<!-- Begin

lostoff = new Image();
lostoff.src = "http://www.hphs84.com/images/menu/lost_off.gif";

loston = new Image();
loston.src = "http://www.hphs84.com/images/menu/lost_on.gif";

function imageChange(imageID,imageName) {
  document.images[imageID].src = eval(imageName + ".src");
}

function validate_found() {
    var validated = true;

    if (!validate(document.found_form.finders_name,'Your Name')) {
        validated = false;
        document.found_form.finders_name.focus();
        return validated;}

    if (!checkEmail(document.found_form.finders_email)) {
        validated = false;
        document.found_form.finders_email.focus();
        return validated;}

    if (!validate(document.found_form.last_name,'Current Last Name')) {
        validated = false;
        document.found_form.last_name.focus();
        return validated;}

    if (!checkEmail(document.found_form.email)) {
        validated = false;
        document.found_form.email.focus();
        return validated;}

    if ((document.found_form.email.value.length == 0) &&
        (document.found_form.home_phone.value.length == 0) && 
        (document.found_form.mobile_phone.value.length == 0) && 
        (document.found_form.work_phone.value.length == 0)) {
        alert('Please provide some contact information for the classmate so we can verify they are no longer missing.');
        validated = false;
        document.found_form.email.focus();
        return validated;}

    if (!checkPhone(document.found_form.home_phone,'Home Phone')) {
        validated = false;
        document.found_form.home_phone.focus();
        return validated;}

    if (!checkPhone(document.found_form.mobile_phone,'Mobile Phone')) {
        validated = false;
        document.found_form.mobile_phone.focus();
        return validated;}

    if (!checkPhone(document.found_form.work_phone,'Work Phone')) {
        validated = false;
        document.found_form.work_phone.focus();
        return validated;}

    return validated;
}

function validate_logon() {
    var validated = true;

    if (!validate(document.logon_form.memberid,'Classmate Id')) {
        validated = false;
        document.logon_form.memberid.focus();
        return validated;}

    if (!validate(document.logon_form.password,'Password')) {
        validated = false;
        document.logon_form.password.focus();
        return validated;}

    return validated;
}

function validate_profile() {
    var validated = true;

    if (!validate(document.profile_form.password,'Password')) {
        validated = false;
        document.profile_form.password.focus();
        return validated;}

    if (!validate(document.profile_form.current_first_name,'Current First Name')) {
        validated = false;
        document.profile_form.current_first_name.focus();
        return validated;}

    if (!validate(document.profile_form.current_last_name,'Current Last Name')) {
        validated = false;
        document.profile_form.current_last_name.focus();
        return validated;}

    if (!checkEmail(document.profile_form.email)) {
        validated = false;
        document.profile_form.email.focus();
        return validated;}

    if (!checkPhone(document.profile_form.home_phone,'Home Phone')) {
        validated = false;
        document.profile_form.home_phone.focus();
        return validated;}

    if (!checkPhone(document.profile_form.mobile_phone,'Mobile Phone')) {
        validated = false;
        document.profile_form.mobile_phone.focus();
        return validated;}

    if (!checkPhone(document.profile_form.work_phone,'Work Phone')) {
        validated = false;
        document.profile_form.work_phone.focus();
        return validated;}

    return validated;
}

function validate_sendinfo() {
    var validated = true;

    if (!validate(document.sendinfo_form.email,'E-mail Address')) {
        validated = false;
        document.sendinfo_form.email.focus();
        return validated;}

    if (!checkEmail(document.sendinfo_form.email)) {
        validated = false;
        document.sendinfo_form.email.focus();
        return validated;}

    return validated;
}

function validate_update() {
    var validated = true;

    if (!validate(document.update_form.current_first_name,'Current First Name')) {
        validated = false;
        document.update_form.current_first_name.focus();
        return validated;}

    if (!validate(document.update_form.current_last_name,'Current Last Name')) {
        validated = false;
        document.update_form.current_last_name.focus();
        return validated;}

    if (!checkEmail(document.update_form.email)) {
        validated = false;
        document.update_form.email.focus();
        return validated;}

    return validated;
}

function validate(object,text) {
    if (object.value.length > 0)
        return true;
    else {
        alert(text + ' is required.');
        return false;
    }
}

function checkEmail(object) {
    if (object.value.length == 0)
      return true;
    else {
        if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(object.value))
            return true;
        else {
            alert('Invalid E-mail Address, please re-enter.');
            return false;
        }
    }
}

function checkPhone(object,text) {
    var numval = object.value;
    var valid = numval.search(/^\d\d\d-\d\d\d-\d\d\d\d$/);

    if (object.value.length == 0)
      return true;
    else {
      if (valid != 0) {
        alert('The ' + text + ' number is not in the requested format, please re-enter.');
        return false; }
      else
        return true;
    }
}

function textCopy(from_field, to_field) {
    to_field.value = from_field.value;
}

function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value = (maxlimit - field.value.length) + ' characters left';
}

function sendMail(domain,to) {
  window.navigate("mailto:" + to + "@" + domain);
} 

// End -->
