// JavaScript Document
function openTerms()
{
url='terms_conditions.htm';
width=500;
height=500;
winName='TermsCondition';
	var left=(screen.width-width)/2;
	var top=(screen.height-height)/2;
	if (left < 0 || top < 0)
	{
		left=100;
		top=100;
	}
window.open(url,winName,'scrollbars=yes,resizable=no,width='+width+',height='+height+',left='+left+',top='+top+'');
}
function printYear()
{
	var tm=new Date();
	var year=tm.getYear();
	if (year < 1000) year+=1900;
	return year;
}

function trim(arg)
{
   if (arg == null) return false;
   return arg.replace(/(^\s+)|(\s+$)/g,"");
}

function clearFieldUsername()
{
	var username=document.login.username
	if (username.value == "Enter User Name") username.value ="";
}

function clearFieldPassword()	
{
	var	password=document.login.password
	if (password.value == "Enter Password") password.value ="";
}

function submitLogin()
{
	var username=document.login.username
	username.value=trim(username.value);
	if (username.value == "Enter User Name" || username.value == "" )
	{
		alert("Please enter username before submit");
		return;
	}	
		
	var password=document.login.password	
	if (password.value == "Enter Password" || password.value == "" )
	{
		alert("Please enter password before submit");
		return;
	}
	document.login.submit();	
}

function changeColor(index)
{	
	var ms_linkid="ms_"+index;
	document.getElementById(ms_linkid).style.backgroundColor="#FFFFFF";
}
function getbackColor(index)
{
	var ms_linkid="ms_"+index;
	document.getElementById(ms_linkid).style.backgroundColor="#FFD32F";
}
function SelectCBList(listname,isChecked)
{
	var i=0;
	while(typeof(document.all[listname+"_"+i])!='undefined')
	{		
		document.all[listname+"_"+i].checked = isChecked;		
		i++;
	}
}
function bw_check()
{
	var is_major=parseInt(navigator.appVersion);
	this.nver=is_major;
	this.ver=navigator.appVersion;
	this.agent=navigator.userAgent;
	this.dom=document.getElementById?1:0;
	this.opera=window.opera?1:0;
	this.ie55=(this.ver.indexOf("MSIE 5.5")>-1&&this.dom&&!this.opera)?1:0;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1&&this.dom&&!this.ie55&&!this.opera)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1&&this.dom&&!this.opera)?1:0;
	this.ie4=(document.all&&!this.dom&&!this.opera)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6;
	this.mac=this.agent.indexOf("Mac")>-1;
	this.ns6=(this.dom&&parseInt(this.ver)>=5)?1:0;
	this.ie3=(this.ver.indexOf("MSIE")&&(is_major<4));
	this.hotjava=(this.agent.toLowerCase().indexOf('hotjava')!=-1)?1:0;
	this.ns4=(document.layers&&!this.dom&&!this.hotjava)?1:0;
	this.bw=(this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera);
	this.ver3=(this.hotjava||this.ie3);
	this.opera7=((this.agent.toLowerCase().indexOf('opera 7')>-1) || (this.agent.toLowerCase().indexOf('opera/7')>-1));
	this.operaOld=this.opera&&!this.opera7;return this
};

bw=new bw_check();