//*****************************************************************
// Configurations
//*****************************************************************
var bgColorOut=""; //background color
var bgColorOver=""; // mouse over background color
var bgColorSelected=""; //background color for selected group
var fontSize=16;
var fontColorOut="#ffffff"; // font color
var fontColorOver="#2e7eee"; //mouse over font color
var fontColorSelected="#2e7eee"; // background color for selected group font
var width="auto"; 
var height="23px";
//*****************************************************************
var selected;
var renderChannel;

function initGroup()
{
document.write('<table cellpadding="0" cellspacing="0" align="center"><tr align="center" style=" cursor:pointer">');
//document.write('<td id="td20" onClick="selectGroup(20);" onMouseOver="changTd(this)" style=" font-size:'+fontSize+'; background:'+bgColorOut+'; color:'+fontColorOut+'; height:'+height+'; width:'+width+';"><b>RRSat</b> </td>');
document.write('<td id="td0" onClick="selectGroup(null);" onMouseOver="changTd(this)" style=" font-size:'+fontSize+'; background:'+bgColorOut+'; color:'+fontColorOut+'; height:'+height+'; width:'+width+';"><b>All</b> </td><td id="td1" onClick="selectGroup(1);" onMouseOver="changTd(this)" style=" font-size:'+fontSize+'; background:'+bgColorOut+'; color:'+fontColorOut+';"><b>News</b></td><td id="td2" onClick="selectGroup(2);" onMouseOver="changTd(this)" style="  font-size:'+fontSize+'; background:'+bgColorOut+'; color:'+fontColorOut+'; height:'+height+'; width:'+width+';"><b>Sports</b></td><td id="td3" onClick="selectGroup(3);" onMouseOver="changTd(this)" style="  font-size:'+fontSize+'; background:'+bgColorOut+'; color:'+fontColorOut+'; height:'+height+'; width:'+width+';"><b>Networks</b></td><td id="td4" onClick="selectGroup(4);" onMouseOver="changTd(this)"style="  font-size:'+fontSize+'; background:'+bgColorOut+'; color:'+fontColorOut+'; height:'+height+'; width:'+width+';"><b>Movies</b></td><td id="td5" onClick="selectGroup(5);" onMouseOver="changTd(this)"style="  font-size:'+fontSize+'; background:'+bgColorOut+'; color:'+fontColorOut+'; height:'+height+'; width:'+width+';"><b>Lifestyle</b></td><td id="td6" onClick="selectGroup(6);" onMouseOver="changTd(this)"style="  font-size:'+fontSize+'; background:'+bgColorOut+'; color:'+fontColorOut+'; height:'+height+'; width:'+width+';"><b>Music</b></td><td id="td9" onClick="selectGroup(9);" onMouseOver="changTd(this)" style=" font-size:'+fontSize+'; background:'+bgColorOut+'; color:'+fontColorOut+'; height:'+height+'; width:'+width+';"><b>Fun</b></td><td id="td11" onClick="selectGroup(11);" onMouseOver="changTd(this)"style="  font-size:'+fontSize+'; background:'+bgColorOut+'; color:'+fontColorOut+'; height:'+height+'; width:'+width+';"><b>English</b></td><td id="td12" onClick="selectGroup(12);" onMouseOver="changTd(this)"style="  font-size:'+fontSize+'; background:'+bgColorOut+'; color:'+fontColorOut+'; height:'+height+'; width:'+width+';"><b>Chinese</b></td><td id="td13" onClick="selectGroup(13);" onMouseOver="changTd(this)"style="  font-size:'+fontSize+'; background:'+bgColorOut+'; color:'+fontColorOut+'; height:'+height+'; width:'+width+';"><b>Cartoons</b></td></tr></table> ')
}
initGroup();
function changTd(obj){
	if(obj!=selected){
	obj.style.backgroundColor=bgColorOver;
	obj.style.color=fontColorOver;
	obj.onmouseout=function(){
		if(obj!=selected){
		obj.style.backgroundColor=bgColorOut;
		obj.style.color=fontColorOut;
		}
	}}
}

function selectGroup(groupId,i){
	if(selected!=null){
		selected.style.backgroundColor=bgColorOut
		selected.style.color=fontColorOut
	}
	selected=eval("td"+(groupId||0));	
	selected.style.backgroundColor=bgColorSelected
	selected.style.color=fontColorSelected
	group_id=groupId;
	if(renderChannel){
		//renderChannelByPage(0);
		getPL();
	}
	
}
window.load=function(){
	selectGroup(null,1);
}
