function discountsup(dz,fullprices,ss) { holsupdays_zz = 0; holsup_zz = 0; holsup_zztemp = 0; hold_zz = 0; ss = ss/1000; return holsup_zz } function overlap_zz(ss,dz,hsdate,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 }