//---------DUNG CHUNG CHO CA ADMIN VA VIEW-------------
function WindowOpenHtlarea(URL)
{
	window.open(URL,'Content','top=150,left=150,width=700px,height=500px,scrollbars=no');
}
function ModalDialog(URL)
{
	window.showModalDialog(URL, 'Not', 'dialogWidth=500px; dialogHeight=110px; scroll=no; status=no');
}
function WindowUpload(URL)
{
	window.open(URL,'Upload','top=350,left=250,width=500px,height=110px,scrollbars=no');
}
function WindowOpenPhoto(URL)
{
	window.showModalDialog(URL,'Content','dialogWidth=700px; dialogHeight=500px; scroll=no; status=no');
}
function getChecked(name){
var o=document.getElementsByName(name);
	var i,s,v;
	for(i=0,s='';i < o.length; ++i){
		v=o.item(i);
		if(v.type == "checkbox"){
			if(v.checked) s += ',' + String(v.value);
		}
	}
	return s.substr(1);//remove leading ,
}
function createCookie(name,value,days) 
{
	if (days) 
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
//=======================================
function deleteCookie(name) 
{
	createCookie(name,"",new Date().getTime());
}

//=========================
function readCookie(name) 
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) 
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
function TrSelect(id)
{
	if(frmTem.objvalue.value != ""){
		document.getElementById(frmTem.objvalue.value).style.background="#ffffff";
		document.getElementById(id).style.background="#F9F9EE";
	}else{
		document.getElementById(id).style.background="#F9F9EE";
	}
	document.frmTem.objvalue.value = id;
	
}