
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


function validateContactForm() {

  var vbCRLF = String.fromCharCode(13,10);
  var incomplete = 0, msg = "";

  if (document.contactForm.name.value == "") {
    incomplete = 1;
    msg = "Please type your first and last name." + vbCRLF;
  }
  if (document.contactForm.email.value == "" || document.contactForm.email.value.indexOf("@")==-1 || document.contactForm.email.value.indexOf(".")==-1 ) {
    incomplete = 1;
    msg += "Please type a valid email address." + vbCRLF;
  }
  if (document.contactForm.subject.value == "") {
    incomplete = 1;
    msg += "Please type subject of your inquiry." + vbCRLF;
  }
  if (document.contactForm.message.value == "") {
    incomplete = 1;
    msg += "Please type your comment or question.";
  }
  if (incomplete == 1) {
    alert(msg);
  }
  else {
    document.contactForm.submit();
  }

}


function validateCareerForm() {

  var vbCRLF = String.fromCharCode(13,10);
  var incomplete = 0, msg = "";

  if (document.careerForm.name.value == "") {
    incomplete = 1;
    msg = "Please type your first and last name." + vbCRLF;
  }
  if (document.careerForm.position.value == "") {
    incomplete = 1;
    msg += "Please select a career position." + vbCRLF;
  }
  if (document.careerForm.attachment.value == "") {
    incomplete = 1;
    msg += "Please attach a copy of your resume or vitae/cover letter.";
  }
  if (incomplete == 1) {
    alert(msg);
  }
  else {
    document.careerForm.submit();
  }

}


