// JavaScript Document var ajax = new sack("http://shippingquest.com/index6.asp"); var ismouse=true function setIsmouse(ismousey){ ismouse=ismousey } function getDATAList(sel,StrSelectBox2pop,CPFlag) { if (sel!=null){ if(ismouse){ sel.blur();window.focus(); } setIsmouse(true) var selectedID = sel.options[sel.selectedIndex].value; if(selectedID.length>0){ var Durl="" if (CPFlag==1){ var DOCountryx="&DOCountryx="+document.getElementById('DOCountry').options[document.getElementById('DOCountry').selectedIndex].value var DOStatex if(document.getElementById('DOState').options.length!=0){ DOStatex="&DOStatex="+document.getElementById('DOState').options[document.getElementById('DOState').selectedIndex].value } else{ DOStatex="&DOStatex="+0 } var CPCountryx="" if(StrSelectBox2pop=="CPCity" || StrSelectBox2pop=="CPState"){ CPCountryx="&CPCountryx="+document.getElementById('CPCountry').options[document.getElementById('CPCountry').selectedIndex].value } var DOCityx="&DOCityx="+document.getElementById('DOCity').options[document.getElementById('DOCity').selectedIndex].value Durl=DOCountryx+DOStatex+DOCityx+CPCountryx } if (StrSelectBox2pop!='priceNzip'){ ajax.requestFile = 'getDataNewTracking.asp?selectedID='+selectedID+"&StrSelectBox2pop="+StrSelectBox2pop+Durl; // Specifying which file to get ajaxurl='getDataNewTracking.asp?selectedID='+selectedID+"&StrSelectBox2pop="+StrSelectBox2pop+Durl; } else{//show price ajax.requestFile = 'getDataNewTracking.asp?DOid='+document.getElementById('CPCity').options[document.getElementById('CPCity').selectedIndex].value+"&CPcityN="+document.getElementById('CPCity').options[document.getElementById('CPCity').selectedIndex].text+'&DOcf='+document.getElementById('DOcf').value ajaxurl='getDataNewTracking.asp?DOid='+document.getElementById('CPCity').options[document.getElementById('CPCity').selectedIndex].value+'&DOcf='+document.getElementById('DOcf').value } ajax.onCompletion = createSelectBox; newselect=document.getElementById(StrSelectBox2pop) ajax.onLoading = showWaitMessage; ajax.runAJAX(); } } else{ if (StrSelectBox2pop="DOcf"){ ajax.requestFile = 'getDataNewTracking.asp?DOidT='+document.getElementById('CPCity').options[document.getElementById('CPCity').selectedIndex].value+'&DOcf='+document.getElementById('DOcf').value+"&recalculate=Y" ajaxurl='getDataNewTracking.asp?DOidT='+document.getElementById('CPCity').options[document.getElementById('CPCity').selectedIndex].value+'&DOcf='+document.getElementById('DOcf').value+"&recalculate=Y" ajax.onCompletion = createSelectBox; newselect=null ajax.onLoading = showWaitMessage; ajax.runAJAX(); } } } function showWaitMessage(){ if(newselect!=null){ newselect.options[0] = new Option("Loading ..."); } SQ_BoxTOG(1,'WaitM') } function createSelectBox() { eval(ajax.response); SQ_BoxTOG(0,'WaitM') } function clearListALL(ID) { var Locationsarray = new Array(); Locationsarray[0] = 'DOState'; Locationsarray[1] = 'DOCity'; Locationsarray[2] = 'CPCountry'; Locationsarray[3] = 'CPState'; Locationsarray[4] = 'CPCity'; SQ_BoxTOG(0,'secondbox') for (var i = ID; i < Locationsarray.length; i++) { document.getElementById(Locationsarray[i]).options.length = 0 document.getElementById(Locationsarray[i]).disabled=true } } function CalulatePrice(recalculate) { if(document.getElementById("DOcf")!=null){ var CFT=document.getElementById("DOcf").value-35 var PricePerCFT=document.getElementById("DOPrice").value var result if(CFT<0){ alert("- The minimum amount is 35 cubic feet ") document.getElementById("DOcf").value=35 result=Number(Math.round(PricePerCFT*35*100)/100 + Math.round(document.getElementById("min35CFTprice").value*100)/100).toFixed(2) document.getElementById("DOcfAddtional").value=0 } else{ result=Number(Math.round(PricePerCFT*CFT*100)/100 + Math.round(document.getElementById("min35CFTprice").value*100)/100).toFixed(2) document.getElementById("DOcfAddtional").value=CFT } document.getElementById("TotalPrice").value=result document.getElementById("TotalPrice2").value=result //update ajax if(recalculate){ getDATAList(null,"DOcf",0) } } } function GetDOPriceNzip(SetPrice,setZip,setMinprice,DOcfajax){ SQ_BoxTOG(1,'secondbox') if( SetPrice!=""){ SQ_BoxTOG(1,'secondbox') if(setZip!="") { SQ_BoxTOG(1,'zipBox') } else { SQ_BoxTOG(0,'zipBox') } document.getElementById('DOPrice').value=SetPrice; document.getElementById('DOZip').value=setZip; document.getElementById('min35CFTprice').value=setMinprice; if(DOcfajax!=""){ document.getElementById('DOcf').value=DOcfajax } if(document.getElementById('DOcf').value!="" ) { CalulatePrice(0) } } else{ SQ_BoxTOG(0,'secondbox') } }