var isNN = (navigator.appName.indexOf("Netscape")!=-1); var phone; var formid = 1; function autoTab(input,len, e) { // Auto tab to next input field var keyCode = (isNN) ? e.which : e.keyCode; var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46]; if(input.value.length >= len && !containsElement(filter,keyCode)) { input.value = input.value.slice(0, len); input.form[(getIndex(input)+1) % input.form.length].focus(); }} function containsElement(arr, ele) { var found = false, index = 0; while(!found && index < arr.length) if(arr[index] == ele) found = true; else index++; return found; } function getIndex(input) { var index = -1, i = 0, found = false; while (i < input.form.length && index == -1) if (input.form[i] == input)index = i; else i++; return index; } function intOnly(i) { // allow numeric input only if(i.value.length>0) { i.value = i.value.replace(/[^\d]+/g, ''); }} function CheckZero(f) { if (f.elements['amount'].value=="0.00") {alert ('No items selected.'); return false;} return true} function fillzip(form) { // formcna: initialize zip and area code based on selected city if (form.city.value=="Belle Meade") {form.zip.value="08502"; form.night_phone_a.value="908";} if (form.city.value=="Branchburg") {form.zip.value="08876"; form.night_phone_a.value="908";} if (form.city.value=="Columbus") {form.zip.value="08022"; form.night_phone_a.value="609";} if (form.city.value=="Cranbury") {form.zip.value="08512"; form.night_phone_a.value="609";} if (form.city.value=="Dayton") {form.zip.value="08810"; form.night_phone_a.value="732";} if (form.city.value=="East Brunswick") {form.zip.value="08816"; form.night_phone_a.value="732";} if (form.city.value=="East brunswick") {form.zip.value="08816"; form.night_phone_a.value="732";} if (form.city.value=="East Windsor") {form.zip.value="08512"; form.night_phone_a.value="609";} if (form.city.value=="East windsor") {form.zip.value="08512"; form.night_phone_a.value="609";} if (form.city.value=="Edison") {form.zip.value="08817"; form.night_phone_a.value="732";} if (form.city.value=="Ewing Township") {form.zip.value="08618"; form.night_phone_a.value="609";} if (form.city.value=="Ewing township") {form.zip.value="08618"; form.night_phone_a.value="609";} if (form.city.value=="Franklin Park") {form.zip.value="08823"; form.night_phone_a.value="732";} if (form.city.value=="Franklin park") {form.zip.value="08823"; form.night_phone_a.value="732";} if (form.city.value=="Highland Park") {form.zip.value="08904"; form.night_phone_a.value="732";} if (form.city.value=="Highland park") {form.zip.value="08904"; form.night_phone_a.value="732";} if (form.city.value=="Hillsborough") {form.zip.value="08844"; form.night_phone_a.value="908";} if (form.city.value=="Jamesburg") {form.zip.value="08831"; form.night_phone_a.value="609"; } if (form.city.value=="Kendall Park") {form.zip.value="08824"; form.night_phone_a.value="732"; } if (form.city.value=="Kendall park") {form.zip.value="08824"; form.night_phone_a.value="732"; } if (form.city.value=="Kingston") {form.zip.value="08528"; form.night_phone_a.value="609"; } if (form.city.value=="Lawrenceville") {form.zip.value="08648"; form.night_phone_a.value="609";} if (form.city.value=="Manville") {form.zip.value="08835"; form.night_phone_a.value="908";} if (form.city.value=="Marlboro") {form.zip.value="07746"; form.night_phone_a.value="732";} if (form.city.value=="Milltown") {form.zip.value="08850"; form.night_phone_a.value="732";} if (form.city.value=="Monmouth Junction") {form.zip.value="08852"; form.night_phone_a.value="732";} if (form.city.value=="Monmouth junction") {form.zip.value="08852"; form.night_phone_a.value="732";} if (form.city.value=="Monroe Township") {form.zip.value="08831"; form.night_phone_a.value="609";} if (form.city.value=="Monroe township") {form.zip.value="08831"; form.night_phone_a.value="609";} if (form.city.value=="New Brunswick") {form.zip.value="08901"; form.night_phone_a.value="732";} if (form.city.value=="New brunswick") {form.zip.value="08901"; form.night_phone_a.value="732";} if (form.city.value=="North Brunswick") {form.zip.value="08902"; form.night_phone_a.value="732";} if (form.city.value=="North brunswick") {form.zip.value="08902"; form.night_phone_a.value="732";} if (form.city.value=="Old Bridge") {form.zip.value="08857"; form.night_phone_a.value="732";} if (form.city.value=="Old bridge") {form.zip.value="08857"; form.night_phone_a.value="732";} if (form.city.value=="Piscataway") {form.zip.value="08854"; form.night_phone_a.value="732";} if (form.city.value=="Plainsboro") {form.zip.value="08536"; form.night_phone_a.value="609";} if (form.city.value=="Princeton") {form.zip.value="08540"; form.night_phone_a.value="609";} if (form.city.value=="Princeton Junction") {form.zip.value="08560"; form.night_phone_a.value="609";} if (form.city.value=="Princeton junction") {form.zip.value="08560"; form.night_phone_a.value="609";} if (form.city.value=="Robbinsville") {form.zip.value="08691"; form.night_phone_a.value="609";} if (form.city.value=="Sayreville") {form.zip.value="08872"; form.night_phone_a.value="732";} if (form.city.value=="Skillman") {form.zip.value="08558"; form.night_phone_a.value="609";} if (form.city.value=="Somerset") {form.zip.value="08873"; form.night_phone_a.value="732";} if (form.city.value=="West Windsor") {form.zip.value="08850"; form.night_phone_a.value="732";} if (form.city.value=="West windsor") {form.zip.value="08850"; form.night_phone_a.value="732";} if ((form.night_phone_a.value=="732") || (form.night_phone_a.value=="908") || (form.night_phone_a.value=="609") || (form.night_phone_a.value=="848")) {document.getElementById("NJ").selected = true; form.country.value="US"; document.info.night_phone_b.focus(); }} function checkZip(field) { if (document.info.country.value=="CA") { reZip = new RegExp(/^\s*[a-ceghj-npr-tvxy]\d[a-z](\s)?\d[a-z]\d\s*$/i); if (!reZip.test(field)) { alert('Invalid Canadian postal code.'); return false; } return true; } else { var valid = "0123456789-"; var hyphencount = 0; if (field.length!=5 && field.length!=10) { alert('Zip format must be: "12345" or "12345-1234" '); return false; } for (var i=0; i < field.length; i++) { temp = "" + field.substring(i, i+1); if (temp == "-") hyphencount++; if (valid.indexOf(temp) == "-1") { alert('Zip format must be: "12345" or "12345-1234"'); return false; } if ((hyphencount > 1) || ((field.length==10) && ""+field.charAt(5)!="-")) { alert('Zip format must be: "12345" or "12345-1234"'); return false; }} return true; } } function setCountry(form) { // onClick state if ((form.state.value=="AB") || (form.state.value=="BC") || (form.state.value=="NF") || (form.state.value=="MB") || (form.state.value=="NB") || (form.state.value=="NS") || (form.state.value=="NT") || (form.state.value=="ON") || (form.state.value=="PE") || (form.state.value=="QC") || (form.state.value=="SK") || (form.state.value=="YT")) form.country.value="CA"; else form.country.value="US"; } cities = new Array( "Belle Meade", "Branchburg", "Columbus", "Cranbury", "Dayton", "East Brunswick", "East Windsor", "Edison", "Ewing Township", "Franklin Park", "Highland Park", "Hillsborough", "Jamesburg", "Kingston", "Kendall Park", "Lawrenceville", "Manville", "Marlboro", "Milltown", "Monmouth Junction", "Monroe Township", "New Brunswick", "North Brunswick", "Old Bridge", "Piscataway", "Plainsboro", "Princeton", "Princeton Junction", "Robbinsville", "Sayreville", "Skillman", "Somerset", "West Windsor" ); function Complete(obj, evt) { // auto-complete city field if ((!obj) || (!evt) || (cities.length == 0)) { return; } if (obj.value.length == 0) { return; } var elm = (obj.setSelectionRange) ? evt.which : evt.keyCode; if ((elm < 32) || (elm >= 33 && elm <= 46) || (elm >= 112 && elm <= 123)) { return; } var txt = obj.value.replace(/;/gi, ","); elm = txt.split(","); txt = elm.pop(); txt = txt.replace(/^\s*/, ""); if (txt.length == 0) { return; } if (obj.createTextRange) { var rng = document.selection.createRange(); if (rng.parentElement() == obj) { elm = rng.text; var ini = obj.value.lastIndexOf(elm); } } else if (obj.setSelectionRange) { var ini = obj.selectionStart; } for (var i = 0; i < cities.length; i++) { elm = cities[i].toString(); if (elm.toLowerCase().indexOf(txt.toLowerCase()) == 0) { obj.value += elm.substring(txt.length, elm.length); break; }} if (obj.createTextRange) { rng = obj.createTextRange(); rng.moveStart("character", ini); rng.moveEnd("character", obj.value.length); rng.select(); } else if (obj.setSelectionRange) { obj.setSelectionRange(ini, obj.value.length); }} function clrzip(form) { // clear zip and area codes when reselecting city form.zip.value = " "; form.night_phone_a.value= " "; } function initialCap(field) { // Capitalize first letter of text field field.value = field.value.substr(0, 1).toUpperCase() + field.value.substr(1); } function checkEmail(field) { // validate email address if (field.value=="") { return (true) } if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(field.value)){ return (true) } alert("Invalid E-mail Address! Please re-enter.") return (false) phone = "("+night_phone_a+") "+night_phone_b+"-"+night_phone_c; } function checkCR(evt) { // prevent CR from sending form data var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if ((evt.keyCode == 13) && (node.type=="text")) {return false;} } var Array732 = new Array("('732','',true,true)", "('908')","('609')","('848')","(' ')"); var Array908 = new Array("('908','',true,true)", "('732')","('609')","('848')","(' ')"); var Array609 = new Array("('609','',true,true)", "('908')","('732')","('848')","(' ')"); function populateArea(inForm,selected) { document.info.phone.focus(); var selectedArray = eval("Array" + selected) ; while (selectedArray.length < inForm.Area.options.length) { inForm.Area.options[(inForm.Area.options.length - 1)] = null; } for (var i=0; i < selectedArray.length; i++) { eval("inForm.Area.options[i]=" + "new Option" + selectedArray[i]); } if (inForm.City.options[0].value == '') { inForm.City.options[0]= null; if ( navigator.appName == 'Netscape') { if (parseInt(navigator.appVersion) < 4) { window.history.go(0); } else { if (navigator.platform == 'Win32' || navigator.platform == 'Win16') { window.history.go(0); } } } } } function checkrequired(which) { var pass=true; if (document.images) { for (i=0;i'); document.write(''); document.write(''); } else { document.write(''); document.write(''); document.write(''); document.write('
'); document.write(''); document.write('
'); document.write('
'); document.write(''); document.write(''); document.write("") }} else { if ( title=='end' ) { document.write('   "); var align='left'; if ( sendto == 'right' ) align='right'; document.write(''); document.write('
'); } else { formid = formid + 1 document.write('
'); document.write(''); document.write(''); document.write(""); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write('
' + title + ''); if (optext == null) optext = ' '; document.write(optext+'
'); } } } function countLines(strtocount, cols) { var hard_lines = 1; var last = 0; while ( true ) { last = strtocount.indexOf("\n", last+1); hard_lines ++; if ( last == -1 ) break; } var soft_lines = Math.round(strtocount.length / (cols-1)); var hard = eval("hard_lines " + unescape("%3e") + "soft_lines;"); if ( hard ) soft_lines = hard_lines; return soft_lines; } function cleanForm() { var the_form = document.forms[0]; for ( var x in the_form ) { if ( ! the_form[x] ) continue; if ( typeof the_form[x].rows != "number" ) continue; the_form[x].rows = countLines(the_form[x].value,the_form[x].cols) +1; } setTimeout("cleanForm();", 300); } function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } } function formcna(styles,color) { var cnacolor = "#f0fff0"; if (typeof color != "undefined") cnacolor = color; if (styles == "print") { document.write("
Name  "); document.write("
Address  "); document.write("
City/State/Zip  "); document.write("          Phone '); document.write('
E-mail 
'); } else { if (styles == "email") { document.write(''); } else { document.write(''); } document.write('
'); document.write(''); document.write('When your city appears...  hit the TAB key, enter your phone number and email.'); document.write('Name  '); document.write(''); document.write('Enter email address to receive
confirmation of your payment.
'); document.write(''); document.write(''); } else { document.write(' value="Last (Enter names as if using your credit card.)" '); document.write('onfocus="if (this.value==\'Last (Enter names as if using your credit card.)\'){this.value=\'\';};return false;" '); document.write('onblur="{if (this.value==\'\'){this.value=\'Last (Enter names as if using a credit card.)\';return false;}; initialCap(this);}">'); } document.write('
Address  '); document.write('
City  '); document.write('   State  Zip '); document.write('  Ctry '); document.write('
Phone  '); document.write('-'); document.write(''); document.write('-'); document.write('     Email
'); }} addLoadEvent(function() { cleanForm();} ); document.onkeypress = checkCR;