// Global JavaScript functions for Payter

// Popup windows
var newWin = null; 
function popUp(strURL, strType, strHeight, strWidth) { 
 if (newWin != null && !newWin.closed) 
   newWin.close(); 
 var strOptions=""; 
 if (strType=="console") 
   strOptions="resizable,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="fixed") 
   strOptions="status,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="elastic") 
   strOptions="location,status,scrollbars,"+ 
     "resizable,height="+ 
     strHeight+",width="+strWidth; 
 newWin = window.open(strURL, 'newWin', strOptions); 
 newWin.focus();
}

function verify() {
    var valid = true;
    if (document.getElementById("00ND0000003axcn").value == "") {
        document.getElementById("00ND0000003axcn").style.border = "red 1px solid";
        valid = false;
    }
    else {
        document.getElementById("00ND0000003axcn").style.border = "#abadb3 1px solid";
    }
    if (document.workshopform.name.value == "") {
        document.workshopform.name.style.border = "red 1px solid";
        valid = false;
    }
    else {
        document.workshopform.name.style.border = "#abadb3 1px solid";
    }
    if (document.getElementById("00ND0000003axcs").value == "") {
        document.getElementById("00ND0000003axcs").style.border = "red 1px solid";
        valid = false;
    }
    else {
        document.getElementById("00ND0000003axcs").style.border = "#abadb3 1px solid";
    }
    if (document.workshopform.company.value == "") {
        document.workshopform.company.style.border = "red 1px solid";
        valid = false;
    }
    else {
        document.workshopform.company.style.border = "#abadb3 1px solid";
    }
    if (document.getElementById("00ND0000003ay5w").value == "") {
        document.getElementById("00ND0000003ay5w").style.border = "red 1px solid";
        valid = false;
    }
    else {
        document.getElementById("00ND0000003ay5w").style.border = "#abadb3 1px solid";
    }
    if (document.workshopform.email.value == "") {
        document.workshopform.email.style.border = "red 1px solid";
        valid = false;
    }
    else {
        document.workshopform.email.style.border = "#abadb3 1px solid";
    }
    if (document.getElementById("00N20000002lylI").value == "") {
        document.getElementById("00N20000002lylI").style.border = "red 1px solid";
        valid = false;
    }
    else {
        document.getElementById("00N20000002lylI").style.border = "#abadb3 1px solid";
    }
    if (document.getElementById("00N20000002lylc").value == "") {
        document.getElementById("00N20000002lylc").style.border = "red 1px solid";
        valid = false;
    }
    else {
        document.getElementById("00N20000002lylc").style.border = "#abadb3 1px solid";
    }
    if (document.getElementById("00N20000002lylh").value == "") {
        document.getElementById("00N20000002lylh").style.border = "red 1px solid";
        valid = false;
    }
    else {
        document.getElementById("00N20000002lylh").style.border = "#abadb3 1px solid";
    }
    if (document.getElementById("00N20000002lylm").value == "") {
        document.getElementById("00N20000002lylm").style.border = "red 1px solid";
        valid = false;
    }
    else {
        document.getElementById("00N20000002lylm").style.border = "#abadb3 1px solid";
    }
    //alert if fields are empty and cancel form submit
    if (valid == true) {
        document.workshopform.submit();
        return valid;
    }
    else {
        return valid;
    }
}


