var forceDoor; var aqMode; var optString; var subtotal; var locations; var locations_total; var tankonly; locations = new Array(); locations[0] = new Array("AR Little Rock",42,2); locations[1] = new Array("AZ Flagstaff",53,3); locations[2] = new Array("AZ Kingman",54,3); locations[3] = new Array("AZ Phoenix",56,3); locations[4] = new Array("CA Los Angeles",55,3); locations[5] = new Array("FL Jacksonville",40,2); locations[6] = new Array("FL Orlando",39,2); locations[7] = new Array("FL Tampa",38,2); locations[8] = new Array("GA Atlanta",37,2); locations[9] = new Array("GA Savannah",41,2); locations[10] = new Array("IA Des Moines",8,1); locations[11] = new Array("IL Chicago",29,2); locations[12] = new Array("IN Indianapolis",36,2); locations[13] = new Array("KY Louisville",31,2); locations[14] = new Array("LA New Orleans",46,2); locations[15] = new Array("MA Boston",57,4); locations[16] = new Array("MD Baltimore",5,1); locations[17] = new Array("MN Minneapolis",7,1); locations[18] = new Array("MO Kansas City",9,1); locations[19] = new Array("MO St. Louis",30,2); locations[20] = new Array("NC Asheville",50,2); locations[21] = new Array("NC Charlottle",47,2); locations[22] = new Array("NC Greensboro",49,2); locations[23] = new Array("NC Raleigh",48,2); locations[24] = new Array("NM Albuquerque",52,3); locations[25] = new Array("NY White Plains",3,1); locations[26] = new Array("OH Bowling Green",34,2); locations[27] = new Array("OH Cincinnati",32,2); locations[28] = new Array("OH Columbus",33,2); locations[29] = new Array("OK Oklahoma City",43,2); locations[30] = new Array("PA Allentown",2,1); locations[31] = new Array("PA Carlisle",1,1); locations[32] = new Array("TN Knoxville",27,2); locations[33] = new Array("TX Amarillo",51,3); locations[34] = new Array("TX Dallas",44,2); locations[35] = new Array("TX Houston",45,2); locations[36] = new Array("VA Manassas",4,1); locations[37] = new Array("VA Roanoke",28,2); locations[38] = new Array("WI Madison",6,1); locations_total = 39; 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; } return true; } function initOrderForm() { try { if(document.getElementById("forcedoor").value == "yes") { forceDoor = true; } else { forceDoor = false; } switchRegular(); updatePrice(); document.getElementById("regularAqRadio").checked = true; } catch(excp) { } } function getDelivPrice(groupid) { if(tankonly) { return document.getElementById('loc_to_'+groupid).value; } else { return document.getElementById('loc_cmb_'+groupid).value; } } function clickRegularStand() { if(document.getElementById("regstand-none").checked == true) { document.getElementById("regdoor").checked = false; document.getElementById("regdoor").disabled = true; } else { document.getElementById("regdoor").disabled = false; } } function clickReefStand() { if(forceDoor) { document.getElementById("reefdoor").disabled=true; document.getElementById("reefdoor").checked = document.getElementById("reefstand").checked; return; } if(document.getElementById("reefstand").checked == false) //not checked { document.getElementById("reefdoor").disabled = true; document.getElementById("reefdoor").checked = false; } else { //checked document.getElementById("reefdoor").disabled = false; } } function switchRegular() { if(aqMode=="reg") { return; } aqMode = "reg"; document.getElementById("part_acrcovers").style.display = "none"; document.getElementById("part_bulkheads").style.display = "none"; document.getElementById("part_sump").style.display = "none"; document.getElementById("part_reefstand").style.display = "none"; document.getElementById("part_regstand").style.display = ""; try { document.getElementById("regstand-none").checked="checked"; clickRegularStand(); } catch(exp) { } try { document.getElementById("canopy").checked=false; } catch(exp) { } try { document.getElementById("glasstops").checked=false; } catch(exp) { } document.getElementById("nostarphire").checked="checked"; document.getElementById("black_silicone").checked = false; } function switchReef() { if(aqMode=="reef") { return; } aqMode = "reef"; document.getElementById("part_acrcovers").style.display = ""; document.getElementById("part_bulkheads").style.display = ""; document.getElementById("part_sump").style.display = ""; document.getElementById("part_reefstand").style.display = ""; document.getElementById("part_regstand").style.display = "none"; try { document.getElementById("reefstand").checked=false; clickReefStand(); } catch(exp) { } document.getElementById("acryliccovers").checked=false; document.getElementById("bulkheads").checked=false; try { //in the event that the sump tank is "custom" or special and isn't available online document.getElementById("sumptank").checked=false; } catch(exp) { } try { document.getElementById("canopy").checked=false; } catch(exp) { } try { document.getElementById("glasstops").checked=false; } catch(exp) { } document.getElementById("nostarphire").checked="checked"; document.getElementById("black_silicone").checked = false; } function getVal(byid) { return document.getElementById(byid).value; } function getCheckedValue(radioObj) { if(!radioObj) return ""; var radioLength = radioObj.length; if(radioLength == undefined) if(radioObj.checked) return radioObj.value; else return ""; for(var i = 0; i < radioLength; i++) { if(radioObj[i].checked) { return radioObj[i].value; } } return ""; } function priceRegular() { var total = parseInt(getVal("base_price")); var mstr = getVal("prodid"); tankonly = true; if(getCheckedValue(document.forms["orderform"].starphire) == "front") { mstr += "\n" + "star_front"; total += parseInt(getVal("star_front")); } else if(getCheckedValue(document.forms["orderform"].starphire) == "frontsides") { mstr += "\n" + "star_3side"; total += parseInt(getVal("star_frontsides")); } try { if(document.forms["orderform"].glasstops.checked == true) { mstr += "\n" + "glasstops"; total += parseInt(getVal("tops_price")); } } catch(exp) { } if(document.forms["orderform"].black_silicone.checked == true) { mstr += "\n" + "black_silicone"; total += parseInt(getVal("black_silicone_price")); } try { if(document.getElementById("regstand-none").checked == false) { var stdid = getCheckedValue(document.forms["orderform"].regstand); mstr += "\n" + "std_" + stdid; total += parseInt(getVal("stand_"+stdid)); tankonly = false; } } catch(exp) { } try { if(document.forms["orderform"].regdoor.checked == true) { mstr += "\n" + "extradoor"; total += parseInt(getVal("door_price")); } } catch(exp) { } try { if(document.forms["orderform"].canopy.checked == true) { mstr += "\n" + "canopy"; total += parseInt(getVal("canopy_price")); tankonly = false; } } catch(exp) { } optString = mstr; document.getElementById("subtotal").innerHTML = "$"+total; subtotal = total; } function priceReef() { var total = parseInt(getVal("base_price")); var mstr = getVal("prodid"); mstr += "\n" + "reefready"; total += parseInt(getVal("reef_price")); tankonly = true; if(getCheckedValue(document.forms["orderform"].starphire) == "front") { mstr += "\n" + "star_front"; total += parseInt(getVal("star_front")); } else if(getCheckedValue(document.forms["orderform"].starphire) == "frontsides") { mstr += "\n" + "star_3side"; total += parseInt(getVal("star_frontsides")); } try { if(document.forms["orderform"].glasstops.checked == true) { mstr += "\n" + "glasstops"; total += parseInt(getVal("tops_price")); } } catch(exp) { } if(document.forms["orderform"].black_silicone.checked == true) { mstr += "\n" + "black_silicone"; total += parseInt(getVal("black_silicone_price")); } try { if(document.forms["orderform"].reefdoor.checked == true) { mstr += "\n" + "extradoor"; total += parseInt(getVal("door_price")); } } catch(exp) { } try { if(document.forms["orderform"].canopy.checked == true) { mstr += "\n" + "canopy"; total += parseInt(getVal("canopy_price")); tankonly = false; } } catch(exp) { } if(document.forms["orderform"].acryliccovers.checked == true) { mstr += "\n" + "acrcovers"; total += parseInt(getVal("arccov_price")); } if(document.forms["orderform"].bulkheads.checked == true) { mstr += "\n" + "bulkheads"; total += parseInt(getVal("bulkheads_price")); } try { //in the event that the sump tank is "custom" or special and isn't available online if(document.forms["orderform"].sumptank.checked == true) { mstr += "\n" + "sumptank"; total += parseInt(getVal("sump_price")); tankonly = false; } } catch(exp) { } try { //in the event that the sump tank is "custom" or special and isn't available online if(document.forms["orderform"].sumpquote.checked == true) { mstr += "\n" + "sumpquote"; } } catch(exp) { } try{ if(document.forms["orderform"].reefstand.checked == true) { mstr += "\n" + "reefstand"; total += parseInt(getVal("reefstd_price")); tankonly = false; } } catch(exp) { } optString = mstr; document.getElementById("subtotal").innerHTML = "$"+total; subtotal = total; } function updatePrice() { if(aqMode=="reg") { priceRegular(); } else { priceReef(); } document.getElementById("optionsstring").value = optString; } //////////////////////////////////////////// //////////////////////////////////////////// //////////////////////////////////////////// //////////////////////////////////////////// function gotoOrder() { scrollTo(0,0); document.getElementById("box_ship").style.display = "none"; document.getElementById("box_order").style.display = ""; IEMinHeight(); } function gotoShipping() { scrollTo(0,0); var out; try { if(tankonly) { shipwt = document.getElementById("wt_to").value; } else { shipwt = document.getElementById("wt_cmb").value; } if(shipwt > 0) { document.getElementById("shipfreightarea").style.display = ""; } else { document.getElementById("shipfreightarea").style.display = "none"; } } catch(exp) { } out=''; IEMinHeight(); } function CalcShipEst() { var shipzip; var shipwt; shipzip = document.getElementById("shipzip").value; if(shipzip.length != 5) { alert('Your zipcode is not valid!'); return false; } if(tankonly) { shipwt = document.getElementById("wt_to").value; } else { shipwt = document.getElementById("wt_cmb").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 = "gc2/backend/rates.php?orderfreight=yes&tozip="+shipzip+"&wt="+shipwt+"&rand="+ Math.floor(Math.random()*999999999) ; script.type = 'text/javascript'; script.defer = true; script.id = 'lastLoadedCmds'; head.appendChild(script); } function freightCallback(frtcost, zip, servcent) { if(frtcost < 61) { 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 Freight 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 = "Estimated shipping via trucking company to "+zip+":

$"+frtcost+"

"; if(servcent!='') { document.getElementById("ship_est_inner").innerHTML += " To this UPS Freight service center: " + servcent; } } }