var shippingmethod_id = 0; var val_string = "quantity,size"; var response_string = "Quantity, Size"; function basicPriceCal(){ if(getValue('zip') == ''){ sumTotal(); }else{ if(!(getValue('quantity') == '' || getValue('size') == '')){ calcShipping(); sumTotal(); }else{ sumTotal(); } } turnAroundTime(); } 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 changePaperFoil(){ pstkpic = getValue('paperstock'); if (pstkpic) document.quoteform.paperfoil.src = ("images/" + pstkpic + ".gif"); } function getBasePrice(quantity,stock,size,color){ var arrQty = Array(); arrQty['1000_58_2x3.5_4/0'] = '129.00'; arrQty['1000_59_2x3.5_4/0'] = '209.00'; arrQty['1000_60_2x3.5_4/0'] = '239.00'; arrQty['1000_58_2x3.5_4/4'] = '187.23'; arrQty['1000_59_4.25x6_4/0'] = '729.00'; arrQty['1000_58_4.25x6_4/0'] = '459.00'; arrQty['1000_60_4.25x6_4/0'] = '850.00'; arrQty['1000_58_4.25x6_4/4'] = '599.00'; arrQty['2500_58_2x3.5_4/0'] = '289.00'; arrQty['2500_59_2x3.5_4/0'] = '499.00'; arrQty['2500_60_2x3.5_4/0'] = '549.00'; arrQty['2500_58_2x3.5_4/4'] = '398.00'; arrQty['2500_59_4.25x6_4/0'] = '1799.00'; arrQty['2500_58_4.25x6_4/0'] = '1119.00'; arrQty['2500_60_4.25x6_4/0'] = '1999.00'; arrQty['2500_58_4.25x6_4/4'] = '1449.00'; arrQty['5000_58_2x3.5_4/0'] = '549.00'; arrQty['5000_59_2x3.5_4/0'] = '999.00'; arrQty['5000_60_2x3.5_4/0'] = '1039.00'; arrQty['5000_58_2x3.5_4/4'] = '729.00'; arrQty['5000_59_4.25x6_4/0'] = '3559.00'; arrQty['5000_58_4.25x6_4/0'] = '2229.00'; arrQty['5000_60_4.25x6_4/0'] = '3969.00'; arrQty['5000_58_4.25x6_4/4'] = '2879.00'; arrQty['500_58_4.25x6_4/4'] = '510.00'; arrQty['500_60_4.25x6_4/0'] = '749.00'; arrQty['500_58_4.25x6_4/0'] = '399.00'; arrQty['500_59_4.25x6_4/0'] = '549.00'; arrQty['500_58_2x3.5_4/4'] = '159.54'; arrQty['500_60_2x3.5_4/0'] = '199.00'; arrQty['500_59_2x3.5_4/0'] = '189.00'; arrQty['500_58_2x3.5_4/0'] = '109.00'; return arrQty[quantity + '_' + stock + '_' + size + '_' + color]; } function setDefaults(){ setEditValues(); } function paperStockChange(){ d=document.quoteform; switch(d.coverstock[d.coverstock.selectedIndex].value){ case "58": d.covercolor[0].disabled = false; d.covercolor[0].selected = true; break; case "59": case "60": d.covercolor[1].selected = true; d.covercolor[0].disabled = true; break; } } function sumTotal(){ var quantity = getValue('quantity'); var args = upsellParams(arguments); if(args[0] && args[0]>0) quantity = args[0]; var size = getValue('size'); var covercolor = getValue('covercolor'); //var covercolor2 = getValue('covercolor2'); var coverstock = getValue('coverstock'); var baseprice = 0; var pts = 0; ink_color = covercolor; if(quantity != ""){ baseprice = getBasePrice(quantity,coverstock,size,ink_color); } setValue('baseprice', currencyFormat(baseprice)); tot=0.00; tot += parseFloat(getValue('baseprice')); 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 turnAroundTime() { setValue('turnaroundtime', '5-7 days Printing'); } function validateForm() { var d = document.quoteform; str = ""; if(d.quantity.selectedIndex == 0) { str += "-Missing quantity\n"; } if ( d.zip.value == "" ) { str += "-Missing zipcode\n"; } if (str != "") { alert("The following fields are missing or have errors:\n"+str); return false; } return true; } function setEditValues(){ setValue('baseprice', '0.00'); setValue('totalprice', '0.00'); }