// JavaScript Document
//document.lastID = 0;

$(document).ready(function(){
window.killEvent = false;
rolloutTimer='';
	$("#N0").mouseenter(function () {
		if (window.dropShowing == true){
		if (rolloutTimer){clearTimeout(rolloutTimer);}
		rolloutTimer=setTimeout("drop('#N0','D0');", 100);
		}else{
		drop('#N0','D0');

		}
		
	});
	$("#N1").mouseenter(function () {
		if (window.dropShowing == true){
		if (rolloutTimer){clearTimeout(rolloutTimer);}
		rolloutTimer=setTimeout("drop('#N1','D1');", 100);
		}else{
		drop('#N1','D1');

		}
		
	});
	
	$("#N2").mouseenter(function () {
		if (window.dropShowing == true){
		if (rolloutTimer){clearTimeout(rolloutTimer);}
		rolloutTimer=setTimeout("drop('#N2','D2');", 100);
		}else{
		drop('#N2','D2');

		}
		
	});
	
	$("#N3").mouseenter(function () {
		if (window.dropShowing == true){
		if (rolloutTimer){clearTimeout(rolloutTimer);}
		rolloutTimer=setTimeout("drop('#N3','D3');", 100);
		}else{
		drop('#N3','D3');

		}
		
	});
	$("#N4").mouseenter(function () {
		if (window.dropShowing == true){
		if (rolloutTimer){clearTimeout(rolloutTimer);}
		rolloutTimer=setTimeout("drop('#N4','D4');", 100);
		}else{
		drop('#N4','D4');

	}
	
	});
	$("#N5").mouseenter(function () {

		if (window.dropShowing == true){
		if (rolloutTimer){clearTimeout(rolloutTimer);}
		rolloutTimer=setTimeout("drop('#N5','D5');", 100);
		}else{
		drop('#N5','D5');

		}
		
	});
});
function drop(id,subId) {

$(window.currentSection).removeClass("hover");
window.currentSection = id;
$(id).addClass("hover");
	window.dropShowing = true;
	var itemOffset = $(id).offset();
	var itemH = $(id).height();
	var itemW = $(id).width();
	
	$("select").css("visibility","hidden");
	$("#buttonBlock").show();
	
		if(document.lastId != undefined){
			document.getElementById(document.lastId).style.display="none";
		}
	
	document.lastId=subId;
    $("#menuDropDown").show();
	document.getElementById(subId).style.display="block";
	 $("this a").css("background","url(images/nav_over.gif) repeat-x left");
	 $("this a").css("color","#fff");
	 $("this span").css("background","url(images/nav_div_selected.gif) no-repeat right");
	 
	$("#buttonBlock").mouseenter(function () {
	$(id).removeClass("hover");
	$("#menuDropDown").hide();
	$("#buttonBlock").hide();
	$("select").css("visibility","visible");
	window.dropShowing = false;

	
	
	
	});

	
	$("#menuDropDown").mouseenter(function(){
		window.killEvent = true;
		if (rolloutTimer){clearTimeout(rolloutTimer);}
	});
	
	$("#menuDropDown").mouseleave(function () {
	

	
	
	if (rolloutTimer != undefined){clearTimeout(rolloutTimer);}
	window.dropShowing = false;
	document.getElementById(subId).style.display="none";
      $("#menuDropDown").hide();
	  $("select").css("visibility","visible");
	 
    });


}