function onCbLienket()
{
	//ThanhNV add: Don't open webpage when value is empty or null
	if ((myform.cbLienket.value.length==0) ||
	(myform.cbLienket.value==null)) 
	{
      return false;
	}	
	
	var newWindow = window.open(myform.cbLienket.value, '_blank');
	newWindow.focus();
    myform.cbLienket.selectedIndex = 0;
	return true;
}


/***********************************************
* Highlight Table Cells Script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Specify highlight behavior. "TD" to highlight table cells, "TR" to highlight the entire row:
var highlightbehavior="TD";

var ns6=document.getElementById&&!document.all;
var ie=document.all;

function changeto(e,highlightcolor)
{
	source=ie? event.srcElement : e.target;
	if (source.tagName=="TABLE")
		return;
	while(source.tagName!=highlightbehavior && source.tagName!="HTML")
		source=ns6? source.parentNode : source.parentElement;
	if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
		source.style.backgroundColor=highlightcolor;
}

function contains_ns6(master, slave)
{ //check if slave is contained by master
	while (slave.parentNode)
		if ((slave = slave.parentNode) == master)
			return true;
	return false;
}

function changeback(e,originalcolor)
{
	if (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TABLE")
		return;
	else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
		return;
	if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
		source.style.backgroundColor=originalcolor;
}
//Xóa user
function confirmDelUser(id)
{
	var agree = confirm('Xác nhận xóa tài khoản người sử dụng?');
	if ( agree)
	{
		location.href('./?act=admin&subact=user_list&status=del&id=' + id);
		return true;
	}
	else
	return false;
}
//Xóa group
function confirmDelGroup(id)
{
	var agree = confirm('Xác nhận xóa nhóm?');
	if ( agree)
	{
		location.href('./?act=admin&subact=group_list&status=del&id=' + id);
		return true;
	}
	else
	return false;
}
//Xoa tin do cac user gui len
function confirmDelNews(id)
{
	var agree = confirm('Xác nhận xóa tin ?');
	if ( agree)
	{
		location.href('./?act=admin&subact=duyet_tintuc&status=del&id=' + id);
		return true;
	}
	else
	return false;
}

function confirmDelNewsID(id)
{
	var agree = confirm('Xác nhận xóa tin ?');
	if ( agree)
	{
		location.href('./?act=admin&subact=del_or_edit&status=del&id=' + id);
		return true;
	}
	else
	return false;
}
//Xac nhan xoa bao cao
function confirmDelReports(id)
{
	var agree = confirm('Xác nhận xóa báo cao ? id=' + id);
	if (agree)
	{
		location.href('./?act=admin&subact=duyet_baocao&status=del&id=' + id);
		return true;
	}
	else
	return false;
}

function confirmDelImages(radioObj, catid, pagenum)
{
	if (!radioObj)
	{
		return false;
	}
	var radioLength = radioObj.length;
	strid = "";
	idcount = 0;
	
	if (radioLength == undefined)
	{
		if(radioObj.checked)
		{
			strid = strid+radioObj.value+";";
			idcount++;			
		}
	}
	else
	{
		for(var i = 0; i < radioLength; i++) 
		{
			if (radioObj[i].checked) 
			{
				strid = strid + radioObj[i].value + ";";
				idcount++;
			}
		}
	}
	if (idcount <= 0)
		return false;
	strMsg = "Xác nhận xóa: " + idcount + " ảnh đã chọn?";
	var agree = confirm(strMsg);
	if ( agree)
	{
		location.href('./?act=admin&subact=edit_image&status=del&strid='+strid+'&catid='+catid+'&page='+pagenum);
		return true;
	}
	return false;
}

function linkTo(link)
{
    location.href(link);
    return true;
}