
function ValidateContact(){
	thisform = document.forms.ContactForm;
	if (thisform.Name.value ==""){
		alert("Please enter your first and last name");
		return false;
	}
	if (thisform.City.value ==""){
		alert("Please enter your city or town ");
		return false;
	}
	if (thisform.Region.value ==""){
		alert("Please enter your province, state or region");
		return false;
	}
	if (thisform.Email.value ==""){
		alert("Please enter your email address");
		return false;
	}
	if (thisform.InquiryType.options[thisform.InquiryType.selectedIndex].value==""){
		alert("Please select an inquiry type");
		return false;
	}
	if (thisform.Message.value ==""){
		alert("Please enter a question or comment");
		return false;
	}
	
	return true;
}

function ValidateSearchNews(){
	thisform = document.forms.SearchNews;
	if (thisform.SearchText.value == ""){
		alert("Please specify news keywords to search for");
		return false;
	}
	return true;
}
		
function isEmail(str){
  // are regular expressions supported?
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) 
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
  return (!r1.test(str) && r2.test(str));
}

