﻿/*
  Original: daniusr
  You are welcomed to modify this script to your needs.
  This script retrieves the time from the internal system clock,
  so it is up to you to make sure the time is accurate or correct.
  */
function clock()
{
	var today = new Date();
	var hours = today.getHours();
	var minutes = today.getMinutes();
	var seconds = today.getSeconds();
	var curr_day = today.getDay() ;
	var curr_date = today.getDate();
	var curr_month = today.getMonth() + 1;
	var curr_year = today.getFullYear();
	var time_holder; // holds the time
	var dayarray=new Array("Chủ nhật","Thứ hai","Thứ ba","Thứ tư","Thứ năm","Thứ sáu", "Thứ bảy")
	// add a leading zero if less than 10
	curr_date = ((curr_date < 10) ? "0" + curr_date : curr_date);
	curr_month = ((curr_month < 10) ? "0" + curr_month : curr_month);
	hours = ((hours < 10) ? "0" + hours : hours);
	minutes = ((minutes < 10) ? "0" + minutes : minutes);
	seconds = ((seconds < 10) ? "0" + seconds : seconds);
	time_holder = dayarray[curr_day] + ", Ngày " + curr_date + "/" + curr_month + "/" + curr_year + " | " + hours + ":" + minutes + ":" + seconds;
	document.getElementById('jsClock').innerHTML = time_holder;	
	// keep the clock ticking
	setTimeout("clock()", 1000);
	
	}	
// end hiding -->
function NewWinDow(url){
    window.open(url,"_blank","center=yes,scrollbars=yes,status=no,resizable=yes") 
}	
