var arrowimages = { down: ['menuarrow', '/Include/UserControls/Navbar/images/down-arrow.gif', '/Include/UserControls/Navbar/images/gray-down-arrow.gif', '/Include/UserControls/Navbar/images/sprite_tab_left_bg.gif', '/Include/UserControls/Navbar/images/sprite_tab_right_without_arrow_bg.gif', '/Include/UserControls/Navbar/images/go_btn.jpg', '/Include/UserControls/Navbar/images/go_on_btn.jpg'] } var menu_section = { fadingsettings: { overduration: 350, outduration: 100 }, //duration of fade in/ out animation, in milliseconds constructmenu: function(menuid, arrowsvar) { jQuery(document).ready(function($) { var $parentmenu = $("#" + menuid + ">ul"); var $headers = $parentmenu.find("ul").parent(); //searching for sub menu's $headers.each(function(i) { var $curobj = $(this); var $sublist_ul = $(this).find('ul.sublevel'); this.htmldimensions = { w: this.offsetWidth, h: this.offsetHeight, subulw: $sublist_ul.outerWidth(), subulh: $sublist_ul.outerHeight() }; this.istopheader = $curobj.parents("ul").length == 1 ? true : false; $sublist_ul.css({ top: this.htmldimensions.h + "px"}); $curobj.children("a:first").append(''); $curobj.hover( function(e) { $(this).children("ul.sublevel:first").css({ left: '0px' }).fadeIn(menu_section.fadingsettings.overduration); $curobj.children("a:first").css({ backgroundPosition: '0% -29px' }).find('span:first').css({ backgroundPosition: '100% -29px' }); if ($(this).attr("class") == "active_tab_without_arrow") { $("ul.parentmenulist>li[@class='active_tab_without_arrow'] .menuarrow").attr("src", arrowsvar.down[1]); $("ul.parentmenulist>li[@class='active_tab_without_arrow']>a").css('background-image', 'url(' + arrowsvar.down[3] + ')').css({ backgroundPosition: '0% -29px', color: '#7e7f82' }); $("ul.parentmenulist>li[@class='active_tab_without_arrow']>a>span").css('background-image', 'url(' + arrowsvar.down[4] + ')').css({ backgroundPosition: '100% -29px', color: '#ffffff' }); } }, function(e) { $curobj.children("a:first").css({ backgroundPosition: '0% 0' }).find('span:first').css({ backgroundPosition: '100% 0' }); $(this).children('ul.sublevel:first').fadeOut(menu_section.fadingsettings.outduration); if ($(this).attr("class") == "active_tab_without_arrow") { $("ul.parentmenulist>li[@class='active_tab_without_arrow'] .menuarrow").attr("src", arrowsvar.down[2]); $("ul.parentmenulist>li[@class='active_tab_without_arrow']>a").css('background-image', 'url(' + arrowsvar.down[3] + ')').css({ backgroundPosition: '0% -58px', color: '#7e7f82' }); $("ul.parentmenulist>li[@class='active_tab_without_arrow']>a>span").css('background-image', 'url(' + arrowsvar.down[4] + ')').css({ backgroundPosition: '100% -58px', color: '#7e7f82' }); } } ) //end hover }) //end $headers.each() $parentmenu.find("ul.sublevel").css({ display: 'none', visibility: 'visible', 'z-index':1000 }) $(".menu_section li.active_tab_without_arrow img").attr("src", arrowsvar.down[2]); //If Active, then change the arrow img to gray //Search functionality $('.search_text_box').each(function() { var default_value = this.value; $(this).focus(function() { if (this.value == default_value) { this.value = ''; } }); $(this).blur(function() { if (this.value == '') { this.value = default_value; } }); }); //Iframe Background Integration for <= IE6.0 browsers jQuery.each(jQuery.browser, function(i) { if ($.browser.msie && $.browser.version <= "6.0") { $('.sublevel').bgiframe(); } }); //Search Button mouseover $(".image").hover(function(e) { $(this).attr('src', arrowsvar.down[6]); }, function(e) { $(this).attr('src', arrowsvar.down[5]); }); }) //end document.ready } }