function open_window(link,w,h) {
	var win = "width="+w+",height=650,menubar=no,location=no,resizable=no,scrollbars=yes";
	newWin = window.open('/'+link,'newWin',win);
}

function WindowPos(mypage,myname,wW,wH,scroll){

	var wW = (!wW)? 100 : wW;
	var wH = (!wH)? 100 : wH;

	if ( navigator.appName == "Netscape") { 
		var winl = (screen.width - wW)/ 2 ;
		var wint = (screen.height - wH)/ 2 ;
		wW = wW +20;
	} else {
		winl = (screen.width) ? (screen.width-wW)/2 : 0;
		wint = (screen.height) ? (screen.height-wH)/2 : 0;
	}	
	
	var winprops = navigator.appName == "Netscape" ? 'height='+wH+',width='+wW+',top='+wint+',left='+winl+',toolbar=no,'+'location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=yes' : 'height='+wH+',width='+wW+',top='+wint+',left='+winl+',toolbar=no,'+'location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=yes';
	

	win = window.open(mypage,myname,winprops);
	if (parseInt(navigator.appVersion) >= 4)
		win.window.focus();
}

 
var currentLayer = null;
var currentLayerNum = 0;
var noClose = 0;
var closeTimer = null;
var bTranState = 0;

function mopen(n){
  var vl = document.getElementById("menu"+n);
 
  if(bTranState){

 	vl.style.visibility='hidden';
	currentLayerNum = 0;
	currentLayer = null;
	currentLayerNum = 0;
	bTranState = 0;
  }else {
	bTranState = 0; 
	mcancelclosetime();
	if(currentLayer && (currentLayerNum != n))currentLayer.style.visibility='hidden';
	currentLayer = vl;
	currentLayerNum = n;	
	vl.style.visibility='visible';
 

  }

				
}

function mclosetime(){
  closeTimer = window.setTimeout(mclose, 700);
}
	
function mcancelclosetime(){

if(closeTimer){
	window.clearTimeout(closeTimer);
	closeTimer = null;
}
					
}
	
function mclose(){

if(currentLayer && noClose!=1){
  currentLayer.style.visibility='hidden';
  currentLayerNum = 0;
  currentLayer = null;
}else{noClose = 0;}

  currentLayer = null;
	
}
	
document.onclick = mclose;

