// JavaScript Document
$(document).ready(function(){
	if($.browser.msie){
		if($.browser.version < 7){
			$(".ulsubmenu").each(function(){
				var pos  = $(this).parent().position();
				$(this).css({"left":pos.left,"top":"125px"});
			});
		}
		$("#kitstock").ready(function(){
			$("#kitbody").css({"height":"0px"})
		});
		$(".TableContainer").css({"height":$(window).height()-250});
	}
	$(".haschild").hover(function(event){
		if($.browser.msie && $.browser.version < 7){
			$(this).removeClass("menu_top").addClass("menu_top_active");
		}
		$(".ulsubmenu").each(function(){
			$(this).slideUp("fast");
		});
		if($(this).children(".ulsubmenu").css("display") == "none"){
			$(this).children(".ulsubmenu").slideDown("fast");	
		}

				
	},function(event){
		if($.browser.msie && $.browser.version < 7){
			$(this).removeClass("menu_top_active").addClass("menu_top");
		}
	});
	$("#haschild").mouseout(function(){
		
	});
	$(".menu_top").mouseover(function(event){
		if($(this).attr("id") != "haschild"){
			$(".ulsubmenu").each(function(){
				$(this).slideUp("fast");
			});
		}
		event.stopPropagation();
	});
	$("#PageHead").mouseover(function(event){
		$(".ulsubmenu").each(function(){
			$(this).slideUp("fast");
		});
		event.stopPropagation();
	});
	$(".ulsubmenu").hover(function(event){
		$(this).parent(".haschild").removeClass("menu_top");
		$(this).parent(".haschild").addClass("menu_top_active");
		event.stopPropagation();
	},function(event){
		$(this).parent(".haschild").removeClass("menu_top_active").addClass("menu_top");
		//if($(this).parent().attr("class") == "menu_top"){
			$(this).slideUp("fast");
		//}
		event.stopPropagation();
	});
	$(".submenu").click(function(){
		//alert($(this).children(".submenu a"));
		document.location.href = $(this).children(".submenu a").attr("href");
	});
	$(".menu_top_active").hover(function(event){
		$(".ulsubmenu").each(function(){
			$(this).slideUp("fast");
		});
	});
});

function set_kitstock(){
	if($.browser.msie){
		if(".TableContainer"){
			$(".TableContainer").css({"height":$(window).height()-250});
			if($(window).width() > 980){
				newleft = Math.floor(($(window).width()-783)/2);
				$("#kithead tr").css({"position":"absolute","left":(newleft-9)+"px","top":"193px"});
			}
		}
	}
}