//********************XMLHTTP Stuff******************** //** Processes every time there is a state change from the XMLHTTP request (makes //** sure we dont do anything until were ready.) function processReqChange() { var resparr; // only if req shows "complete" if (req.readyState == 4) { // only if "OK" if (req.status == 200) { // ...processing statements go here... response = req.responseText; //response always comes back as a comma delimited array, first element is the function that is retrieving resparr = response.split(','); if (resparr[0] == 'REMOVE') { //We just removed a product if (resparr[1] == 'SUCCESS') { window.location.href = "/store/cart.asp"; } else { window.location.href= "/error.asp"; } } else { window.location.href= "/error.asp"; } } else if (resparr[0] == 'RECALCULATE') { //Cart was recalculated if (resparr[1] == 'SUCCESS') { window.location.href = "/store/cart.asp"; } else { window.location.href= "/error.asp"; } } else { alert("There was a problem retrieving the XML data:\n" + req.statusText); } } } function removeitem(cartitemid) { var querystr; if (cartitemid != '') { loadXMLDoc('http://www.openroadjourney.com/store/s_removecartitem.asp','cartitemid=' + cartitemid); } else { window.location.href= "/error.asp"; } } function checkquantity(cartitemids) { var frm = document.forms.cart; var arr; var v; if (cartitemids != '') { // the quantity value for all the cartitems arr = cartitemids.split(','); for (i=0;i 99 || v == '' || isNaN(v) || Math.round(v) != v) { alert('We\'re sorry. A quantity you have entered is not valid. Please enter a whole number quantity between 0 and 99.') eval('frm.item'+ arr[i]+'.focus()'); return false; } } frm.recalculate.value = 1; frm.submit(); } }