// *** Email validation display in textbox ***
	function echecknew(str,frm) {
        dml=document.forms[frm];
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid email address")
		   //dml.txtdisplay.value="Invalid email address..";
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || 
str.indexOf(at)==lstr){
		   alert("Invalid email address")
		   //dml.txtdisplay.value="Invalid email address..";
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || 
str.indexOf(dot)==lstr){
		   alert("Invalid email address")
		    //dml.txtdisplay.value="Invalid email address..";
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid email address")
		   //dml.txtdisplay.value="Invalid email address..";
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || 
str.substring(lat+1,lat+2)==dot){
		  alert("Invalid email address")
		    //dml.txtdisplay.value="Invalid email address..";
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid email address")
		   //dml.txtdisplay.value="Invalid email address..";
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid email address")
		   //dml.txtdisplay.value="Invalid email address..";
		    return false
		 }

 		 return true					
	}
//*****************email validation end***/
//*****************email validation end
//trim blankspace validation
function trim(str)
{
   return str.replace(/^\s*|\s*$/g,"");
}

// Numeric check for price details 
function isNumericKey(e)
{
var k = document.all ? e.keyCode : e.which;
return ((k > 47 && k < 58) || k == 8 || k == 0);
}

// *** Float validation ***
function keyCheck(eventObj, obj)
{
var keyCode

// Check For Browser Type
if (document.all){ 
keyCode=eventObj.keyCode
}
else{
keyCode=eventObj.which
}

var str=obj.value

if(keyCode==46){ 
if (str.indexOf(".")>0){
return false
}
}

if((keyCode<48 || keyCode >58) && (keyCode != 46)){ // Allow only integers and decimal points 
return false
}
return true
}


// contact form validation
function checkform() { // First the normal form validation 
	if (trim(document.frmcontact.name.value)=="")
	{
	 alert("Please Enter Your Name...");
	 document.frmcontact.name.value="";
	 document.frmcontact.name.focus();
	 return false;
	}
	else if (trim(document.frmcontact.address.value)=="")
	{
	 alert("Please Enter Your Address...");
	 document.frmcontact.address.value="";
	 document.frmcontact.address.focus();
	 return false;
	}
	else if (trim(document.frmcontact.city.value)=="")
	{
	 alert("Please Enter Your City...");
	 document.frmcontact.city.value="";
	 document.frmcontact.city.focus();
	 return false;
	}
	else if (trim(document.frmcontact.state.value)=="")
	{
	 alert("Please Enter Your State...");
	 document.frmcontact.state.value="";
	 document.frmcontact.state.focus();
	 return false;
	}
	else if (trim(document.frmcontact.zip.value)=="")
	{
	 alert("Please Enter Your Zip...");
	 document.frmcontact.zip.value="";
	 document.frmcontact.zip.focus();
	 return false;
	}
	else if (trim(document.frmcontact.phone.value)=="")
	{
	 alert("Please Enter Your Phone Number...");
	 document.frmcontact.phone.value="";
	 document.frmcontact.phone.focus();
	 return false;
	}
	else if (trim(document.frmcontact.email.value)=="")
	{
	 alert("Please Enter Your Email...");
	 document.frmcontact.email.value="";
	 document.frmcontact.email.focus();
	 return false;
	}
	else if (echecknew(document.frmcontact.email.value)==""){
	 document.frmcontact.email.value="";
	 document.frmcontact.email.focus();
	 return false;
	}
	else if (trim(document.frmcontact.call_time.value)=="")
	{
	 alert("Please Enter Your Preferred Call Time...");
	 document.frmcontact.call_time.value="";
	 document.frmcontact.call_time.focus();
	 return false;
	}
	else if (trim(document.frmcontact.fax.value)=="")
	{
	 alert("Please Enter Your Fax...");
	 document.frmcontact.fax.value="";
	 document.frmcontact.fax.focus();
	 return false;
	}
	else if (trim(document.frmcontact.message.value)=="")
	{
	 alert("Please Enter Your Message...");
	 document.frmcontact.message.value="";
	 document.frmcontact.message.focus();
	 return false;
	}
	else if (document.frmcontact.code.value == "")
	{ 
	 alert("Please enter the string from the displayed image"); 
	 document.frmcontact.code.value=""; 
	 document.frmcontact.code.focus(); 
	 return false; 
	}  
	else
	{
	 checkcode(document.frmcontact.code.value); 
	 return false; 
	}
	 
	 //return false; 
}  