
var evalhold = new Array();
var evalothertexthold = "";
function cleareval() {
  var g=0;
  if (document.theForm.evalnone.checked == true) {
    for (i=0; i< document.theForm.elements.length; i++) {
      if (document.theForm.elements[i].type == "checkbox" && String(document.theForm.elements[i].name).substring(0,4) == "eval") {
        evalhold[g++] = document.theForm.elements[i].checked
        document.theForm.elements[i].checked = false;
        document.theForm.elements[i].disabled = true;
      }
    }
    evalothertexthold = document.theForm.evalothertext.value;
    document.theForm.evalothertext.value = "";
    document.theForm.evalothertext.disabled = true;
    document.theForm.evalnone.disabled = false;
    document.theForm.evalnone.checked = true;

  } else {
    for (i=0; i< document.theForm.elements.length; i++) {
      if (document.theForm.elements[i].type == "checkbox" && String(document.theForm.elements[i].name).substring(0,4) == "eval") {
        document.theForm.elements[i].checked = evalhold[g++];
        document.theForm.elements[i].disabled = false;
      }
    }
    document.theForm.evalnone.checked = false;
    if (document.theForm.evalother.checked==true) { document.theForm.evalothertext.value = evalothertexthold; }
    document.theForm.evalothertext.disabled = false;
  }
}

function calculate() {
  document.theForm.stotal.value = '$' + (parseFloat(document.theForm.scost.value.replace(/[\$, ]/g, "")) + parseFloat(document.theForm.sfund.value.replace(/[\$, ]/g, "")));
  document.theForm.mtotal.value = '$' + (parseFloat(document.theForm.mcost.value.replace(/[\$, ]/g, "")) + parseFloat(document.theForm.mfund.value.replace(/[\$, ]/g, "")));
  document.theForm.ototal.value = '$' + (parseFloat(document.theForm.ocost.value.replace(/[\$, ]/g, "")) + parseFloat(document.theForm.ofund.value.replace(/[\$, ]/g, "")));
  document.theForm.gtotal.value = '$' + (parseFloat(document.theForm.stotal.value.replace(/[\$, ]/g, "")) + parseFloat(document.theForm.mtotal.value.replace(/[\$, ]/g, "")) + parseFloat(document.theForm.ototal.value.replace(/[\$, ]/g, "")));
  document.theForm.gcost.value  = '$' + (parseFloat(document.theForm.scost.value.replace(/[\$, ]/g, "")) + parseFloat(document.theForm.mcost.value.replace(/[\$, ]/g, "")) + parseFloat(document.theForm.ocost.value.replace(/[\$, ]/g, "")));
  document.theForm.gfund.value  = '$' + (parseFloat(document.theForm.sfund.value.replace(/[\$, ]/g, "")) + parseFloat(document.theForm.mfund.value.replace(/[\$, ]/g, "")) + parseFloat(document.theForm.ofund.value.replace(/[\$, ]/g, "")));
  return true;		    
}			    

function coston() {
  document.theForm.cost.disabled=false;
  document.theForm.cost.value=costhold;
}

var locationhold = new Array();

function locationoff(where) {
  var g=0;
  for (i=0; i< document.theForm.elements.length; i++) {
   if (document.theForm.elements[i].type == "text" && String(document.theForm.elements[i].name).substring(0,8) == "location") {
     if (document.theForm.elements[i].value != where) {
       locationhold[g++] = document.theForm.elements[i].value
     }
     document.theForm.elements[i].value = where;
     //document.theForm.elements[i].disabled = true;
   }
  }
}

function locationon() {
  var g=0;
  for (i=0; i< document.theForm.elements.length; i++) {
   if (document.theForm.elements[i].type == "text" && String(document.theForm.elements[i].name).substring(0,8) == "location") {
     document.theForm.elements[i].disabled = false;
     if (locationhold[g]) {
       document.theForm.elements[i].value = locationhold[g++];
     } else { document.theForm.elements[i].value = ""; }
   }
  }
}

function changeclear(elmt, defaulttext) {
  if(String(elmt.value).substring(0,4)==defaulttext){
    elmt.value="";
  }
}

function killcontact(x) {
if (x.checked==true) {
document.theForm.contactn.value=document.theForm.facultyn.value;
document.theForm.contactp.value=document.theForm.facultyp.value;
document.theForm.contacte.value=document.theForm.facultye.value;
}
return true;
}

