// JavaScript Document
function putMenuOn(obj)
{
	obj.className="menuon";
}
function putMenuOff(obj)
{
	obj.className="menuoff";
}
function str_trim(str)
{	
	if(str.length > 0)
		while(str.charAt(0)==' ')
			str = str.substr(1);
		
	if(str.length > 0)
		while(str.charAt((str.length - 1))==' ')
			str = str.substring(0, str.length-1);
	
	return str;
}
function checkNum()
{
	var carCode = event.keyCode;
	
	if ((carCode < 48) || (carCode > 57))
	{
		//alert(carCode);
		alert('Please enter only numeric values.');
		event.cancelBubble = true;
		event.returnValue = false;
	}
} 
function checkEmail(x)
{
	a=new Array();
	s=x.value;
	
	for(i=0; i<s.length; i++)
		a[i]=s.charAt(i);

	dot = s.indexOf(".");
	at   = s.indexOf("@");

	if (dot == -1 || at == -1)
	{
		x.focus()
		alert ("Please Check Email Address");
		return 1;
	}

	str1=s.substring(dot+1,s.length);
	str2=s.substring(at+1, dot);
	str3=s.substring(0,at);

	if((str1.length==0)||(str2.length==0)||(str3.length==0))
	{
		x.focus()     
		alert ("Please Check Email Address");
		return 1;
	}

	return 0;
}

function GoToPage(page)
{
	window.document.location.href=page;
}

function WindowPosition(widthX,heightX)
{
	var width = (screen.width);
	var height = (screen.height - 25);
	var centerleft = 0;
	var centertop = 0;
	var centerleft = (width/2) - (widthX/2);
	var centertop = (height/2) - (heightX/2);
	var width=widthX;
	var height=heightX;
	window.moveTo(centerleft,centertop);
	window.resizeTo(width, height);
	window.focus();
}