var vstate = false;
	var tab = null;
	function switch_all(ngay){
		for (var i = -1; i < 6; i++){
			var lnk=document.getElementById(i);
			lnk.bgColor = '#FFFFFF';
			lnk.style.color = '#000000';
		}
		if(tab==null) tab = document.getElementById(-1);	
		if(tab!=null) tab.className = null;
		tab=document.getElementById(ngay);
		if(tab!=null) tab.className = 'redtab';
	
		var ext_obj = document.getElementById('ext_content');
		if(ext_obj!=null){
			if(ngay==-1) ext_obj.className = 'on';
			else ext_obj.className = 'off';
		}
		for (var i = 0; i < 7; i++){
			var obj=document.getElementById('blck'+i);
			var tit=document.getElementById('title'+i);
			if(obj!=null){
				if(ngay==-1){
					obj.className = 'on';
					//tit.className = 'on';
				}
				else if(i==ngay){
					obj.className = 'on';
					//tit.className = 'off';				
				}
				else{
					obj.className = 'off';
					//tit.className = 'on';
				}
			}
		}
	}
	
function weekNo() {
var totalDays = 0;
now = new Date();
years=now.getYear();
var days = new Array(12); // Array to hold the total days in a month
days[0] = 31;
days[2] = 31;
days[3] = 30;
days[4] = 31;
days[5] = 30;
days[6] = 31;
days[7] = 31;
days[8] = 30;
days[9] = 31;
days[10] = 30;
days[11] = 31;
 
// Check to see if this is a leap year
if (Math.round(now.getYear()/4) == now.getYear()/4) {
days[1] = 29
}else{
days[1] = 28
}
 
// If this is January no need for any fancy calculation otherwise figure out the
// total number of days to date and then determine what week
if (now.getMonth() == 0) { 
totalDays = totalDays + now.getDate();
}else{
var curMonth = now.getMonth();
for (var count = 1; count <= curMonth; count++) {
totalDays = totalDays + days[count - 1];
}
totalDays = totalDays + now.getDate();
}
// Here is the modification: considering when start the 1st week of year.
// Originally was only: var week = Math.round(totalDays/7)
// Check if browser is "Microsoft Internet Explorer" or not and apply the right var
var agt=navigator.userAgent.toLowerCase();
if ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) {
var firstday=new Date("01/01/"+String(now.getYear())).getDay();
}
else {
var firstday=new Date("01/01/"+String(1900+now.getYear())).getDay();
}
var diff=7-firstday+1;
var week = Math.round((totalDays+diff-firstday)/7) + 1; return week;
}

function weekNo_Date(ngay, thang, nam) {
var totalDays = 0;
//now = new Date(date);
inc_day1 = parseInt(thang) + '/' + parseInt(ngay) + '/' + parseInt(nam)
var now =  new Date(inc_day1 + " 00:00:00");
	
years=now.getYear();
var days = new Array(12); // Array to hold the total days in a month
days[0] = 31;
days[2] = 31;
days[3] = 30;
days[4] = 31;
days[5] = 30;
days[6] = 31;
days[7] = 31;
days[8] = 30;
days[9] = 31;
days[10] = 30;
days[11] = 31;
 
// Check to see if this is a leap year
if (Math.round(now.getYear()/4) == now.getYear()/4) {
days[1] = 29
}else{
days[1] = 28
}
 
// If this is January no need for any fancy calculation otherwise figure out the
// total number of days to date and then determine what week
if (now.getMonth() == 0) { 
totalDays = totalDays + now.getDate();
}else{
var curMonth = now.getMonth();
for (var count = 1; count <= curMonth; count++) {
totalDays = totalDays + days[count - 1];
}
totalDays = totalDays + now.getDate();
}
// Here is the modification: considering when start the 1st week of year.
// Originally was only: var week = Math.round(totalDays/7)
// Check if browser is "Microsoft Internet Explorer" or not and apply the right var
var agt=navigator.userAgent.toLowerCase();
if ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) {
var firstday=new Date("01/01/"+String(now.getYear())).getDay();
}
else {
var firstday=new Date("01/01/"+String(1900+now.getYear())).getDay();
}
var diff=7-firstday+1;
var week = Math.round((totalDays+diff-firstday)/7); return week;
}