function bodyLoaded(){
  loseFocus(document.getElementById('fName'), 'Name');
  loseFocus(document.getElementById('fMail'), 'E-Mail');
  loseFocus(document.getElementById('fText'), 'Brief description of your problem');
}
function hoverOn(element){
  element.style.textDecoration = "underline";
  element.style.color = "#660000";
}
function hoverOff(element){
  element.style.textDecoration = "none";
  element.style.color = "#000000";
}
function showDisclaimer(){
  document.getElementById('disclaimer').style.display = "None";
  document.getElementById('disclaimer2').style.display = "Inline";
}
function maxLength(element, maxValue){
  if (element.value.length > maxValue){
    element.value = element.value.substr(0, maxValue)
  }
}
function gainFocus(element, defaultText){
  element.style.fontStyle = "Normal";
  element.style.color = "#000000";
  if (element.value == defaultText){
    element.value = ""
  }
}
function loseFocus(element, defaultText){
  if (element.value == defaultText || element.value == ""){
    element.style.fontStyle = "italic";
    element.style.color = "#999999";
    element.value = defaultText;
  }
}
function checkAgree(elementId){
  if (document.getElementById(elementId).checked){
    return true;
  }
  else{
    alert("Please review the Important Information and check the box above once you have done so.")
    return false;
  }
}
function checkQuickForm(){
  var stop = "";
  if (document.getElementById('fName').value == "Name" || document.getElementById('fName').value == ""){
    stop = "Please enter a name";
  }
  if (document.getElementById('fMail').value == "E-Mail" || document.getElementById('fMail').value == ""){
    if (stop.length > 0){
      stop += " and an e-mail address";
    }
    else{
      stop = "Please enter an e-mail address";
    }
  }
  if (document.getElementById('fText').value == "Brief description of your problem" || document.getElementById('fText').value == ""){
    if (stop.length > 0){
      stop += " and a brief description of your problem";
    }
    else{
      stop = "Please enter a brief description of your problem";
    }
  }
  if (stop.length > 0){
    stop += " and try again.";
    alert(stop);
    return false;
  }
}

function checkFullForm(){
  var stop = "";
  if (document.getElementById('fullname').value == ""){
    stop = "Please enter your name";
  }
  if (document.getElementById('phone').value == "" && document.getElementById('email').value == ""){
    if (stop.length > 0){
      stop += " and a valid telephone number or e-mail address";
    }
    else{
      stop = "Please enter a valid telephone number or e-mail address";
    }
  }
  if (document.getElementById('pdesc').value == ""){
    if (stop.length > 0){
      stop += " and a brief description of your problem";
    }
    else{
      stop = "Please enter a brief description of your problem";
    }
  }
  if (stop.length > 0){
    stop += " and try again.";
    alert(stop);
    return false;
  }
}
