zipcodes = Array(); zipcodes[133] = '35901'; zipcodes[134] = '35902'; zipcodes[135] = '35903'; zipcodes[136] = '35904'; zipcodes[137] = '35905'; zipcodes[138] = '35906'; zipcodes[139] = '35907'; zipcodes[140] = '35952'; zipcodes[141] = '35954'; zipcodes[142] = '35956'; zipcodes[143] = '35961'; zipcodes[144] = '35972'; zipcodes[145] = '35990'; zipcodes[146] = '36272'; mv_mailer = new Image(); br_mailer = new Image(); mv_mailer.src = "../images/mv_mailer.jpg"; br_mailer.src = "../images/br_mailer.jpg"; sp_name = Array(); sp_image = Array(); /******************************************************************/ function disp_mailer(mailer) { image = document.getElementById('mailer'); image.height = 500; image.width = 750; image.src = mailer.src; } /******************************************************************/ function disp_sp_form() { chk = document.getElementById('sp_form'); if (chk.checked == true) _clientSideInclude('special_disp', 'select_sp.php'); else _clear('special_disp'); } /******************************************************************/ function disp_sp_dwngrd() { dwngrd_chk = document.getElementById('sp_dwngrd'); if (dwngrd_chk.checked == true) _clientSideInclude('standard_disp', 'select_sp_dwngrd.php'); else _clear('standard_disp'); } /******************************************************************/ function disp_sp_image(id) { image = document.getElementById('sp_image'); image.height = 150; image.width = 300; image.src = sp_image[id].src; _display('sp_name', sp_name[id]); } /******************************************************************/ function reset_(image) { image.height = 0; image.width = 0; image.src = ""; } /******************************************************************/ function validate_mv_form() { if(document.vehicle.mv_number.value == '') { alert("Please enter your Tag Number."); return false; } if(document.vehicle.mv_pin.value == '') { alert("Please enter your Record Number."); return false; } my_return = _submitForm(document.vehicle, 'verify_container'); _clear('form_container'); return my_return; } /******************************************************************/ function chk_fein() { if(document.getElementById('feinchk').value == 'y') { for(i = 0; i < 3; i++) { //document.getElementById('FirstName['+i+']').value = ''; //document.getElementById('LastName['+i+']').value = '' //document.getElementById('DLNumber['+i+']').value = '' //document.getElementById('FirstName['+i+']').disabled = true; //document.getElementById('LastName['+i+']').disabled = true; //document.getElementById('DLNumber['+i+']').disabled = true; //document.getElementById('DLExpirationDateMonth['+i+']').disabled = true; //document.getElementById('DLExpirationDateDay['+i+']').disabled = true; //document.getElementById('DLExpirationDateYear['+i+']').disabled = true; } document.getElementById('FEIN').disabled = false; document.getElementById('FEIN').focus(); }else{ for(i = 0; i < 3; i++) { document.getElementById('FirstName['+i+']').disabled = false; document.getElementById('LastName['+i+']').disabled = false; document.getElementById('DLNumber['+i+']').disabled = false; document.getElementById('DLExpirationDateMonth['+i+']').disabled = false; document.getElementById('DLExpirationDateDay['+i+']').disabled = false; document.getElementById('DLExpirationDateYear['+i+']').disabled = false; } document.getElementById('FEIN').value = ''; document.getElementById('FEIN').disabled = true; document.getElementById('FirstName[0]').focus(); } //return false; } /******************************************************************/ function validate_dlpoc(atLeastCount) { if(document.getElementById('feinchk').value == 'y') { // check FEIN box if(document.getElementById('FEIN').value == '') { alert('You must supply a valid Federal Employer Identification Number to renew this registration.'); return false; } //ret_val = _submitForm(document.dlpoc, 'verify_container'); //return ret_val; } dateToday = 20180816; for(i = 0; i < 3; i++) { if( document.getElementById('DLNumber['+i+']').value != '' && document.getElementById('LastName['+i+']').value != '') { if(document.getElementById('DLExpirationDateYear['+i+']').value != 1900) { dateYear = document.getElementById('DLExpirationDateYear['+i+']').value; if(document.getElementById('DLExpirationDateMonth['+i+']').value.length == 1) dateMonth = '0'+document.getElementById('DLExpirationDateMonth['+i+']').value; else dateMonth = document.getElementById('DLExpirationDateMonth['+i+']').value; if(document.getElementById('DLExpirationDateDay['+i+']').value.length == 1) dateDay = '0'+document.getElementById('DLExpirationDateDay['+i+']').value; else dateDay = document.getElementById('DLExpirationDateDay['+i+']').value; dateExpires = dateYear+dateMonth+dateDay; if(Number(dateExpires) < Number(dateToday)) { alert('Driver\'s License/State ID for '+document.getElementById('FirstName['+i+']').value+' '+document.getElementById('LastName['+i+']').value+' is expired. An expired Driver\'s License/State ID is not an acceptable proof of citizenship.'); return false; }// END date check }// END 1900 check }// END values check }// END for // Make sure at least one DL is input if(!atLeastCount) atLeastCount = 1; Least = 0; atLeast = false; for(i = 0; i < 3; i++) { if( document.getElementById('DLNumber['+i+']').value != '' && document.getElementById('LastName['+i+']').value != '') { Least++; if(Least == atLeastCount) { atLeast = true; break; } } } if(atLeast) { ret_val = _submitForm(document.dlpoc, 'verify_container'); }else{ alert('Please complete the Driver\'s License information for the names listed on the registration.'); } return false; } /******************************************************************/ function validate_br_form() { if(document.boat.br_number.value == '' || document.boat.br_suffix.value == '') { alert("Please both parts of your Decal Number."); return false; } if(document.boat.br_pin.value == '') { alert("Please enter your Record Number."); return false; } my_return = _submitForm(document.boat, 'verify_container'); _clear('form_container'); return my_return; } /******************************************************************/ function validate_br_verify(form) { rdo = false; no_motor = document.getElementById('no_motor'); if(document._verify.hull_serial.value == '') { if(document._verify.hull_serial.value != 'true') { alert("Please enter your hull serial number completely."); return false; } } if(document._verify.motor_serial.value == '') { if (no_motor.checked != true) { if(document._verify.motor_serial.value != 'true') { alert("Please enter your motor serial number."); return false; } } } for(i=form.msd.length-1; i>-1; i--) { if(form.msd[i].checked) { rdo = true; break; } } if(rdo == false) { alert('You must designate whether or not this boat has a Marine Sanitation Device installed. Please select your response and continue again.'); return false; } ret_val = _submitForm(form, 'cart_container'); _clientSideInclude('form_container','br_more.php'); _clear('verify_container'); return ret_val; } /******************************************************************/ function validate_mh_form() { if(document.manf_homes.mh_decal.value == '') { alert("Please enter your Decal #."); return false; } my_return = _submitForm(document.manf_homes, 'verify_container'); _clear('form_container'); return my_return; } /******************************************************************/ function validate_mh_verify(form) { ret_val = _submitForm(form, 'cart_container'); _clientSideInclude('form_container', 'mh_more.php'); _clear('verify_container'); return false; } /******************************************************************/ function validate_mv_verify(form) { ret_val = _submitForm(form, 'cart_container'); _clientSideInclude('form_container', 'mv_more.php'); _clear('verify_container'); return false; } /******************************************************************/ function validate_sm_address(f) { // TODO THIS JAVASCRIPT if(document.saddress.phone.value == "") { alert('Please fill in your phone number.'); document.saddress.phone.focus(); return false; } if(document.saddress.street0.value == "") { alert('Please fill in your street address.'); document.saddress.street0.focus(); return false; } if(document.saddress.city.value == "") { alert('Please fill in your city.'); document.saddress.city.focus(); return false; } if(document.saddress.state.value == "") { alert('Please fill in your state.'); document.saddress.state.focus(); return false; } if(document.saddress.zip.value == "") { alert('Please fill in your ZIP code.'); document.saddress.zip.focus(); return false; } for(i=document.saddress.reason.length-1; i>-1; i--) { if(document.saddress.reason[i].checked) { r_rdo = true; reason=document.saddress.reason[i].value; //alert(reason); break; } } if(r_rdo == false) { alert('Please select the reason for the mailing address.'); return false; } if(document.saddress.hinder0.value == "") { alert('Please fill out all reason fields.'); document.saddress.hinder0.focus(); return false; } if(reason != 'other') { if(document.saddress.hinder1.value == "") { alert('Please fill out all reason fields.'); document.saddress.hinder1.focus(); return false; } } return _submitForm(f, 'form_container'); //alert('passed all'); return false; } /******************************************************************/ function validate_coa_address(f) { // TODO THIS JAVASCRIPT if(document.caddress.phone.value == "") { alert('Please fill in your phone number.'); document.caddress.phone.focus(); return false; } if(document.caddress.street0.value == "") { alert('Please fill in your street address.'); document.caddress.street0.focus(); return false; } if(document.caddress.city.value == "") { alert('Please fill in your city.'); document.caddress.city.focus(); return false; } if(document.caddress.state.value == "") { alert('Please fill in your state.'); document.caddress.state.focus(); return false; } if(document.caddress.zip.value == "") { alert('Please fill in your ZIP code.'); document.caddress.zip.focus(); return false; } if(zipcodes.indexOf(document.caddress.zip.value) == -1) { alert('This ZIP Code is not within Etowah County. Please use the "I\'m out of town" option for a temporary mailing.'); return false; } for(i=document.caddress.city_limits.length-1; i>-1; i--) { if(document.caddress.city_limits[i].checked) { cl_rdo = true; type=document.caddress.city_limits[i].value; break; } } if(cl_rdo == false) { alert('Please select whether or not the address is within the city limits.'); return false; } return _submitForm(f, 'form_container'); //alert('passed all'); return false; } /******************************************************************/ function show_additional(type) { sm = '
'; sm += '
Reason*:
'; sm += '
'; sm += ' Student  '; sm += ' Military  '; sm += '
'; sm += '
'; sm += '
'; sm += '
School/College*:
'; sm += '
'; sm += '
'; sm += '
'; sm += '
Student ID*:
'; sm += '
'; sm += '
'; coa = '
'; coa += '
Inside city limits*?
'; coa += '
Yes  No
'; coa += '
'; switch(type) { case 'sm': _display('additional', sm); break; case 'coa': _display('additional', coa); break; } } /******************************************************************/ function change_hinder(type) { switch(type) { case 'student': _display('hinder0_title', 'School Name*: '); _display('hinder1_title', 'Student #*: '); _display('hinder1_input', ''); break; case 'military': _display('hinder0_title', 'Base*: '); _display('hinder1_title', 'Commanding Officer*: '); _display('hinder1_input', ''); break; case 'other': _display('hinder0_title', 'Other*:'); _display('hinder1_title', ' '); _display('hinder1_input', ' '); break; } } /******************************************************************/ function cancel_poc() { _clear('verify_container'); _clientSideInclude('form_container', 'mh_form.php'); _clientSideInclude('cart_container', 'cart.php?mode=display'); }