function verifyContactForm() {	

	if( document.contactForm.contactName.value == "" )
		{ alert( "You must provide your name."); return false; }
		
	if( document.contactForm.contactEmail.value == "" )
		{ alert( "You must provide an email address."); return false; }
		
	if( checkemail( document.contactForm.contactEmail ) == false )
		{ alert( "You must provide a valid email address."); return false; }
		
	if( document.contactForm.contactConfirmEmail.value == "" )
		{ alert( "You must confirm your email address."); return false; }
		
	if( checkemail( document.contactForm.contactConfirmEmail ) == false )
		{ alert( "You must provide a valid confirmation email address."); return false; }
		
	if( document.contactForm.contactEmail.value != document.contactForm.contactConfirmEmail.value )
		{ alert( "The email addresses you have provided do not match."); return false; }
		
	if( document.contactForm.contactLocation.value == "" )
		{ alert( "You must specify a location."); return false; }	
		
	if( document.contactForm.contactReferrer.value == "" )
		{ alert( "You must specify how you found me."); return false; }		
		
	return true;
	
	}
	
function selectType() {
	if( document.contactForm.contactType.value == "Weddings" )
		{
			document.contactForm.contactDate.disabled=false;
			document.contactForm.contactDate.style.backgroundColor = "#fff";
			document.contactForm.contactLocation.disabled=false;
			document.contactForm.contactLocation.style.backgroundColor = "#fff";
		}
		else
		{
			document.contactForm.contactDate.disabled=true;
			document.contactForm.contactDate.style.backgroundColor = "#aaa";
			document.contactForm.contactLocation.disabled=true;
			document.contactForm.contactLocation.style.backgroundColor = "#aaa";
		}
	}
	

// Now check for fields that are supposed to be emails.
// Only checks that there's one @ symbol and no whitespace
function checkemail(e)
{
  var seenAt = false;

  for(var j = 0; j < e.value.length; j++)
  {
    var c = e.value.charAt(j);

    if ((c == ' ') || (c == '\n') || (c == '\t'))
    {
      return false;
    }

    if ((c == '@') && (seenAt == true))
    {
      return false;
    }

    if ((c == '@'))
      seenAt = true;
  }

  if (seenAt == false)
  {
    return false;
  }
  return true;
}

// Checks if a field looks like a date in the 99/99/9999 format
function checkdate(e)
{
  var slashCount = 0;
  if (e.value.length != 10)
  {
    return false;
  }

  for(var j = 0; j < e.value.length; j++)
  {
    var c = e.value.charAt(j);

    if ((c == '/'))
       slashCount++;

    if (c != '/' && (c < '0' || c > '9'))
    {
      return false;
    }
  }

  if (slashCount != 2)
  {
    return false;
  }

  return true;
}