function preload() { image_list = new Array(); image_list[0] = 'buttons/button_bg_hover_narrow.png'; image_list[1] = 'buttons/button_bg_hover.png'; image_list[2] = 'buttons/button_bg_hover_wide.png'; image_list[3] = 'buttons/button_bg_hover_ewide.png'; image_list[4] = 'buttons/button_bg_hover_eewide.png'; image_list[5] = 'wheelchair_hover.png'; for (i=0; i 12) {mm_fail = true;} if (yy < year) {yy_fail = true;} else if (yy == year) { if (mm >= month) {mm_fail = false; yy_fail = false;} } } else {mm_fail = true; yy_fail = true;} if ((mm_fail == true) || (yy_fail == true)) { if (acc == true) { if (mm_fail == true) { document.getElementById('mm').style.backgroundColor = 'red'; } if (yy_fail == true) { document.getElementById('yy').style.backgroundColor = 'red'; } } else { document.getElementById('expdate_img').src = 'https://www.radarkey.org/images/cross.png'; } valid = false; } else { document.getElementById('expdate_img').src = 'https://www.radarkey.org/images/tick.png'; } card_type = document.getElementById('card_type').value; if (card_type == 'Maestro') { issue = document.getElementById('issue').value; mm = document.getElementById('s_mm').value; yy = document.getElementById('s_yy').value; if (issue == '') { if ((mm != '') && (yy != '')) { if ((mm != 'mm') && (yy != 'yy')) { mm = parseInt(mm, 10); yy = parseInt(yy, 10); if (mm <= 12) { if (yy <= year) { card_fail = false; } else if (yy == year) { if (mm <= month) { card_fail = false; } else {card_fail = true;} } else {card_fail = true;} } else {card_fail = true;} } else {card_fail = true;} } else {card_fail = true;} } else {card_fail = false;} if (card_fail == true) { if (acc == 'true') { document.getElementById('issue').style.backgroundColor = 'red'; document.getElementById('s_mm').style.backgroundColor = 'red'; document.getElementById('s_yy').style.backgroundColor = 'red'; } else { document.getElementById('issue_img').src = 'https://www.radarkey.org/images/cross.png'; document.getElementById('startdate_img').src = 'https://www.radarkey.org/images/cross.png'; } valid = false; } else { if (issue != '') { document.getElementById('issue_img').src = 'https://www.radarkey.org/images/tick.png'; } else { document.getElementById('startdate_img').src = 'https://www.radarkey.org/images/tick.png'; } } } if (valid === true) { document.getElementById('pay_now').disabled = true; document.getElementById('pay_now').value = 'Just a sec...'; // if (document.getElementById('jwt')) {check_payment();} else {return true;} return true; } else { // document.getElementById('about_you_error').style.display = 'inline'; return false; } } function hide_maestro() { document.getElementById('maestro_1').innerHTML = ""; document.getElementById('maestro_2').innerHTML = ""; document.getElementById('maestro_3').innerHTML = ""; document.getElementById('maestro_4').innerHTML = ""; } function show_maestro() { card_type = document.getElementById('card_type').value; if (card_type == 'Maestro') { document.getElementById('maestro_1').innerHTML = "Start date (maestro)"; document.getElementById('maestro_2').innerHTML = " / "; document.getElementById('maestro_3').innerHTML = "Issue number (maestro)"; document.getElementById('maestro_4').innerHTML = ""; } else { hide_maestro(); } } function show_email() { email = document.getElementById('you_email').value; email.trim; email = email.replace(/[^0-9a-zA-Z,._\-\.\@]/g, ''); document.getElementById('you_email').value = email; var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,63})$/; if ((email != '') && (reg.test(email) === true)) { document.getElementById('email_checks').style.display = 'inline'; } else { document.getElementById('email_checks').style.display = 'none'; } } function check_email(acc) { document.getElementById('you_email').style.backgroundColor = ''; document.getElementById('you_email_img').src = 'https://www.radarkey.org/images/blank.png'; email = document.getElementById('you_email').value; email.trim; if (email != '') { var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,63})$/; if (reg.test(email) !== true) { if (acc == 'true') { document.getElementById('you_email').style.backgroundColor = 'red'; } else { document.getElementById('you_email_img').src = 'https://www.radarkey.org/images/cross.png'; } return false; } else { document.getElementById('you_email_img').src = 'https://www.radarkey.org/images/tick.png'; return true; } } } function clean_email(box_name) { email = document.getElementById(box_name).value; email = email.trim(); email = email.replace(/[^0-9A-Za-z_\-\.@!#\$%&\'\*\+-\/\=\?\^_`{\|}~]/g, ''); document.getElementById(box_name).value = email; } function apply_validation() { tocheck = new Array(3); tocheck[0] = 'name'; tocheck[1] = 'phone'; tocheck[2] = 'company'; valid = true; for (i=0; i 0) { if (split_total[1].length === 2) { pass = true; } } } */ if (pass == true) {return true;} else { document.getElementById('order_total_img').src = 'https://www.radarkey.org/images/cross.png'; return false; } } function show(text_box) { document.getElementById(text_box).style.display = 'inline'; } function show_locks(prod_id) { document.getElementById('show_locks').style.display = 'none'; document.getElementById('prices_locks').style.display = 'block'; if (prod_id !== '') { lock_id = 'prod_' + prod_id; height_to_move = document.getElementById(lock_id).offsetTop; window.scroll(0, height_to_move); } } function country_show() { document.getElementById('confirm_vat').style.display = 'none'; document.getElementById('update_postage_1').style.display = 'inline'; document.getElementById('update_postage_2').style.display = 'none'; country_list = new Array(29); country_list[0] = 'Andorra'; country_list[1] = 'Austria'; country_list[2] = 'Belgium'; country_list[3] = 'Croatia'; country_list[4] = 'Cyprus'; country_list[5] = 'Czech Republic'; country_list[6] = 'Denmark'; country_list[7] = 'Finland'; country_list[8] = 'France'; country_list[9] = 'Germany'; country_list[10] = 'Greece'; country_list[11] = 'Greenland'; country_list[12] = 'Iceland'; country_list[13] = 'Ireland (Republic)'; country_list[14] = 'Italy'; country_list[15] = 'Liechtenstein'; country_list[16] = 'Lithuania'; country_list[17] = 'Luxembourg'; country_list[18] = 'Malta'; country_list[19] = 'Netherlands'; country_list[20] = 'Netherlands Antilles'; country_list[21] = 'Norway'; country_list[22] = 'Poland'; country_list[23] = 'Portugal'; country_list[24] = 'San Marino'; country_list[25] = 'Spain'; country_list[26] = 'Sweden'; country_list[27] = 'Switzerland'; country_list[28] = 'Vatican City State'; country = document.getElementById('update_country').value; vat_reason = document.getElementById('reason_id').value; for (j=0; j