﻿///<Reference path="/_js/jQuery/1.4.1/jquery-1.4.1-vsdoc.js" />

//to remove the weird "fade out grab" glitch, just make it display:none after that .animate line.  ie .css("display","none") right under .animate.
j$(document).ready(function () {
    j$("#header ul.topnav li.ruler").hover(function () {
        //swap the background
        j$(this).children("a.big").first().css("background", "url('/_images/template/global/menuHover.png') repeat-x");

        //hide the vertical bars
        //j$(this).siblings("li.bar").css("visibility", "hidden");


        //IE7 Popup z-index bug
        var zIndexNumber = 10000;
        // Put your target element(s) in the selector below!
        j$(this).children("a").each(function () {
            j$(this).css('zIndex', zIndexNumber);
            zIndexNumber -= 10;
        });

        j$(this).find("div.dropdown").stop()
                .animate({ opacity: 1 }, "fast")
                .css("display", "block")
                .css("position", "relative");
    }, function () {
        j$(this).children("a.big").first().css("background", "none");
        j$(this).find("div.dropdown").stop()
        .animate({ opacity: 0 }, "fast", "swing", function () { j$(this).css("display", "none") });

        //show the bars again
        //j$(this).siblings("li.bar").css("visibility", "visible");
    });

    /*IE8 anti-css fail-safe glitch*/
    j$("ul.topnav li.ruler div.dropdown ul li a").hover(function () {
        j$(this).addClass(":hover");
    }, function () {
        j$(this).removeClass(":hover");
    });
});
