var DOM=(document.getElementById)?true:false
var NN4=(document.layers)?true:false
var IE4=(!DOM&&document.all)?true:false
var delay
var shown=false
var tlEnd
var olink

function writeTopLayerStart (x,y,w,h,name,addstyle) {
//
if (NN4) {
	line="<layer name="+name+" left="+x+" top="+y+" visibility=hide z-index=1 width="+w+" clip='"+w+","+h+"' "+addstyle+" onmouseover=\"checkMode('show')\" onmouseout=\"checkMode()\">";
        tlEnd="</layer>";
} else {
	line="<div id="+name+" style='LEFT: "+x+"px; TOP: "+y+"px; WIDTH: "+w+"px; HEIGHT: "+h+"px; POSITION: absolute;  Z-INDEX: 1; VISIBILITY: hidden; "+addstyle+"' onmouseover=\"checkMode('show')\" onmouseout=\"checkMode()\">";
        tlEnd="</div>";
}
document.write(line);
}

function procMenu (event, objNum){
var obj="menu"+objNum;
var olink="mm"+objNum;
//alert("procMenu=["+obj+"]");
switch (event.type){
case 'mouseover' : clearTimeout(delay); show(objNum); break;
case 'mouseout' : shown=false; delay=setTimeout('hideAll()',750); break;
}
}

function show(objNum) {
var obj="menu"+objNum;
var olink="mm"+objNum;
//alert("show=["+obj+"]");
shown=true;
hideAll();
/*
aObj = document.getElementById('menu2').getElementsByTagName('a');
document.all[obj].setAttribute("class", "active");
aObj.setAttribute("Tmenu", "hover");

if (DOM) eval("document.getElementById(obj).style.visibility = 'visible'");
if (IE4) eval("document.all[obj].style.visibility = 'visible'");
if (NN4) eval("document.layers['"+obj+"'].visibility = 'show'");
*/
document.getElementById(olink).className='TmenuHover';
if (DOM) {document.getElementById(obj).style.visibility='visible';}
if (IE4) {document.all[obj].style.visibility='visible';}
if (NN4) {document.layers[obj].visibility='show';}
shown=true;
}

function checkMode(mode){
if(mode=='show') clearTimeout(delay);
else delay=setTimeout('hideAll()',250);
}

function hideAll() {
for (st=1;st<=menusNum;st++) {
	obj="menu"+st;
	olink="mm"+st;
	if (DOM) eval("document.getElementById(obj).style.visibility = 'hidden'");
	if (IE4) eval("document.all[obj].style.visibility = 'hidden'");
	if (NN4) eval("document.layers['"+obj+"'].visibility = 'hide'");
eval("document.getElementById('"+olink+"').className='Tmenu';");
	}     
shown=false;
return true
}

function checkSize() {
if (defW!=document.width||defH!=document.height) location.reload()
}

function getSize() {
defW=document.width
defH=document.height
}

if(NN4) {
onResize=checkSize
onLoad=getSize
}

function MM_reloadPage(init) {
if (init==true) with (navigator) {
if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; 
document.MM_pgH=innerHeight; 
onresize=MM_reloadPage; 
}
}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);	
