function changeChannel( newActiveLinkId, basePath) 
{
	var newActiveLink = document.getElementById(newActiveLinkId);	
	disableAllTabs();
	enableActiveTab(newActiveLink);
	setChannelFrameUrl(basePath);
}
function setChannelFrameUrl(url) {
	frames["channelFrame"].location.replace(url);
}
function enableActiveTab(newActiveLink) {	
	newActiveLink.className = "LinkButton_active";
}
function disableAllTabs() {
	var tabList = document.getElementById("tabList");	
	//note: subtract one because the last item is the detailed or thumbnail link
	for (var i=0; i<tabList.childNodes.length -1; i++) 
	{	
			
		var tabItem = document.getElementById(tabList.childNodes[i].id);		
		tabItem.className = "LinkButton_disable";		
	}
}
function Redirect(location)
{
	if (typeof(document.forms[0].DoSubmit) != 'undefined')
	{
		// dirty flag that causes the DoSubmitCheck function below
		// to return false, canceling the form submit and redirecting
		// to our desired location with the new ticker
		//document.forms[0].DoSubmit.value = "true";
	}
	window.parent.location = location;
}
function doSearch(url, text, tabid)
{
	var searchText = document.getElementById(text).value;
	if ("SEARCH" == searchText.toUpperCase()) searchText = "";
	//var searchDropDown = document.getElementById(dropDown);
	//var searchType = searchDropDown.options[searchDropDown.selectedIndex].value
	var location = url + encodeURIComponent(searchText) + "&tabid=" + tabid;
	Redirect(location);
}

function jumpPage(url,Pid,Category_ID,tabid,langid,currPage,Type)
{
	var location = url + "?Pid=" + Pid + "&Category_ID=" + Category_ID + "&tabid=" + tabid + "&langid=" + langid + "&page=" + currPage + "&Type=" + Type;
	Redirect(location);
}
function jumpPage_TL(url,Category_ID,tabid,langid,currPage,Type)
{
	var location = url + "?Category_ID=" + Category_ID + "&tabid=" + tabid + "&langid=" + langid + "&page=" + currPage + "&Type=" + Type;
	Redirect(location);
}
function jumpPage_TL_New(url,text,Category_ID,tabid,langid,currPage,Type)
{
	var location = url + "?txt_Tieude=" + text + "&Category_ID=" + Category_ID + "&tabid=" + tabid + "&langid=" + langid + "&page=" + currPage + "&Type=" + Type;
	Redirect(location);
}
function jumpPageSearch(url,Category_ID,tabid,langid,currPage,Type,text)
{
	var location = url + "?Category_ID=" + Category_ID + "&tabid=" + tabid + "&langid=" + langid + "&page=" + currPage + "&Type=" + Type;
	Redirect(location);
}
function goPopup(url)
{	
	var location = url
	window.open(location,'popup','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=620,height=500,scrollbars=no,top=50,left=200'); 
}
function goPopupAudioPlay(AudioID,url)
{	
	var location = url + "?AudioID=" + AudioID
	window.open(location,'popup','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=620,height=500,scrollbars=no,top=50,left=200'); 
}
function goPopupAudioPlayByCategory(CatID,url)
{		
	var location = url + "?CatID=" + CatID
	window.open(location,'popup','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=620,height=500,scrollbars=no,top=50,left=200'); 
}

function jumpPageNews(url,Pid,Category_ID,tabid,langid,currPage)
{
	var location = url + "?Pid=" + Pid + "&Category_ID=" + Category_ID + "&tabid=" + tabid + "&langid=" + langid + "&page=" + currPage;
	//On_PlayMedium(location)
	Redirect(location);
}
function jumpPageNews_search(url,searchText,Category_ID,tabid,langid,currPage)
{
	var location = url + "?srch=" + encodeURIComponent(searchText) + "&Category_ID=" + Category_ID + "&tabid=" + tabid + "&langid=" + langid + "&page=" + currPage;
	Redirect(location);
}
function jumpPageNewsSpec(url,ID,currPage)
{
	var location = url + "?id=" + ID + "&page=" + currPage;
	//On_PlayMedium(location)
	Redirect(location);
}
function jumpPageNews_TL(url,tabid,currPage)
{
	var location = url + "?tabid=" + tabid + "&page=" + currPage;
	//On_PlayMedium(location)
	Redirect(location);
}