// JavaScript Document
function formValidator_Order()
   {
	var Name = document.getElementById('name');
	var Address = document.getElementById('address');
	var City = document.getElementById('city');
	var Zcode = document.getElementById('zcode');
	var State = document.getElementById('state');
	var Email = document.getElementById('email');
	var Mobile = document.getElementById('mobile');
	var Tel = document.getElementById('tel');
	var Fax = document.getElementById('fax');
	var Product = document.getElementById('product');
	if(isAlphabet(Name, " Please enter Name. ")){
	if(notEmpty(Address," Please enter Address. ")){
	if(isAlphabet(City, " Please enter City. ")){	
	if(isNumeric(Zcode," Enter valid Zipcode. ")){
	if(notEmpty(State," Please Select the state. ")){
	if(emailValidator(Email, " Please enter a valid email address. ")){
	if(isNumeric(Mobile," Enter valid Cell no. ")){	
	if(isNumeric(Tel," Please enter the Landline no. ")){
	if(notEmpty(Fax," Please enter the Fax no. ")){
	if(notEmpty(Product," Please choose whether Product/model.")){
	return true;
	}
	}
	}
	}
	} 
	}
	}
	}
	}
	}
	return false;
  }
  function formValidator_Enquiry()
   {
	var Name = document.getElementById('txtName');
	var Address = document.getElementById('txtAddress1');
	var City = document.getElementById('txtcity');
	var Zip = document.getElementById('txtZip');
	var Countries = document.getElementById('cmbCountries');
	var Email = document.getElementById('txtEmail');
	var Mobile = document.getElementById('txtMobile');
	var Telephone = document.getElementById('txtTelephone');
	var Fax = document.getElementById('txtFax');
	var Hour = document.getElementById('cmbHour');
	var Othedetail = document.getElementById('txtOtherDetails');
	if(isAlphabet(Name, " Please enter Name. ")){
	if(notEmpty(Address, " Please enter Address.")){
	if(isAlphabet(City, " Please enter City name. ")){
	if(isNumeric(Zip," Enter valid Zipcode. ")){
	if(notEmpty(Countries," Please Choose Country" )){
	if(emailValidator(Email, " Please enter a valid email address. ")){
	if(isNumeric(Mobile," Enter valid Cell no. ")){
	if(isNumeric(Telephone," Please enter Landline no. ")){
	if(notEmpty(Fax," Please enter the Fax no. ")){
	if(notEmpty(Hour," Please Choose the hours back. ")){
	if(notEmpty(Othedetail," Please choose. ")){
	return true;
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	return false;
  }
function Checkweb() 
{
missinginfo = "";
if ((document.addb.Bwebsite.value == "") || 
(document.addb.Bwebsite.value.indexOf("http://") == -1) || 
(document.addb.Bwebsite.value.indexOf(".") == -1)) {
missinginfo += "\n Enter valid  Website";
}

if (missinginfo != "") 
{
alert(missinginfo);
return false;
}
else return true;
}
//  End -->
function notEmpty(elem, helperMsg)
{
if(elem.value.length == 0)
{
alert(helperMsg);
elem.focus(); // set the focus to this input
return false;
}
return true;
}

function isNumeric(elem, helperMsg)
{
var numericExpression = /^[0-9]+$/;
if(elem.value.match(numericExpression)){
return true;
}
else
{
alert(helperMsg);
elem.focus();
return false;
}
}

function validate(fld)

 {
	if(!/(\.bmp|\.gif|\.jpg|\.jpeg)$/i.test(fld.value)) 
	{
		alert("Invalid image file type.");
		document.wallpaper.Bimage.focus();
		return false;
	}
	return true;
}
function isAlphabet(elem, helperMsg)
{
var alphaExp = /^[a-zA-Z]+$/;
if(elem.value.match(alphaExp))
{
return true;
}else{
alert(helperMsg);
elem.focus();
return false;
}
}

function emailValidator(elem, helperMsg)
{
var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
if(elem.value.match(emailExp))
{
return true;
}else{
alert(helperMsg);
elem.focus();
return false;
}
}

function ischeck(p1,p2,helperMsg)
{
if(p1.value == p2.value)
{	
return true;  
}
else
{
alert(helperMsg);
p2.focus();
return false;
}
}
// Fron Listing

