
function loadFunct()
{
// Highlight current page in menu
	TMopen()

// Check for cookies
	checkCookie()

//	verifyFolder()

//	pg=document.getElementById("version")
//	alert(pg.innerText)

}


function getCookie(c_name)
{
	if (document.cookie.length>0)
	{
		c_start=document.cookie.indexOf(c_name + "=")
		if (c_start!=-1)
		{
			c_start=c_start + c_name.length+1
			c_end=document.cookie.indexOf(";",c_start)
			if (c_end==-1) c_end=document.cookie.length
		    return unescape(document.cookie.substring(c_start,c_end))
		}
	}
	return ""
}


function checkCookie()
{
loginEr=getCookie('loginErr')
pwordEr=getCookie('pwordErr')
loginSt=getCookie('lgvalid')
user   =getCookie('usrname')

if (loginEr!=null || loginEr!="none")
	{
		if (loginEr=="password")
// Password error. set display to inline for login-per
		{
			document.getElementById("login-per").style.display = "inline"
		}
		else if (loginEr=="clientid")
// Client ID error. set display to inline for login-cer
		{
			document.getElementById("login-cer").style.display = "inline"
		}
	}

if (pwordEr !=null || pwordEr!="none")
	{
		if (pwordEr == "pwordver")
		{
			document.getElementById("pwver-err1").style.display = "inline"
			document.getElementById("pwver-err2").style.display = "inline"
			document.getElementById("pwver-err3").style.display = "inline"
		}
	}

if (loginSt !=null && loginSt!=1)
	{
//		setCookie(usrname,' ',180)
	}
}


function setCookie(c_name,value,expiredays)
{
	var exdate=new Date()
	exdate.setDate(exdate.getDate()+expiredays)
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : "; expires="+exdate.toGMTString())
}


function TMopen()
{
	var i,x,dmenu,dsub,hr,ha,hb,ef,a,ag,hrsub,hasub,hbsub;

	if(document.getElementById)
	{
 		dmenu=document.getElementById("menu2");
 		if(dmenu)
		{
			hr=window.location.href;
			ha=dmenu.getElementsByTagName("A");
			hb=dmenu.getElementsByTagName("B");

			if(ha&&ha.length)
			{
				for(i=0;i<ha.length;i++)
				{
					if(ha[i].href)
					{
						if(hr.indexOf(ha[i].href)>-1)
						{
							if(hr != ha[i].href)
							{
								hb[i].style.color="#ff6600"
							}
						}
						if(hr.indexOf("services")>-1 && ha[i].href.indexOf("services")>-1)
						{
							hb[i].style.color="#ff6600"
						}
						if(hr == ha[i].href)
						{
							hb[i].style.color="#ff6600"
						}
					}
				}
			}
		}

	 	dsub=document.getElementById("sub-menu");
	 	if(dsub)
		{
			hrsub=window.location.href;
			hasub=dsub.getElementsByTagName("A");
			hbsub=dsub.getElementsByTagName("B");

			if(hasub&&hasub.length)
			{
				for(i=0;i<hasub.length;i++)
				{
					if(hasub[i].href)
					{
						if(hrsub.indexOf(hasub[i].href)>-1)
						{
							hbsub[i].style.color="#ff6600"
							hasub[i].style.color="#030366"
							hasub[i].style.borderBottomColor="#ff6600"
							hasub[i].style.borderTopColor="#ff6600"
						}
					}
				}
			}
		}
	}
}

