function checkEmail(myForm) {
			if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email_friend.value) && /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.email_yours.value)){
			return (true)
		}
			
		alert("Invalid E-mail Address! Please re-enter.") 
		return (false)
		}

//variables used to center pop-up windows
var width = screen.width;
var height = screen.height;
var popUpWidth = 0;
var popUpHeight = 0;
var positionTop = 0;
var positionLeft = 0;

function openResources(page){
  popUpWidth = 545;
  popUpHeight = 500;
  positionTop = ((height/2) - (popUpHeight/2));
  positionLeft = ((width/2) - (popUpWidth/2));
  resources=window.open(page,'resources', config='width=' + popUpWidth + ',height=' + popUpHeight + ',left=' + positionLeft + ',top=' + positionTop + ',toolbar=no,directories=0,status=0,menubar=no,resizable=yes,scrollbars=yes'); resources.focus();
}

function leaveSite(page){
  popUpWidth = 780;
  popUpHeight = 500;
  positionTop = ((height/2) - (popUpHeight/2));
  positionLeft = ((width/2) - (popUpWidth/2));
  interstitial=window.open(page,'interstitial', config='width=' + popUpWidth + ',height=' + popUpHeight + ',left=' + positionLeft + ',top=' + positionTop + ',toolbar=yes,directories=0,status=0,menubar=yes,resizable=yes,scrollbars=yes,location=yes');
}

function validate_form() {
	if (!check_email(document.frmEmail.from))
		return false;
	if (!check_email(document.frmEmail.to))
		return false;
	return true;
}
	
function check_email(oControl)
{
   var address;

   address = oControl.value;
   if (address == "")
   {
      window.alert("Please enter an email address!");
      oControl.focus();
      return false;
   }
   if(address.indexOf('@') == 0 || address.indexOf('@') == (address.length - 1) || address.indexOf('@') == -1)
   {
      window.alert("Please enter a valid email address!");
      oControl.select();
      oControl.focus();
      return false;
   }

   return true;
}
