function updateProductLayer(f, id) { eval("var radio = f.type_" +id+ ";"); type = ""; for(i=0; i1) { eval("var list = f.qty_" +id+";"); for(i=0; i0) { f.type.value=type; f.submit(); } else { self.alert("Please Select a Product Type"); } } else { // value is singular and is a hidden field f.type.value=radio.value; f.submit(); } } function validateSecureForm(f) { var ccform = false; if ( validateFilled(f.card_name, 'name') && validateFilled(f.cc1, 'Credit card number') && validateFilled(f.cc2, 'Credit card number') && validateFilled(f.cc3, 'Credit card number') && validateFilled(f.cc4, 'Credit card number') && validateNumber(f.cc1, 'Credit card number', 4) && validateNumber(f.cc2, 'Credit card number', 4) && validateNumber(f.cc3, 'Credit card number', 4) ){ var cvv_number=4; if(f.card_type[f.card_type.selectedIndex].value=="Amex") { // validate for 3 CC numbers at end (AMEX cards are 15 in length) cvv_number=4; if(!validateNumber(f.cc4, 'Credit card number', 3)) { return false; } } else { cvv_number=3 if(!validateNumber(f.cc4, 'Credit card number', 4)) { return false; } } // if(!validateNumber(f.card_cvv, 'Credit card security code', cvv_number)) // { // return false; // } var currentMonth = parseInt("02"); var currentYear = parseInt("20"); var ccMonth = parseFloat(f.card_expiry_month[f.card_expiry_month.selectedIndex].value); var ccYear = parseFloat(f.card_expiry_year[f.card_expiry_year.selectedIndex].value); var ccvalid = false; if( ccYear > currentYear || ( ccYear == currentYear && ccMonth >= currentMonth ) ) { // cc is valid return true; } else { self.alert("Please enter a valid expiry date"); return false; } } else { return false; } } function submitSecure(f) { if(validateSecureForm(f)) { f.submit(); } } function backSecureForm(f) { f.section.value="getcc"; f.submit(); } function submitDetails(f) { /* var postage_valid = false; if(f.country[f.country.selectedIndex].value != f.country_original.value) { self.alert("You have changed your Country from when you previously calculated your postage.\n\nPlease click on 'Calculate Postage' again."); return false; } else { if(f.postage_calculated.value==1) { postage_valid = true; } else { self.alert("Please click on 'Calculate Postage' before continuing."); return false; } } */ var postage_valid = true; if(postage_valid) { if(f.country[f.country.selectedIndex].value!="Australia" && f.payment_method[f.payment_method.selectedIndex].value!="credit") { self.alert("You may only pay for your order via Credit Card because you are outside Australia."); return false; } else if (f.payment_method.selectedIndex==0) { self.alert("Please select a payment method."); return false; } else if (validateFilled(f.firstname, 'First Name') && validateFilled(f.surname, 'Surname') && validateEmail(f.email, 'Email Address') && validateFilled(f.postal, 'Postal Address') && validateFilled(f.suburb, 'Suburb/City/Town') && validateFilled(f.postcode, 'Post/Zip Code') && validatePhone(f.phone_home, 'Home Phone') && validatePhone(f.phone_work, 'Work Phone') && validatePhone(f.phone_mobile, 'Mobile Phone') ){ f.submit(); } } } function getPostage(f) { f.action="checkout.php"; f.form_action.value="updatePostage"; f.submit(); } function submit_subscriber(f) { if(validateFilled(f.subscriber_first_name, 'First Name') && validateFilled(f.subscriber_last_name, 'Surname') && validateEmail(f.subscriber_email, 'Email Address')) { f.submit(); } }