function get_temps(dz,ss,mz,group_id) { ss = ss/1000; has_temp = 0; all_tempdays = 0; all_temp_prices = 0; all_weekdayzz=0; weekdayzz = 0; if (23 == group_id) { overlap_zz1(ss,dz,1458687600,1459033200) if (hold_zz > 0 ) { weekday_zz1(1458687600,hold_zz) //TEMP ID IS 128 all_weekdayzz = (all_weekdayzz + weekdayzz); has_temp = has_temp + 1; all_tempdays = (all_tempdays + hold_zz); myprice = get_temp_price23(hold_zz,mz) all_temp_prices = all_temp_prices + myprice; } } if (23 == group_id) { overlap_zz1(ss,dz,1388876400,1393542000) if (hold_zz > 0 ) { weekday_zz1(1388876400,hold_zz) //TEMP ID IS 129 all_weekdayzz = (all_weekdayzz + weekdayzz); has_temp = has_temp + 1; all_tempdays = (all_tempdays + hold_zz); myprice = get_temp_price25(hold_zz,mz) all_temp_prices = all_temp_prices + myprice; } } if (23 == group_id) { overlap_zz1(ss,dz,1414796400,1419116400) if (hold_zz > 0 ) { weekday_zz1(1414796400,hold_zz) //TEMP ID IS 130 all_weekdayzz = (all_weekdayzz + weekdayzz); has_temp = has_temp + 1; all_tempdays = (all_tempdays + hold_zz); myprice = get_temp_price25(hold_zz,mz) all_temp_prices = all_temp_prices + myprice; } } if (24 == group_id) { overlap_zz1(ss,dz,1458687600,1459033200) if (hold_zz > 0 ) { weekday_zz1(1458687600,hold_zz) //TEMP ID IS 72 all_weekdayzz = (all_weekdayzz + weekdayzz); has_temp = has_temp + 1; all_tempdays = (all_tempdays + hold_zz); myprice = get_temp_price24(hold_zz,mz) all_temp_prices = all_temp_prices + myprice; } } if (24 == group_id) { overlap_zz1(ss,dz,1420239600,1425078000) if (hold_zz > 0 ) { weekday_zz1(1420239600,hold_zz) //TEMP ID IS 71 all_weekdayzz = (all_weekdayzz + weekdayzz); has_temp = has_temp + 1; all_tempdays = (all_tempdays + hold_zz); myprice = get_temp_price26(hold_zz,mz) all_temp_prices = all_temp_prices + myprice; } } if (24 == group_id) { overlap_zz1(ss,dz,1414796400,1419116400) if (hold_zz > 0 ) { weekday_zz1(1414796400,hold_zz) //TEMP ID IS 70 all_weekdayzz = (all_weekdayzz + weekdayzz); has_temp = has_temp + 1; all_tempdays = (all_tempdays + hold_zz); myprice = get_temp_price26(hold_zz,mz) all_temp_prices = all_temp_prices + myprice; } } return [has_temp,all_tempdays,all_temp_prices,all_weekdayzz]; function overlap_zz1(ss,dz,hsdate,hedate) { //window.alert(+ss+'ss'+dz+'ss'+hsdate+'ss'+hedate) durms = dz*86400; se = ss + durms; hs = hsdate; he = hedate; //holiday end is midnight of last holiday day, i.e. beginning of next day; so, add a day //he = he + 86400; holms = 0; if (ss < hs && se > hs && se < he ) {holms = se - hs ;} if (ss > hs && se > he && ss < he ) {holms = he - ss ;} if (ss >= hs && se <= he ) {holms = durms ;} if (ss <= hs && se >= he ) {holms = he - hs ;} //hold is holidaydays hold_zz = 0; hold_zz = Math.round(holms/86400); return hold_zz } function weekday_zz1(ss,dz) { //FIND OUT HOW MANY WEEK DAYS THERE ARE weekendddzz = 0 weekdayzz = 0 sx = ss for (i = 1; i <= dz; i++) { dayuvweak = new Date (sx); dayuvweak = dayuvweak.getDay() if (dayuvweak < 5) { weekdayzz++ } else { weekendddzz++ } sx = (sx + 86400000) } //END FIND OUT HOW MANY WEEK DAYS THERE ARE return weekdayzz } } function get_temp_price23(dz,mz){ prix = 0 if (dz == 1 && mz == 1) {prix = 210}if (dz == 2 && mz == 1) {prix = 210}if (dz == 3 && mz == 1) {prix = 210}if (dz == 4 && mz == 1) {prix = 280}if (dz == 5 && mz == 1) {prix = 350}if (dz == 6 && mz == 1) {prix = 400}if (dz >= 7 && mz == 1) {prix = 57 * dz}if (dz >= 14 && mz == 1) {prix = 45 * dz}if (dz >= 21 && mz == 1) {prix = 40 * dz}if (dz >= 28 && mz == 1) {prix = 35 * dz}if (dz == 1 && mz == 2) {prix = 210}if (dz == 2 && mz == 2) {prix = 210}if (dz == 3 && mz == 2) {prix = 210}if (dz == 4 && mz == 2) {prix = 280}if (dz == 5 && mz == 2) {prix = 350}if (dz == 6 && mz == 2) {prix = 400}if (dz >= 7 && mz == 2) {prix = 57 * dz}if (dz >= 14 && mz == 2) {prix = 45 * dz}if (dz >= 21 && mz == 2) {prix = 40 * dz}if (dz >= 28 && mz == 2) {prix = 35 * dz}if (dz == 1 && mz == 3) {prix = 255}if (dz == 2 && mz == 3) {prix = 255}if (dz == 3 && mz == 3) {prix = 255}if (dz == 4 && mz == 3) {prix = 325}if (dz == 5 && mz == 3) {prix = 400}if (dz == 6 && mz == 3) {prix = 460}if (dz >= 7 && mz == 3) {prix = 65 * dz}if (dz >= 14 && mz == 3) {prix = 50 * dz}if (dz >= 21 && mz == 3) {prix = 45 * dz}if (dz >= 28 && mz == 3) {prix = 40 * dz} return prix }function get_temp_price25(dz,mz){ prix = 0 if (dz == 1 && mz == 1) {prix = 60}if (dz == 2 && mz == 1) {prix = 120}if (dz == 3 && mz == 1) {prix = 180}if (dz == 4 && mz == 1) {prix = 240}if (dz == 5 && mz == 1) {prix = 300}if (dz == 6 && mz == 1) {prix = 360}if (dz >= 7 && mz == 1) {prix = 60 * dz}if (dz >= 14 && mz == 1) {prix = 60 * dz}if (dz >= 21 && mz == 1) {prix = 60 * dz}if (dz >= 28 && mz == 1) {prix = 60 * dz}if (dz == 1 && mz == 2) {prix = 60}if (dz == 2 && mz == 2) {prix = 120}if (dz == 3 && mz == 2) {prix = 180}if (dz == 4 && mz == 2) {prix = 240}if (dz == 5 && mz == 2) {prix = 300}if (dz == 6 && mz == 2) {prix = 360}if (dz >= 7 && mz == 2) {prix = 60 * dz}if (dz >= 14 && mz == 2) {prix = 60 * dz}if (dz >= 21 && mz == 2) {prix = 60 * dz}if (dz >= 28 && mz == 2) {prix = 60 * dz}if (dz == 1 && mz == 3) {prix = 68}if (dz == 2 && mz == 3) {prix = 136}if (dz == 3 && mz == 3) {prix = 204}if (dz == 4 && mz == 3) {prix = 272}if (dz == 5 && mz == 3) {prix = 340}if (dz == 6 && mz == 3) {prix = 408}if (dz >= 7 && mz == 3) {prix = 68 * dz}if (dz >= 14 && mz == 3) {prix = 68 * dz}if (dz >= 21 && mz == 3) {prix = 68 * dz}if (dz >= 28 && mz == 3) {prix = 68 * dz} return prix }function get_temp_price25(dz,mz){ prix = 0 if (dz == 1 && mz == 1) {prix = 60}if (dz == 2 && mz == 1) {prix = 120}if (dz == 3 && mz == 1) {prix = 180}if (dz == 4 && mz == 1) {prix = 240}if (dz == 5 && mz == 1) {prix = 300}if (dz == 6 && mz == 1) {prix = 360}if (dz >= 7 && mz == 1) {prix = 60 * dz}if (dz >= 14 && mz == 1) {prix = 60 * dz}if (dz >= 21 && mz == 1) {prix = 60 * dz}if (dz >= 28 && mz == 1) {prix = 60 * dz}if (dz == 1 && mz == 2) {prix = 60}if (dz == 2 && mz == 2) {prix = 120}if (dz == 3 && mz == 2) {prix = 180}if (dz == 4 && mz == 2) {prix = 240}if (dz == 5 && mz == 2) {prix = 300}if (dz == 6 && mz == 2) {prix = 360}if (dz >= 7 && mz == 2) {prix = 60 * dz}if (dz >= 14 && mz == 2) {prix = 60 * dz}if (dz >= 21 && mz == 2) {prix = 60 * dz}if (dz >= 28 && mz == 2) {prix = 60 * dz}if (dz == 1 && mz == 3) {prix = 68}if (dz == 2 && mz == 3) {prix = 136}if (dz == 3 && mz == 3) {prix = 204}if (dz == 4 && mz == 3) {prix = 272}if (dz == 5 && mz == 3) {prix = 340}if (dz == 6 && mz == 3) {prix = 408}if (dz >= 7 && mz == 3) {prix = 68 * dz}if (dz >= 14 && mz == 3) {prix = 68 * dz}if (dz >= 21 && mz == 3) {prix = 68 * dz}if (dz >= 28 && mz == 3) {prix = 68 * dz} return prix }function get_temp_price24(dz,mz){ prix = 0 if (dz == 1 && mz == 1) {prix = 80}if (dz == 2 && mz == 1) {prix = 160}if (dz == 3 && mz == 1) {prix = 240}if (dz == 4 && mz == 1) {prix = 320}if (dz == 5 && mz == 1) {prix = 400}if (dz == 6 && mz == 1) {prix = 480}if (dz >= 7 && mz == 1) {prix = 80 * dz}if (dz >= 14 && mz == 1) {prix = 80 * dz}if (dz >= 21 && mz == 1) {prix = 80 * dz}if (dz >= 28 && mz == 1) {prix = 80 * dz}if (dz == 1 && mz == 2) {prix = 80}if (dz == 2 && mz == 2) {prix = 160}if (dz == 3 && mz == 2) {prix = 240}if (dz == 4 && mz == 2) {prix = 320}if (dz == 5 && mz == 2) {prix = 400}if (dz == 6 && mz == 2) {prix = 480}if (dz >= 7 && mz == 2) {prix = 80 * dz}if (dz >= 14 && mz == 2) {prix = 80 * dz}if (dz >= 21 && mz == 2) {prix = 80 * dz}if (dz >= 28 && mz == 2) {prix = 80 * dz}if (dz == 1 && mz == 3) {prix = 100}if (dz == 2 && mz == 3) {prix = 200}if (dz == 3 && mz == 3) {prix = 300}if (dz == 4 && mz == 3) {prix = 400}if (dz == 5 && mz == 3) {prix = 500}if (dz == 6 && mz == 3) {prix = 600}if (dz >= 7 && mz == 3) {prix = 100 * dz}if (dz >= 14 && mz == 3) {prix = 100 * dz}if (dz >= 21 && mz == 3) {prix = 100 * dz}if (dz >= 28 && mz == 3) {prix = 100 * dz} return prix }function get_temp_price26(dz,mz){ prix = 0 if (dz == 1 && mz == 1) {prix = 55}if (dz == 2 && mz == 1) {prix = 110}if (dz == 3 && mz == 1) {prix = 165}if (dz == 4 && mz == 1) {prix = 220}if (dz == 5 && mz == 1) {prix = 275}if (dz == 6 && mz == 1) {prix = 330}if (dz >= 7 && mz == 1) {prix = 50 * dz}if (dz >= 14 && mz == 1) {prix = 45 * dz}if (dz >= 21 && mz == 1) {prix = 40 * dz}if (dz >= 28 && mz == 1) {prix = 35 * dz}if (dz == 1 && mz == 2) {prix = 55}if (dz == 2 && mz == 2) {prix = 110}if (dz == 3 && mz == 2) {prix = 165}if (dz == 4 && mz == 2) {prix = 220}if (dz == 5 && mz == 2) {prix = 275}if (dz == 6 && mz == 2) {prix = 330}if (dz >= 7 && mz == 2) {prix = 50 * dz}if (dz >= 14 && mz == 2) {prix = 45 * dz}if (dz >= 21 && mz == 2) {prix = 40 * dz}if (dz >= 28 && mz == 2) {prix = 35 * dz}if (dz == 1 && mz == 3) {prix = 63}if (dz == 2 && mz == 3) {prix = 126}if (dz == 3 && mz == 3) {prix = 189}if (dz == 4 && mz == 3) {prix = 252}if (dz == 5 && mz == 3) {prix = 315}if (dz == 6 && mz == 3) {prix = 378}if (dz >= 7 && mz == 3) {prix = 60 * dz}if (dz >= 14 && mz == 3) {prix = 50 * dz}if (dz >= 21 && mz == 3) {prix = 45 * dz}if (dz >= 28 && mz == 3) {prix = 35 * dz} return prix }function get_temp_price26(dz,mz){ prix = 0 if (dz == 1 && mz == 1) {prix = 55}if (dz == 2 && mz == 1) {prix = 110}if (dz == 3 && mz == 1) {prix = 165}if (dz == 4 && mz == 1) {prix = 220}if (dz == 5 && mz == 1) {prix = 275}if (dz == 6 && mz == 1) {prix = 330}if (dz >= 7 && mz == 1) {prix = 50 * dz}if (dz >= 14 && mz == 1) {prix = 45 * dz}if (dz >= 21 && mz == 1) {prix = 40 * dz}if (dz >= 28 && mz == 1) {prix = 35 * dz}if (dz == 1 && mz == 2) {prix = 55}if (dz == 2 && mz == 2) {prix = 110}if (dz == 3 && mz == 2) {prix = 165}if (dz == 4 && mz == 2) {prix = 220}if (dz == 5 && mz == 2) {prix = 275}if (dz == 6 && mz == 2) {prix = 330}if (dz >= 7 && mz == 2) {prix = 50 * dz}if (dz >= 14 && mz == 2) {prix = 45 * dz}if (dz >= 21 && mz == 2) {prix = 40 * dz}if (dz >= 28 && mz == 2) {prix = 35 * dz}if (dz == 1 && mz == 3) {prix = 63}if (dz == 2 && mz == 3) {prix = 126}if (dz == 3 && mz == 3) {prix = 189}if (dz == 4 && mz == 3) {prix = 252}if (dz == 5 && mz == 3) {prix = 315}if (dz == 6 && mz == 3) {prix = 378}if (dz >= 7 && mz == 3) {prix = 60 * dz}if (dz >= 14 && mz == 3) {prix = 50 * dz}if (dz >= 21 && mz == 3) {prix = 45 * dz}if (dz >= 28 && mz == 3) {prix = 35 * dz} return prix }