function timeS2R(x){return eval(x.replace(/^(\d* )?(\d+):(\d{2}):(\d{2})$/,"parseInt('0$1',10)+parseInt('$2',10)/24+parseInt('$3',10)/1440+parseInt('$4',10)/86400"))}
function timeR2S(x){u="";x=Math.round(x*86400);s=x%60;x=Math.floor(x/60);m=x%60;x=Math.floor(x/60);h=x%24;d=Math.floor(x/24);if(d){u+=d+" ";if(h<10)u+="0"};u+=h;u+=":";if(m<10)u+="0";u+=m;u+=":";if(s<10)u+="0";return u+s}
function timeS2I(x){return eval(x.replace(/^(\d* )?(\d+):(\d{2}):(\d{2})$/,"parseInt('0$1',10)*86400+parseInt('$2',10)*3600+parseInt('$3',10)*60+parseInt('$4',10)"))}
function timeI2S(x){u="";x=Math.round(x);s=x%60;x=Math.floor(x/60);m=x%60;x=Math.floor(x/60);h=x%24;d=Math.floor(x/24);if(d){u+=d+" ";if(h<10)u+="0"};u+=h;u+=":";if(m<10)u+="0";u+=m;u+=":";if(s<10)u+="0";return u+s}