// JavaScript Document

// Custom Form Validation
function validateForm(contact)
{
// Contact Name Required.
	if (document.contact.name.value == "")
		{
			alert ("Please enter your Name");
			contact.name.focus();
			return false;
		}

// Check to see that a Contact Method has been entered.
	if ((document.contact.phonehome.value == "") && (document.contact.phonework.value == "") && (document.contact.phonefax.value == "") && (document.contact.email.value == ""))
		{
			alert ("Please enter a Contact Method - either Home or Work Phone, a Fax Number or an Email Address");
			contact.phonehome.focus();
			return false;
		}
// /end

// Check to make sure that if a contact method is entered, that they are a correct length.
	if ((document.contact.phonehome.value != "") && (document.contact.phonehome.value.length < 9))
		{
			alert ("Please enter your full Home Telephone Number including Area Code");
			contact.phonehome.focus();
			return false;
		}

	if ((document.contact.phonework.value != "") && (document.contact.phonework.value.length < 9))
		{
			alert ("Please enter your full Work Telephone Number including Area Code");
			contact.phonework.focus();
			return false;
		}

	if ((document.contact.phonefax.value != "") && (document.contact.phonefax.value.length < 6))
		{
			alert ("Please enter your full Fax Number including Area Code");
			contact.phonefax.focus();
			return false;
		}

	if (document.contact.email.value != "")
		{
			if ((document.contact.email.value.indexOf("@", 0) < 0) || (document.contact.email.value.indexOf(".", 0) < 0))
				{
					window.alert("Please enter a valid e-mail address.");
					contact.email.focus();
					return false;
				}
		}
// /end
	
// Check if an option was selected for How They Found Us.
	if (document.contact.foundus.selectedIndex == "")
		{
			alert ("Please select an option for How You Found Temelli Jewellery");
			return false;
		}
// /end

// If all OK
  return true;
}

/* Button Hover */
function hov(loc,cls)
{
   if(loc.className)
      loc.className=cls;
}

