
function check(theform) 
{
	if(theform.name.value == "") 
	{
		alert("Please enter your full name.");
		theform.name.focus();
		return (false);
	}
	
	if(theform.email.value == "") 
	{
		alert("Please enter your email address.");
		theform.email.focus();
		return (false);
	}
	
	var str = theform.email.value
	if ((str.indexOf("@") == -1) || (str.indexOf(".") == -1))
	{
		alert("Please enter a valid email address");
		theform.email.value = ""
		theform.email.focus();
		return false
	}
	
	if(theform.street.value == "") 
	{
		alert("Please enter your street address.");
		theform.street.focus();
		return (false);
	}
	if(theform.city.value == "") 
	{
		alert("Please enter your City/Town.");
		theform.city.focus();
		return (false);
	}
	if(theform.state.value == "") 
	{
		alert("Please enter your State/Province.");
		theform.state.focus();
		return (false);
	}
	if(theform.zip.value == "") 
	{
		alert("Please enter your Post Code.");
		theform.zip.focus();
		return (false);
	}

	if(theform.wphone.value == "") 
	{
		alert("Please enter your phone number.");
		theform.wphone.focus();
		return (false);
	}
	
	if(theform.reasenq.value == "") 
	{
		alert("Please enter your reason.");
		theform.reasenq.focus();
		return (false);
	}
	if (theform.country.value == "AUSTRALIA")
	{	
		var flag = true;
		var str = new String(theform.zip.value);
		for(var i=0; i<str.length; i++)
		{
			if(str.charAt(i) < '0' || str.charAt(i) > '9')
			{
				flag = false;
			}
		}
		if (flag == false)
		{
			alert("Please Enter Number Only")
			theform.zip.value = "";
			theform.zip.focus();
		}
		return flag;
	}
	
	return true;
	
}
function checknum(field)
{
	var flag = true;
	var str = new String(field.value);
	for(var i=0; i<str.length; i++)
	{
		if(str.charAt(i) < '0' || str.charAt(i) > '9')
		{
			flag = false;
		}
	}
	if (flag == false)
	{
		alert("Please Enter Number Only")
		field.value = "";
		field.focus();
	}
	return flag;
}
