var val_string = "quantity,size,coverstock"; var response_string = "Quantity,Finished Size,Number Of Parts"; var shippingmethod_id = 0; function getElement(el) { return document.getElementById(el); } function basicPriceCal() { turnAroundTime(); 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(); } } } /* function changeImage(){ var sel = document.quoteform.inkPMS1[getElement("inkPMS1").selectedIndex].value; switch(sel){ case '0': document.images.pmsimage.src = "images/pmsnone.gif"; break; case 'Blue (Pms 300)': document.images.pmsimage.src = "images/pms300.gif"; break; case 'Reflex Blue': document.images.pmsimage.src = "images/reflex_blue.gif"; break; case 'Red (Pms 185)': document.images.pmsimage.src = "images/pms185.gif"; break; case 'Red (Pms 032)': document.images.pmsimage.src = "images/pms032.gif"; break; case 'Green (Pms 347)': document.images.pmsimage.src = "images/pms347.gif"; break; case 'Burgundy (Pms 201)': document.images.pmsimage.src = "images/pms201.gif"; break; case 'Brown (Pms 463)': document.images.pmsimage.src = "images/pms463.gif"; break; case 'Blue (Pms 287)': document.images.pmsimage.src = "images/pms287.gif"; break; case 'Process Blue': document.images.pmsimage.src = "images/processblue.gif"; break; case 'Red (Pms 199)': document.images.pmsimage.src = "images/pms199.gif"; break; case 'Warm Red': document.images.pmsimage.src = "images/warmred.gif"; break; case 'Green (Pms 348)': document.images.pmsimage.src = "images/pms348.gif"; break; case 'Grey (Pms 424)': document.images.pmsimage.src = "images/pms424.gif"; break; case 'Black Ink': document.images.pmsimage.src = "images/black.gif"; break; } } */ /* function changeImage2(){ var sel = document.quoteform.inkPMS2[getElement("inkPMS2").selectedIndex].value; switch(sel){ case '0': document.images.pmsimage2.src = "images/pmsnone.gif"; break; case 'Blue (Pms 300)': document.images.pmsimage2.src = "images/pms300.gif"; break; case 'Reflex Blue': document.images.pmsimage2.src = "images/reflex_blue.gif"; break; case 'Red (Pms 185)': document.images.pmsimage2.src = "images/pms185.gif"; break; case 'Red (Pms 032)': document.images.pmsimage2.src = "images/pms032.gif"; break; case 'Green (Pms 347)': document.images.pmsimage2.src = "images/pms347.gif"; break; case 'Burgundy (Pms 201)': document.images.pmsimage2.src = "images/pms201.gif"; break; case 'Brown (Pms 463)': document.images.pmsimage2.src = "images/pms463.gif"; break; case 'Blue (Pms 287)': document.images.pmsimage2.src = "images/pms287.gif"; break; case 'Process Blue': document.images.pmsimage2.src = "images/processblue.gif"; break; case 'Red (Pms 199)': document.images.pmsimage2.src = "images/pms199.gif"; break; case 'Warm Red': document.images.pmsimage2.src = "images/warmred.gif"; break; case 'Green (Pms 348)': document.images.pmsimage2.src = "images/pms348.gif"; break; case 'Grey (Pms 424)': document.images.pmsimage2.src = "images/pms424.gif"; break; case 'Black Ink': document.images.pmsimage2.src = "images/black.gif"; break; } } */ function dispPMS() { var d=document.quoteform; if(document.getElementById("tpms1")) document.getElementById("tpms1").style.visibility='hidden'; if(document.getElementById("tpms2")) document.getElementById("tpms2").style.visibility='hidden'; if(document.getElementById("selpms1")) document.getElementById("selpms1").style.visibility='hidden'; if(document.getElementById("selpms2")) document.getElementById("selpms2").style.visibility='hidden'; } function colorChange() { d=document.quoteform; if(!is_select(d.covercolor1)) return; switch ( d.covercolor1[d.covercolor1.selectedIndex].value ) { case "black": d.ink1[0].checked = true; break; } } function getBasePrice(qty,size,color) { var arrQty = new Array(); var coverstock = getValue('coverstock'); arrQty['250_5.5x8.5_Two'] = '75.89'; arrQty['500_5.5x8.5_Two'] = '87.45'; arrQty['1000_5.5x8.5_Two'] = '109.73'; arrQty['1500_5.5x8.5_Two'] = '120.75'; arrQty['2000_5.5x8.5_Two'] = '184.25'; arrQty['2500_5.5x8.5_Two'] = '204.32'; arrQty['3000_5.5x8.5_Two'] = '225.12'; arrQty['3500_5.5x8.5_Two'] = '255.16'; arrQty['4000_5.5x8.5_Two'] = '276.30'; arrQty['4500_5.5x8.5_Two'] = '310.90'; arrQty['5000_5.5x8.5_Two'] = '345.50'; arrQty['5500_5.5x8.5_Two'] = '379.50'; arrQty['6000_5.5x8.5_Two'] = '420.80'; arrQty['6500_5.5x8.5_Two'] = '452.80'; arrQty['7000_5.5x8.5_Two'] = '484.80'; arrQty['7500_5.5x8.5_Two'] = '517.20'; arrQty['8000_5.5x8.5_Two'] = '549.60'; arrQty['8500_5.5x8.5_Two'] = '582.00'; arrQty['9000_5.5x8.5_Two'] = '614.40'; arrQty['9500_5.5x8.5_Two'] = '643.80'; arrQty['10000_5.5x8.5_Two'] = '673.20'; arrQty['250_5.5x8.5_Three'] = '92.45'; arrQty['500_5.5x8.5_Three'] = '101.04'; arrQty['1000_5.5x8.5_Three'] = '149.16'; arrQty['1500_5.5x8.5_Three'] = '185.25'; arrQty['2000_5.5x8.5_Three'] = '258.50'; arrQty['2500_5.5x8.5_Three'] = '294.04'; arrQty['3000_5.5x8.5_Three'] = '330.75'; arrQty['3500_5.5x8.5_Three'] = '364.14'; arrQty['4000_5.5x8.5_Three'] = '385.83'; arrQty['4500_5.5x8.5_Three'] = '425.52'; arrQty['5000_5.5x8.5_Three'] = '465.20'; arrQty['5500_5.5x8.5_Three'] = '505.08'; arrQty['6000_5.5x8.5_Three'] = '544.95'; arrQty['6500_5.5x8.5_Three'] = '583.83'; arrQty['7000_5.5x8.5_Three'] = '623.70'; arrQty['7500_5.5x8.5_Three'] = '663.58'; arrQty['8000_5.5x8.5_Three'] = '702.45'; arrQty['8500_5.5x8.5_Three'] = '744.33'; arrQty['9000_5.5x8.5_Three'] = '786.20'; arrQty['9500_5.5x8.5_Three'] = '828.95'; arrQty['10000_5.5x8.5_Three'] = '870.95'; arrQty['250_5.5x8.5_Four'] = '121.04'; arrQty['500_5.5x8.5_Four'] = '138.05'; arrQty['1000_5.5x8.5_Four'] = '197.45'; arrQty['1500_5.5x8.5_Four'] = '232.50'; arrQty['2000_5.5x8.5_Four'] = '314.05'; arrQty['2500_5.5x8.5_Four'] = '374.18'; arrQty['3000_5.5x8.5_Four'] = '431.92'; arrQty['3500_5.5x8.5_Four'] = '461.71'; arrQty['4000_5.5x8.5_Four'] = '495.53'; arrQty['4500_5.5x8.5_Four'] = '520.11'; arrQty['5000_5.5x8.5_Four'] = '545.50'; arrQty['5500_5.5x8.5_Four'] = '582.88'; arrQty['6000_5.5x8.5_Four'] = '624.05'; arrQty['6500_5.5x8.5_Four'] = '664.40'; arrQty['7000_5.5x8.5_Four'] = '706.40'; arrQty['7500_5.5x8.5_Four'] = '747.58'; arrQty['8000_5.5x8.5_Four'] = '788.75'; arrQty['8500_5.5x8.5_Four'] = '829.25'; arrQty['9000_5.5x8.5_Four'] = '871.10'; arrQty['9500_5.5x8.5_Four'] = '912.28'; arrQty['10000_5.5x8.5_Four'] = '953.45'; arrQty['250_8.5x11_Two'] = '120.59'; arrQty['500_8.5x11_Two'] = '131.25'; arrQty['1000_8.5x11_Two'] = '202.06'; arrQty['1500_8.5x11_Two'] = '234.47'; arrQty['2000_8.5x11_Two'] = '311.82'; arrQty['2500_8.5x11_Two'] = '355.97'; arrQty['3000_8.5x11_Two'] = '396.20'; arrQty['3500_8.5x11_Two'] = '445.53'; arrQty['4000_8.5x11_Two'] = '479.78'; arrQty['4500_8.5x11_Two'] = '530.75'; arrQty['5000_8.5x11_Two'] = '581.74'; arrQty['5500_8.5x11_Two'] = '617.38'; arrQty['6000_8.5x11_Two'] = '653.02'; arrQty['6500_8.5x11_Two'] = '688.66'; arrQty['7000_8.5x11_Two'] = '738.70'; arrQty['7500_8.5x11_Two'] = '759.94'; arrQty['8000_8.5x11_Two'] = '795.58'; arrQty['8500_8.5x11_Two'] = '831.22'; arrQty['9000_8.5x11_Two'] = '866.86'; arrQty['9500_8.5x11_Two'] = '902.50'; arrQty['10000_8.5x11_Two'] = '938.14'; arrQty['250_8.5x11_Three'] = '142.54'; arrQty['500_8.5x11_Three'] = '154.35'; arrQty['1000_8.5x11_Three'] = '244.30'; arrQty['1500_8.5x11_Three'] = '300.04'; arrQty['2000_8.5x11_Three'] = '400.06'; arrQty['2500_8.5x11_Three'] = '472.89'; arrQty['3000_8.5x11_Three'] = '546.14'; arrQty['3500_8.5x11_Three'] = '694.38'; arrQty['4000_8.5x11_Three'] = '712.60'; arrQty['4500_8.5x11_Three'] = '762.98'; arrQty['5000_8.5x11_Three'] = '813.34'; arrQty['5500_8.5x11_Three'] = '876.28'; arrQty['6000_8.5x11_Three'] = '944.56'; arrQty['6500_8.5x11_Three'] = '993.42'; arrQty['7000_8.5x11_Three'] = '1042.30'; arrQty['7500_8.5x11_Three'] = '1091.50'; arrQty['8000_8.5x11_Three'] = '1109.38'; arrQty['8500_8.5x11_Three'] = '1174.72'; arrQty['9000_8.5x11_Three'] = '1240.06'; arrQty['9500_8.5x11_Three'] = '1305.40'; arrQty['10000_8.5x11_Three'] = '1370.74'; arrQty['250_8.5x11_Four'] = '159.02'; arrQty['500_8.5x11_Four'] = '173.49'; arrQty['1000_8.5x11_Four'] = '312.68'; arrQty['1500_8.5x11_Four'] = '415.64'; arrQty['2000_8.5x11_Four'] = '528.14'; arrQty['2500_8.5x11_Four'] = '606.98'; arrQty['3000_8.5x11_Four'] = '684.92'; arrQty['3500_8.5x11_Four'] = '779.82'; arrQty['4000_8.5x11_Four'] = '847.66'; arrQty['4500_8.5x11_Four'] = '945.10'; arrQty['5000_8.5x11_Four'] = '1042.54'; arrQty['5500_8.5x11_Four'] = '1235.02'; arrQty['6000_8.5x11_Four'] = '1333.54'; arrQty['6500_8.5x11_Four'] = '1432.06'; arrQty['7000_8.5x11_Four'] = '1530.82'; arrQty['7500_8.5x11_Four'] = '1629.10'; arrQty['8000_8.5x11_Four'] = '1739.86'; arrQty['8500_8.5x11_Four'] = '1833.28'; arrQty['9000_8.5x11_Four'] = '1926.70'; arrQty['9500_8.5x11_Four'] = '2020.12'; arrQty['10000_8.5x11_Four'] = '2113.54'; arrQty['250_8.5x14_Two'] = '135.31'; arrQty['500_8.5x14_Two'] = '146.27'; arrQty['1000_8.5x14_Two'] = '218.60'; arrQty['1500_8.5x14_Two'] = '264.48'; arrQty['2000_8.5x14_Two'] = '363.26'; arrQty['2500_8.5x14_Two'] = '423.71'; arrQty['3000_8.5x14_Two'] = '484.84'; arrQty['3500_8.5x14_Two'] = '548.58'; arrQty['4000_8.5x14_Two'] = '593.23'; arrQty['4500_8.5x14_Two'] = '658.99'; arrQty['5000_8.5x14_Two'] = '724.74'; arrQty['5500_8.5x14_Two'] = '776.94'; arrQty['6000_8.5x14_Two'] = '829.14'; arrQty['6500_8.5x14_Two'] = '881.34'; arrQty['7000_8.5x14_Two'] = '933.54'; arrQty['7500_8.5x14_Two'] = '985.74'; arrQty['8000_8.5x14_Two'] = '1037.94'; arrQty['8500_8.5x14_Two'] = '1090.14'; arrQty['9000_8.5x14_Two'] = '1142.34'; arrQty['9500_8.5x14_Two'] = '1194.54'; arrQty['10000_8.5x14_Two'] = '1246.74'; arrQty['250_8.5x14_Three'] = '163.66'; arrQty['500_8.5x14_Three'] = '189.23'; arrQty['1000_8.5x14_Three'] = '288.31'; arrQty['1500_8.5x14_Three'] = '352.21'; arrQty['2000_8.5x14_Three'] = '486.55'; arrQty['2500_8.5x14_Three'] = '569.69'; arrQty['3000_8.5x14_Three'] = '653.65'; arrQty['3500_8.5x14_Three'] = '741.13'; arrQty['4000_8.5x14_Three'] = '802.72'; arrQty['4500_8.5x14_Three'] = '892.82'; arrQty['5000_8.5x14_Three'] = '982.93'; arrQty['5500_8.5x14_Three'] = '1073.03'; arrQty['6000_8.5x14_Three'] = '1163.14'; arrQty['6500_8.5x14_Three'] = '1253.24'; arrQty['7000_8.5x14_Three'] = '1343.33'; arrQty['7500_8.5x14_Three'] = '1433.44'; arrQty['8000_8.5x14_Three'] = '1523.53'; arrQty['8500_8.5x14_Three'] = '1613.64'; arrQty['9000_8.5x14_Three'] = '1703.75'; arrQty['9500_8.5x14_Three'] = '1793.83'; arrQty['10000_8.5x14_Three'] = '1883.94'; arrQty['250_8.5x14_Four'] = '202.00'; arrQty['500_8.5x14_Four'] = '236.66'; arrQty['1000_8.5x14_Four'] = '377.96'; arrQty['1500_8.5x14_Four'] = '418.09'; arrQty['2000_8.5x14_Four'] = '660.62'; arrQty['2500_8.5x14_Four'] = '780.06'; arrQty['3000_8.5x14_Four'] = '900.38'; arrQty['3500_8.5x14_Four'] = '1025.42'; arrQty['4000_8.5x14_Four'] = '1114.46'; arrQty['4500_8.5x14_Four'] = '1242.92'; arrQty['5000_8.5x14_Four'] = '1371.41'; arrQty['5500_8.5x14_Four'] = '1499.88'; arrQty['6000_8.5x14_Four'] = '1628.36'; arrQty['6500_8.5x14_Four'] = '1756.82'; arrQty['7000_8.5x14_Four'] = '1885.30'; arrQty['7500_8.5x14_Four'] = '2013.78'; arrQty['8000_8.5x14_Four'] = '2142.24'; arrQty['8500_8.5x14_Four'] = '2270.72'; arrQty['9000_8.5x14_Four'] = '2399.20'; arrQty['9500_8.5x14_Four'] = '2527.68'; arrQty['10000_8.5x14_Four'] = '2656.14'; return arrQty[qty + '_' + size + '_' + coverstock]; } function isSPMS(inkcolor) { //checking whether this is a Standard PMS color //console.log(typeof getStandardPMS); if(typeof getStandardPMS !='function') return false; var spms = getStandardPMS(); //console.log(inkcolor); //console.log(spms.indexOf(inkcolor)); return spms.indexOf(inkcolor)!=-1; } function isMetal(inkcolor) { //checking whether this is a Metal if(typeof getMetalPMS !='function') return false; var mpms = getMetalPMS(); return mpms.indexOf(inkcolor)!=-1; } function inkCostCalc() { d=document.quoteform; /* FOR PMS PRICES >>>>>>>>> */ var covercolor = getValue('covercolor'); if(!covercolor) return; //return for no selection var sel_color = getValue('covercolor1'); //var pms1=getValue('inkNS1'); //var pms2=getValue('inkNS2'); var qty=d.quantity.value; var b=Math.floor(qty/1000); var ns1=d.inkNS1.value; var ns2=d.inkNS2.value; var ink1 = getValue('ink1'); var ink2 = getValue('ink2'); console.log('First ink2: ' +ink2); console.log('ns2: ' + ns2); if(isSPMS(ns1)) ink1 = 'PMS'; else if(isMetal(ns1)) ink1 = 'Metal'; // Chris disabled this to stop certain colors from not being charged 6/11/2015 // if(isSPMS(ns2)) ink2 = 'PMS'; // else if(isMetal(ns2)) ink2 = 'Metal'; pmsink_cost1=0; pmsink_cost2=0; //console.log(sel_color); console.log(ink1); console.log('Here: ' + ink2); if (sel_color == "1" || sel_color == "2") { //if (!(pms1=="Black" || pms1=="black" || pms1 == "" || pms1 == 0)) if(ink1=="NS" && (ns1!=0 && ns1!="")) pmsink_cost1=(parseFloat(d.d_onecol_rpt.value))+((parseFloat(b))*(parseFloat(d.d_onecol_acpt.value))); if (sel_color == "2") { //if (!(pms2=="Black" || pms2=="black" || pms2 == "" || pms2 == 0)) if(ink2=="NS" && (ns2!=0 && ns2!="")) pmsink_cost2=(parseFloat(d.d_twocol_rpt.value))+((parseFloat(b))*(parseFloat(d.d_twocol_acpt.value))); } } //console.log(parseFloat(pmsink_cost1)+parseFloat(pmsink_cost2)); return parseFloat(pmsink_cost1)+parseFloat(pmsink_cost2); } function setInkValues(rd_inktype,val,num) { var rdo = rd_inktype; var ctrl="ink"+num; setValue(ctrl,val); if(rdo=="PMS") { setValue("inkPMS"+num, val); if (num == 1) { if(exists(document.quoteform.ink1[2])) { document.quoteform.ink1[2].checked = true; } } else { if(exists(document.quoteform.ink2[2])) { document.quoteform.ink2[2].checked = true; } } } else if(rdo=="NS") { setValue("inkNS"+num,val); if (num == 1) { if(exists(document.quoteform.ink1[3])) { document.quoteform.ink1[3].checked = true; } } else { if(exists(document.quoteform.ink2[2])) { document.quoteform.ink2[2].checked = true; } } } else if(rdo=="Metal") { setValue("inkMetal"+num,val); if (num == 1) { if(exists(document.quoteform.ink2[2])) { document.quoteform.ink2[2].checked = true; } } else { if(exists(document.quoteform.ink2[2])) { document.quoteform.ink2[2].checked = true; } } } else if(rdo=="black") { if (num == 1) { if(exists(document.quoteform.ink2[2])) { document.quoteform.ink2[2].checked = true; } } else { if(exists(document.quoteform.ink2[2])) { document.quoteform.ink2[2].checked = true; } } } else if(rdo=="reflex blue") { if (num == 1) { if(exists(document.quoteform.ink1[1])) { document.quoteform.ink1[1].checked = true; } } else { if(exists(document.quoteform.ink2[1])) { document.quoteform.ink2[1].checked = true; } } } } function isDefaultColor(color){ var arrDefaultsColors = new Array (); for (i=0;i < arrDefaultsColors.length ; i ++ ){ if (arrDefaultsColors[i] == color){ return true; } } return false; } function gunguna() { var d=document.quoteform; var pagesd = getValue('size'); if (pagesd!="8.5x11") { d.tag.disabled=true; d.tag.checked=false; d.tag.value="0.00"; } else { d.tag.disabled=false; } } function showNumbering() { var numbering = getValue('consecutivenumber'); document.getElementById("numberingOptions").style.display = numbering == 'Yes' ? 'block' : 'none'; } function sbt() { var d=document.quoteform; if (!validRequired(d.zip,"Zip Code")) { return false; } if (!validNum(d.zip,"Zip Code")) { return false; } if (d.quantity.selectedIndex == 0) { alert('Please select Quantity to continue'); d.quantity.focus(); return false; } if (d.coverstock.selectedIndex == 0) { alert('Please select Number Of Parts to continue'); d.coverstock.focus(); return false; } if (d.shipmethod.selectedIndex == 0) { alert('Please select Shipping Method to continue'); d.shipmethod.focus(); return false; } window.open("bd3.php?quantity="+d.quantity.value+"&size="+getValue('size')+"&stock="+d.coverstock.value+"&zip="+d.zip.value+"&shipmethod="+d.shipmethod.value+"&item=Carbonless",'Now','toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,height=500,width=600'); } function setDefaults(){ setEditValues(); } function tog() { var d=document.quoteform; if(!is_select(d.covercolor1)) return; switch(d.covercolor1[document.getElementById('covercolor1').selectedIndex].value){ case "": document.getElementById('completehide1').style.display = "none"; break; case "1": document.getElementById('hidetable2').style.display = "none"; document.getElementById('featuresmenu1').style.display = "block"; document.getElementById('hidetable1').style.display = "block"; document.getElementById('completehide1').style.display = "block"; break; case "2": document.getElementById('hidetable1').style.display = "block"; document.getElementById('hidetable2').style.display = "block"; document.getElementById('featuresmenu2').style.display = "block"; document.getElementById('completehide1').style.display = "block"; break; } } function resetDropDowns(num){ document.getElementById('inkPMS'+num).selectedIndex = 0; document.getElementById('inkMetal'+num).selectedIndex = 0; document.getElementById('inkNS'+num).value = ""; var sel = document.getElementById('ink'+num); var val = sel.options[sel.selectedIndex].value; switch(val){ case "Black": case "Reflex Blue": document.getElementById('inkPMS'+num+'div').style.display = "none"; document.getElementById('inkNS'+num+'div').style.display = "none"; document.getElementById('inkMetal'+num+'div').style.display = "none"; break; case "PMS": document.getElementById('inkPMS'+num+'div').style.display = "block"; document.getElementById('inkNS'+num+'div').style.display = "none"; document.getElementById('inkMetal'+num+'div').style.display = "none"; break; case "NS": document.getElementById('inkPMS'+num+'div').style.display = "none"; document.getElementById('inkNS'+num+'div').style.display = "block"; document.getElementById('inkMetal'+num+'div').style.display = "none"; break; case "Metal": document.getElementById('inkPMS'+num+'div').style.display = "none"; document.getElementById('inkNS'+num+'div').style.display = "none"; document.getElementById('inkMetal'+num+'div').style.display = "block"; break; } } function twoSide() { } function sumTotal(){ // disable the following shipping methods // shipDisable('07');//'Pick Up from Long Island City' var d=document.quoteform; var pmsprice=0.00; noncol=0.00; ppchange=0.00; trim=0.00; pad=0.00; padwrap=0.00; num=0.00; perf=0.00; backp=0.00; tag=0.00; punch=0.00; var qty=d.quantity.value; var args = upsellParams(arguments); if(args[0] && args[0]>0) qty = args[0]; var size=getValue('size'); var startnumber=getValue('startnumber'); var consecutivenumber=getValue('consecutivenumber'); var coverstock=d.coverstock.value; var proof=getValue('proof'); var turnaround=getValue('turnaround'); var a=Math.floor(qty/1000); var c=Math.round(qty/1000); var b=Math.ceil(qty/1000); var baseprice=0; var pagesd = getValue('quantity'); //var inkcol = document.quoteform.covercolor1.options[document.quoteform.covercolor1.selectedIndex].value; var colors=d.covercolor.value; //var inkcol = getValue('covercolor1'); /* FOR PMS PRICES >>>>>>>>> */ var pmsink1=getValue('ink1'); var pmsink2=getValue('ink2'); //var pms1=d.inkPMS1.value; //var pms2=d.inkPMS2.value; //var ns1=d.inkNS1.value; //var ns2=d.inkNS2.value; var inkcolarr = colors.split('/'); inkcol = inkcolarr[0]; if(inkcol == 2) // To save time in inserting into DB inkcol = 1; var color = inkcol + "/0" ; if(qty!="" && coverstock!="") { baseprice= getBasePrice(qty,size,inkcol); if(!isNaN(baseprice)) d.baseprice.value=currencyFormat(baseprice); else d.baseprice.value=currencyFormat(0); } if (qty > 0) { if(document.getElementById('noncol').checked){ //noncol=(parseFloat(d.d_noncol_rpt.value)*parseInt(baseprice))+((parseFloat(b)-1)*(parseFloat(d.d_noncol_acpt.value))); noncol=baseprice*d.d_noncol_rpt.value/100; d.nonstandardcolorprice.value = noncol; }else { noncol=0.00; d.nonstandardcolorprice.value = noncol; } if(document.getElementById('change').checked){ //ppchange=(parseFloat(d.d_partchange_rpt.value))+((parseFloat(b)-1)*(parseFloat(d.d_partchange_acpt.value))); ppchange = parseFloat(d.baseprice.value)*(d.d_partchange_rpt.value/100); d.partchangeprice.value = ppchange; }else { ppchange=0.00; d.partchangeprice.value = ppchange; } if(document.getElementById('trim').checked) { trim=(parseFloat(d.d_trim_rpt.value))+((parseFloat(b)-1)*(parseFloat(d.d_trim_acpt.value))); d.trimmingprice.value = trim; } else { trim=0.00; d.trimmingprice.value = trim; } if( consecutivenumber == 'Yes' ) { num=(parseFloat(d.d_num_rpt.value))+((parseFloat(b)-1)*(parseFloat(d.d_num_acpt.value))); } else num=0.00; if(document.getElementById('perf').checked) { perf=(parseFloat(d.d_perfo_rpt.value))+((parseFloat(b)-1)*(parseFloat(d.d_perfo_acpt.value))); d.perforatingprice.value = perf; } else { perf=0.00; d.perforatingprice.value = perf; } if(document.getElementById('backp').checked) { backp=(parseFloat(d.d_backprn_rpt.value))+((parseFloat(b)-1)*(parseFloat(d.d_backprn_acpt.value))); d.backprintprice.value = backp; } else { backp=0.00; d.backprintprice.value = backp; } if(document.getElementById('tag').checked) { tag=(parseFloat(d.d_tag_rpt.value))+((parseFloat(b)-1)*(parseFloat(d.d_tag_acpt.value))); d.tagprice.value = tag; } else { tag=0.00; d.tagprice.value = tag; } if(document.getElementById('punch').checked) { punch=(parseFloat(d.d_punch_rpt.value))+((parseFloat(b)-1)*(parseFloat(d.d_punch_acpt.value))); d.punchprice.value = punch; } else { punch=0.00; d.punchprice.value = punch; } if(document.getElementById('pad').checked) { pad=(parseFloat(d.d_padd_rpt.value))+((parseFloat(b)-1)*(parseFloat(d.d_padd_acpt.value))); d.paddingprice.value = pad; } else { pad=0.00; d.paddingprice.value = pad; } if(document.getElementById('padwrap').checked) { padwrap=(parseFloat(d.d_padwrap_rpt.value))+((parseFloat(b)-1)*(parseFloat(d.d_padwrap_acpt.value))); d.padwrapprice.value = padwrap; } else { padwrap=0.00; d.padwrapprice.value = padwrap; } } tot=0.00; ex=0.00 if (parseInt(d.baseprice.value) < 0) d.baseprice.value=currencyFormat(0); ex+=parseFloat(noncol); ex+=parseFloat(ppchange); ex+=parseFloat(backp); ex+=parseFloat(tag); ex+=parseFloat(punch); ex+=parseFloat(pad); ex+=parseFloat(padwrap); ex+=parseFloat(trim); ex+=parseFloat(perf); if(!isNaN(ex)) d.extraprice.value=currencyFormat(ex); if(parseInt(ex)<=0) d.extraprice.value=currencyFormat(0); numbering = 0.00; numbering+=parseFloat(num); if(!isNaN(numbering)) d.numberingprice.value=currencyFormat(numbering); if(parseInt(numbering)<=0) d.numberingprice.value=currencyFormat(0); pmsprice=inkCostCalc(); //console.log(pmsprice); d.pmsprice.value=currencyFormat(pmsprice); tot+=parseFloat(d.pmsprice.value); tot+=parseFloat(d.baseprice.value); tot+=parseFloat(d.numberingprice.value); //console.log(d.turnaroundprice.value); tot+=parseFloat(d.turnaroundprice.value); //console.log(tot); tot+=parseFloat(d.extraprice.value); if(!isNaN(tot)) d.totalprice.value=currencyFormat(tot); if(parseInt(tot)<=0) d.totalprice.value=currencyFormat(0); if(args[1]) return d.totalprice.value;doupsell(); if(d.totalprice.value!="" || !isNaN(d.totalprice.value)) pts_tot=d.totalprice.value; gtot=0.00; gtot+=parseFloat(d.shippingcost.value); gtot+=parseFloat(d.totalprice.value); d.grandtotal.value = currencyFormat(gtot); if(d.totalprice.value=="" ) pts_tot =0; d.pts.value= parseInt(parseFloat(pts_tot)) } function setSpotValue(sel,dest1,dest2) { var spot = $(sel).val(); $('#'+dest1).val(spot); $('#'+dest2).val(spot); } function splitColor(sel) { var colors = $(sel).val(); var vals = colors.split('/'); if ( typeof vals[0] != 'undefined' && typeof vals[0] != 'undefined' ) { $('#covercolor1').val(vals[0]); $('#covercolor2').val(vals[1]); if ( parseInt(vals[1]) > 0 ) $('#sides').val('2'); else $('#sides').val('1'); } //console.log(colors) switch(colors) { case "1/0": $('#spot2').hide(); $('#spot3').hide(); $('#spot4').hide(); $('#inkMetal2').val('0'); $('#inkMetal11').val('0'); $('#inkMetal22').val('0'); break; case "1/1": $('#spot2').hide(); $('#spot3').show(); $('#spot4').hide(); $('#inkMetal2').val('0'); $('#inkMetal22').val('0'); //setSecondSideSpotValues(); break; case "2/0": $('#spot2').show(); $('#spot3').hide(); $('#spot4').hide(); $('#inkMetal11').val('0'); $('#inkMetal22').val('0'); break; case "2/1": $('#spot2').show(); $('#spot3').show(); $('#spot4').hide(); //$('#inkMetal22').val('0'); setSecondSideSpotValues(); break; case "2/2": $('#spot2').show(); $('#spot3').show(); $('#spot4').show(); setSecondSideSpotValues(); break; } } function getInkCost(val) { switch (val) { case "PMS": pmsink=1; break; case "NS": pmsink=2; break; case "Metal": pmsink=3; break; } pmscost=getColorPrice(pmsink); return pmscost; } function getColorPrice(type) { var inkPMS1 = getValue('inkPMS1'); var inkPMS2 = getValue('inkPMS2'); var colorcost =0.00; if(type=="1") {colorcost = '47.50'; } else if(type=="2") {colorcost = '48.00'; } else if(type=="3") {colorcost = '52.00'; } if(inkPMS1!="" && ! isDefaultColor(inkPMS1)) cost=parseFloat(colorcost); if(!isNaN(colorcost)) colorcost = currencyFormat(colorcost); return colorcost; } function isDefaultColor(color){ var arrDefaultsColors = new Array (); for (i=0;i < arrDefaultsColors.length ; i ++ ){ if (arrDefaultsColors[i] == color){ return true; } } return false; } function setSecondSideSpotValues() { var d=document.quoteform; var colors = $('#covercolor').val(); colors = colors.replace('/', ''); var inkMetal1 = d.inkMetal1.value; var inkMetal2 = d.inkMetalSelect2.value; if ( inkMetal1 != "Black" && inkMetal1 != "Reflex Blue" ) $('#ink1').val('NS'); else $('#ink1').val(inkMetal1); if ( inkMetal2 != "Black" && inkMetal2 != "Reflex Blue" ) $('#ink2').val('NS'); else $('#ink2').val(inkMetal2); } function validateForm() { d=document.quoteform; str = ""; if (d.quantity.selectedIndex == 0) { str += "-Missing quantity\n"; } if (d.coverstock.selectedIndex == 0) { str += "-Missing Parts\n"; } /* if (d.glued.selectedIndex == 0) { str += "-Missing Finishing options\n"; } if (d.consecutivenumber[0].checked) { if (isNaN(parseInt(d.startnumber.value))) { str += "-Invalid Starting Number\n"; } if (d.numberposition.selectedIndex==0) { str += "-Missing Numbering Position\n"; } } else if(!d.consecutivenumber[0].checked && !d.consecutivenumber[1].checked) { str += "-Missing Numbering Option\n"; } if (d.startnumber.value < 0) { str += "-Invalid Starting Number\nit Should be positive Number"; } */ if (d.zip.value=="") { str += "-Missing zipcode\n"; } if(str != "") { alert("The following fields are missing:\n"+str); return false; } return true; } 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 turnAroundTime() { var d = document.quoteform; var cost = 0.00; var turnaround = getValue('turnaround'); var arrTurnarounePrice = new Array(); /* setValue('turnaroundtime2', ''); if (turnaround == "1D") setValue('turnaroundtime', 'Next Day Printing'); if (turnaround == "3D") setValue('turnaroundtime', '3 Days Printing'); if (turnaround == "5D") setValue('turnaroundtime', '5 Days Printing'); if (turnaround == "7-10D") setValue('turnaroundtime', '7-10 Days Printing'); */ arrTurnarounePrice["1D"] = "75.00"; arrTurnarounePrice["3D"] = "50.00"; arrTurnarounePrice["5D"] = "35.00"; arrTurnarounePrice["7-10D"] = "0.00"; if(parseInt(turnaround)<=0){ cost=0; }else{ cost=arrTurnarounePrice[turnaround]; } if(!isNaN(cost)){ d.turnaroundprice.value=currencyFormat(cost); } } /* function turnaroundtime() { if(getValue('fold') == 0){ setValue('turnaroundtime', '2-5 days Printing'); }else{ setValue('turnaroundtime', '5-7 days Printing'); } if(getValue('mailservice')=="Yes"){ setValue('turnaroundtime2', '+ 3-5 days Mailing'); }else{ setValue('turnaroundtime2', ''); } } */ function setColor1Values() { var d = document.quoteform; dispPMS(); setBackPrint(); } function setColor2Values() { var d = document.quoteform; dispPMS(); setBackPrint(); } function setBackPrint() { var d = document.quoteform; if( document.getElementById('backp').checked ) { d.covercolor2.value = d.covercolor1.value; } else { d.covercolor2.value = 0; } } function setShippingCost() { var d = document.quoteform; var cost = 0.00; cost = frames['shipcost'].document.iframe.UPScost.value; d.shippingcost.value=currencyFormat(cost); } function setEditValues() { var d=document.quoteform; // d.baseprice.value='0.00'; //d.proofprice.value='0.00'; //d.extraprice.value='0.00'; //d.turnaroundprice.value='0.00'; //d.totalprice.value='0.00'; } var standardPMS = new Array(); standardPMS.push('Blue (Pms 300)') standardPMS.push('Blue (Pms 287)') standardPMS.push('Red (Pms 185)') standardPMS.push('Red (Pms 199)') standardPMS.push('Red (Pms 032)') standardPMS.push('Warm Red') standardPMS.push('Green (Pms 347)') standardPMS.push('Green (Pms 348)') standardPMS.push('Burgundy (Pms 201)') standardPMS.push('Grey (Pms 424)') standardPMS.push('Brown (Pms 463)') standardPMS.push('Process Blue') standardPMS.push('Black Ink') function getStandardPMS() { if(standardPMS!='undefined') return standardPMS; return new Array(); } var metalPMS = new Array(); metalPMS.push('PMS 871') metalPMS.push('PMS 872') metalPMS.push('PMS 873') metalPMS.push('PMS 874') metalPMS.push('PMS 875') metalPMS.push('PMS 876') metalPMS.push('PMS 877') metalPMS.push('PMS 8003') metalPMS.push('PMS 8021') metalPMS.push('PMS 8062') metalPMS.push('PMS 8100') metalPMS.push('PMS 8201') metalPMS.push('PMS 8281') metalPMS.push('PMS 8321') //xChar111Dnt function getMetalPMS() { if(metalPMS!='undefined') return metalPMS; return new Array(); }