/* Copyright © 2001-2011 Greenerprinter. All Rights Reserved. Copyright © 2001-2011 Greenerprinter. All Rights Reserved. Copyright © 2001-2011 Greenerprinter. All Rights Reserved. */ 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 == "100_enova_cover") { return '0.000431232'; } if (type == "100_enova_book") { return '0.000214572'; } 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 == "gloss_label") { 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'; } } var jobWeights = {}; jobWeights['Custom Paper See Notes'] = 0.0004776; jobWeights['16pt_nl_rein_dblthick'] = 0.0005018; jobWeights['18pt_renewal'] = 0.000614736; jobWeights['20pt_kraftboard'] = 0.000614736; jobWeights['24pt_C1S'] = 0.000614736; jobWeights['24_nl_ew'] = 0.000128421; jobWeights['60_nl_o_book'] = .0001263157894736842; jobWeights['60_nl_pioneer'] = .0001263157894736842; jobWeights['60_kraft_starliner'] = 0.000307487; jobWeights['gloss_label'] = 0.000307487; jobWeights['70_mt_starliner'] = 0.000307487; jobWeights['70_nl_imag_text'] = 0.000168421; jobWeights['70_nl_o_book'] = .0001478260869565217; jobWeights['70_nl_rein_book'] = .0001469265; jobWeights['80_nl_eb_book'] = 0.000168421; jobWeights['80_nl_ec_cover'] = 0.000307368; jobWeights['80_nl_o_book'] = .000168944099378882; jobWeights['80_nl_rein_book'] = 0.000168421; jobWeights['80_nl_rein_cover'] = 0.000307368; jobWeights['87_nl_sak_book'] = 0.000183158; jobWeights['88_nl_pvg_book'] = .0001857142857142857; jobWeights['89_nl_pvg_cover'] = .0003428571428571429; jobWeights['95_nl_rein_cover'] = 0.000366316; jobWeights['96_nl_sak_cover'] = 0.000369231; jobWeights['100_enova_book'] = 0.00021; jobWeights['100_enova_cover'] = 0.0003852; jobWeights['100_nl_ec_cover'] = 0.000385093; jobWeights['101_nl_pvg_book'] = 0.000212632; jobWeights['105_nl_rein_book'] = 0.000221053; jobWeights['106_nl_sak_book'] = 0.000223158; jobWeights['111_nl_pvg_cover'] = 0.000427368; function getJobWeight(tsi, tsi_cover) { var selectedCoverPaper = getValueIfRadio(document.estiForm.coverPaper), selectedInsidePaper = getValueIfRadio(document.estiForm.paper), insidePagesWeight = (tsi || 0) * (jobWeights[selectedInsidePaper] || 0), coverPagesWeight = (tsi_cover || 0) * (jobWeights[selectedCoverPaper] || 0); return (insidePagesWeight + coverPagesWeight); } function getNexPressFactor(quantity, si, page_type) { var nexpresscharges = 0; //initialize to some value in case none of the "ifs" below are met if (page_type == "4over4") { nexpresscharges = get44NexPressPricing(quantity, si); } else if (page_type == "4over1") { nexpresscharges = get41NexPressPricing(quantity, si); } else if (page_type == "4over0") { nexpresscharges = get40NexPressPricing(quantity, si); } else if (page_type == "1over1") { nexpresscharges = get11NexPressPricing(quantity, si); } else if (page_type == "NoCover") { nexpresscharges = 0; } setAndLogEstiProperty("nexpresscharge", 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 (25 + (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 ((document.estiForm.productFamily.value == "Card" || document.estiForm.productFamily.value.indexOf("w2pCard") != -1) && quantity <= 250) { return (55 + (quantity * si * 216/140 * (.57/(12*18)) )); } else 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 (13 + (quantity * si * 216/132 * (.69/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (250 + (quantity * si * 216/132 * (.245/(12*18)) )); else return (100 + (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 * .115)); // Extremely simplified biz card pricing, 082407 BV } else if (si < 35) { if (quantity <= 1000) return (4 + (quantity * si * 216/168 * (.655/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (45 + (quantity * si * 216/168 * (.44/(12*18)) )); else return (100 + (quantity * si * 216/168 * (.284/(12*18)) )); } else if (si >= 35 && si < 40) { if ((document.estiForm.productFamily.value == "Card" || document.estiForm.productFamily.value.indexOf("w2pCard") != -1) && quantity <= 250) { return (50 + (quantity * si * 216/140 * (.57/(12*18)) )); } else if (quantity <= 1000) return (40 + (quantity * si * 216/140 * (.57/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (135 + (quantity * si * 216/140 * (.195/(12*18)) )); else return (150 + (quantity * si * 216/140 * (.174/(12*18)) )); } else if (si >= 40 && si < 54) { if (quantity <= 1000) return (40 + (quantity * si * 216/160 * (.67/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (69 + (quantity * si * 216/160 * (.39/(12*18)) )); else return (27 + (quantity * si * 216/160 * (.426/(12*18)) )); } else if (si >= 54 && si < 66) { if (quantity <= 1000) return (26 + (quantity * si * 216/108 * (.43/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (163 + (quantity * si * 216/108 * (.185/(12*18)) )); else return (182 + (quantity * si * 216/108 * (.173/(12*18)) )); } else if (si >= 66 && si < 75) { if (quantity <= 1000) return (6 + (quantity * si * 216/132 * (.69/(12*18)) )); else if (quantity > 1000 && quantity <= 3000) return (230 + (quantity * si * 216/132 * (.245/(12*18)) )); else return (50 + (quantity * si * 216/132 * (.2285/(12*18)) )); } else if (si < 93.5) return (quantity * si * 1.35 * .0083333); else return (quantity * si * 1.15 * .0083333); } function get11NexPressPricing(quantity, si) { if (si < 93.5) return (quantity * si * 1.5 * .0046296); else return (quantity * si * 1.25 * .0046296); } 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 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 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 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 calcFolding() { var hasFold = (getValueIfRadio(document.estiForm.fold) || "no") !== "no"; var folding = 0; if (hasFold) { var foldBase = 15; var foldUnitCost = 0.0115; folding = foldBase + (document.estiForm.realquant.value * foldUnitCost); // cover paper needs scoring var paperVal = getValueIfRadio(document.estiForm.paper); if (~paperVal.indexOf("cover")) { var scoreBase = 25; var scoreUnitCost = 0.023; folding = folding + (scoreBase + (document.estiForm.realquant.value * scoreUnitCost)); } } setAndLogEstiProperty("folding", formatCurrency(folding)); return folding; } function calcScoring() { var hasScore = (getValueIfRadio(document.estiForm.score) || "no") !== "no"; var scoring = 0; if (hasScore) { var scoreBase = 25; var scoreUnitCost = 0.023; scoring = scoreBase + (document.estiForm.realquant.value * scoreUnitCost); } setAndLogEstiProperty("scoring", formatCurrency(scoring)); return scoring; } function calcPerforating() { var hasPerforate = (getValueIfRadio(document.estiForm.perforate) || "no") !== "no"; var perforating = 0; if (hasPerforate) { var perfBase = 25; var perfUnitCost = 0.023; perforating = perfBase + (document.estiForm.realquant.value * perfUnitCost); } setAndLogEstiProperty("perforating", formatCurrency(perforating)); return perforating; } function calcDrilling() { //alert(document.estiForm.drill.value); //unit price // $20 setup for thicker papers var hasScore = (getValueIfRadio(document.estiForm.score) || "no") !== "no"; var hasDrill = (getValueIfRadio(document.estiForm.drill) || "no") !== "no"; var hasStringing = (getValueIfRadio(document.estiForm.stringing) || "No") !== "No"; var hasShapeCut = (getValueIfRadio(document.estiForm.shapeCut) || "no") !== "no"; var quantity = +(getValueIfRadio(document.estiForm.quantity) || 0); var productFamily = getValueIfRadio(document.estiForm.productFamily); var paperVal = getValueIfRadio(document.estiForm.paper); var drilling = 0; if (hasDrill || (hasStringing && hasShapeCut)) { // calculate base var drillBase = 25; // Drilling happens on flat pieces, so if there's scoring, add $10 setup for 2nd hole: if (hasScore) { drillBase = drillBase + 10; } var drill_unit_cost = (!hasStringing || productFamily == "Calendar") ? 0.02 : 0; if (paperVal === "95_nl_rein_cover" || paperVal === "96_nl_sak_cover" || paperVal === "111_nl_pvg_cover" || paperVal === "20pt_kraftboard") { // drill unit cost requires no adjustment } else { drill_unit_cost = drill_unit_cost * .75; } // add unit cost to base drilling = (quantity * drill_unit_cost); // Drilling happens on flat pieces, so if there's scoring, that means piece will fold and require TWO drill holes: if (hasScore) { drilling = drilling * 2; } drilling = drilling + drillBase; } setAndLogEstiProperty("drilling", formatCurrency(drilling)); return drilling; } function calcProof(si) { var proofVal = getValueIfRadio(document.estiForm.proof); var proofing = 0; if (proofVal === "HardProof") { var isMulti = document.estiForm.multi; var productFamilyVal = getValueIfRadio(document.estiForm.productFamily); var colorsVal = getValueIfRadio(document.estiForm.colors); // handle the hard codes if (productFamilyVal === "Folder" || productFamilyVal == "3 Panel Folder") { if (colorsVal !== "4over4") { proofing = 144; } else { proofing = 224; } } else if (productFamilyVal === "Folder 4x9") { if (colorsVal !== "4over4") { proof = 104; } else { proof = 144; } } else if (productFamilyVal === "Doorhanger") { if (colorsVal !== "4over4") { proof = 52; } else { proof = 40; } } else if (isMulti) { var inkjetBase = (si * .046) * 2; var pages = +(getValueIfRadio(document.estiForm.pages) || 0) + 4; var inkjetProof = inkjetBase + (pages * 5); var spinjetSheets = Math.ceil(pages / 12); proofing = 20 + (spinjetSheets * 44) + inkjetProof; } else { var ppsi = 0.437807; var proofBase = 25; proofing = proofBase + (si * ppsi); } } setAndLogEstiProperty("proofcharge", formatCurrency(proofing)); return proofing; } function calcNexPressProof(si) { var proofVal = getValueIfRadio(document.estiForm.proof); var proofing = 0; if (proofVal === "HardProof") { proofing = 50; } setAndLogEstiProperty("proofcharge", formatCurrency(proofing)); return proofing; } function calcRush(total, si) { var postCardSize = (si > 7 && si <= 24); var paperIsKraft = (getValueIfRadio(document.estiForm.paper) === "20pt_kraftboard"); var turnaroundVal = getValueIfRadio(document.estiForm.turnaround); var turnaroundNum = +(/^(\d+).*/.exec(turnaroundVal || '7 day')[1]); var rushFactor = 0; if (postCardSize) { //special rush factors for postcards if (turnaroundNum >= 7) { rushFactor = -0.1; // -10% } else if (turnaroundNum >= 3) { rushFactor = paperIsKraft ? 0.285 : 0.035; } else { rushFactor = paperIsKraft ? 0.845 : 0.395; } } else { var productFamilyVal = getValueIfRadio(document.estiForm.productFamily); var isMulti = document.estiForm.multi; var isDiecut = productFamilyVal === "Folder" || productFamilyVal === "Folder 4x9" || productFamilyVal === "CD Sleeve 5x5" || productFamilyVal == "3 Panel Folder" || productFamilyVal == "DVD Sleeve" || ~productFamilyVal.indexOf("w2pPresFolder"); if (turnaroundNum >= 7) { if (isMulti) { rushFactor = -0.014; } else if (productFamilyVal === "Doorhanger") { rushFactor = 0; } else { rushFactor = -0.1; } } else if (turnaroundNum >= 4) { if (isMulti) { rushFactor = 0.07; } else if (productFamilyVal === "Doorhanger") { rushFactor = 0.06; } else if (isDiecut) { rushFactor = -0.01; } else { rushFactor = -0.05; } } else if (turnaroundNum >= 3) { if (isDiecut) { rushFactor = 0.175; } else if (paperIsKraft) { rushFactor = 0.25; } } else { if (isMulti) { // nothing here? } else if (paperIsKraft) { rushFactor = 0.18 + 0.55; } else { rushFactor = 0.18 + 0.1; } } } var rushing = total * rushFactor; setValueIfPossible(document.estiForm.rush, formatCurrency(rushing)); return rushing; } function calcHandling(tsi) { var boxBase = 10; var boxFactor = 2.5; var boxWeightFactor = 1.1; var total_weight = boxWeightFactor * getJobWeight(tsi); var number_full_boxes = Math.max(Math.floor(total_weight / 20), 1); var number_partial_boxes = ((total_weight > 20) && (total_weight % 20) > 0) ? 1 : 0; var total_boxes = (number_full_boxes + number_partial_boxes); var handling = boxBase + ((total_boxes - 1) * boxFactor); setAndLogEstiProperty("handling", formatCurrency(handling)); return handling; } 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 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; } return '0.15'; } 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 calculate_bannerStand() { if (document.estiForm.bannerStand != null && document.estiForm.bannerStand.value.indexOf('MediaScreen 1') != -1) { if (document.estiForm.bannerStand.value.indexOf('33 7/16') != -1) { return '216'; } else if (document.estiForm.bannerStand.value.indexOf('39 3/8') != -1) { return '235'; } } else if (document.estiForm.bannerStand != null && document.estiForm.bannerStand.value.indexOf('MediaScreen 4') != -1) { if (document.estiForm.bannerStand.value.indexOf('33 7/16') != -1) { if (document.estiForm.bannerStand.value.indexOf('CARTRIDGE') != -1) { return '51.3'; } else { return '251.55'; } } else if (document.estiForm.bannerStand.value.indexOf('39 3/8') != -1) { if (document.estiForm.bannerStand.value.indexOf('CARTRIDGE') != -1) { return '58.05'; } else { return '291.15'; } } } else if (document.estiForm.bannerStand != null && document.estiForm.bannerStand.value.indexOf('QuickScreen') != -1) { if (document.estiForm.bannerStand.value.indexOf('19 11/16') != -1) { if (document.estiForm.bannerStand.value.indexOf('CARTRIDGE') != -1) { return '73.8'; } else { return '240.3'; } } if (document.estiForm.bannerStand.value.indexOf('33 7/16') != -1) { if (document.estiForm.bannerStand.value.indexOf('CARTRIDGE') != -1) { return '87.3'; } else { return '260.55'; } } else if (document.estiForm.bannerStand.value.indexOf('39 3/8') != -1) { if (document.estiForm.bannerStand.value.indexOf('CARTRIDGE') != -1) { return '94.05'; } else { return '291.15'; } } } else if (document.estiForm.bannerStand != null && document.estiForm.bannerStand.value.indexOf('SmartStand') != -1) { if (document.estiForm.bannerStand.value.indexOf('19 11/16') != -1) { if (document.estiForm.bannerStand.value.indexOf('PRINT') != -1) { return '30'; } else { return '99'; } } else if (document.estiForm.bannerStand.value.indexOf('23 5/8') != -1) { if (document.estiForm.bannerStand.value.indexOf('PRINT') != -1) { return '30'; } else { return '99'; } } else if (document.estiForm.bannerStand.value.indexOf('27 9/16') != -1) { if (document.estiForm.bannerStand.value.indexOf('PRINT') != -1) { return '30'; } else { return '109'; } } else if (document.estiForm.bannerStand.value.indexOf('31 1/2') != -1) { if (document.estiForm.bannerStand.value.indexOf('PRINT') != -1) { return '30'; } else { return '109'; } } } else if (document.estiForm.bannerStand != null && document.estiForm.bannerStand.value.indexOf('XStand') != -1) { if (document.estiForm.bannerStand.value.indexOf('24 1/2') != -1) { if (document.estiForm.bannerStand.value.indexOf('PRINT') != -1) { return '15'; } else { return '42'; } } else if (document.estiForm.bannerStand.value.indexOf('26 1/2') != -1) { if (document.estiForm.bannerStand.value.indexOf('PRINT') != -1) { return '15'; } else { return '43'; } } else if (document.estiForm.bannerStand.value.indexOf('32 1/2') != -1) { if (document.estiForm.bannerStand.value.indexOf('PRINT') != -1) { return '15'; } else { return '44'; } } } else { return 0; } }