/* Copyright © 2001-2008 GreenerPrinter. All Rights Reserved. Copyright © 2001-2008 GreenerPrinter. All Rights Reserved. Copyright © 2001-2008 GreenerPrinter. All Rights Reserved. */ var locked = false; function showPaperDetails(select_object) { if (select_object.selectedIndex==0) { setVisibilityAndPosition('paper_div_eco', 100, -160); select_object.selectedIndex=1; } } function stopRKey(evt) { var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if ((evt.keyCode == 13) && (node.type=="text")) { return false; } } function setQuant() { if (document.estiForm.quantity.value <= 0 || document.estiForm.quantity.value=="") { //document.estiForm.quantity.value=1; document.estiForm.realquant.value=0; return 0; } document.estiForm.realquant.value=document.estiForm.quantity.value; return 1; } function setStationeryQuant() { document.estiForm.quantity.value = (parseInt(document.estiForm.stationeryLetterhead.options[document.estiForm.stationeryLetterhead.selectedIndex].value) + parseInt(document.estiForm.stationeryLetterheadBlank.options[document.estiForm.stationeryLetterheadBlank.selectedIndex].value) + parseInt(document.estiForm.stationeryEnvelopes.options[document.estiForm.stationeryEnvelopes.selectedIndex].value) + parseInt(document.estiForm.stationeryBizCardQuantity.value)); if (document.estiForm.quantity.value <= 0 || document.estiForm.quantity.value=="") { //document.estiForm.quantity.value=1; document.estiForm.realquant.value=0; updateText("myTp", "0.00"); return 0; } document.estiForm.realquant.value=document.estiForm.quantity.value; return 1; } function checkQuant() { if (document.estiForm.quantity.value < 50){ document.estiForm.quantity.value=50; alert('Minimum quantity: 50'); calculate(); } if (document.estiForm.quantity.value > 30000){ document.estiForm.quantity.value=30000; alert('Maximum quantity: 30000. For higher quantities please request a custom estimate!'); calculate(); } } function checkNameQuant() { if ((document.estiForm.cardName2.value != "" || document.estiForm.cardName3.value != "" || document.estiForm.cardName4.value != "" || document.estiForm.cardName5.value != "" || document.estiForm.cardName6.value != "" || document.estiForm.cardName7.value != "" || document.estiForm.cardName8.value != "") && document.estiForm.cardName1.value == "" && document.estiForm.cardQuant1.value != 0){ alert('Please enter a name for card 1'); document.estiForm.cardName1.focus(); return 0; } if (document.getElementById('bc_name_two').style.display == 'block' && document.estiForm.cardQuant2.value > 0 && document.estiForm.cardName2.value == ""){ alert('Please enter a name for card 2'); document.estiForm.cardName2.focus(); return 0; } if (document.getElementById('bc_name_three').style.display == 'block' && document.estiForm.cardQuant3.value > 0 && document.estiForm.cardName3.value == ""){ alert('Please enter a name for card 3'); document.estiForm.cardName3.focus(); return 0; } if (document.getElementById('bc_name_four').style.display == 'block' && document.estiForm.cardQuant4.value > 0 && document.estiForm.cardName4.value == ""){ alert('Please enter a name for card 4'); document.estiForm.cardName4.focus(); return 0; } if (document.getElementById('bc_name_five').style.display == 'block' && document.estiForm.cardQuant5.value > 0 && document.estiForm.cardName5.value == ""){ alert('Please enter a name for card 5'); document.estiForm.cardName5.focus(); return 0; } if (document.getElementById('bc_name_six').style.display == 'block' && document.estiForm.cardQuant6.value > 0 && document.estiForm.cardName6.value == ""){ alert('Please enter a name for card 6'); document.estiForm.cardName6.focus(); return 0; } if (document.getElementById('bc_name_seven').style.display == 'block' && document.estiForm.cardQuant7.value > 0 && document.estiForm.cardName7.value == ""){ alert('Please enter a name for card 7'); document.estiForm.cardName7.focus(); return 0; } if (document.getElementById('bc_name_eight').style.display == 'block' && document.estiForm.cardQuant8.value > 0 && document.estiForm.cardName8.value == ""){ alert('Please enter a name for card 8'); document.estiForm.cardName8.focus(); return 0; } if (document.estiForm.cardName1.value != "" && document.estiForm.cardQuant1.value < 250){ alert('Please enter a quantity for Name 1'); return 0; } if (document.getElementById('bc_name_two').style.display == 'block' && document.estiForm.cardName2.value != "" && document.estiForm.cardQuant2.value < 250){ alert('Please enter a quantity for Name 2'); return 0; } if (document.getElementById('bc_name_three').style.display == 'block' && document.estiForm.cardName3.value != "" && document.estiForm.cardQuant3.value < 250){ alert('Please enter a quantity for Name 3'); return 0; } if (document.getElementById('bc_name_four').style.display == 'block' && document.estiForm.cardName4.value != "" && document.estiForm.cardQuant4.value < 250){ alert('Please enter a quantity for Name 4'); return 0; } if (document.getElementById('bc_name_five').style.display == 'block' && document.estiForm.cardName5.value != "" && document.estiForm.cardQuant5.value < 250){ alert('Please enter a quantity for Name 5'); return 0; } if (document.getElementById('bc_name_six').style.display == 'block' && document.estiForm.cardName6.value != "" && document.estiForm.cardQuant6.value < 250){ alert('Please enter a quantity for Name 6'); return 0; } if (document.getElementById('bc_name_seven').style.display == 'block' && document.estiForm.cardName7.value != "" && document.estiForm.cardQuant7.value < 250){ alert('Please enter a quantity for Name 7'); return 0; } if (document.getElementById('bc_name_eight').style.display == 'block' && document.estiForm.cardName8.value != "" && document.estiForm.cardQuant8.value < 250){ alert('Please enter a quantity for Name 8'); return 0; } if (document.estiForm.quantity.value < 250){ alert('Please select a quantity for at least one name. Quantities are available in increments of 250'); return 0; } document.estiForm.submit(); } function checkStationeryNameQuant() { //alert('checking bizcard names'); if ((document.estiForm.cardName2.value != "" || document.estiForm.cardName3.value != "" || document.estiForm.cardName4.value != "" || document.estiForm.cardName5.value != "" || document.estiForm.cardName6.value != "" || document.estiForm.cardName7.value != "" || document.estiForm.cardName8.value != "") && document.estiForm.cardName1.value == "" && document.estiForm.cardQuant1.value != 0){ alert('Please enter a name for card 1'); document.estiForm.cardName1.focus(); return 0; } if (document.getElementById('bc_name_two').style.display == 'block' && document.estiForm.cardQuant2.value > 0 && document.estiForm.cardName2.value == ""){ alert('Please enter a name for card 2'); document.estiForm.cardName2.focus(); return 0; } if (document.getElementById('bc_name_three').style.display == 'block' && document.estiForm.cardQuant3.value > 0 && document.estiForm.cardName3.value == ""){ alert('Please enter a name for card 3'); document.estiForm.cardName3.focus(); return 0; } if (document.getElementById('bc_name_four').style.display == 'block' && document.estiForm.cardQuant4.value > 0 && document.estiForm.cardName4.value == ""){ alert('Please enter a name for card 4'); document.estiForm.cardName4.focus(); return 0; } if (document.getElementById('bc_name_five').style.display == 'block' && document.estiForm.cardQuant5.value > 0 && document.estiForm.cardName5.value == ""){ alert('Please enter a name for card 5'); document.estiForm.cardName5.focus(); return 0; } if (document.getElementById('bc_name_six').style.display == 'block' && document.estiForm.cardQuant6.value > 0 && document.estiForm.cardName6.value == ""){ alert('Please enter a name for card 6'); document.estiForm.cardName6.focus(); return 0; } if (document.getElementById('bc_name_seven').style.display == 'block' && document.estiForm.cardQuant7.value > 0 && document.estiForm.cardName7.value == ""){ alert('Please enter a name for card 7'); document.estiForm.cardName7.focus(); return 0; } if (document.getElementById('bc_name_eight').style.display == 'block' && document.estiForm.cardQuant8.value > 0 && document.estiForm.cardName8.value == ""){ alert('Please enter a name for card 8'); document.estiForm.cardName8.focus(); return 0; } if (document.estiForm.cardName1.value != "" && document.estiForm.cardQuant1.value < 500){ alert('Please enter a quantity for Name 1'); return 0; } if (document.estiForm.cardName2.value != "" && document.estiForm.cardQuant2.value < 500){ alert('Please enter a quantity for Name 2'); return 0; } if (document.estiForm.cardName3.value != "" && document.estiForm.cardQuant3.value < 500){ alert('Please enter a quantity for Name 3'); return 0; } if (document.estiForm.cardName4.value != "" && document.estiForm.cardQuant4.value < 500){ alert('Please enter a quantity for Name 4'); return 0; } if (document.estiForm.cardName5.value != "" && document.estiForm.cardQuant5.value < 500){ alert('Please enter a quantity for Name 5'); return 0; } if (document.estiForm.cardName6.value != "" && document.estiForm.cardQuant6.value < 500){ alert('Please enter a quantity for Name 6'); return 0; } if (document.estiForm.cardName7.value != "" && document.estiForm.cardQuant7.value < 500){ alert('Please enter a quantity for Name 7'); return 0; } if (document.estiForm.cardName8.value != "" && document.estiForm.cardQuant8.value < 500){ alert('Please enter a quantity for Name 8'); return 0; } if (document.estiForm.cardQuant5.value == 0 && (document.estiForm.cardQuant6.value != 0 || document.estiForm.cardQuant7.value != 0 || document.estiForm.cardQuant8.value != 0)){ alert('Our site requires that you enter names and quantities sequentially, beginning with Name 1, leaving no "blank" fields between names and quantities. Thank-you!'); return 0; } document.estiForm.submit(); } function openCertWin() { certwin=window.open("/grp/jsp/eco_cert.jsp", "ship_win", "width=700,height=600,toolbar=0,location=0,status=0,scrollbars=1,resizable=1"); } function redirect() { if (document.estiForm.doc_type) { if (document.estiForm.doc_type.options[document.estiForm.doc_type.selectedIndex].value == "promotional") { document.location.href="/grp/index.jsp"; } if (document.estiForm.doc_type.options[document.estiForm.doc_type.selectedIndex].value == "identity") { document.location.href="/grp/sp2.jsp"; } if (document.estiForm.doc_type.options[document.estiForm.doc_type.selectedIndex].value == "cards") { document.location.href="/grp/sp1.jsp"; } if (document.estiForm.doc_type.options[document.estiForm.doc_type.selectedIndex].value == "oversize") { document.location.href="/grp/sp3.jsp"; } if (document.estiForm.doc_type.options[document.estiForm.doc_type.selectedIndex].value == "multi") { document.location.href="/grp/multi.jsp"; } } } function checkDependencies() { if (document.estiForm.coverColors.options) { if (document.estiForm.coverColors.options[document.estiForm.coverColors.options.selectedIndex].value == "NoCover") { document.estiForm.coverPaper.disabled = true; } if (document.estiForm.coverColors.options[document.estiForm.coverColors.options.selectedIndex].value != "NoCover") { document.estiForm.coverPaper.disabled = false; } } else { if (document.estiForm.coverColors.value == "NoCover") { document.estiForm.coverPaper.disabled = true; } if (document.estiForm.coverColors.value != "NoCover") { document.estiForm.coverPaper.disabled = false; } } if (document.estiForm.multi) { /* reset the hidden form vars (specific to multi-page docs) to make accurate entries in estimate dbase */ document.estiForm.tsi_cover.value=""; document.estiForm.coverPapercharge.value=""; document.estiForm.coverPresscharge.value=""; document.estiForm.insideQuantity.value=""; document.estiForm.presscharge1.value=""; document.estiForm.presscharge2.value=""; document.estiForm.presscharge3.value=""; document.estiForm.booklet.value=""; document.estiForm.rush.value=""; } } function pausecomp(Amount) { d = new Date() //today's date while (1) { mill=new Date() // Date Now diff = mill-d //difference in milliseconds if( diff > Amount ) { break; } } } function calcGrid() { document.estiForm.pricegrid.value=""; //for 250 document.estiForm.quantity.value=250; calculate_postcard(); document.estiForm.pricegrid.value=(document.estiForm.tp.value); //for 500 document.estiForm.quantity.value=500; calculate_postcard(); document.estiForm.pricegrid.value=(document.estiForm.pricegrid.value + "\n" + document.estiForm.tp.value); for (i=1000; i<=5000; i=(i+1000)) { document.estiForm.quantity.value=i; calculate_postcard(); document.estiForm.pricegrid.value=(document.estiForm.pricegrid.value + "\n" + document.estiForm.tp.value); } //for 10000 document.estiForm.quantity.value=10000; calculate_postcard(); document.estiForm.pricegrid.value=(document.estiForm.pricegrid.value + "\n" + document.estiForm.tp.value); //for 20000 document.estiForm.quantity.value=20000; calculate_postcard(); document.estiForm.pricegrid.value=(document.estiForm.pricegrid.value + "\n" + document.estiForm.tp.value); } function calcGridStandard() { document.estiForm.pricegrid.value=""; //for 250 //document.estiForm.quantity.value=250; //calculate(); //document.estiForm.pricegrid.value=(document.estiForm.tp.value); //for 500 document.estiForm.quantity.value=500; calculate(); document.estiForm.pricegrid.value=(document.estiForm.pricegrid.value + "\n" + document.estiForm.tp.value); for (i=1000; i<=5000; i=(i+1000)) { document.estiForm.quantity.value=i; calculate(); document.estiForm.pricegrid.value=(document.estiForm.pricegrid.value + "\n" + document.estiForm.tp.value); //put an extra space after the quant 1000 and 2000 if (i==1000 || i==2000) document.estiForm.pricegrid.value=(document.estiForm.pricegrid.value + "\n"); } //for 8000 document.estiForm.quantity.value=8000; calculate(); document.estiForm.pricegrid.value=(document.estiForm.pricegrid.value + "\n" + document.estiForm.tp.value); //for 10000 document.estiForm.quantity.value=10000; calculate(); document.estiForm.pricegrid.value=(document.estiForm.pricegrid.value + "\n" + document.estiForm.tp.value); //for 20000 document.estiForm.quantity.value=20000; calculate(); document.estiForm.pricegrid.value=(document.estiForm.pricegrid.value + "\n" + document.estiForm.tp.value); //for 30000 document.estiForm.quantity.value=30000; calculate(); document.estiForm.pricegrid.value=(document.estiForm.pricegrid.value + "\n" + document.estiForm.tp.value); //for 40000 document.estiForm.quantity.value=40000; calculate(); document.estiForm.pricegrid.value=(document.estiForm.pricegrid.value + "\n" + document.estiForm.tp.value); //for 50000 document.estiForm.quantity.value=50000; calculate(); document.estiForm.pricegrid.value=(document.estiForm.pricegrid.value + "\n" + document.estiForm.tp.value); } function calculate_multi(mode) { // Remove non-numeric characters document.estiForm.quantity.value = document.estiForm.quantity.value.replace(/\D/g, ""); if (setQuant() <= 0 && document.estiForm.tp) { document.estiForm.tp.value=formatCurrency(0); document.estiForm.ppu.value=formatCurrency(0); return true; } else if (setQuant() <= 0) { updatePrice("tp", formatCurrency(0), 0, document.estiForm.quantity.value); updatePrice("ppu", formatCurrency(0), 0, document.estiForm.quantity.value); return true; } checkDependencies(); //square inches, height, width if (document.estiForm.finalHeight.options) { height = document.estiForm.finalHeight.options[document.estiForm.finalHeight.selectedIndex].value; width = document.estiForm.finalWidth.options[document.estiForm.finalWidth.selectedIndex].value; } else { height = document.estiForm.finalHeight.value; width = document.estiForm.finalWidth.value } quantity = document.estiForm.realquant.value; pages = document.estiForm.pages.value; productFamily = document.estiForm.productFamily.value; //if (document.estiForm.coverColors.options) { //if (document.estiForm.coverColors.options[document.estiForm.coverColors.selectedIndex].value == document.estiForm.colors.options[document.estiForm.colors.selectedIndex].value //&& document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value) { /* user chose same colors/paper for cover as they did for inside pages. Treat this as a "self-cover" and just increment pages value by 4. A similar check is made in the calcPress(), and calcPaper() functions, in order to avoid calculating additinoal cost for coverPaper and coverPress. It's already accounted for in the inside pages calculation for both press and paper. */ //pages = (eval(pages) + 4); //} //} //else { //if (document.estiForm.coverColors.value == document.estiForm.colors.value //&& document.estiForm.coverPaper.value == document.estiForm.paper.value) { /* user chose same colors/paper for cover as they did for inside pages. Treat this as a "self-cover" and just increment pages value by 4. A similar check is made in the calcPress(), and calcPaper() functions, in order to avoid calculating additinoal cost for coverPaper and coverPress. It's already accounted for in the inside pages calculation for both press and paper. */ //pages = (eval(pages) + 4); //} //} inside_quantity = ( (quantity * pages) / 4); inside_sheets = (inside_quantity / quantity); /*alert ("quantity: " + quantity + "\n" + "inside quantity: " + inside_quantity + "\n" + "inside_sheets: " + inside_sheets);*/ //put inside_quantity to hidden html form object to be used for shipping weight/cost calculations document.estiForm.insideQuantity.value = inside_quantity; //square inches for one unfolded sheet of booklet si = (height * width * 2); //square inches of all inside pages per booklet inside_si = (si * inside_sheets); //total square inches for cover tsi_cover = (si * quantity); //total square inches for inside pages tsi = (si * inside_quantity); var finalHeight = document.estiForm.finalHeight.value; var finalWidth = document.estiForm.finalWidth.value; if (document.estiForm.mailing && document.estiForm.mailQuant.value > 0) { checkMailDependencies(productFamily, quantity, document.estiForm.mailQuant.value); } if (document.estiForm.mailing) { var mailRate = document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value; var mailQuant = document.estiForm.mailQuant.value; if (document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value != "no" && mailQuant > 0) { var weightPerUnit = getUnitWeightOnces((tsi + tsi_cover), quantity); if (document.estiForm.weightPerUnit) document.estiForm.weightPerUnit.value=weightPerUnit; var mailPostage = (calcPostage(productFamily, (finalHeight*finalWidth), weightPerUnit, mailQuant, mailRate))?calcPostage(productFamily, (finalHeight*finalWidth), weightPerUnit, mailQuant, mailRate):0; var mailLabor = (calcMailLabor(si, weightPerUnit, mailQuant, mailRate))?calcMailLabor(si, weightPerUnit, mailQuant, mailRate):0; //alert("unitWeight:" + weightPerUnit + "\nmailPostage:" + mailPostage + "\nmailLabor:" + mailLabor); var totalMailingCost = (mailPostage + mailLabor); updateText("mailCostTop", formatCurrency2(totalMailingCost)); showDiv2("mailCostDiv"); updateText("myMailCost", formatCurrency2(totalMailingCost)); totalMailingCost = Math.round(totalMailingCost); //round it to the nearest buck document.estiForm.mailCost.value = formatAsMoney(totalMailingCost); //then add two zero's to the end var shipQuant = (quantity - mailQuant); updateText("myShipQuant", shipQuant); document.estiForm.shipQuant.value = shipQuant; } else { var totalMailingCost = 0; updateText("mailCostTop", formatCurrency2(totalMailingCost)); updateText("myShipQuant", quantity); document.estiForm.shipQuant.value = quantity; document.estiForm.mailCost.value = "0.00"; hideDiv2("mailCostDiv"); } } else { if (document.estiForm.shipQuant) document.estiForm.shipQuant.value = quantity; if (document.estiForm.mailCost) document.estiForm.mailCost.value = "0.00"; } if ((inside_si) <= 561) { // up to 12 inside pages @ 8.5 x 11 each (all fites on one signature) //alert("Less than or equal to one press sheet" + "\nInside Sheets: " + inside_sheets); tp_no_rush = (calcPaper(tsi_cover, si, "cover") + calcPaper(tsi, si, "pages") + calcPress(quantity, si, "cover") + calcPress(quantity, 561, "pages1") + calcDrilling() + calcProof(si + (inside_si)) + calcHandling(tsi + tsi_cover) + calcBooklet(quantity, pages, inside_quantity) ); } else if (inside_si > 561 && inside_si <= 1122) { //over 12 inside pages and up to 24 @ 8.5 x 11 each (fits on two signatures) if ( Math.ceil((inside_si % 561) / si) == 0) {//this means that the pages fit on an EXACT number of sheets (i.e. 2 or 3) //my_inside_quantity1 = ( (Math.floor(561 / si)) * quantity); // quantity that will fit on first press sheet. //my_inside_quantity2 = ( (Math.floor(561 / si)) * quantity); // quantity that will fit on first press sheet. sig1_si=561; sig2_si=561; } else { // fits on two signatures //my_inside_quantity1 = ( (Math.floor(561 / si)) * quantity); // quantity that will fit on first press sheet. //my_inside_quantity2 = ( Math.ceil((inside_si % 561) / si) * quantity); sig1_si=561; sig2_si=(inside_si - 561); //alert("sig2_si : " + sig2_si); } //alert("Inside Sheets: " + inside_sheets + "\nTotal Signatures: " + (inside_si / 561) + "(exact=" + Math.ceil(inside_si / 561) + ")\nExtra Square Inches: " + (inside_si % 561) + "\nExtra Sheets: " + ((inside_si % 561) / si) + "(rounded=" + Math.ceil(((inside_si % 561) / si)) + ")\nTotal Quantity on Press Sheet #1: " + my_inside_quantity1 + "\nTotal Quantity on Press Sheet #2: " + my_inside_quantity2); tp_no_rush = (calcPaper(tsi_cover, si, "cover") + calcPaper(tsi, si, "pages") + calcPress(quantity, si, "cover") + calcPress(quantity, sig1_si, "pages1") + calcPress(quantity, sig2_si, "pages2") + calcDrilling() + calcProof(si + inside_si) + calcHandling(tsi + tsi_cover) + calcBooklet(quantity, pages, inside_quantity) ); } else if (inside_si > 1122 && inside_si <= 1683) { //over 24 inside pages and up to 36 @ 8.5 x 11 each (fits on three signatures) if ( Math.ceil(((inside_si % 561) / si)) == 0) { //this means that the pages fit on an EXACT number of sheets (i.e. 3 or 4) //my_inside_quantity1 = ( (Math.floor(561 / si)) * quantity); // quantity that will fit on first press sheet. //my_inside_quantity2 = ( (Math.floor(561 / si)) * quantity); // quantity that will fit on second press sheet. //my_inside_quantity3 = ( (Math.floor(561 / si)) * quantity); // quantity that will fit on third press sheet. sig1_si=561; sig2_si=561; sig3_si=561; } else { //fits on three signatures //my_inside_quantity1 = ( (Math.floor(561 / si)) * quantity); // quantity that will fit on first press sheet. //my_inside_quantity2 = ( (Math.floor(561 / si)) * quantity); // quantity that will fit on second press sheet. //my_inside_quantity3 = ( Math.ceil(inside_si % 1122 / si) * quantity); // quantity that will fit on third press sheet. sig1_si=561 sig2_si=561 sig3_si=(inside_si - (2 * 561)) } //alert("Inside Sheets: " + inside_sheets + "\nTotal Signatures: " + (inside_si / 561) + "(exact=" + Math.ceil((inside_si / 561)) + ")\nExtra Square Inches: " + (inside_si % 1122) + "\nExtra Sheets: " + ((inside_si % 1122) / si) + "(rounded=" + Math.ceil( (inside_si % 1122) / si) + ")\nTotal Quantity on Press Sheet #1: " + my_inside_quantity1 + "\nTotal Quantity on Press Sheet #2: " + my_inside_quantity2 + "\nTotal Quantity on Press Sheet #3: " + my_inside_quantity3); //alert("sig3_si: " + sig3_si); tp_no_rush = (calcPaper(tsi_cover, si, "cover") + calcPaper(tsi, si, "pages") + calcPress(quantity, si, "cover") + calcPress(quantity, sig1_si, "pages1") + calcPress(quantity, sig2_si, "pages2") + calcPress(quantity, sig3_si, "pages3") + calcDrilling() + calcProof(si + inside_si) + calcHandling(tsi + tsi_cover) + calcBooklet(quantity, pages, inside_quantity) ); } else if (inside_si > 1683 && inside_si <= 2244) { //over 36 inside pages and up to 48 @ 8.5 x 11 each (fits on three signatures) if ( Math.ceil(((inside_si % 561) / si)) == 0) { //this means that the pages fit on an EXACT number of sheets (i.e. 3 or 4) sig1_si=561; sig2_si=561; sig3_si=561; sig4_si=561; } else { //fits on three signatures sig1_si=561; sig2_si=561; sig3_si=561; sig4_si=(inside_si - (3 * 561)) } //alert("Inside Sheets: " + inside_sheets + "\nTotal Signatures: " + (inside_si / 561) + "(exact=" + Math.ceil((inside_si / 561)) + ")\nExtra Square Inches: " + (inside_si % 1122) + "\nExtra Sheets: " + ((inside_si % 1122) / si) + "(rounded=" + Math.ceil( (inside_si % 1122) / si) + ")\nTotal Quantity on Press Sheet #1: " + my_inside_quantity1 + "\nTotal Quantity on Press Sheet #2: " + my_inside_quantity2 + "\nTotal Quantity on Press Sheet #3: " + my_inside_quantity3); //alert("sig3_si: " + sig3_si); tp_no_rush = (calcPaper(tsi_cover, si, "cover") + calcPaper(tsi, si, "pages") + calcPress(quantity, si, "cover") + calcPress(quantity, sig1_si, "pages1") + calcPress(quantity, sig2_si, "pages2") + calcPress(quantity, sig3_si, "pages3") + calcPress(quantity, sig4_si, "pages4") + calcDrilling() + calcProof(si + inside_si) + calcHandling(tsi + tsi_cover) + calcBooklet(quantity, pages, inside_quantity) ); } else if (inside_si > 2244 && inside_si <= 2805) { //over 48 inside pages and up to 60 @ 8.5 x 11 each (fits on three signatures) if ( Math.ceil(((inside_si % 561) / si)) == 0) { //this means that the pages fit on an EXACT number of sheets (i.e. 3 or 4) sig1_si=561; sig2_si=561; sig3_si=561; sig4_si=561; sig5_si=561; } else { //fits on three signatures sig1_si=561; sig2_si=561; sig3_si=561; sig4_si=561; sig5_si=(inside_si - (4 * 561)) } //alert("Inside Sheets: " + inside_sheets + "\nTotal Signatures: " + (inside_si / 561) + "(exact=" + Math.ceil((inside_si / 561)) + ")\nExtra Square Inches: " + (inside_si % 1122) + "\nExtra Sheets: " + ((inside_si % 1122) / si) + "(rounded=" + Math.ceil( (inside_si % 1122) / si) + ")\nTotal Quantity on Press Sheet #1: " + my_inside_quantity1 + "\nTotal Quantity on Press Sheet #2: " + my_inside_quantity2 + "\nTotal Quantity on Press Sheet #3: " + my_inside_quantity3); //alert("sig3_si: " + sig3_si); tp_no_rush = (calcPaper(tsi_cover, si, "cover") + calcPaper(tsi, si, "pages") + calcPress(quantity, si, "cover") + calcPress(quantity, sig1_si, "pages1") + calcPress(quantity, sig2_si, "pages2") + calcPress(quantity, sig3_si, "pages3") + calcPress(quantity, sig4_si, "pages4") + calcPress(quantity, sig5_si, "pages5") + calcDrilling() + calcProof(si + inside_si) + calcHandling(tsi + tsi_cover) + calcBooklet(quantity, pages, inside_quantity) ); } else if (inside_si > 2805 && inside_si <= 3366) { //over 60 inside pages and up to 72 @ 8.5 x 11 each (fits on three signatures) if ( Math.ceil(((inside_si % 561) / si)) == 0) { //this means that the pages fit on an EXACT number of sheets (i.e. 3 or 4) sig1_si=561; sig2_si=561; sig3_si=561; sig4_si=561; sig5_si=561; sig6_si=561; } else { //fits on three signatures sig1_si=561; sig2_si=561; sig3_si=561; sig4_si=561; sig5_si=561; sig6_si=(inside_si - (5 * 561)) } //alert("Inside Sheets: " + inside_sheets + "\nTotal Signatures: " + (inside_si / 561) + "(exact=" + Math.ceil((inside_si / 561)) + ")\nExtra Square Inches: " + (inside_si % 1122) + "\nExtra Sheets: " + ((inside_si % 1122) / si) + "(rounded=" + Math.ceil( (inside_si % 1122) / si) + ")\nTotal Quantity on Press Sheet #1: " + my_inside_quantity1 + "\nTotal Quantity on Press Sheet #2: " + my_inside_quantity2 + "\nTotal Quantity on Press Sheet #3: " + my_inside_quantity3); //alert("sig3_si: " + sig3_si); tp_no_rush = (calcPaper(tsi_cover, si, "cover") + calcPaper(tsi, si, "pages") + calcPress(quantity, si, "cover") + calcPress(quantity, sig1_si, "pages1") + calcPress(quantity, sig2_si, "pages2") + calcPress(quantity, sig3_si, "pages3") + calcPress(quantity, sig4_si, "pages4") + calcPress(quantity, sig5_si, "pages5") + calcPress(quantity, sig6_si, "pages6") + calcDrilling() + calcProof(si + inside_si) + calcHandling(tsi + tsi_cover) + calcBooklet(quantity, pages, inside_quantity) ); } else { alert("**Error - signature count: " + inside_sheets + "beyond maximum limit"); return; } nexpress_tp = (calcPaper(tsi_cover, si, "cover") + calcPaper(tsi, si, "pages") + calcNexPress(quantity, si, "cover") + calcNexPress(quantity, inside_si, "pages") + calcDrilling() + calcNexPressProof(si + inside_si) + calcHandling(tsi + tsi_cover) + calcBooklet(quantity, pages, inside_quantity) ); //total price without rush charges //tp_no_rush = (calcPaper(tsi_cover, si, "cover") + calcPaper(tsi, si, "pages") + calcPress(quantity, si, "cover") + calcPress(inside_quantity, si, "pages") + calcDrilling() + calcProof(si + (si * inside_sheets)) + calcHandling(tsi + tsi_cover) ); //total price with rush charges tp = (tp_no_rush + calcRush(tp_no_rush)); nexpress_tp = (nexpress_tp + calcRush(nexpress_tp)); //used for %5 addition to recycled paper orders tp = (tp + paperMarketAdjustment(tp, "multi", quantity)); nexpress_tp = (nexpress_tp + paperMarketAdjustment(nexpress_tp, "multi", quantity)); // as of 01-07-2008, all multi-page order have been increased by 20% (-NW) tp = tp*1.2; nexpress_tp = nexpress_tp*1.2; //adjust for market changes based on quantity tp = (tp + marketAdjustmentByQuantity(tp, si, "", "multi", quantity)); nexpress_tp = (nexpress_tp + marketAdjustmentByQuantity(nexpress_tp, si, "", "multi", quantity)); //adjust for market changes tp = (tp + marketAdjustment(tp, "multi", quantity)); nexpress_tp = (nexpress_tp + marketAdjustment(nexpress_tp, "multi", quantity)); document.estiForm.si.value=si; document.estiForm.tsi_cover.value=tsi_cover; document.estiForm.tsi.value=tsi; if (nexpress_tp < tp && si <= 234) { if (mode && mode == "1") { ppu = (nexpress_tp / (document.estiForm.realquant.value)); updatePrice("tp",formatCurrency2(nexpress_tp), Math.round(nexpress_tp), quantity); document.estiForm.press.value="NexP"; updatePrice("ppu", formatCurrency(ppu), ppu, quantity); } else { //document.estiForm.tp.value=formatCurrency2(nexpress_tp); //document.estiForm.ppu.value=formatCurrency(ppu); document.estiForm.press.value="NexP"; ppu = (nexpress_tp / (document.estiForm.realquant.value)); if (document.estiForm.mailing && document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value != "no" && document.estiForm.mailQuant.value > 0) { //IF MAILING IS ON AND HAS A VALID QUANTITY var printTotal = nexpress_tp; var grandTotal = (nexpress_tp + Math.round(totalMailingCost)); showDiv2("mailCostDiv"); updateText("myPrintCost", formatCurrency2(nexpress_tp)); updateText("myTp", formatCurrency2(grandTotal)); document.estiForm.printCost.value = formatAsMoney(printTotal); //adds two zeros to the end of the price. document.estiForm.ppu.value = formatCurrency(ppu); document.estiForm.tp.value = formatCurrency(grandTotal); } else { //NO MAILING var printTotal = nexpress_tp; var grandTotal = nexpress_tp; hideDiv2("mailCostDiv"); updateText("myTp", formatCurrency2(grandTotal)); document.estiForm.ppu.value=formatCurrency(ppu); document.estiForm.tp.value=formatCurrency2(nexpress_tp); printTotal = Math.round(printTotal); //round to the nearest buck document.estiForm.printCost.value = formatAsMoney(printTotal); //adds two zeros to the end of the price. document.estiForm.shipQuant.value = quantity; } } } else { if (mode && mode == "1") { ppu = (tp / (document.estiForm.realquant.value)); updatePrice("tp", formatCurrency(tp), tp, quantity); document.estiForm.press.value="74CD"; updatePrice("ppu", formatCurrency(ppu), ppu, quantity); } else { //document.estiForm.tp.value=formatCurrency(tp); //document.estiForm.ppu.value=formatCurrency(ppu); document.estiForm.press.value="74CD"; ppu = (tp / (document.estiForm.realquant.value)); if (document.estiForm.mailing && document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value != "no" && document.estiForm.mailQuant.value > 0) { //IF MAILING IS ON AND HAS A VALID QUANTITY var printTotal = tp; var grandTotal = (tp + Math.round(totalMailingCost)); showDiv2("mailCostDiv"); updateText("myPrintCost", formatCurrency(tp)); updateText("myTp", formatCurrency(grandTotal)); document.estiForm.printCost.value = formatAsMoney(tp); //this trick adds two zeros to the end of the price. document.estiForm.ppu.value = formatCurrency(ppu); document.estiForm.tp.value = formatCurrency(grandTotal); } else { //NO MAILING var printTotal = tp; var grandTotal = tp; hideDiv2("mailCostDiv"); updateText("myTp", formatCurrency(grandTotal)); document.estiForm.ppu.value=formatCurrency(ppu); document.estiForm.tp.value=formatCurrency(tp); document.estiForm.printCost.value = formatAsMoney(printTotal); } } } /* alert("calculated the following:"+ "\nsSquare Inches: " + si + "\nTotal Square Inches: " + tsi + "\nTotal Price: " + tp + "\nPrice Per Unit: " + ppu) */ /* alert ("calculating for:"+ "\nColors:\t" + document.estiForm.colors.options[document.estiForm.colors.selectedIndex].value + "\nWidth:\t" + document.estiForm.finalWidth.options[document.estiForm.finalWidth.selectedIndex].value + "\nHeight:\t" + document.estiForm.finalHeight.options[document.estiForm.finalHeight.selectedIndex].value + "\nUnit Square Inches:\t" + si + "\nTotal Square Inches:\t" + tsi + "\nQuantity:\t" + document.estiForm.realquant.value); */ } function checkFinalMailDependencies(productFamily, quantity, mailQuant) { if (document.estiForm.mailing && document.estiForm.mailQuant.value > 0 && document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value != "no") { if (document.estiForm.height.options) var si = (document.estiForm.height.options[document.estiForm.height.selectedIndex].value * document.estiForm.width.options[document.estiForm.width.selectedIndex].value); else if (productFamily=="Booklet" || productFamily=="Catalog" || productFamily=="Calendar") { si = (document.estiForm.finalHeight.value * document.estiForm.finalWidth.value); } else si = (document.estiForm.height.value * document.estiForm.width.value); if (productFamily == "Card" && document.estiForm.blankEnvelopes.value == "no") { if (mailQuant && mailQuant < 500 && mailQuant > 0 && (document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value=="firstClass" || document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value=="bulkMail" || document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value=="nonProfit")) { document.estiForm.mailing.selectedIndex=4; alert("None of the presorted mailing options (which includes First Class, Bulk Mail and Non-Profit) are available when mailing fewer than 500 pieces. The Stamps option has been selected instead!"); } var validSmallPostcardPapers = new Array(12); validSmallPostcardPapers[0] = "105_nl_rein_book"; validSmallPostcardPapers[1] = "80_nl_rein_cover"; validSmallPostcardPapers[2] = "95_nl_rein_cover"; validSmallPostcardPapers[3] = "92.5_nl_pvg_cover"; validSmallPostcardPapers[4] = "111_nl_pvg_cover"; validSmallPostcardPapers[5] = "80_nl_ec_cover"; validSmallPostcardPapers[6] = "100_nl_ec_cover"; validSmallPostcardPapers[7] = "80_cover"; validSmallPostcardPapers[8] = "100_cover"; validSmallPostcardPapers[9] = "12pt_cover"; validSmallPostcardPapers[10] = "96_nl_sak_cover"; validSmallPostcardPapers[11] = "96_nl_sak_cover"; var validLargePostcardPapers = new Array(8); validLargePostcardPapers[0] = "80_nl_rein_cover"; validLargePostcardPapers[1] = "95_nl_rein_cover"; validLargePostcardPapers[2] = "111_nl_pvg_cover"; validLargePostcardPapers[3] = "80_nl_ec_cover"; validLargePostcardPapers[4] = "100_nl_ec_cover"; validLargePostcardPapers[5] = "100_cover"; validLargePostcardPapers[6] = "96_nl_sak_cover"; validLargePostcardPapers[7] = "96_nl_sak_cover"; if (si <= 25.5) { var validPaper = false; for (x in validSmallPostcardPapers) { //alert(validSmallPostcardPapers[x]); if (document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value==validSmallPostcardPapers[x]) validPaper=true; } if(!validPaper) { document.estiForm.mailing.selectedIndex=0; alert("The combination of size (" + document.estiForm.height.options[document.estiForm.height.selectedIndex].value + " x " + document.estiForm.width.options[document.estiForm.width.selectedIndex].value + ") and paper (" + document.estiForm.paper.options[document.estiForm.paper.selectedIndex].text + ") is not a valid mailing choice. In some cases this can be resolved by changing to a heavier paper, or a smaller size."); return; } if (document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value=="bulkMail") { document.estiForm.mailing.selectedIndex=1; alert("Standard Presort Mail is not an option for the size (" + document.estiForm.height.options[document.estiForm.height.selectedIndex].value + " x " + document.estiForm.width.options[document.estiForm.width.selectedIndex].value + ") postcards that you've chosen. First Class has been selected instead."); return; } } else if (si > 25.5 && si <= 70.4375) { var validPaper = false; for (x in validLargePostcardPapers) { if (document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value==validLargePostcardPapers[x]) validPaper=true; } if(!validPaper) { document.estiForm.mailing.selectedIndex=0; alert("The combination of size (" + document.estiForm.height.options[document.estiForm.height.selectedIndex].value + " x " + document.estiForm.width.options[document.estiForm.width.selectedIndex].value + ") and paper (" + document.estiForm.paper.options[document.estiForm.paper.selectedIndex].text + ") is not a valid mailing choice. In some cases this can be resolved by changing to a heavier paper, or a smaller size."); } } else if (si > 70.4375) { document.estiForm.mailing.selectedIndex=0; alert("The combination of size (" + document.estiForm.height.options[document.estiForm.height.selectedIndex].value + " x " + document.estiForm.width.options[document.estiForm.width.selectedIndex].value + ") and paper (" + document.estiForm.paper.options[document.estiForm.paper.selectedIndex].text + ") is not a valid mailing choice. In some cases this can be resolved by changing to a heavier paper, or a smaller size."); } } else { // the non-postcard jobs var finalHeight = document.estiForm.finalHeight.value; var finalWidth = document.estiForm.finalWidth.value; if (mailQuant && mailQuant < 500 && mailQuant > 0 && (document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value=="firstClass" || document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value=="bulkMail" || document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value=="nonProfit")) { document.estiForm.mailing.selectedIndex=4; alert("None of the presorted mailing options (which includes First Class, Bulk Mail and Non-Profit) are available when mailing quantities fewer than 500. The stamp option has been selected instead!"); return; } if ((finalHeight*finalWidth) > 180 && (document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value=="firstClass" || document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value=="bulkMail" || document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value=="nonProfit")) { document.estiForm.mailing.selectedIndex=4; alert("The size you have chosen is too large to qualify for any of the presorted mailing options (which includes First Class, Bulk Mail and Non-Profit). Choosing a fold option may reduce the size of the final piece enough to qualify for presorted rates.\nThe stamp option has been selected."); return; } } } } function checkMailDependencies(productFamily, quantity, mailQuant) { /*if (document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value=="no") { if (document.estiForm.mailQuant) { document.estiForm.mailQuant.value=0; document.estiForm.mailQuant.disabled=true; } } else if (document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value!="no") { if (document.estiForm.mailQuant) document.estiForm.mailQuant.disabled=false; }*/ if (document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value=='no' && parseInt(document.estiForm.mailQuant.value) > 0) { document.estiForm.mailQuant.value='0'; alert('Please select a mail service before entering a quantity'); } var m = parseInt(document.estiForm.mailQuant.value); var q = parseInt(quantity); if(m > q) { document.estiForm.mailQuant.value=q; alert("The quantity to be mailed cannot be more than the total print quantity!"); } if (document.estiForm.pages) { //this is a multipage document var finalHeight = document.estiForm.finalHeight.value; var finalWidth = document.estiForm.finalWidth.value; var weightPerUnit = getUnitWeightOnces((tsi + tsi_cover), document.estiForm.quantity.value); if (weightPerUnit > 3) { alert("Your printed piece weighs more than 3 ounces and will require special attention. You'll need to contact customer service (csr@greenerprinter.com) to arrange for custom mailing."); document.estiForm.mailing.selectedIndex=0; document.estiForm.mailQuant.value=0; return; } } } function updateText(id, str) { if (document.getElementById(id)) { document.getElementById(id).innerHTML = str; } } function formatAsMoney(mnt) { mnt -= 0; mnt = (Math.round(mnt*100))/100; return (mnt == Math.floor(mnt)) ? mnt + '.00' : ( (mnt*10 == Math.floor(mnt*10)) ? mnt + '0' : mnt); } function calculateStationeryBizCards(){ sbc = 0; //baseline pricing for K + PMS 2-sided business cards (we'll remove the PMS charge if only black at the end) if (document.estiForm.stationeryBizCardQuantity && document.estiForm.stationeryBizCardQuantity.selectedIndex != 0 && (document.estiForm.stationeryBizCardColors.value == ("Black & 1 PMS / Black & 1 PMS") || document.estiForm.stationeryBizCardColors.value == ("Black / Black"))){ if (document.estiForm.stationeryBizCardQuantity.value == 500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.5403125); } if (document.estiForm.stationeryBizCardQuantity.value == 1000){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.2788525); } if (document.estiForm.stationeryBizCardQuantity.value == 1500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.191699167); } if (document.estiForm.stationeryBizCardQuantity.value == 2000){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.169905); } if (document.estiForm.stationeryBizCardQuantity.value == 2500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.1481225); } if (document.estiForm.stationeryBizCardQuantity.value == 3000){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.126334); } if (document.estiForm.stationeryBizCardQuantity.value == 3500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.104545833); } if (document.estiForm.stationeryBizCardQuantity.value == 4000){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.093652); } if (document.estiForm.stationeryBizCardQuantity.value == 4500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0827575); } if (document.estiForm.stationeryBizCardQuantity.value == 5000 || document.estiForm.stationeryBizCardQuantity.value == 5500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0696845); } if (document.estiForm.stationeryBizCardQuantity.value == 6000 || document.estiForm.stationeryBizCardQuantity.value == 6500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.060969167); } if (document.estiForm.stationeryBizCardQuantity.value == 7000 || document.estiForm.stationeryBizCardQuantity.value == 7500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0552925); } if (document.estiForm.stationeryBizCardQuantity.value == 8000 || document.estiForm.stationeryBizCardQuantity.value == 8500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.050555); } if (document.estiForm.stationeryBizCardQuantity.value == 9000 || document.estiForm.stationeryBizCardQuantity.value == 9500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.046870278); } if (document.estiForm.stationeryBizCardQuantity.value == 10000 || document.estiForm.stationeryBizCardQuantity.value == 10500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0439225); } if (document.estiForm.stationeryBizCardQuantity.value == 11000 || document.estiForm.stationeryBizCardQuantity.value == 11500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.041510682); } if (document.estiForm.stationeryBizCardQuantity.value == 12000 || document.estiForm.stationeryBizCardQuantity.value == 12500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.039500833); } if (document.estiForm.stationeryBizCardQuantity.value == 13000 || document.estiForm.stationeryBizCardQuantity.value == 13500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.037800192); } if (document.estiForm.stationeryBizCardQuantity.value == 14000 || document.estiForm.stationeryBizCardQuantity.value == 14500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0363425); } if (document.estiForm.stationeryBizCardQuantity.value == 15000 || document.estiForm.stationeryBizCardQuantity.value == 15500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.035079167); } if (document.estiForm.stationeryBizCardQuantity.value == 16000){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.03469375); } } //baseline pricing for K + PMS 1-sided business cards (we'll remove the PMS charge if only black at the end) if (document.estiForm.stationeryBizCardQuantity && document.estiForm.stationeryBizCardQuantity.selectedIndex != 0 && (document.estiForm.stationeryBizCardColors.value == ("Black & 1 PMS / blank") || document.estiForm.stationeryBizCardColors.value == ("Black / blank"))){ if (document.estiForm.stationeryBizCardQuantity.value == 500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.4559275); } if (document.estiForm.stationeryBizCardQuantity.value == 1000){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.2346475); } if (document.estiForm.stationeryBizCardQuantity.value == 1500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.1608875); } if (document.estiForm.stationeryBizCardQuantity.value == 2000 || document.estiForm.stationeryBizCardQuantity.value == 2500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.1240075); } if (document.estiForm.stationeryBizCardQuantity.value == 3000 || document.estiForm.stationeryBizCardQuantity.value == 3500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0871275); } if (document.estiForm.stationeryBizCardQuantity.value == 4000 || document.estiForm.stationeryBizCardQuantity.value == 4500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0686875); } if (document.estiForm.stationeryBizCardQuantity.value == 5000 || document.estiForm.stationeryBizCardQuantity.value == 5500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0576235); } if (document.estiForm.stationeryBizCardQuantity.value == 6000 || document.estiForm.stationeryBizCardQuantity.value == 6500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0502475); } if (document.estiForm.stationeryBizCardQuantity.value == 7000 || document.estiForm.stationeryBizCardQuantity.value == 7500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.045253214); } if (document.estiForm.stationeryBizCardQuantity.value == 8000 || document.estiForm.stationeryBizCardQuantity.value == 8500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0412675); } if (document.estiForm.stationeryBizCardQuantity.value == 9000 || document.estiForm.stationeryBizCardQuantity.value == 9500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0381675); } if (document.estiForm.stationeryBizCardQuantity.value == 10000 || document.estiForm.stationeryBizCardQuantity.value == 10500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0356875); } if (document.estiForm.stationeryBizCardQuantity.value == 11100 || document.estiForm.stationeryBizCardQuantity.value == 11500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.033658409); } if (document.estiForm.stationeryBizCardQuantity.value == 12000 || document.estiForm.stationeryBizCardQuantity.value == 12500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0319675); } if (document.estiForm.stationeryBizCardQuantity.value == 13000 || document.estiForm.stationeryBizCardQuantity.value == 13500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.030536731); } if (document.estiForm.stationeryBizCardQuantity.value == 14000 || document.estiForm.stationeryBizCardQuantity.value == 14500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.028624643); } if (document.estiForm.stationeryBizCardQuantity.value == 15000 || document.estiForm.stationeryBizCardQuantity.value == 15500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0282475); } if (document.estiForm.stationeryBizCardQuantity.value == 16000){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0276775); } } //baseline pricing for 2 PMS and 1 PMS 2-sided business cards (we'll remove the extra PMS charge if only 1 PMS at the end) if (document.estiForm.stationeryBizCardQuantity && document.estiForm.stationeryBizCardQuantity.selectedIndex != 0 && (document.estiForm.stationeryBizCardColors.value == ("2 PMS / 2 PMS") || document.estiForm.stationeryBizCardColors.value == ("1 PMS / 1 PMS"))){ if (document.estiForm.stationeryBizCardQuantity.value == 500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.6603125); } if (document.estiForm.stationeryBizCardQuantity.value == 1000){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.3388525); } if (document.estiForm.stationeryBizCardQuantity.value == 1500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.231699167); } if (document.estiForm.stationeryBizCardQuantity.value == 2000 || document.estiForm.stationeryBizCardQuantity.value == 2500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.1781225); } if (document.estiForm.stationeryBizCardQuantity.value == 3000 || document.estiForm.stationeryBizCardQuantity.value == 3500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.124545833); } if (document.estiForm.stationeryBizCardQuantity.value == 4000 || document.estiForm.stationeryBizCardQuantity.value == 4500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0977575); } if (document.estiForm.stationeryBizCardQuantity.value == 5000 || document.estiForm.stationeryBizCardQuantity.value == 5500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0816845); } if (document.estiForm.stationeryBizCardQuantity.value == 6000 || document.estiForm.stationeryBizCardQuantity.value == 6500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.070969167); } if (document.estiForm.stationeryBizCardQuantity.value == 7000 || document.estiForm.stationeryBizCardQuantity.value == 7500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.063863929); } if (document.estiForm.stationeryBizCardQuantity.value == 8000 || document.estiForm.stationeryBizCardQuantity.value == 8500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.058055); } if (document.estiForm.stationeryBizCardQuantity.value == 9000 || document.estiForm.stationeryBizCardQuantity.value == 9500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.053536944); } if (document.estiForm.stationeryBizCardQuantity.value == 10000 || document.estiForm.stationeryBizCardQuantity.value == 10500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0499225); } if (document.estiForm.stationeryBizCardQuantity.value == 11000 || document.estiForm.stationeryBizCardQuantity.value == 11500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.046965227); } if (document.estiForm.stationeryBizCardQuantity.value == 12000 || document.estiForm.stationeryBizCardQuantity.value == 12500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.044500833); } if (document.estiForm.stationeryBizCardQuantity.value == 13000 || document.estiForm.stationeryBizCardQuantity.value == 13500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.042415577); } if (document.estiForm.stationeryBizCardQuantity.value == 14000 || document.estiForm.stationeryBizCardQuantity.value == 14500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.040628214); } if (document.estiForm.stationeryBizCardQuantity.value == 15000 || document.estiForm.stationeryBizCardQuantity.value == 15500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.039079167); } if (document.estiForm.stationeryBizCardQuantity.value == 16000){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.03844375); } } //baseline pricing for 2 PMS and 1 PMS 1-sided business cards (we'll remove the extra PMS charge if only 1 PMS at the end) if (document.estiForm.stationeryBizCardQuantity && document.estiForm.stationeryBizCardQuantity.selectedIndex != 0 && (document.estiForm.stationeryBizCardColors.value == ("2 PMS / blank") || document.estiForm.stationeryBizCardColors.value == ("1 PMS / blank"))){ if (document.estiForm.stationeryBizCardQuantity.value == 500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.5759275); } if (document.estiForm.stationeryBizCardQuantity.value == 1000){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.2946475); } if (document.estiForm.stationeryBizCardQuantity.value == 1500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.2008875); } if (document.estiForm.stationeryBizCardQuantity.value == 2000 || document.estiForm.stationeryBizCardQuantity.value == 2500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.1540075); } if (document.estiForm.stationeryBizCardQuantity.value == 3000 || document.estiForm.stationeryBizCardQuantity.value == 3500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.1071275); } if (document.estiForm.stationeryBizCardQuantity.value == 4000 || document.estiForm.stationeryBizCardQuantity.value == 4500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0836875); } if (document.estiForm.stationeryBizCardQuantity.value == 5000 || document.estiForm.stationeryBizCardQuantity.value == 5500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0696235); } if (document.estiForm.stationeryBizCardQuantity.value == 6000 || document.estiForm.stationeryBizCardQuantity.value == 6500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0602475); } if (document.estiForm.stationeryBizCardQuantity.value == 7000 || document.estiForm.stationeryBizCardQuantity.value == 7500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.053824643); } if (document.estiForm.stationeryBizCardQuantity.value == 8000 || document.estiForm.stationeryBizCardQuantity.value == 8500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0487675); } if (document.estiForm.stationeryBizCardQuantity.value == 9000 || document.estiForm.stationeryBizCardQuantity.value == 9500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.044834167); } if (document.estiForm.stationeryBizCardQuantity.value == 10000 || document.estiForm.stationeryBizCardQuantity.value == 10500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0416875); } if (document.estiForm.stationeryBizCardQuantity.value == 11000 || document.estiForm.stationeryBizCardQuantity.value == 11500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.039112955); } if (document.estiForm.stationeryBizCardQuantity.value == 12000 || document.estiForm.stationeryBizCardQuantity.value == 12500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0369675); } if (document.estiForm.stationeryBizCardQuantity.value == 13000 || document.estiForm.stationeryBizCardQuantity.value == 13500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.035152115); } if (document.estiForm.stationeryBizCardQuantity.value == 14000 || document.estiForm.stationeryBizCardQuantity.value == 14500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.033596071); } if (document.estiForm.stationeryBizCardQuantity.value == 15000 || document.estiForm.stationeryBizCardQuantity.value == 15500){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0322475); } if (document.estiForm.stationeryBizCardQuantity.value == 16000){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.0314275); } } // plus 10% if Everest if (document.estiForm.stationeryBizCardQuantity && document.estiForm.stationeryBizCardQuantity.value != 0 && document.estiForm.paper.value == ("100_nl_ec_cover")){ sbc = (sbc * 1.1); } // pricing above assumed 1 or 2 PMS inks, so subtract plate/ink mix if only one (or none) PMS ink if (document.estiForm.stationeryBizCardQuantity && document.estiForm.stationeryBizCardQuantity.value != 0 && (document.estiForm.stationeryBizCardColors.value == ("Black / Black") || document.estiForm.stationeryBizCardColors.value == ("Black / blank") || document.estiForm.stationeryBizCardColors.value == ("1 PMS / 1 PMS") || document.estiForm.stationeryBizCardColors.value == ("1 PMS / blank"))){ sbc += (-80); } // subtract 1st PMS ink mix from business card price if already mixed for letterhead or envelope if (document.estiForm.stationeryBizCardQuantity && document.estiForm.stationeryBizCardQuantity.value != 0 && (document.estiForm.stationeryLetterhead.selectedIndex != 0 || document.estiForm.stationeryEnvelopes.selectedIndex != 0) && (document.estiForm.stationeryBizCardColors.value == ("Black + 1 PMS /Black + 1 PMS") || document.estiForm.stationeryBizCardColors.value == ("Black + 1 PMS / blank") || document.estiForm.stationeryBizCardColors.value == ("2 PMS / 2 PMS") || document.estiForm.stationeryBizCardColors.value == ("2 PMS / blank") || document.estiForm.stationeryBizCardColors.value == ("1 PMS / 1 PMS") || document.estiForm.stationeryBizCardColors.value == ("1 PMS / blank")) && ((document.estiForm.letterheadColors.value == ("2 PMS") || document.estiForm.letterheadColors.value == ("1 PMS") || document.estiForm.letterheadColors.value == ("Black + PMS")) ||(document.estiForm.stationeryEnvColors.value == ("2 PMS") || document.estiForm.stationeryEnvColors.value == ("1 PMS") || document.estiForm.stationeryEnvColors.value == ("Black + 1 PMS")))){ sbc += (-50); } // subtract 2nd PMS ink mix from business card price if already mixed for letterhead or envelope if ((document.estiForm.stationeryBizCardQuantity && document.estiForm.stationeryBizCardQuantity.value != 0) && (document.estiForm.stationeryLetterhead.selectedIndex != 0 || document.estiForm.stationeryEnvelopes.selectedIndex != 0) && (document.estiForm.stationeryBizCardColors.value == ("2 PMS / 2 PMS") || document.estiForm.stationeryBizCardColors.value == ("2 PMS / blank")) && ((document.estiForm.letterheadColors.value == ("2 PMS")) ||(document.estiForm.stationeryEnvColors.value == ("2 PMS")))){ sbc += (-50); } //add flat desktop fee of $10 for additional versions of business cards. If there are 5-8 names, we will also charge for extra plate(s)/makeready (separate logic) if (document.estiForm.productFamily && document.estiForm.productFamily.value == "Stationery"){ if (document.getElementById('bc_name_two').style.display == 'block' && document.estiForm.cardQuant2.selectedIndex != 0){ sbc += 10; } if (document.getElementById('bc_name_three').style.display == 'block' && document.estiForm.cardQuant3.selectedIndex != 0){ sbc += 10; } if (document.getElementById('bc_name_four').style.display == 'block' && document.estiForm.cardQuant4.selectedIndex != 0){ sbc += 10; } // we add $100 if there are more than four names due to extra plates and makeready (sheetwise vs. work/turn) if (document.getElementById('bc_name_five').style.display == 'block' && document.estiForm.cardQuant5.selectedIndex != 0){ sbc += 110; } if (document.getElementById('bc_name_six').style.display == 'block' && document.estiForm.cardQuant6.selectedIndex != 0){ sbc += 10; } if (document.getElementById('bc_name_seven').style.display == 'block' && document.estiForm.cardQuant7.selectedIndex != 0){ sbc += 10; } if (document.getElementById('bc_name_eight').style.display == 'block' && document.estiForm.cardQuant8.selectedIndex != 0){ sbc += 10; } } //alert(sbc); //add 10 cents per card for rounded corners on business cards if (document.estiForm.round_corners.value == "yes"){ sbc += (parseInt(document.estiForm.stationeryBizCardQuantity.value) * 0.1); } } function calculateStationery(mode) { calculateStationeryBizCards(mode); if (setStationeryQuant() <= 0 && document.estiForm.tp) { document.estiForm.tp.value=formatCurrency(0); updatePrice("tp", formatCurrency(0), 0, document.estiForm.quantity.value); return true; } else if (setStationeryQuant() <= 0) { updatePrice("tp", formatCurrency(0), 0, document.estiForm.quantity.value); return true; } //alert(sbc); productFamily = document.estiForm.productFamily.value; quantity = document.estiForm.realquant.value; document.estiForm.shipQuant.value = quantity; tp = 0; //start with baseline pricing on letterhead, black only if (document.estiForm.stationeryLetterhead && document.estiForm.stationeryLetterhead.selectedIndex != 0){ if (document.estiForm.stationeryLetterhead.value == 500){ tp += 192; } if (document.estiForm.stationeryLetterhead.value == 1000){ tp += 209; } if (document.estiForm.stationeryLetterhead.value == 1500){ tp += 229; } if (document.estiForm.stationeryLetterhead.value == 2000){ tp += 249; } if (document.estiForm.stationeryLetterhead.value == 2500){ tp += 273; } if (document.estiForm.stationeryLetterhead.value == 3000){ tp += 297; } if (document.estiForm.stationeryLetterhead.value == 3500){ tp += 321; } if (document.estiForm.stationeryLetterhead.value == 4000){ tp += 346; } if (document.estiForm.stationeryLetterhead.value == 4500){ tp += 370; } if (document.estiForm.stationeryLetterhead.value == 5000){ tp += 394; } if (document.estiForm.letterheadColors.value == ("Black Only")){ tp += 0; } // plus 60 bucks for ink mix if PMS if (document.estiForm.stationeryLetterhead && document.estiForm.stationeryLetterhead.selectedIndex != 0 && document.estiForm.letterheadColors.value == ("1 PMS")){ tp += 60; } //add the following amounts for 1 PMS ink mix and 1 plate and extra washup if ((document.estiForm.letterheadColors.value == ("Black + PMS")) && ((document.estiForm.stationeryLetterhead.value == 500) || (document.estiForm.stationeryLetterhead.value == 1000))){ tp += 121 } else if (document.estiForm.letterheadColors.value == ("Black + PMS") && document.estiForm.stationeryLetterhead.value == 1500){ tp += 122 } else if (document.estiForm.letterheadColors.value == ("Black + PMS") && document.estiForm.stationeryLetterhead.value == 2000){ tp += 123 } else if (document.estiForm.letterheadColors.value == ("Black + PMS") && document.estiForm.stationeryLetterhead.value == 2500){ tp += 125 } else if (document.estiForm.letterheadColors.value == ("Black + PMS") && document.estiForm.stationeryLetterhead.value == 3000){ tp += 127 } else if (document.estiForm.letterheadColors.value == ("Black + PMS") && document.estiForm.stationeryLetterhead.value == 3500){ tp += 129 } else if (document.estiForm.letterheadColors.value == ("Black + PMS") && document.estiForm.stationeryLetterhead.value == 4000){ tp += 130 } else if (document.estiForm.letterheadColors.value == ("Black + PMS") && document.estiForm.stationeryLetterhead.value == 4500){ tp += 132 } else if (document.estiForm.letterheadColors.value == ("Black + PMS") && document.estiForm.stationeryLetterhead.value == 5000){ tp += 134 } //or add the following amounts for 2 PMS ink mixes and 1 plate and washup if ((document.estiForm.letterheadColors.value == ("2 PMS")) && ((document.estiForm.stationeryLetterhead.value == 500) || (document.estiForm.stationeryLetterhead.value == 1000))){ tp += 178 } else if (document.estiForm.letterheadColors.value == ("2 PMS") && document.estiForm.stationeryLetterhead.value == 1500){ tp += 179 } else if (document.estiForm.letterheadColors.value == ("2 PMS") && document.estiForm.stationeryLetterhead.value == 2000){ tp += 180 } else if (document.estiForm.letterheadColors.value == ("2 PMS") && document.estiForm.stationeryLetterhead.value == 2500){ tp += 182 } else if (document.estiForm.letterheadColors.value == ("2 PMS") && document.estiForm.stationeryLetterhead.value == 3000){ tp += 184 } else if (document.estiForm.letterheadColors.value == ("2 PMS") && document.estiForm.stationeryLetterhead.value == 3500){ tp += 185 } else if (document.estiForm.letterheadColors.value == ("2 PMS") && document.estiForm.stationeryLetterhead.value == 4000){ tp += 187 } else if (document.estiForm.letterheadColors.value == ("2 PMS") && document.estiForm.stationeryLetterhead.value == 4500){ tp += 189 } else if (document.estiForm.letterheadColors.value == ("2 PMS") && document.estiForm.stationeryLetterhead.value == 5000){ tp += 191 } } // simple pricing for blank letterhead at $40 per 1000 if (document.estiForm.stationeryLetterheadBlank && document.estiForm.stationeryLetterheadBlank.selectedIndex != 0){ tp += (document.estiForm.stationeryLetterheadBlank.value / 500) * 20; } // baseline envelope pricing for black only if (document.estiForm.stationeryEnvelopes && document.estiForm.stationeryEnvelopes.selectedIndex != 0){ if (document.estiForm.stationeryEnvelopesSize.value == ("#9 (8.875 x 3.785)")){ if (document.estiForm.stationeryEnvelopes.value == 500){ tp += 216; } if (document.estiForm.stationeryEnvelopes.value == 1000){ tp += 265; } if (document.estiForm.stationeryEnvelopes.value == 1500){ tp += 314; } if (document.estiForm.stationeryEnvelopes.value == 2000){ tp += 363; } if (document.estiForm.stationeryEnvelopes.value == 2500){ tp += 417; } if (document.estiForm.stationeryEnvelopes.value == 3000){ tp += 471; } if (document.estiForm.stationeryEnvelopes.value == 3500){ tp += 525; } if (document.estiForm.stationeryEnvelopes.value == 4000){ tp += 579; } if (document.estiForm.stationeryEnvelopes.value == 4500){ tp += 633; } if (document.estiForm.stationeryEnvelopes.value == 5000){ tp += 687; } } else if (document.estiForm.stationeryEnvelopesSize.value == ("#10 (9.5 x 4.125)")){ if (document.estiForm.stationeryEnvelopes.value == 500){ tp += 208; } if (document.estiForm.stationeryEnvelopes.value == 1000){ //alert("1000 #10 envelopes = $251"); tp += 251; } if (document.estiForm.stationeryEnvelopes.value == 1500){ tp += 297; } if (document.estiForm.stationeryEnvelopes.value == 2000){ tp += 338; } if (document.estiForm.stationeryEnvelopes.value == 2500){ tp += 385; } if (document.estiForm.stationeryEnvelopes.value == 3000){ tp += 433; } if (document.estiForm.stationeryEnvelopes.value == 3500){ tp += 480; } if (document.estiForm.stationeryEnvelopes.value == 4000){ tp += 528; } if (document.estiForm.stationeryEnvelopes.value == 4500){ tp += 576; } if (document.estiForm.stationeryEnvelopes.value == 5000){ tp += 623; } } if (document.estiForm.stationeryEnvColors.value == ("Black Only")){ tp += 0; } //only charge for additional PMS ink mix on envelopes if we haven't already charged for it on letterhead if ((document.estiForm.stationeryEnvColors.value == ("1 PMS") || document.estiForm.stationeryEnvColors.value == ("Black + PMS") || document.estiForm.stationeryEnvColors.value == ("2 PMS")) && (document.estiForm.stationeryLetterhead.selectedIndex == 0 || document.estiForm.letterheadColors.value == ("Black Only"))){ //alert("adding 60 bucks for PMS mix = $311"); tp += 60; } // 60 bucks for extra PMS ink mix on envelope if not on letterhead if (document.estiForm.stationeryEnvColors.value == ("2 PMS") && (document.estiForm.stationeryLetterhead.selectedIndex == 0 || document.estiForm.letterheadColors.value != ("2 PMS"))){ //alert("adding another 60 bucks for 2nd PMS mix = $371"); tp += 60; } // additional plate and washup for PMS if ((document.estiForm.stationeryEnvColors.value == ("Black + PMS") || document.estiForm.stationeryEnvColors.value == ("2 PMS")) && document.estiForm.stationeryEnvelopes.value == 500){ tp += 58 } else if ((document.estiForm.stationeryEnvColors.value == ("Black + PMS") || document.estiForm.stationeryEnvColors.value == ("2 PMS")) && document.estiForm.stationeryEnvelopes.value == 1000){ //alert("adding 62 bucks for extra plate and washup of PMS = $433"); tp += 62 } else if ((document.estiForm.stationeryEnvColors.value == ("Black + PMS") || document.estiForm.stationeryEnvColors.value == ("2 PMS")) && document.estiForm.stationeryEnvelopes.value == 1500){ tp += 65 } else if ((document.estiForm.stationeryEnvColors.value == ("Black + PMS") || document.estiForm.stationeryEnvColors.value == ("2 PMS")) && document.estiForm.stationeryEnvelopes.value == 2000){ tp += 69 } else if ((document.estiForm.stationeryEnvColors.value == ("Black + PMS") || document.estiForm.stationeryEnvColors.value == ("2 PMS")) && document.estiForm.stationeryEnvelopes.value == 2500){ tp += 73 } else if ((document.estiForm.stationeryEnvColors.value == ("Black + PMS") || document.estiForm.stationeryEnvColors.value == ("2 PMS")) && document.estiForm.stationeryEnvelopes.value == 3000){ tp += 77 } else if ((document.estiForm.stationeryEnvColors.value == ("Black + PMS") || document.estiForm.stationeryEnvColors.value == ("2 PMS")) && document.estiForm.stationeryEnvelopes.value == 3500){ tp += 81 } else if ((document.estiForm.stationeryEnvColors.value == ("Black + PMS") || document.estiForm.stationeryEnvColors.value == ("2 PMS")) && document.estiForm.stationeryEnvelopes.value == 4000){ tp += 85 } else if ((document.estiForm.stationeryEnvColors.value == ("Black + PMS") || document.estiForm.stationeryEnvColors.value == ("2 PMS")) && document.estiForm.stationeryEnvelopes.value == 4500){ tp += 89 } else if ((document.estiForm.stationeryEnvColors.value == ("Black + PMS") || document.estiForm.stationeryEnvColors.value == ("2 PMS")) && document.estiForm.stationeryEnvelopes.value == 5000){ tp += 93 } } tp = (tp + sbc); if (document.estiForm.turnaround.value == ("5 day")) { tp = tp + (tp * .25) } if (document.estiForm.turnaround.value == ("3 day")) { tp = tp + (tp * .5) } //final multi-product discount to bring pricing more into line with Robert's - BV if (document.estiForm.stationeryLetterhead.selectedIndex != 0 && ((document.estiForm.stationeryEnvelopes.selectedIndex != 0 && document.estiForm.stationeryBizCardQuantity.value == 0) || (document.estiForm.stationeryEnvelopes.selectedIndex == 0 && document.estiForm.stationeryBizCardQuantity.value != 0))) { //alert("6% discount for letterhead and bizcards or envelopes"); tp = (tp * .94); } else if (document.estiForm.stationeryLetterhead.selectedIndex == 0 && (document.estiForm.stationeryEnvelopes.selectedIndex != 0 && document.estiForm.stationeryBizCardQuantity.value != 0)) { //alert("6% discount for bizcards and envelopes"); tp = (tp * .94); } else if (document.estiForm.stationeryLetterhead.selectedIndex != 0 && document.estiForm.stationeryEnvelopes.selectedIndex != 0 && document.estiForm.stationeryBizCardQuantity.value != 0) { //alert("10% discount for ordering all 3 products!"); tp = (tp * .9); } //document.estiForm.si.value=si; //document.estiForm.tsi.value=tsi; //si = (document.estiForm.height.value * document.estiForm.width.value); //height = document.estiForm.height.value; //width = document.estiForm.width.value //tsi = (si * quantity); //ppu = (tp / (document.estiForm.realquant.value)); if (mode && mode == 1) { updatePrice("ppu", formatCurrency(ppu), ppu, quantity); updatePrice("tp", formatCurrency2(tp), Math.round(tp), quantity); } else { var grandTotal = tp; hideDiv2("mailCostDiv"); updateText("myTp", formatCurrency(grandTotal)); //document.estiForm.ppu.value=formatCurrency(ppu); document.estiForm.tp.value=formatCurrency(tp); printTotal = grandTotal; document.estiForm.printCost.value = formatAsMoney(printTotal); } } function calculateBizCardPrice(mode) { // Remove non-numeric characters document.estiForm.quantity.value = document.estiForm.quantity.value.replace(/\D/g, ""); //alert(mode) if (setQuant() <= 0 && document.estiForm.tp) { document.estiForm.tp.value=formatCurrency(0); document.estiForm.ppu.value=formatCurrency(0); return true; } else if (setQuant() <= 0) { updatePrice("tp", formatCurrency(0), 0, document.estiForm.quantity.value); updatePrice("ppu", formatCurrency(0), 0, document.estiForm.quantity.value); return true; } productFamily = document.estiForm.productFamily.value; quantity = document.estiForm.realquant.value; if (document.estiForm.mailing && document.estiForm.mailQuant) { checkMailDependencies(productFamily, quantity, document.estiForm.mailQuant.value); } //square inches, height, width if (document.estiForm.height.options) { si = (document.estiForm.height.options[document.estiForm.height.selectedIndex].value * document.estiForm.width.options[document.estiForm.width.selectedIndex].value); height = document.estiForm.height.options[document.estiForm.height.selectedIndex].value; width = document.estiForm.width.options[document.estiForm.width.selectedIndex].value colors = document.estiForm.colors.options[document.estiForm.colors.selectedIndex].value; } else { si = (document.estiForm.height.value * document.estiForm.width.value); height = document.estiForm.height.value; width = document.estiForm.width.value colors = document.estiForm.colors.value; } if (document.estiForm.finalHeight) { var finalHeight = document.estiForm.finalHeight.value; var finalWidth = document.estiForm.finalWidth.value; } //total square inches tsi = (si * quantity); if (document.estiForm.mailing) { var mailRate = document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value; var mailQuant = document.estiForm.mailQuant.value; if (document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value != "no" && mailQuant > 0) { var weightPerUnit = getUnitWeightOnces(tsi, quantity); if (document.estiForm.weightPerUnit) document.estiForm.weightPerUnit.value=weightPerUnit; if (document.estiForm.fold && document.estiForm.fold.options[document.estiForm.fold.selectedIndex].value != 'no') { var mailPostage = (calcPostage(productFamily, (finalHeight*finalWidth), weightPerUnit, mailQuant, mailRate))?calcPostage(productFamily, (finalHeight*finalWidth), weightPerUnit, mailQuant, mailRate):0; } else var mailPostage = (calcPostage(productFamily, si, weightPerUnit, mailQuant, mailRate))?calcPostage(productFamily, si, weightPerUnit, mailQuant, mailRate):0; var mailLabor = (calcMailLabor(si, weightPerUnit, mailQuant, mailRate))?calcMailLabor(si, weightPerUnit, mailQuant, mailRate):0; //alert("unitWeight:" + weightPerUnit + "\nmailPostage:" + mailPostage + "\nmailLabor:" + mailLabor); var totalMailingCost = (mailPostage + mailLabor); updateText("mailCostTop", formatCurrency2(totalMailingCost)); showDiv2("mailCostDiv"); updateText("myMailCost", formatCurrency2(totalMailingCost)); totalMailingCost = Math.round(totalMailingCost); //round it to the nearest buck document.estiForm.mailCost.value = formatAsMoney(totalMailingCost); //then add two zero's to the end var shipQuant = (quantity - mailQuant); updateText("myShipQuant", shipQuant); document.estiForm.shipQuant.value = shipQuant; } else { var totalMailingCost = 0; updateText("mailCostTop", formatCurrency2(totalMailingCost)); updateText("myShipQuant", quantity); document.estiForm.shipQuant.value = quantity; document.estiForm.mailCost.value = "0.00"; hideDiv2("mailCostDiv"); } } else { if (document.estiForm.shipQuant) document.estiForm.shipQuant.value = quantity; if (document.estiForm.mailCost) document.estiForm.mailCost.value = "0.00"; } if (document.estiForm.quantity && document.estiForm.quantity.value != "0"){ if (document.estiForm.quantity.value == 250){ //alert ("Quantity = 250"); ppu = .216; } if (document.estiForm.quantity.value == 500){ //alert ("Quantity = 500"); ppu = .118; } if (document.estiForm.quantity.value == 750){ ppu = .104; } if (document.estiForm.quantity.value == 1000){ ppu = .09; } if (document.estiForm.quantity.value == 1250){ ppu = .085; } if (document.estiForm.quantity.value == 1500){ ppu = .08; } if (document.estiForm.quantity.value == 1750){ ppu = .0775; } if (document.estiForm.quantity.value == 2000 || document.estiForm.quantity.value == 2250){ ppu = .075; } if (document.estiForm.quantity.value == 2500 || document.estiForm.quantity.value == 2750 || document.estiForm.quantity.value == 3000 || document.estiForm.quantity.value == 3250 || document.estiForm.quantity.value == 3500 || document.estiForm.quantity.value == 3750 || document.estiForm.quantity.value == 4000 || document.estiForm.quantity.value == 4250 || document.estiForm.quantity.value == 4500 || document.estiForm.quantity.value == 4750 || document.estiForm.quantity.value == 5000){ ppu = .07; } if (document.estiForm.quantity.value == 5250 || document.estiForm.quantity.value == 5500 || document.estiForm.quantity.value == 5750 || document.estiForm.quantity.value == 6000 || document.estiForm.quantity.value == 6250 || document.estiForm.quantity.value == 6500 || document.estiForm.quantity.value == 6750 || document.estiForm.quantity.value == 7000){ ppu = .06; } if (document.estiForm.quantity.value == 7250 || document.estiForm.quantity.value == 7500 || document.estiForm.quantity.value == 7750 || document.estiForm.quantity.value == 8000 || document.estiForm.quantity.value == 8250 || document.estiForm.quantity.value == 8500 || document.estiForm.quantity.value == 8750){ ppu = .05; } if (document.estiForm.quantity.value == 9000 || document.estiForm.quantity.value == 9250 || document.estiForm.quantity.value == 9500 || document.estiForm.quantity.value == 9750 || document.estiForm.quantity.value == 10000 || document.estiForm.quantity.value == 10250 || document.estiForm.quantity.value == 10500 || document.estiForm.quantity.value == 10750 || document.estiForm.quantity.value == 11000 || document.estiForm.quantity.value == 11250 || document.estiForm.quantity.value == 11500 || document.estiForm.quantity.value == 11750){ ppu = .04; } if (document.estiForm.quantity.value == 12000 || document.estiForm.quantity.value == 12250 || document.estiForm.quantity.value == 12500 || document.estiForm.quantity.value == 12750 || document.estiForm.quantity.value == 13000 || document.estiForm.quantity.value == 13250 || document.estiForm.quantity.value == 13500 || document.estiForm.quantity.value == 13750 || document.estiForm.quantity.value == 14000 || document.estiForm.quantity.value == 14250 || document.estiForm.quantity.value == 14500 || document.estiForm.quantity.value == 14750){ ppu = .03; } if (document.estiForm.quantity.value == 15000 || document.estiForm.quantity.value == 15250 || document.estiForm.quantity.value == 15500 || document.estiForm.quantity.value == 15750 || document.estiForm.quantity.value == 16000){ ppu = .0275; } if (document.estiForm.colors.options) { if (document.estiForm.colors.options[document.estiForm.colors.selectedIndex].value=="4over1") { ppu = (ppu + (ppu * .152)); } else if (document.estiForm.colors.options[document.estiForm.colors.selectedIndex].value=="4over4") { ppu = (ppu + (ppu * .283)); } } else { if (document.estiForm.colors.value=="4over1") { ppu = (ppu + (ppu * .152)); } else if (document.estiForm.colors.value=="4over4") { ppu = (ppu + (ppu * .283)); } } } tp = ((document.estiForm.quantity.value) * ppu); //add flat fee of $10 for additional versions of business cards if (document.estiForm.variableData && document.estiForm.variableData.value == "yes") { } else if (document.estiForm.productFamily && document.estiForm.productFamily.value == "BusCard") { if (document.getElementById('bc_name_one').style.display == 'block' && ( parseInt(document.estiForm.cardQuant2.value) != 0 || parseInt(document.estiForm.cardQuant3.value) != 0 || parseInt(document.estiForm.cardQuant4.value) != 0 || parseInt(document.estiForm.cardQuant5.value) != 0 || parseInt(document.estiForm.cardQuant6.value) != 0 || parseInt(document.estiForm.cardQuant7.value) != 0 || parseInt(document.estiForm.cardQuant8.value) != 0) && parseInt(document.estiForm.cardQuant1.value) == 250){ tp += 13; } if (document.getElementById('bc_name_two').style.display == 'block' && parseInt(document.estiForm.cardQuant2.value) != 0 && parseInt(document.estiForm.cardQuant2.value) != 250){ tp += 10; } if (document.getElementById('bc_name_two').style.display == 'block' && parseInt(document.estiForm.cardQuant2.value) != 0 && parseInt(document.estiForm.cardQuant2.value) == 250){ tp += 23; } if (document.getElementById('bc_name_three').style.display == 'block' && parseInt(document.estiForm.cardQuant3.value) != 0 && parseInt(document.estiForm.cardQuant3.value) != 250){ tp += 10; } if (document.getElementById('bc_name_three').style.display == 'block' && parseInt(document.estiForm.cardQuant3.value) != 0 && parseInt(document.estiForm.cardQuant3.value) == 250){ tp += 23; } if (document.getElementById('bc_name_four').style.display == 'block' && parseInt(document.estiForm.cardQuant4.value) != 0 && parseInt(document.estiForm.cardQuant4.value) != 250){ tp += 10; } if (document.getElementById('bc_name_four').style.display == 'block' && parseInt(document.estiForm.cardQuant4.value) != 0 && parseInt(document.estiForm.cardQuant4.value) == 250){ tp += 23; } if (document.getElementById('bc_name_five').style.display == 'block' && parseInt(document.estiForm.cardQuant5.value) != 0 && parseInt(document.estiForm.cardQuant5.value) != 250){ tp += 10; } if (document.getElementById('bc_name_five').style.display == 'block' && parseInt(document.estiForm.cardQuant5.value) != 0 && parseInt(document.estiForm.cardQuant5.value) == 250){ tp += 23; } if (document.getElementById('bc_name_six').style.display == 'block' && parseInt(document.estiForm.cardQuant6.value) != 0 && parseInt(document.estiForm.cardQuant6.value) != 250){ tp += 10; } if (document.getElementById('bc_name_six').style.display == 'block' && parseInt(document.estiForm.cardQuant6.value) != 0 && parseInt(document.estiForm.cardQuant6.value) == 250){ tp += 23; } if (document.getElementById('bc_name_seven').style.display == 'block' && parseInt(document.estiForm.cardQuant7.value) != 0 && parseInt(document.estiForm.cardQuant7.value) != 250){ tp += 10; } if (document.getElementById('bc_name_seven').style.display == 'block' && parseInt(document.estiForm.cardQuant7.value) != 0 && parseInt(document.estiForm.cardQuant7.value) == 250){ tp += 23; } if (document.getElementById('bc_name_eight').style.display == 'block' && parseInt(document.estiForm.cardQuant8.value) != 0 && parseInt(document.estiForm.cardQuant8.value) != 250){ tp += 10; } if (document.getElementById('bc_name_eight').style.display == 'block' && parseInt(document.estiForm.cardQuant8.value) != 0 && parseInt(document.estiForm.cardQuant8.value) == 250){ tp += 23; } } // add 25% for 5-day turn if (document.estiForm.turnaround && document.estiForm.turnaround.value == "5 day"){ tp = (tp + (tp * .25)) ; //alert("adding 25% for 5-day turn") } // add 45% for 3-day turn if (document.estiForm.turnaround && document.estiForm.turnaround.value == "3 day"){ tp = (tp + (tp * .45)) ; //alert("adding 45% for 3-day turn") } // add flat fee of $30 for hard proof (per Grant... price is meant to discourage!) if (document.estiForm.proof && document.estiForm.proof.value == "HardProof"){ tp = (tp + 30) ; //alert("adding $30 for hard proof") } // add flat fee of $10 for Sakura or Primavera (per Grant) - removed this when I made double-thick the only available option! //if (document.estiForm.paper && document.estiForm.paper.value != "95_nl_rein_cover"){ //tp = (tp + 10) ; //alert("adding cost non-reincarnation paper") //} //add 10 cents per card for rounded corners on business cards if (document.estiForm.productFamily && document.estiForm.productFamily.value == "BusCard"){ if (document.estiForm.round_corners.value == "yes"){ tp = (tp + (.1 * quantity)) ; //alert("adding cost for rounded corners") } } if (mode && mode == 1) { updatePrice("ppu", formatCurrency(ppu), ppu, quantity); updatePrice("tp", formatCurrency2(tp), Math.round(tp), quantity); } else { var grandTotal = tp; hideDiv2("mailCostDiv"); updateText("myTp", formatCurrency(grandTotal)); //document.estiForm.ppu.value=formatCurrency(ppu); document.estiForm.tp.value=formatCurrency(tp); printTotal = grandTotal; document.estiForm.printCost.value = formatAsMoney(printTotal); } } function proofWarning() { if (document.estiForm.variableData && document.estiForm.variableData.value == "yes") { calculate; document.estiForm.jobname.value = document.jobnameform.jobname.value; document.estiForm.submit(); } else if (document.estiForm.proof && document.estiForm.proof.value == "SoftProof") { if (document.estiForm.productFamily && document.estiForm.productFamily.value != "BusCard" && document.estiForm.productFamily.value != "Stationery" && document.estiForm.productFamily.value != "Booklet" && document.estiForm.productFamily.value != "Catalog" && document.estiForm.productFamily.value != "Calendar" && document.estiForm.productFamily.value != "Folder") { var r=confirm("You have chosen a soft proof. Since computer monitors reproduce colors differently than printing presses, we cannot guarantee color matching to soft proofs.\n\nFor color critical projects, please request a hardcopy proof which can be matched.\n\nClick \"OK\" to proceed with a soft proof. Click \"Cancel\" to edit your order and select a hardcopy proof.") if (r==true) { calculate(); document.estiForm.submit(); } else { return; } } else if (document.estiForm.productFamily && document.estiForm.productFamily.value == "BusCard") { var r=confirm("You have chosen a soft proof for your business cards. Since computer monitors reproduce colors differently than printing presses, we cannot guarantee color matching to soft proofs.\n\nFor color critical projects, please request a hardcopy proof which can be matched.\n\nClick \"OK\" to proceed with a soft proof. Click \"Cancel\" to edit your order and select a hardcopy proof.") if (r==true) { calculateBizCardPrice(); checkNameQuant(); } else { return; } } else if (document.estiForm.productFamily && document.estiForm.productFamily.value == "Folder") { var r=confirm("You have chosen a soft proof. Since computer monitors reproduce colors differently than printing presses, we cannot guarantee color matching to soft proofs.\n\nFor color critical projects, please request a hardcopy proof which can be matched.\n\nClick \"OK\" to proceed with a soft proof. Click \"Cancel\" to edit your order and select a hardcopy proof.") if (r==true) { calculate_folder(); document.estiForm.submit(); } else { return; } } else if (document.estiForm.productFamily && document.estiForm.productFamily.value == "Booklet" || document.estiForm.productFamily.value == "Catalog" || document.estiForm.productFamily.value == "Calendar") { var r=confirm("You have chosen a soft proof. Since computer monitors reproduce colors differently than printing presses, we cannot guarantee color matching to soft proofs.\n\nFor color critical projects, please request a hardcopy proof which can be matched.\n\nClick \"OK\" to proceed with a soft proof. Click \"Cancel\" to edit your order and select a hardcopy proof.") if (r==true) { calculate_multi() document.estiForm.submit(); } else { return; } } } else if (document.estiForm.proof && document.estiForm.proof.value == "HardProof" && document.estiForm.productFamily && document.estiForm.productFamily.value != "BusCard" ) { calculate; document.estiForm.submit(); } else if (document.estiForm.proof && document.estiForm.proof.value == "HardProof" && document.estiForm.productFamily && document.estiForm.productFamily.value == "BusCard" ) { calculateBizCardPrice(); checkNameQuant(); } } function calculate(mode) { // Remove non-numeric characters document.estiForm.quantity.value = document.estiForm.quantity.value.replace(/\D/g, ""); //alert(mode) if (setQuant() <= 0 && document.estiForm.tp) { document.estiForm.tp.value=formatCurrency(0); document.estiForm.ppu.value=formatCurrency(0); return true; } else if (setQuant() <= 0) { updatePrice("tp", formatCurrency(0), 0, document.estiForm.quantity.value); updatePrice("ppu", formatCurrency(0), 0, document.estiForm.quantity.value); return true; } productFamily = document.estiForm.productFamily.value; quantity = document.estiForm.realquant.value; if (document.estiForm.mailing && document.estiForm.mailQuant) { checkMailDependencies(productFamily, quantity, document.estiForm.mailQuant.value); } //square inches, height, width if (document.estiForm.height.options) { si = (document.estiForm.height.options[document.estiForm.height.selectedIndex].value * document.estiForm.width.options[document.estiForm.width.selectedIndex].value); height = document.estiForm.height.options[document.estiForm.height.selectedIndex].value; width = document.estiForm.width.options[document.estiForm.width.selectedIndex].value colors = document.estiForm.colors.options[document.estiForm.colors.selectedIndex].value; } else { si = (document.estiForm.height.value * document.estiForm.width.value); height = document.estiForm.height.value; width = document.estiForm.width.value colors = document.estiForm.colors.value; } if (document.estiForm.finalHeight) { var finalHeight = document.estiForm.finalHeight.value; var finalWidth = document.estiForm.finalWidth.value; } //total square inches tsi = (si * quantity); if (document.estiForm.mailing) { var mailRate = document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value; var mailQuant = document.estiForm.mailQuant.value; if (document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value != "no" && mailQuant > 0) { var weightPerUnit = getUnitWeightOnces(tsi, quantity); if (document.estiForm.weightPerUnit) document.estiForm.weightPerUnit.value=weightPerUnit; if (document.estiForm.fold && document.estiForm.fold.options[document.estiForm.fold.selectedIndex].value != 'no') { var mailPostage = (calcPostage(productFamily, (finalHeight*finalWidth), weightPerUnit, mailQuant, mailRate))?calcPostage(productFamily, (finalHeight*finalWidth), weightPerUnit, mailQuant, mailRate):0; } else var mailPostage = (calcPostage(productFamily, si, weightPerUnit, mailQuant, mailRate))?calcPostage(productFamily, si, weightPerUnit, mailQuant, mailRate):0; var mailLabor = (calcMailLabor(si, weightPerUnit, mailQuant, mailRate))?calcMailLabor(si, weightPerUnit, mailQuant, mailRate):0; //alert("unitWeight:" + weightPerUnit + "\nmailPostage:" + mailPostage + "\nmailLabor:" + mailLabor); var totalMailingCost = (mailPostage + mailLabor); updateText("mailCostTop", formatCurrency2(totalMailingCost)); showDiv2("mailCostDiv"); updateText("myMailCost", formatCurrency2(totalMailingCost)); totalMailingCost = Math.round(totalMailingCost); //round it to the nearest buck document.estiForm.mailCost.value = formatAsMoney(totalMailingCost); //then add two zero's to the end var shipQuant = (quantity - mailQuant); updateText("myShipQuant", shipQuant); document.estiForm.shipQuant.value = shipQuant; } else { var totalMailingCost = 0; updateText("mailCostTop", formatCurrency2(totalMailingCost)); updateText("myShipQuant", quantity); document.estiForm.shipQuant.value = quantity; document.estiForm.mailCost.value = "0.00"; hideDiv2("mailCostDiv"); } } else { if (document.estiForm.shipQuant) document.estiForm.shipQuant.value = quantity; if (document.estiForm.mailCost) document.estiForm.mailCost.value = "0.00"; } //total price without rush charges tp_no_rush = (calcPaper(tsi, si, "pages") + calcPress(document.estiForm.realquant.value, si, "pages") + calcDrilling() + calcPerforating() + calcScoring() + calcFolding() + calcProof(si) + calcHandling(tsi)); nexpress_tp_no_rush = (calcPaper(tsi, si, "pages") + calcNexPress(document.estiForm.realquant.value, si, "pages") + calcDrilling() + calcPerforating() + calcScoring() + calcFolding() + calcNexPressProof(si) + calcHandling(tsi)); //alert(calcPaper(tsi, si, "pages") + "\n" + calcNexPress(document.estiForm.realquant.value, si, "pages") + "\n" + calcDrilling() + "\n" + calcPerforating() + "\n" + calcScoring() + calcFolding() + "\n" + calcNexPressProof(si) + "\n" + calcHandling(tsi)); //total price with rush charges tp = (tp_no_rush + calcRush(tp_no_rush, si)); nexpress_tp = (nexpress_tp_no_rush + calcRush(nexpress_tp_no_rush, si)); //used for %5 addition to recycled paper orders tp = (tp + paperMarketAdjustment(tp, "single", quantity)); nexpress_tp = (nexpress_tp + paperMarketAdjustment(nexpress_tp, "single", quantity)); //adjust for market changes based on quantity tp = (tp + marketAdjustmentByQuantity(tp, si, colors, "single", quantity)); //nexpress_tp = (nexpress_tp + marketAdjustmentByQuantity(nexpress_tp, si, colors, "single", quantity)); //adjust for market changes tp = (tp + marketAdjustment(tp, "single", quantity)); nexpress_tp = (nexpress_tp + marketAdjustment(nexpress_tp, "single", quantity)); if (nexpress_tp < 65) nexpress_tp = 65; //ADD BLANK ENVELOPES tp = (tp + calcBlankEnvelopes()); nexpress_tp = (nexpress_tp + calcBlankEnvelopes()); //ADD BLANK ENVELOPES FOR W2P PRODUCTS tp = (tp + calcW2pBlankEnvelopes()); nexpress_tp = (nexpress_tp + calcW2pBlankEnvelopes()); //ADD PRINTED ENVELOPES FOR W2P PRODUCTS tp = (tp + calcW2pPrintedEnvelopes()); nexpress_tp = (nexpress_tp + calcW2pPrintedEnvelopes()); //alert('nexpress price = ' + nexpress_tp + '. 74-CD price = ' + tp); document.estiForm.si.value=si; document.estiForm.tsi.value=tsi; //IF THE NEXPRESS IS THE CHOSEN PRESS DO THE CONTENTS OF THIS IF if (nexpress_tp < tp && si <= 234 && height <= 19.5 && width <= 19.5) { ppu = (nexpress_tp / (document.estiForm.realquant.value)); document.estiForm.press.value="NexP"; if (mode && mode == 1) { updatePrice("ppu", formatCurrency(ppu), ppu, quantity); updatePrice("tp", formatCurrency2(nexpress_tp), Math.round(nexpress_tp), quantity); } else { if (document.estiForm.mailing && document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value != "no" && document.estiForm.mailQuant.value > 0) { //IF MAILING IS ON AND HAS A VALID QUANTITY var printTotal = nexpress_tp; var grandTotal = (nexpress_tp + Math.round(totalMailingCost)); showDiv2("mailCostDiv"); updateText("myPrintCost", formatCurrency2(nexpress_tp)); updateText("myTp", formatCurrency2(grandTotal)); document.estiForm.printCost.value = formatAsMoney(printTotal); //adds two zeros to the end of the price. document.estiForm.ppu.value = formatCurrency(ppu); document.estiForm.tp.value = formatCurrency(grandTotal); } else { //NO MAILING var printTotal = nexpress_tp; var grandTotal = nexpress_tp; hideDiv2("mailCostDiv"); updateText("myTp", formatCurrency2(grandTotal)); document.estiForm.ppu.value=formatCurrency(ppu); document.estiForm.tp.value=formatCurrency2(nexpress_tp); printTotal = Math.round(printTotal); //round to the nearest buck document.estiForm.printCost.value = formatAsMoney(printTotal); //adds two zeros to the end of the price. document.estiForm.shipQuant.value = quantity; } } } //ELSE THE 74CD IS THE CHOSEN PRESS DO THE CONTENTS OF THIS ELSE else { ppu = (tp / (document.estiForm.realquant.value)); document.estiForm.press.value="74CD"; if (mode && mode == 1) { //mode 1 used for calc prices from the re-order page. updatePrice("ppu", formatCurrency(ppu), ppu, quantity); updatePrice("tp", formatCurrency(tp), tp, quantity); } else { if (document.estiForm.mailing && document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value != "no" && document.estiForm.mailQuant.value > 0) { //IF MAILING IS ON AND HAS A VALID QUANTITY var printTotal = tp; var grandTotal = (tp + Math.round(totalMailingCost)); showDiv2("mailCostDiv"); updateText("myPrintCost", formatCurrency(tp)); updateText("myTp", formatCurrency(grandTotal)); document.estiForm.printCost.value = formatAsMoney(tp); //this trick adds two zeros to the end of the price. document.estiForm.ppu.value = formatCurrency(ppu); document.estiForm.tp.value = formatCurrency(grandTotal); } else { //NO MAILING var printTotal = tp; var grandTotal = tp; hideDiv2("mailCostDiv"); updateText("myTp", formatCurrency(grandTotal)); document.estiForm.ppu.value=formatCurrency(ppu); document.estiForm.tp.value=formatCurrency(tp); document.estiForm.printCost.value = formatAsMoney(printTotal); } } } //alert(document.estiForm.press.value); /*if (si <= 234) document.estiForm.nexpress_tp.value=formatCurrency2(nexpress_tp); else document.estiForm.nexpress_tp.value='flat size too large'; */ //document.estiForm.ppu.value=formatCurrency(ppu); /*alert("calculated the following:"+ "\nsSquare Inches: " + si + "\nTotal Square Inches: " + tsi + "\nTotal Price: " + tp + "\nFolding: " + calcFolding() + "\npaper: " + calcPaper(tsi, si, "pages") + "\n" + "\nnexpress: " + calcNexPress(document.estiForm.realquant.value, si, "pages") + "\n" + "\ndrilling: " + calcDrilling() + "\n" + "\nperfing: " + calcPerforating() + "\n" + "\nscore: " + calcScoring() + "\n" + "\nfolding: " + calcFolding() + "\n" + "\nproof: " + calcNexPressProof(si) + "\n" + "\nhandling: " + calcHandling(tsi) + "\n");*/ } function calcBlankEnvelopes() { /*if (document.estiForm.blankEnvelopes && document.estiForm.blankEnvelopesSize && document.estiForm.blankEnvelopesSize.options[document.estiForm.blankEnvelopesSize.selectedIndex].value != "no" && document.estiForm.blankEnvelopes.options[document.estiForm.blankEnvelopes.selectedIndex].value == "no") { document.estiForm.blankEnvelopesSize.selectedIndex=0; alert('You must select a quantity of envelopes before choosing the size'); }*/ if (document.estiForm.blankEnvelopes && document.estiForm.blankEnvelopes.options[document.estiForm.blankEnvelopes.selectedIndex].value != "no" && document.estiForm.blankEnvelopesSize.options[document.estiForm.blankEnvelopesSize.selectedIndex].value != "") { var env = document.estiForm.blankEnvelopes.options[document.estiForm.blankEnvelopes.selectedIndex].value; var envSize = document.estiForm.blankEnvelopesSize.options[document.estiForm.blankEnvelopesSize.selectedIndex].value; if (envSize == "A-6") document.estiForm.blankEnvCost.value = ( (env/250) * 40); else if (envSize == "A-7") document.estiForm.blankEnvCost.value = ( (env/250) * 45); if (document.estiForm.blankEnvCost.value && document.estiForm.blankEnvCost.value != "") return parseInt(document.estiForm.blankEnvCost.value); else return 0; } else { return 0; } } function calcW2pBlankEnvelopes() { if (document.estiForm.w2pEnvelopesBlank && document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value != "0") { if (document.estiForm.finalWidth.value == "7") { //alert("adding a-7 env") if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "100") document.estiForm.w2pBlankEnvCost.value = 18; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "150") document.estiForm.w2pBlankEnvCost.value = 27; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "200") document.estiForm.w2pBlankEnvCost.value = 36; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "250") document.estiForm.w2pBlankEnvCost.value = 45; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "500") document.estiForm.w2pBlankEnvCost.value = 90; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "750") document.estiForm.w2pBlankEnvCost.value = 135; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "1000") document.estiForm.w2pBlankEnvCost.value = 180; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "1250") document.estiForm.w2pBlankEnvCost.value = 225; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "1500") document.estiForm.w2pBlankEnvCost.value = 270; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "2000") document.estiForm.w2pBlankEnvCost.value = 360; } else if (document.estiForm.finalWidth.value == "6") { //alert("adding a-6 env") if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "100") document.estiForm.w2pBlankEnvCost.value = 16; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "150") document.estiForm.w2pBlankEnvCost.value = 24; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "200") document.estiForm.w2pBlankEnvCost.value = 32; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "250") document.estiForm.w2pBlankEnvCost.value = 40; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "500") document.estiForm.w2pBlankEnvCost.value = 80; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "750") document.estiForm.w2pBlankEnvCost.value = 120; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "1000") document.estiForm.w2pBlankEnvCost.value = 160; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "1250") document.estiForm.w2pBlankEnvCost.value = 200; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "1500") document.estiForm.w2pBlankEnvCost.value = 240; if (document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value == "2000") document.estiForm.w2pBlankEnvCost.value = 320; } if (document.estiForm.w2pBlankEnvCost.value && document.estiForm.w2pBlankEnvCost.value != "") { return parseInt(document.estiForm.w2pBlankEnvCost.value); } else { //alert("returning 0") return 0; } } else { return 0; } } function calcW2pPrintedEnvelopes() { if (document.estiForm.w2pEnvelopesPrint && document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value != "0") { if (document.estiForm.finalWidth.value == "7") { //alert("adding a-7 env printing") if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "100") document.estiForm.w2pPrintedEnvCost.value = 108; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "150") document.estiForm.w2pPrintedEnvCost.value = 117; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "200") document.estiForm.w2pPrintedEnvCost.value = 126; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "250") document.estiForm.w2pPrintedEnvCost.value = 135; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "500") document.estiForm.w2pPrintedEnvCost.value = 200; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "750") document.estiForm.w2pPrintedEnvCost.value = 245; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "1000") document.estiForm.w2pPrintedEnvCost.value = 290; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "1250") document.estiForm.w2pPrintedEnvCost.value = 365; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "1500") document.estiForm.w2pPrintedEnvCost.value = 410; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "2000") document.estiForm.w2pPrintedEnvCost.value = 500; } else if (document.estiForm.finalWidth.value == "6") { //alert("adding a-6 env printing") if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "100") document.estiForm.w2pPrintedEnvCost.value = 106; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "150") document.estiForm.w2pPrintedEnvCost.value = 114; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "200") document.estiForm.w2pPrintedEnvCost.value = 122; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "250") document.estiForm.w2pPrintedEnvCost.value = 130; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "500") document.estiForm.w2pPrintedEnvCost.value = 190; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "750") document.estiForm.w2pPrintedEnvCost.value = 230; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "1000") document.estiForm.w2pPrintedEnvCost.value = 270; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "1250") document.estiForm.w2pPrintedEnvCost.value = 340; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "1500") document.estiForm.w2pPrintedEnvCost.value = 380; if (document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value == "2000") document.estiForm.w2pPrintedEnvCost.value = 460; } if (document.estiForm.w2pPrintedEnvCost.value && document.estiForm.w2pPrintedEnvCost.value != "") { return parseInt(document.estiForm.w2pPrintedEnvCost.value); } else { //alert("returning 0") return 0; } } else { return 0; } } function calcMailLabor(si, weightPerUnit, mailQuant, mailRate) { var mailLabor = ((mailQuant * 0.05) + 60); if (si > 70.4375) mailLabor += (mailQuant * 0.03); if (document.estiForm.blankEnvelopes && document.estiForm.blankEnvelopes.value != "no" && mailQuant != "0") mailLabor += (mailQuant * .18); if (mailLabor != null && mailLabor > 0 && document.estiForm.mailLabor) document.estiForm.mailLabor.value = mailLabor; else { if (document.estiForm.mailLabor) document.estiForm.mailLabor.value = 0; } return mailLabor; } function calcPostage(productFamily, si, weightPerUnit, mailQuant, mailRate) { if (productFamily == 'Card' && document.estiForm.blankEnvelopes.value == "no") { if (mailRate == "firstClass") { if (si >= 17.5 && si <= 25.5) { // sizes between 3.5 x 5 --> 4.25 x 6 var postage = (mailQuant * 0.223); } else if (si > 25.5 && si <= 70.4375) { // sizes bigger than 4.25 x 6 and up to 6.125 x 11.5 var postage = (mailQuant * 0.369); } } if (mailRate == "bulkMail") { if (si <= 25.5) { // sizes between 3.5 x 5 --> 6.125 x 11.5 return null; //not an option should be caught by the dependency checking function, but just in case, return null } else if (si > 25.5 && si <= 70.4375) { // sizes bigger than 4.25 x 6 and up to 6.125 x 11.5 var postage = (mailQuant * 0.257); } } // This is Grant's attempt to add non-profit to postcards // See commented section below to see if script is correct. // I know that I have a redundent else if but I didn't want to change it if (mailRate == "nonProfit") { //return null; //not an option should be caught by the dependency checking function, but just in case, return null if (si >= 17.5 && si <= 25.5) { // sizes between 3.5 x 5 --> 4.25 x 6 var postage = (mailQuant * 0.159); } else if (si > 25.5 && si <= 70.4375) { // sizes bigger than 4.25 x 6 and up to 6.125 x 11.5 var postage = (mailQuant * 0.159); } } if (mailRate == "stamps") { if (si >= 17.5 && si <= 25.5) { // sizes between 3.5 x 5 --> 4.25 x 6 var postage = (mailQuant * 0.32); //.27 for postage + .05 for applying stamps } else if (si > 25.5 && si <= 70.4375) { // sizes bigger than 4.25 x 6 and up to 6.125 x 11.5 var postage = (mailQuant * 0.47); //.42 for postage + .05 for applying stamps } } } else { //the non-postcard stuff if (mailRate == "firstClass") { if (si >= 17.5 && si <= 70.4375) { // sizes between 3.5 x 5 --> 6.125 x 11.5 if(weightPerUnit <= 1) { var postage = (mailQuant * 0.369); } else if(weightPerUnit <= 2) { var postage = (mailQuant * 0.494); } else if(weightPerUnit <= 3) { var postage = (mailQuant * 0.619); } else { return null; } } else if (si > 70.4375 && si <= 180) { // sizes between 6.125 x 11.5 --> 12 x 15 if(weightPerUnit <= 1) { var postage = (mailQuant * 0.702); } else if(weightPerUnit <= 2) { var postage = (mailQuant * 0.872); } else if(weightPerUnit <= 3) { var postage = (mailQuant * 1.042); } else { return null; } } } if (mailRate == "bulkMail") { if(weightPerUnit <= 3.3) { if (si >= 17.5 && si <= 70.4375) { // sizes between 3.5 x 5 --> 6.125 x 11.5 var postage = (mailQuant * 0.257); } else if (si > 70.4375 && si <= 180) { // sizes between 6.125 x 11.5 --> 12 x 15 var postage = (mailQuant * 0.489); } } else if(weightPerUnit > 3.3) { if (si >= 17.5 && si <= 70.4375) { // sizes between 3.5 x 5 --> 6.125 x 11.5 var postage = (mailQuant * (0.733 + 0.106)); } else if (si > 70.4375 && si <= 180) { // sizes between 6.125 x 11.5 --> 12 x 15 var postage = (mailQuant * (0.733 + 0.402)); } } } if (mailRate == "nonProfit") { if(weightPerUnit <= 3.3) { if (si >= 17.5 && si <= 70.4375) { // sizes between 3.5 x 5 --> 6.125 x 11.5 var postage = (mailQuant * 0.159); } else if (si > 70.4375 && si <= 180) { // sizes between 6.125 x 11.5 --> 12 x 15 var postage = (mailQuant * 0.356); } } else if (weightPerUnit > 3.3) { if (si >= 17.5 && si <= 70.4375) { // sizes between 3.5 x 5 --> 6.125 x 11.5 var postage = (mailQuant * (0.632 + .029)); } else if (si > 70.4375 && si <= 180) { // sizes between 6.125 x 11.5 --> 12 x 15 var postage = (mailQuant * (0.632 + 0.226)); } } } if (mailRate == "stamps") { if (si >= 17.5 && si <= 70.4375) { // sizes between 3.5 x 5 --> 6.125 x 11.5 if(weightPerUnit <= 1) { var postage = (mailQuant * 0.47); // postage plus 5 cents for adding stamp } else if(weightPerUnit <= 2) { var postage = (mailQuant * 0.59); } else if(weightPerUnit <= 3) { var postage = (mailQuant * 0.76); } else { return null; } } else if (si > 70.4375 && si <= 180) { // sizes between 6.125 x 11.5 --> 12 x 15 if(weightPerUnit <= 1) { var postage = (mailQuant * 0.83); } else if(weightPerUnit <= 2) { var postage = (mailQuant * 1.00); } else if(weightPerUnit <= 3) { var postage = (mailQuant * 1.17); } else { return null; } } } } if (postage != null && postage > 0) document.estiForm.postage.value = postage; else document.estiForm.postage.value = 0; return postage; } function calcNexPress(quantity, si, page_type) { if (page_type == "cover") { this_type = (document.estiForm.coverColors.options) ? document.estiForm.coverColors.options[document.estiForm.coverColors.selectedIndex].value : document.estiForm.coverColors.value; } else { this_type = (document.estiForm.colors.options) ? document.estiForm.colors.options[document.estiForm.colors.selectedIndex].value : document.estiForm.colors.value; } if (page_type == "postcard_gr") { nexpress = (getNexPressFactor(quantity, si, this_type)); } else { nexpress = (getNexPressFactor(quantity, si, this_type)); } if (page_type == "cover") { document.estiForm.coverPresscharge.value=formatCurrency(press); } else if (page_type == "pages1") { document.estiForm.presscharge1.value=formatCurrency(press); } else if (page_type == "pages2") { document.estiForm.presscharge2.value=formatCurrency(press); } else if (page_type == "pages3") { document.estiForm.presscharge3.value=formatCurrency(press); } else if (page_type == "pages4") { document.estiForm.presscharge4.value=formatCurrency(press); } else if (page_type == "pages5") { document.estiForm.presscharge5.value=formatCurrency(press); } else if (page_type == "pages6") { document.estiForm.presscharge6.value=formatCurrency(press); } return nexpress; } function enableLock() { locked = true; } function disableLock() { locked = false; } function isCheaper() { /*check to see if the locked var is true and if so, then return without running function this is to fix a bug involving a double call to this fuction due to having both the onKeyUp() and the onBlur() event handlers calling this function. */ if (locked) { return true; } if (document.estiForm.colors.options[document.estiForm.colors.selectedIndex].value=="4over1") { if (document.estiForm.postcardSize.options[document.estiForm.postcardSize.selectedIndex].value=="25.5" && document.estiForm.quantity.value >= 13000) { setAbsoluteVisibilityAndPosition('redirect_custom', 370, 230); locked = true; } else if (document.estiForm.postcardSize.options[document.estiForm.postcardSize.selectedIndex].value=="51" && document.estiForm.quantity.value >= 3400) { setAbsoluteVisibilityAndPosition('redirect_custom', 370, 230); locked = true; } else if (document.estiForm.postcardSize.options[document.estiForm.postcardSize.selectedIndex].value=="66" && document.estiForm.quantity.value >= 1850) { setAbsoluteVisibilityAndPosition('redirect_custom', 370, 230); locked = true; } } else if (document.estiForm.colors.options[document.estiForm.colors.selectedIndex].value=="4over4") { if (document.estiForm.postcardSize.options[document.estiForm.postcardSize.selectedIndex].value=="25.5" && document.estiForm.quantity.value >= 5900) { setAbsoluteVisibilityAndPosition('redirect_custom', 370, 230); locked = true; } else if (document.estiForm.postcardSize.options[document.estiForm.postcardSize.selectedIndex].value=="51" && document.estiForm.quantity.value >= 2100) { setAbsoluteVisibilityAndPosition('redirect_custom', 370, 230); locked = true; } else if (document.estiForm.postcardSize.options[document.estiForm.postcardSize.selectedIndex].value=="66" && document.estiForm.quantity.value >= 2000) { setAbsoluteVisibilityAndPosition('redirect_custom', 370, 230); locked = true; } } return true; } function calculate_folder(mode) { // Remove non-numeric characters document.estiForm.quantity.value = document.estiForm.quantity.value.replace(/\D/g, ""); if (setQuant() <= 0 && document.estiForm.tp) { document.estiForm.tp.value=formatCurrency(0); document.estiForm.ppu.value=formatCurrency(0); return true; } else if (setQuant() <= 0) { updatePrice("tp", formatCurrency(0), 0, document.estiForm.quantity.value); updatePrice("ppu", formatCurrency(0), 0, document.estiForm.quantity.value); return true; } quantity = document.estiForm.realquant.value; //square inches si = (19 * 25); // 425 si_nl = (20 * 26); // 520 //total square inches tsi = (si * document.estiForm.realquant.value); tsi_nl = (si_nl * document.estiForm.realquant.value); //total price without rush charges //alert(calcProof(si)); // + calcHandling(tsi) ); if (document.estiForm.paper.value.indexOf("_nl_") > -1) { tp_no_rush = (calcPaper(tsi_nl, si_nl, "pages") + calcFolderMakeReady() + calcPress(document.estiForm.realquant.value, si, "pages") + calcFolderBuyout(quantity) + calcProof(si) + calcHandling(tsi) ); } else { tp_no_rush = (calcPaper(tsi, si, "pages") + calcFolderMakeReady() + calcPress(document.estiForm.realquant.value, si, "pages") + calcFolderBuyout(quantity) + calcProof(si) + calcHandling(tsi) ); } //alert(tp_no_rush); //total price with rush charges tp = (tp_no_rush + calcRush(tp_no_rush, si)); //used for %5 addition to recycled paper orders tp = (tp + paperMarketAdjustment(tp, "single", quantity)); //adjust for market changes based on quantity tp = (tp + marketAdjustmentByQuantity(tp, si, "", "single", quantity)); //adjust for market changes tp = (tp + marketAdjustment(tp, "single", quantity)); document.estiForm.si.value=si; document.estiForm.tsi.value=tsi; //alert(mode); if (mode && mode==1) { document.estiForm.press.value="74CD"; updatePrice("ppu", formatCurrency(tp / (document.estiForm.realquant.value)), (tp / (document.estiForm.realquant.value)), quantity); //alert(tp); updatePrice("tp", formatCurrency2(tp), Math.round(tp), quantity); } else { //document.estiForm.tp.value=formatCurrency2(tp); //document.estiForm.press.value="74CD"; //document.estiForm.ppu.value=formatCurrency(ppu); ppu = (tp / (document.estiForm.realquant.value)); var printTotal = tp; var grandTotal = tp; hideDiv2("mailCostDiv"); updateText("myTp", formatCurrency(grandTotal)); document.estiForm.ppu.value=formatCurrency(ppu); document.estiForm.tp.value=formatCurrency(tp); document.estiForm.printCost.value = formatAsMoney(printTotal); document.estiForm.shipQuant.value = quantity; } /* alert("calculated the following:"+ "\nsSquare Inches: " + si + "\nTotal Square Inches: " + tsi + "\nTotal Price: " + tp + "\nPrice Per Unit: " + ppu) */ /* alert ("calculating for:"+ "\nColors:\t" + document.estiForm.colors.options[document.estiForm.colors.selectedIndex].value + "\nWidth:\t" + document.estiForm.width.options[document.estiForm.width.selectedIndex].value + "\nHeight:\t" + document.estiForm.height.options[document.estiForm.height.selectedIndex].value + "\nUnit Square Inches:\t" + si + "\nTotal Square Inches:\t" + tsi + "\nQuantity:\t" + document.estiForm.realquant.value); */ } function calcFolderMakeReady() { return 20; } function calcFolderBuyout(quantity) { var folder = (getFolderFactor(quantity)); // add $15 per 1000 for shipping back and forth to folder buyout plant folder = (folder + (Math.ceil(quantity / 1000) * 15)); //alert ((Math.ceil(quantity / 1000) * 15)); document.estiForm.folder.value=formatCurrency(folder); //alert("quantity: " + quantity + "\nfolder buyout: " + folder); return folder; } function getFolderFactor(quantity) { var folder_markup = 1.3; return ((0.0977 * quantity) + 140) * folder_markup; } function calculate_postcard() { if (setQuant() <= 0) { document.estiForm.tp.value=formatCurrency(0); document.estiForm.ppu.value=formatCurrency(0); return true; } //isCheaper(); quantity = document.estiForm.realquant.value; //square inches si = (document.estiForm.height.value * document.estiForm.width.value); //total square inches tsi = (si * quantity); //total price without rush charges tp_no_rush = (calcPaper(tsi, si, "pages") + calcPress(document.estiForm.realquant.value, si, "postcard_gr") + calcProof(si) + calcHandling(tsi) ); //total price with rush charges tp = (tp_no_rush + calcRush(tp_no_rush, si)); //used for %5 addition to recycled paper orders tp = (tp + paperMarketAdjustment(tp, "single", quantity)); //adjust for market changes based on quantity tp = (tp + marketAdjustmentByQuantity(tp, si, "", "single", quantity)); //adjust for market changes tp = (tp + marketAdjustment(tp, "single", quantity)); //price per unit ppu = (tp / (document.estiForm.realquant.value)); document.estiForm.si.value=si; document.estiForm.tsi.value=tsi; document.estiForm.tp.value=formatCurrency2(tp); document.estiForm.ppu.value=formatCurrency(ppu); /* alert("calculated the following:"+ "\nsSquare Inches: " + si + "\nTotal Square Inches: " + tsi + "\nTotal Price: " + tp + "\nPrice Per Unit: " + ppu) */ /* alert ("calculating for:"+ "\nColors:\t" + document.estiForm.colors.options[document.estiForm.colors.selectedIndex].value + "\nWidth:\t" + document.estiForm.width.options[document.estiForm.width.selectedIndex].value + "\nHeight:\t" + document.estiForm.height.options[document.estiForm.height.selectedIndex].value + "\nUnit Square Inches:\t" + si + "\nTotal Square Inches:\t" + tsi + "\nQuantity:\t" + document.estiForm.realquant.value); */ } function calcBooklet(quantity, pages, inside_quantity) { var booklet = (getBookletFactor(quantity, pages, inside_quantity)); //booklet = (booklet * 1.15); // add $15 per 1000 for shipping back and forth to bindery buyout plant booklet = (booklet + (Math.ceil(quantity / 1000) * 15)); //alert ((Math.ceil(quantity / 1000) * 15)); if (document.estiForm.bind.options) { if (document.estiForm.bind.options[document.estiForm.bind.selectedIndex].value == "wiro") {//they chose a wire-o bind booklet = (booklet + eval(quantity)) //add $1 per book for wire-o } } else { if (document.estiForm.bind.value == "wiro") {//they chose a wire-o bind booklet = (booklet + eval(quantity)) //add $1 per book for wire-o } } document.estiForm.booklet.value=formatCurrency(booklet); //alert("pages: " + pages + "\nquantity: " + quantity + "\nbooklet: " + booklet); return booklet; } function getBookletFactor(quantity, pages, inside_quantity) { if (quantity <= 1000) { if (pages <= 4) { // up 4 pages return ( (inside_quantity * .0115) + 15); //folding only } if (pages > 4 && pages <= 8) { // over 4 and up to 8 pages return ((0.06667 * quantity + 143)); } if (pages > 8 && pages <= 12) { // over 8 and up to 12 pages return ((0.10000 * quantity + 150)); } if (pages > 12 && pages <= 16) { // over 12 and up to 16 pages return ((0.08889 * quantity + 161)); } if (pages > 16 && pages <= 20) { // over 16 and up to 20 pages return ((0.09444 * quantity + 166)); } if (pages > 20 && pages <= 24) { // over 20 and up to 24 pages return ((0.11111 * quantity + 179)); } if (pages > 24 && pages <= 28) { // over 24 and up to 28 pages return ((0.11111 * quantity + 174)); } if (pages > 28 && pages <= 64) { // over 28 and up to 32 pages return ((0.11111 * quantity + 179)); } } if (quantity > 1000 && quantity <= 2500) { if (pages <= 4) { // up 4 pages return ( (inside_quantity * .0115) + 15); //folding only } if (pages > 4 && pages <= 8) { // over 4 and up to 8 pages return ((0.02667 * quantity + 183)); } if (pages > 8 && pages <= 12) { // over 8 and up to 12 pages return ((0.03667 * quantity + 213)); } if (pages > 12 && pages <= 16) { // over 12 and up to 16 pages return ((0.05000 * quantity + 208)); } if (pages > 16 && pages <= 20) { // over 16 and up to 20 pages return ((0.05333 * quantity + 207)); } if (pages > 20 && pages <= 24) { // over 20 and up to 24 pages return ((0.07667 * quantity + 203)); } if (pages > 24 && pages <= 28) { // over 24 and up to 28 pages return ((0.09333 * quantity + 192)); } if (pages > 28 && pages <= 64) { // over 28 and up to 32 pages return ((0.11000 * quantity + 180)); } } if (quantity > 2500) { if (pages <= 4) { // up 4 pages return ( (inside_quantity * .0115) + 15); //folding only } if (pages > 4 && pages <= 8) { // over 4 and up to 8 pages return ((.01911 * quantity + 202)); } if (pages > 8 && pages <= 12) { // over 8 and up to 12 pages return ((.02667 * quantity + 238)); } if (pages > 12 && pages <= 16) { // over 12 and up to 16 pages return ((.03133 * quantity + 247)); } if (pages > 16 && pages <= 20) { // over 16 and up to 20 pages return ((.03956 * quantity + 241)); } if (pages > 20 && pages <= 24) { // over 20 and up to 24 pages return ((.04489 * quantity + 283)); } if (pages > 24 && pages <= 28) { // over 24 and up to 28 pages return ((.04911 * quantity + 302)); } if (pages > 28 && pages <= 64) { // over 28 and up to 32 pages return ((.04778 * quantity + 336)); } } } function setFinalSize() { if (document.estiForm.fold && document.estiForm.fold.options && document.estiFo