
function checksubscribe()
{
	var strErr,field;
	strErr="";
	var email =/[-a-zA-Z0-9_\.]+@[-a-zA-Z0-9]+\.[-a-zA-Z0-9\.]+/;
	var eflag = trim(document.formsub.email.value).match(email);
	if (trim(document.formsub.fname.value)=="")
	{
	strErr+="*Enter First Name \n";
	if (typeof(field)=="undefined")
	{field=document.formsub.fname;}
	}
	if (trim(document.formsub.lname.value)=="")
	{
	strErr+="*Enter Last Name\n";
	if (typeof(field)=="undefined")
	{field=document.formsub.lname;}
	}
	if(eflag!=trim(document.formsub.email.value))	   
	{
	strErr+="*Enter Valid Email\n";
	if (typeof(field)=="undefined")
	{field=document.formsub.email;}
	}
	
	if (trim(document.formsub.capval.value)=="")
	{
	strErr+="*Enter Numbers as shown\n";
	if (typeof(field)=="undefined")
	{field=document.formsub.capval;}
	}	
		
	if(strErr!="")
	{
	alert("The required Information is incomplete\n\n"+strErr);
	field.focus();    
	return false;
	}
}

function unsubcheck()
{
	var strErr,field;
	strErr="";
	var email =/[-a-zA-Z0-9_\.]+@[-a-zA-Z0-9]+\.[-a-zA-Z0-9\.]+/;
	var eflag = trim(document.formunsub.email.value).match(email);
	if(eflag!=trim(document.formunsub.email.value))	   
	{
	strErr+="*Enter Valid Email\n";
	if (typeof(field)=="undefined")
	{field=document.formunsub.email;}
	}
	

	if(strErr!="")
	{
	alert("The required Information is incomplete\n\n"+strErr);
	field.focus();    
	return false;
	}
}




function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
