function js_clock(A,N,D,E,G,$){s=N.split("-");var M=new Date();M.setFullYear(s[0],s[1]-1,s[2]);M.setHours(0);M.setMinutes(0);M.setSeconds(0);var H=M.getMonth()+1,F=M.getDate(),J=M.getYear();J=(J<1900?(1900+J):J);finaldateshow=J+"-"+H+"-"+F;var B=new Date(),N="";if(G=="down")N=Math.round((M-B)/1000);else N=Math.round((B-M)/1000);var I=parseInt(N/86400);L=N%86400;var C=parseInt(L/3600);L=L%3600;var _=parseInt(L/60);seconds=L%60;var L="";if(document.getElementById("cpickerf1")!=null)$=document.getElementById("cpickerf1").value;if(E==1){if(N>0){L="
"+I+" | : | "+C+" | : | "+_+" | : | "+seconds+" |
";L=L+"วัน | | ชั่วโมง | | นาที | | ที่สอง |
|
"}else L=finaldateshow}else if(E==2){if(N>0){L=""+I+" | : | "+C+" | : | "+_+" | : | "+seconds+" |
";L=L+"วัน | | ชั่วโมง | | นาที | | ที่สอง |
|
"}else L=finaldateshow}else if(E==3){if(N>0){L=""+I+" | : | "+C+" | : | "+_+" | : | "+seconds+" |
";L=L+"วัน | | ชั่วโมง | | นาที | | ที่สอง |
|
"}else L=finaldateshow}else if(E==4)if(N>0){L=""+I+" | : | "+C+" | : | "+_+" | : | "+seconds+" |
";L=L+"วัน | | ชั่วโมง | | นาที | | ที่สอง |
| |
"}else L=finaldateshow;var K=document.getElementById(D);K.innerHTML=L;setTimeout(""+A+"("+N+",'"+D+"',"+E+")",1000)}function DateAdd(_,A,$){switch(_){case"d":A.setDate(A.getDate()+$);break;case"m":A.setMonth(A.getMonth()+$);break;case"y":A.setYear(A.getFullYear()+$);break;case"h":A.setHours(A.getHours()+$);break;case"n":A.setMinutes(A.getMinutes()+$);break;case"s":A.setSeconds(A.getSeconds()+$);break}return A}function dateDiff(interval,date1,date2){var objInterval={"D":1000*60*60*24,"H":1000*60*60,"M":1000*60,"S":1000,"T":1};interval=interval.toUpperCase();var dt1=Date.parse(date1.replace(/-/g,"/")),dt2=Date.parse(date2.replace(/-/g,"/"));try{return Math.round((dt2-dt1)/eval("(objInterval."+interval+")"))}catch(e){return e.message}}function addLoadEvent($){var _=window.onload;if(typeof window.onload!="function")window.onload=$;else window.onload=function(){_();$()}}
function mystartxcount2_19802542422(){
js_clock('mystartxcount2_19802542422','2024-04-29','xcount2_1980254242',2,'down','111111');
}
addLoadEvent(mystartxcount2_19802542422);