function chkSubsForm(objForm)
{
//alert("dfg");
	
	var theMessage	= "You entered incorrectly or forgot to fill in ::\n";
	var noErrors	= theMessage;
	var focusval	= objForm.usr_name;
	var dt			= new Date();
	
	if(objForm.usr_name)
	{
		if(objForm.usr_name.value=='')
		{
			theMessage+= "\nPlease enter Name";
			focusval = objForm.usr_name;
		}
	
	}

	if(objForm.usr_email)
	{
		if (trimAll(objForm.usr_email.value).length<=0) 
		{
			theMessage+="\nPlesae enter your email" ;
			focusval = objForm.usr_email;
		} else if (!isValidEmail(trimAll(objForm.usr_email.value)))
		{	
			theMessage+= "\nPlesae enter valid email id" ;
			focusval = objForm.usr_email;
		}
	}

if (theMessage == noErrors)
	{
		return true;
	} 
	else
	{
		alert(theMessage);
		focusval.focus();

		return false;
	}



}


function isValidEmail(sFieldValue)
{
	var REmail=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;

	var str=sFieldValue;
	if(!str.match(REmail)){
		return false;
	}
	else
	{
		return true;
	}
}

function trimAll(str){
	var l=0;
	var r=str.length;
	while((ch=str.charAt(l++)) == ' ');
	while((ch=str.charAt(--r)) == ' ');
	return(0>r)?"":str.substring(l-1,r+1);
}



