var popper = null; function choice() { var e = document.getElementById("form1").value; if (e == "new") {document.getElementById("form1").action = "index2.html";} else {document.getElementById("form1").action = "index3.html";} } function memo() { if (popper && popper.open) {popper.close();} var dest="newsletter.html"; popper = window.open(dest,"popMap","scrollbars=yes,toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,copyhistory=0,width=550,height=500"); return; } function checktix() { if (document.form1.name.value=="") {alert("Please enter YOUR FULL NAME ...");document.form1.name.focus();document.form1.name.select();return false;} if (document.form1.phone1.value=="") {alert("Please enter YOUR AREA CODE ...");document.form1.phone1.focus();document.form1.phone1.select();return false;} if (document.form1.phone2.value=="") {alert("Please enter YOUR FULL TELEPHONE NUMBER ...");document.form1.phone2.focus();document.form1.phone2.select();return false;} if (document.form1.phone3.value=="") {alert("Please enter YOUR FULL TELEPHONE NUMBER ...");document.form1.phone3.focus();document.form1.phone3.select();return false;} if (document.form1.email.value=="") {alert("Please enter YOUR E-MAIL ADDRESS ...");document.form1.email.focus();document.form1.email.select();return false;} if (document.getElementById("affilPPB") && document.getElementById("affilOTHER")) { if (document.getElementById("affilPPB").checked==false && document.getElementById("affilOTHER").value=="") { alert("Please indicate YOUR AFFILIATION ...");document.form1.affilPPB.focus();return false; } } var e = document.getElementById("numtix"); var totNum = e.options[e.selectedIndex].value; if (totNum == 0) {alert("Please SELECT THE NUMBER OF TICKETS ...");document.form1.numtix.focus();return false;} s = document.getElementById("tixmeat"); var steak = s.options[s.selectedIndex].value; f = document.getElementById("tixfish"); var fish = f.options[f.selectedIndex].value; v = document.getElementById("tixfruit"); var fruit = v.options[v.selectedIndex].value; var totMeals = parseInt(steak)+parseInt(fish)+parseInt(fruit); if (totMeals != totNum) {alert("The NUMBER OF TICKETS and NUMBER OF MEALS don't match ...");document.form1.numtix.focus();return false;} // check the credit card information // e = document.getElementById("ccnum"); // var cardnum = e.value; // var oneDigit = cardnum.substring(0,1); // e = document.getElementById("cctype"); // var selCard = e.options[e.selectedIndex].value; // if (selCard == "Visa" && oneDigit != 4) {alert("You have not entered a valid Visa card number ... please check and re-enter ...");document.form1.ccnum.focus();document.form1.ccnum.select();return false;} // else if (selCard == "Mastercard" && oneDigit != 5) {alert("You have not entered a valid Mastercard card number ... please check and re-enter ...");document.form1.ccnum.focus();document.form1.ccnum.select();return false;} // else if (selCard == "American Express" && oneDigit != 3) {alert("You have not entered a valid American Express card number ... please check and re-enter ...");document.form1.ccnum.focus();document.form1.ccnum.select();return false;} // else if (selCard == "Discover" && oneDigit != 6) {alert("You have not entered a valid Discover card number ... please check and re-enter ...");document.form1.ccnum.focus();document.form1.ccnum.select();return false;} // if (luhnCheck() === !1) { // alert("We can't validate the Credit Card Number you entered - please check the number and re-type ..."); // document.form1.ccnum.focus(); // document.form1.ccnum.select(); // return false; // } // if (!checkDate()) {alert("You have entered an INVALID EXPIRATION DATE - please check and re-type ...");document.form1.xmonth.focus();return false;} // var cvvValue = document.form1.cvv.value; // if (cvvValue.length == 4 && selCard != "American Express") {alert("You have entered an INVALID CVV NUMBER ... please check and re-enter ...");document.form1.cvv.focus();document.form1.cvv.select();return false;} // else if (cvvValue.length == 3 && (selCard != "Visa" && selCard != "Mastercard" && selCard != "Discover")) {alert("You have entered an INVALID CVV NUMBER ... please check and re-enter ...");document.form1.cvv.focus();document.form1.cvv.select();return false;} } function luhnCheck() { var e = document.getElementById("ccnum"); var val = e.value; var nondigits = new RegExp(/[^0-9]+/g); var number = val.replace(nondigits,''); var pos, digit, i, sub_total, sum = 0; var strlen = number.length; if(strlen < 13){return false;} for(i=0;i 9) { sub_total = 1 + (sub_total - 10); } } else {sub_total = digit;} sum += sub_total; } if (sum > 0 && (sum % 10) == 0) {return true;} else {return false;} } function checkDate() { // set current month and year var right_now=new Date(); var this_year=right_now.getYear()+1900; var this_month=right_now.getMonth(); // get selected month and year var e = document.getElementById("xmonth"); var selMonth = e.options[e.selectedIndex].value; selMonth = parseInt(selMonth,10); e = document.getElementById("xyear"); var selYear = e.options[e.selectedIndex].value; // disallow past month/year if (selYear == this_year && selMonth < this_month) {return false;} return(true); } function preload() { document.form1.numtix.value = parseInt(tsfrTix); document.form1.numtixDiscount.value = parseInt(tsfrTix-1); return recalc(); } function addMeal() { var meat = parseInt(document.getElementById("tixmeat").value); var fish = parseInt(document.getElementById("tixfish").value); var fruit = parseInt(document.getElementById("tixfruit").value); var totNum = parseInt(meat+fish+fruit); if (totNum == 0) { document.getElementById("numtix").value = 0; document.getElementById("numtixDiscount").value = 0; } else if (totNum > 1) { document.getElementById("numtix").value = 1; document.getElementById("numtixDiscount").value = parseInt(totNum-1); } else if (totNum > 0) { document.getElementById("numtix").value = 1; document.getElementById("numtixDiscount").value = 0; } return recalc(); } function recalc() { if (document.getElementById("numtix").value) {var totNum1 = document.getElementById("numtix").value;} else {var totNum1 = 0;} if (totNum1>0) {var totcost1 = totNum1*tix1;} else {var totcost1 = 0;} document.form1.runtot.value = totcost1.toFixed(2); if (document.getElementById("numtixDiscount").value) {var totNum2 = document.getElementById("numtixDiscount").value;} else {var totNum2 = 0;} if (totNum2>0) {var totcost2 = totNum2*tix2;} else {var totcost2 = 0;} document.form1.runtotDiscount.value = totcost2.toFixed(2); var totalCharge = parseInt(totcost1+ totcost2); document.form1.totCharge.value = totalCharge.toFixed(2); return; }