function appearVis(obj) {
  if (obj.style.visibility == "hidden") {
    obj.style.visibility = "visible";
  } else {
    obj.style.visibility = "hidden";
  }
}

function appearDis(obj) {
  if (obj.style.display == "none") {
    obj.style.display = "";
  } else {
    obj.style.display = "none";
  }
}

function hideshow(w) {  // which is a reserved keyword
        if(document.getElementById){
                w = eval('document.getElementById("'+w+'").style');
                w.display = "none" == w.display ? "" : "none";
        }
}

function show(w) {  // which is a reserved keyword
        if(document.getElementById){
                w = eval('document.getElementById("'+w+'").style');
                w.display = "";
        }
}

function hide(w) {  // which is a reserved keyword
        if(document.getElementById){
                w = eval('document.getElementById("'+w+'").style');
                w.display = "none";
        }
}

function calcTotal(qty,price,item) {
    item.value = (qty * price);
}

function calcGrand() {
     matReq.subtotal.value = eval(matReq.tc1.value) + eval(matReq.tc2.value) + eval(matReq.tc3.value) + eval(matReq.tc4.value) + eval(matReq.tc5a.value) + eval(matReq.tc5b.value) + eval(matReq.tc5c.value) + eval(matReq.tc6.value) + eval(matReq.tc7.value) + eval(matReq.tc8.value) + eval(matReq.tc9.value) + eval(matReq.tc10.value) + eval(matReq.tc11.value) + eval(matReq.tc12.value) + eval(matReq.tc13.value) + eval(matReq.tc14.value) + eval(matReq.tc15.value) + eval(matReq.tc16.value);
     matReq.total.value = matReq.subtotal.value;
}

function checkQty(minqty,qty,n) {
    if ((qty < minqty) && !(qty == "") && !(qty == 0)) {
        alert("The minimum quantity for this item is " + minqty + " units.");
        n.select();
        n.focus();
    }
}

function confirmCleanUp() {   if (confirm("Are you sure you want to quit this application?")) {      cleanUp()   }}

function notMovedPopup (mover_id,zip) {
	thewindow = window.open('http://www.ourtownamerica.com/survey/notMoved.php?ot[mover_id]='+mover_id+'&ot[zip]='+zip, 'notMoved', config='height=400,width=700,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=yes');
}

function SponsorPopup (mover_id,zip) {
	thewindow = window.open('http://www.ourtownamerica.com/survey/sponsor_comments.php?ot[mover_id]='+mover_id+'&ot[zip]='+zip, 'notMoved', config='height=500,width=700,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=yes');
}