<!--
function MM_swapImgRestore() {
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() {
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
var dropdowncontent={
	disableanchorlink: true,
 hidedivmouseout: [true, 1000],
	ajaxloadingmsg: "Loading content. Please wait...",
	ajaxbustcache: true,
	getposOffset:function(what, offsettype){
		return (what.offsetParent)? what[offsettype]+this.getposOffset(what.offsetParent, offsettype) : what[offsettype]
	},
	isContained:function(m, e){
		var e=window.event || e
		var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
		while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
		if (c==m)
			return true
		else
			return false
	},
	show:function(anchorobj, subobj, e){
		if (!this.isContained(anchorobj, e) || (e && e.type=="click")){
			var e=window.event || e
			if (e.type=="click" && subobj.style.visibility=="visible"){
				subobj.style.visibility="hidden"
				return
			}
			var horizontaloffset=(subobj.dropposition[0]=="left")? -(subobj.offsetWidth-anchorobj.offsetWidth) : 0
			var verticaloffset=(subobj.dropposition[1]=="top")? -subobj.offsetHeight : anchorobj.offsetHeight
			subobj.style.left=this.getposOffset(anchorobj, "offsetLeft") + horizontaloffset + "px"
			subobj.style.top=this.getposOffset(anchorobj, "offsetTop")+verticaloffset+"px"
			subobj.style.clip=(subobj.dropposition[1]=="top")? "rect(auto auto auto 0)" : "rect(0 auto 0 0)"
			subobj.style.visibility="visible"
			subobj.startTime=new Date().getTime()
			subobj.contentheight=parseInt(subobj.offsetHeight)
			if (typeof window["hidetimer_"+subobj.id]!="undefined")
				clearTimeout(window["hidetimer_"+subobj.id])
			this.slideengine(subobj, (subobj.dropposition[1]=="top")? "up" : "down")
		}
	},
	curveincrement:function(percent){
		return (1-Math.cos(percent*Math.PI)) / 2
	},
	slideengine:function(obj, direction){
		var elapsed=new Date().getTime()-obj.startTime
		if (elapsed<obj.glidetime){
			var distancepercent=(direction=="down")? this.curveincrement(elapsed/obj.glidetime) : 1-this.curveincrement(elapsed/obj.glidetime)
			var currentclip=(distancepercent*obj.contentheight)+"px"
			obj.style.clip=(direction=="down")? "rect(0 auto "+currentclip+" 0)" : "rect("+currentclip+" auto auto 0)"
			window["glidetimer_"+obj.id]=setTimeout(function(){dropdowncontent.slideengine(obj, direction)}, 10)
		}
		else{
			obj.style.clip="rect(0 auto auto 0)"
		}
	},
	hide:function(activeobj, subobj, e){
		if (!dropdowncontent.isContained(activeobj, e)){
			window["hidetimer_"+subobj.id]=setTimeout(function(){
				subobj.style.visibility="hidden"
				subobj.style.left=subobj.style.top=0
				clearTimeout(window["glidetimer_"+subobj.id])
			}, dropdowncontent.hidedivmouseout[1])
		}
	},
	hidediv:function(subobjid){
		document.getElementById(subobjid).style.visibility="hidden"
	},
	ajaxconnect:function(pageurl, divId){
		var page_request = false
		var bustcacheparameter=""
		if (window.XMLHttpRequest)
			page_request = new XMLHttpRequest()
		else if (window.ActiveXObject){
			try {
			page_request = new ActiveXObject("Msxml2.XMLHTTP")
			} 
			catch (e){
				try{
				page_request = new ActiveXObject("Microsoft.XMLHTTP")
				}
				catch (e){}
			}
		}
		else
			return false
		document.getElementById(divId).innerHTML=this.ajaxloadingmsg
		page_request.onreadystatechange=function(){dropdowncontent.loadpage(page_request, divId)}
		if (this.ajaxbustcache)
			bustcacheparameter=(pageurl.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
		page_request.open('GET', pageurl+bustcacheparameter, true)
		page_request.send(null)
	},
	loadpage:function(page_request, divId){
		if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
			document.getElementById(divId).innerHTML=page_request.responseText
		}
	},
 init:function(anchorid, pos, glidetime, revealbehavior){
		var anchorobj=document.getElementById(anchorid)
		var subobj=document.getElementById(anchorobj.getAttribute("rel"))
		var subobjsource=anchorobj.getAttribute("rev")
		if (subobjsource!=null && subobjsource!="")
			this.ajaxconnect(subobjsource, anchorobj.getAttribute("rel"))
		subobj.dropposition=pos.split("-")
		subobj.glidetime=glidetime || 1000
		subobj.style.left=subobj.style.top=0
		if (typeof revealbehavior=="undefined" || revealbehavior=="mouseover"){
			anchorobj.onmouseover=function(e){dropdowncontent.show(this, subobj, e)}
			anchorobj.onmouseout=function(e){dropdowncontent.hide(subobj, subobj, e)}
			if (this.disableanchorlink) anchorobj.onclick=function(){return false}
		}
		else
			anchorobj.onclick=function(e){dropdowncontent.show(this, subobj, e); return false}
		if (this.hidedivmouseout[0]==true)
			subobj.onmouseout=function(e){dropdowncontent.hide(this, subobj, e)}
	}
}
function hidestatus(){
	  window.status=''
	    return true
	}
	if (document.layers)
	  document.addEventListener(Event.MOUSEOVER | Event.MOUSEOUT)
	  document.onmouseover=hidestatus
	  document.onmouseout=hidestatus
function bookmarksite(title,url){
if (window.sidebar)
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)
	window.external.AddFavorite(url, title);
}
tempo = 50;
chars = 10;
texto = "<O*;-Don't forget to bookmark us! Press CTRL-D";
wtexto = new Array(33);
wtexto[0] = texto;
blnk = "                                              ";
for (i = 1; i < 32; i++) {
b = blnk.substring(0, i);
wtexto[i] = "";
for (j = 0; j < texto.length; j++) wtexto[i] = wtexto[i] + texto.charAt(j) + b;
}
function animastatus() {
if (chars > -1) str = wtexto[chars]; 
else str = wtexto[0];
if (chars-- < -40) chars = 31;
status = str;
clearTimeout(tempo);
tempo = setTimeout("animastatus()", 60);
}
animastatus()
function msg(){
alert('Coming Soon..');
}
function message()
{
var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=parseFloat(b_version);
if ((browser=="Microsoft Internet Explorer")
&& (version>=4))
{
var answerOkay = alert("Afzel Moshahede Mozilla Firefox \n\n Behtarin Moshahede ba Mozilla Firefox \n\n Best Viewed with Mozilla Firefox \n\n Mieux Vu avec Mozilla Firefox \n\n Se Ve Mejor con Mozilla Firefox \n\n Beste Ansicht mit Mozilla Firefox")
if (answerOkay)
{
return true;
}
}
else
{
return false;
}
}
function ddtabcontent(tabinterfaceid){
	this.tabinterfaceid=tabinterfaceid
	this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a")
	this.enabletabpersistence=true
	this.hottabspositions=[]
	this.subcontentids=[]
	this.revcontentids=[]
	this.selectedClassTarget="link"
}
ddtabcontent.getCookie=function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i");
	if (document.cookie.match(re))
		return document.cookie.match(re)[0].split("=")[1]
	return ""
}
ddtabcontent.setCookie=function(name, value){
	document.cookie = name+"="+value+";path=/"
}
ddtabcontent.prototype={
	expandit:function(tabid_or_position){
		this.cancelautorun()
		var tabref=""
		try{
			if (typeof tabid_or_position=="string" && document.getElementById(tabid_or_position).getAttribute("rel"))
				tabref=document.getElementById(tabid_or_position)
			else if (parseInt(tabid_or_position)!=NaN && this.tabs[tabid_or_position].getAttribute("rel"))
				tabref=this.tabs[tabid_or_position]
		}
		catch(err){alert("Invalid Tab ID or position entered!")}
		if (tabref!="")
			this.expandtab(tabref)
	},
	setpersist:function(bool){
			this.enabletabpersistence=bool
	},
	setselectedClassTarget:function(objstr){
		this.selectedClassTarget=objstr || "link"
	},
	getselectedClassTarget:function(tabref){
		return (this.selectedClassTarget==("linkparent".toLowerCase()))? tabref.parentNode : tabref
	},
	expandtab:function(tabref){
		var subcontentid=tabref.getAttribute("rel")
		var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : ""
		this.expandsubcontent(subcontentid)
		this.expandrevcontent(associatedrevids)
		for (var i=0; i<this.tabs.length; i++){
			this.getselectedClassTarget(this.tabs[i]).className=(this.tabs[i].getAttribute("rel")==subcontentid)? "selected" : ""
		}
		if (this.enabletabpersistence)
			ddtabcontent.setCookie(this.tabinterfaceid, tabref.tabposition)
	},
	expandsubcontent:function(subcontentid){
		for (var i=0; i<this.subcontentids.length; i++){
			var subcontent=document.getElementById(this.subcontentids[i])
			subcontent.style.display=(subcontent.id==subcontentid)? "block" : "none"
		}
	},
	expandrevcontent:function(associatedrevids){
		var allrevids=this.revcontentids
		for (var i=0; i<allrevids.length; i++){
			document.getElementById(allrevids[i]).style.display=(associatedrevids.indexOf(","+allrevids[i]+",")!=-1)? "block" : "none"
		}
	},
	autorun:function(){
		var currentTabIndex=this.automode_currentTabIndex
		var hottabspositions=this.hottabspositions
		this.expandtab(this.tabs[hottabspositions[currentTabIndex]])
		this.automode_currentTabIndex=(currentTabIndex<hottabspositions.length-1)? currentTabIndex+1 : 0
	},
	cancelautorun:function(){
		if (typeof this.autoruntimer!="undefined")
			clearInterval(this.autoruntimer)
	},
	init:function(automodeperiod){
		var persistedtab=ddtabcontent.getCookie(this.tabinterfaceid)
		var persisterror=true
		this.automodeperiod=automodeperiod || 0
		for (var i=0; i<this.tabs.length; i++){
			this.tabs[i].tabposition=i
			if (this.tabs[i].getAttribute("rel")){
				var tabinstance=this
				this.hottabspositions[this.hottabspositions.length]=i
				this.subcontentids[this.subcontentids.length]=this.tabs[i].getAttribute("rel")
				this.tabs[i].onmouseover=function(){
					tabinstance.expandtab(this)
					tabinstance.cancelautorun()
					return false
				}
				if (this.tabs[i].getAttribute("rev")){
					this.revcontentids=this.revcontentids.concat(this.tabs[i].getAttribute("rev").split(/\s*,\s*/))
				}
				if (this.enabletabpersistence && parseInt(persistedtab)==i || !this.enabletabpersistence && this.getselectedClassTarget(this.tabs[i]).className=="selected"){
					this.expandtab(this.tabs[i])
					persisterror=false
					this.automode_currentTabIndex=(i>0)? 0 : 1
				}
			}
		}
		if (persisterror)
			this.expandtab(this.tabs[this.hottabspositions[0]])
		if (parseInt(this.automodeperiod)>500 && this.hottabspositions.length>1){
			this.automode_currentTabIndex=this.automode_currentTabIndex || 0
			this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod)
		}
	}
}
function hideShow(){
var toggleRemote = "<span id='MaxMin'>"+hideshowMinMaxOne+"</span><a id='SwitchThis' class='hideShow' onclick='toggle(Btn);'>"+hideshowObject+"</a><a id='SwitchImage' class='hideShow' onclick='toggle(Btn);'>"+hideshowRemoteOne+"</a>";
document.write(toggleRemote);
}
var Btn=1;
function toggle(Button){
if (Button==1){
document.getElementById(hideshowID).style.display="none";
document.getElementById("SwitchThis").innerHTML=hideshowObject;
document.getElementById("MaxMin").innerHTML=hideshowMinMaxTwo;
document.getElementById("SwitchImage").innerHTML=hideshowRemoteTwo;
Btn=0;
}
if (Button==0){
document.getElementById(hideshowID).style.display="block";
document.getElementById("SwitchThis").innerHTML=hideshowObject;
document.getElementById("MaxMin").innerHTML=hideshowMinMaxOne;
document.getElementById("SwitchImage").innerHTML=hideshowRemoteOne;
Btn=1;
}
}
var count1=true, count2=true, count3=true;
function toggleThisOnce(Me){
  if (count1==true && Me=="MostViewedChannels")
  {
  document.getElementById(Me).style.display='block';
  count1=false;
  }
  else if (count2==true && Me=="AllChannelsBrowser")
  {
  document.getElementById(Me).style.display='block';
  count2=false;
  }
  else if (count3==true && Me=="QuickChannelSearch")
  {
  document.getElementById(Me).style.display='block';
  count3=false;
  }
  else if (count4==true && Me=="ChannelsBeingWatched")
  {
  document.getElementById(Me).style.display='block';
  count4=false;
  }
}
function toggleThis(Me,Sign){
var toggleMe=document.getElementById(Me);
 if (toggleMe!=null)
 {
 toggleMe.style.display=(toggleMe.style.display=='block')? 'none' : 'block';
 }
  if (Sign)
  {
  var toggleSign=document.images[Sign];
  toggleSign.src=(toggleSign.src=='http://www.etvland.com/images/collapseh.gif')? 'http://www.etvland.com/images/expandh.gif' : 'http://www.etvland.com/images/collapseh.gif';
  }
}
function setOpacity(testObj,value) {
	testObj.style.opacity = value/10;
	testObj.style.filter = 'alpha(opacity=' + value*10 + ')';
}
function pulsar(e,obj) {
tecla = (document.all) ? e.keyCode : e.which;
if (tecla!="8" && tecla!="0"){
obj.value += String.fromCharCode(tecla).toUpperCase();
return false;
}else{
return true;
}
}
function changeCase(frmObj) {
var index;
var tmpStr;
var tmpChar;
var preString;
var postString;
var strlen;
tmpStr = frmObj.value.toLowerCase();
strLen = tmpStr.length;
if (strLen > 0)  {
for (index = 0; index < strLen; index++)  {
if (index == 0)  {
tmpChar = tmpStr.substring(0,1).toUpperCase();
postString = tmpStr.substring(1,strLen);
tmpStr = tmpChar + postString;
}
else {
tmpChar = tmpStr.substring(index, index+1);
if (tmpChar == " " && index < (strLen-1))  {
tmpChar = tmpStr.substring(index+1, index+2).toUpperCase();
preString = tmpStr.substring(0, index+1);
postString = tmpStr.substring(index+2,strLen);
tmpStr = preString + tmpChar + postString;
         }
      }
   }
}
frmObj.value = tmpStr;
}
var color = function (elementStyle,colorCode)
{
  elementStyle.color=colorCode;
};
// End -->