    function trim(str) {
      return str.replace(/^\s*|\s*$/g,"");
    }

    function focusElement(targ, strval) {
      targ.className = "tboxover";
      if (trim(targ.value) == strval) {
        targ.value = "";
      }
    }

    function blurElement(targ, strval) {
      targ.className = "tbox";
      if (trim(targ.value) == "") {
        targ.value = strval;
      }
    }

    var fl, msg, sendto

    function checkElement(cb, cbs, listing){
      if (trim(cb.value) == "" || trim(cb.value) == "Email" || trim(cb.value) == "Password" || trim(cb.value) == "Name") {
        fl = 1;
        msg += "       -  "+listing+"\n";
        sendto += ","+cbs;
      }
    }

    function checkSelect(cb, cbs, listing){
      if (cb.selectedIndex == 0) {
        fl = 1;
        msg += "       -  "+listing+"\n";
        sendto += ","+cbs;
      }
    }

    function checkClientLogin(targ){
      fl = 0;
      msg = "";
      sendto = "";
      checkElement(targ.client_email, "client_email", "Email Address");
      checkElement(targ.client_password, "client_password", "Password");
      if (fl == 1) {
        msg = "Please enter a value in the following field(s):            \n"+msg;
      }
      if (targ.client_email.value.indexOf("@") == -1 || targ.client_email.value.indexOf(".") == -1) {
        fl = 1;
        msg += "\nYou have entered an invalid email address.     ";
        sendto += ",client_email";
      }
      if (fl == 0) {
        return true;
      } else {
        alert(msg);
        sendto = sendto.split(",");
        obj = eval("targ."+sendto[1]);
        obj.focus();
        return false;
      }
    }

    function checkYachtSearch(targ){
      fl = 0;
      msg = "";
      sendto = "";
      checkSelect(targ.ys_location, "ys_location", "Location");
      checkSelect(targ.ys_budget, "ys_budget", "Group Budget");
      if (fl == 1) {
        msg = "Please select a value in the following field(s):            \n"+msg;
      }
      if (fl == 0) {
        return true;
      } else {
        alert(msg);
        sendto = sendto.split(",");
        obj = eval("targ."+sendto[1]);
        obj.focus();
        return false;
      }
    }

    function checkSubscription(targ){
      fl = 0;
      msg = "";
      sendto = "";
      checkElement(targ.news_name, "news_name", "Name");
      checkElement(targ.news_email, "news_email", "Email Address");
      if (fl == 1) {
        msg = "Please enter a value in the following field(s):            \n"+msg;
      }
      if (targ.news_email.value.indexOf("@") == -1 || targ.news_email.value.indexOf(".") == -1) {
        fl = 1;
        msg += "\nYou have entered an invalid email address.     ";
        sendto += ",news_email";
      }
      if (fl == 0) {
        return true;
      } else {
        alert(msg);
        sendto = sendto.split(",");
        obj = eval("targ."+sendto[1]);
        obj.focus();
        return false;
      }
    }
	
	function changeRHSimage (newimgsrc1, newimgsrc2) {
	  document.images.rhsimg1.src = newimgsrc1;
	  document.images.rhsimg2.src = newimgsrc2;
	}