﻿var showblock=false;
var block_id='';
var itemSelected=false;
var item_id='';
function mouse_click_action(obj, pathlink, width, height){
	obj.className='mouse_click_me';
	//window_open(pathlink,600, 400,'yes','normal');
}
function mouse_over_action(obj){
	obj.className='mouse_over_me';
}
function mouse_out_action(obj){
	obj.className='mouse_out_me';
}
function WebAction(linkto){
	document.location.href=linkto;
}
function initpage(blockId){
	if(blockId!=block_id){
		if(block_id!='')
			document.getElementById(block_id).style.display = "none";
		document.getElementById(blockId).style.display = "block";
		showblock = true;
		block_id=blockId;
	}
	else{
		if(!showblock){
			 showblock = true;
			document.getElementById(blockId).style.display = "block";
		}
	}
}
function showBlock(blockId){
    document.getElementById(blockId).style.display = "block";
}
function hideBlock(blockId){
    document.getElementById(blockId).style.display = "none";
}
function selectItemListbox(obj, value){
	for(i=0; i < obj.options.length; i++)
	{
		val = parseInt(obj.options[i].value);
		if(val==parseInt(value)){
			obj.selectedIndex=i;
		}	
	}

}
function selectAutoListbox(obj, index){
	obj.selectedIndex=index;
}
function showSubMenu(menuid){
	if (menuid!="none"){
		document.getElementById(menuid).className="level1sel";		
		if (document.getElementById(menuid+'sub')){
			document.getElementById(menuid+'sub').style.display="block";
		}
	}
}
function writeTime(s){
	var mydate;
	if (s)
		mydate = new Date(s);
	else
		mydate = new Date();
	
	var year = mydate.getYear()
	if (year < 1000)
		year += 1900
	var month = mydate.getMonth() + 1
	if (month < 10)
		month = "0" + month
	var day = mydate.getDate()
	if (day < 10)
		day = "0" + day

	var dayw = mydate.getDay()
	
	var hour = mydate.getHours()
	if (hour < 10)
		hour = "0" + hour
	
	var minute=mydate.getMinutes()
	if (minute < 10)
		minute = "0" + minute
	//var dayarray=new Array("Ch&#7911; Nh&#7853;t","Th&#7913; Hai","Th&#7913; Ba","Th&#7913; T&#432;","Th&#7913; N&#259;m","Th&#7913; S&#225;u","Th&#7913; B&#7843;y")
	//document.write(dayarray[dayw]+", "+day+"/"+month+"/"+year+",&nbsp;"+hour+":"+minute + " GMT+7")
	document.write(day+"/"+month+"/"+year+",&nbsp;"+hour+":"+minute + " GMT+7")
}
