var msgstr;
function checkFormGeneric() {
var showError = true;


	if(document.form1.fname.value=="")
	{
		
		msgstr="Please Enter Name.";		
		document.getElementById("nameid").innerHTML=msgstr;	
		showError = false;

	}
	else
	{
		document.getElementById("nameid").innerHTML="";	
	}
	
	if(document.form1.phone.value=="" && document.form1.email.value=="")
	{
		msgstr="Please Enter Either an Email Address or a Phone #";
		document.getElementById("emailid").innerHTML=msgstr;
		msgstr="Please Enter Either an Email Address or a Phone #";
		document.getElementById("phoneid").innerHTML=msgstr;					
		showError = false;
	}
	else
	{
		document.getElementById("emailid").innerHTML="";
		document.getElementById("phoneid").innerHTML="";			
	}
	if(document.form1.email.value!="")
	{
		if (echeck(document.form1.email.value)==false)
		{
			//document.form1.email.focus();
			msgstr="Please Enter Valid Email Address";
		   document.getElementById("emailid").innerHTML=msgstr;
			showError = false;
		}
		else
		{
		 document.getElementById("emailid").innerHTML="";
		}
			
	}
	else
	{
	 document.getElementById("emailid").innerHTML="";
	 //document.getElementById("errorid").innerHTML="";
	}


if (document.form1.txtCaptcha.value!=document.form1.hidSuccess.value)
{
	msgstr="Please Enter Valid Verification Code";
    document.getElementById("veriid").innerHTML=msgstr;
	showError = false;
	
}
else
{	
document.getElementById("veriid").innerHTML="";

	
}


return showError;

//document.frm.submit();
}

/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){		  
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){		  
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){

		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){

		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){

		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){

		    return false
		 }

 		 return true					
	}



