﻿$(document).ready(function() {
    function megaHoverOver() {
        $(this).find(".sub").stop().fadeTo('fast', 1).show();
    }

    function megaHoverOut() {
        $(this).find(".sub").stop().fadeTo('fast', 0, function() {
            $(this).hide();
        });
    }

    var config = {
        sensitivity: 1, // number = sensitivity threshold (must be 1 or higher)    
        interval: 100, // number = milliseconds for onMouseOver polling interval    
        over: megaHoverOver, // function = onMouseOver callback (REQUIRED)    
        timeout: 400, // number = milliseconds delay before onMouseOut    
        out: megaHoverOut // function = onMouseOut callback (REQUIRED)    
    };

    $("ul#menuStripList li .sub").css({ 'opacity': '0' });
    $("ul#menuStripList li").hoverIntent(config);
});

// Fixes ZOrder issues in ie6 & 7
function FixZOrderBug() {
    var isIE6 = navigator.userAgent.toLowerCase().indexOf('msie 6') != -1;
    var isIE7 = navigator.userAgent.toLowerCase().indexOf('msie 7') != -1;

    if (isIE6 || isIE7) {
        $(function() {
            var zIndexNumber = 1000;
            $('div').each(function() {
                $(this).css('zIndex', zIndexNumber);
                zIndexNumber -= 10;
            });
        });
    }
}