function EmsOnline (a, b, c, d) { var f = (c*60+d)-(a*60+b); return f % 60 >= 0.5? f+(1-(f%60)):f-(f%60); } =EmsOnline(a16, b16, c16, d16);