function validateContactForm(formobj) {

   var alertMsg = "The following fields must be filled in before submitting the form:\n";
   var len_Msg = alertMsg.length;
   var fldRequired    = Array("email",
                              "comments");
   var fldDescription = Array("Your email address",
                              "Your Comments");
   
   
   for (var i = 0; i < fldRequired.length; i++) {
      var obj = formobj.elements[fldRequired[i]];
      if (obj) {
         switch(obj.type){
            case "select-one":
               if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == "") {
  		  alertMsg += " : " + fldDescription[i] + "\n";
               }
	       break;
	    case "select-multiple":
	       if (obj.selectedIndex == -1) {
		  alertMsg += " : " + fldDescription[i] + "\n";
	       }
	       break;
	    case "text":
	    case "textarea":
	       if (obj.value == "" || obj.value == null) {
		  alertMsg += " : " + fldDescription[i] + "\n";
	       }
	       break;
	    default:
	       if (obj.value == "" || obj.value == null) {
		  alertMsg += " : " + fldDescription[i] + "\n";
	       }
	 }
      }
   }

   if (alertMsg.length == len_Msg) {
      return true;
      
   }
   else {
      alert(alertMsg);
      return false;
   }
}


function validateRefForm(formobj) {

   var alertMsg = "The following fields must be filled in before submitting the form:\n";
   var len_Msg = alertMsg.length;
   var fldRequired    = Array("mail_to",
                              "mail_from",
                              "mail_subject");
   var fldDescription = Array("Your friend's email address",
                              "Your email address",
                              "Subject/Title");
   
   
   for (var i = 0; i < fldRequired.length; i++) {
      var obj = formobj.elements[fldRequired[i]];
      if (obj) {
         switch(obj.type){
            case "select-one":
               if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == "") {
  		  alertMsg += " : " + fldDescription[i] + "\n";
               }
	       break;
	    case "select-multiple":
	       if (obj.selectedIndex == -1) {
		  alertMsg += " : " + fldDescription[i] + "\n";
	       }
	       break;
	    case "text":
	    case "textarea":
	       if (obj.value == "" || obj.value == null) {
		  alertMsg += " : " + fldDescription[i] + "\n";
	       }
	       break;
	    default:
	       if (obj.value == "" || obj.value == null) {
		  alertMsg += " : " + fldDescription[i] + "\n";
	       }
	 }
      }
   }

   if (alertMsg.length == len_Msg) {
      return true;
      
   }
   else {
      alert(alertMsg);
      return false;
   }
}
