
var timeout         = 600;
var closetimer		= 0;
var ddmenuitem      = 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';
	
	
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
 	{
  
		if (document.getElementById("regal")) {

			document.getElementById('regal').style.zIndex = -1;
		
		}
		if (document.getElementById("contentbox")) {

			document.getElementById('contentbox').style.zIndex = -1;
		
		}
		document.getElementById(id).style.zIndex = 1000;
	
	
	 }
	else {
  
	document.getElementById('regal').style.zIndex = 1;
	document.getElementById(id).style.zIndex = 1000;
	
	}

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
 	{
  
		if (document.getElementById("regal")) {

			document.getElementById('regal').style.zIndex = 1;
		
		}
		if (document.getElementById("contentbox")) {

			document.getElementById('contentbox').style.zIndex = 1;
		
		}
	
	
	 }
	else {
  
	document.getElementById('regal').style.zIndex = 1;
	document.getElementById(id).style.zIndex = 1000;
	
	}
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

function show_button(id) 
{
	//document.getElementById(id).style.visibility='visible';
	document.getElementById(id).src='img/cover/'+id+'_hover.jpg';
}

function hide_button(id) 
{
	//document.getElementById(id).style.visibility='hidden';
	document.getElementById(id).src='img/cover/'+id+'.jpg';
}
// close layer when click-out
document.onclick = mclose; 



function setLayer()
{
document.getElementbyID("header2").setStyle(z-index,1000);
}
