var val_string = "quantity,size,coverstock"; var response_string = "Quantity,Size,Paper Stock"; var shippingmethod_id = 0; function basicPriceCal(){ if(getValue('zip') == ''){ sumTotal(); }else{ if(!(getValue('coverstock') == '' || getValue('quantity') == '' || getValue('size') == '')){ //make sure values are different from previous before calculating shipping again. calcShipping(); sumTotal(); }else{ sumTotal(); } } turnAroundTime(); } function turnAroundTime() { setValue('turnaroundtime', '2-5 days Printing'); setValue('turnaroundtime2', ''); } function changeColorImage(){ var d=document.quoteform; var img; var covercolor1 = getValue('covercolor1'); switch(covercolor1) { case "4": img = brochure4col; break; case "2": img = brochure2col; break; case "1": img = brochure1col; break; default: img = brochure4col; } d.frontimage.src = img; var covercolor2 = getValue('covercolor2'); switch(covercolor2) { case "4": img = brochure4col; break; case "2": img = brochure2col; break; case "1": img = brochure1col; break; case "0": img = brochurenone; break; case "B": img = brochuregrey; break; default: img=brochure4col; } d.backimage.src = img; basicPriceCal(); } function getBasePrice(qty,size,color){ var arrQty = Array(); splitCoverColor(); var paperstock = getValue('coverstock'); if(paperstock == "5"){ arrQty['250_13x19_4/0'] = '467.50'; arrQty['500_13x19_4/0'] = '627.00'; arrQty['1000_13x19_4/0'] = '742.50'; arrQty['2500_13x19_4/0'] = '1094.50'; arrQty['5000_13x19_4/0'] = '1644.50'; arrQty['10000_13x19_4/0'] = '2744.61'; arrQty['250_13x19_4/4'] = '540.60'; arrQty['500_13x19_4/4'] = '770.35'; arrQty['1000_13x19_4/4'] = '940.30'; arrQty['2500_13x19_4/4'] = '1220.00'; arrQty['5000_13x19_4/4'] = '1905.77'; arrQty['10000_13x19_4/4'] = '3091.77'; arrQty['250_13x19_4/1'] = '530.00'; arrQty['500_13x19_4/1'] = '760.00'; arrQty['1000_13x19_4/1'] = '925.00'; arrQty['2500_13x19_4/1'] = '1890.00'; arrQty['5000_13x19_4/1'] = '1610.00'; arrQty['10000_13x19_4/1'] = '3010.00'; arrQty['250_18x24_4/0'] = '467.50'; arrQty['500_18x24_4/0'] = '627.00'; arrQty['1000_18x24_4/0'] = '742.50'; arrQty['2500_18x24_4/0'] = '1094.50'; arrQty['5000_18x24_4/0'] = '1644.50'; arrQty['10000_18x24_4/0'] = '2744.61'; arrQty['250_18x24_4/4'] = '439.07'; arrQty['500_18x24_4/4'] = '498.37'; arrQty['1000_18x24_4/4'] = '676.97'; arrQty['2500_18x24_4/4'] = '1012.77'; arrQty['5000_18x24_4/4'] = '1705.77'; arrQty['10000_18x24_4/4'] = '3091.77'; arrQty['250_18x24_4/1'] = '336.02'; arrQty['500_18x24_4/1'] = '395.87'; arrQty['1000_18x24_4/1'] = '515.57'; arrQty['2500_18x24_4/1'] = '874.67'; arrQty['5000_18x24_4/1'] = '1473.17'; arrQty['10000_18x24_4/1'] = '2670.17'; arrQty['250_24x36_4/0'] = '467.50'; arrQty['500_24x36_4/0'] = '627.00'; arrQty['1000_24x36_4/0'] = '742.50'; arrQty['2500_24x36_4/0'] = '1094.50'; arrQty['5000_24x36_4/0'] = '1644.50'; arrQty['10000_24x36_4/0'] = '2744.61'; arrQty['250_24x36_4/4'] = '439.07'; arrQty['500_24x36_4/4'] = '498.37'; arrQty['1000_24x36_4/4'] = '676.97'; arrQty['2500_24x36_4/4'] = '1012.77'; arrQty['5000_24x36_4/4'] = '1705.77'; arrQty['10000_24x36_4/4'] = '3091.77'; arrQty['250_24x36_4/1'] = '336.02'; arrQty['500_24x36_4/1'] = '395.87'; arrQty['1000_24x36_4/1'] = '515.57'; arrQty['2500_24x36_4/1'] = '874.67'; arrQty['5000_24x36_4/1'] = '1473.17'; arrQty['10000_24x36_4/1'] = '2670.17'; } else if(paperstock == "6"){ arrQty['250_13x19_4/0'] = '276.10'; arrQty['500_13x19_4/0'] = '325.60'; arrQty['1000_13x19_4/0'] = '434.50'; arrQty['2500_13x19_4/0'] = '654.50'; arrQty['5000_13x19_4/0'] = '1045.00'; arrQty['10000_13x19_4/0'] = '1851.30'; arrQty['250_13x19_4/4'] = '365.31'; arrQty['500_13x19_4/4'] = '419.76'; arrQty['1000_13x19_4/4'] = '528.66'; arrQty['2500_13x19_4/4'] = '855.36'; arrQty['5000_13x19_4/4'] = '1399.86'; arrQty['10000_13x19_4/4'] = '2488.86'; arrQty['250_13x19_4/1'] = '315.50'; arrQty['500_13x19_4/1'] = '362.52'; arrQty['1000_13x19_4/1'] = '456.57'; arrQty['2500_13x19_4/1'] = '738.72'; arrQty['5000_13x19_4/1'] = '1208.97'; arrQty['10000_13x19_4/1'] = '2149.47'; arrQty['250_18x24_4/0'] = '395.00'; arrQty['500_18x24_4/0'] = '545.00'; arrQty['1000_18x24_4/0'] = '595.00'; arrQty['2500_18x24_4/0'] = '955.00'; arrQty['5000_18x24_4/0'] = '1195.00'; arrQty['10000_18x24_4/0'] = '1625.00'; arrQty['250_18x24_4/4'] = '365.31'; arrQty['500_18x24_4/4'] = '419.76'; arrQty['1000_18x24_4/4'] = '528.66'; arrQty['2500_18x24_4/4'] = '855.36'; arrQty['5000_18x24_4/4'] = '1399.86'; arrQty['10000_18x24_4/4'] = '2488.86'; arrQty['250_18x24_4/1'] = '315.50'; arrQty['500_18x24_4/1'] = '362.52'; arrQty['1000_18x24_4/1'] = '456.57'; arrQty['2500_18x24_4/1'] = '738.72'; arrQty['5000_18x24_4/1'] = '1208.97'; arrQty['10000_18x24_4/1'] = '2149.47'; arrQty['250_24x36_4/0'] = '875.00'; arrQty['500_24x36_4/0'] = '945.00'; arrQty['1000_24x36_4/0'] = '995.00'; arrQty['2500_24x36_4/0'] = '1695.00'; arrQty['5000_24x36_4/0'] = '2395.00'; arrQty['10000_24x36_4/0'] = '3795.00'; arrQty['250_24x36_4/4'] = '365.31'; arrQty['500_24x36_4/4'] = '419.76'; arrQty['1000_24x36_4/4'] = '528.66'; arrQty['2500_24x36_4/4'] = '855.36'; arrQty['5000_24x36_4/4'] = '1399.86'; arrQty['10000_24x36_4/4'] = '2488.86'; arrQty['250_24x36_4/1'] = '315.50'; arrQty['500_24x36_4/1'] = '362.52'; arrQty['1000_24x36_4/1'] = '456.57'; arrQty['2500_24x36_4/1'] = '738.72'; arrQty['5000_24x36_4/1'] = '1208.97'; arrQty['10000_24x36_4/1'] = '2149.47'; } else { arrQty['250_13x19_4/0'] = '276.10'; arrQty['500_13x19_4/0'] = '325.60'; arrQty['1000_13x19_4/0'] = '434.50'; arrQty['2500_13x19_4/0'] = '654.50'; arrQty['5000_13x19_4/0'] = '1045.00'; arrQty['10000_13x19_4/0'] = '1851.30'; arrQty['250_13x19_4/0'] = '467.50'; arrQty['500_13x19_4/0'] = '627.00'; arrQty['1000_13x19_4/0'] = '742.50'; arrQty['2500_13x19_4/0'] = '1094.50'; arrQty['5000_13x19_4/0'] = '1644.50'; arrQty['10000_13x19_4/0'] = '2744.61'; arrQty['250_13x19_4/4'] = '365.31'; arrQty['500_13x19_4/4'] = '419.76'; arrQty['1000_13x19_4/4'] = '528.66'; arrQty['2500_13x19_4/4'] = '855.36'; arrQty['5000_13x19_4/4'] = '1399.86'; arrQty['10000_13x19_4/4'] = '2488.86'; arrQty['250_13x19_4/4'] = '540.60'; arrQty['500_13x19_4/4'] = '770.35'; arrQty['1000_13x19_4/4'] = '940.30'; arrQty['2500_13x19_4/4'] = '1220.00'; arrQty['5000_13x19_4/4'] = '1905.77'; arrQty['10000_13x19_4/4'] = '3091.77'; arrQty['250_13x19_4/1'] = '315.50'; arrQty['500_13x19_4/1'] = '362.52'; arrQty['1000_13x19_4/1'] = '456.57'; arrQty['2500_13x19_4/1'] = '738.72'; arrQty['5000_13x19_4/1'] = '1208.97'; arrQty['10000_13x19_4/1'] = '2149.47'; arrQty['250_13x19_4/1'] = '530.00'; arrQty['500_13x19_4/1'] = '760.00'; arrQty['1000_13x19_4/1'] = '925.00'; arrQty['2500_13x19_4/1'] = '1890.00'; arrQty['5000_13x19_4/1'] = '1610.00'; arrQty['10000_13x19_4/1'] = '3010.00'; arrQty['250_18x24_4/0'] = '395.00'; arrQty['500_18x24_4/0'] = '545.00'; arrQty['1000_18x24_4/0'] = '595.00'; arrQty['2500_18x24_4/0'] = '955.00'; arrQty['5000_18x24_4/0'] = '1195.00'; arrQty['10000_18x24_4/0'] = '1625.00'; arrQty['250_18x24_4/0'] = '467.50'; arrQty['500_18x24_4/0'] = '627.00'; arrQty['1000_18x24_4/0'] = '742.50'; arrQty['2500_18x24_4/0'] = '1094.50'; arrQty['5000_18x24_4/0'] = '1644.50'; arrQty['10000_18x24_4/0'] = '2744.61'; arrQty['250_18x24_4/4'] = '365.31'; arrQty['500_18x24_4/4'] = '419.76'; arrQty['1000_18x24_4/4'] = '528.66'; arrQty['2500_18x24_4/4'] = '855.36'; arrQty['5000_18x24_4/4'] = '1399.86'; arrQty['10000_18x24_4/4'] = '2488.86'; arrQty['250_18x24_4/4'] = '439.07'; arrQty['500_18x24_4/4'] = '498.37'; arrQty['1000_18x24_4/4'] = '676.97'; arrQty['2500_18x24_4/4'] = '1012.77'; arrQty['5000_18x24_4/4'] = '1705.77'; arrQty['10000_18x24_4/4'] = '3091.77'; arrQty['250_18x24_4/1'] = '315.50'; arrQty['500_18x24_4/1'] = '362.52'; arrQty['1000_18x24_4/1'] = '456.57'; arrQty['2500_18x24_4/1'] = '738.72'; arrQty['5000_18x24_4/1'] = '1208.97'; arrQty['10000_18x24_4/1'] = '2149.47'; arrQty['250_18x24_4/1'] = '336.02'; arrQty['500_18x24_4/1'] = '395.87'; arrQty['1000_18x24_4/1'] = '515.57'; arrQty['2500_18x24_4/1'] = '874.67'; arrQty['5000_18x24_4/1'] = '1473.17'; arrQty['10000_18x24_4/1'] = '2670.17'; arrQty['250_24x36_4/0'] = '875.00'; arrQty['500_24x36_4/0'] = '945.00'; arrQty['1000_24x36_4/0'] = '995.00'; arrQty['2500_24x36_4/0'] = '1695.00'; arrQty['5000_24x36_4/0'] = '2395.00'; arrQty['10000_24x36_4/0'] = '3795.00'; arrQty['250_24x36_4/0'] = '467.50'; arrQty['500_24x36_4/0'] = '627.00'; arrQty['1000_24x36_4/0'] = '742.50'; arrQty['2500_24x36_4/0'] = '1094.50'; arrQty['5000_24x36_4/0'] = '1644.50'; arrQty['10000_24x36_4/0'] = '2744.61'; arrQty['250_24x36_4/4'] = '365.31'; arrQty['500_24x36_4/4'] = '419.76'; arrQty['1000_24x36_4/4'] = '528.66'; arrQty['2500_24x36_4/4'] = '855.36'; arrQty['5000_24x36_4/4'] = '1399.86'; arrQty['10000_24x36_4/4'] = '2488.86'; arrQty['250_24x36_4/4'] = '439.07'; arrQty['500_24x36_4/4'] = '498.37'; arrQty['1000_24x36_4/4'] = '676.97'; arrQty['2500_24x36_4/4'] = '1012.77'; arrQty['5000_24x36_4/4'] = '1705.77'; arrQty['10000_24x36_4/4'] = '3091.77'; arrQty['250_24x36_4/1'] = '315.50'; arrQty['500_24x36_4/1'] = '362.52'; arrQty['1000_24x36_4/1'] = '456.57'; arrQty['2500_24x36_4/1'] = '738.72'; arrQty['5000_24x36_4/1'] = '1208.97'; arrQty['10000_24x36_4/1'] = '2149.47'; arrQty['250_24x36_4/1'] = '336.02'; arrQty['500_24x36_4/1'] = '395.87'; arrQty['1000_24x36_4/1'] = '515.57'; arrQty['2500_24x36_4/1'] = '874.67'; arrQty['5000_24x36_4/1'] = '1473.17'; arrQty['10000_24x36_4/1'] = '2670.17'; } return arrQty[qty + '_' + size + '_' + color]; } function setDefaults(){ setEditValues(); } function setProofPrice(){ var d = document.quoteform; var cost = 0.00; var proof = parseInt(getValue('proof'))+1; var arrProofprice = new Array(); arrProofprice["1"] = "0.00"; arrProofprice["2"] = "0.00"; arrProofprice["3"] = "45.00"; if(parseInt(proof)<=0 && parseInt(proof)>4){ cost=0; }else{ cost=arrProofprice[proof]; } if(!isNaN(cost)){ d.proofprice.value=currencyFormat(cost); } } function sumTotal(){ var d = document.quoteform; var quantity = getValue('quantity'); var args = upsellParams(arguments); if(args[0] && args[0]>0) quantity = args[0]; var covercolor = getValue('covercolor'); //var covercolor2 = getValue('covercolor2'); var paperstock = getValue('coverstock'); var size = getValue('size'); //var bleed = getValue('bleed'); var proof = getValue('proof'); var inkcolor = covercolor; var baseprice=-1; setProofPrice(); if(quantity != "" && paperstock != ""){ baseprice= getBasePrice(quantity,size,inkcolor); } if(!isNaN(baseprice)) { d.baseprice.value=currencyFormat(baseprice); } else { d.baseprice.value=currencyFormat(0); } if( parseInt(d.baseprice.value) < 0 ) { d.baseprice.value=currencyFormat(0); } tot=0.00; tot += parseFloat(getValue('baseprice')); tot += parseFloat(getValue('proofprice')); setValue('totalprice', currencyFormat(tot)); if(args[1]) return getValue('totalprice');doupsell(); gtot = tot; gtot += parseFloat(getValue('shippingcost')); setValue('grandtotal', currencyFormat(gtot)); pts_tot = tot; setValue('pts', parseInt(parseFloat(pts_tot))); } function validateForm() { var d = document.quoteform; str = ""; if(d.quantity.selectedIndex == 0) { str += "-Missing quantity\n"; } if(d.coverstock.selectedIndex == 0){ str += "-Missing Paper Stock\n"; } if (d.zip.value=="") { str += "-Missing zipcode\n"; } if(str != "") { alert("The following fields are missing:\n"+str); return false; } return true; } function splitCoverColor() { //d = document.quoteform; var color = $('#covercolor').val(); if(color.indexOf('/')!=-1) { var colors = color.split('/'); $('#covercolor1').val(colors[0]); $('#insidecolor1').val(colors[1]); } } function setEditValues(){ var d=document.quoteform; setValue('baseprice', '0.00'); setValue('proofprice', '0.00'); setValue('totalprice', '0.00'); }