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					
}

function apply_Validation() 
{ 
		var hh = document.contactform;
		if(hh.FullName.value=="")
		{
			alert("Please Enter Your First Name.");
			hh.FullName.focus();
			return false;
		}
		if(hh.company.value=="")
		{
			alert("Please Enter Your Company Name.");
			hh.company.focus();
			return false;
		}

		/*
		 * if(hh.telephone.value=="") { alert("Please Enter Your Telephone
		 * No."); hh.telephone.focus(); return false; }
		 */
						
		if(hh.email.value=="")
		{
			alert("Please Enter Your Email address.");
			hh.email.focus();
		return false;
		}
		
		
		if(hh.phone.value=="")
		{
			alert("Please Enter Your Phone No.");
			hh.phone.focus();
		return false;
		}
		
	
		if (echeck(hh.email.value)==false)
		{
			alert("Invalid email Address.");
			hh.email.focus();
		return false;
		}
		
	return true;
}

function apply_Validation1() 
{ 
		var hh = document.rfqform;
		if(hh.userName.value=="")
		{
			alert("Please Enter Your First Name.");
			hh.userName.focus();
			return false;
		}
		if(hh.companyName.value=="")
		{
			alert("Please Enter Your Company Name.");
			hh.companyName.focus();
			return false;
		}
		if(hh.city.value=="")
		{
			alert("Please Enter Your City.");
			hh.city.focus();
			return false;
		}
						
		if(hh.phoneNumber.value=="")
		{
			alert("Please Enter Your Phone No.");
			hh.phoneNumber.focus();
		return false;
		}
		
		
		if(hh.emailID.value=="")
		{
			alert("Please Enter Your Email address.");
			hh.emailID.focus();
		return false;
		}
		
		
	
		if (echeck(hh.email.value)==false)
		{
			alert("Invalid email Address.");
			hh.email.focus();
		return false;
		}
		
	return true;
}

function form_Validation() 
{
		var hh = document.ultraForm;
		if(hh.userName.value=="")
		{
			alert("Please enter your Name.");
			hh.userName.focus();
			return false;
		}
		if(hh.companyName.value=="")
		{
			alert("Please enter your Company Name.");
			hh.companyName.focus();
			return false;
		}
		if(hh.city.value=="")
		{
			alert("Please enter your City.");
			hh.city.focus();
			return false;
		}
		
		if(hh.country.value=="")
		{
			alert("Please enter your Country.");
			hh.country.focus();
			return false;
		}
		
		if(hh.phoneNumber.value=="")
		{
			alert("Please enter your Phone No.");
			hh.phoneNumber.focus();
			return false;
		}
		
		if(hh.emailID.value=="")
		{
			alert("Please enter Email address.");
			hh.emailID.focus();
		return false;
		}
}


function shipping_Validation() 
	{ 
		var hh = document.shipform;
		if(hh.name.value=="")
		{
			alert("Please Enter Name.");
			hh.name.focus();
			return false;
		}
		if(hh.companyName.value=="")
		{
			alert("Please Enter Company Name.");
			hh.companyName.focus();
			return false;
		}		
		/*if(hh.carrierName.value=="")
		{
			alert("Please Enter Your Carrier Name.");
			hh.carrierName.focus();
			return false;
		}
		if(hh.contactName.value=="")
		{
			alert("Please Enter Your Contact Name.");
			hh.contactName.focus();
			return false;
		}
		if(hh.account.value=="")
		{
			alert("Please Enter Account No.");
			hh.account.focus();
			return false;
		}*/
							
		if(hh.contactphone.value=="")
		{
			alert("Please Enter Contact Phone.");
			hh.contactphone.focus();
		return false;
		}
		
		if(hh.emailID.value=="")
		{
			alert("Please Enter Your Email address.");
			hh.emailID.focus();
		return false;
		}
		
		if (echeck(hh.emailID.value)==false)
		{
			alert("Invalid email Address.");
			hh.emailID.focus();
		return false;
		}
		
	return true;
}
