<!--

function checktext(str,errmsg)
{	
	var checkspc=1;
	if(str.value.length==0)
	{
		alert('You have not entered '+errmsg);
		str.focus();
		return false;
	}
	for(i=0;i<str.value.length;i++)
		if(str.value.charAt(i)  != " ")
		{
			checkspc=0; break;
		}
	if(checkspc==1)	
	{
		alert('You have not entered '+errmsg);
		str.select();
		str.focus();
		return false;
	} 
	return true;
}
function checkspace(str,errmsg)
{
	if(str.value.length==0)
	{
		alert('You have not entered '+errmsg);
		str.focus();
		return false;
	}
	for(i=0;i<str.value.length;i++)
		if(str.value.charAt(i) == " ")
		{
			alert('Please do not enter spaces in field '+errmsg);
			str.select();
			str.focus();
			return false;
		}
	return true;
}
function checkdigit(str,errmsg)
{
	digits = "0123456789.";

	if (str.value.length==0) 
	{
		alert('You have not entered '+errmsg);
		str.focus();
		return false;
	}
	for (var i = 0; i < str.value.length; i++) 
	{
		var ch = str.value.charAt(i);
		var a = digits.indexOf(ch);
		if (a == -1)
		{
			alert('Invalid '+errmsg);
			str.select();
			str.focus();
			return (false);
		}
	}
	return(true);
}

function checkdigit1(str,errmsg)
{
	digits = "0123456789";

	for (var i = 0; i < str.value.length; i++) 
	{
		var ch = str.value.charAt(i);
		var a = digits.indexOf(ch);
		if (a == -1)
		{
			alert('Invalid '+errmsg);
			str.select();
			str.focus();
			return (false);
		}
	}
	return(true);
}


function checknum(str,errmsg)
{
	if(str.value.length==0)
	{
		alert('You have not entered '+errmsg);
		str.focus();
		return false;
	}
	if(isNaN(str.value))
	{
		alert(errmsg+' must be numeric');
		str.select();
		str.focus();
		return false;
	}
	return true;
}

function checknum1(str,errmsg)
{
	if(isNaN(str.value))
	{
		alert(errmsg+' must be numeric');
		str.select();
		str.focus();
		return false;
	}
	return true;
}

function checkmail(str,errmsg)
{
	flag=0;
if(str.value.length!=0)
{
	if(str.value.indexOf("@") < 1)
	 {
		flag=1;
	 }
	else if(str.value.indexOf(".") < 1)
	 {
  		flag=1;
	 }
	else if(str.value.indexOf(" ") != -1)
	 {
   		flag=1;
	 } 
	else if(str.value.indexOf("@")+1 >= str.value.indexOf("."))
	 {
		flag=1;
	 } 
		else if(str.value.indexOf(".") == str.value.length-1)
	 {
   		flag=1;
	 } 
	 if (flag==1)
	 {
		alert('Invalid '+errmsg);
		str.select();
		str.focus();
		return false;
 	 }  
}
	 return true;
}
function checkpass(str1,errmsg1,str2,errmsg2)
{
	if ( str1.value != str2.value )
	{
		alert('You have entered different values in '+errmsg1);
		str1.select();
		str1.focus();
		return false;
	}	
	return true;
}
function checkcombo(str,errmsg)
{
	if(str.selectedIndex <=0 )
	{
		alert('You have not entered '+errmsg);
		str.focus();
		return false;
	}
	return true;
}
function checkint(str,errmsg)
{
	if( str.value>2147483647 || str.value<0 )
	{
		alert('Invalid '+errmsg);
		str.select();
		str.focus();
		return false;
	}
	return true;
}


// -->
