var http_request = http_set_request(); var isDebug = 0; function AJAX_GET_URL(get_url, update_url, response_url) { get_url = url_add_timestamp(get_url); update_url = url_add_timestamp(update_url); if(isDebug) { alert('get_url: ' + get_url); alert('update_url: ' + update_url); alert('response_url: ' + response_url); } http_request.open('get', get_url, true); http_request.onreadystatechange = function() { update_page(update_url, response_url); }; http_request.send(null); } function AJAX_POST_URL(post_url, paramsJavascript, update_url, response_url) { var params = eval(paramsJavascript); post_url = url_add_timestamp(post_url); update_url = url_add_timestamp(update_url); if(isDebug) { alert('post_url: ' + post_url); alert('update_url: ' + update_url); alert('response_url: ' + response_url); alert('params: ' + params); } http_request.open('post', post_url, true); http_request.setRequestHeader('content-type', 'application/x-www-form-urlencoded'); http_request.setRequestHeader('content-length', params.length); http_request.setRequestHeader('connection', 'close'); http_request.onreadystatechange = function() { update_page(update_url, response_url); }; http_request.send(params); } function http_set_request() { try { http_request = new XMLHttpRequest(); } catch(trymicrosoft) { try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch(othermicrosoft) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (failed) { http_request = null; } } } return http_request; } function update_page(update_url, response_url) { if(http_request.readyState == 4) { if(http_request.status == 200) { if(isDebug) { alert('http_request.responseText: ' + http_request.responseText); } if(http_request.responseText) { window.location = response_url; } else { window.location = update_url; } } else { alert('Error! REQUEST status is [' + http_request.status + '].'); } } } function url_add_timestamp(url) { if(url.match(/#.*$/)) { var url_1 = url.match(/^.*#/).toString(); url_1 = url_1.substring(0, url_1.length - 1); var url_2 = url.match(/#.*$/).toString(); if(url_1.match(/.*\?.*/)) url_1 += '&timestamp=' + new Date().getTime(); else url_1 += '?timestamp=' + new Date().getTime(); url = url_1 + url_2; } else { if(url.match(/.*\?.*/)) url += '&timestamp=' + new Date().getTime(); else url += '?timestamp=' + new Date().getTime(); } return url; } function build_select_options(so_label, so_total, i, n) { var selectOptionsInput = so_label; for(var j = 1; j < so_total; j++) { var isInStock = document.getElementById('selectOptions_' + i + '_' + j + '_' + n).value; var optionPriceChangeElem = document.getElementById('optionPriceChangeInput_' + i + '_' + j + '_' + n); if(optionPriceChangeElem == null) { var optionPriceChange = 'null'; } else { var optionPriceChange = document.getElementById('optionPriceChangeInput_' + i + '_' + j + '_' + n).value; } var menuChoice = document.getElementById('selectOptions_' + i + '_' + j + '_' + n + '_label').innerHTML; menuChoice = menuChoice.substring(0, menuChoice.length - 1); menuChoice = QUOTE_ENCODE(menuChoice); selectOptionsInput += ' ; ' + isInStock + ' , ' + optionPriceChange + ' , ' + menuChoice; } return selectOptionsInput; } function post_form_individual_item(post_url, update_url, i, itemType, name_id_url_encoded, so1_label, so1_total, so2_label, so2_total, so3_label, so3_total) { name_id_url_encoded = encodeURIComponent(name_id_url_encoded); isInStockInput = document.getElementById('isInStock_' + i).value; isInStockInput = encodeURIComponent(isInStockInput); var displayOrderInput = parseInt(document.getElementById('displayOrderInput_' + i).value); displayOrderInput = encodeURIComponent(displayOrderInput); var priceInputElem = document.getElementById('priceInput_' + i); var priceInput = priceInputElem.value; priceInput = encodeURIComponent(priceInput); var qtyPriceInputElem = document.getElementById('qtyPriceInput_' + i); if(qtyPriceInputElem) var qtyPriceInput = qtyPriceInputElem.value; else var qtyPriceInput = 'null'; qtyPriceInput = encodeURIComponent(qtyPriceInput); if(so1_label != null) { so1_label = decodeURIComponent(so1_label); selectOptions1Input = build_select_options(so1_label, so1_total, i, 1); selectOptions1Input = encodeURIComponent(selectOptions1Input); } else { selectOptions1Input = null; } if(so2_label != null) { so2_label = decodeURIComponent(so2_label); selectOptions2Input = build_select_options(so2_label, so2_total, i, 2); selectOptions2Input = encodeURIComponent(selectOptions2Input); } else { selectOptions2Input = null; } if(so3_label != null) { so3_label = decodeURIComponent(so3_label); selectOptions3Input = build_select_options(so3_label, so3_total, i, 3); selectOptions3Input = encodeURIComponent(selectOptions3Input); } else { selectOptions3Input = null; } var paramsJavascript = "'name_id_url_encoded=' + '" + name_id_url_encoded + "'" + " + '&itemType=' + '" + itemType + "'" + " + '&isInStockInput=' + '" + isInStockInput + "'" + " + '&displayOrderInput=' + '" + displayOrderInput + "'" + " + '&priceInput=' + '" + priceInput + "'" + " + '&qtyPriceInput=' + '" + qtyPriceInput + "'" + " + '&selectOptions1Input=' + '" + selectOptions1Input + "'" + " + '&selectOptions2Input=' + '" + selectOptions2Input + "'" + " + '&selectOptions3Input=' + '" + selectOptions3Input + "'"; var params = eval(paramsJavascript); AJAX_POST_URL(post_url, paramsJavascript, update_url, null); } function post_form_package(post_url, update_url, i, itemType, name_id_url_encoded, so1_label, so1_total, so2_label, so2_total, so3_label, so3_total, so4_label, so4_total, so5_label, so5_total, so6_label, so6_total, so7_label, so7_total, so8_label, so8_total, so9_label, so9_total) { name_id_url_encoded = encodeURIComponent(name_id_url_encoded); isInStockInput = document.getElementById('isInStock_' + i).value; isInStockInput = encodeURIComponent(isInStockInput); var displayOrderInput = parseInt(document.getElementById('displayOrderInput_' + i).value); displayOrderInput = encodeURIComponent(displayOrderInput); var priceInputElem = document.getElementById('priceInput_' + i); var priceInput = priceInputElem.value; priceInput = encodeURIComponent(priceInput); if(isInStockInput) { if(so1_label != null) { so1_label = decodeURIComponent(so1_label); selectOptions1Input = build_select_options(so1_label, so1_total, i, 1); selectOptions1Input = encodeURIComponent(selectOptions1Input); } else { selectOptions1Input = null; } if(so2_label != null) { so2_label = decodeURIComponent(so2_label); selectOptions2Input = build_select_options(so2_label, so2_total, i, 2); selectOptions2Input = encodeURIComponent(selectOptions2Input); } else { selectOptions2Input = null; } if(so3_label != null) { so3_label = decodeURIComponent(so3_label); selectOptions3Input = build_select_options(so3_label, so3_total, i, 3); selectOptions3Input = encodeURIComponent(selectOptions3Input); } else { selectOptions3Input = null; } if(so4_label != null) { so4_label = decodeURIComponent(so4_label); selectOptions4Input = build_select_options(so4_label, so4_total, i, 4); selectOptions4Input = encodeURIComponent(selectOptions4Input); } else { selectOptions4Input = null; } if(so5_label != null) { so5_label = decodeURIComponent(so5_label); selectOptions5Input = build_select_options(so5_label, so5_total, i, 5); selectOptions5Input = encodeURIComponent(selectOptions5Input); } else { selectOptions5Input = null; } if(so6_label != null) { so6_label = decodeURIComponent(so6_label); selectOptions6Input = build_select_options(so6_label, so6_total, i, 6); selectOptions6Input = encodeURIComponent(selectOptions6Input); } else { selectOptions6Input = null; } if(so7_label != null) { so7_label = decodeURIComponent(so7_label); selectOptions7Input = build_select_options(so7_label, so7_total, i, 7); selectOptions7Input = encodeURIComponent(selectOptions7Input); } else { selectOptions7Input = null; } if(so8_label != null) { so8_label = decodeURIComponent(so8_label); selectOptions8Input = build_select_options(so8_label, so8_total, i, 8); selectOptions8Input = encodeURIComponent(selectOptions8Input); } else { selectOptions8Input = null; } if(so9_label != null) { so9_label = decodeURIComponent(so9_label); selectOptions9Input = build_select_options(so9_label, so9_total, i, 9); selectOptions9Input = encodeURIComponent(selectOptions9Input); } else { selectOptions9Input = null; } } else { selectOptions1Input = null; selectOptions2Input = null; selectOptions3Input = null; selectOptions4Input = null; selectOptions5Input = null; selectOptions6Input = null; selectOptions7Input = null; selectOptions8Input = null; selectOptions9Input = null; } var paramsJavascript = "'name_id_url_encoded=' + '" + name_id_url_encoded + "'" + " + '&itemType=' + '" + itemType + "'" + " + '&isInStockInput=' + '" + isInStockInput + "'" + " + '&displayOrderInput=' + '" + displayOrderInput + "'" + " + '&priceInput=' + '" + priceInput + "'" + " + '&selectOptions1Input=' + '" + selectOptions1Input + "'" + " + '&selectOptions2Input=' + '" + selectOptions2Input + "'" + " + '&selectOptions3Input=' + '" + selectOptions3Input + "'" + " + '&selectOptions4Input=' + '" + selectOptions4Input + "'" + " + '&selectOptions5Input=' + '" + selectOptions5Input + "'" + " + '&selectOptions6Input=' + '" + selectOptions6Input + "'" + " + '&selectOptions7Input=' + '" + selectOptions7Input + "'" + " + '&selectOptions8Input=' + '" + selectOptions8Input + "'" + " + '&selectOptions9Input=' + '" + selectOptions9Input + "'"; var params = eval(paramsJavascript); AJAX_POST_URL(post_url, paramsJavascript, update_url, null); } function validate_form_grad_item(i, so_total) { var priceInputElem = document.getElementById('priceInput_' + i); if(priceInputElem.value == '' || isNaN(priceInputElem.value) || priceInputElem.value < 0 || priceInputElem.value > 999.99) { priceInputElem.value = ''; priceInputElem.focus(); ALERT_GREY_OUT('Please input PRICE: 0.00 to 999.99'); return false; } else { priceInputElem.value = PHP_NUMBER_FORMAT(parseFloat(priceInputElem.value), 2); } var qtyPriceInputElem = document.getElementById('qtyPriceInput_' + i); if(qtyPriceInputElem) { if(qtyPriceInputElem.value == '' || isNaN(qtyPriceInputElem.value) || qtyPriceInputElem.value < 0 || qtyPriceInputElem.value > 999.99) { qtyPriceInputElem.value = ''; qtyPriceInputElem.focus(); ALERT_GREY_OUT('Please input ADDITIONAL ITEMS: 0.00 to 999.99'); return false; } else { qtyPriceInputElem.value = PHP_NUMBER_FORMAT(parseFloat(qtyPriceInputElem.value), 2); } } if(so_total == '') { var so_total_arr = so_total.split(', '); } else { var so_total_arr = new Array(); so_total_arr[0] = 0; } for(var n = 1; n < 10; n++) { for(var j = 1, size = so_total_arr[n - 1]; j < size; j++) { var optionPriceChangeElem = document.getElementById('optionPriceChangeInput_' + i + '_' + j + '_' + n); if(optionPriceChangeElem == null) { continue; } if(optionPriceChangeElem.value == '' || isNaN(optionPriceChangeElem.value) || optionPriceChangeElem.value < -99.99 || optionPriceChangeElem.value > 99.99) { optionPriceChangeElem.value = ''; optionPriceChangeElem.focus(); ALERT_GREY_OUT('Please input PRICE CHANGE: -99.99 to 99.99'); return false; } else { optionPriceChangeElem.value = PHP_NUMBER_FORMAT(parseFloat(optionPriceChangeElem.value), 2); } j++; } } return true; } function download_orders(url) { var datepickerStart = document.getElementById('datepickerStartInput').value; datepickerStart = datepickerStart.split('/'); var month = datepickerStart[0]; var day = datepickerStart[1]; var year = datepickerStart[2]; datepickerStart = year + '-' + month + '-' + day + ' ' + '00:00:00'; var datepickerEnd = document.getElementById('datepickerEndInput').value; datepickerEnd = datepickerEnd.split('/'); var month = datepickerEnd[0]; var day = datepickerEnd[1]; var year = datepickerEnd[2]; datepickerEnd = year + '-' + month + '-' + day + ' ' + '23:59:59'; var downloadOptions = ''; for(var i = 0; i < document.getElementById('downloadForm').downloadOptions.length; i++) { if(document.getElementById('downloadForm').downloadOptions[i].checked) { if(downloadOptions == '') { downloadOptions += i; } else { downloadOptions += ', ' + i; } } } var sortBy = ''; for(var i = 0; i < document.getElementById('downloadForm').sortBy.length; i++) { if(document.getElementById('downloadForm').sortBy[i].checked) { sortBy = i; break; } } if(document.getElementById('salesReportInput').checked) { var isSalesReport = 1; } else { var isSalesReport = 0; } url = url + '?start-date=' + encodeURIComponent(datepickerStart) + '&end-date=' + encodeURIComponent(datepickerEnd) + '&download-options=' + encodeURIComponent(downloadOptions) + '&sort-by=' + encodeURIComponent(sortBy) + '&is-sales-report=' + isSalesReport; window.location = url; } function is_valid_date(input) { input = input.split('/'); var month = (input[0] - 1); var day = input[1]; var year = input[2]; if(isNaN(day) || isNaN(month) || isNaN(year)) { return false; } var date = new Date(year, month, day); return ((day == date.getDate()) && (month == date.getMonth()) && (year == date.getFullYear())); } function filter_processed_time(url) { var filterSelected = document.getElementById('filterInput').options[document.getElementById('filterInput').selectedIndex].value; if(filterSelected == 0) var filter = '7-days'; else if(filterSelected == 1) var filter = '30-days'; else var filter = 'school-year'; url += '?filter=' + filter; window.location = url; } function post_form_search(type, url) { if(type == 'lastName') { var lastName = document.getElementById('filterLastNameInput').value; lastName = lastName.replace(/'/g, '&#039;'); url += '?last-name=' + encodeURIComponent(lastName); } else { var paypal_txn_id = document.getElementById('filterPayPalTxnIdInput').value; url += '?paypal-txn-id=' + encodeURIComponent(paypal_txn_id); } window.location = url; } function screen_name(input) { input = input.replace(/^\s+|\s+$/g, ''); input = input.replace(/ +/, ' '); if(input.match(/^[a-zA-Z]+([a-zA-Z '\-\.,]|( & ))*$/)) return input; else return ''; } function validate_form_download() { var datepickerStart = document.getElementById('datepickerStartInput').value; if(!is_valid_date(datepickerStart)) { document.getElementById('datepickerStartInput').focus(); document.getElementById('datepickerStartInput').value = ''; ALERT_GREY_OUT('Please ENTER A VALID DATE.'); return false; } var datepickerEnd = document.getElementById('datepickerEndInput').value; if(!is_valid_date(datepickerEnd)) { document.getElementById('datepickerEndInput').focus(); document.getElementById('datepickerEndInput').value = ''; ALERT_GREY_OUT('Please ENTER A VALID DATE.'); return false; } var startDateArr = datepickerStart.split('/'); var startDate = startDateArr[2] + (startDateArr[0] - 1) + startDateArr[1]; var endDateArr = datepickerStart.split('/'); var endDate = endDateArr[2] + (endDateArr[0] - 1) + endDateArr[1]; if(startDate > endDate) { document.getElementById('datepickerStartInput').focus(); document.getElementById('datepickerStartInput').value = ''; ALERT_GREY_OUT('Please PICK A START DATE <= SELECTED END DATE.'); return false; } var isChecked = false; for(var i = 0; i < document.getElementById('downloadForm').downloadOptions.length; i++) { if(document.getElementById('downloadForm').downloadOptions[i].checked) { isChecked = true; break; } } if(!isChecked) { document.getElementById('schoolInput').focus(); ALERT_GREY_OUT('Please SELECT AT LEAST 1 DOWNLOAD OPTION.'); return false; } } function validate_form_search(type, url) { if(type == 'lastName') { var lastName = document.getElementById('filterLastNameInput').value; if(screen_name(lastName) == '') { document.getElementById('filterLastNameInput').focus(); document.getElementById('filterLastNameInput').value = ''; document.getElementById('filterPayPalTxnIdInput').value = ''; ALERT_GREY_OUT('Please ENTER LAST NAME.'); return false; } } else { var paypal_txn_id = document.getElementById('filterPayPalTxnIdInput').value; if(paypal_txn_id.length != 17) { document.getElementById('filterPayPalTxnIdInput').focus(); document.getElementById('filterLastNameInput').value = ''; document.getElementById('filterPayPalTxnIdInput').value = ''; ALERT_GREY_OUT('Please ENTER PAYPAL TXN ID.'); return false; } } return true; } function cancel() { window.location.replace('school-info.html'); } function confirm_all_schools_off(get_url, update_url) { var confirmed = CONFIRM_GREY_OUT('Are you sure you want to TURN OFF all of your schools?'); if(confirmed) { AJAX_GET_URL(get_url, update_url, null); } } function confirm_all_schools_on(get_url, update_url) { var confirmed = CONFIRM_GREY_OUT('Are you sure you want to TURN ON all of your schools?'); if(confirmed) { AJAX_GET_URL(get_url, update_url, null); } } function delete_school(name_id_url_encoded, get_url, update_url) { name_id = PHP_URLDECODE(name_id_url_encoded); name_id = name_id.replace(/&#039;/g, "'"); name_id = name_id.replace(/&amp;/g, '&'); var confirmed = CONFIRM_GREY_OUT('Are you sure you want to delete [' + name_id + '] from your database?'); if(confirmed) { AJAX_GET_URL(get_url, update_url, null); } } function post_form_school_info(post_url, update_url, i, name_id_url_encoded) { name_id_url_encoded = encodeURIComponent(name_id_url_encoded); var isTakingOrdersInput = encodeURIComponent(document.getElementById('isTakingOrdersInput_' + i).value); var newSchoolNameInput = encodeURIComponent(QUOTE_ENCODE(document.getElementById('newSchoolNameInput_' + i).value)); var is_cg_input = encodeURIComponent(document.getElementById('is_cg_input_' + i).value); var cg_price_change_input = encodeURIComponent(document.getElementById('cg_price_change_input_' + i).value); var isAnncInStockInput = encodeURIComponent(document.getElementById('isAnncInStockInput_' + i).value); var taxRateInput = encodeURIComponent(document.getElementById('taxRateInput_' + i).value); var paramsJavascript = "'name_id_url_encoded=' + '" + name_id_url_encoded + "'" + " + '&isTakingOrdersInput=' + '" + isTakingOrdersInput + "'" + " + '&newSchoolNameInput=' + '" + newSchoolNameInput + "'" + " + '&is_cg_input=' + '" + is_cg_input + "'" + " + '&cg_price_change_input=' + '" + cg_price_change_input + "'" + " + '&isAnncInStockInput=' + '" + isAnncInStockInput + "'" + " + '&taxRateInput=' + '" + taxRateInput + "'"; AJAX_POST_URL(post_url, paramsJavascript, update_url, null); } function validate_form_school_info(i) { var newSchoolNameInputElem = document.getElementById('newSchoolNameInput_' + i); if(newSchoolNameInputElem.value == '') { newSchoolNameInputElem.value = ''; newSchoolNameInputElem.focus(); ALERT_GREY_OUT('Please input SCHOOL NAME.'); return false; } var cg_price_change_input_elem = document.getElementById('cg_price_change_input_' + i); if(cg_price_change_input_elem.value == '' || isNaN(cg_price_change_input_elem.value) || cg_price_change_input_elem.value < -99.99 || cg_price_change_input_elem.value > 99.99) { cg_price_change_input_elem.value = ''; cg_price_change_input_elem.focus(); ALERT_GREY_OUT('Please input CAP & GOWN PRICE CHANGE: -99.99 to 99.99'); return false; } var taxRateInputElem = document.getElementById('taxRateInput_' + i); if(taxRateInputElem.value == '' || isNaN(taxRateInputElem.value) || taxRateInputElem.value < 0 || taxRateInputElem.value > 99.99) { taxRateInputElem.value = ''; taxRateInputElem.focus(); ALERT_GREY_OUT('Please input TAX RATE: 0.00 to 99.99'); return false; } return true; } function ALERT_GREY_OUT(message) { GREY_OUT(true, {'zindex':'50', 'bgcolor':'#333333', 'opacity':'70'}); alert(message); GREY_OUT(false); } function CONFIRM_GREY_OUT(message) { GREY_OUT(true, {'zindex':'50', 'bgcolor':'#333333', 'opacity':'70'}); var answer = confirm(message); GREY_OUT(false); return answer; } function QUOTE_ENCODE(input) { input = input.replace(/'/g, '&#039;'); input = input.replace(/"/g, '&quot;'); return input; } function QUOTE_DECODE(input) { input = input.replace(/__#039__/g, '&#039;'); input = input.replace(/__QUOT__/g, '&quot;'); return input; } function post_form_gso_state(post_URL, update_URL) { var gsosOnElem = document.getElementById('gsosOn'); var gsosOffElem = document.getElementById('gsosOff'); var gsosRedirectElem = document.getElementById('gsosRedirect'); if(gsosOnElem.checked) var gradSupplyOrderStateInput = 'on'; else if(gsosOffElem.checked) var gradSupplyOrderStateInput = 'off'; else var gradSupplyOrderStateInput = 'redirect'; var paramsJavascript = "'gradSupplyOrderStateInput=' + '" + gradSupplyOrderStateInput + "'"; AJAX_POST_URL(post_URL, paramsJavascript, update_URL, null); } function GREY_OUT(vis, options) { var options = options || {}; var zindex = options.zindex || 50; var opacity = options.opacity || 70; var opaque = (opacity / 100); var bgcolor = options.bgcolor || '#000000'; var dark=document.getElementById('darkenScreenObject'); if(!dark) { var tbody = document.getElementsByTagName('body')[0]; var tnode = document.createElement('div'); tnode.style.position='absolute'; tnode.style.top='0px'; tnode.style.left='0px'; tnode.style.overflow='hidden'; tnode.style.display='none'; tnode.id='darkenScreenObject'; tbody.appendChild(tnode); dark=document.getElementById('darkenScreenObject'); } if(vis) { if( document.body && ( document.body.scrollWidth || document.body.scrollHeight )) { var pageWidth = document.body.scrollWidth+'px'; var pageHeight = document.body.scrollHeight+'px'; } else if(document.body.offsetWidth) { var pageWidth = document.body.offsetWidth+'px'; var pageHeight = document.body.offsetHeight+'px'; } else { var pageWidth='100%'; var pageHeight='100%'; } dark.style.opacity=opaque; dark.style.MozOpacity=opaque; dark.style.filter='alpha(opacity='+opacity+')'; dark.style.zIndex=zindex; dark.style.backgroundColor=bgcolor; dark.style.width= pageWidth; dark.style.height= pageHeight; dark.style.display='block'; } else { dark.style.display='none'; } } window.onload = function() { var links = document.getElementsByTagName('a'); for(var i =0 ; i < links.length; i++) { if(links[i].className.match('newWindow')) { links[i].onclick = function() { window.open(this.href); return false; }; } } }; function PHP_NUMBER_FORMAT(n, c, d, t) { if(n > 999) { c = (c >= 0) ? c : 2; d = d || '.'; t = t || ','; nInteger = Math.floor(n); nDecimal = (n - nInteger).toFixed(c); var rev_nInteger = nInteger.toString().split('').reverse(); var new_nInteger = new Array(); var new_nDecimal = nDecimal.toString().substr(1); for(var i = rev_nInteger.length; i > 0; i--) { if(i % 3) { new_nInteger.push(rev_nInteger.pop()); } else { new_nInteger.push(t); new_nInteger.push(rev_nInteger.pop()); } } newValue = new_nInteger.join('') + new_nDecimal; return newValue; } else { return n.toFixed(c); } } function PHP_URLDECODE(input) { return decodeURIComponent(input.replace(/\+/g, '%20')); } function post_form_rush_fee(post_URL, update_URL) { var rushFeeInput = encodeURIComponent(document.getElementById('rushFeeInput').value); var paramsJavascript = "'rushFeeInput=' + '" + rushFeeInput + "'"; AJAX_POST_URL(post_URL, paramsJavascript, update_URL, null); } function validate_form_rush_fee() { var rushFeeElem = document.getElementById('rushFeeInput'); if(rushFeeElem.value == '' || isNaN(rushFeeElem.value) || rushFeeElem.value < 0 || rushFeeElem.value > 99.99) { rushFeeElem.value = ''; rushFeeElem.focus(); ALERT_GREY_OUT('Please input RUSH FEE: 0.00 to 99.99'); return false; } return true; } function post_form_shipping_handling(post_URL, update_URL) { var shippingHandlingFeeInput = encodeURIComponent(document.getElementById('shippingHandlingFeeInput').value); var paramsJavascript = "'shippingHandlingFeeInput=' + '" + shippingHandlingFeeInput + "'"; AJAX_POST_URL(post_URL, paramsJavascript, update_URL, null); } function validate_form_shipping_handling() { var shippingHandlingFeeElem = document.getElementById('shippingHandlingFeeInput'); if(shippingHandlingFeeElem.value == '' || isNaN(shippingHandlingFeeElem.value) || shippingHandlingFeeElem.value < 0 || shippingHandlingFeeElem.value > 99.99) { shippingHandlingFeeElem.value = ''; shippingHandlingFeeElem.focus(); ALERT_GREY_OUT('Please input SHIPPING AND HANDLING FEE: 0.00 to 99.99'); return false; } return true; } function post_form_thank_you_email(post_URL, update_URL) { var emailBodyInput = encodeURIComponent(QUOTE_ENCODE(document.getElementById('emailBodyInput').value)); var emailSignatureInput = encodeURIComponent(QUOTE_ENCODE(document.getElementById('emailSignatureInput').value)); var paramsJavascript = "'emailBodyInput=' + '" + emailBodyInput + "'" + " + '&emailSignatureInput=' + '" + emailSignatureInput + "'"; AJAX_POST_URL(post_URL, paramsJavascript, update_URL, null); }