
// Preload Background Images in Dropdown Menu
//preload( '../images/design/menu_dropdown_bg_hover.png', '../images/design/menu_dropdown_bg.png' );

var nav_dropdown_active = 0;

var nav_1_timer;
function hideNav1 () {
	$('#top_navi_1').parent().find('ul.subnav').hide();
};

var nav_4_timer;
function hideNav4 () {
	$('#top_navi_4').parent().find('ul.subnav_small').hide();
};

$( function() {
	
	// IE6 Select z-index Fix
	$('.site-header ul.navigation li ul').bgiframe();
	
	$('.site-header ul.navigation li ul').css('display', 'none');
	
	$('#top_navi_1').hover( function() {
		$('#top_navi_4').parent().find('ul.subnav_small').stop(true,true).hide();
		clearTimeout( nav_1_timer );
		$(this).parent().find("ul.subnav").slideDown(400).show();
		$(this).parent().hover( function () {
			clearTimeout( nav_1_timer );
			$('#top_navi_4').parent().find('ul.subnav_small').hide();
		}, function () {
			clearTimeout( nav_1_timer );
			nav_1_timer = setTimeout( "hideNav1()", 800 );
		});
	});
	
	$('#top_navi_4').hover( function() {
		nav_dropdown_active = 4;
		$('#top_navi_1').parent().find('ul.subnav').stop(true,true).hide();
		clearTimeout( nav_4_timer );
		$(this).parent().find("ul.subnav_small").slideDown(400).show();
		$(this).parent().hover( function () {
			$('#top_navi_1').parent().find('ul.subnav').hide();
			clearTimeout( nav_4_timer );
		}, function () {
			clearTimeout( nav_4_timer );
			nav_4_timer = setTimeout( "hideNav4()", 800 );
		});
	});
	
	// Hide on Nav_2, Nav_3
/*	$('#top_navi_2').hover( function() {
		$('#top_navi_1').parent().find('ul.subnav').hide();
		$('#top_navi_4').parent().find('ul.subnav_small').hide();
	});
	$('#top_navi_3').hover( function() {
		$('#top_navi_1').parent().find('ul.subnav').hide();
		$('#top_navi_4').parent().find('ul.subnav_small').hide();
	}); */
	
});
