////
// this here is the image swap code
function overImg(o_img) {
  ////
	// replace the source path with the path of the highlighted
	// image
  o_img.src = "./images/menu_" + o_img.name + "_over.gif";
}
function outImg(o_img) {
  ////
	// replace the highlighted image with the original image
  o_img.src = "./images/menu_" + o_img.name + ".gif";
}
function preloadMenu() {
  ////
	// setup array of image objects
	ar_images = new Array;
	for(i=0;i<5;i++) {
	  ar_images[i] = new Image;
	}
	////
	// load each image object with the menu's "over" images
  ar_images[0].src = "./images/menu_home_over.gif";
  ar_images[1].src = "./images/menu_services_over.gif";
  ar_images[2].src = "./images/menu_projects_over.gif";
  ar_images[3].src = "./images/menu_clients_over.gif";
  ar_images[4].src = "./images/menu_contact_over.gif";
}

////
// form validation for the email form on contact page
function checkform(frm) {
  ////
  // alert message upon missing elements
  var szError = "Please provide a return email address and a subject\n" + 
    "with your message.";
  ////
  // special error message if someone forgot to type a message
  var szNoMessage = "You forgot to type a message!";
  ////
  // if either "return email" or "subject" are left blank the form
  // is rejected and the user is alerted to their mistake.
  if(!(frm.from.value && frm.subject.value)) {
    alert(szError);
    return false;
  }
  else if(!(frm.message.value)) {
    alert(szNoMessage);
    return false;
  }
  else {
    ////
    // form is good, message shall be sent.
    return true;
  }
}
