﻿/*Note
File này thuộc quyền sở hữu của Lê Văn Phương - konchieng@gmail.com
Bất cứ ai xài lại File này thì vẫn giữ nguyên những thông tin ghi chú này.
Bất cứ ai xài lại File này mà xóa những thông tin ghi chú này thì là con chó ghẻ
///////
This file was copyrighted by Phuong Le Van - konchieng@gmail.com
Anyone using this file again that clear this notes so you are "son of a bitch"
*/
var timerID;
var nowHours="00";
var nowMinutes="00";
var nowSeconds="00";
var objDate = new Date();
var myDay = objDate.getDay();
var myDate = objDate.getDate();
var myCalendar_Title = objDate.getDate();
var myMonth = objDate.getMonth() + 1;
if (myMonth<10)
{
	myMonth="0" + myMonth;
}
var myYear = objDate.getFullYear();
if (myDay==0) { myDay = "Chủ nhật"; }
else if (myDay==1) { myDay = "Thứ hai"; }
else if (myDay==2) { myDay = "Thứ ba"; }
else if (myDay==3) { myDay = "Thứ tư"; }
else if (myDay==4) { myDay = "Thứ năm"; }
else if (myDay==5) { myDay = "Thứ sáu"; }
else if (myDay==6) { myDay = "Thứ bảy"; }
myDate=myDay + ", " + myDate + "/" + myMonth + "/" + myYear + " - ";

function initObjects() 
{
	document.getElementById("calendar_title").innerHTML= '&nbsp;';//myCalendar_Title;
	tick();
}

function tick() 
{
	var now = new Date()
	nowHours = now.getHours()
	nowMinutes = now.getMinutes()
	nowSeconds = now.getSeconds()

	//if (nowSeconds<10) 
	//{
	//	nowSeconds="0" + nowSeconds;
	//} 
	
	if (nowMinutes<10) 
	{
		nowMinutes="0" + nowMinutes;
	} 
		
	//if (nowHours >= 12) 
	//{
	//	nowSeconds=nowSeconds + " PM";
	//}
	//else
	//{
	//	nowSeconds=nowSeconds + " AM";
	//}

	if (nowHours >= 12) 
	{
		nowMinutes=nowMinutes + " PM";
	}
	else
	{
		nowMinutes=nowMinutes + " AM";
	}

	if (nowHours<10) 
	{
		nowHours="0" + nowHours;
	} 
	
	document.getElementById("clock1").innerHTML="&nbsp;&nbsp;" + myDate + nowHours + ":" + nowMinutes; // + ":" + nowSeconds;	
	//just using for IE : document.all.clock1.innerText =" " + nowHours + ":" + nowMinutes + ":" + nowSeconds;
	timerID  = window.setTimeout("tick()", 100);
}
/*Note
File này thuộc quyền sở hữu của Lê Văn Phương - konchieng@gmail.com
Bất cứ ai xài lại File này thì vẫn giữ nguyên những thông tin ghi chú này.
Bất cứ ai xài lại File này mà xóa những thông tin ghi chú này thì là con chó ghẻ
///////
This file was copyrighted by Phuong Le Van - konchieng@gmail.com
Anyone using this file again that clear this notes so you are "son of a bitch"
*/
