function launchWindow(url) {
	if (url != '') {
		window.open(url);
		document.getElementById('login_menu').options[0].selected = true;
	}
};


function clearText(thefield){
	if (thefield.defaultValue==thefield.value)
	thefield.value = ""
}
function refillText(thefield){
	if (thefield.value=="")
	thefield.value = thefield.defaultValue
}

function validateForm(theForm) {

  if (theForm.name.value == "Your Name")
  {
    alert("Please enter your name.");
    theForm.name.focus();
    return (false);
  }

  if (theForm.email_address.value == "Your Email Address")
  {
    alert("Please enter your email address.");
    theForm.email_address.focus();
    return (false);
  }

  if (theForm.email_address.value.length < 3)
  {
    alert("Please enter a valid email address.");
    theForm.email_address.focus();
    return (false);
  }

	emailAddy = theForm.email_address.value
	AtPos = emailAddy.indexOf("@")
	StopPos = emailAddy.lastIndexOf(".")
	
	if (AtPos == -1 || StopPos == -1) {
		alert("Please enter a valid email address.");
		theForm.email_address.focus();
		return false;
	}

	var selObject_1 = document.getElementById('location');
	var selIndex_1 = selObject_1.selectedIndex;

  if (selIndex_1 == 0)
  {
    alert("Please select your location.");
    theForm.location.focus();
    return (false);
  }

	var selObject_2 = document.getElementById('reason');
	var selIndex_2 = selObject_2.selectedIndex;

  if (selIndex_2 == 0)
  {
    alert("Please select your reason for contact.");
    theForm.reason.focus();
    return (false);
  }


  return (true);

}


function checkResponse(theForm) {

	if (theForm.email_address.value.length < 1) {
		alert("Please enter your email address.");
		theForm.email_address.focus();
		return (false);
	}


	emailAddy = theForm.email_address.value
	AtPos = emailAddy.indexOf("@")
	StopPos = emailAddy.lastIndexOf(".")
	
	if (AtPos == -1 || StopPos == -1) {
		alert("Please enter a valid email address.");
		theForm.email_address.focus();
		return false;
	}


	if (theForm.name.value.length < 2) {
		alert("Please enter your name.");
		theForm.name.focus();
		return (false);
	}


	if (theForm.response.value.length < 1) {
		alert("Please enter your response.");
		theForm.response.focus();
		return (false);
	}


	return (true);


}



function validateSendToFriend(theForm) {

	if (theForm.recipient_name.value.length < 1) {
		alert("Please enter the recipient's name.");
		theForm.recipient_name.focus();
		return (false);
	}

	if (theForm.recipient_email.value.length < 1) {
		alert("Please enter the recipient's email address.");
		theForm.recipient_email.focus();
		return (false);
	}

	if (theForm.sender_name.value.length < 1) {
		alert("Please enter your name.");
		theForm.sender_name.focus();
		return (false);
	}

	if (theForm.sender_email.value.length < 1) {
		alert("Please enter your email address.");
		theForm.sender_email.focus();
		return (false);
	}

	emailAddy = theForm.recipient_email.value
	AtPos = emailAddy.indexOf("@")
	StopPos = emailAddy.lastIndexOf(".")
	
	if (AtPos == -1 || StopPos == -1) {
		alert("Please enter a valid recipient's email address.");
		theForm.recipient_email.focus();
		return false;
	}

	emailAddy2 = theForm.sender_email.value
	AtPos2 = emailAddy2.indexOf("@")
	StopPos2 = emailAddy2.lastIndexOf(".")
	
	if (AtPos2 == -1 || StopPos2 == -1) {
		alert("Please enter a valid email address.");
		theForm.sender_email.focus();
		return false;
	}
	
	return (true);

}