﻿function showDialog(url, width, height)
{
	return showWindow(url, false, false, true, false, false, false, true, true, width, height, 0, 0);
}

function showWindow(url, isStatus, isResizeable, isScrollbars, isToolbar, isLocation, isFullscreen, isTitlebar, isCentered, width, height, top, left)
{
	if (isCentered)
	{
		top = (screen.height - height) / 2;
		left = (screen.width - width) / 2;
	}

	open(url, '_blank', 'status=' + (isStatus ? 'yes' : 'no') + ','
	+ 'resizable=' + (isResizeable ? 'yes' : 'no') + ','
	+ 'scrollbars=' + (isScrollbars ? 'yes' : 'no') + ','
	+ 'toolbar=' + (isToolbar ? 'yes' : 'no') + ','
	+ 'location=' + (isLocation ? 'yes' : 'no') + ','
	+ 'fullscreen=' + (isFullscreen ? 'yes' : 'no') + ','
	+ 'titlebar=' + (isTitlebar ? 'yes' : 'no') + ','
	+ 'height=' + height + ',' + 'width=' + width + ','
	+ 'top=' + top + ',' + 'left=' + left);
}
function displayInfo(info)
{
	if (info == 'ThoiTiet')
		showDialog('Infomation.aspx?ID=1', 520, 600);
	if (info == 'XoSo')
		showDialog('Infomation.aspx?ID=2', 500, 600);
	if (info == 'TruyenHinh')
		showDialog('Infomation.aspx?ID=3', 500, 600);
	if (info == 'NgoaiTe')
		showDialog('Infomation.aspx?ID=4', 500, 600);
	if (info == 'Vang')
		showDialog('Infomation.aspx?ID=5', 500, 300);
}
function getFullDateInVietnamese(){
	var now = new Date();
	var month = "";
	var day = "";
	var first_date_num="";

  if (now.getDate() < 10)
  	first_date_num="0";
	else
		first_date_num="";
			
	switch (now.getDay()){
		case 0: day="Ch&#7911; nh&#7853;t";break;
		case 1: day="Th&#7913; hai";break;
		case 2: day="Th&#7913; ba";break;
		case 3: day="Th&#7913; t&#432;";break;
		case 4: day="Th&#7913; n&#259;m";break;
		case 5: day="Th&#7913; s&#225;u";break;
		case 6: day="Th&#7913; b&#7843;y";break;
	}	
	return day + " ng&#224;y " + first_date_num + now.getDate() + " th&#225;ng " + (now.getMonth()+1) + " n&#259;m " + now.getFullYear();
}
function whenEvent(tdItem, className){
		tdItem.className = className;
}	
function fXL(value){
		window.open(value,"NewWin");
	}
