var agnt=navigator.userAgent,bIsIE=agnt.indexOf("MSIE")>-1,bIsMac=agnt.indexOf("Macintosh")>-1 || agnt.indexOf("PowerPC")>-1 || agnt.indexOf("PPC")>-1,bIsMz=agnt.indexOf("Mozilla/")>-1,bIsWin=agnt.indexOf("Windows")>-1,M=window;
var mnuAct=null,mnuEvt=null,mnuNav=null,splash=false;vCnt=0,vMsg="",vObj=null;

if(bIsIE)var ieVer=parseFloat(agnt.substring(agnt.indexOf("MSIE")+4,agnt.length-1)),nsVer=0;else if(bIsMz)var ieVer=0,nsVer=parseFloat(agnt.substring(agnt.indexOf("Mozilla/")+8,agnt.length-1));
else var ieVer=0,nsVer=0;

function clsDlg()
{
	setTimeout("window.close()",10);
}

function clkImg(url,w,h)
{
	window.open(url,"_blank","height="+h+",width="+w);
}

function clkNws(pg)
{
	window.location.href='/news/'+pg+'.html';
}

function clkSrchTechLib()
{
	document.frm.action="/mod/techLib/search.html?m=1";document.frm.submit();
}

function fo(nm)
{
	return document.frm.elements[nm];
}

function go(url)
{
	if(mnuAct!=null)
	{
		if(mnuEvt!=null)clearTimeout(mnuEvt);
		if(splash)splMnuOff2();
		else mnuOff2();
	}
	window.location.href=url;
}

function hd(o)
{
	var i,oa=o.split(",");
	for(i=0;i<oa.length;i++)document.getElementById(oa[i]).style.visibility="hidden";
}

function kyCrtTechLib(e)
{
	if(e.keyCode==13)clkSrchTechLib();
}

function mnuOff()
{
	mnuEvt=setTimeout("mnuOff2();",200);
}

function mnuOff2()
{
	mnuEvt=null;
	if(mnuNav!=null)
	{
		setBgCol(mnuNav.parentNode,'transparent');
		setFntCol(mnuNav,'#666666');
		hd("mnu"+mnuAct);
		mnuAct=null;
		mnuNav=null;
	}
}

function mnuOn(o,m)
{
	if(mnuEvt!=null)
	{
		clearTimeout(mnuEvt);
		mnuEvt=null;
		if(mnuAct==m)return;
		else mnuOff2();
	}
	mnuNav=o;mnuAct=m;
	setBgCol(o.parentNode,'#7E98B8');
	setFntCol(o,'white');
	vis("mnu"+m);
}

function mnuOut(e)
{
	var o=bIsIE?event.srcElement:e.target;
	if(o.nodeName=="TD"||o.nodeName=="#text")
	{
		if(o.nodeName=="#text")o=o.parentNode;
		setBgFntCol(o,"transparent","#333333");
	}
	mnuOff();
}

function mnuOvr(e)
{
	var o=bIsIE?event.srcElement:e.target;
	if(mnuEvt!=null)
	{
		clearTimeout(mnuEvt);
		mnuEvt=null;
	}
	if(o.nodeName=="TD"||o.nodeName=="#text")
	{
		if(o.nodeName=="#text")o=o.parentNode;
		setBgFntCol(o,"#0062C8","white");
	}
}

function objWin()
{
	if(bIsIE)
	{
		this.h=document.body.offsetHeight;
		this.w=document.body.offsetWidth;
	}
	else
	{
		this.h=window.innerHeight;
		this.w=window.innerWidth;
	}
}

function rsz(o,w,h)
{
	if(w!=null)document.getElementById(o).style.width=w+"px";
	if(h!=null)document.getElementById(o).style.height=h+"px";
}

function rnd()
{
	return Math.random();
}

function setBgCol(o,c)
{
	o.style.backgroundColor=c;
}

function setBgFntCol(o,c1,c2)
{
	setBgCol(o,c1);setFntCol(o,c2);
}

function setFntCol(o,c)
{
	o.style.color=c;
}

function splMnuOff()
{
	mnuEvt=setTimeout("splMnuOff2();",200);
}

function splMnuOff2()
{
	mnuEvt=null;
	if(mnuNav!=null)
	{
		setBgCol(mnuNav,'#7E98B8');
		hd("mnu"+mnuAct);
		mnuAct=null;
		mnuNav=null;
	}
}

function splMnuOn(o,m)
{
	if(mnuEvt!=null)
	{
		clearTimeout(mnuEvt);
		mnuEvt=null;
		if(mnuAct==m)return;
		else splMnuOff2();
	}
	mnuNav=o;
	mnuAct=m;
	setBgCol(o,'#FFBE31');
	vis("mnu"+m);
}

function splMnuOut(e)
{
	var o=bIsIE?event.srcElement:e.target;
	if(o.nodeName=="TD"||o.nodeName=="#text")
	{
		if(o.nodeName=="#text")o=o.parentNode;
		setBgFntCol(o,"#CECFFF","#CECFFF");
	}
	splMnuOff();
}

function splMnuOvr(e)
{
	var o=bIsIE?event.srcElement:e.target;
	if(mnuEvt!=null)
	{
		clearTimeout(mnuEvt);
		mnuEvt=null;
	}
	if(o.nodeName=="TD"||o.nodeName=="#text")
	{
		if(o.nodeName=="#text")o=o.parentNode;
		setBgFntCol(o,"#CECFFF","white");
	}
}

function vChk(o,b,msg)
{
	if(b){vCnt++;
	if(vObj==null)vObj=o;
	if(vMsg!="")vMsg+="\n";
	vMsg+="   "+vCnt+". "+msg;
	}
}

function vErr()
{
	if(vCnt>0)
	{
		alert("The following information is incorrect or missing:\n\n"+vMsg);
		vCnt=0;
		vMsg="";
		vObj.focus();
		return false;
	}
	else return true;
}

function vis(o)
{
	var i,oa=o.split(",");
	for(i=0;i<oa.length;i++)document.getElementById(oa[i]).style.visibility="visible";
}

function _s()
{
	var win=new objWin(),h=win.h,w=win.w;
	rsz("contentSz",null,h-160);
	if(bIsIE&&bIsWin)
	{
		document.getElementById("fred").style.tableLayout="fixed";
		if(h>530)
			{
			document.getElementById("contents").style.overflow="auto";
			rsz("contents",w-196,h-160);
			}
		else document.getElementById("contents").style.overflow="visible";
	}
}

function _wol()
{
	_s();
	vis("fred");
	if(typeof(wol)=="function")wol();
}