/* Copyright © 2001-2009 GreenerPrinter. All Rights Reserved. Copyright © 2001-2009 GreenerPrinter. All Rights Reserved. Copyright © 2001-2009 GreenerPrinter. All Rights Reserved. */ var locked = false; function enableAll() { for(i=0; i 0) { if (document.estiForm.purchMailListQty && (parseInt(document.estiForm.mailQuant.value) > parseInt(document.estiForm.purchMailListQty.value))) { alert("Please send the additional names for your mailing list as an email attachment to csr@greenerprinter.com, with your order name in the subject line."); return; } else if (document.estiForm.purchMailListQty && (parseInt(document.estiForm.mailQuant.value) == parseInt(document.estiForm.purchMailListQty.value))) { return; } else { alert("You have chosen to mail some or all of your pieces. Please send your list as an email attachment to csr@greenerprinter.com, with your order name in the subject line."); return; } } } function printedEnvReminder() { if (document.estiForm.greetingCardEnvelopes && document.estiForm.greetingCardEnvelopes.options && document.estiForm.greetingCardEnvelopes.options[document.estiForm.greetingCardEnvelopes.selectedIndex].value == "Printed - Return Address, Black Ink") { alert("Make sure you supply artwork for your printed envelopes!"); return; } } function envelopeSizeAlert() { if (((document.estiForm.blankEnvelopes && document.estiForm.blankEnvelopes.options && document.estiForm.blankEnvelopes.options[document.estiForm.blankEnvelopes.selectedIndex].value != "no") || (document.estiForm.konlyEnvelopes && document.estiForm.konlyEnvelopes.options && document.estiForm.konlyEnvelopes.options[document.estiForm.konlyEnvelopes.selectedIndex].value != "no")) && ((document.estiForm.blankEnvelopesSize.options[document.estiForm.blankEnvelopesSize.selectedIndex].value == "") || (document.estiForm.blankEnvelopesSize.options[document.estiForm.blankEnvelopesSize.selectedIndex].value == "no"))) { alert("Please select an envelope size."); return; } if (((document.estiForm.blankEnvelopes && document.estiForm.blankEnvelopes.options && document.estiForm.blankEnvelopes.options[document.estiForm.blankEnvelopes.selectedIndex].value == "no") && (document.estiForm.konlyEnvelopes && document.estiForm.konlyEnvelopes.options && document.estiForm.konlyEnvelopes.options[document.estiForm.konlyEnvelopes.selectedIndex].value == "no")) && (document.estiForm.blankEnvelopesSize.options[document.estiForm.blankEnvelopesSize.selectedIndex].value != "no")) { alert("Please choose an envelope quantity or set Envelope Size to 'none'."); return; } } function showPaperDetails(select_object) { if (select_object.selectedIndex==0) { setVisibilityAndPosition('paper_div_eco', 100, -160); select_object.selectedIndex=1; } } 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 checkStationeryQuant() { if (document.estiForm.productFamily && document.estiForm.productFamily.value == "Stationery-Business Cards") { if (document.estiForm.stationeryBizCardQuantity.value == "0") { document.estiForm.cardQuant1.selectedIndex = "1"; stationerySmartQuantitySum(); calculateStationery(); alert('Minimum quantity: 500'); } else { proofWarning(); } } if (document.estiForm.productFamily && document.estiForm.productFamily.value == "Stationery-Envelopes") { if (document.estiForm.stationeryEnvelopes.value == "0") { document.estiForm.stationeryEnvelopes.selectedIndex = "1"; calculateStationery(); inspect(this); alert('Minimum quantity: 500'); } else { proofWarning(); } } if (document.estiForm.productFamily && document.estiForm.productFamily.value == "Stationery-Letterhead") { if (document.estiForm.stationeryLetterhead.value == "0") { document.estiForm.stationeryLetterhead.selectedIndex = "1"; calculateStationery(); inspect(this); alert('Minimum quantity of printed letterhead: 500'); } else { proofWarning(); } } if (document.estiForm.productFamily && document.estiForm.productFamily.value == "Stationery-Package") { if (document.estiForm.stationeryBizCardQuantity.value == "0" && document.estiForm.stationeryEnvelopes.value == "0" && document.estiForm.stationeryLetterhead.value == "0") { alert('Please select a quantity for one or more printed items.'); } else { proofWarning(); } } } function checkPackageQuant() { if (document.estiForm.quantity.value < 1000) { alert('The minimum quantity for custom package orders is 1,000. Please increase your quantity and re-submit.'); document.estiForm.quantity.focus(); } else { prepareSubmit(); } } function setStationeryQuant() { if (document.estiForm.stationeryLetterhead.options && document.estiForm.stationeryLetterheadBlank.options && document.estiForm.stationeryEnvelopes.options) { 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)); } else if (document.estiForm.stationeryLetterhead.options && document.estiForm.stationeryLetterheadBlank.options) { //this is for 2-color letterhead ONLY document.estiForm.quantity.value = (parseInt(document.estiForm.stationeryLetterhead.options[document.estiForm.stationeryLetterhead.selectedIndex].value) + parseInt(document.estiForm.stationeryLetterheadBlank.options[document.estiForm.stationeryLetterheadBlank.selectedIndex].value)); } else if (document.estiForm.stationeryEnvelopes.options) { //this is for 2-color envelopes ONLY document.estiForm.quantity.value = (parseInt(document.estiForm.stationeryEnvelopes.options[document.estiForm.stationeryEnvelopes.selectedIndex].value)); } else { //this is for 2-color business cards ONLY document.estiForm.quantity.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"); updateText("myTp2", "0.00"); return 0; } document.estiForm.realquant.value=document.estiForm.quantity.value; //alert(document.estiForm.realquant.value); return 1; } function checkQuant() { if (document.estiForm.productFamily.value != "Calendar" && document.estiForm.productFamily.value != "DLCalendar" && document.estiForm.productFamily.value != "DLPhotobook" && document.estiForm.productFamily.value != "HouseCalendar") { if (document.estiForm.quantity.value < 50){ document.estiForm.quantity.value=50; alert('Minimum quantity: 50'); if (document.estiForm.productFamily.value=="Booklet" || document.estiForm.productFamily.value=="Catalog" || document.estiForm.productFamily.value=="Calendar") calculate_multi(); else if (document.estiForm.productFamily.value=="Folder" || document.estiForm.productFamily.value=="Folder 4x9" || document.estiForm.productFamily.value=="CD Sleeve 5x5" || document.estiForm.productFamily.value=="Doorhanger" || document.estiForm.productFamily.value=="3 Panel Folder") calculate_folder(); else calculate(); } } if (document.estiForm.productFamily.value == "Calendar") { if (document.estiForm.quantity.value < 25){ document.estiForm.quantity.value=25; alert('Minimum quantity: 25'); calculate_multi(); } } if (document.estiForm.productFamily.value == "4cLetterhead" && document.estiForm.quantity.value < 1000){ document.estiForm.quantity.value=1000; alert('Sorry, due to production constraints, minimum quantity for 4-color letterhead is 1,000. For smaller orders, we suggest 2-color letterhead, which can be run on our smaller press.'); calculate(); } if (document.estiForm.productFamily.value != "Booklet" && document.estiForm.productFamily.value != "Catalog" && document.estiForm.productFamily.value != "Calendar" && document.estiForm.quantity.value > 30000) { document.estiForm.quantity.value=30000; alert('Maximum quantity: 30000. For higher quantities please request a custom estimate!'); if (document.estiForm.productFamily.value=="Folder" || document.estiForm.productFamily.value=="Folder 4x9" || document.estiForm.productFamily.value=="CD Sleeve 5x5" || document.estiForm.productFamily.value=="Doorhanger" || document.estiForm.productFamily.value=="3 Panel Folder") calculate_folder(); else calculate(); } if (document.estiForm.quantity.value > 20000 && (document.estiForm.productFamily.value=="Booklet" || document.estiForm.productFamily.value=="Catalog" || document.estiForm.productFamily.value=="Calendar")) { document.estiForm.quantity.value=20000; alert('Maximum quantity: 20000. For higher quantities please request a custom estimate!'); calculate_multi(); } } 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; } enableAll(); 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; } enableAll(); document.estiForm.submit(); } function checkCardBoxQuant() { if (document.estiForm.greetingCardBoxes && document.estiForm.greetingCardBoxes != null && document.estiForm.greetingCardBoxes.value > 1000) { alert("If you need more than 1,000 boxes, please submit a custom quote!"); document.estiForm.greetingCardBoxes.value = 1000; } } 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; inside_pages = (parseInt(document.estiForm.pages.value)); total_pages = (parseInt(document.estiForm.pages.value) + 4); productFamily = document.estiForm.productFamily.value; var finalHeight = document.estiForm.finalHeight.value; var finalWidth = document.estiForm.finalWidth.value; inside_quantity = ( (quantity * inside_pages) / 4); inside_sheets = (inside_quantity / quantity); //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); /*alert ("quantity: " + quantity + "\n" + "inside quantity: " + inside_quantity + "\n" + "inside_sheets: " + inside_sheets + "\n" + "square inches, unfolded: " + si + "\n" + "square inches of all inside pages per booklet: " + inside_si + "\n" + "total square inches for cover: " + tsi_cover + "\n" + "total square inches for inside pages: " + tsi);*/ 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)); 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("myMailCost", formatCurrency2(totalMailingCost)); updateText("myShipQuant", quantity); document.estiForm.shipQuant.value = quantity; document.estiForm.mailCost.value = "0.00"; } } else { if (document.estiForm.shipQuant) document.estiForm.shipQuant.value = quantity; if (document.estiForm.mailCost) document.estiForm.mailCost.value = "0.00"; } if (total_pages == "8") { if (quantity < 5000) { tp=calc8pager(); } else { tp=( calc8pager() * 1.1); } } if (total_pages == "12") { if (quantity <= 1000) { tp=(calc12pager() * 1.03); } else if (quantity <= 2000) { tp=(calc12pager() * 1.13); } else if (quantity <= 10000) { tp=(calc12pager() * 1.23); } else { tp=(calc12pager() * 1.33); } } if (total_pages == "16") { if (quantity <= 2000) { tp=(calc16pager() * 1.08); } else if (quantity <= 5000) { tp=(calc16pager() * 1.13); } else if (quantity <= 7500) { tp=(calc16pager() * 1.18); } else { tp=(calc16pager() * 1.2); } } if (total_pages == "20") { if (quantity <= 1000) { tp=(calc20pager() * 1.22); } else if (quantity <= 2000) { tp=(calc20pager() * 1.27); } else if (quantity <= 5000) { tp=(calc20pager() * 1.34); } else if (quantity <= 7500) { tp=(calc20pager() * 1.37); } else if (quantity <= 10000) { tp=(calc20pager() * 1.4); } else { tp=(calc20pager() * 1.45); } } if (total_pages == "24") { if (quantity <= 500) { tp=(calc24pager() * 1.31); } else if (quantity <= 1000) { tp=(calc24pager() * 1.33); } else if (quantity <= 2000) { tp=(calc24pager() * 1.37); } else if (quantity <= 5000) { tp=(calc24pager() * 1.5); } else if (quantity <= 7500) { tp=(calc24pager() * 1.54); } else if (quantity <= 10000) { tp=(calc24pager() * 1.59); } else { tp=(calc24pager() * 1.65); } } if (total_pages == "28") { if (quantity <= 200 && document.estiForm.productFamily.value == "Calendar") { if (quantity <= 25) { tp = (100 + (22 * quantity)); } else if (quantity <= 50) { tp = (100 + (19 * quantity)); } else if (quantity <= 75) { tp = (100 + (14 * quantity)); } else if (quantity <= 150) { tp = (100 + (10 * quantity)); } else if (quantity <= 200) { tp = (100 + (9 * quantity)); } } else if (quantity <= 1000) { tp=(calc28pager() * 1.31); } else if (quantity <= 2000) { tp=(calc28pager() * 1.37); } else if (quantity <= 5000) { tp=(calc28pager() * 1.46); } else if (quantity <= 7500) { tp=(calc28pager() * 1.51); } else if (quantity <= 10000) { tp=(calc28pager() * 1.51); } else { tp=(calc28pager() * 1.57); } } if (total_pages == "32") { if (quantity <= 500) { tp=((calc8pager() + calc24pager()) * 1.18); } else if (quantity <= 2000) { tp=((calc8pager() + calc24pager()) * 1.2); } else if (quantity <= 5000) { tp=((calc8pager() + calc24pager()) * 1.32); } else if (quantity <= 7500) { tp=((calc8pager() + calc24pager()) * 1.35); } else if (quantity <= 10000) { tp=((calc8pager() + calc24pager()) * 1.4); } else { tp=((calc8pager() + calc24pager()) * 1.45); } } if (total_pages == "36") { if (quantity <= 2000) { tp=(((calc12pager() * 1.03) + calc24pager()) * 1.35); } else if (quantity <= 5000) { tp=(((calc12pager() * 1.03) + calc24pager()) * 1.45); } else if (quantity <= 7500) { tp=(((calc12pager() * 1.03) + calc24pager()) * 1.55); } else if (quantity <= 10000) { tp=(((calc12pager() * 1.03) + calc24pager()) * 1.57); } else { tp=(((calc12pager() * 1.03) + calc24pager()) * 1.6); } } if (total_pages == "40") { if (quantity <= 2000) { tp=((calc16pager() + calc24pager()) * 1.3); } else if (quantity <= 5000) { tp=((calc16pager() + calc24pager()) * 1.38); } else if (quantity <= 7500) { tp=((calc16pager() + calc24pager()) * 1.4); } else if (quantity <= 10000) { tp=((calc16pager() + calc24pager()) * 1.45); } else { tp=((calc16pager() + calc24pager()) * 1.5); } } if (total_pages == "44") { if (quantity <= 2000) { tp=((calc20pager() + calc24pager()) * 1.4); } else if (quantity <= 5000) { tp=((calc20pager() + calc24pager()) * 1.45); } else if (quantity <= 7500) { tp=((calc20pager() + calc24pager()) * 1.5); } else if (quantity <= 7500) { tp=((calc20pager() + calc24pager()) * 1.55); } else { tp=((calc20pager() + calc24pager()) * 1.6); } } if (total_pages == "48") { if (quantity <= 1000) { tp=((calc24pager() *2) * 1.45); } else if (quantity <= 2000) { tp=((calc24pager() *2) * 1.5); } else if (quantity <= 5000) { tp=((calc24pager() *2) * 1.55); } else if (quantity <= 7500) { tp=((calc24pager() *2) * 1.65); } else if (quantity <= 10000) { tp=((calc24pager() *2) * 1.7); } else { tp=((calc24pager() *2) * 1.75); } } if (total_pages == "52") { if (quantity <= 2000) { tp=(((calc20pager() *2 ) + (calc12pager())) * 1.35); } else if (quantity <= 5000) { tp=(((calc20pager() *2 ) + (calc12pager())) * 1.4); } else if (quantity <= 10000) { tp=(((calc20pager() *2 ) + (calc12pager())) * 1.45); } else { tp=(((calc20pager() *2 ) + (calc12pager())) * 1.5); } } if (total_pages == "56") { if (quantity <= 1000) { tp=((calc8pager() + (calc24pager() * 2)) * 1.4); } else if (quantity <= 2000) { tp=((calc8pager() + (calc24pager() * 2)) * 1.45); } else if (quantity <= 5000) { tp=((calc8pager() + (calc24pager() * 2)) * 1.5); } else if (quantity <= 10000) { tp=((calc8pager() + (calc24pager() * 2)) * 1.55); } else { tp=((calc8pager() + (calc24pager() * 2)) * 1.6); } } if (total_pages == "60") { if (quantity <= 1000) { tp=((calc12pager() + (calc24pager() * 2)) * 1.5); } else if (quantity <= 5000) { tp=((calc12pager() + (calc24pager() * 2)) * 1.58); } else if (quantity <= 10000) { tp=((calc12pager() + (calc24pager() * 2)) * 1.65); } else { tp=((calc12pager() + (calc24pager() * 2)) * 1.75); } } if (total_pages == "64") { if (quantity <= 1000) { tp=(((calc24pager() * 2) + (calc16pager())) * 1.45); } else if (quantity <= 2000) { tp=(((calc24pager() * 2) + (calc16pager())) * 1.48); } else if (quantity <= 5000) { tp=(((calc24pager() * 2) + (calc16pager())) * 1.5); } else if (quantity <= 10000) { tp=(((calc24pager() * 2) + (calc16pager())) * 1.55); } else { tp=(((calc24pager() * 2) + (calc16pager())) * 1.6); } } if (total_pages == "68") { if (quantity <= 1000) { tp=(((calc8pager() + calc12pager()) + ((calc24pager() * 2))) * 1.45); } else if (quantity <= 2000) { tp=(((calc8pager() + calc12pager()) + ((calc24pager() * 2))) * 1.5); } else if (quantity <= 5000) { tp=(((calc8pager() + calc12pager()) + ((calc24pager() * 2))) * 1.52); } else if (quantity <= 10000) { tp=(((calc8pager() + calc12pager()) + ((calc24pager() * 2))) * 1.6); } else { tp=(((calc8pager() + calc12pager()) + ((calc24pager() * 2))) * 1.65); } } if (document.estiForm.colors.value == "1over1" && document.estiForm.coverColors.value != "1over1") { //extra charge for plates & makeready on color cover if (total_pages == "8") { tp=(tp + 90); } if (total_pages == "12") { tp=(tp + 140); } else if (total_pages >= "16") { tp=(tp + 260); } } if (document.estiForm.coverPaper.value != "same as inside") { //For Cover add $350 up to 4,500 then double to $700 up to 10,000 then add $350 for each additional 5,000 if (quantity <= 200 && document.estiForm.productFamily.value == "Calendar") { tp=(tp + 0); } else if (quantity <= 4500) { tp=(tp + 350) } else if (quantity <= 10000) { tp=(tp + 700) } else if (quantity <= 15000) { tp=(tp + 1050) } else if (quantity <= 20000) { tp=(tp + 1400) } if (document.estiForm.coverColors.value == "4over1") { //Small discounts for less presstime on inside cover tp=(tp - 28) } if (document.estiForm.coverColors.value == "4over0") { tp=(tp - 58) } } if (document.estiForm.productFamily.value == "Calendar") { tp = (tp + calcDrilling()); } if (document.estiForm.bind.options) { if (document.estiForm.bind.options[document.estiForm.bind.selectedIndex].value == "wiro") {//they chose a wire-o bind tp = (tp + (quantity * 1)); //add $1 per book for wire-o } } else { if (document.estiForm.bind.value == "wiro") {//they chose a wire-o bind tp = (tp + (quantity * 1)); //add $1 per book for wire-o } } tp = (tp + (calcProof(si + (si * inside_sheets)))); if (finalHeight == "8.5" && finalWidth == "5.5"){ tp = (tp * .75) } if (document.estiForm.turnaround[0] && document.estiForm.turnaround[0].type=='radio') { for (var i=0; i < document.estiForm.turnaround.length; i++) { if (document.estiForm.turnaround[i].checked) { var turn_val = document.estiForm.turnaround[i].value; if (turn_val == '5 day') tp = tp + (tp * .1) } } } document.estiForm.si.value=si; document.estiForm.tsi.value=tsi; 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; if (document.estiForm.productFamily.value == "Calendar") { var printDiscount = tp * .15; } else { var printDiscount = tp * .1; } tp = (tp - printDiscount); var grandTotal = (tp + Math.round(totalMailingCost)); var printFullPrice = (tp + printDiscount); updateText("myPrintDiscount", formatCurrency(printDiscount)); updateText("myPrintFullPrice", formatCurrency(printFullPrice)); updateText("myPrintCost", formatCurrency(tp)); updateText("myTp", formatCurrency(grandTotal)); updateText("myTp2", 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; if (document.estiForm.productFamily.value == "Calendar") { var printDiscount = tp * .15; } else { var printDiscount = tp * .1; } tp = (tp - printDiscount); var grandTotal = tp; var printFullPrice = (tp + printDiscount); updateText("myPrintDiscount", formatCurrency(printDiscount)); updateText("myPrintFullPrice", formatCurrency(printFullPrice)); updateText("myPrintCost", formatCurrency(tp)); updateText("myTp", formatCurrency(grandTotal)); updateText("myTp2", formatCurrency(grandTotal)); document.estiForm.ppu.value=formatCurrency(ppu); document.estiForm.tp.value=formatCurrency(tp); document.estiForm.printCost.value = formatAsMoney(printTotal); } } } function calc8pager() { //baseline pricing for 8-page sig. Market adjustments are made in calc_multi function above! if (document.estiForm.colors.value == "4over4") { var numberSheets = ((quantity/1000) + .8); var numberPlates = 8; } else if (document.estiForm.colors.value == "1over1") { var numberSheets = ((quantity/1000) + .4); var numberPlates = 2; } var paperCost = (numberSheets * getPaperCostPerK()); var prepressCost = 80; var plateCost = (numberPlates * 30); var hoursOnPress = ((quantity/7000) + 1.5); var pressCost = (hoursOnPress * 250); var binderyCost = 0; if (quantity <= 4000) { binderyCost = 247.5 } else if (quantity <= 4500) { binderyCost = 330 } else if (quantity <= 5000) { binderyCost = 357.5 } else if (quantity > 5000) { var binderyAdd = ((quantity - 5000) / 500) binderyCost = (357.5 + ((binderyAdd) * (22)) ); //$22 per 500 beyond qty of 5000 } //alert ("numberSheets = " + numberSheets + "\n paperCost = " + paperCost + "\n prepressCost = " + prepressCost + "\n plateCost = " + plateCost + "\n pressCost = " + pressCost + "\n binderyCost = " + binderyCost); return (paperCost + prepressCost + plateCost+ pressCost + binderyCost); } function calc12pager() { //baseline pricing for 12-page sig. Market adjustments are made in calc_multi function above! if (document.estiForm.colors.value == "4over4") { var numberSheets = ((quantity/1000) + .8); var numberPlates = 8; } else if (document.estiForm.colors.value == "1over1") { var numberSheets = ((quantity/1000) + .4); var numberPlates = 2; } var paperCost = (numberSheets * getPaperCostPerK()); var prepressCost = 80; var plateCost = (numberPlates * 30); var hoursOnPress = ((quantity/7000) + 1.5); var pressCost = (hoursOnPress * 250); var binderyCost = 0; if (quantity <= 1000) { binderyCost = 247.5 } else if (quantity <= 1500) { binderyCost = 258.5 } else if (quantity > 1500) { var binderyAdd = ((quantity - 1500) / 500) binderyCost = (258.5 + ((binderyAdd) * (22)) ); //$22 per 500 beyond qty of 1500 } //alert ("numberSheets = " + numberSheets + "\n paperCost = " + paperCost + "\n prepressCost = " + prepressCost + "\n plateCost = " + plateCost + "\n pressCost = " + pressCost + "\n binderyCost = " + binderyCost); return (paperCost + prepressCost + plateCost+ pressCost + binderyCost); } function calc16pager() { //baseline pricing for 16-page sig. Market adjustments are made in calc_multi function above! if (document.estiForm.colors.value == "4over4") { var numberSheets = (((quantity/1000)*2) + 1.6); var numberPlates = 12; } else if (document.estiForm.colors.value == "1over1") { var numberSheets = (((quantity/1000)*2) + .8); var numberPlates = 4; } var paperCost = (numberSheets * getPaperCostPerK()); var prepressCost = 160; var plateCost = (numberPlates * 30); var hoursOnPress = (((quantity/7000)*2) + 2); var pressCost = (hoursOnPress * 250); var binderyCost = 0; if (quantity <= 500) { binderyCost = 324.5 } else if (quantity > 500) { var binderyAdd = ((quantity - 500) / 500) binderyCost = (324.5 + ((binderyAdd) * (22)) ); //$22 per 500 beyond qty of 500 } //alert ("numberSheets = " + numberSheets + "\n paperCost = " + paperCost + "\n prepressCost = " + prepressCost + "\n plateCost = " + plateCost + "\n pressCost = " + pressCost + "\n binderyCost = " + binderyCost); return (paperCost + prepressCost + plateCost+ pressCost + binderyCost); } function calc20pager() { //baseline pricing for 20-page sig. Market adjustments are made in calc_multi function above! if (document.estiForm.colors.value == "4over4") { var numberSheets = (((quantity/1000)*2) + 1.6); var numberPlates = 16; } else if (document.estiForm.colors.value == "1over1") { var numberSheets = (((quantity/1000)*2) + .8); var numberPlates = 4; } var paperCost = (numberSheets * getPaperCostPerK()); var prepressCost = 160; var plateCost = (numberPlates * 30); var hoursOnPress = (((quantity/7000)*2) + 2); var pressCost = (hoursOnPress * 250); var binderyCost = 0; if (quantity <= 500) { binderyCost = 352 } else if (quantity > 500) { var binderyAdd = ((quantity - 500) / 500) binderyCost = (352 + ((binderyAdd) * (22)) ); //$22 per 500 beyond qty of 500 } //alert ("numberSheets = " + numberSheets + "\n paperCost = " + paperCost + "\n prepressCost = " + prepressCost + "\n plateCost = " + plateCost + "\n pressCost = " + pressCost + "\n binderyCost = " + binderyCost); return (paperCost + prepressCost + plateCost+ pressCost + binderyCost); } function calc24pager() { //baseline pricing for 24-page sig. Market adjustments are made in calc_multi function above! if (document.estiForm.colors.value == "4over4") { var numberSheets = (((quantity/1000)*2) + 1.6); var numberPlates = 16; } else if (document.estiForm.colors.value == "1over1") { var numberSheets = (((quantity/1000)*2) + .8); var numberPlates = 4; } var paperCost = (numberSheets * getPaperCostPerK()); var prepressCost = 300; var plateCost = (numberPlates * 30); var hoursOnPress = (((quantity/7000)*2) + 2); var pressCost = (hoursOnPress * 250); var binderyCost = 0; if (quantity <= 500) { binderyCost = 407 } else if (quantity > 500) { var binderyAdd = ((quantity - 500) / 500) binderyCost = (407 + ((binderyAdd) * (22)) ); //$22 per 500 beyond qty of 500 } //alert ("numberSheets = " + numberSheets + "\n paperCost = " + paperCost + "\n prepressCost = " + prepressCost + "\n plateCost = " + plateCost + "\n pressCost = " + pressCost + "\n binderyCost = " + binderyCost); return (paperCost + prepressCost + plateCost+ pressCost + binderyCost); } function calc28pager() { //baseline pricing for 28-page sig. Market adjustments are made in calc_multi function above! if (document.estiForm.colors.value == "4over4") { var numberSheets = (((quantity/1000)*2.5) + 2.2); var numberPlates = 20; } else if (document.estiForm.colors.value == "1over1") { var numberSheets = (((quantity/1000)*2.5) + 1); var numberPlates = 5; } var paperCost = (numberSheets * getPaperCostPerK()); var prepressCost = 300; var plateCost = (numberPlates * 30); var hoursOnPress = (((quantity/7000)*2.5) + 2.5); var pressCost = (hoursOnPress * 250); var binderyCost = 0; if (quantity <= 500) { binderyCost = 462 } else if (quantity > 500) { var binderyAdd = ((quantity - 500) / 500) binderyCost = (462 + ((binderyAdd) * (22)) ); //$22 per 500 beyond qty of 500 } //alert ("numberSheets = " + numberSheets + "\n paperCost = " + paperCost + "\n prepressCost = " + prepressCost + "\n plateCost = " + plateCost + "\n pressCost = " + pressCost + "\n binderyCost = " + binderyCost); return (paperCost + prepressCost + plateCost+ pressCost + binderyCost); } function getPaperCostPerK() { if (document.estiForm.paper && document.estiForm.paper.value == "80_nl_rein_book"){ return 116.8342695 } if (document.estiForm.paper && document.estiForm.paper.value == "105_nl_rein_book"){ return 153.781859 } if (document.estiForm.paper && document.estiForm.paper.value == "101_nl_pvg_book"){ return 131.739758 } if (document.estiForm.paper && document.estiForm.paper.value == "87_nl_sak_book"){ return 119.1683545 } if (document.estiForm.paper && document.estiForm.paper.value == "106_nl_sak_book"){ return 145.4416925 } if (document.estiForm.paper && document.estiForm.paper.value == "80_nl_eb_book"){ return 174.116475 } } function checkFinalMailDependencies(productFamily, quantity, mailQuant) { if (document.estiForm.mailing && 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" || productFamily == "w2pCard") && document.estiForm.blankEnvelopes.value == "no" && document.estiForm.konlyEnvelopes.value == "no") { //alert(productFamily + si); 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!"); } if (mailQuant && mailQuant > 499 && document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value=="stamps") { document.estiForm.mailing.selectedIndex=1; alert("Stamps are not an option for mailings of more than 500. First Class Bulk Mail 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 this size card. 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=0; alert("The quantity to be mailed cannot be more than the total print quantity! Mail quantity has been reset to zero."); } 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.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); } if (document.estiForm.stationeryBizCardQuantity.value == 0){ sbc = 0; } } //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) && (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 && document.estiForm.stationeryLetterhead.selectedIndex != 0) || (document.estiForm.stationeryEnvelopes && 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-Business Cards") { 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; } else { sbc += 0; } } //add rounded corners charge if (document.estiForm.round_corners && document.estiForm.round_corners.value == "yes"){ roundCorners = (25 + (((document.estiForm.stationeryBizCardQuantity.value) - 250) * .03)); sbc = sbc + roundCorners; } } 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.875)")){ 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; } } else if (document.estiForm.stationeryEnvelopesSize.value == ("A6 (6.5 x 4.75)")){ if (document.estiForm.stationeryEnvelopes.value == 500){ tp += 220; } if (document.estiForm.stationeryEnvelopes.value == 1000){ //alert("1000 #10 envelopes = $251"); tp += 272; } if (document.estiForm.stationeryEnvelopes.value == 1500){ tp += 324; } if (document.estiForm.stationeryEnvelopes.value == 2000){ tp += 376; } if (document.estiForm.stationeryEnvelopes.value == 2500){ tp += 433; } if (document.estiForm.stationeryEnvelopes.value == 3000){ tp += 490; } if (document.estiForm.stationeryEnvelopes.value == 3500){ tp += 548; } if (document.estiForm.stationeryEnvelopes.value == 4000){ tp += 605; } if (document.estiForm.stationeryEnvelopes.value == 4500){ tp += 662; } if (document.estiForm.stationeryEnvelopes.value == 5000){ tp += 719; } } else if (document.estiForm.stationeryEnvelopesSize.value == ("A7 (7.25 x 5.25)")){ if (document.estiForm.stationeryEnvelopes.value == 500){ tp += 235; } if (document.estiForm.stationeryEnvelopes.value == 1000){ //alert("1000 #10 envelopes = $251"); tp += 298; } if (document.estiForm.stationeryEnvelopes.value == 1500){ tp += 360; } if (document.estiForm.stationeryEnvelopes.value == 2000){ tp += 423; } if (document.estiForm.stationeryEnvelopes.value == 2500){ tp += 492; } if (document.estiForm.stationeryEnvelopes.value == 3000){ tp += 561; } if (document.estiForm.stationeryEnvelopes.value == 3500){ tp += 630; } if (document.estiForm.stationeryEnvelopes.value == 4000){ tp += 699; } if (document.estiForm.stationeryEnvelopes.value == 4500){ tp += 768; } if (document.estiForm.stationeryEnvelopes.value == 5000){ tp += 837; } } else if (document.estiForm.stationeryEnvelopesSize.value == ("#10 Window")){ if (document.estiForm.stationeryEnvelopes.value == 500){ tp += 169; } if (document.estiForm.stationeryEnvelopes.value == 1000){ //alert("1000 #10 envelopes = $251"); tp += 245.50; } if (document.estiForm.stationeryEnvelopes.value == 1500){ tp += 286.50; } if (document.estiForm.stationeryEnvelopes.value == 2000){ tp += 327.50; } if (document.estiForm.stationeryEnvelopes.value == 2500){ tp += 372.50; } if (document.estiForm.stationeryEnvelopes.value == 3000){ tp += 417.50; } if (document.estiForm.stationeryEnvelopes.value == 3500){ tp += 462.50; } if (document.estiForm.stationeryEnvelopes.value == 4000){ tp += 508; } if (document.estiForm.stationeryEnvelopes.value == 4500){ tp += 553; } if (document.estiForm.stationeryEnvelopes.value == 5000){ tp += 598; } } else if (document.estiForm.stationeryEnvelopesSize.value == ("#9 Remit")){ if (document.estiForm.stationeryEnvelopes.value == 500){ tp += 335; } if (document.estiForm.stationeryEnvelopes.value == 1000){ tp += 420; } if (document.estiForm.stationeryEnvelopes.value == 1500){ tp += 505; } if (document.estiForm.stationeryEnvelopes.value == 2000){ tp += 590; } if (document.estiForm.stationeryEnvelopes.value == 2500){ tp += 684; } if (document.estiForm.stationeryEnvelopes.value == 3000){ tp += 778; } if (document.estiForm.stationeryEnvelopes.value == 3500){ tp += 876.50; } if (document.estiForm.stationeryEnvelopes.value == 4000){ tp += 975; } if (document.estiForm.stationeryEnvelopes.value == 4500){ tp += 1074; } if (document.estiForm.stationeryEnvelopes.value == 5000){ tp += 1173.50; } } else if (document.estiForm.stationeryEnvelopesSize.value == ("#6.5 Remit (6.25 x 3.5)")){ if (document.estiForm.stationeryEnvelopes.value == 500){ tp += 312; } if (document.estiForm.stationeryEnvelopes.value == 1000){ tp += 385; } if (document.estiForm.stationeryEnvelopes.value == 1500){ tp += 457.50; } if (document.estiForm.stationeryEnvelopes.value == 2000){ tp += 530; } if (document.estiForm.stationeryEnvelopes.value == 2500){ tp += 609.50; } if (document.estiForm.stationeryEnvelopes.value == 3000){ tp += 689; } if (document.estiForm.stationeryEnvelopes.value == 3500){ tp += 773; } if (document.estiForm.stationeryEnvelopes.value == 4000){ tp += 857; } if (document.estiForm.stationeryEnvelopes.value == 4500){ tp += 941; } if (document.estiForm.stationeryEnvelopes.value == 5000){ tp += 1025; } } else if (document.estiForm.stationeryEnvelopesSize.value == ("A2 (4.375 x 5.75)")){ if (document.estiForm.stationeryEnvelopes.value == 500){ tp += 212; } if (document.estiForm.stationeryEnvelopes.value == 1000){ tp += 259; } if (document.estiForm.stationeryEnvelopes.value == 1500){ tp += 305; } if (document.estiForm.stationeryEnvelopes.value == 2000){ tp += 351; } if (document.estiForm.stationeryEnvelopes.value == 2500){ tp += 402; } if (document.estiForm.stationeryEnvelopes.value == 3000){ tp += 453; } if (document.estiForm.stationeryEnvelopes.value == 3500){ tp += 504; } if (document.estiForm.stationeryEnvelopes.value == 4000){ tp += 555; } if (document.estiForm.stationeryEnvelopes.value == 4500){ tp += 606.50; } if (document.estiForm.stationeryEnvelopes.value == 5000){ tp += 658; } } else if (document.estiForm.stationeryEnvelopesSize.value == ("9 x 12 Catalog")){ if (document.estiForm.stationeryEnvelopes.value == 500){ tp += 282; } if (document.estiForm.stationeryEnvelopes.value == 1000){ tp += 378; } if (document.estiForm.stationeryEnvelopes.value == 1500){ tp += 474; } if (document.estiForm.stationeryEnvelopes.value == 2000){ tp += 570; } if (document.estiForm.stationeryEnvelopes.value == 2500){ tp += 675.50; } if (document.estiForm.stationeryEnvelopes.value == 3000){ tp += 781; } if (document.estiForm.stationeryEnvelopes.value == 3500){ tp += 887; } if (document.estiForm.stationeryEnvelopes.value == 4000){ tp += 993; } if (document.estiForm.stationeryEnvelopes.value == 4500){ tp += 1098.50; } if (document.estiForm.stationeryEnvelopes.value == 5000){ tp += 1204; } } if (document.estiForm.productFamily.value == ("Stationery-Envelopes")) { if (document.estiForm.stationeryEnvelopesSize.value == ("#9 (8.875 x 3.875)") || document.estiForm.stationeryEnvelopesSize.value == ("#10 (9.5 x 4.125)") || document.estiForm.stationeryEnvelopesSize.value == ("A6 (6.5 x 4.75)") || document.estiForm.stationeryEnvelopesSize.value == ("A7 (7.25 x 5.25)") || document.estiForm.stationeryEnvelopesSize.value == ("A2 (4.375 x 5.75)") ) { if (document.estiForm.everestNatural[0] && document.estiForm.everestNatural[0].type=='radio') { for (var i=0; i < document.estiForm.everestNatural.length; i++) { if (document.estiForm.everestNatural[i].checked) { var everestNaturalSelected = document.estiForm.everestNatural[i].value; if (everestNaturalSelected == 'yes') { var everestNaturalCharge = ((quantity / 1000) * 30); tp = tp + everestNaturalCharge; } } } } } } if (document.estiForm.productFamily.value == ("Stationery-Letterhead")) { if (document.estiForm.everestNatural[0] && document.estiForm.everestNatural[0].type=='radio') { for (var i=0; i < document.estiForm.everestNatural.length; i++) { if (document.estiForm.everestNatural[i].checked) { var everestNaturalSelected = document.estiForm.everestNatural[i].value; if (everestNaturalSelected == 'yes') { var everestNaturalCharge = (((document.estiForm.stationeryLetterhead.value / 1000) * 30) + ((document.estiForm.stationeryLetterheadBlank.value / 1000) * 30)); tp = tp + everestNaturalCharge; } } } } } 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.options || 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 == ("7 day")) { tp = tp - (tp * .05) } if (document.estiForm.turnaround.value == ("3 day")) { tp = tp + (tp * .15) } if (document.estiForm.turnaround[0] && document.estiForm.turnaround[0].type=='radio') { for (var i=0; i < document.estiForm.turnaround.length; i++) { if (document.estiForm.turnaround[i].checked) { var turn_val = document.estiForm.turnaround[i].value; if (turn_val == '7 day') tp = tp - (tp * .05) else if (turn_val == '3 day') tp = tp + (tp * .15) } } } //final multi-product discount to bring pricing more into line with Robert's - BV if (document.estiForm.stationeryLetterhead.options && document.estiForm.stationeryLetterheadBlank.options && document.estiForm.stationeryLetterheadBlank.options && document.estiForm.stationeryEnvelopes.options) { 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; updateText("myTp", formatCurrency(grandTotal)); updateText("myTp2", formatCurrency(grandTotal)); //document.estiForm.ppu.value=formatCurrency(ppu); document.estiForm.tp.value=formatCurrency(tp); printTotal = grandTotal; document.estiForm.printCost.value = formatAsMoney(printTotal); } setFinalSize(); } 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)); 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"; } } else { if (document.estiForm.shipQuant) document.estiForm.shipQuant.value = quantity; if (document.estiForm.mailCost) document.estiForm.mailCost.value = "0.00"; } if (productFamily=="BusCard") { 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 = .079; } if (document.estiForm.quantity.value == 2000 || document.estiForm.quantity.value == 2250){ ppu = .07875; } if (document.estiForm.quantity.value >= 2500 && document.estiForm.quantity.value <= 5000){ ppu = .07625; } if (document.estiForm.quantity.value >= 5250 && document.estiForm.quantity.value <= 7000){ ppu = .075; } if (document.estiForm.quantity.value >= 7250 && document.estiForm.quantity.value <= 8750){ ppu = .07375; } if (document.estiForm.quantity.value >= 9000 && document.estiForm.quantity.value <= 11750){ ppu = .0725; } if (document.estiForm.quantity.value >= 12000 && document.estiForm.quantity.value <= 14750){ ppu = .07125; } if (document.estiForm.quantity.value >= 15000 && document.estiForm.quantity.value <= 16000){ ppu = .07; } 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. Add $23 if only 250 cards. if (document.getElementById('bc_name_one').style.display == 'block' && (document.estiForm.productFamily.value == "BusCard") && ( 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') && 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') && 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') && 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') && 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') && 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') && 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') && 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') && 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') && 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') && 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') && 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') && 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') && 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') && document.getElementById('bc_name_eight').style.display == 'block' && parseInt(document.estiForm.cardQuant8.value) != 0 && parseInt(document.estiForm.cardQuant8.value) == 250){ tp += 23; } } if (productFamily == "w2pBusCard-1person") { cardQuant1 = document.estiForm.cardQuant1.value; if (quantity == "250") { tp = 29.50 } if (quantity == "500") { tp = 39.50 } if (quantity == "1000") { tp = 60 } } if (productFamily == "w2pBusCard-2person") { cardQuant1 = document.estiForm.cardQuant1.value; if (quantity == "500") { tp = 59 } if (quantity == "1000") { tp = 79 } if (quantity == "2000") { tp = 120 } } if (productFamily == "w2pBusCard-3person") { cardQuant1 = document.estiForm.cardQuant1.value; if (quantity == "750") { tp = 88.5 } if (quantity == "1500") { tp = 118.5 } if (quantity == "3000") { tp = 180 } } if (productFamily == "w2pBusCard-4person") { cardQuant1 = document.estiForm.cardQuant1.value; if (quantity == "1000") { tp = 118 } if (quantity == "2000") { tp = 158 } if (quantity == "4000") { tp = 240 } } var totalQuant = quantity; updateText("myTq", (totalQuant)); //alert("Line 2362 quantity: " + quantity); // 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") } if (document.estiForm.turnaround[0] && document.estiForm.turnaround[0].type=='radio') { for (var i=0; i < document.estiForm.turnaround.length; i++) { if (document.estiForm.turnaround[i].checked) { var turn_val = document.estiForm.turnaround[i].value; if (turn_val == '5 day') tp = (tp + (tp * .25)) ; else if (turn_val == '3 day') tp = (tp + (tp * .45)) ; } } } // 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 rounded corners charge business cards if (document.estiForm.productFamily && (document.estiForm.productFamily.value == "BusCard" || document.estiForm.productFamily.value == "w2pBusCard-1person" || document.estiForm.productFamily.value == "w2pBusCard-2person" || document.estiForm.productFamily.value == "w2pBusCard-3person" || document.estiForm.productFamily.value == "w2pBusCard-4person")) { if (document.estiForm.round_corners.value == "yes"){ roundCorners = (25 + ((quantity - 250) * .03)); tp = tp + roundCorners; } } //add shapeCut charge if (document.estiForm.shapeCut && document.estiForm.shapeCut.value == "yes"){ tp = (tp * 1.5); } //add 25% for kraft paper if (document.estiForm.paper && document.estiForm.paper.value == "20pt_kraftboard"){ tp = (tp * 1.25); } if (mode && mode == 1) { updatePrice("ppu", formatCurrency(ppu), ppu, quantity); updatePrice("tp", formatCurrency2(tp), Math.round(tp), quantity); } else { var grandTotal = tp; updateText("myTp", formatCurrency(grandTotal)); updateText("myTp2", 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; enableAll(); 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-Package" && document.estiForm.productFamily.value != "Stationery-Business Cards" && document.estiForm.productFamily.value != "Stationery-Letterhead" && document.estiForm.productFamily.value != "Stationery-Envelopes" && document.estiForm.productFamily.value != "Booklet" && document.estiForm.productFamily.value != "Catalog" && document.estiForm.productFamily.value != "Calendar" && document.estiForm.productFamily.value != "Folder" && document.estiForm.productFamily.value != "Folder 4x9" && document.estiForm.productFamily.value != "3 Panel Folder" && document.estiForm.productFamily.value != "CD Sleeve 5x5" && document.estiForm.productFamily.value != "Doorhanger") { 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(); enableAll(); 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" || document.estiForm.productFamily.value == "Folder 4x9" || document.estiForm.productFamily.value=="CD Sleeve 5x5" || document.estiForm.productFamily.value=="Doorhanger" || document.estiForm.productFamily.value == "3 Panel 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(); enableAll(); 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(); enableAll(); document.estiForm.submit(); } else { return; } } else if (document.estiForm.productFamily && document.estiForm.productFamily.value == "Stationery-Letterhead" || document.estiForm.productFamily.value == "Stationery-Envelopes") { var r=confirm('Since we offer only PDF soft proofs for our stationery products, it is strongly recommended that you refer to a Pantone Uncoated Color Guide to ensure color accuracy.'); if (r==true) { calculateStationery(); enableAll(); document.estiForm.submit(); } else { return; } } else if (document.estiForm.productFamily && document.estiForm.productFamily.value == "Stationery-Business Cards" || document.estiForm.productFamily.value == "Stationery-Package") { var r=confirm('Since we offer only PDF soft proofs for our stationery products, it is strongly recommended that you refer to a Pantone Uncoated Color Guide to ensure color accuracy.'); if (r==true) { calculateStationery(); checkStationeryNameQuant(); } else { return; } } } else if (document.estiForm.proof && document.estiForm.proof.value == "HardProof" && document.estiForm.productFamily && document.estiForm.productFamily.value != "BusCard" ) { calculate(); enableAll(); 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_blankProduct() { document.estiForm.quantity.value = document.estiForm.quantity.value.replace(/\D/g, ""); document.estiForm.realquant.value=document.estiForm.quantity.value; document.estiForm.shipQuant.value=document.estiForm.quantity.value; if (document.estiForm.productFamily.value == "Blank Kraft Folder") { if (document.estiForm.quantity.value <= 200) tp = (document.estiForm.quantity.value * .75) else if (document.estiForm.quantity.value <= 1000) tp = (document.estiForm.quantity.value * .6) else if (document.estiForm.quantity.value <= 5000) tp = (document.estiForm.quantity.value * .56) } else if (document.estiForm.productFamily.value == "Blank Gable Box") { if (document.estiForm.quantity.value <= 500) tp = (document.estiForm.quantity.value * 1) else if (document.estiForm.quantity.value <= 1000) tp = (document.estiForm.quantity.value * .92) else if (document.estiForm.quantity.value <= 5000) tp = (document.estiForm.quantity.value * .85) } else { tp = 0; } if (document.estiForm.productFamily.value == 'Blank Kraft Folder' || document.estiForm.productFamily.value == 'Blank Gable Box') { si = (19 * 25); // starting flat sheet size in square inches tsi = (si * document.estiForm.quantity.value); } var printTotal = tp; var grandTotal = tp; updateText("myPrintCost", formatCurrency(tp)); updateText("myMailCost", formatCurrency2(0)); updateText("myTp", formatCurrency(grandTotal)); updateText("myTp2", formatCurrency(grandTotal)); document.estiForm.tp.value=formatCurrency(tp); document.estiForm.printCost.value = formatAsMoney(printTotal); } function blankProductQuantCheck() { if (document.estiForm.quantity.value > 5000) { document.estiForm.quantity.value = 5000; alert("For orders larger than 5000, please submit a custom quote!"); calculate_blankProduct(); } if (document.estiForm.quantity.value < 50) { document.estiForm.quantity.value = 50; alert("Minimum quantity is 50"); calculate_blankProduct(); } } function submit_blankProduct() { calculate_blankProduct(); document.estiForm.submit(); } function calculate_banner() { document.estiForm.quantity.value = document.estiForm.quantity.value.replace(/\D/g, ""); document.estiForm.realquant.value=document.estiForm.quantity.value; document.estiForm.shipQuant.value=document.estiForm.quantity.value; height = document.estiForm.height.options[document.estiForm.height.selectedIndex].value; width = document.estiForm.width.options[document.estiForm.width.selectedIndex].value if (document.estiForm.paper.value == "biobanner") var materialCost = (height * width * .0042361); if (document.estiForm.paper.value == "matte_canvas") var materialCost = (height * width * .0132638) if (document.estiForm.paper.value == "matte_banner") var materialCost = (height * width * .0030555) var machineCost = ((( (height * width) /144) /68) * 47) tp = (((materialCost + machineCost) * 5.25) * document.estiForm.quantity.value) if (document.estiForm.turnaround[0] && document.estiForm.turnaround[0].type=='radio') { for (var i=0; i < document.estiForm.turnaround.length; i++) { if (document.estiForm.turnaround[i].checked) { var turn_val = document.estiForm.turnaround[i].value; if (turn_val == '5 day') tp = (tp + (tp * .08)) ; else if (turn_val == '3 day') tp = (tp + (tp * .2)) ; } } } if (tp < 62) tp = 62; var printTotal = tp; var grandTotal = tp; updateText("myPrintCost", formatCurrency(tp)); updateText("myMailCost", formatCurrency2(0)); updateText("myTp", formatCurrency(grandTotal)); updateText("myTp2", formatCurrency(grandTotal)); document.estiForm.tp.value=formatCurrency(tp); document.estiForm.printCost.value = formatAsMoney(printTotal); } function bannerQuantCheck() { if (document.estiForm.quantity.value > 50) { document.estiForm.quantity.value = 50; alert("For more than 50 banners, please submit a custom quote!"); calculate_banner(); } if (document.estiForm.quantity.value < 1) { document.estiForm.quantity.value = 1; alert("You must select at least '1' for quantity!"); calculate_banner(); } } function submit_banner() { calculate_banner(); document.estiForm.submit(); } function calculate_DLCalendar() { document.estiForm.quantity.value = document.estiForm.quantity.value.replace(/\D/g, ""); document.estiForm.press.value="NexP"; document.estiForm.realquant.value=document.estiForm.quantity.value; document.estiForm.shipQuant.value=document.estiForm.quantity.value; var total_pages = (parseInt(document.estiForm.pages.value)); var inside_quantity = (document.estiForm.quantity.value * total_pages); document.estiForm.insideQuantity.value = inside_quantity; tsi = (1215.5 * document.estiForm.quantity.value); if (document.estiForm.realquant.value <= 12) { tp = (document.estiForm.quantity.value * 15.99); } else if (document.estiForm.quantity.value <= 50) { tp = (document.estiForm.quantity.value * 12.99); } else if (document.estiForm.quantity.value > 50) { tp = (document.estiForm.quantity.value * 10.99); } else { tp = (document.estiForm.quantity.value * 15.99); } var printTotal = tp; var grandTotal = tp; updateText("myPrintCost", formatCurrency(tp)); updateText("myMailCost", formatCurrency2(0)); updateText("myTp", formatCurrency(grandTotal)); updateText("myTp2", formatCurrency(grandTotal)); document.estiForm.tp.value=formatCurrency(tp); document.estiForm.printCost.value = formatAsMoney(printTotal); } function calculate_DLPhotobook() { document.estiForm.quantity.value = document.estiForm.quantity.value.replace(/\D/g, ""); document.estiForm.press.value="NexP"; document.estiForm.realquant.value=document.estiForm.quantity.value; document.estiForm.shipQuant.value=document.estiForm.quantity.value; var total_pages = (parseInt(document.estiForm.pageCount.value)); var inside_quantity = (document.estiForm.quantity.value * total_pages); document.estiForm.insideQuantity.value = inside_quantity; tsi = (1215.5 * document.estiForm.quantity.value); var extraPagesCharge = ((document.estiForm.pageCount.value - 24) * 1) if (document.estiForm.realquant.value <= 12) { tp = (document.estiForm.quantity.value * (29.99 + extraPagesCharge)); } else if (document.estiForm.quantity.value <= 50) { tp = (document.estiForm.quantity.value * (27.99 + extraPagesCharge)); } else if (document.estiForm.quantity.value > 50) { tp = (document.estiForm.quantity.value * (25.99 + extraPagesCharge)); } else { tp = (document.estiForm.quantity.value * 29.99); } if (document.estiForm.bookCoverColor.value == "Black Leather") { tp = (tp + (document.estiForm.quantity.value * 2.5)) } var printTotal = tp; var grandTotal = tp; updateText("myPrintCost", formatCurrency(tp)); updateText("myMailCost", formatCurrency2(0)); updateText("myTp", formatCurrency(grandTotal)); updateText("myTp2", formatCurrency(grandTotal)); document.estiForm.tp.value=formatCurrency(tp); document.estiForm.printCost.value = formatAsMoney(printTotal); } function submit_DLPhotobook() { calculate_DLPhotobook(); enableAll(); document.estiForm.submit(); } function submit_DLCalendar() { calculate_DLCalendar(); enableAll(); document.estiForm.submit(); } function calculate_GableBox() { document.estiForm.quantity.value = document.estiForm.quantity.value.replace(/\D/g, ""); document.estiForm.realquant.value=document.estiForm.quantity.value; document.estiForm.shipQuant.value=document.estiForm.quantity.value; quantity = document.estiForm.quantity.value; if (document.estiForm.paper.value == "18pt_renewal") { if (quantity == 1000) tp = 3415.74 if (quantity == 1500) tp = 4128.77; if (quantity == 2000) tp = 4851.60 if (quantity == 2500) tp = 4722.30 if (quantity == 3000) tp = 5159.61 if (quantity == 3500) tp = 5742.96 if (quantity == 4000) tp = 6325.27 if (quantity == 4500) tp = 6743.50 if (quantity == 5000) tp = 6802.85 if (quantity == 6000) tp = 7954.16 if (quantity == 7000) tp = 9006.27 if (quantity == 8000) tp = 10033.35 if (quantity == 9000) tp = 11075.83 if (quantity == 10000) tp = 12114.46 } if (document.estiForm.paper.value == "20pt_kraftboard") { if (quantity == 1000) tp = 2347.23 if (quantity == 1500) tp = 2756.52 if (quantity == 2000) tp = 3175.90 if (quantity == 2500) tp = 3048.18 if (quantity == 3000) tp = 3222.25 if (quantity == 3500) tp = 3547.39 if (quantity == 4000) tp = 3871.46 if (quantity == 4500) tp = 4052.39 if (quantity == 5000) tp = 4034.05 if (quantity == 6000) tp = 4707.37 if (quantity == 7000) tp = 5278.72 if (quantity == 8000) tp = 5824.32 if (quantity == 9000) tp = 6385.77 if (quantity == 10000) tp = 6943.26 } if (document.estiForm.paper.value == "24pt_C1S") { if (quantity == 1000) tp = 3068.32 if (quantity == 1500) tp = 3677.92 if (quantity == 2000) tp = 4297.59 if (quantity == 2500) tp = 4352.89 if (quantity == 3000) tp = 4724.64 if (quantity == 3500) tp = 5247.47 if (quantity == 4000) tp = 5769.22 if (quantity == 4500) tp = 6130.37 if (quantity == 5000) tp = 6136.09 if (quantity == 6000) tp = 7171.82 if (quantity == 7000) tp = 8105.59 if (quantity == 8000) tp = 9013.62 if (quantity == 9000) tp = 9937.48 if (quantity == 10000) tp = 10857.39 } var printTotal = tp; var grandTotal = tp; updateText("myPrintCost", formatCurrency(tp)); updateText("myMailCost", formatCurrency2(0)); updateText("myTp", formatCurrency(grandTotal)); updateText("myTp2", formatCurrency(grandTotal)); document.estiForm.tp.value=formatCurrency(tp); document.estiForm.printCost.value = formatAsMoney(printTotal); } function submit_GableBox() { calculate_GableBox(); document.estiForm.submit(); } 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 if (productFamily == "Card") { if (document.estiForm.postcardSize && document.estiForm.postcardSize.value=="4 x 6") { height = 6; width = 4; si = (height * width); document.estiForm.height.value="6"; document.estiForm.width.value="4"; colors = document.estiForm.colors.value; } else if (document.estiForm.postcardSize && document.estiForm.postcardSize.value=="4.25 x 6") { height = 6; width = 4.25; si = (height * width); document.estiForm.height.value="6"; document.estiForm.width.value="4.25"; colors = document.estiForm.colors.value; } else if (document.estiForm.postcardSize && document.estiForm.postcardSize.value=="5 x 7") { height = 7; width = 5; si = (height * width); document.estiForm.height.value="7"; document.estiForm.width.value="5"; colors = document.estiForm.colors.value; } else if (document.estiForm.postcardSize && document.estiForm.postcardSize.value=="5.5 x 8.5") { height = 8.5; width = 5.5; si = (height * width); document.estiForm.height.value="8.5"; document.estiForm.width.value="5.5"; colors = document.estiForm.colors.value; } else if (document.estiForm.postcardSize && document.estiForm.postcardSize.value=="6 x 9") { height = 9; width = 6; si = (height * width); document.estiForm.height.value="9"; document.estiForm.width.value="6"; colors = document.estiForm.colors.value; } else if (document.estiForm.postcardSize && document.estiForm.postcardSize.value=="6 x 11") { height = 11; width = 6; si = (height * width); document.estiForm.height.value="11"; document.estiForm.width.value="6"; colors = document.estiForm.colors.value; } else { height = document.estiForm.height.value; width = document.estiForm.width.value; si = (height * width); // for reorders, this is required since they have no postcardSize formfield colors = document.estiForm.colors.value; } } else if (productFamily == "Greeting Card") { colors = document.estiForm.colors.value; if (document.estiForm.greetingCardSize && document.estiForm.greetingCardSize.value=="4.25 x 6") { height = 8.5; width = 6; si = (height * width); document.estiForm.height.value="8.5"; document.estiForm.width.value="6"; document.estiForm.finalHeight.value="4.25"; document.estiForm.finalWidth.value="6"; } else if (document.estiForm.greetingCardSize && document.estiForm.greetingCardSize.value=="5 x 7") { height = 10; width = 7; si = (height * width); document.estiForm.height.value="10"; document.estiForm.width.value="7"; document.estiForm.finalHeight.value="5"; document.estiForm.finalWidth.value="7"; } else if (document.estiForm.greetingCardSize && document.estiForm.greetingCardSize.value=="4 x 5.5") { height = 8; width = 5.5; si = (height * width); document.estiForm.height.value="8"; document.estiForm.width.value="5.5"; document.estiForm.finalHeight.value="4"; document.estiForm.finalWidth.value="5.5"; } else { height = document.estiForm.height.value; width = document.estiForm.width.value; si = (height * width); // for reorders, this is required since they have no greetingCardSize formfield } //alert("square inches = " + si + " height: " + document.estiForm.height.value + " width: " + document.estiForm.width.value + "\n final height: " + document.estiForm.finalHeight.value + " final width: " + document.estiForm.finalWidth.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("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"; } } 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() + calcEyelets() + calcPerforating() + calcScoring() + calcFolding() + calcProof(si) + calcHandling(tsi)); nexpress_tp_no_rush = (calcPaper(tsi, si, "pages") + calcNexPress(document.estiForm.realquant.value, si, "pages") + calcDrilling() + calcEyelets() + calcPerforating() + calcScoring() + calcFolding() + calcNexPressProof(si) + calcHandling(tsi)); //alert(calcPaper(tsi, si, "pages") + "\n" + calcNexPress(document.estiForm.realquant.value, si, "pages") + "\n" + calcDrilling() + "\n" + calcEyelets() + "\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)); //add rounded corners charge if (document.estiForm.round_corners && document.estiForm.round_corners.value == "yes") { if (document.estiForm.productFamily && (document.estiForm.productFamily.value == "HangTag" || document.estiForm.productFamily.value == "Bookmark") ) { if (document.estiForm.realquant.value <= 250) { roundCorners = 25; } else if (document.estiForm.realquant.value > 250 && document.estiForm.realquant.value < 2500) { roundCorners = (document.estiForm.realquant.value * .1); } else if (document.estiForm.realquant.value >= 2500 && document.estiForm.realquant.value < 5000) { roundCorners = (document.estiForm.realquant.value * .08); } else if (document.estiForm.realquant.value >= 5000) { roundCorners = (document.estiForm.realquant.value * .06); } nexpress_tp = nexpress_tp + roundCorners; tp = tp + roundCorners; } else { roundCorners = (25 + (((document.estiForm.realquant.value) - 250) * .03)); nexpress_tp = nexpress_tp + roundCorners; tp = tp + roundCorners; } } //add shapeCut charge if (document.estiForm.shapeCut && document.estiForm.shapeCut.value == "yes"){ if (document.estiForm.realquant.value <= 250) { shapeCutCharge = 25; } else if (document.estiForm.realquant.value > 250 && document.estiForm.realquant.value < 2500) { shapeCutCharge = (document.estiForm.realquant.value * .1); } else if (document.estiForm.realquant.value >= 2500 && document.estiForm.realquant.value < 5000) { shapeCutCharge = (document.estiForm.realquant.value * .08); } else if (document.estiForm.realquant.value >= 5000) { shapeCutCharge = (document.estiForm.realquant.value * .06); } tp = (tp + shapeCutCharge); nexpress_tp = (nexpress_tp + shapeCutCharge); } //discounted pricing for postcards, 3/24/09 - BV if (document.estiForm.productFamily.value == "Card" || document.estiForm.productFamily.value == "w2pCard") { // note: height and width are "flipped" on w2p cards, thus the convoluted logic - BV if ((height == 6 && (width == 4.25 || width == 4)) || height == 4.25) { if (quantity <= 500) { tp = (tp - (tp * .1)); nexpress_tp = (nexpress_tp - (nexpress_tp * .1)); } else if (quantity > 10000) { tp = (tp - (tp * .15)); nexpress_tp = (nexpress_tp - (nexpress_tp * .15)); } else { tp = (tp - (tp * .25)); nexpress_tp = (nexpress_tp - (nexpress_tp * .25)); } } if (height == 7 || height == 5) { if (quantity <= 500 || (quantity > 10000 && quantity <= 25000)) { tp = (tp - (tp * .1)); nexpress_tp = (nexpress_tp - (nexpress_tp * .1)); } else if (quantity > 25000) { tp = (tp - (tp * .15)); nexpress_tp = (nexpress_tp - (nexpress_tp * .15)); } else { tp = (tp - (tp * .25)); nexpress_tp = (nexpress_tp - (nexpress_tp * .25)); } } if (height == 8.5 || height == 9 || (height == 6 && width == 9)) { if (quantity <= 500) { tp = (tp - (tp * .1)); nexpress_tp = (nexpress_tp - (nexpress_tp * .1)); } else if (quantity > 500 && quantity <= 1000) { tp = (tp - (tp * .15)); nexpress_tp = (nexpress_tp - (nexpress_tp * .2)); } else if (quantity >= 9000 && quantity <= 10000) { tp = (tp - (tp * .2)); nexpress_tp = (nexpress_tp - (nexpress_tp * .2)); } else if (quantity > 1000 && quantity < 2500) { tp = (tp - (tp * .33)); nexpress_tp = (nexpress_tp - (nexpress_tp * .33)); } else if (quantity >= 2500 && quantity < 5500) { tp = (tp - (tp * .36)); nexpress_tp = (nexpress_tp - (nexpress_tp * .36)); } else if (quantity >= 5500 && quantity <= 7000) { tp = (tp - (tp * .33)); nexpress_tp = (nexpress_tp - (nexpress_tp * .33)); } else if (quantity > 7000 && quantity < 9000) { tp = (tp - (tp * .28)); nexpress_tp = (nexpress_tp - (nexpress_tp * .28)); } else if (quantity > 10000 && quantity <= 15000) { tp = (tp - (tp * .05)); nexpress_tp = (nexpress_tp - (nexpress_tp * .05)); } } if (height == 11) { if (quantity >= 500 && quantity < 1000) { tp = (tp - (tp * .1)); nexpress_tp = (nexpress_tp - (nexpress_tp * .2)); } else if (quantity == 1000) { tp = (tp - (tp * .25)); nexpress_tp = (nexpress_tp - (nexpress_tp * .25)); } else if (quantity > 1000 && quantity < 3000) { tp = (tp - (tp * .3)); nexpress_tp = (nexpress_tp - (nexpress_tp * .3)); } else if (quantity >= 3000 && quantity < 4000) { tp = (tp - (tp * .25)); nexpress_tp = (nexpress_tp - (nexpress_tp * .25)); } else if (quantity >= 4000 && quantity < 5000) { tp = (tp - (tp * .17)); nexpress_tp = (nexpress_tp - (nexpress_tp * .17)); } else if (quantity >= 5000 && quantity < 6000) { tp = (tp - (tp * .12)); nexpress_tp = (nexpress_tp - (nexpress_tp * .12)); } else if (quantity >= 6000 && quantity < 7000) { tp = (tp - (tp * .07)); nexpress_tp = (nexpress_tp - (nexpress_tp * .07)); } else if (quantity >= 7000 && quantity < 8000) { tp = (tp - (tp * .03)); nexpress_tp = (nexpress_tp - (nexpress_tp * .03)); } else if (quantity >= 9000 && quantity < 10000) { tp = (tp + (tp * .08)); nexpress_tp = (nexpress_tp + (nexpress_tp * .08)); } else if (quantity >= 10000 && quantity < 11000) { tp = (tp + (tp * .13)); nexpress_tp = (nexpress_tp + (nexpress_tp * .13)); } else if (quantity >= 11000 && quantity < 12000) { tp = (tp + (tp * .14)); nexpress_tp = (nexpress_tp + (nexpress_tp * .14)); } else if (quantity >= 12000 && quantity < 13000) { tp = (tp + (tp * .15)); nexpress_tp = (nexpress_tp + (nexpress_tp * .15)); } else if (quantity >= 13000 && quantity < 14000) { tp = (tp + (tp * .16)); nexpress_tp = (nexpress_tp + (nexpress_tp * .16)); } else if (quantity >= 14000 && quantity < 15000) { tp = (tp + (tp * .17)); nexpress_tp = (nexpress_tp + (nexpress_tp * .17)); } else if (quantity >= 15000 && quantity < 20000) { tp = (tp + (tp * .2)); nexpress_tp = (nexpress_tp + (nexpress_tp * .2)); } else if (quantity >= 20000 && quantity <= 25000) { tp = (tp + (tp * .22)); nexpress_tp = (nexpress_tp + (nexpress_tp * .22)); } else if (quantity > 25000) { tp = (tp + (tp * .1)); nexpress_tp = (nexpress_tp + (nexpress_tp * .1)); } } } if (nexpress_tp < 65) nexpress_tp = 65; //ADD BLANK ENVELOPES tp = (tp + calcBlankEnvelopes()); nexpress_tp = (nexpress_tp + calcBlankEnvelopes()); //ADD BLACK ENVELOPES tp = (tp + calcKonlyEnvelopes()); nexpress_tp = (nexpress_tp + calcKonlyEnvelopes()); //alert(nexpress_tp); //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()); //ADD BLANK LETTERHEAD FOR STATIONERY PRODUCTS if (document.estiForm.stationeryLetterheadBlank && document.estiForm.stationeryLetterheadBlank.selectedIndex != 0){ tp += (document.estiForm.stationeryLetterheadBlank.value / 500) * 20; nexpress_tp += (document.estiForm.stationeryLetterheadBlank.value / 500) * 20; } //ADD BLANK BOXES FOR GREETING CARDS if (document.estiForm.greetingCardBoxes && document.estiForm.greetingCardBoxes != null && document.estiForm.greetingCardBoxes.value != "0") { tp = (tp + (document.estiForm.greetingCardBoxes.value * .95)); nexpress_tp = (nexpress_tp + (document.estiForm.greetingCardBoxes.value * .95)); } if (document.estiForm.paper.value == "20pt_kraftboard") { //plus 20% for kraft board tp = (tp + (tp * .2)); nexpress_tp = (nexpress_tp + (nexpress_tp * .2)); } //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 <= 216 && height <= 18 && width <= 18) { 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 if (document.estiForm.productFamily.value == "Brochure" || document.estiForm.productFamily.value == "Sellsheet") { var printDiscount = (nexpress_tp * .1); nexpress_tp = (nexpress_tp - printDiscount); var printFullPrice = (nexpress_tp + printDiscount); updateText("myPrintDiscount", formatCurrency(printDiscount)); updateText("myPrintFullPrice", formatCurrency(printFullPrice)); } var printTotal = nexpress_tp; if (document.estiForm.purchMailListCost && document.estiForm.purchMailListCost.value != '') { var grandTotal = (nexpress_tp + Math.round(totalMailingCost) + Math.round(document.estiForm.purchMailListCost.value)); } else { var grandTotal = (nexpress_tp + Math.round(totalMailingCost)); } updateText("myMailCost", formatCurrency2(totalMailingCost)); updateText("myPrintCost", formatCurrency2(nexpress_tp)); updateText("myTp", formatCurrency2(grandTotal)); updateText("myTp2", 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 if (document.estiForm.purchMailListCost && document.estiForm.purchMailListCost.value != '') { if (document.estiForm.productFamily.value == "Brochure" || document.estiForm.productFamily.value == "Sellsheet") { var printDiscount = (nexpress_tp * .1); nexpress_tp = (nexpress_tp - printDiscount); var printFullPrice = (nexpress_tp + printDiscount); updateText("myPrintDiscount", formatCurrency(printDiscount)); updateText("myPrintFullPrice", formatCurrency(printFullPrice)); } var grandTotal = (nexpress_tp + Math.round(document.estiForm.purchMailListCost.value)); //alert("nexpress_tp:" + nexpress_tp + "\n" + "mailList:" + Math.round(document.estiForm.purchMailListCost.value) + "\n" + "grandTotal:" + grandTotal); updateText("myPrintCost", formatCurrency2(nexpress_tp)); updateText("myTp", formatCurrency2(grandTotal)); updateText("myTp2", 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 if (document.estiForm.productFamily.value == "Brochure" || document.estiForm.productFamily.value == "Sellsheet") { var printDiscount = (nexpress_tp * .1); nexpress_tp = (nexpress_tp - printDiscount); var printFullPrice = (nexpress_tp + printDiscount); updateText("myPrintDiscount", formatCurrency(printDiscount)); updateText("myPrintFullPrice", formatCurrency(printFullPrice)); } var printTotal = nexpress_tp; var grandTotal = nexpress_tp; updateText("myPrintCost", formatCurrency2(nexpress_tp)); updateText("myMailCost", formatCurrency2(0)); updateText("myTp", formatCurrency2(grandTotal)); updateText("myTp2", 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 if (document.estiForm.productFamily.value == "Brochure" || document.estiForm.productFamily.value == "Sellsheet") { var printDiscount = (tp * .1); tp = (tp - printDiscount); var printFullPrice = (tp + printDiscount); updateText("myPrintDiscount", formatCurrency(printDiscount)); updateText("myPrintFullPrice", formatCurrency(printFullPrice)); } if (document.estiForm.purchMailListCost && document.estiForm.purchMailListCost.value != '') { var grandTotal = (tp + Math.round(totalMailingCost) + Math.round(document.estiForm.purchMailListCost.value)); } else { var grandTotal = (tp + Math.round(totalMailingCost)); } updateText("myPrintCost", formatCurrency(tp)); updateText("myTp", formatCurrency(grandTotal)); updateText("myTp2", 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 if (document.estiForm.purchMailListCost && document.estiForm.purchMailListCost.value != '') { if (document.estiForm.productFamily.value == "Brochure" || document.estiForm.productFamily.value == "Sellsheet") { var printDiscount = (tp * .1); tp = (tp - printDiscount); var printFullPrice = (tp + printDiscount); updateText("myPrintDiscount", formatCurrency(printDiscount)); updateText("myPrintFullPrice", formatCurrency(printFullPrice)); } var grandTotal = (tp + Math.round(document.estiForm.purchMailListCost.value)); updateText("myPrintCost", formatCurrency(tp)); updateText("myTp", formatCurrency(grandTotal)); updateText("myTp2", 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 if (document.estiForm.productFamily.value == "Brochure" || document.estiForm.productFamily.value == "Sellsheet") { var printDiscount = (tp * .1); tp = (tp - printDiscount); var printFullPrice = (tp + printDiscount); updateText("myPrintDiscount", formatCurrency(printDiscount)); updateText("myPrintFullPrice", formatCurrency(printFullPrice)); } var printTotal = tp; var grandTotal = tp; updateText("myPrintCost", formatCurrency(tp)); updateText("myMailCost", formatCurrency2(0)); updateText("myTp", formatCurrency(grandTotal)); updateText("myTp2", 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 + "\n74 Total Price: " + tp + "\nNP Total Price: " + nexpress_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.productFamily && document.estiForm.productFamily.value != "Greeting Card") { if (document.estiForm.blankEnvelopes && document.estiForm.blankEnvelopes.options && document.estiForm.blankEnvelopesSize.options && 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) * 28); else if (envSize == "A-7") document.estiForm.blankEnvCost.value = ( (env/250) * 35); else if (envSize == "A-2") document.estiForm.blankEnvCost.value = ( (env/250) * 25); if (document.estiForm.blankEnvCost.value && document.estiForm.blankEnvCost.value != "") { return parseInt(document.estiForm.blankEnvCost.value); } else return 0; } else if (document.estiForm.blankEnvelopes && document.estiForm.blankEnvelopes.value != "no" && document.estiForm.blankEnvelopesSize.value != "") { var env = document.estiForm.blankEnvelopes.value; var envSize = document.estiForm.blankEnvelopesSize.value; if (envSize == "A-6") document.estiForm.blankEnvCost.value = ( (env/250) * 28); else if (envSize == "A-7") document.estiForm.blankEnvCost.value = ( (env/250) * 35); else if (envSize == "A-2") document.estiForm.blankEnvCost.value = ( (env/250) * 25); if (document.estiForm.blankEnvCost.value && document.estiForm.blankEnvCost.value != "") return parseInt(document.estiForm.blankEnvCost.value); else return 0; } else { return 0; } } else if (document.estiForm.productFamily && document.estiForm.productFamily.value == "Greeting Card") { if (document.estiForm.greetingCardEnvelopes.options[document.estiForm.greetingCardEnvelopes.selectedIndex].value == "Blank") { var envQuant = (Math.ceil(document.estiForm.quantity.value / 25) * 25); document.estiForm.blankEnvelopes.value = envQuant; if (document.estiForm.greetingCardSize.value == "4.25 x 6") { document.estiForm.blankEnvCost.value = ( (envQuant/250) * 28); return parseInt(document.estiForm.blankEnvCost.value); } else if (document.estiForm.greetingCardSize.value == "5 x 7") { document.estiForm.blankEnvCost.value = ( (envQuant/250) * 35); return parseInt(document.estiForm.blankEnvCost.value); } else if (document.estiForm.greetingCardSize.value == "4 x 5.5") { document.estiForm.blankEnvCost.value = ( (envQuant/250) * 25); return parseInt(document.estiForm.blankEnvCost.value); } } else { if (document.estiForm.greetingCardEnvelopes.options[document.estiForm.greetingCardEnvelopes.selectedIndex].value == "None") { document.estiForm.blankEnvelopesSize.value = "no"; } document.estiForm.blankEnvelopes.value = "no"; return 0; } } else { return 0; } } function calcKonlyEnvelopes() { if (document.estiForm.productFamily && document.estiForm.productFamily.value != "Greeting Card") { if (document.estiForm.konlyEnvelopes && document.estiForm.konlyEnvelopes.options && document.estiForm.konlyEnvelopes.options[document.estiForm.konlyEnvelopes.selectedIndex].value != "no" && document.estiForm.blankEnvelopesSize.options[document.estiForm.blankEnvelopesSize.selectedIndex].value != "") { var env = document.estiForm.konlyEnvelopes.options[document.estiForm.konlyEnvelopes.selectedIndex].value; var envSize = document.estiForm.blankEnvelopesSize.options[document.estiForm.blankEnvelopesSize.selectedIndex].value; //alert(env + " " + envSize); if (envSize == "A-2") //price per 1000 var envPerM = 43.12 if (envSize == "A-6") var envPerM = 50.99 if (envSize == "A-7") var envPerM = 65.96 if (env <= 500) //env Quant plus makeready envMR = (env * 1.4) else if (env <= 1000) envMR = (env * 1.2) else if (env <= 8000) envMR = (env * 1.1) else if (env <= 50000) envMR = (env * 1.05) var envPrice = ((((envMR / 1000) * envPerM) * 1.4) + 130) //envelope price plus dt, proof and plate if (envMR <= 700) // time on press = no. per hour times 78 var pressHours = (envMR / 1400) * 78 else if (envMR <= 1200) var pressHours = (envMR / 1600) * 78 else if (envMR <= 5500) var pressHours = (envMR / 2200) * 78 else var pressHours = (envMR / 2500) * 78 document.estiForm.konlyEnvCost.value = (envPrice + pressHours); return parseInt(document.estiForm.konlyEnvCost.value); } else { return 0; } } else if (document.estiForm.productFamily && document.estiForm.productFamily.value == "Greeting Card" && (document.estiForm.greetingCardEnvelopes.options && document.estiForm.greetingCardEnvelopes.options[document.estiForm.greetingCardEnvelopes.selectedIndex].value == "Printed - Return Address, Black Ink")) { var env = (Math.ceil(document.estiForm.quantity.value / 25) * 25); if (document.estiForm.greetingCardSize.value == "4.25 x 6") { var envSize = "A-6"; } if (document.estiForm.greetingCardSize.value == "5 x 7") { var envSize = "A-7"; } if (document.estiForm.greetingCardSize.value == "4 x 5.5") { var envSize = "A-2"; } if (envSize == "A-2") //price per 1000 var envPerM = 43.12 if (envSize == "A-6") var envPerM = 50.99 if (envSize == "A-7") var envPerM = 65.96 if (env <= 500) //env Quant plus makeready envMR = (env * 1.4) else if (env <= 1000) envMR = (env * 1.2) else if (env <= 8000) envMR = (env * 1.1) else if (env <= 50000) envMR = (env * 1.05) var envPrice = ((((envMR / 1000) * envPerM) * 1.4) + 130) //envelope price plus markup, dt, proof and plate if (envMR <= 700) // time on press = no. per hour times 78 var pressHours = (envMR / 1400) * 78 else if (envMR <= 1200) var pressHours = (envMR / 1600) * 78 else if (envMR <= 5500) var pressHours = (envMR / 2200) * 78 else var pressHours = (envMR / 2500) * 78 document.estiForm.konlyEnvelopes.value = env; document.estiForm.konlyEnvCost.value = (envPrice + pressHours); /* alert("Envelope Printing Costs:"+ "\nPrice per 1000: " + envPerM + "\nTotal envelopes without makeready: " + env + "\nTotal envelopes incl. makeready: " + envMR + "\nEnvelopes Price (incl. dt & plate): " + envPrice + "\nPress costs ($78/hr): " + pressHours + "\nTotal: " + document.estiForm.konlyEnvCost.value); */ return parseInt(document.estiForm.konlyEnvCost.value); } else { if (document.estiForm.greetingCardEnvelopes.options[document.estiForm.greetingCardEnvelopes.selectedIndex].value == "None") { document.estiForm.blankEnvelopesSize.value = "no"; } document.estiForm.konlyEnvelopes.value = "no"; return 0; } } function calcW2pBlankEnvelopes() { if (document.estiForm.w2pEnvelopesBlank && document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value != "0") { var env = document.estiForm.w2pEnvelopesBlank.options[document.estiForm.w2pEnvelopesBlank.selectedIndex].value; //alert(env); if (document.estiForm.finalWidth.value == "7") { document.estiForm.w2pBlankEnvCost.value = ( (env/250) * 35); } else if (document.estiForm.finalWidth.value == "6") { //alert("adding a-6 env") document.estiForm.w2pBlankEnvCost.value = ( (env/250) * 28); } 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") { var env = document.estiForm.w2pEnvelopesPrint.options[document.estiForm.w2pEnvelopesPrint.selectedIndex].value; if (document.estiForm.finalWidth.value == "6") { var envSize = "A-6"; } if (document.estiForm.finalWidth.value == "7") { var envSize = "A-7"; } if (envSize == "A-6") var envPerM = 50.99 if (envSize == "A-7") var envPerM = 65.96 if (env <= 500) //env Quant plus makeready envMR = (env * 1.4) else if (env <= 1000) envMR = (env * 1.2) else if (env <= 8000) envMR = (env * 1.1) else if (env <= 50000) envMR = (env * 1.05) var envPrice = ((((envMR / 1000) * envPerM) * 1.4) + 130) //envelope price plus markup, dt, proof and plate if (envMR <= 700) // time on press = no. per hour times 78 var pressHours = (envMR / 1400) * 78 else if (envMR <= 1200) var pressHours = (envMR / 1600) * 78 else if (envMR <= 5500) var pressHours = (envMR / 2200) * 78 else var pressHours = (envMR / 2500) * 78 document.estiForm.w2pPrintedEnvCost.value = (envPrice + pressHours); 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") || (document.estiForm.konlyEnvelopes && document.estiForm.konlyEnvelopes.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) { var finalHeight = document.estiForm.finalHeight.value; var finalWidth = document.estiForm.finalWidth.value; if ((productFamily == 'Card' || productFamily == 'w2pCard') && document.estiForm.blankEnvelopes.value == "no" && document.estiForm.konlyEnvelopes.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.23); } 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.382); } } 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.27); } } // 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") { 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.169); } } if (mailRate == "stamps") { if (si >= 17.5 && si <= 25.5) { // sizes between 3.5 x 5 --> 4.25 x 6 var postage = (mailQuant * 0.33); //.28 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.49); //.44 for postage + .05 for applying stamps } } } else { //the non-postcard stuff if (document.estiForm.fold && document.estiForm.fold.value != "no" && document.estiForm.fold.value != "SignatureFold") { // have to "switch" height and width on some folded pieces for proper postage calculations! - BV, 010809 var finalHeight = document.estiForm.finalWidth.value; var finalWidth = document.estiForm.finalHeight.value; //alert("switching height & width: \nfinal height :" + finalHeight + "\nfinal width: " +finalWidth); } if (mailRate == "firstClass") { if (si >= 17.5 && si <= 70.4375 && finalWidth <= 6.125 && finalHeight <= 11.5) { // sizes between 3.5 x 5 --> 6.125 x 11.5 if(weightPerUnit <= 1) { var postage = (mailQuant * 0.382); } else if(weightPerUnit <= 2) { var postage = (mailQuant * 0.507); } else if(weightPerUnit <= 3.3) { var postage = (mailQuant * 0.632); } else { return null; } } else if ((si > 70.4375 && si <= 180) || (finalWidth > 6.125) || (finalHeight > 11.5)) { // sizes between 6.125 x 11.5 --> 12 x 15 if(weightPerUnit <= 1) { var postage = (mailQuant * 0.725); } else if(weightPerUnit <= 2) { var postage = (mailQuant * 0.895); } else if(weightPerUnit <= 3.3) { var postage = (mailQuant * 1.065); } else { return null; } } } if (mailRate == "bulkMail") { if(weightPerUnit <= 3.3) { if (si >= 17.5 && si <= 70.4375 && finalWidth <= 6.125 && finalHeight <= 11.5) { // sizes between 3.5 x 5 --> 6.125 x 11.5 var postage = (mailQuant * 0.270); } else if ((si > 70.4375 && si <= 180) || (finalWidth > 6.125) || (finalHeight > 11.5)) { // sizes between 6.125 x 11.5 --> 12 x 15 var postage = (mailQuant * 0.496); } } else if(weightPerUnit > 3.3) { if (si >= 17.5 && si <= 70.4375 && finalWidth <= 6.125 && finalHeight <= 11.5) { // sizes between 3.5 x 5 --> 6.125 x 11.5 var postage = (mailQuant * (0.725 + 0.120)); } else if ((si > 70.4375 && si <= 180) || (finalWidth > 6.125) || (finalHeight > 11.5)) { // sizes between 6.125 x 11.5 --> 12 x 15 var postage = (mailQuant * (0.725 + 0.346)); } } } if (mailRate == "nonProfit") { if(weightPerUnit <= 3.3) { if (si >= 17.5 && si <= 70.4375 && finalWidth <= 6.125 && finalHeight <= 11.5) { // sizes between 3.5 x 5 --> 6.125 x 11.5 var postage = (mailQuant * 0.169); } else if ((si > 70.4375 && si <= 180) || (finalWidth > 6.125) || (finalHeight > 11.5)) { // sizes between 6.125 x 11.5 --> 12 x 15 var postage = (mailQuant * 0.362); } } else if (weightPerUnit > 3.3) { if (si >= 17.5 && si <= 70.4375 && finalWidth <= 6.125 && finalHeight <= 11.5) { // sizes between 3.5 x 5 --> 6.125 x 11.5 var postage = (mailQuant * (0.628 + .039)); } else if ((si > 70.4375 && si <= 180) || (finalWidth > 6.125) || (finalHeight > 11.5)) { // sizes between 6.125 x 11.5 --> 12 x 15 var postage = (mailQuant * (0.628 + 0.232)); } } } if (mailRate == "stamps") { if (si >= 17.5 && si <= 70.4375 && finalWidth <= 6.125 && finalHeight <= 11.5) { // sizes between 3.5 x 5 --> 6.125 x 11.5 if(weightPerUnit <= 1) { var postage = (mailQuant * 0.49); // postage plus 5 cents for adding stamp } else if(weightPerUnit <= 2) { var postage = (mailQuant * 0.66); } else if(weightPerUnit <= 3.3) { var postage = (mailQuant * 0.83); } else { return null; } } else if ((si > 70.4375 && si <= 180) || (finalWidth > 6.125) || (finalHeight > 11.5)) { // sizes between 6.125 x 11.5 --> 12 x 15 if(weightPerUnit <= 1) { var postage = (mailQuant * 0.93); // postage plus 5 cents for adding stamp } else if(weightPerUnit <= 2) { var postage = (mailQuant * 1.10); } else if(weightPerUnit <= 3.3) { var postage = (mailQuant * 1.27); } 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 calculate_folder(mode) { // this is also used for doorhangers and CD/DVD sleeves) - BV // 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 if (document.estiForm.productFamily.value == "Folder" || document.estiForm.productFamily.value.indexOf("w2pPresFolder") != -1) { si = (18 * 24); // starting flat sheet size in square inches } if (document.estiForm.productFamily.value == "Folder 4x9") { si = (18 * 12); // starting flat sheet size in square inches, this will run 2-up } if (document.estiForm.productFamily.value == "3 Panel Folder") { si = (28 * 22); // starting flat sheet size in square inches, this will run 1-up } if (document.estiForm.productFamily.value=="CD Sleeve 5x5") { si = (9 * 12); // starting flat sheet size in square inches, this will run 4-up } if (document.estiForm.productFamily.value=="Doorhanger") { si = (5 * 10); // starting flat sheet size in square inches, these will run 8-up - BV if (document.estiForm.doorhangerSize.options && document.estiForm.doorhangerSize.options[document.estiForm.doorhangerSize.selectedIndex].value == "4 x 9") { document.estiForm.height.value = 9; document.estiForm.width.value = 4; } if (document.estiForm.doorhangerSize.options && document.estiForm.doorhangerSize.options[document.estiForm.doorhangerSize.selectedIndex].value == "4.25 x 11") { document.estiForm.height.value = 11; document.estiForm.width.value = 4.25; } } if (document.estiForm.productFamily.value=="Doorhanger") { //doorhangers (for now) use hard-coded pricing - BV 6/26/09 if (document.estiForm.quantity.value == 100){ tp = 345.01 } if (document.estiForm.quantity.value == 250){ tp = 350.31 } if (document.estiForm.quantity.value == 500){ tp = 384.13 } if (document.estiForm.quantity.value == 750){ tp = 417.96 } if (document.estiForm.quantity.value == 1000){ tp = 476.78 } if (document.estiForm.quantity.value == 1250){ tp = 500.61 } if (document.estiForm.quantity.value == 1500){ tp = 519.43 } if (document.estiForm.quantity.value == 1750){ tp = 543.26 } if (document.estiForm.quantity.value == 2000){ tp = 562.08 } if (document.estiForm.quantity.value == 2500){ tp = 604.73 } if (document.estiForm.quantity.value == 3000){ tp = 647.38 } if (document.estiForm.quantity.value == 3500){ tp = 690.03 } if (document.estiForm.quantity.value == 4000){ tp = 732.68 } if (document.estiForm.quantity.value == 4500){ tp = 800.33 } if (document.estiForm.quantity.value == 5000){ tp = 867.98 } if (document.estiForm.quantity.value == 6000){ tp = 953.28 } if (document.estiForm.quantity.value == 7000){ tp = 1038.58 } if (document.estiForm.quantity.value == 7500){ tp = 1081.23 } if (document.estiForm.quantity.value == 8000){ tp = 1123.88 } if (document.estiForm.quantity.value == 9000){ tp = 1259.18 } if (document.estiForm.quantity.value == 10000){ tp = 1344.48 } if (document.estiForm.quantity.value == 12500){ tp = 2083.73 } if (document.estiForm.quantity.value == 15000){ tp = 1870.98 } if (document.estiForm.quantity.value == 20000){ tp = 2397.48 } if (document.estiForm.quantity.value == 25000){ tp = 2923.98 } if (document.estiForm.quantity.value == 30000){ tp = 3406.48 } tp_no_rush = (tp + calcProof(si)); //total price with rush charges tp = (tp_no_rush + calcRush(tp_no_rush, si)); //finalSheets = ((si * document.estiForm.realquant.value)/8); // total sheets needed without makeready... div. by 8 so that doorhangers will NOT price W&T (calculates as 18x24 sheet) -BV tsi = (document.estiForm.realquant.value * 50); // sheets needed plus 200 sheets plus 3% for extra makeready } else { finalSheets = (si * document.estiForm.realquant.value); // total sheets needed without makeready tsi = ((finalSheets * 1.05) + 86400); // sheets needed plus 200 18x24 sheets plus 5% for extra makeready //total price without rush charges tp_no_rush = (calcPaper(tsi, si, "pages") + calcPress(document.estiForm.realquant.value, si, "pages") + 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)); if (document.estiForm.paper.value == "20pt_kraftboard") { //plus 5% for kraft board tp = (tp + (tp * .05)); } //add makeready from below tp = (tp + calcFolderMakeReady()); document.estiForm.si.value=si; document.estiForm.tsi.value=tsi; } //Grant's discounts, 08/12/09 - BV if (document.estiForm.productFamily.value == "Folder" || document.estiForm.productFamily.value.indexOf("w2pPresFolder") != -1) { if (quantity <= 250) tp = (tp - 200) else if (quantity <= 500) tp = (tp - 175) else if (quantity <= 750) tp = (tp - 125) else if (quantity <= 1500) tp = (tp - 150) else if (quantity <= 2000) tp = (tp - 225) else if (quantity <= 2500) tp = (tp - 300) else if (quantity <= 3000) tp = (tp - 350) else if (quantity <= 3500) tp = (tp - 425) else if (quantity <= 4000) tp = (tp - 525) else if (quantity <= 4500) tp = (tp - 600) else if (quantity <= 5000) tp = (tp - 700) else if (quantity <= 7000) tp = (tp - 800) else if (quantity <= 8000) tp = (tp - 850) else if (quantity <= 9000) tp = (tp - 900) else if (quantity <= 10000) tp = (tp - 950) else if (quantity <= 15000) tp = (tp - 1000) else if (quantity <= 20000) tp = (tp - 1250) else if (quantity <= 25000) tp = (tp - 1500) else if (quantity <= 30000) tp = (tp - 2000) } //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)); if (document.estiForm.productFamily.value == "Folder" || document.estiForm.productFamily.value.indexOf("w2pPresFolder") != -1 || document.estiForm.productFamily.value == "Folder 4x9" || document.estiForm.productFamily.value == "3 Panel Folder") { tp = (tp + (tp * .175)); var printDiscount = (tp * .15); tp = (tp - printDiscount); var printFullPrice = (tp + printDiscount); updateText("myPrintDiscount", formatCurrency(printDiscount)); updateText("myPrintFullPrice", formatCurrency(printFullPrice)); } var printTotal = tp; var grandTotal = tp; updateText("myTp", formatCurrency(grandTotal)); updateText("myTp2", 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 + "\n74 Total Price: " + tp + "\nFolding: " + calcFolding() + "\npaper: " + calcPaper(tsi, si, "pages") + "\n" + "\ndrilling: " + calcDrilling() + "\n" + "\nperfing: " + calcPerforating() + "\n" + "\nscore: " + calcScoring() + "\n" + "\nfolding: " + calcFolding() + "\n" + "\nproof: " + calcNexPressProof(si) + "\n" + "\nhandling: " + calcHandling(tsi) + "\n"); */ } function calcFolderMakeReady() { if (document.estiForm.productFamily.value == "Folder" || document.estiForm.productFamily.value.indexOf("w2pPresFolder") != -1 || document.estiForm.productFamily.value == "3 Panel Folder") { makereadySheets = ((quantity * 1.05) + 200); //makeready sheets: total plus 200 plus 5% var diecutting = (50 + ((makereadySheets/2000) * 100) + (quantity * .015)); // Diecutting: $50 flat-fee, plus 2k per hour at $100/hr, plus 1.5 cents per to punch out } if (document.estiForm.productFamily.value == "Folder 4x9" || document.estiForm.productFamily.value == "CD Sleeve 5x5") { makereadySheets = (((quantity * .5) * 1.05) + 200); //makeready sheets: total (2-up) plus 200 plus 5% var diecutting = (50 + ((makereadySheets/2000) * 100) + (quantity * .025)); // Diecutting: $50 flat-fee, plus 2k per hour at $100/hr, plus 2.5 cents per to punch out } if (document.estiForm.productFamily.value == "Doorhanger") { //makereadySheets = (((quantity * .125) * 1.03) + 200); //makeready sheets: total (2-up) plus 200 plus 3% //var diecutting = (100 + ((makereadySheets/2000) * 100) + (quantity * .025)); // Diecutting: $100 flat-fee, plus 2k per hour at $100/hr, plus 2.5 cents per to punch out ("inner weed") } // Next, glueing and folding: $75 flat, plus 5k per hour at $100/hr, if (document.estiForm.productFamily.value != "Doorhanger") { var glueing = (75 + ((makereadySheets/5000) * 100)); return (glueing + diecutting); } // Doorhanger "Post-trim" work //if (document.estiForm.productFamily.value == "Doorhanger") { //var cuts = ((makereadySheets/500)*12) //var posttrim = (25 + ((cuts/60) * 75)); //alert ("Post-trim and diecutting = " + (posttrim + diecutting)); //return (posttrim + diecutting); //} } function getFolderFactor(quantity) { var folder_markup = 1.3; return ((0.0977 * quantity) + 140) * folder_markup; } 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.estiForm.fold.options[document.estiForm.fold.selectedIndex].value != "no") { if (document.estiForm.height.options[document.estiForm.height.selectedIndex].value <= parseFloat("5.5") || document.estiForm.width.options[document.estiForm.width.selectedIndex].value <= parseFloat("5.5")) { alert("Folding on Custom Sizes is allowed only on pieces that are at least 6 inches long on each dimension. If you need folding on a smaller piece, please request a 'Custom Quote' from the menu to the left."); document.estiForm.fold.selectedIndex=0; } else if (document.estiForm.fold.options[document.estiForm.fold.selectedIndex].value == "HalfFold" || document.estiForm.fold.options[document.estiForm.fold.selectedIndex].value == "GateFold") { document.estiForm.finalHeight.value = roundAmount((document.estiForm.height.options[document.estiForm.height.selectedIndex].value / 2)); document.estiForm.finalWidth.value = document.estiForm.width.options[document.estiForm.width.selectedIndex].value; updateText("myFinalHeight", roundAmount((document.estiForm.height.options[document.estiForm.height.selectedIndex].value / 2))); updateText("myFinalWidth", document.estiForm.width.options[document.estiForm.width.selectedIndex].value); } else if (document.estiForm.fold.options[document.estiForm.fold.selectedIndex].value == "TriFold" || document.estiForm.fold.options[document.estiForm.fold.selectedIndex].value == "ZFold") { document.estiForm.finalHeight.value = roundAmount((document.estiForm.height.options[document.estiForm.height.selectedIndex].value / 3)); document.estiForm.finalWidth.value = document.estiForm.width.options[document.estiForm.width.selectedIndex].value; updateText("myFinalHeight", roundAmount((document.estiForm.height.options[document.estiForm.height.selectedIndex].value / 3))); updateText("myFinalWidth", document.estiForm.width.options[document.estiForm.width.selectedIndex].value); } else if (document.estiForm.fold.options[document.estiForm.fold.selectedIndex].value == "AccordianFold" || document.estiForm.fold.options[document.estiForm.fold.selectedIndex].value == "DoubleGateFold" || document.estiForm.fold.options[document.estiForm.fold.selectedIndex].value == "RollFold" || document.estiForm.fold.options[document.estiForm.fold.selectedIndex].value == "DoubleParallelFold") { document.estiForm.finalHeight.value = roundAmount((document.estiForm.height.options[document.estiForm.height.selectedIndex].value / 4)); document.estiForm.finalWidth.value = document.estiForm.width.options[document.estiForm.width.selectedIndex].value; updateText("myFinalHeight", roundAmount((document.estiForm.height.options[document.estiForm.height.selectedIndex].value / 4))); updateText("myFinalWidth", document.estiForm.width.options[document.estiForm.width.selectedIndex].value); } else if (document.estiForm.fold.options[document.estiForm.fold.selectedIndex].value == "SignatureFold") { document.estiForm.finalHeight.value = roundAmount((document.estiForm.height.options[document.estiForm.height.selectedIndex].value / 2)); document.estiForm.finalWidth.value = roundAmount((document.estiForm.width.options[document.estiForm.width.selectedIndex].value / 2)); updateText("myFinalHeight", roundAmount((document.estiForm.height.options[document.estiForm.height.selectedIndex].value / 2))); updateText("myFinalWidth", roundAmount((document.estiForm.width.options[document.estiForm.width.selectedIndex].value / 2))); } } else if (document.estiForm.multi && document.estiForm.productFamily != "DLCalendar" && document.estiForm.productFamily != "HouseCalendar") { document.estiForm.height.value = (document.estiForm.finalHeight.options[document.estiForm.finalHeight.selectedIndex].value); document.estiForm.width.value = (document.estiForm.finalWidth.options[document.estiForm.finalWidth.selectedIndex].value * 2); //updateText("finalHeight", roundAmount((document.estiForm.height.options[document.estiForm.height.selectedIndex].value / 2))); //updateText("finalWidth", roundAmount((document.estiForm.width.options[document.estiForm.width.selectedIndex].value / 2))); //alert(document.estiForm.width.value + " x " + document.estiForm.height.value); } else if (document.estiForm.productFamily.value.indexOf("Stationery") != -1) { document.estiForm.height.value = (3.5); document.estiForm.width.value = (2); } else { if (document.estiForm.height.options && document.estiForm.width.options) { document.estiForm.finalHeight.value = document.estiForm.height.options[document.estiForm.height.selectedIndex].value; document.estiForm.finalWidth.value = document.estiForm.width.options[document.estiForm.width.selectedIndex].value; updateText("myFinalHeight", document.estiForm.height.options[document.estiForm.height.selectedIndex].value); updateText("myFinalWidth", document.estiForm.width.options[document.estiForm.width.selectedIndex].value); } else { document.estiForm.finalHeight.value = document.estiForm.height.value; document.estiForm.finalWidth.value = document.estiForm.width.value; updateText("myFinalHeight", document.estiForm.height.value); updateText("myFinalWidth", document.estiForm.width.value); } } if (document.estiForm.mailing && document.estiForm.mailing.options[document.estiForm.mailing.selectedIndex].value != "no" && document.estiForm.mailQuant.value > 0) { checkFinalMailDependencies(document.estiForm.productFamily.value, document.estiForm.realquant.value, document.estiForm.mailQuant.value); } } function setHeightWidth(select_object) { if (select_object.options[select_object.selectedIndex].value=="24") { document.estiForm.height.value="6"; document.estiForm.width.value="4"; } if (select_object.options[select_object.selectedIndex].value=="25.5") { document.estiForm.height.value="6"; document.estiForm.width.value="4.25"; } if (select_object.options[select_object.selectedIndex].value=="35") { document.estiForm.height.value="7"; document.estiForm.width.value="5"; } if (select_object.options[select_object.selectedIndex].value=="40") { document.estiForm.height.value="8"; document.estiForm.width.value="5"; } if (select_object.options[select_object.selectedIndex].value=="46.75") { document.estiForm.height.value="8.5"; document.estiForm.width.value="5.5"; } if (select_object.options[select_object.selectedIndex].value=="51") { document.estiForm.height.value="8.5"; document.estiForm.width.value="6"; } if (select_object.options[select_object.selectedIndex].value=="54") { document.estiForm.height.value="9"; document.estiForm.width.value="6"; } if (select_object.options[select_object.selectedIndex].value=="66") { document.estiForm.height.value="11"; document.estiForm.width.value="6"; } if (select_object.options[select_object.selectedIndex].value=="70.4375") { document.estiForm.height.value="11.5"; document.estiForm.width.value="6.125"; } } function calcPaper(tsi, si, sheet_type) { if (sheet_type == "cover") { if (document.estiForm.coverPaper.options) { if (document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value) { type = "0"; } else { type = document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value; } } else { if (document.estiForm.coverPaper.value == document.estiForm.paper.value) { type = "0"; } else { type = document.estiForm.coverPaper.value; } } } else { if (document.estiForm.paper.options) // for doing estimate when option lists are present type = document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value; else if (document.estiForm.paper.value) type = document.estiForm.paper.value; } //price per square inch ppsi = getPaperFactor(si, type); paper = ((ppsi * tsi)); // add for paper overs...either 10% or 35 whichever is more if ( (paper / 10) > 35) { paper = (paper * 1.1); } else if (paper == 0) { paper = 0; } else { paper = (paper + 35); } if (sheet_type == "cover") { document.estiForm.coverPapercharge.value=formatCurrency(paper); } else { document.estiForm.papercharge.value=formatCurrency(paper); } return paper; } function getPaperFactor(si, type) { if (type == "0") { return 0; } if (type == "70_nl_rein_book") { return '0.000182328'; } if (type == "80_nl_rein_book") { return '0.000208368'; } if (type == "105_nl_rein_book") { return '0.00027312'; } if (type == "65_nl_rein_cover") { return '0.000308352'; } if (type == "80_nl_rein_cover") { return '0.000379968'; } if (type == "95_nl_rein_cover") { return '0.000451224'; } if (type == "88_nl_pvg_book") { return '0.000187404'; } if (type == "101_nl_pvg_book") { return '0.000214572'; } if (type == "89_nl_pvg_cover") { return '0.000345996'; } if (type == "111_nl_pvg_cover") { return '0.000431232'; } if (type == "24_nl_ew") { return '0.00025254'; } if (type == "80_nl_eb_book") { return '0.000332232'; } if (type == "80_nl_ec_cover") { return '0.000605832'; } if (type == "100_nl_ec_cover") { return '0.000756348'; } if (type == "70_mt_starliner") { return '0.00959'; } if (type == "60_kraft_starliner") { return '0.00959'; } if (type == "16pt_nl_rein_dblthick") { return '0.000451224'; } if (type == "20pt_kraftboard") { return '0.000451224'; } if (type == "18pt_renewal") { return '0.000751224'; } if (type == "24pt_C1S") { return '0.000751224'; } if (type == "60_nl_o_book") { return '0.0001362'; } if (type == "70_nl_o_book") { return '0.000161088'; } if (type == "80_nl_o_book") { return '0.00018216'; } if (type == "87_nl_sak_book") { return '0.000208368'; } if (type == "106_nl_sak_book") { return '0.00027312'; } if (type == "96_nl_sak_cover") { return '0.000379968'; } if (type == "100_book") { if (si <= 93.5) { // up to 8.5 x 11 return '0.000181'; } else if (si > 93.5 && si <= 119) { // bigger than 8.5 x 11 and up to 8.5 x 14 return '0.000139'; } else if (si > 119 && si <= 187) { // bigger than 8.5 x 14 and up to 11 x 17 return '0.000181'; } else if (si > 187 && si <= 374) { // bigger than 11 x 17 and up to 17 x 22 return '0.000182'; } else if (si > 374 && si <= 432) { // bigger than 17 x 22 and up to 18 x 24 return '0.000182'; } else if (si > 432 && si <= 616) { // bigger than 18 x 24 and up to 22 x 28 return '0.000144'; } } else if (type == "80_book") { if (si <= 93.5) { // up to 8.5 x 11 return '0.000145'; } else if (si > 93.5 && si <= 119) { // bigger than 8.5 x 11 and up to 8.5 x 14 return '0.000112'; } else if (si > 119 && si <= 187) { // bigger than 8.5 x 14 and up to 11 x 17 return '0.000145'; } else if (si > 187 && si <= 374) { // bigger than 11 x 17 and up to 17 x 22 return '0.000145'; } else if (si > 374 && si <= 432) { // bigger than 17 x 22 and up to 18 x 24 return '0.000145'; } else if (si > 432 && si <= 616) { // bigger than 18 x 24 and up to 22 x 28 return '0.000114'; } } else if (type == "100_cover") { if (si <= 93.5) { // up to 8.5 x 11 return '0.000355'; } else if (si > 93.5 && si <= 119) { // bigger than 8.5 x 11 and up to 8.5 x 14 return '0.000271'; } else if (si > 119 && si <= 187) { // bigger than 8.5 x 14 and up to 11 x 17 return '0.000354'; } else if (si > 187 && si <= 374) { // bigger than 11 x 17 and up to 17 x 22 return '0.000354'; } else if (si > 374 && si <= 432) { // bigger than 17 x 22 and up to 18 x 24 return '0.000354'; } else if (si > 432 && si <= 616) { // bigger than 18 x 24 and up to 22 x 28 return '0.000279'; } } else if (type == "80_cover") { if (si <= 7) { // 2 x 3.5 bus. cards and smaller return '0.000307'; } else if (si > 7 && si <= 93.5) { // bigger than 2 x 3.5 bus cards and up to 8.5 x 11 return '0.000283'; } else if (si > 93.5 && si <= 119) { // bigger than 8.5 x 11 and up to 8.5 x 14 return '0.000217'; } else if (si > 119 && si <= 187) { // bigger than 8.5 x 14 and up to 11 x 17 return '0.000283'; } else if (si > 187 && si <= 374) { // bigger than 11 x 17 and up to 17 x 22 return '0.000283'; } else if (si > 374 && si <= 432) { // bigger than 17 x 22 and up to 18 x 24 return '0.000283'; } else if (si > 432 && si <= 616) { // bigger than 18 x 24 and up to 22 x 28 return '0.000223'; } } else if (type == "12pt_cover") { if (si <= 24 ) { // 4 x 6 post cards and smaller return '0.0003873'; } else if (si > 24 && si <= 35) { // bigger than 4 x 6 post cards and up to 5 x 7 post cards return '0.0003873'; } else if (si > 35 && si <= 36) { // bigger than 5 x 7 post cards and up to 4 x 9 rack cards return '0.0003873'; } else if (si > 36 && si <= 54) { // bigger than 4 x 9 rack cards and up to 6 x 9 post cards return '0.0003873'; } else if (si > 54 && si <= 70) { // bigger than 6 x 9 post cards and up to 7 x 10 greeting cards return '0.0003873'; } else if (si > 70 && si <= 93.5) { // bigger than 7 x 10 greeting cards and up to 8.5 x 11 return '0.0003873'; } else if (si > 93.5 && si <= 119) { // bigger than 8.5 x 11 and up to 8.5 x 14 return '0.0003873'; } else if (si > 119 && si <= 187) { // bigger than 8.5 x 14 and up to 11 x 17 return '0.0003873'; } else if (si > 187 && si <= 374) { // bigger than 11 x 17 and up to 17 x 22 return '0.0003873'; } else if (si > 374 && si <= 432) { // bigger than 17 x 22 and up to 18 x 24 return '0.0003873'; } else if (si > 432 && si <= 616) { // bigger than 18 x 24 and up to 22 x 28 return '0.0003873'; } } else if (type == "12pt2_cover") { return '0.0005205'; } } function getPressFactor(quantity, si, page_type) { if (page_type == "4over4") { presscharges = get44Pricing(quantity, si); } if (page_type == "4over1") { presscharges = get41Pricing(quantity, si); } if (page_type == "4over0") { presscharges = get40Pricing(quantity, si); } if (page_type == "1over1") { presscharges = get11Pricing(quantity, si); } if (page_type == "NoCover") { if (document.estiForm.colors.value == "4over4"){ presscharges = 0; } if (document.estiForm.colors.value == "4over1"){ presscharges = 0; } if (document.estiForm.colors.value == "1over1"){ presscharges = 0; } } //if(page_type == "black_1pms") { //presscharges = getB1 if (document.estiForm.presscharge) { document.estiForm.presscharge.value=formatCurrency(presscharges); } return presscharges; } function getNexPressFactor(quantity, si, page_type) { if (page_type == "4over4") { nexpresscharges = get44NexPressPricing(quantity, si); } if (page_type == "4over1") { nexpresscharges = get41NexPressPricing(quantity, si); } if (page_type == "4over0") { nexpresscharges = get40NexPressPricing(quantity, si); } if (page_type == "1over1") { nexpresscharges = get11NexPressPricing(quantity, si); } if (page_type == "NoCover") { nexpresscharges = 0; } if (document.estiForm.nexpresscharge) { document.estiForm.nexpresscharge.value=formatCurrency(nexpresscharges); } return nexpresscharges; } function get44NexPressPricing(quantity, si) { /* 87.5 setup, 216/168 ratio of total vs. used sheet space $xx.xx / sheetsize using y = mx+b: b = 87.5 x = quantity m = si * 216/168 * .1/(12*18) */ if (si <= 7 && (document.estiForm.productFamily.value == "BusCard")) { //return (87.5 + (quantity * si * 216/168 * (.2/(12*18)) )); // 87.5 setup, 216/168 ratio of used vs. unused sheet space, 20¢ / sheetsize return (0 + (quantity * .14)); // Extremely simplified biz card pricing, 082407 BV } else if (si < 35) { if (quantity <= 1000) return (21 + (quantity * si * 216/168 * (.89/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (81 + (quantity * si * 216/168 * (.59/(12*18)) )); else return (163 + (quantity * si * 216/168 * (.4/(12*18)) )); } else if (si >= 35 && si < 40) { if (quantity <= 1000) return (74 + (quantity * si * 216/140 * (.76/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (217 + (quantity * si * 216/140 * (.27/(12*18)) )); else return (235 + (quantity * si * 216/140 * (.246/(12*18)) )); } else if (si >= 40 && si < 54) { if (quantity <= 1000) return (74 + (quantity * si * 216/160 * (.89/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (116 + (quantity * si * 216/160 * (.53/(12*18)) )); else return (75 + (quantity * si * 216/160 * (.576/(12*18)) )); } else if (si >= 54 && si < 66) { if (quantity <= 1000) return (56 + (quantity * si * 216/108 * (.57/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (251 + (quantity * si * 216/108 * (.255/(12*18)) )); else return (279 + (quantity * si * 216/108 * (.239/(12*18)) )); } else if (si >= 66 && si < 75) { if (quantity <= 1000) return (2 + (quantity * si * 216/132 * (.915/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (337 + (quantity * si * 216/132 * (.338/(12*18)) )); else return (373 + (quantity * si * 216/132 * (.316/(12*18)) )); } else if (si < 93.5) return (quantity * si * 1.5 * .0092593); else return (quantity * si * 1.25 * .0092593); } function get41NexPressPricing(quantity, si) { if (si <= 7 && (document.estiForm.productFamily.value == "BusCard")) { return (0 + (quantity * .115)); // Extremely simplified biz card pricing, 082407 BV } else if (si < 35) { if (quantity <= 1000) return (8 + (quantity * si * 216/168 * (.655/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (51 + (quantity * si * 216/168 * (.44/(12*18)) )); else return (116 + (quantity * si * 216/168 * (.284/(12*18)) )); } else if (si >= 35 && si < 40) { if (quantity <= 1000) return (46 + (quantity * si * 216/140 * (.57/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (155 + (quantity * si * 216/140 * (.195/(12*18)) )); else return (171 + (quantity * si * 216/140 * (.174/(12*18)) )); } else if (si >= 40 && si < 54) { if (quantity <= 1000) return (46 + (quantity * si * 216/160 * (.67/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (79 + (quantity * si * 216/160 * (.39/(12*18)) )); else return (47 + (quantity * si * 216/160 * (.426/(12*18)) )); } else if (si >= 54 && si < 66) { if (quantity <= 1000) return (32 + (quantity * si * 216/108 * (.43/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (183 + (quantity * si * 216/108 * (.185/(12*18)) )); else return (202 + (quantity * si * 216/108 * (.173/(12*18)) )); } else if (si >= 66 && si < 75) { if (quantity <= 1000) return (-9 + (quantity * si * 216/132 * (.69/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (250 + (quantity * si * 216/132 * (.245/(12*18)) )); else return (278 + (quantity * si * 216/132 * (.2285/(12*18)) )); } else if (si < 93.5) return (quantity * si * 1.5 * .0083333); else return (quantity * si * 1.25 * .0083333); } function get40NexPressPricing(quantity, si) { if (si <= 7 && (document.estiForm.productFamily.value == "BusCard")) { return (0 + (quantity * .095)); // Extremely simplified biz card pricing, 082407 BV } else if (si < 35) { if (quantity <= 1000) return (8 + (quantity * si * 216/168 * (.655/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (51 + (quantity * si * 216/168 * (.44/(12*18)) )); else return (116 + (quantity * si * 216/168 * (.284/(12*18)) )); } else if (si >= 35 && si < 40) { if (quantity <= 1000) return (46 + (quantity * si * 216/140 * (.57/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (155 + (quantity * si * 216/140 * (.195/(12*18)) )); else return (171 + (quantity * si * 216/140 * (.174/(12*18)) )); } else if (si >= 40 && si < 54) { if (quantity <= 1000) return (46 + (quantity * si * 216/160 * (.67/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (79 + (quantity * si * 216/160 * (.39/(12*18)) )); else return (47 + (quantity * si * 216/160 * (.426/(12*18)) )); } else if (si >= 54 && si < 66) { if (quantity <= 1000) return (32 + (quantity * si * 216/108 * (.43/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (183 + (quantity * si * 216/108 * (.185/(12*18)) )); else return (202 + (quantity * si * 216/108 * (.173/(12*18)) )); } else if (si >= 66 && si < 75) { if (quantity <= 1000) return (-9 + (quantity * si * 216/132 * (.69/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (250 + (quantity * si * 216/132 * (.245/(12*18)) )); else return (278 + (quantity * si * 216/132 * (.2285/(12*18)) )); } /* this next "else if" is matches non-eco psp prices else if (si > 7 && si <= 24) { if (quantity <= 1000) return (-4 + (quantity * si * 216/168 * (.52/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (21 + (quantity * si * 216/168 * (.36/(12*18)) )); else return (85 + (quantity * si * 216/168 * (.211/(12*18)) )); }*/ else if (si < 93.5) return (quantity * si * 1.5 * .0046296); else return (quantity * si * 1.25 * .0046296); } function get11NexPressPricing(quantity, si) { if (si < 93.5) return (quantity * si * 1.5 * .0046296); else return (quantity * si * 1.25 * .0046296); } function get44Pricing(quantity, si) { /*follow formula y = mx + b + fixed_cost, where: y = price m = slope of price line as graphed on xy axis x = quantity b = y intercept fixed_cost = fixed cost for this color type */ my44setup = 425; //alert("regular: " + my44setup); //if (document.estiForm.realquant.value < 5000 && document.estiForm.turnaround.selectedIndex == 0 && !document.estiForm.multi) { //if (document.estiForm.turnaround.selectedIndex == 0 && !document.estiForm.multi) { //the following if/else statement discounts for 10 day orders, commented out as of 9/23/04 /*if (document.estiForm.turnaround.selectedIndex == 0) { if (document.estiForm.height.value <= 22 && document.estiForm.width.value <= 14) { my44setup = (my44setup * (1 - 0.4) ); //alert("40% discount (old): " + my44setup + "\n40% discount (new): " + my44setup2 + "\nArithmetic Test: " + (1 - .4)); } else { my44setup = (my44setup * (1 - 0.1) ); //alert("10% discount: " + my44setup); } }*/ if (si <= 7 && (document.estiForm.productFamily.value == "BusCard")) { // up to 2 x 3.5 bus. cards return ((.014538153 * quantity + 186) + my44setup); //c86// } else if (si <= 24) { // up to 4 x 6 if (quantity <= 9999) { return ((.038496241 * quantity + 182) + my44setup);//c99 + slope changed// } else if (quantity > 9999) { return ((.023896552 * quantity + 328) + my44setup); //c// } } else if (si > 24 && si <= 35) { // bigger than 4 x 6 and up to 5 x 7 if (quantity <= 14999) { // slope for quantities up to 14999 return ((.038929188 * quantity + 182) + my44setup); //c86// } else if (quantity > 14999) { //slope different for quantities greater than 15000 return ((.0194 * quantity + 475) + my44setup); //c669// } } else if (si > 35 && si <= 36) { // bigger than 5 x 7 and up to 4 x 9 return ((.021621622 * quantity + 175) + my44setup); //c86// } else if (si > 36 && si <= 54) { // bigger than 4 x 9 and up to 6 x 9 if (quantity <= 14999) { // slope for quantities up to 14999 return ((.038597582 * quantity + 169) + my44setup); //c86// } else if (quantity > 14999) { //slope different for quantities greater than 15000 return ((.0193 * quantity + 459) + my44setup); //c746// } } else if (si > 54 && si <= 70) { // bigger than 6 x 9 and up to 7 x 10 if (quantity <= 14999) { // slope for quantities up to 14999 return ((.048946459 * quantity + 184) + my44setup); //c86// } else if (quantity > 14999) { //slope different for quantities greater than 15000 return ((.0185 * quantity + 641) + my44setup); //c819// } } else if (si > 70 && si <= 93.5) { // bigger than 7 x 10 and up to 8.5 x 11 return ((.043083083 * quantity + 85) + my44setup); //c84// } else if (si > 93.5 && si <= 119) { // bigger than 8.5 x 11 and up to 8.5 x 14 if (quantity <= 9999) { // slope for quantities up to 9999 return ((.059651715 * quantity + 184) + my44setup); //c185// } else if (quantity > 9999) { //slope different for quantities greater than 10000 return ((.018866667 * quantity + 591) + my44setup); //c780// } } else if (si > 119 && si <= 187) { //bigger than 8.5 x 14 and up to 11 x 17 if (quantity <= 4999) { // slope for quantities up to 4999 return ((.108342644 * quantity + 181) + my44setup); //c184// } else if (quantity > 4999 && quantity <= 9999) { //slope different for quantities greater than 5000 and less than 10000 return ((.0224 * quantity + 611) + my44setup); //c723// } else if (quantity > 9999 && quantity <= 19999) { //slope different for quantities greater than 9999 and less than 20000 return ((.055557895 * quantity + 279) + my44setup); //c835// } else if (quantity > 19999) { //slope different for quantities greater than 20000 return ((.0332 * quantity + 730) + my44setup); //c1394// } } else if (si > 187 && si <= 374) { // bigger than 11 x 17 up to 17 x 22 return ((.104624625 * quantity + 454) + my44setup);//c457// } else if (si > 374 && si <= 432) { // bigger than 17 x 22 up to 18 x 24 if (document.estiForm.productFamily.value == "Doorhanger") { return ((0.104624625 * (((quantity * .125) + 200) * 1.03) + 454) + my44setup); //c457// } else { return ((0.104624625 * quantity + 454) + my44setup); //c457// } } else if (si > 432 && si <= 616 && document.estiForm.multi && document.estiForm.coverColors.value!="NoCover") { // bigger than 18 x 24 up to 22 x 28 if (quantity <= 1499) { return ((.121591592 * quantity + 455) + my44setup); //c458// } else if (quantity > 1499 && quantity <= 5500) { return ((0 * quantity + 637) + my44setup); } else if (quantity > 5500) { return ((.02 * quantity + 637) + my44setup); } } else if (si > 432 && si <= 616 && document.estiForm.multi && document.estiForm.coverColors.value=="NoCover") { // bigger than 18 x 24 up to 22 x 28 if (quantity <= 1499) { return ((.121591592 * quantity + 455) + my44setup); //c458// } else if (quantity > 1499 && quantity <= 5500) { return ((0 * quantity + 637) + my44setup); } else if (quantity > 5500) { return ((.04 * quantity + 417) + my44setup); } } else if (si > 432 && si <= 616 && !document.estiForm.multi) { // bigger than 18 x 24 up to 22 x 28 return ((.111591592 * quantity + 455) + my44setup); //c458// } } function get41Pricing(quantity, si) { /*follow formula y = mx + b + fixed_cost, where: y = price m = slope of price line as graphed on xy axis x = quantity b = y intercept fixed_cost = fixed cost for this color type */ my41setup = 410; //if (document.estiForm.realquant.value < 5000 && document.estiForm.turnaround.selectedIndex == 0 && !document.estiForm.multi) { //the following if/else statement discounts for 10 day orders, commented out as of 9/23/04 /*if (document.estiForm.turnaround.selectedIndex == 0 && !document.estiForm.multi) { if (document.estiForm.height.value <= 22 && document.estiForm.width.value <= 14) { my41setup = (my41setup * (1 - 0.5) ); } else { my41setup = (my41setup * (1 - 0.1) ); } }*/ if (si <= 7 && (document.estiForm.productFamily.value == "BusCard")) { // up to 2 x 3.5 bus. cards return ((.01437751 * quantity + 136) + my41setup); //c71// } else if (si <= 24) { // up to 4 x 6 if (quantity <= 14999) { // slope for quantities up to 14999 return ((.037996546 * quantity + 132) + my41setup); //c71// } else if (quantity > 14999) { //slope different for quantities greater than 15000 return ((.0191 * quantity + 416) + my41setup); //c702// } } else if (si > 24 && si <= 35) { // bigger than 4 x 6 and up to 5 x 7 if (quantity <= 14999) { // slope for quantities up to 14999 return ((.038328152 * quantity + 132) + my41setup); //c71// } else if (quantity > 14999) { //slope different for quantities greater than 15000 return ((.0191 * quantity + 421) + my41setup); //c645// } } else if (si > 35 && si <= 36) { // bigger than 5 x 7 and up to 4 x 9 return ((.021061061 * quantity + 128) + my41setup); //c71// } else if (si > 36 && si <= 54) { // bigger than 4 x 9 and up to 6 x 9 if (quantity <= 14999) { // slope for quantities up to 14999 return ((.037727116 * quantity + 121) + my41setup); //c71// } else if (quantity > 14999) { //slope different for quantities greater than 15000 return ((0.0189 * quantity + 404) + my41setup); //c636// } } else if (si > 54 && si <= 70) { // bigger than 6 x 9 and up to 7 x 10 if (quantity <= 19999) { // slope for quantities up to 19999 return ((.045786906 * quantity + 131) + my41setup); //c71// } else if (quantity > 19999) { //slope different for quantities greater than 20000 return ((.0092 * quantity + 859) + my41setup); //c982// } } else if (si > 70 && si <= 93.5) { // bigger than 7 x 10 up to 8.5 x 11 return ((.043323323 * quantity + 70) + my41setup); //c71// } else if (si > 93.5 && si <= 119) { // bigger than 8.5 x 11 and up to 8.5 x 14 if (quantity <= 9999) { // slope for quantities up to 9999 return ((.064094987 * quantity + 41) + my41setup); //c75// } else if (quantity > 9999) { //slope different for quantities greater than 10000 return ((.020866667 * quantity + 472) + my41setup); //c713// } } else if (si > 119 && si <= 187) { //bigger than 8.5 x 14 and up to 11 x 17 if (quantity <= 1499) { return ((.0694 * quantity + 115) + my41setup); //c49// } else if (quantity > 1499 && quantity <= 4999) { // slope for quantities up to 4999 return ((.11538175 * quantity + 46) + my41setup); //c49// } else if (quantity > 4999 && quantity <= 9999) { //slope different for quantities greater than 5000 and less than 10000 return ((.025 * quantity + 496) + my41setup); //c621// } else if (quantity > 9999 && quantity <= 19999) { //slope different for quantities greater than 9999 and less than 20000 return ((.058778947 * quantity + 158) + my41setup); //c746// } else if (quantity > 19999) { //slope different for quantities greater than 20000 return ((.0348 * quantity + 641) + my41setup); //c1337// } } else if (si > 187 && si <= 374) { // bigger than 11 x 17 up to 17 x 22 return ((0.1003003 * quantity + 168) + my41setup); //c171// } else if (si > 374 && si <= 432) { // bigger than 17 x 22 up to 18 x 24 if (document.estiForm.productFamily.value == "Doorhanger") { return ((0.1003003 * (((quantity * .125) + 200) * 1.03) + 168) + my41setup); //c171// } else { return ((0.1003003 * quantity + 168) + my41setup); //c171// } } else if (si > 432 && si <= 616 && document.estiForm.multi && document.estiForm.coverColors.value!="NoCover") { // bigger than 18 x 24 up to 22 x 28 if (quantity <= 1499) { return ((.121591592 * quantity + 168) + my41setup); //c458// } else if (quantity > 1499 && quantity <= 5500) { return ((0 * quantity + 350) + my41setup); } else if (quantity > 5500) { return ((.02 * quantity + 240) + my41setup); } } else if (si > 432 && si <= 616 && document.estiForm.multi && document.estiForm.coverColors.value=="NoCover") { // bigger than 18 x 24 up to 22 x 28 if (quantity <= 1499) { return ((.121591592 * quantity + 168) + my41setup); //c458// } else if (quantity > 1499 && quantity <= 5500) { return ((0 * quantity + 350) + my41setup); } else if (quantity > 5500) { return ((.04 * quantity + 130) + my41setup); } } else if (si > 432 && si <= 616 && !document.estiForm.multi) { // bigger than 18 x 24 up to 22 x 28 return ((.105505506 * quantity + 168) + my41setup); //c171// } } function get11Pricing(quantity, si) { my11setup=266; if (si > 432 && si <= 616 && document.estiForm.multi && document.estiForm.coverColors.value!="NoCover") { // bigger than 18 x 24 up to 22 x 28 if (quantity <= 1499) { return ((.121591592 * quantity + 55) + my11setup); //c458// } else if (quantity > 1499 && quantity <= 4500) { return ((0 * quantity + 237) + my11setup); } else if (quantity > 4500) { return ((.02 * quantity + 227) + my11setup); } } else if (si > 432 && si <= 616 && document.estiForm.multi && document.estiForm.coverColors.value=="NoCover") { // bigger than 18 x 24 up to 22 x 28 if (quantity <= 1499) { return ((.121591592 * quantity + 55) + my11setup); //c458// } else if (quantity > 1499 && quantity <= 4500) { return ((0 * quantity + 237) + my11setup); } else if (quantity > 4500) { return ((.04 * quantity + 117) + my11setup); } } else { return (get40Pricing(quantity, si) - 133); } } function get40Pricing(quantity, si) { /*follow formula y = mx + b + fixed_cost, where: y = price m = slope of price line as graphed on xy axis x = quantity b = y intercept fixed_cost = fixed cost for this color type */ my40setup = 400; //if (document.estiForm.realquant.value < 5000 && document.estiForm.turnaround.selectedIndex == 0 && !document.estiForm.multi) { //the following if/else statement discounts for 10 day orders, commented out as of 9/23/04 /*if (document.estiForm.turnaround.selectedIndex == 0 && !document.estiForm.multi) { if (document.estiForm.height.value <= 22 && document.estiForm.width.value <= 14) { my40setup = (my40setup * (1 - 0.5) ); } else { my40setup = (my40setup * (1 - 0.1) ); } }*/ if (si <= 7 && (document.estiForm.productFamily.value == "BusCard")) { // up to 2 x 3.5 bus. cards return ((.011084337 * quantity + 83) + my40setup); //c68// } else if (si <= 24) { // up to 4 x 6 return ((.026783479 * quantity + 84) + my40setup); //c68// } else if (si > 24 && si <= 35) { // bigger than 4 x 6 and up to 5 x 7 if (quantity <= 19999) { // slope for quantities up to 19999 return ((.027086008 * quantity + 84) + my40setup); //c68// } else if (quantity > 19999) { //slope different for quantities greater than 20000 return ((.0028 * quantity + 570) + my40setup); //c609// } } else if (si > 35 && si <= 36) { // bigger than 5 x 7 and up to 4 x 9 return ((.015055055 * quantity + 77) + my40setup); //c68// } else if (si > 36 && si <= 54) { // bigger than 4 x 9 and up to 6 x 9 return ((.026232791 * quantity + 73) + my40setup); //c68// } else if (si > 54 && si <= 70) { // bigger than 6 x 9 and up to 7 x 10 if (quantity <= 19999) { // slope for quantities up to 19999 return ((.036441592 * quantity + 81) + my40setup); //c68// } else if (quantity > 19999) { //slope different for quantities greater than 20000 return ((.0092 * quantity + 626) + my40setup); //c796// } } else if (si > 70 && si <= 93.5) { // bigger than 7 x 10 and up to 8.5 x 11 return ((.02802803 * quantity + 67) + my40setup); //c68// } else if (si > 93.5 && si <= 119) { // bigger than 8.5 x 11 and up to 8.5 x 14 if (quantity <= 9999) { // slope for quantities up to 9999 return ((.037794195 * quantity + 73) + my40setup); //c74// } else if (quantity > 9999) { //slope different for quantities greater than 10000 return ((.017466667 * quantity + 276) + my40setup); //c451// } } else if (si > 119 && si <= 187) { //bigger than 8.5 x 14 and up to 11 x 17 if (quantity <= 4999) { // slope for quantities up to 4999 return ((.064506518 * quantity + 72) + my40setup); //c74// } else if (quantity > 4999 && quantity <= 9999) { //slope different for quantities greater than 5000 and less than 10000 return ((.0226 * quantity + 282) + my40setup); //c395// } else if (quantity > 9999 && quantity <= 19999) { //slope different for quantities greater than 9999 and less than 20000 return ((.038115789 * quantity + 127) + my40setup); //c127// } else if (quantity > 19999) { //slope different for quantities greater than 20000 return ((.0272 * quantity + 347) + my40setup); //c891// } } else if (si > 187 && si <= 374) { // bigger than 11 x 17 up to 17 x 22 return ((.064024024 * quantity + 72) + my40setup); //c110// } else if (si > 374 && si <= 432) { // bigger than 17 x 22 up to 18 x 24 if (document.estiForm.productFamily.value == "Doorhanger") { return ((.065465465 * (((quantity * .125) + 200) * 1.03) + 72) + my40setup); //c74// } else { return ((.065465465 * quantity + 72) + my40setup); //c74// } } else if (si > 432 && si <= 616 && document.estiForm.multi && document.estiForm.coverColors.value!="NoCover") { // bigger than 18 x 24 up to 22 x 28 if (quantity <= 1499) { return ((.121591592 * quantity + 72) + my40setup); //c458// } else if (quantity > 1499 && quantity <= 5500) { return ((0 * quantity + 254) + my40setup); } else if (quantity > 5500) { return ((.02 * quantity + 144) + my40setup); } } else if (si > 432 && si <= 616 && document.estiForm.multi && document.estiForm.coverColors.value=="NoCover") { // bigger than 18 x 24 up to 22 x 28 if (quantity <= 1499) { return ((.121591592 * quantity + 72) + my40setup); //c458// } else if (quantity > 1499 && quantity <= 5500) { return ((0 * quantity + 254) + my40setup); } else if (quantity > 5500) { return ((.04 * quantity + 34) + my40setup); } } else if (si > 432 && si <= 616) { // bigger than 18 x 24 up to 22 x 28 return ((.06962963 * quantity + 72) + my40setup); //c74// } } /*function calcPressIdent(quantity, si, page_type) { if (page_type == "black_1pms") { press = getPressFactor(quantity, si, page_type); } return press; }*/ function calcPress(quantity, si, page_type) { if (page_type == "cover") { 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.coverColors.options[document.estiForm.coverColors.selectedIndex].value != document.estiForm.colors.options[document.estiForm.colors.selectedIndex].value)) { this_type = "NoCover"; } else { this_type = document.estiForm.coverColors.options[document.estiForm.coverColors.selectedIndex].value; } } else { if (document.estiForm.coverColors.value == document.estiForm.colors.value) { this_type = "NoCover"; } else { this_type = document.estiForm.coverColors.value; } } } else { if (document.estiForm.colors.options) //select menu value this_type = document.estiForm.colors.options[document.estiForm.colors.selectedIndex].value; else if (document.estiForm.colors) // hidden value this_type = document.estiForm.colors.value; } press = (getPressFactor(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 press; } function calcFolding() { //unit price folding_unit_cost = getFoldingFactor(); addl_scoring_unit_cost = getAdditionalScoringFactor(); folding = (document.estiForm.realquant.value * folding_unit_cost); my_scoring = (document.estiForm.realquant.value * addl_scoring_unit_cost); foldBase = 15; scoreBase = 25; /*alert("paper: " + document.estiForm.paper.selectedIndex + "\n" + "quantity: " + document.estiForm.realquant.value + "\n" + "folding unit: " + folding_unit_cost + "\n" + "folding factor: " + folding + "\n" + "fold base: " + foldBase);*/ if (document.estiForm.paper.options) { //had to do this due to w2p folded brochure where paper is passed via hidden input value. Will have to add more logic if we add w2p folded brochure on cover stock (due to scoring). if (folding > 1 && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value.indexOf("cover") > -1) { folding = (folding + foldBase + my_scoring + scoreBase); //alert (folding); } else if (folding > 1) { folding = (folding + 15); //alert (folding); } } else { if (folding > 1) { folding = (folding + foldBase); //alert (folding); } } document.estiForm.folding.value=formatCurrency(folding); return folding; } function getFoldingFactor() { if (document.estiForm.fold && (document.estiForm.fold.selectedIndex > 0 || (document.estiForm.fold.value == "HalfFold" || document.estiForm.fold.value == "TriFold"))) { return '0.0115'; } else { return 0; } } function calcScoring() { //unit price scoring_unit_cost = getScoringFactor(); scoring = (document.estiForm.realquant.value * scoring_unit_cost); scoreBase = 25; if (scoring > 1) { scoring = (scoring + scoreBase); } document.estiForm.scoring.value=formatCurrency(scoring); //alert("scoreBase = $" + scoreBase + "\n" + "scoring unit cost = $" + scoring_unit_cost + "\n" + "scoring total = $" + scoring); return scoring; } function getScoringFactor() { if (document.estiForm.score && document.estiForm.score.selectedIndex > 0) { return '0.023'; } else { return 0; } } function getAdditionalScoringFactor() { if (document.estiForm.fold && (document.estiForm.fold.selectedIndex > 0 || document.estiForm.fold.value == "HalfFold") && document.estiForm.paper.selectedIndex >= 1) { return '0.023'; } else { return 0; } } function calcPerforating() { //unit price perf_unit_cost = getPerforatingFactor(); perforating = (document.estiForm.realquant.value * perf_unit_cost); perfBase = 25; if (perforating > 1) { perforating = (perforating + perfBase); } document.estiForm.perforating.value=formatCurrency(perforating); return perforating; } function getPerforatingFactor() { if (document.estiForm.perforate && document.estiForm.perforate.selectedIndex > 0) { return '0.023'; } else { return 0; } } function calcDrilling() { //alert(document.estiForm.drill.value); //unit price // $20 setup for thicker papers if (((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "95_nl_rein_cover") || document.estiForm.paper.value == "95_nl_rein_cover") || ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "96_nl_sak_cover") || document.estiForm.paper.value == "96_nl_sak_cover") || ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "111_nl_pvg_cover") || document.estiForm.paper.value == "111_nl_pvg_cover") || ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "20pt_kraftboard") || document.estiForm.paper.value == "20pt_kraftboard") ) { drill_unit_cost = getDrillingFactor(); } else { drill_unit_cost = (getDrillingFactor() * .75); } // Drilling happens on flat pieces, so if there's scoring, that means piece will fold and require TWO drill holes: if (document.estiForm.score && document.estiForm.score.selectedIndex > 0) { drilling = ((document.estiForm.realquant.value * drill_unit_cost) * 2); } else { drilling = (document.estiForm.realquant.value * drill_unit_cost); } // Drilling happens on flat pieces, so if there's scoring, add $10 setup for 2nd hole: if (document.estiForm.score && document.estiForm.score.selectedIndex > 0) { drillBase = (25 + 10); } else { drillBase = 25; } if (drilling > 1) { drilling = (drilling + drillBase); } document.estiForm.drilling.value=formatCurrency(drilling); //alert("drillBase: $" + drillBase + "\n" + "drilling per item: $" + drill_unit_cost + "\n" + "drilling total: $" + drilling); return drilling; } function getDrillingFactor() { if (document.estiForm.drill && document.estiForm.drill.selectedIndex > 0) { return '0.02'; } else if (document.estiForm.productFamily.value == "Calendar") { return '0.02'; } else { return 0; } } function calcEyelets() { if (document.estiForm.eyelet && document.estiForm.eyelet.options && document.estiForm.eyelet.selectedIndex > 0) { //if eyelet is chosen if (document.estiForm.score && document.estiForm.score.options && document.estiForm.score.selectedIndex > 0) { //if piece is scored if (document.estiForm.realquant.value < 200) { //min. charge is $50 for eyelets var eyelets = 50 } else { var eyelets = (document.estiForm.realquant.value * .25); //or .25 ea (for scored pieces) } } else { if (document.estiForm.realquant.value < 250) { //if piece is flat var eyelets = 50 //min. charge is $50 for eyelets } else { var eyelets = (document.estiForm.realquant.value * .20); //or .20 ea (for flat pieces) } } document.estiForm.drill.selectedIndex = 3; document.estiForm.drill.disabled=true; return eyelets; } else { if (document.estiForm.eyelet && document.estiForm.eyelet.options && document.estiForm.drill && document.estiForm.drill.options) { document.estiForm.drill.disabled=false; return 0; } else { return 0; } } } function calcNexPressProof(si) { if (document.estiForm.proof.options) { if (document.estiForm.proof.selectedIndex == 0) { proof = 0; } else { proof = 50; } } else { if (document.estiForm.proof.value == 'SoftProof') { proof = 0; } else { proof = 50; } } document.estiForm.proofcharge.value=formatCurrency(proof); return proof; } function calcProof(si) { //unit price ppsi = getProofFactor(); if (document.estiForm.proof.selectedIndex > 0 && !document.estiForm.multi && document.estiForm.productFamily.value != "Folder" && document.estiForm.productFamily.value != "Folder 4x9" && document.estiForm.productFamily.value != "Doorhanger" && document.estiForm.productFamily.value != "3 Panel Folder") { proof = (si * ppsi); proofBase = 25; proof = (proof + proofBase); } else if (document.estiForm.proof.selectedIndex > 0 && document.estiForm.multi) { pages = (parseInt(document.estiForm.pages.value) + 4); proofBase = ((si * ppsi) * 2); inkjetProof = (proofBase + (pages * 5)); spinjetSheets = (Math.ceil(((parseInt(document.estiForm.pages.value) + 4)) / 12)); spinjetProof = (spinjetSheets * 44); // $44 per spinjet (up to 12 pages per sig) proof = (inkjetProof + spinjetProof + 20); /*alert("Pages: " + pages + "\nProof base: " + proofBase + "\nTotal, Inkjet proofs: " + inkjetProof + "\nSpinJet Sheets: " + spinjetSheets + "\nTotal, SpinJetProof proofs: " + spinjetProof + "\nTotal Proof Charge: " + proof );*/ } else if (document.estiForm.proof.selectedIndex > 0 && (document.estiForm.productFamily.value == "Folder" || document.estiForm.productFamily.value == "3 Panel Folder")) { if (document.estiForm.colors.value != "4over4") { proof = 144 } else { proof = 224 } } else if (document.estiForm.proof.selectedIndex > 0 && document.estiForm.productFamily.value == "Folder 4x9") { if (document.estiForm.colors.value != "4over4") { proof = 104 } else { proof = 144 } } else if (document.estiForm.proof.selectedIndex > 0 && document.estiForm.productFamily.value == "Doorhanger") { if (document.estiForm.colors.value != "4over4") { proof = 52 } else { proof = 40 } } else { proof = 0 } document.estiForm.proofcharge.value=formatCurrency(proof); return proof; } function getProofFactor() { if ((document.estiForm.proof.options && document.estiForm.proof.selectedIndex == 0) || document.estiForm.proof.value=='SoftProof') { return 0; } if (((document.estiForm.proof.options && document.estiForm.proof.selectedIndex > 0) || document.estiForm.proof.value.length > 0) && !document.estiForm.multi) { return '0.437807'; } if (document.estiForm.proof.selectedIndex > 0 && document.estiForm.multi) { return .046; } } function calcRush(total, si) { //unit price rush_factor = getRushFactor(si); rush = (total * rush_factor); //alert(rush); document.estiForm.rush.value=formatCurrency(rush); return rush; } function getRushFactor(si) { if (si <= 7 && (document.estiForm.productFamily.value == "BusCard")) { //special rush factors for buscards if (document.estiForm.turnaround.options) { if (document.estiForm.turnaround.options[document.estiForm.turnaround.selectedIndex].value == '7 day') return 0; else if (document.estiForm.turnaround.options[document.estiForm.turnaround.selectedIndex].value == '3 day') return .25 else if (document.estiForm.turnaround.options[document.estiForm.turnaround.selectedIndex].value == '2 day') return .35 + .10; // +. 10 is temp increase to lower demand } else if (document.estiForm.turnaround[0] && document.estiForm.turnaround[0].type=='radio') { for (var i=0; i < document.estiForm.turnaround.length; i++) { if (document.estiForm.turnaround[i].checked) { var turn_val = document.estiForm.turnaround[i].value; if (turn_val == '7 day') return 0; else if (turn_val == '3 day') return .25 else if (turn_val == '2 day') return .35 + .10; // +. 10 is temp increase to lower demand } } } else { if (document.estiForm.turnaround.value == "7 day") return 0; else if (document.estiForm.turnaround.value == "3 day") return .25 else if (document.estiForm.turnaround.value == "2 day") return .35 + .10; // +. 10 is temp increase to lower demand } } else if (si > 7 && si <= 24) {//special rush factors for postcards if (document.estiForm.turnaround.options) { if (document.estiForm.turnaround.options[document.estiForm.turnaround.selectedIndex].value == '7 day') { return '-0.1'; // -10% } if (document.estiForm.turnaround.options[document.estiForm.turnaround.selectedIndex].value == '3 day') { return ".035"; // +3.5% } if (document.estiForm.turnaround.options[document.estiForm.turnaround.selectedIndex].value == '2 day') { return .295 + .10; // +. 10 is temp increase to lower demand } } else if (document.estiForm.turnaround[0] && document.estiForm.turnaround[0].type=='radio') { for (var i=0; i < document.estiForm.turnaround.length; i++) { if (document.estiForm.turnaround[i].checked) { var turn_val = document.estiForm.turnaround[i].value; if (turn_val == '7 day') return '-0.1'; // -10% else if (turn_val == '3 day') return ".035"; // +3.5% else if (turn_val == '2 day') return .295 + .10; // +. 10 is temp increase to lower demand } } } else { if (document.estiForm.turnaround.value == "7 day") { return '-0.1'; // -10% } if (document.estiForm.turnaround.value == "3 day") { return ".035"; // +3.5% } if (document.estiForm.turnaround.value == "2 day") { return .295 + .10; // +. 10 is temp increase to lower demand } } } else { if (document.estiForm.turnaround.options) { if (document.estiForm.turnaround.options[document.estiForm.turnaround.selectedIndex].value == '7 day' && document.estiForm.multi) { return "-.014"; } if (document.estiForm.turnaround.options[document.estiForm.turnaround.selectedIndex].value == '7 day') { return '-0.1'; //return "-.1"; } if (document.estiForm.turnaround.options[document.estiForm.turnaround.selectedIndex].value == '5 day' && !document.estiForm.multi) { //return '0.15'; return "-.05"; } if (document.estiForm.turnaround.options[document.estiForm.turnaround.selectedIndex].value == '5 day' && document.estiForm.multi) { //return '0.15'; return ".07"; } if (document.estiForm.turnaround.options[document.estiForm.turnaround.selectedIndex].value == '2 day' && !document.estiForm.multi) { return 0.18 + .10; // +. 10 is temp increase to lower demand } } else if (document.estiForm.turnaround[0] && document.estiForm.turnaround[0].type=='radio') { for (var i=0; i < document.estiForm.turnaround.length; i++) { if (document.estiForm.turnaround[i].checked) { var turn_val = document.estiForm.turnaround[i].value; if (turn_val == '7 day') { if (document.estiForm.multi) { return "-.014"; } if (document.estiForm.productFamily.value == "Doorhanger") { return "0"; } else { return "-.1"; } } if (turn_val == '5 day' && !document.estiForm.multi) { if (document.estiForm.productFamily.value == "Folder" || document.estiForm.productFamily.value == "Folder 4x9" || document.estiForm.productFamily.value == "CD Sleeve 5x5" || document.estiForm.productFamily.value.indexOf("w2pPresFolder") != -1 || document.estiForm.productFamily.value == "3 Panel Folder") { return "-.01"; } if (document.estiForm.productFamily.value == "Doorhanger") { return ".06"; } else { return "-.05"; } } if (turn_val == '5 day' && document.estiForm.multi) { return ".07"; } if (turn_val == '3 day') { if (document.estiForm.productFamily.value == "Folder" || document.estiForm.productFamily.value == "Folder 4x9" || document.estiForm.productFamily.value == "CD Sleeve 5x5" || document.estiForm.productFamily.value.indexOf("w2pPresFolder") != -1 || document.estiForm.productFamily.value == "3 Panel Folder") { return ".175"; } else { return "0"; // +3.5% } } if (turn_val == '2 day' && !document.estiForm.multi) { return 0.18 + .10; // +. 10 is temp increase to lower demand } } } } else { if (document.estiForm.turnaround.value == "7 day" && document.estiForm.multi) { return "-.014"; } if (document.estiForm.turnaround.value == "7 day") { return "-.1"; } if (document.estiForm.turnaround.value == "5 day" && document.estiForm.multi) { return ".07"; } if (document.estiForm.turnaround.value == "2 day" && !document.estiForm.multi) { return 0.18 + .10; // +. 10 is temp increase to lower demand } } } return "0"; } function calcHandling(tsi) { boxBase = 10; boxFactor = 2.5; boxWeightFactor = 1.1; total_weight = (boxWeightFactor * getJobWeight(tsi)); if (total_weight > 0 && total_weight <= 20) { number_full_boxes = 1; } else { number_full_boxes = Math.floor( (total_weight / 20) ); } if ( (total_weight > 20) && (total_weight % 20) > 0) { number_partial_boxes = 1; } else { number_partial_boxes = 0; } total_boxes = (number_full_boxes + number_partial_boxes); //if one box charge $10 if (total_boxes == 1) { handling = total_boxes * boxBase; } //if multitple boxes, charge $10 for first and $2.50 for each additional box else { handling = (boxBase + (total_boxes - 1) * boxFactor); } document.estiForm.handling.value=formatCurrency(handling); //alert('\nTotal Weight: ' + total_weight + '\nNumber Full Boxes: ' + number_full_boxes + '\nNumber Partial Boxes: ' + number_partial_boxes + '\nTotal Boxes: ' + total_boxes + '\nHandling: ' + handling); return handling; } function getJobWeight(tsi) { if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "80_book") || document.estiForm.paper.value == "80_book") { return (tsi * .000167914438503); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "100_book") || document.estiForm.paper.value == "100_book") { return (tsi * .000211764705882); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "80_cover") || document.estiForm.paper.value == "80_cover") { return (tsi * .000308021390374); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "100_cover") || document.estiForm.paper.value == "100_cover") { return (tsi * .000387165775401); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "12pt_cover") || document.estiForm.paper.value == "12pt_cover") { return (tsi * .000428877005348); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "12pt2_cover") || document.estiForm.paper.value == "12pt2_cover") { return (tsi * .000488877005348); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "70_nl_rein_book") || document.estiForm.paper.value == "70_nl_rein_book") { return (tsi * .0001469265); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "80_nl_rein_book") || document.estiForm.paper.value == "80_nl_rein_book") { return (tsi * 0.000168421); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "105_nl_rein_book") || document.estiForm.paper.value == "105_nl_rein_book") { return (tsi * 0.000221053); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "65_nl_rein_cover") || document.estiForm.paper.value == "65_nl_rein_cover") { return (tsi * .0002302722157894737); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "80_nl_rein_cover") || document.estiForm.paper.value == "80_nl_rein_cover") { return (tsi * 0.000307368); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "95_nl_rein_cover") || document.estiForm.paper.value == "95_nl_rein_cover") { return (tsi * 0.000366316); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "87_nl_sak_book") || document.estiForm.paper.value == "87_nl_sak_book") { return (tsi * 0.000183158); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "106_nl_sak_book") || document.estiForm.paper.value == "106_nl_sak_book") { return (tsi * 0.000223158); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "96_nl_sak_cover") || document.estiForm.paper.value == "96_nl_sak_cover") { return (tsi * 0.000369231); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "88_nl_pvg_book") || document.estiForm.paper.value == "88_nl_pvg_book") { return (tsi * .0001857142857142857); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "101_nl_pvg_book") || document.estiForm.paper.value == "101_nl_pvg_book") { return (tsi * 0.000212632); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "89_nl_pvg_cover") || document.estiForm.paper.value == "89_nl_pvg_cover") { return (tsi * .0003428571428571429); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "111_nl_pvg_cover") || document.estiForm.paper.value == "111_nl_pvg_cover") { return (tsi * 0.000427368); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "24_nl_ew") || document.estiForm.paper.value == "24_nl_ew") { return (tsi * 0.000128421); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "80_nl_eb_book") || document.estiForm.paper.value == "80_nl_eb_book") { return (tsi * 0.000168421); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "80_nl_ec_cover") || document.estiForm.paper.value == "80_nl_ec_cover") { return (tsi * 0.000307368); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "100_nl_ec_cover") || document.estiForm.paper.value == "100_nl_ec_cover") { return (tsi * 0.000385093); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "60_nl_o_book") || document.estiForm.paper.value == "60_nl_o_book") { return (tsi * .0001263157894736842); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "70_nl_o_book") || document.estiForm.paper.value == "70_nl_o_book") { return (tsi * .0001478260869565217); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "80_nl_o_book") || document.estiForm.paper.value == "80_nl_o_book") { return (tsi * .000168944099378882); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "70_mt_starliner") || document.estiForm.paper.value == "70_mt_starliner") { return (tsi * 0.000307487); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "60_kraft_starliner") || document.estiForm.paper.value == "60_kraft_starliner") { return (tsi * 0.000307487); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "16pt_nl_rein_dblthick") || document.estiForm.paper.value == "16pt_nl_rein_dblthick") { return (tsi * 0.0005018); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "20pt_kraftboard") || document.estiForm.paper.value == "20pt_kraftboard") { return (tsi * 0.000614736); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "18pt_renewal") || document.estiForm.paper.value == "18pt_renewal") { return (tsi * 0.000614736); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "24pt_C1S") || document.estiForm.paper.value == "24pt_C1S") { return (tsi * 0.000614736); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "matte_banner") || document.estiForm.paper.value == "matte_banner") { return (tsi * 0.001214736); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "matte_canvas") || document.estiForm.paper.value == "matte_canvas") { return (tsi * 0.002414736); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "biobanner") || document.estiForm.paper.value == "biobanner") { return (tsi * 0.001214736); } } function coverWeight(tsi_cover) { if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "70_nl_rein_book") || document.estiForm.coverPaper.value == "70_nl_rein_book") { return (tsi_cover * .0001469265); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "80_nl_rein_book") || document.estiForm.coverPaper.value == "80_nl_rein_book") { return (tsi_cover * 0.000168421); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "105_nl_rein_book") || document.estiForm.coverPaper.value == "105_nl_rein_book") { return (tsi_cover * 0.000221053); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "65_nl_rein_cover") || document.estiForm.coverPaper.value == "65_nl_rein_cover") { return (tsi_cover * .0002302722157894737); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "80_nl_rein_cover") || document.estiForm.coverPaper.value == "80_nl_rein_cover") { return (tsi_cover * 0.000307368); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "95_nl_rein_cover") || document.estiForm.coverPaper.value == "95_nl_rein_cover") { return (tsi_cover * 0.000366316); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "87_nl_sak_book") || document.estiForm.coverPaper.value == "87_nl_sak_book") { return (tsi_cover * 0.000183158); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "106_nl_sak_book") || document.estiForm.coverPaper.value == "106_nl_sak_book") { return (tsi_cover * 0.000223158); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "96_nl_sak_cover") || document.estiForm.coverPaper.value == "96_nl_sak_cover") { return (tsi_cover * 0.000369231); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "88_nl_pvg_book") || document.estiForm.coverPaper.value == "88_nl_pvg_book") { return (tsi_cover * .0001857142857142857); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "101_nl_pvg_book") || document.estiForm.coverPaper.value == "101_nl_pvg_book") { return (tsi_cover * 0.000212632); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "89_nl_pvg_cover") || document.estiForm.coverPaper.value == "89_nl_pvg_cover") { return (tsi_cover * .0003428571428571429); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "111_nl_pvg_cover") || document.estiForm.coverPaper.value == "111_nl_pvg_cover") { return (tsi_cover * 0.000427368); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "24_nl_ew") || document.estiForm.coverPaper.value == "24_nl_ew") { return (tsi_cover * 0.000128421); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "80_nl_eb_book") || document.estiForm.coverPaper.value == "80_nl_eb_book") { return (tsi_cover * 0.000168421); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "80_nl_ec_cover") || document.estiForm.coverPaper.value == "80_nl_ec_cover") { return (tsi_cover * 0.000307368); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "100_nl_ec_cover") || document.estiForm.coverPaper.value == "100_nl_ec_cover") { return (tsi_cover * 0.000385093); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "60_nl_o_book") || document.estiForm.coverPaper.value == "60_nl_o_book") { return (tsi_cover * .0001263157894736842); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "70_nl_o_book") || document.estiForm.coverPaper.value == "70_nl_o_book") { return (tsi_cover * .0001478260869565217); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "80_nl_o_book") || document.estiForm.coverPaper.value == "80_nl_o_book") { return (tsi_cover * .000168944099378882); } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "same as inside") || document.estiForm.coverPaper.value == "same as inside") { if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "80_nl_rein_book") || document.estiForm.paper.value == "80_nl_rein_book") { return (tsi_cover * 0.000168421); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "105_nl_rein_book") || document.estiForm.paper.value == "105_nl_rein_book") { return (tsi_cover * 0.000221053); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "87_nl_sak_book") || document.estiForm.paper.value == "87_nl_sak_book") { return (tsi_cover * 0.000183158); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "106_nl_sak_book") || document.estiForm.paper.value == "106_nl_sak_book") { return (tsi_cover * 0.000223158); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "101_nl_pvg_book") || document.estiForm.paper.value == "101_nl_pvg_book") { return (tsi_cover * 0.000212632); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "80_nl_eb_book") || document.estiForm.paper.value == "80_nl_eb_book") { return (tsi_cover * 0.000168421); } } } function getUnitWeightOnces(tsi, quantity) { if (document.estiForm.pages) { //this is a multipage document //alert( ((getJobWeight(tsi) / quantity) * 16) + ((coverWeight(tsi_cover) / quantity) * 16)); return ( ((getJobWeight(tsi) / quantity) * 16) + ((coverWeight(tsi_cover) / quantity) * 16)); } else { return ((getJobWeight(tsi) / quantity) * 16) ; } } function getBlankEnvelopesWeight() { if (document.estiForm.blankEnvelopes && document.estiForm.blankEnvelopes.value != "no" && document.estiForm.blankEnvelopesSize && document.estiForm.blankEnvelopesSize.value != "") { var env = document.estiForm.blankEnvelopes.options[document.estiForm.blankEnvelopes.selectedIndex].value; var envWeight = ( (env/250) * 5); } if (document.estiForm.konlyEnvelopes && document.estiForm.konlyEnvelopes.value != "no" && document.estiForm.blankEnvelopesSize && document.estiForm.blankEnvelopesSize.value != "") { var env = document.estiForm.konlyEnvelopes.options[document.estiForm.konlyEnvelopes.selectedIndex].value; var envWeight = ( (env/250) * 5); } if (envWeight && envWeight > 0) { return envWeight; } else { return 0; } } function switchDiv(div_id) { if (document.getElementById(div_id)) { var style_sheet = getStyleObject(div_id); if (style_sheet) { hideAll(); changeObjectVisibility(div_id, "visible"); } else { alert("Sorry, this only works in browsers that support Dynamic HTML (sd)"); } } } function switchDivBetter(div_id) { if (document.getElementById(div_id)) { var style_sheet = getStyleObject(div_id); if (style_sheet) { hideAllBetter(); changeObjectVisibilityBetter(div_id, "block"); } else { alert("Sorry, this only works in browsers that support Dynamic HTML (sdb)"); } } } function changeObjectVisibility(objectId, newVisibility) { // first get the object's stylesheet var styleObject = getStyleObject(objectId); /* then if we find a stylesheet, set its visibility as requested */ if (styleObject) { styleObject.visibility = newVisibility; return true; } else { return false; } } function stationerySmartQuantitySum() { document.estiForm.stationeryBizCardQuantity.value = 0; if (document.getElementById('bc_name_one') && document.getElementById('bc_name_one').style.display == 'block') { document.estiForm.stationeryBizCardQuantity.value = parseInt(document.estiForm.stationeryBizCardQuantity.value) + parseInt(document.estiForm.cardQuant1.value); } if (document.getElementById('bc_name_two') && document.getElementById('bc_name_two').style.display == 'block') { document.estiForm.stationeryBizCardQuantity.value = parseInt(document.estiForm.stationeryBizCardQuantity.value) + parseInt(document.estiForm.cardQuant2.value); } if (document.getElementById('bc_name_three') && document.getElementById('bc_name_three').style.display == 'block') { document.estiForm.stationeryBizCardQuantity.value = parseInt(document.estiForm.stationeryBizCardQuantity.value) + parseInt(document.estiForm.cardQuant3.value); } if (document.getElementById('bc_name_four') && document.getElementById('bc_name_four').style.display == 'block') { document.estiForm.stationeryBizCardQuantity.value = parseInt(document.estiForm.stationeryBizCardQuantity.value) + parseInt(document.estiForm.cardQuant4.value); } if (document.getElementById('bc_name_five') && document.getElementById('bc_name_five').style.display == 'block') { document.estiForm.stationeryBizCardQuantity.value = parseInt(document.estiForm.stationeryBizCardQuantity.value) + parseInt(document.estiForm.cardQuant5.value); } if (document.getElementById('bc_name_six') && document.getElementById('bc_name_six').style.display == 'block') { document.estiForm.stationeryBizCardQuantity.value = parseInt(document.estiForm.stationeryBizCardQuantity.value) + parseInt(document.estiForm.cardQuant6.value); } if (document.getElementById('bc_name_seven') && document.getElementById('bc_name_seven').style.display == 'block') { document.estiForm.stationeryBizCardQuantity.value = parseInt(document.estiForm.stationeryBizCardQuantity.value) + parseInt(document.estiForm.cardQuant7.value); } if (document.getElementById('bc_name_eight') && document.getElementById('bc_name_eight').style.display == 'block') { document.estiForm.stationeryBizCardQuantity.value = parseInt(document.estiForm.stationeryBizCardQuantity.value) + parseInt(document.estiForm.cardQuant8.value); } } function smartQuantitySum() { document.estiForm.quantity.value = 0; if (document.getElementById('bc_name_one') && document.getElementById('bc_name_one').style.display == 'block') { document.estiForm.quantity.value = parseInt(document.estiForm.quantity.value) + parseInt(document.estiForm.cardQuant1.value); } if (document.getElementById('bc_name_two') && document.getElementById('bc_name_two').style.display == 'block') { document.estiForm.quantity.value = parseInt(document.estiForm.quantity.value) + parseInt(document.estiForm.cardQuant2.value); } if (document.getElementById('bc_name_three') && document.getElementById('bc_name_three').style.display == 'block') { document.estiForm.quantity.value = parseInt(document.estiForm.quantity.value) + parseInt(document.estiForm.cardQuant3.value); } if (document.getElementById('bc_name_four') && document.getElementById('bc_name_four').style.display == 'block') { document.estiForm.quantity.value = parseInt(document.estiForm.quantity.value) + parseInt(document.estiForm.cardQuant4.value); } if (document.getElementById('bc_name_five') && document.getElementById('bc_name_five').style.display == 'block') { document.estiForm.quantity.value = parseInt(document.estiForm.quantity.value) + parseInt(document.estiForm.cardQuant5.value); } if (document.getElementById('bc_name_six') && document.getElementById('bc_name_six').style.display == 'block') { document.estiForm.quantity.value = parseInt(document.estiForm.quantity.value) + parseInt(document.estiForm.cardQuant6.value); } if (document.getElementById('bc_name_seven') && document.getElementById('bc_name_seven').style.display == 'block') { document.estiForm.quantity.value = parseInt(document.estiForm.quantity.value) + parseInt(document.estiForm.cardQuant7.value); } if (document.getElementById('bc_name_eight') && document.getElementById('bc_name_eight').style.display == 'block') { document.estiForm.quantity.value = parseInt(document.estiForm.quantity.value) + parseInt(document.estiForm.cardQuant8.value); } } function w2pBizCardSum() { document.estiForm.quantity.value = 0; productFamily = document.estiForm.productFamily.value; cardQuant1 = document.estiForm.cardQuant1.value; if (productFamily == "w2pBusCard-1person") { document.estiForm.quantity.value = cardQuant1; } else if (productFamily == "w2pBusCard-2person") { if (cardQuant1 == "250") { document.estiForm.quantity.value = 500; } if (cardQuant1 == "500") { document.estiForm.quantity.value = 1000; } if (cardQuant1 == "1000") { document.estiForm.quantity.value = 2000; } } else if (productFamily == "w2pBusCard-3person") { if (cardQuant1 == "250") { document.estiForm.quantity.value = 750; } if (cardQuant1 == "500") { document.estiForm.quantity.value = 1500; } if (cardQuant1 == "1000") { document.estiForm.quantity.value = 3000; } } else if (productFamily == "w2pBusCard-4person") { if (cardQuant1 == "250") { document.estiForm.quantity.value = 1000; } if (cardQuant1 == "500") { document.estiForm.quantity.value = 2000; } if (cardQuant1 == "1000") { document.estiForm.quantity.value = 4000; } } } var left = null; var top = null; function setVisibilityAndPosition(objectId, x, y) { if (document.all) { // IE4+ //document.all[objectId].style.posLeft = window.event.x + document.body.scrollLeft + x; //document.all[objectId].style.posTop = window.event.y + document.body.scrollTop + y; // Lots of problems with position of popups in IE, so I just set it to 0, 0... fix this sometime! BV document.all[objectId].style.posLeft = 150; document.all[objectId].style.posTop = 300; document.all[objectId].style.visibility = 'visible'; return; } else if (document.layers) { // NN 4+ or W3C DOM document.layers[object].left = left + x; document.layers[object].top = top + y; document.layers[object].visibility = 'visible'; return; } else if (document.getElementById && document.getElementById(objectId)) { //Mozilla, Netscape 6 + 7 document.getElementById(objectId).style.left = left + x + 'px'; document.getElementById(objectId).style.top = top + y + 'px'; document.getElementById(objectId).style.visibility = 'visible'; return; } else { alert("Sorry, this only works in browsers that support Dynamic HTML"); } } function setAbsoluteVisibilityAndPosition(objectId, x, y) { if (document.all) { // IE4+ //document.all[objectId].style.posLeft = window.event.x + document.body.scrollLeft + x; //document.all[objectId].style.posTop = window.event.y + document.body.scrollTop + y; document.all[objectId].style.posLeft = x; document.all[objectId].style.posTop = y; document.all[objectId].style.visibility = 'visible'; return; } else if (document.layers) { // NN 4+ or W3C DOM document.layers[object].left = x; document.layers[object].top = y; document.layers[object].visibility = 'visible'; return; } else if (document.getElementById && document.getElementById(objectId)) { //Mozilla, Netscape 6 + 7 document.getElementById(objectId).style.left = x; document.getElementById(objectId).style.top = y; document.getElementById(objectId).style.visibility = 'visible'; return; } else { alert("Sorry, this only works in browsers that support Dynamic HTML"); } } function hideLayer(objectId) { if (document.layers && document.layers[objectId]) { document.layers[objectId].visibility = 'hidden'; } else if (document.all) { document.all[objectId].style.visibility = 'hidden'; } else if (document.getElementById) { document.getElementById(objectId).style.visibility = 'hidden'; } } function hideAll() { changeObjectVisibility("bind_show","hidden"); changeObjectVisibility("bind_hide","hidden"); } function hideAllBetter() { changeObjectVisibilityBetter("bind_show","none"); changeObjectVisibilityBetter("bind_hide","none"); } function setMouseCoordinate(e) { if (document.layers) { // NN 4+ left = e.pageX; top = e.pageY; } else if (document.all) { // IE 4+ left = document.body.scrollLeft + event.clientX; top = document.body.scrollTop + event.clientY; } else if (document.getElementById) { // NN 6+ left = e.pageX; top = e.pageY; } //window.status = "left=" + left + ", top=" + top; } function formatCurrency2(num) { num = num.toString().replace(/\$|\,/g,''); if(isNaN(num)) num = "0"; sign = (num == (num = Math.abs(num))); num = Math.floor(num*100+0.50000000001); num = Math.round(num/100).toString(); for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3)); return (((sign)?'':'-') + '$' + num + ".00"); } function formatCurrency(num) { num = num.toString().replace(/\$|\,/g,''); if(isNaN(num)) num = "0"; sign = (num == (num = Math.abs(num))); num = Math.floor(num*100+0.50000000001); cents = num%100; num = Math.floor(num/100).toString(); if(cents<10) cents = "0" + cents; for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3)); return (((sign)?'':'-') + '$' + num + '.' + cents); } function roundAmount(n) { var s = "" + Math.round(n * 100) / 100 var i = s.indexOf('.') if (i < 0) return s + ".00" var t = s.substring(0, i + 1) + s.substring(i + 1, i + 3) if (i + 2 == s.length) t += "0" return t } function roundToInteger(n) { var s = "" + Math.round(n * 100) / 100 var i = s.indexOf('.') var t = s.substring(0, s.indexOf('.')); return t; /*if (i < 0) return s + ".00" var t = s.substring(0, i + 1) + s.substring(i + 1, i + 3) if (i + 2 == s.length) t += "0" return t */ } function showDiv(div_id) { var style_sheet = getStyleObject(div_id); if (style_sheet) { //set changeObjectVisibility(div_id, "visible"); } else { alert("sorry, this only works in browsers that support Dynamic HTML"); } } function hideDiv(div_id) { var style_sheet = getStyleObject(div_id); if (style_sheet) { changeObjectVisibility(div_id, "hidden"); } else { alert("sorry, this only works in browsers that support Dynamic HTML"); } } function popUp(url) { sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450'); self.name = "mainWin"; } function popUp(url,height,width) { sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=' + width + ',height=' + height); self.name = "mainWin"; } function infoBanner() { if (document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value.indexOf("_nl_") > -1) { pull(); } else if (document.estiForm.coverPaper) if (document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value.indexOf("_nl_") > -1) { pull(); } else { draw(); } } function paperMarketAdjustment(my_total, type, quantity) { paperMarketFactor = getPaperMarketFactor(type, quantity); paperMarketAdj = (my_total * paperMarketFactor); //alert(paperMarketAdj); document.estiForm.paperMarketAdj.value=formatCurrency(paperMarketAdj); return paperMarketAdj; } function getPaperMarketFactor(type, quantity) { if (type == "multi") { if (document.estiForm.coverPaper.disabled == false && ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value.indexOf("_nl_") > -1) || document.estiForm.coverPaper.value.indexOf("_nl_") > -1 )) { return ".05"; } else if ( (document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value.indexOf("_nl_") > -1) || document.estiForm.paper.value.indexOf("_nl_") > -1 ) { return ".05"; } else { return "0"; } } else if (type == "single") { if ( (document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value.indexOf("_nl_") > -1) || document.estiForm.paper.value.indexOf("_nl_") > -1 || document.estiForm.paper.value == "20pt_kraftboard") { if (quantity > 7499 && quantity < 15000) { //alert ( (((quantity * .00001333) - .1) * (-1)) + .05); return ( (((quantity * .00001333) - .1) * (-1)) + .05); } else if (quantity > 14999) { return "-.05"; } else { return ".05"; } } else if (quantity > 7499 && quantity < 15000) { //alert((quantity * .00001333) - .1) * (-1); return ((quantity * .00001333) - .1) * (-1); } else if (quantity >= 15000) { return "-.1"; } else { return "0"; } } } function marketAdjustment(my_total, type, quantity) { marketFactor = getMarketFactor(type, quantity); marketAdj = (my_total * marketFactor); document.estiForm.marketAdj.value=formatCurrency(marketAdj); return marketAdj; } function getMarketFactor(type, quantity) { if (type == "multi") { //alert(0.1 + 0.1); if (document.estiForm.pages.value >= 28) return (0.1 + 0.1); else return (0.1); } else if (type == "single") { return '0.1'; } } function marketAdjustmentByQuantity(my_total, si, colors, type, quantity) { if (si <= 7) marketFactorByQuantity = getMarketFactorByQuantity("buscard", colors, quantity); else marketFactorByQuantity = getMarketFactorByQuantity(type, colors, quantity); marketAdjByQuantity = (my_total * marketFactorByQuantity); //alert(marketAdjByQuantity); document.estiForm.marketAdjByQuantity.value=formatCurrency(marketAdjByQuantity); return marketAdjByQuantity; } function getMarketFactorByQuantity(type, colors, quantity) { if (type == "multi") { if (quantity <= 5000) { return '0'; } if (quantity > 5001 && quantity <= 10000) { return '0'; } if (quantity > 10000 && quantity <= 25000) { return '0'; } if (quantity > 25000) { return '0.15'; } } else if (type == "buscard") { if (colors == "4over4") { if (quantity <= 30000) return 0; } if (colors == "4over1") { if (quantity <= 30000) return 0; } if (colors == "4over0") { if (quantity <= 30000) return 0; } } /*else if (type == "buscard") { if (colors == "4over0") { if (quantity <= 500) return -.308; if (quantity <= 1000) return -.015; if (quantity <= 1500) return .26; if (quantity <= 2000) return .525; if (quantity <= 2500) return .775; if (quantity <= 3000) return 1.012; if (quantity <= 3500) return 1.24; if (quantity <= 4000) return 1.455; if (quantity <= 4500) return 1.665; if (quantity <= 5000) return 2.147; if (quantity <= 6500) return 2.596; if (quantity <= 8000) return 3.045; if (quantity <= 10000) return 3.471; if (quantity <= 15000) return 4.246; if (quantity <= 20000) return 4.796; if (quantity <= 25000) return 5.222; if (quantity <= 30000) return 5.854; } else if (colors == "4over1") { if (quantity <= 500) return -.308; if (quantity <= 1000) return .105; if (quantity <= 1500) return .435; if (quantity <= 2000) return .742; if (quantity <= 2500) return 1.03; if (quantity <= 3000) return 1.31; if (quantity <= 3500) return 1.57; if (quantity <= 4000) return 1.815; if (quantity <= 4500) return 2.055; if (quantity <= 5000) return 2.28; if (quantity <= 8000) return 3.455; if (quantity <= 10000) return 4.607; if (quantity <= 15000) return 5.579; if (quantity <= 20000) return 6.785; if (quantity <= 25000) return 7.446; if (quantity <= 30000) return 8.015; } else if (colors == "4over4") { if (quantity <= 500) return -.147; if (quantity <= 1000) return .645; if (quantity <= 2000) return 1.136; if (quantity <= 3000) return 1.845; if (quantity <= 4000) return 2.329; if (quantity <= 5000) return 2.754; if (quantity <= 8000) return 3.799; if (quantity <= 10000) return 3.964; if (quantity <= 12000) return 4.178; if (quantity <= 15000) return 4.525; if (quantity <= 20000) return 4.972; if (quantity <= 25000) return 5.319; if (quantity <= 30000) return 5.602; } else if (colors == "4over4") { if (quantity <= 500) return -.147; if (quantity <= 1000) return .645; if (quantity <= 2000) return 1.136; if (quantity <= 3000) return 1.845; if (quantity <= 4000) return 2.329; if (quantity <= 5000) return 2.754; if (quantity <= 8000) return 3.799; if (quantity <= 10000) return 3.964; if (quantity <= 12000) return 4.178; if (quantity <= 15000) return 4.525; if (quantity <= 20000) return 4.972; if (quantity <= 25000) return 5.319; if (quantity <= 30000) return 5.602; } } */ else if (type == "single") { if (quantity <= 5000) { return '0'; } if (quantity >= 5001 && quantity <= 10000) { return '0'; } if (quantity > 10000 && quantity <= 25000) { return '0'; } if (quantity > 25000) { return '0.15'; } } } function getEcoAudit() { //alert ("Job Weight: " + getJobWeight(tsi)); var env_trees = 0; var env_water = 0; var env_solidwaste = 0; var env_ghgasses = 0; var env2_trees = 0; var env2_water = 0; var env2_solidwaste = 0; var env2_ghgasses = 0; var env_carmiles = 0; var env2_lbswood = 0; var env_lbswood = 0; var coverTrees = 0; var coverWater = 0; var coverSolidwaste = 0; var coverGhgasses = 0; var coverCarmiles = 0; var coverLbswood = 0; var A6_weight = 0; var A7_weight = 0; var ltrhd_weight = 0; var ltrhd_trees = 0; var ltrhd_water = 0; var ltrhd_solidwaste = 0; var ltrhd_ghgasses = 0; var ltrhd_carmiles = 0; var ltrhd_lbswood = 0; var blnkltrhd_weight = 0; var blnkltrhd_trees = 0; var blnkltrhd_water = 0; var blnkltrhd_solidwaste = 0; var blnkltrhd_ghgasses = 0; var blnkltrhd_carmiles = 0; var blnkltrhd_lbswood = 0; // do blank envelopes first if (document.estiForm.blankEnvelopes && document.estiForm.blankEnvelopes.value != "no" && document.estiForm.blankEnvelopesSize && document.estiForm.blankEnvelopesSize.value != "") { if (document.estiForm.blankEnvelopesSize.value == "A-6") { var A6_weight = ( (parseInt(document.estiForm.blankEnvelopes.value)/250) * 3.3125) var env_trees = ( .96 * (A6_weight/2000) * 24 + .04 * (A6_weight/2000) * 12); var env_water = ( (20519.6 * (A6_weight/2000)) - (10484 * (A6_weight/2000)) ) var env_solidwaste = ( (2278.349 * (A6_weight/2000)) - (1168.1357 * (A6_weight/2000)) ) var env_ghgasses = ( (5789.724 * (A6_weight/2000)) - (3597.112 * (A6_weight/2000)) ) var env_carmiles = ( (env_ghgasses/11440) * 10000 ) var env_lbswood = ( 3.46666666666667 * (A6_weight) ) updateText("A6_weight" , (A6_weight.toFixed(1))); } else if (document.estiForm.blankEnvelopesSize.value == "A-7") { var A7_weight = ( (parseInt(document.estiForm.blankEnvelopes.value)/250) * 3.569) var env_trees = ( .96 * (A7_weight/2000) * 24 + .04 * (A7_weight/2000) * 12); var env_water = ( (20519.6 * (A7_weight/2000)) - (10484 * (A7_weight/2000)) ) var env_solidwaste = ( (2278.349 * (A7_weight/2000)) - (1168.1357 * (A7_weight/2000)) ) var env_ghgasses = ( (5789.724 * (A7_weight/2000)) - (3597.112 * (A7_weight/2000)) ) var env_carmiles = ( (env_ghgasses/11440) * 10000 ) var env_lbswood = ( 3.46666666666667 * (A7_weight) ) updateText("A7_weight" , (A7_weight.toFixed(1))); } updateText("env_trees", (env_trees.toFixed(2))); updateText("env_water", (env_water.toFixed(1))); updateText("env_solidwaste", (env_solidwaste.toFixed(1))); updateText("env_ghgasses", (env_ghgasses.toFixed(1))); updateText("env_carmiles", (env_carmiles.toFixed(1))); updateText("env_lbswood", (env_lbswood.toFixed(1))); } // printed black envelopes if (document.estiForm.konlyEnvelopes && document.estiForm.konlyEnvelopes.value != "no" && document.estiForm.blankEnvelopesSize && document.estiForm.blankEnvelopesSize.value != "") { if (document.estiForm.blankEnvelopesSize.value == "A-6") { var A6_weight2 = ( (parseInt(document.estiForm.konlyEnvelopes.value)/250) * 3.3125) var env2_trees = ( .96 * (A6_weight2/2000) * 24 + .04 * (A6_weight2/2000) * 12); var env2_water = ( (20519.6 * (A6_weight2/2000)) - (10484 * (A6_weight2/2000)) ) var env2_solidwaste = ( (2278.349 * (A6_weight2/2000)) - (1168.1357 * (A6_weight2/2000)) ) var env2_ghgasses = ( (5789.724 * (A6_weight2/2000)) - (3597.112 * (A6_weight2/2000)) ) var env2_carmiles = ( (env2_ghgasses/11440) * 10000 ) var env2_lbswood = ( 3.46666666666667 * (A6_weight) ) updateText("A6_weight2" , (A6_weight2.toFixed(1))); } else if (document.estiForm.blankEnvelopesSize.value == "A-7") { var A7_weight2 = ( (parseInt(document.estiForm.konlyEnvelopes.value)/250) * 3.569) var env2_trees = ( .96 * (A7_weight/2000) * 24 + .04 * (A7_weight2/2000) * 12); var env2_water = ( (20519.6 * (A7_weight2/2000)) - (10484 * (A7_weight2/2000)) ) var env2_solidwaste = ( (2278.349 * (A7_weight2/2000)) - (1168.1357 * (A7_weight2/2000)) ) var env2_ghgasses = ( (5789.724 * (A7_weight2/2000)) - (3597.112 * (A7_weight2/2000)) ) var env2_carmiles = ( (env2_ghgasses/11440) * 10000 ) var env2_lbswood = ( 3.46666666666667 * (A7_weight) ) updateText("A7_weight2" , (A7_weight2.toFixed(1))); } updateText("env2_trees", (env_trees.toFixed(2))); updateText("env2_water", (env_water.toFixed(1))); updateText("env2_solidwaste", (env_solidwaste.toFixed(1))); updateText("env2_ghgasses", (env_ghgasses.toFixed(1))); updateText("env2_carmiles", (env_carmiles.toFixed(1))); updateText("env2_lbswood", (env2_lbswood.toFixed(1))); } // w2p product blank envelopes if (document.estiForm.w2pEnvelopesBlank && document.estiForm.w2pEnvelopesBlank.value != "0") { if (document.estiForm.finalWidth.value == "6") { var A6_weight = ( (parseInt(document.estiForm.w2pEnvelopesBlank.value)/250) * 3.3125) var env_trees = ( .96 * (A6_weight/2000) * 24 + .04 * (A6_weight/2000) * 12); var env_water = ( (20519.6 * (A6_weight/2000)) - (10484 * (A6_weight/2000)) ) var env_solidwaste = ( (2278.349 * (A6_weight/2000)) - (1168.1357 * (A6_weight/2000)) ) var env_ghgasses = ( (5789.724 * (A6_weight/2000)) - (3597.112 * (A6_weight/2000)) ) var env_carmiles = ( (env_ghgasses/11440) * 10000 ) var env_lbswood = ( 3.46666666666667 * (A6_weight) ) updateText("A6_weight" , (A6_weight.toFixed(1))); } else if (document.estiForm.finalWidth.value == "7") { var A7_weight = ( (parseInt(document.estiForm.w2pEnvelopesBlank.value)/250) * 3.569) var env_trees = ( .96 * (A7_weight/2000) * 24 + .04 * (A7_weight/2000) * 12); var env_water = ( (20519.6 * (A7_weight/2000)) - (10484 * (A7_weight/2000)) ) var env_solidwaste = ( (2278.349 * (A7_weight/2000)) - (1168.1357 * (A7_weight/2000)) ) var env_ghgasses = ( (5789.724 * (A7_weight/2000)) - (3597.112 * (A7_weight/2000)) ) var env_carmiles = ( (env_ghgasses/11440) * 10000 ) var env_lbswood = ( 3.46666666666667 * (A7_weight) ) updateText("A7_weight" , (A7_weight.toFixed(1))); } updateText("env_trees", (env_trees.toFixed(2))); updateText("env_water", (env_water.toFixed(1))); updateText("env_solidwaste", (env_solidwaste.toFixed(1))); updateText("env_ghgasses", (env_ghgasses.toFixed(1))); updateText("env_carmiles", (env_carmiles.toFixed(1))); updateText("env_lbswood", (env_lbswood.toFixed(1))); } // w2p product printed envelopes if (document.estiForm.w2pEnvelopesPrint && document.estiForm.w2pEnvelopesPrint.value != "0") { if (document.estiForm.finalWidth.value == "6") { var A6_weight2 = ( (parseInt(document.estiForm.w2pEnvelopesPrint.value)/250) * 3.3125) var env2_trees = ( .96 * (A6_weight2/2000) * 24 + .04 * (A6_weight2/2000) * 12); var env2_water = ( (20519.6 * (A6_weight2/2000)) - (10484 * (A6_weight2/2000)) ) var env2_solidwaste = ( (2278.349 * (A6_weight2/2000)) - (1168.1357 * (A6_weight2/2000)) ) var env2_ghgasses = ( (5789.724 * (A6_weight2/2000)) - (3597.112 * (A6_weight2/2000)) ) var env2_carmiles = ( (env2_ghgasses/11440) * 10000 ) var env2_lbswood = ( 3.46666666666667 * (A6_weight) ) updateText("A6_weight2" , (A6_weight2.toFixed(1))); } else if (document.estiForm.finalWidth.value == "7") { var A7_weight2 = ( (parseInt(document.estiForm.w2pEnvelopesPrint.value)/250) * 3.569) var env2_trees = ( .96 * (A7_weight2/2000) * 24 + .04 * (A7_weight2/2000) * 12); var env2_water = ( (20519.6 * (A7_weight2/2000)) - (10484 * (A7_weight2/2000)) ) var env2_solidwaste = ( (2278.349 * (A7_weight2/2000)) - (1168.1357 * (A7_weight2/2000)) ) var env2_ghgasses = ( (5789.724 * (A7_weight2/2000)) - (3597.112 * (A7_weight2/2000)) ) var env2_carmiles = ( (env2_ghgasses/11440) * 10000 ) var env2_lbswood = ( 3.46666666666667 * (A7_weight) ) updateText("A7_weight2" , (A7_weight2.toFixed(1))); } updateText("env2_trees", (env_trees.toFixed(2))); updateText("env2_water", (env_water.toFixed(1))); updateText("env2_solidwaste", (env_solidwaste.toFixed(1))); updateText("env2_ghgasses", (env_ghgasses.toFixed(1))); updateText("env2_carmiles", (env_carmiles.toFixed(1))); updateText("env2_lbswood", (env2_lbswood.toFixed(1))); } // next, if stationery... if (document.estiForm.productFamily && document.estiForm.productFamily.value.indexOf("Stationery") != -1) { tsi = (7 * (parseInt(document.estiForm.stationeryBizCardQuantity.value))); if (document.estiForm.stationeryEnvelopes && document.estiForm.stationeryEnvelopes.value != "none") { if (document.estiForm.stationeryEnvelopesSize.value == "#10 (9.5 x 4.125)") { var no10_weight = ( (parseInt(document.estiForm.stationeryEnvelopes.value)/500) * 5.7375) var env_trees = ( .96 * (no10_weight/2000) * 24 + .04 * (no10_weight/2000) * 12); var env_water = ( (20519.6 * (no10_weight/2000)) - (10484 * (no10_weight/2000)) ) var env_solidwaste = ( (2278.349 * (no10_weight/2000)) - (1168.1357 * (no10_weight/2000)) ) var env_ghgasses = ( (5789.724 * (no10_weight/2000)) - (3597.112 * (no10_weight/2000)) ) var env_carmiles = ( (env_ghgasses/11440) * 10000 ) var env_lbswood = ( 3.46666666666667 * (no10_weight) ) updateText("no10_weight" , (no10_weight.toFixed(1))); } else if (document.estiForm.stationeryEnvelopesSize.value == "#9 (8.875 x 3.875)") { var no9_weight = ( (parseInt(document.estiForm.stationeryEnvelopes.value)/500) * 5.0438) var env_trees = ( .96 * (no9_weight/2000) * 24 + .04 * (no9_weight/2000) * 12); var env_water = ( (20519.6 * (no9_weight/2000)) - (10484 * (no9_weight/2000)) ) var env_solidwaste = ( (2278.349 * (no9_weight/2000)) - (1168.1357 * (no9_weight/2000)) ) var env_ghgasses = ( (5789.724 * (no9_weight/2000)) - (3597.112 * (no9_weight/2000)) ) var env_carmiles = ( (env_ghgasses/11440) * 10000 ) var env_lbswood = ( 3.46666666666667 * (no9_weight) ) updateText("no9_weight" , (no9_weight.toFixed(1))); } else if (document.estiForm.stationeryEnvelopesSize.value == "A6 (6.5 x 4.75)") { var A6_weight = ( (parseInt(document.estiForm.stationeryEnvelopes.value)/250) * 3.3125) var env_trees = ( .96 * (A6_weight/2000) * 24 + .04 * (A6_weight/2000) * 12); var env_water = ( (20519.6 * (A6_weight/2000)) - (10484 * (A6_weight/2000)) ) var env_solidwaste = ( (2278.349 * (A6_weight/2000)) - (1168.1357 * (A6_weight/2000)) ) var env_ghgasses = ( (5789.724 * (A6_weight/2000)) - (3597.112 * (A6_weight/2000)) ) var env_carmiles = ( (env_ghgasses/11440) * 10000 ) var env_lbswood = ( 3.46666666666667 * (A6_weight) ) updateText("A6_weight" , (A6_weight.toFixed(1))); } else if (document.estiForm.stationeryEnvelopesSize.value == "A7 (7.25 x 5.25)") { var A7_weight = ( (parseInt(document.estiForm.stationeryEnvelopes.value)/250) * 3.569) var env_trees = ( .96 * (A7_weight/2000) * 24 + .04 * (A7_weight/2000) * 12); var env_water = ( (20519.6 * (A7_weight/2000)) - (10484 * (A7_weight/2000)) ) var env_solidwaste = ( (2278.349 * (A7_weight/2000)) - (1168.1357 * (A7_weight/2000)) ) var env_ghgasses = ( (5789.724 * (A7_weight/2000)) - (3597.112 * (A7_weight/2000)) ) var env_carmiles = ( (env_ghgasses/11440) * 10000 ) var env_lbswood = ( 3.46666666666667 * (A7_weight) ) updateText("A7_weight" , (A7_weight.toFixed(1))); } } updateText("env_trees", (env_trees.toFixed(2))); updateText("env_water", (env_water.toFixed(1))); updateText("env_solidwaste", (env_solidwaste.toFixed(1))); updateText("env_ghgasses", (env_ghgasses.toFixed(1))); updateText("env_carmiles", (env_carmiles.toFixed(1))); updateText("env_lbswood", (env_lbswood.toFixed(1))); if (document.estiForm.stationeryLetterhead && document.estiForm.stationeryLetterhead.value != "none") { var ltrhd_weight = ( (parseInt(document.estiForm.stationeryLetterhead.value)/500) * 6.35) var ltrhd_trees = ( .96 * (ltrhd_weight/2000) * 24 + .04 * (ltrhd_weight/2000) * 12); var ltrhd_water = ( (20519.6 * (ltrhd_weight/2000)) - (10484 * (ltrhd_weight/2000)) ) var ltrhd_solidwaste = ( (2278.349 * (ltrhd_weight/2000)) - (1168.1357 * (ltrhd_weight/2000)) ) var ltrhd_ghgasses = ( (5789.724 * (ltrhd_weight/2000)) - (3597.112 * (ltrhd_weight/2000)) ) var ltrhd_carmiles = ( (ltrhd_weight/11440) * 10000 ) var ltrhd_lbswood = ( 3.46666666666667 * (ltrhd_weight) ) updateText("ltrhd_weight" , (ltrhd_weight.toFixed(1))); updateText("ltrhd_trees", (ltrhd_trees.toFixed(2))); updateText("ltrhd_water", (ltrhd_water.toFixed(1))); updateText("ltrhd_solidwaste", (ltrhd_solidwaste.toFixed(1))); updateText("ltrhd_ghgasses", (ltrhd_ghgasses.toFixed(1))); updateText("ltrhd_carmiles", (ltrhd_carmiles.toFixed(1))); updateText("ltrhd_lbswood", (ltrhd_lbswood.toFixed(1))); } if (document.estiForm.stationeryLetterheadBlank && document.estiForm.stationeryLetterheadBlank.value != "none") { var blnkltrhd_weight = ( (parseInt(document.estiForm.stationeryLetterheadBlank.value)/500) * 6.35) var blnkltrhd_trees = ( .96 * (blnkltrhd_weight/2000) * 24 + .04 * (blnkltrhd_weight/2000) * 12); var blnkltrhd_water = ( (20519.6 * (blnkltrhd_weight/2000)) - (10484 * (blnkltrhd_weight/2000)) ) var blnkltrhd_solidwaste = ( (2278.349 * (blnkltrhd_weight/2000)) - (1168.1357 * (blnkltrhd_weight/2000)) ) var blnkltrhd_ghgasses = ( (5789.724 * (blnkltrhd_weight/2000)) - (3597.112 * (blnkltrhd_weight/2000)) ) var blnkltrhd_carmiles = ( (blnkltrhd_weight/11440) * 10000 ) var blnkltrhd_lbswood = ( 3.46666666666667 * (blnkltrhd_weight) ) updateText("blnkltrhd_weight" , (blnkltrhd_weight.toFixed(1))); updateText("blnkltrhd_trees", (blnkltrhd_trees.toFixed(2))); updateText("blnkltrhd_water", (blnkltrhd_water.toFixed(1))); updateText("blnkltrhd_solidwaste", (blnkltrhd_solidwaste.toFixed(1))); updateText("blnkltrhd_ghgasses", (blnkltrhd_ghgasses.toFixed(1))); updateText("blnkltrhd_carmiles", (blnkltrhd_carmiles.toFixed(1))); updateText("blnkltrhd_lbswood", (blnkltrhd_lbswood.toFixed(1))); } } // next, if multi //alert(document.estiForm.productFamily.value); if (document.estiForm.pages && !document.estiForm.productFamily.value == "DLCalendar" && !document.estiForm.productFamily.value == "HouseCalendar" && !document.estiForm.productFamily == "DLPhotobook") { //this is a multipage document 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; //square inches for unfolded sheets si = (height * width * 2); //total square inches for cover tsi_cover = (si * quantity); if (document.estiForm.coverPaper.options && // cover is Everest (document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "24_nl_ew" || document.estiForm.coverPaper.value == "24_nl_ew" || document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "80_nl_eb_book" || document.estiForm.coverPaper.value == "80_nl_eb_book" || document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "80_nl_ec_cover" || document.estiForm.coverPaper.value == "80_nl_ec_cover" || document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "100_nl_ec_cover" || document.estiForm.coverPaper.value == "100_nl_ec_cover" || (document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "same as inside" && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "80_nl_eb_book"))) { var coverTrees = ( .96 * (coverWeight(tsi_cover)/2000) * 24 + .04 * (coverWeight(tsi_cover)/2000) * 12); var coverWater = ( (20519.6 * (coverWeight(tsi_cover)/2000)) - (10484 * (coverWeight(tsi_cover)/2000)) ); var coverSolidwaste = ( (2278.349 * (coverWeight(tsi_cover)/2000)) - (1168.1357 * (coverWeight(tsi_cover)/2000)) ); var coverGhgasses = ( (5789.724 * (coverWeight(tsi_cover)/2000)) - (3597.112 * (coverWeight(tsi_cover)/2000)) ); var coverCarmiles = ( (coverGhgasses/11440) * 10000 ); var coverLbswood = ( 3.46666666666667 * (coverWeight(tsi_cover)) ); } else if (document.estiForm.coverPaper.options && // cover is Reincarnation (document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "70_nl_rein_book" || document.estiForm.coverPaper.value == "70_nl_rein_book" || document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "80_nl_rein_book" || document.estiForm.coverPaper.value == "80_nl_rein_book" || document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "105_nl_rein_book" || document.estiForm.coverPaper.value == "105_nl_rein_book" || document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "65_nl_rein_cover" || document.estiForm.coverPaper.value == "65_nl_rein_cover" || document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "80_nl_rein_cover" || document.estiForm.coverPaper.value == "80_nl_rein_cover" || document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "95_nl_rein_cover" || document.estiForm.coverPaper.value == "95_nl_rein_cover" || (document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "same as inside" && (document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "80_nl_rein_book" || (document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "105_nl_rein_book"))))) { var coverTrees = ( .47 * (coverWeight(tsi_cover)/2000) * 24 + .03 * (coverWeight(tsi_cover)/2000) * 12); var coverWater = ( (17851.968 * (coverWeight(tsi_cover)/2000)) - (15320.5 * (coverWeight(tsi_cover)/2000)) ); var coverSolidwaste = ( (2207.67 * (coverWeight(tsi_cover)/2000)) - (1653.874 * (coverWeight(tsi_cover)/2000)) ); var coverGhgasses = ( (5569.508 * (coverWeight(tsi_cover)/2000)) - (4633.694 * (coverWeight(tsi_cover)/2000)) ); var coverCarmiles = ( (coverGhgasses/11440) * 10000 ); var coverLbswood = ( (2.84444444444444 * (coverWeight(tsi_cover))) - (1.55555555555556 * (coverWeight(tsi_cover))) ); } else if (document.estiForm.coverPaper.options && // cover is Sakura (still awaiting these numbers!) (document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "87_nl_sak_book" || document.estiForm.coverPaper.value == "87_nl_sak_book" || document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "106_nl_sak_book" || document.estiForm.coverPaper.value == "106_nl_sak_book" || document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "96_nl_sak_cover" || document.estiForm.coverPaper.value == "96_nl_sak_cover" || (document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "same as inside" && (document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "87_nl_sak_book" || (document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "106_nl_sak_book"))))) { var coverTrees = ( .96 * (coverWeight(tsi_cover)/2000) * 24 + .04 * (coverWeight(tsi_cover)/2000) * 12); var coverWater = ( (20519.6 * (coverWeight(tsi_cover)/2000)) - (10484 * (coverWeight(tsi_cover)/2000)) ); var coverSolidwaste = ( (2278.349 * (coverWeight(tsi_cover)/2000)) - (1168.1357 * (coverWeight(tsi_cover)/2000)) ); var coverGhgasses = ( (5789.724 * (coverWeight(tsi_cover)/2000)) - (3597.112 * (coverWeight(tsi_cover)/2000)) ); var coverCarmiles = ( (coverGhgasses/11440) * 10000 ); var coverLbswood = ( 3.46666666666667 * (coverWeight(tsi_cover)) ); } else if (document.estiForm.coverPaper.options && // Cover is Primavera (document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "88_nl_pvg_book" || document.estiForm.coverPaper.value == "88_nl_pvg_book" || document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "101_nl_pvg_book" || document.estiForm.coverPaper.value == "101_nl_pvg_book" || document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "89_nl_pvg_cover" || document.estiForm.coverPaper.value == "89_nl_pvg_cover" || document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "111_nl_pvg_cover" || document.estiForm.coverPaper.value == "111_nl_pvg_cover" || (document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "same as inside" && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "101_nl_pvg_book"))) { var coverTrees = ( .40 * (coverWeight(tsi_cover)/2000) * 24 + .0 * (coverWeight(tsi_cover)/2000) * 12); var coverWater = ( (17851.968 * (coverWeight(tsi_cover)/2000)) - (11931.2 * (coverWeight(tsi_cover)/2000)) ); var coverSolidwaste = ( (2207.67 * (coverWeight(tsi_cover)/2000)) - (1732.493 * (coverWeight(tsi_cover)/2000)) ); var coverGhgasses = ( (5569.508 * (coverWeight(tsi_cover)/2000)) - (4333.0106 * (coverWeight(tsi_cover)/2000)) ); var coverCarmiles = ( (coverGhgasses/11440) * 10000 ); var coverLbswood = ( (2.84444444444444 * (coverWeight(tsi_cover))) - (1.70666666666667 * (coverWeight(tsi_cover))) ); } updateText("coverTrees", (coverTrees.toFixed(2))); updateText("coverWater", (coverWater.toFixed(1))); updateText("coverSolidwaste", (coverSolidwaste.toFixed(1))); updateText("coverGhgasses", (coverGhgasses.toFixed(1))); updateText("coverCarmiles", (coverCarmiles.toFixed(1))); updateText("coverLbswood" , (coverLbswood.toFixed(1))); updateText("coverWeight" , (coverWeight(tsi_cover).toFixed(1))); } if (document.estiForm.stationeryLetterheadBlank && document.estiForm.stationeryLetterheadBlank.value != "none") { var blnkltrhd_weight = ( (parseInt(document.estiForm.stationeryLetterheadBlank.value)/500) * 6.35) var blnkltrhd_trees = ( .96 * (blnkltrhd_weight/2000) * 24 + .04 * (blnkltrhd_weight/2000) * 12); var blnkltrhd_water = ( (20519.6 * (blnkltrhd_weight/2000)) - (10484 * (blnkltrhd_weight/2000)) ) var blnkltrhd_solidwaste = ( (2278.349 * (blnkltrhd_weight/2000)) - (1168.1357 * (blnkltrhd_weight/2000)) ) var blnkltrhd_ghgasses = ( (5789.724 * (blnkltrhd_weight/2000)) - (3597.112 * (blnkltrhd_weight/2000)) ) var blnkltrhd_carmiles = ( (blnkltrhd_weight/11440) * 10000 ) updateText("blnkltrhd_weight" , (blnkltrhd_weight.toFixed(1))); updateText("blnkltrhd_trees", (blnkltrhd_trees.toFixed(2))); updateText("blnkltrhd_water", (blnkltrhd_water.toFixed(1))); updateText("blnkltrhd_solidwaste", (blnkltrhd_solidwaste.toFixed(1))); updateText("blnkltrhd_ghgasses", (blnkltrhd_ghgasses.toFixed(1))); updateText("blnkltrhd_carmiles", (blnkltrhd_carmiles.toFixed(1))); } if (document.estiForm.paper.options && (document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "70_nl_rein_book" || document.estiForm.paper.value == "70_nl_rein_book" || document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "80_nl_rein_book" || document.estiForm.paper.value == "80_nl_rein_book" || document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "105_nl_rein_book" || document.estiForm.paper.value == "105_nl_rein_book" || document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "65_nl_rein_cover" || document.estiForm.paper.value == "65_nl_rein_cover" || document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "80_nl_rein_cover" || document.estiForm.paper.value == "80_nl_rein_cover" || document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "95_nl_rein_cover" || document.estiForm.paper.value == "95_nl_rein_cover" || document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "20pt_kraftboard" || document.estiForm.paper.value == "20pt_kraftboard" || document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "16pt_nl_rein_dblthick" || document.estiForm.paper.value == "16pt_nl_rein_dblthick" || document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "87_nl_sak_book" || document.estiForm.paper.value == "87_nl_sak_book" || document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "106_nl_sak_book" || document.estiForm.paper.value == "106_nl_sak_book" || document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "96_nl_sak_cover" || document.estiForm.paper.value == "96_nl_sak_cover")) { var trees = ( (.47 * (getJobWeight(tsi)/2000) * 24 + .03 * (getJobWeight(tsi)/2000) * 12) + env_trees + env2_trees + coverTrees + blnkltrhd_trees + ltrhd_trees); var water = ( ((17851.968 * (getJobWeight(tsi)/2000)) - (15320.5 * (getJobWeight(tsi)/2000))) + env_water + env2_water + coverWater + ltrhd_water + blnkltrhd_water); var solidwaste = ( ((2207.67 * (getJobWeight(tsi)/2000)) - (1653.874 * (getJobWeight(tsi)/2000))) + env_solidwaste + env2_solidwaste + coverSolidwaste + ltrhd_solidwaste + blnkltrhd_solidwaste); var ghgasses = ( ((5569.508 * (getJobWeight(tsi)/2000)) - (4633.694 * (getJobWeight(tsi)/2000))) + env_ghgasses + env2_ghgasses + coverGhgasses + ltrhd_ghgasses + blnkltrhd_ghgasses); var carmiles = ( (ghgasses/11440) * 10000 ); var lbswood = ( ((2.84444444444444 * (getJobWeight(tsi))) - (1.55555555555556 * (getJobWeight(tsi)))) + env_lbswood + env2_lbswood + coverLbswood + blnkltrhd_lbswood + ltrhd_lbswood ); } else if (document.estiForm.paper.options && (document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "88_nl_pvg_book" || document.estiForm.paper.value == "88_nl_pvg_book" || document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "101_nl_pvg_book" || document.estiForm.paper.value == "101_nl_pvg_book" || document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "89_nl_pvg_cover" || document.estiForm.paper.value == "89_nl_pvg_cover" || document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "111_nl_pvg_cover" || document.estiForm.paper.value == "111_nl_pvg_cover")) { var trees = (( .40 * (getJobWeight(tsi)/2000) * 24 + .0 * (getJobWeight(tsi)/2000) * 12) + env_trees + env2_trees + coverTrees + blnkltrhd_trees + ltrhd_trees); var water = ( ((17851.968 * (getJobWeight(tsi)/2000)) - (11931.2 * (getJobWeight(tsi)/2000))) + env_water + env2_water + coverWater + ltrhd_water + blnkltrhd_water); var solidwaste = ( ((2207.67 * (getJobWeight(tsi)/2000)) - (1732.493 * (getJobWeight(tsi)/2000))) + env_solidwaste + env2_solidwaste + coverSolidwaste + ltrhd_solidwaste + blnkltrhd_solidwaste); var ghgasses = ( ((5569.508 * (getJobWeight(tsi)/2000)) - (4333.0106 * (getJobWeight(tsi)/2000))) + env_ghgasses + env2_ghgasses + coverGhgasses + ltrhd_ghgasses + blnkltrhd_ghgasses); var carmiles = ( (ghgasses/11440) * 10000 ); var lbswood = ( ((2.84444444444444 * (getJobWeight(tsi))) - (1.70666666666667 * (getJobWeight(tsi)))) + env_lbswood + env2_lbswood + coverLbswood + blnkltrhd_lbswood + ltrhd_lbswood ); } else if (document.estiForm.paper.options && (document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "24_nl_ew" || document.estiForm.paper.value == "24_nl_ew" || document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "80_nl_eb_book" || document.estiForm.paper.value == "80_nl_eb_book" || document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "80_nl_ec_cover" || document.estiForm.paper.value == "80_nl_ec_cover" || document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "100_nl_ec_cover" || document.estiForm.paper.value == "100_nl_ec_cover" )) { var trees = (( .96 * (getJobWeight(tsi)/2000) * 24 + .04 * (getJobWeight(tsi)/2000) * 12) + env_trees + env2_trees + coverTrees + blnkltrhd_trees + ltrhd_trees); var water = ( ((20519.6 * (getJobWeight(tsi)/2000)) - (10484 * (getJobWeight(tsi)/2000))) + env_water + env2_water + coverWater + ltrhd_water + blnkltrhd_water); var solidwaste = ( ((2278.349 * (getJobWeight(tsi)/2000)) - (1168.1357 * (getJobWeight(tsi)/2000))) + env_solidwaste + env2_solidwaste + env2_solidwaste + coverSolidwaste + ltrhd_solidwaste + blnkltrhd_solidwaste); var ghgasses = ( ((5789.724 * (getJobWeight(tsi)/2000)) - (3597.112 * (getJobWeight(tsi)/2000))) + env_ghgasses + env2_ghgasses + coverGhgasses + ltrhd_ghgasses + blnkltrhd_ghgasses); var carmiles = ( (ghgasses/11440) * 10000 ); var lbswood = ( (3.46666666666667 * (getJobWeight(tsi))) + env_lbswood + env2_lbswood + coverLbswood + blnkltrhd_lbswood + ltrhd_lbswood) ; } else if (document.estiForm.paper.value == "95_nl_rein_cover" || document.estiForm.paper.value == "16pt_nl_rein_dblthick" || document.estiForm.paper.value == "24_nl_ew" || document.estiForm.paper.value == "80_nl_rein_cover" || document.estiForm.paper.value == "105_nl_rein_book" || document.estiForm.paper.value == "80_nl_rein_book" || document.estiForm.paper.value == "20pt_kraftboard") { var trees = ( (.47 * (getJobWeight(tsi)/2000) * 24 + .03 * (getJobWeight(tsi)/2000) * 12) + env_trees + env2_trees + coverTrees + blnkltrhd_trees + ltrhd_trees); var water = ( ((17851.968 * (getJobWeight(tsi)/2000)) - (15320.5 * (getJobWeight(tsi)/2000))) + env_water + env2_water + coverWater + ltrhd_water + blnkltrhd_water); var solidwaste = ( ((2207.67 * (getJobWeight(tsi)/2000)) - (1653.874 * (getJobWeight(tsi)/2000))) + env_solidwaste + env2_solidwaste + coverSolidwaste + ltrhd_solidwaste + blnkltrhd_solidwaste); var ghgasses = ( ((5569.508 * (getJobWeight(tsi)/2000)) - (4633.694 * (getJobWeight(tsi)/2000))) + env_ghgasses + env2_ghgasses + coverGhgasses + ltrhd_ghgasses + blnkltrhd_ghgasses); var carmiles = ( (ghgasses/11440) * 10000 ); var lbswood = ( ((2.84444444444444 * (getJobWeight(tsi))) - (1.55555555555556 * (getJobWeight(tsi)))) + env_lbswood + env2_lbswood + coverLbswood + blnkltrhd_lbswood + ltrhd_lbswood ); } updateText("myJobWeight", (getJobWeight(tsi).toFixed(1))); updateText("trees", (trees.toFixed(2))); updateText("water", (water.toFixed(1))); updateText("solidwaste", (solidwaste.toFixed(1))); updateText("ghgasses", (ghgasses.toFixed(1))); updateText("carmiles", (carmiles.toFixed(1))); updateText("lbswood", (lbswood.toFixed(1))); } /* Copyright © 2001-2009 GreenerPrinter. All Rights Reserved. Copyright © 2001-2009 GreenerPrinter. All Rights Reserved. Copyright © 2001-2009 GreenerPrinter. All Rights Reserved. */