﻿function initializeGlobalNavigation() {
    $j("#global-nav").children().each(function(i) {
        var li = $j(this);
        var a = li.find("a");
        var ul = li.find("ul");

        li.mouseenter(function(event) {
            ul.removeClass("hidden");
            li.addClass("hover");
        });

        li.mouseleave(function(event) {
            ul.addClass("hidden");
            li.removeClass("hover");
        });
    });
}

var hasFlash = false;
var playerVersion = swfobject.getFlashPlayerVersion(); // returns a JavaScript object
if (playerVersion.major != null) {
    hasFlash = true;
    if (Get_Cookie("flashVersion")) {
    }
    else
    {
    setCookie("flashVersion", playerVersion.major, 1);
    }
}
 if (Get_Cookie("flash")) {
    }
    else
    {
setCookie("flash", hasFlash, 1);
}

function setCookie(c_name, value, exdays) {
    Delete_Cookie(c_name, '/', '');
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + exdate);
    var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
    document.cookie = c_name + "=" + c_value;
}

function Delete_Cookie(name, path, domain) {
    if (Get_Cookie(name)) document.cookie = name + "=" +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}


function Get_Cookie(name) {

    var start = document.cookie.indexOf(name + "=");
    var len = start + name.length + 1;
    if ((!start) &&
(name != document.cookie.substring(0, name.length))) {
        return null;
    }
    if (start == -1) return null;
    var end = document.cookie.indexOf(";", len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len, end));
}


$j(document).ready(function () {
    if ($j.browser.msie) {
        if ($j.browser.version >= 7.0)
            $j(".promodiv").addClass("ie9fixpromo");

    }
});

