
var TimeOut         = 300;
var currentLayer    = null;
var currentitem     = null;
var currentLayerNum = 0;
var noClose         = 0;
var closeTimer      = null;
var z_index_navi    = 100;

function mopen(n) {
  var l  = document.getElementById("menu"+n);
  var mm = document.getElementById("mmenu"+n);
	
  if(l) {
    mcancelclosetime();
    l.style.visibility='visible';
	l.style.zIndex= z_index_navi;
    if(currentLayer && (currentLayerNum != n))
      currentLayer.style.visibility='hidden';
    currentLayer = l;
    currentitem = mm;
    currentLayerNum = n;			
  } else if(currentLayer) {
    currentLayer.style.visibility='hidden';
    currentLayerNum = 0;
    currentitem = null;
    currentLayer = null;
 	}
}

function mclosetime() {
  closeTimer = window.setTimeout(mclose, TimeOut);
}

function mcancelclosetime() {
  if(closeTimer) {
    window.clearTimeout(closeTimer);
    closeTimer = null;
  }
}

function mclose() {
  if(currentLayer && noClose!=1)   {
    currentLayer.style.visibility='hidden';
    currentLayerNum = 0;
    currentLayer = null;
    currentitem = null;
	z_index_navi = z_index_navi + 1;
  } else {
    noClose = 0;
  }
  currentLayer = null;
  currentitem = null;
}

document.onclick = mclose; 

function embedFlash(url, w, h) {
	document.write('<object width=' + w + ' height=' + h + ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0">');
	document.write('<param name="movie" value="' + url + '">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<embed src="' + url + '" width=' + w + ' height=' + h + ' quality="high" wmode="transparent" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" TYPE="application/x-shockwave-flash"></embed>');
	document.write('</object><br>');
}

function embedFlash2(url, w, h) {
	document.write('<object width=' + w + ' height=' + h + ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0">');
	document.write('<param name="movie" value="' + url + '">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="bgcolor" value="#333333" >');
	document.write('<embed src="' + url + '" width=' + w + ' height=' + h + ' quality="high" bgcolor="#333333" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" TYPE="application/x-shockwave-flash"></embed>');
	document.write('</object><br>');
}

function closeWin() { 
window.close(); 
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function openBox() { 
document.getElementById('box_warning').style.display = 'block';
}

function openBox2() { 
document.getElementById('box_warning2').style.display = 'block';
}
       
