var popup = $(".menu .menu_6");
var bigSubPopup = $(".Popup");
var setIDIn;
var setIDOut;

popup.hover (
	function () {
		clearTimeout(setIDOut);
		setIDIn = setTimeout(function(){
			$(".menu_6 a").css("background-position","0px -36px")
			$(".Popup").stop(false,true).slideDown(500);
			$(".Mask").height($('body').height()).stop(true,true).fadeTo(500,0.5);
		},200);
	},
	function () {
		clearTimeout(setIDIn);
		
		setIDOut = setTimeout(function(){
		
			$(".menu_6 a").css("background-position","0px 0px")
			$(".Popup").stop(false,true).slideUp(500);
			$(".Mask").stop(true,true).fadeTo(500,0,function(){
				$(".Mask").hide();
			});
		},200);
	}
);

bigSubPopup.hover(function(){
	clearTimeout(setIDOut);
	},function(){
		setIDOut = setTimeout(function(){
			$(".menu_6 a").css("background-position","0px 0px")
			$(".Popup").stop(false,true).slideUp(500);
			$(".Mask").stop(true,true).fadeTo(500,0,function(){
				$(".Mask").hide();
			});
		},200);
	});

/*popup.mouseover(function(){
	$(".menu_6 a").css("background-position","0px 0px")
	$(".Popup").stop(false,true).slideDown(500);
	$(".Mask").height($('body').height()).stop(true,true).fadeTo(500,0.5);
	});
popup_other.mouseover(function(){
	$(".menu_6 a").css("background-position","0px -34px")
	$(".Popup").stop(false,true).slideUp(500);
	$(".Mask").stop(true,true).fadeTo(500,0,function(){
		$(".Mask").hide();
		});	
});*/

/*   ==========================================================================   */
$(".language").hover (
	function () {
		$(".label").css("zIndex","10");
		$(".language_list").show();
	},
	function () {
		$(".label").css("zIndex","0");
		$(".language_list").hide();
	}
);

/*   ==========================================================================   */

var second = $(".menu li[class*='second']");
var second_list = $(".second_list");
second.each(function(i){
	$(this).attr('rel',i);
});
second.hover (
	function(){
		var i = $(this).attr("rel");
		//$(this).addClass("now");
		second_list.eq(i).show();
		//alert (0);
		//var i = $(this).index();
		//$(".menu li[class*='second']").find(".second_list").show();
	},
	function(){
		var i = $(this).attr("rel");
		second_list.eq(i).hide();
		//alert (1);
		//var i = $(this).index();
		//$(this).find("div").eq(i).hide();
	}
);

/*$(".menu_2").hover (
	function(){
		$(".menu_2_list").show();
	},
	function(){
		$(".menu_2_list").hide();
	}
);
$(".menu_4").hover (
	function(){
		$(".menu_4_list").show();
	},
	function(){
		$(".menu_4_list").hide();
	}
);
$(".menu_7").hover (
	function(){
		$(".menu_7_list").show();
	},
	function(){
		$(".menu_7_list").hide();
	}
);
$(".menu_8").hover (
	function(){
		$(".menu_8_list").show();
	},
	function(){
		$(".menu_8_list").hide();
	}
);*/

//
/*function makeShort(_selector){
		// $(_selector).animate({height:'hide'},{duration:300, queue: false});
		$(_selector).hide();
	}
function makeTall(_selector){
		 //$(_selector).animate({height:'hide'},{duration:300, queue: false});
		 $(_selector).show();
	}
	
	$(".menu_42222").hoverIntent(	{    
		 sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)
		 interval: 100, // number = milliseconds for onMouseOver polling interval
		 over: function(){makeTall('.menu_4_list')}, // function = onMouseOver callback (REQUIRED)
		 timeout: 500, // number = milliseconds delay before onMouseOut
		 out: function(){makeShort('.menu_4_list')} // function = onMouseOut callback (REQUIRED)
	 });*/
