function keyCheck(eventObj) { var keyCode; // Check For Browser Type if (document.all){ keyCode=eventObj.keyCode; } else { keyCode=eventObj.which; } if(keyCode == 0 || keyCode == 8) { return true; } if(keyCode<48 || keyCode >58){ // Allow only integers return false; } return true; } function getFVal(item) { return document.forms["shipform"][item].value; } function validateForm() { if(getFVal('custname')=="") { alert('Please enter your name.'); return false; } if(getFVal('email')=="") { alert('Please enter your email address.\n\nIf you do not have one please type \'none\' in the email address box.'); return false; } if(getFVal('phone')=="" && getFVal('cell')=="") { alert('Please enter atleast one phone number.'); return false; } shipzip = document.getElementById("shipzip").value; if(shipzip.length != 5) { alert('Your shipping zipcode is either empty or invalid.\n\nNote: The \'shipping zipcode\' needs to be entered in the field next to \'Ship order via UPS Ground\'.\n\nThere are two zipcode fields on this page infact.'); return false; } return true; } function initOrderForm() { } function CalcShipEst() { var shipzip; var shipwt; var oversize; shipzip = document.getElementById("shipzip").value; if(shipzip.length != 5) { alert('Your zipcode is not valid!'); return false; } shipwt = document.getElementById("wt").value; oversize = document.getElementById("oversize").value; document.getElementById("ship_est_out").innerHTML = '
Please wait
Communicating with estimation program... please wait...
'; var head = document.getElementsByTagName('head').item(0); var old = document.getElementById('lastLoadedCmds'); if (old) head.removeChild(old); script = document.createElement('script'); script.src = "http://www.glasscages.com/gc2/backend/rates.php?orderups=yes&tozip="+shipzip+"&wt="+shipwt+"&ov="+oversize+"&rand="+ Math.floor(Math.random()*999999999) ; script.type = 'text/javascript'; script.defer = true; script.id = 'lastLoadedCmds'; head.appendChild(script); } function upsCallback(frtcost, zip) { if(frtcost < 6) { /*6 is just a guess - doesn't really matter.. just bug out if the ups charge seems too small or invalid */ document.getElementById("ship_est_inner").innerHTML = "Unable to calculate shipping. Please check your zipcode and try again.
If you continue to have problems please call us for an estimate.
(UPS sometimes has areas that it can't provide estimates for.. we can help you on the phone, however.)"; } else { document.getElementById("ship_est_inner").innerHTML = "(official rate may vary; must call for final quote)
Estimated shipping via ups ground to "+zip+":

$"+frtcost+"

"; } }