/* Copyright © 2001-2009 GreenerPrinter. All Rights Reserved. Copyright © 2001-2009 GreenerPrinter. All Rights Reserved. Copyright © 2001-2009 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 == "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 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); } else if ((document.estiForm.paper.options && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value == "70_nl_imag_text") || document.estiForm.paper.value == "70_nl_imag_text") { return (tsi * 0.000168421); } } 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); } } else if ((document.estiForm.coverPaper.options && document.estiForm.coverPaper.options[document.estiForm.coverPaper.selectedIndex].value == "20pt_kraftboard") || document.estiForm.coverPaper.value == "20pt_kraftboard") { return (tsi_cover * 0.000614736); } } 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 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 > 0 && document.estiForm.paper.options[document.estiForm.paper.selectedIndex].value.indexOf("cover") > -1) { folding = (folding + foldBase + my_scoring + scoreBase); //alert (folding); } else if (folding > 0) { folding = (folding + 15); //alert (folding); } } else { if (folding > 0) { folding = (folding + foldBase); //alert (folding); } } document.estiForm.folding.value=formatCurrency(folding); //alert(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 > 0) { 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 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") || (document.estiForm.proof.selectedIndex > 0 && document.estiForm.productFamily.value == "Pad")) { 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 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 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; } } 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'; } } }