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 (32 == group_id) { overlap_zz1(ss,dz,1490997600,1496181600) if (hold_zz > 0 ) { weekday_zz1(1490997600,hold_zz) //TEMP ID IS 250 all_weekdayzz = (all_weekdayzz + weekdayzz); has_temp = has_temp + 1; all_tempdays = (all_tempdays + hold_zz); myprice = get_temp_price161(hold_zz,mz) all_temp_prices = all_temp_prices + myprice; } } if (32 == group_id) { overlap_zz1(ss,dz,1504216800,1509404400) if (hold_zz > 0 ) { weekday_zz1(1504216800,hold_zz) //TEMP ID IS 251 all_weekdayzz = (all_weekdayzz + weekdayzz); has_temp = has_temp + 1; all_tempdays = (all_tempdays + hold_zz); myprice = get_temp_price161(hold_zz,mz) all_temp_prices = all_temp_prices + myprice; } } if (32 == group_id) { overlap_zz1(ss,dz,1496268000,1504130400) if (hold_zz > 0 ) { weekday_zz1(1496268000,hold_zz) //TEMP ID IS 249 all_weekdayzz = (all_weekdayzz + weekdayzz); has_temp = has_temp + 1; all_tempdays = (all_tempdays + hold_zz); myprice = get_temp_price160(hold_zz,mz) all_temp_prices = all_temp_prices + myprice; } } if (32 == group_id) { overlap_zz1(ss,dz,1488322800,1490911200) if (hold_zz > 0 ) { weekday_zz1(1488322800,hold_zz) //TEMP ID IS 248 all_weekdayzz = (all_weekdayzz + weekdayzz); has_temp = has_temp + 1; all_tempdays = (all_tempdays + hold_zz); myprice = get_temp_price160(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_price161(dz,mz){ prix = 0 if (dz == 1 && mz == 1) {prix = 159}if (dz == 2 && mz == 1) {prix = 318}if (dz == 3 && mz == 1) {prix = 477}if (dz == 4 && mz == 1) {prix = 636}if (dz == 5 && mz == 1) {prix = 795}if (dz == 6 && mz == 1) {prix = 954}if (dz >= 7 && mz == 1) {prix = 159 * dz}if (dz >= 14 && mz == 1) {prix = 159 * dz}if (dz >= 21 && mz == 1) {prix = 159 * dz}if (dz >= 28 && mz == 1) {prix = 159 * dz}if (dz == 1 && mz == 2) {prix = 159}if (dz == 2 && mz == 2) {prix = 318}if (dz == 3 && mz == 2) {prix = 477}if (dz == 4 && mz == 2) {prix = 636}if (dz == 5 && mz == 2) {prix = 795}if (dz == 6 && mz == 2) {prix = 954}if (dz >= 7 && mz == 2) {prix = 159 * dz}if (dz >= 14 && mz == 2) {prix = 159 * dz}if (dz >= 21 && mz == 2) {prix = 159 * dz}if (dz >= 28 && mz == 2) {prix = 159 * dz}if (dz == 1 && mz == 3) {prix = 169}if (dz == 2 && mz == 3) {prix = 338}if (dz == 3 && mz == 3) {prix = 507}if (dz == 4 && mz == 3) {prix = 676}if (dz == 5 && mz == 3) {prix = 845}if (dz == 6 && mz == 3) {prix = 1014}if (dz >= 7 && mz == 3) {prix = 169 * dz}if (dz >= 14 && mz == 3) {prix = 169 * dz}if (dz >= 21 && mz == 3) {prix = 169 * dz}if (dz >= 28 && mz == 3) {prix = 169 * dz}if (dz == 1 && mz == 4) {prix = 179}if (dz == 2 && mz == 4) {prix = 358}if (dz == 3 && mz == 4) {prix = 537}if (dz == 4 && mz == 4) {prix = 716}if (dz == 5 && mz == 4) {prix = 895}if (dz == 6 && mz == 4) {prix = 1074}if (dz >= 7 && mz == 4) {prix = 179 * dz}if (dz >= 14 && mz == 4) {prix = 179 * dz}if (dz >= 21 && mz == 4) {prix = 179 * dz}if (dz >= 28 && mz == 4) {prix = 179 * dz} return prix }function get_temp_price161(dz,mz){ prix = 0 if (dz == 1 && mz == 1) {prix = 159}if (dz == 2 && mz == 1) {prix = 318}if (dz == 3 && mz == 1) {prix = 477}if (dz == 4 && mz == 1) {prix = 636}if (dz == 5 && mz == 1) {prix = 795}if (dz == 6 && mz == 1) {prix = 954}if (dz >= 7 && mz == 1) {prix = 159 * dz}if (dz >= 14 && mz == 1) {prix = 159 * dz}if (dz >= 21 && mz == 1) {prix = 159 * dz}if (dz >= 28 && mz == 1) {prix = 159 * dz}if (dz == 1 && mz == 2) {prix = 159}if (dz == 2 && mz == 2) {prix = 318}if (dz == 3 && mz == 2) {prix = 477}if (dz == 4 && mz == 2) {prix = 636}if (dz == 5 && mz == 2) {prix = 795}if (dz == 6 && mz == 2) {prix = 954}if (dz >= 7 && mz == 2) {prix = 159 * dz}if (dz >= 14 && mz == 2) {prix = 159 * dz}if (dz >= 21 && mz == 2) {prix = 159 * dz}if (dz >= 28 && mz == 2) {prix = 159 * dz}if (dz == 1 && mz == 3) {prix = 169}if (dz == 2 && mz == 3) {prix = 338}if (dz == 3 && mz == 3) {prix = 507}if (dz == 4 && mz == 3) {prix = 676}if (dz == 5 && mz == 3) {prix = 845}if (dz == 6 && mz == 3) {prix = 1014}if (dz >= 7 && mz == 3) {prix = 169 * dz}if (dz >= 14 && mz == 3) {prix = 169 * dz}if (dz >= 21 && mz == 3) {prix = 169 * dz}if (dz >= 28 && mz == 3) {prix = 169 * dz}if (dz == 1 && mz == 4) {prix = 179}if (dz == 2 && mz == 4) {prix = 358}if (dz == 3 && mz == 4) {prix = 537}if (dz == 4 && mz == 4) {prix = 716}if (dz == 5 && mz == 4) {prix = 895}if (dz == 6 && mz == 4) {prix = 1074}if (dz >= 7 && mz == 4) {prix = 179 * dz}if (dz >= 14 && mz == 4) {prix = 179 * dz}if (dz >= 21 && mz == 4) {prix = 179 * dz}if (dz >= 28 && mz == 4) {prix = 179 * dz} return prix }function get_temp_price160(dz,mz){ prix = 0 if (dz == 1 && mz == 1) {prix = 139}if (dz == 2 && mz == 1) {prix = 278}if (dz == 3 && mz == 1) {prix = 417}if (dz == 4 && mz == 1) {prix = 556}if (dz == 5 && mz == 1) {prix = 695}if (dz == 6 && mz == 1) {prix = 834}if (dz >= 7 && mz == 1) {prix = 139 * dz}if (dz >= 14 && mz == 1) {prix = 139 * dz}if (dz >= 21 && mz == 1) {prix = 139 * dz}if (dz >= 28 && mz == 1) {prix = 139 * dz}if (dz == 1 && mz == 2) {prix = 139}if (dz == 2 && mz == 2) {prix = 278}if (dz == 3 && mz == 2) {prix = 417}if (dz == 4 && mz == 2) {prix = 556}if (dz == 5 && mz == 2) {prix = 695}if (dz == 6 && mz == 2) {prix = 834}if (dz >= 7 && mz == 2) {prix = 139 * dz}if (dz >= 14 && mz == 2) {prix = 139 * dz}if (dz >= 21 && mz == 2) {prix = 139 * dz}if (dz >= 28 && mz == 2) {prix = 139 * dz}if (dz == 1 && mz == 3) {prix = 149}if (dz == 2 && mz == 3) {prix = 298}if (dz == 3 && mz == 3) {prix = 447}if (dz == 4 && mz == 3) {prix = 596}if (dz == 5 && mz == 3) {prix = 745}if (dz == 6 && mz == 3) {prix = 894}if (dz >= 7 && mz == 3) {prix = 149 * dz}if (dz >= 14 && mz == 3) {prix = 149 * dz}if (dz >= 21 && mz == 3) {prix = 149 * dz}if (dz >= 28 && mz == 3) {prix = 149 * dz}if (dz == 1 && mz == 4) {prix = 159}if (dz == 2 && mz == 4) {prix = 318}if (dz == 3 && mz == 4) {prix = 477}if (dz == 4 && mz == 4) {prix = 636}if (dz == 5 && mz == 4) {prix = 795}if (dz == 6 && mz == 4) {prix = 954}if (dz >= 7 && mz == 4) {prix = 159 * dz}if (dz >= 14 && mz == 4) {prix = 159 * dz}if (dz >= 21 && mz == 4) {prix = 159 * dz}if (dz >= 28 && mz == 4) {prix = 159 * dz} return prix }function get_temp_price160(dz,mz){ prix = 0 if (dz == 1 && mz == 1) {prix = 139}if (dz == 2 && mz == 1) {prix = 278}if (dz == 3 && mz == 1) {prix = 417}if (dz == 4 && mz == 1) {prix = 556}if (dz == 5 && mz == 1) {prix = 695}if (dz == 6 && mz == 1) {prix = 834}if (dz >= 7 && mz == 1) {prix = 139 * dz}if (dz >= 14 && mz == 1) {prix = 139 * dz}if (dz >= 21 && mz == 1) {prix = 139 * dz}if (dz >= 28 && mz == 1) {prix = 139 * dz}if (dz == 1 && mz == 2) {prix = 139}if (dz == 2 && mz == 2) {prix = 278}if (dz == 3 && mz == 2) {prix = 417}if (dz == 4 && mz == 2) {prix = 556}if (dz == 5 && mz == 2) {prix = 695}if (dz == 6 && mz == 2) {prix = 834}if (dz >= 7 && mz == 2) {prix = 139 * dz}if (dz >= 14 && mz == 2) {prix = 139 * dz}if (dz >= 21 && mz == 2) {prix = 139 * dz}if (dz >= 28 && mz == 2) {prix = 139 * dz}if (dz == 1 && mz == 3) {prix = 149}if (dz == 2 && mz == 3) {prix = 298}if (dz == 3 && mz == 3) {prix = 447}if (dz == 4 && mz == 3) {prix = 596}if (dz == 5 && mz == 3) {prix = 745}if (dz == 6 && mz == 3) {prix = 894}if (dz >= 7 && mz == 3) {prix = 149 * dz}if (dz >= 14 && mz == 3) {prix = 149 * dz}if (dz >= 21 && mz == 3) {prix = 149 * dz}if (dz >= 28 && mz == 3) {prix = 149 * dz}if (dz == 1 && mz == 4) {prix = 159}if (dz == 2 && mz == 4) {prix = 318}if (dz == 3 && mz == 4) {prix = 477}if (dz == 4 && mz == 4) {prix = 636}if (dz == 5 && mz == 4) {prix = 795}if (dz == 6 && mz == 4) {prix = 954}if (dz >= 7 && mz == 4) {prix = 159 * dz}if (dz >= 14 && mz == 4) {prix = 159 * dz}if (dz >= 21 && mz == 4) {prix = 159 * dz}if (dz >= 28 && mz == 4) {prix = 159 * dz} return prix }