function resetvalue(formNm){
 formNm.reset();
 formNm.tpname.focus();
}

var remail=/^([_&a-zA-Z0-9-]+(\.[_&a-zA-Z0-9-]+)*@[&a-zA-Z0-9-]+\.+[&a-zA-Z0-9-]+)/;

function trim(str)
{
	return str.replace(/^\s*|\s*$/g,"");
}

function checkEmail(fieldvalue){
	if(remail.test(fieldvalue)){
		return false;
	}
	else {
		return true;
	}
}



function ValidateSecuritytag(formNm)
{
	
	var errMsg  = "Please correct the following item(s):\n\n";
	var errNum  = 0;
	var fldName = "";
	var passerr = 0;
	
	if (trim(formNm.name.value)=="") {
			alert("Please enter the name ");
			formNm.name.focus();
			return false;
	}
	if (trim(formNm.company.value)=="") {
		    alert("Please enter the company name");
			formNm.company.focus();
			return false;
	} 
	if(trim(formNm.email.value)=="") {
		    alert("Please enter the email");
			formNm.email.focus();
			return false;
	}
	if(trim(formNm.email.value)!="" && checkEmail(trim(formNm.email.value))) {
		    alert("Email should be valid");
			formNm.email.focus();
			return false;
	} 
	
	if(trim(formNm.telephone.value)==""){
		    alert("Please enter the telephone numbers");
			formNm.telephone.focus();
			return false;
	} 

	if(trim(formNm.message.value)==""){
		   alert("Please enter the message");
			formNm.message.focus();
			return false;
	} 

	if(trim(formNm.security_code.value)==""){
		   alert("Please enter the security code");
			formNm.security_code.focus();
			return false;
	} 
	
	
	formNm.submit();
   	return true;
}




