var gTimer0="";
var gTimer1="";
var gTimer2="";
var gTimer3="";

function pulldown(num){
	clearTimer(num);
	safariPullup(num);
	pulldownLayer="submenu"+num;
	theLayer="g"+num;
	foreLayer="g"+num+"a";
	theImage="../images/0"+num+"_pic_1.gif";
	foreImage="../images/0"+num+"_txt_1.gif";
	if(document.all){
		document.all(pulldownLayer).style.visibility = "visible";
		document.all(theLayer).style.backgroundImage = "url("+theImage+")";
		document.all(foreLayer).style.backgroundImage = "url("+foreImage+")";
	}else if(document.getElementById){	
		document.getElementById(pulldownLayer).style.visibility = "visible";
		document.getElementById(theLayer).style.backgroundImage = "url("+theImage+")";
		document.getElementById(foreLayer).style.backgroundImage = "url("+foreImage+")";
	}else if(document.layers){
		document.pulldownLayer.visibility = "show";		
		document.theLayer.backgroundImage = "url("+theImage+")";
		document.foreLayer.backgroundImage = "url("+foreImage+")";
	}else{
		document.pulldownLayer.style.display="block";		
		document.theLayer.style.backgroundImage = "url("+theImage+")";
		document.foreLayer.style.backgroundImage = "url("+foreImage+")";
	}
}

function pullup(num){
	clearTimer(num);
	pullupLayer="submenu"+num;
	theLayer="g"+num;
	foreLayer="g"+num+"a";
	theImage="../images/0"+num+"_pic_2.gif";
	foreImage="../images/0"+num+"_txt_2.gif";
	if(document.all){
		document.all(pullupLayer).style.visibility = "hidden";
		document.all(theLayer).style.backgroundImage = "url("+theImage+")";
		document.all(foreLayer).style.backgroundImage = "url("+foreImage+")";
	}else if(document.getElementById){
		document.getElementById(pullupLayer).style.visibility = "hidden";		
		document.getElementById(theLayer).style.backgroundImage = "url("+theImage+")";
		document.getElementById(foreLayer).style.backgroundImage = "url("+foreImage+")";
	}else if(document.layers){
		document.pullupLayer.visibility = "hide";
		document.theLayer.backgroundImage = "url("+theImage+")";
		document.foreLayer.backgroundImage = "url("+foreImage+")";
	}else{
		document.pullupLayer.style.display="none";
		document.theLayer.style.backgroundImage = "url("+theImage+")";
		document.foreLayer.style.backgroundImage = "url("+foreImage+")";
	}
}

function hideTimer(num){
	if(num==0){
		gTimer0=setTimeout("pullup(0);",1000);
	}else if(num==1){
		gTimer1=setTimeout("pullup(1);",1000);
	}else if(num==2){
		gTimer2=setTimeout("pullup(2);",1000);
	}else if(num==3){
		gTimer3=setTimeout("pullup(3);",1000);
	}
}

function safariPullup(num){
	if(navigator.userAgent.indexOf("Safari")!=-1){
		if(num==0){
			pullup(1);
			pullup(2);
			pullup(3);
		}else if(num==1){
			pullup(0);
			pullup(2);
			pullup(3);
		}else if(num==2){
			pullup(0);
			pullup(1);
			pullup(3);
		}else if(num==3){
			pullup(0);
			pullup(1);
			pullup(2);
		}else if(5){
			pullup(0);
			pullup(1);
			pullup(2);
			pullup(3);
		}
	}else{
	}
}



function clearTimer(num){
	if(num==0){
		clearTimeout(gTimer0);
	}else if(num==1){
		clearTimeout(gTimer1);
	}else if(num==2){
		clearTimeout(gTimer2);
	}else if(num==3){
		clearTimeout(gTimer3);
	}
}