// JavaScript Document
// JavaScript Document
function trim(txt_value) 
{ return (txt_value.replace(/^\s|\s*$/g,"")); }
function isValidEmail( emailField )
{ 
   // var emailregex=/^[\w]+\+?\w*@[\w]+\.[\w.]+\w$/; 
   var emailregex=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-zA-Z]{2,6}(?:\.[a-zA-Z]{2})?)$/i;
    var match=emailField.match( emailregex ); 
    if ( !match ) 
    { 
       return false; 
    }
    else
    {
       return true; 
    }
}

function val_regform()
{
	if(document.regform.cname.value=='')
	{
		alert("Please enter first name.");
		document.regform.cname.focus();
		return false;
	}
	
	
	if(document.regform.cemail.value=='')
	{
		alert("Please enter email address.");
		document.regform.cemail.focus();
		return false;
	}
	if(document.regform.cemail.value!='')
	{
		if(!isValidEmail(document.regform.cemail.value))
		{
			alert("Please enter valid email address.");
			document.regform.cemail.focus();
			return false;
		}
		
	}
}
