﻿//popup method
$.popup = function (formid, closeSelectors) {
    var $overlay = $j('<div id="overlay" />').hide().appendTo('body');
    $form = $j(formid).appendTo($overlay);
    $close = $j(closeSelectors, $form),
		    $doc = $j(document);
    $overlay.show();
    //$form.show();
    $doc.keyup(function (e) {
        if (e.keyCode == 27) { // Esc
            $close.click();
            $doc.unbind('keyup');
        }
    });
    $close.click(function (e) {
        e.preventDefault();
        $form.hide();
        $overlay.hide();
    });
};

var $j = jQuery.noConflict();

$j(document).ready(function () {
    jQuery('ul.sf-menu').superfish();
    $j('.LanguageSelect').hoverIntent(function () {
        $j('ul', this).slideDown(100);
        $j(this).css("background", "url(/site_images/LanguageList_BG.gif) #fff bottom left no-repeat");
    }, function () {
        $j('ul', this).slideUp(100);
        $j(this).css("background", "#fff");
    });
    $j('ul.#nav').superfish({
        delay: 20,
        speed: 'fast',                          // faster animation speed 
        autoArrows: false,                           // disable generation of arrow mark-up 
        dropShadows: true                            // disable drop shadows 
    });
    $j('#PI_UL_Right li').hoverIntent(function () {
        $j('ul', this).slideDown(300);
    }, function () {
        $j('ul', this).slideUp(150);
    });
});
Shadowbox.init();
