var popper = null; var singleTic = 32; var dblTic = 52; 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.fname.value=="") {alert("Please enter YOUR FIRST NAME ...");document.form1.fname.focus();document.form1.fname.select();return false;} if (document.form1.lname.value=="") {alert("Please enter YOUR LAST NAME ...");document.form1.lname.focus();document.form1.lname.select();return false;} if (document.form1.phone1.value.length < 3) {alert("Please enter YOUR AREA CODE ...");document.form1.phone1.focus();document.form1.phone1.select();return false;} if (document.form1.phone2.value.length < 3) {alert("Please enter YOUR FULL TELEPHONE NUMBER ...");document.form1.phone2.focus();document.form1.phone2.select();return false;} if (document.form1.phone3.value.length < 4) {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;} var e1 = document.getElementById("numtix1").value; var eSam = document.getElementById("numtixSam").value; var eDavid = document.getElementById("numtixDavid").value; var totaltix = (e1 + eSam + eDavid); if (totaltix < 1) {alert("Please ORDER AT LEAST ONE TICKET ...");document.form1.numtix1.focus();return false;} var steak = 0; var fish = 0; var fruit = 0; var totMeals = 0; return recalc(); } 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("numtixDavid").value) {var totNum3 = document.getElementById("numtixDavid").value;} else {var totNum3 = 0;} if (totNum3>0) {var totcost3 = totNum3*singleTic;} else {var totcost3 = 0;} var totalCharge = parseInt(totcost3); document.form1.totCharge.value = totalCharge.toFixed(2); return; }