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; 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 } }