dirpbl="http://pare.cl/";

nn=(document.layers)?true:false; 
ie=(document.all)?true:false; 
function keyDown(e) { 

} 
document.onkeydown=keyDown; 
if(nn) document.captureEvents(Event.KEYDOWN);

var ya_reviso_fb="no";
var puede_cambiar_fb_status="no";
var puede_cambiar_fb_status_efectivamente=false;

var estalogeado="no";
//document.getElementById("guia_contenido").style.height=document.getElementById("botones").offsetHeight;
var canales2 = new Object();
var pais_actual=false;
var cat_actual=false;
var idioma_actual=false;

var ultimo_marcado="documentales";
var canal_previo="";
var canal_actual="";
var minutos_canal_actual=0;
var minutos_canal_actual_total=0;
var cargo_publicidad_izq_arriba=0;

Object.prototype.clone = function() {
  var newObj = (this instanceof Array) ? [] : {};
  for (i in this) {
    if (i == 'clone') continue;
    if (this[i] && typeof this[i] == "object") {
      newObj[i] = this[i].clone();
    } else newObj[i] = this[i]
  } return newObj;
};




function busqueda(quebuscar) {

}
function cuadro_busqueda() {


}
function filter(objeto, campo,contenido) {
	

	
	if (contenido==-1) {return objeto;}
	
	var newObj = new Object;
	var newArr = new Array;
	
	for (i in objeto) {
		if (i == 'clone') continue;
		if (objeto[i][campo]==contenido || contenido==0) {
			newObj = objeto[i].clone();
			if (objeto[i][0]!="") {
				newArr.push(newObj);
			}
		}
		
		//julio esto esta funcionando
		if ((campo=="buscado")) {
			var re = new RegExp(contenido, "i");
			var str = objeto[i][4]+" "+objeto[i][3]+" "+objeto[i][10]+" "+objeto[i][7]+" "+objeto[i][0]+" .";
//var str = "";
			
			if (str.match(re)) {
				newObj = objeto[i].clone();
				if (objeto[i][0]!="") {
					newArr.push(newObj);
				}
			}
		}
	}
	//ordenamiento sigue dos horas mas dela ultima renivacion del televidentes
	if ((estatuscanales_offset-2)<tiempo_offset)	{
		newArr.sort(sortfunction_extendido);
	}
	else {
		newArr.sort(sortfunction);
	}
	return newArr;
  
}
function filter_favs(objeto, favoritos) {
	

}

function filter_o (objeto, campo,contenido) {//com: si el contrenuido es 0, solo copia y sortea
	if (contenido==-1) {return objeto;}
	
	var newObj = (objeto instanceof Array) ? [] : {};
	
	for (i in objeto) {
		if (i == 'clone') continue;
		if (objeto[i][campo]==contenido || contenido==0) {
			newObj[i] = objeto[i].clone();
		}
	}
	return newObj;
  
}

var indiceimportanciacuartos=3;



function sortfunction_extendido(a, b){
	var peso_a=0;
	var peso_b=0;
	
	var signo_a;
	var signo_b;
	
	signo_a = (estatuscanales[a[1]]==-1) ? -1 : 1;
	signo_b = (estatuscanales[b[1]]==-1) ? -1 : 1;

	peso_por_videntes_a = (televidentes[a[1]]>1) ? televidentes[a[1]]/20 : 1;
	peso_por_videntes_b = (televidentes[b[1]]>1) ? televidentes[b[1]]/20 : 1;

	peso_a = (pesoscanales[a[1]]>0) ?  (pesoscanales[a[1]] * indiceimportanciacuartos) : 0;
	peso_a = (peso_a + a[9] + peso_por_videntes_a) * signo_a ;
	
	peso_b = (pesoscanales[b[1]]>0) ?  (pesoscanales[b[1]] * indiceimportanciacuartos) : 0;
	peso_b = (peso_b + b[9]  + peso_por_videntes_b) * signo_b;

	var res=(peso_a>=peso_b) ? -1 : 1; 
	
	return res;

}
function sortfunction (a, b){
	var peso_a=0;
	var peso_b=0;	

	peso_a = (pesoscanales[a[1]]>0) ?  (pesoscanales[a[1]] * indiceimportanciacuartos) : 0;
	peso_a = peso_a + a[9];
	
	peso_b = (pesoscanales[b[1]]>0) ?  (pesoscanales[b[1]] * indiceimportanciacuartos) : 0;
	peso_b = peso_b + b[9];

	var res=(peso_a>=peso_b) ? -1 : 1; 
	
	return res;

}
function cambia_guia(objeto) {
	cambia_guia2(objeto);
	return;
	

}

/*----------------------------------sobre pantalla (deberia ir en otro lado modularmente-----------------*/


var timersobrepan =null;
var funcion_para_chatoguia;
var color1="white";
var color2="black";

function doAtLoad() {
    flashObj = (navigator.appName.indexOf ("Microsoft") !=-1)?window["Movie1"]:window.document["Movie1"];
    
    
}
function datos_res(res, funcion, elcanal) {
	eval(funcion+"(res,'"+elcanal+"');");
}
function get_at(o,at) {
	var sub=o.getElementsByTagName(at)[0];
	r = (sub.childNodes[0]==null)? "" : sub.childNodes[0].nodeValue;
	return r;
}
function datos_res_canal(res,elcanal) {
	var texto="";
	var xmlDoc=xml(res);
	texto += get_at(xmlDoc,"status");
	texto += " " + get_at(xmlDoc,"title");
	texto += " " + get_at(xmlDoc,"description");
	texto += " " + get_at(xmlDoc,"tags");
	sobrepan2(texto);
}
function datos_res_canal3(res,elcanal) {
	datos_res_canal2(res,elcanal,1);
}

function get_at2(o,at,i) {
	if (i>-1) {}
	else {i=0;}
	if (typeof(o.getElementsByTagName(at)[i]) != "object" ) return "";
	var sub=o.getElementsByTagName(at)[i];
	r = (sub.firstChild.nodeValue==null)? "" : sub.firstChild.nodeValue;
	return r;
}
function get_clipid(emb) {
return emb.replace("http://www.justin.tv/clip/","");

}
var objetoclis=new Array();
var objetoclis_nom_num=new Array();
function datos_res_ondemand(res,elcanal,sinpantas) {	
}
function datos_res_canal2(res,elcanal,sinpantas) {
	
	var texto="";
	var myObject = eval('(' + res + ')');
	var tele=((typeof(myObject[0]) != "object")) ? "0" : myObject[0]["stream_count"];	
	var estatus=((typeof(myObject[0]) != "object")) ? "0" : myObject[0]["channel"]["status"];	
	if (sinpantas != 1) {
		if ((tele==0) && (res=="[]")) {
			document.getElementById("thumb_"+elcanal).src="img/aguste.jpg";
			document.getElementById("viewers_"+elcanal).innerHTML="";
		}
		else {
			document.getElementById("viewers_"+elcanal).innerHTML="<img  align='baseline' border=0 src='img/ojo4.jpg'> "+tele;
			canales2[elcanal][10]=estatus;
//top.document.title=canales2[elcanal][10];
		}
	}
	
	televidentes[elcanal]=tele;
	
	
}
function xml(txt) {
	try //Internet Explorer
	  {
	  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	  xmlDoc.async="false";
	  xmlDoc.loadXML(txt);
	  return xmlDoc; 
	  }
	catch(e)
	  {
	  parser=new DOMParser();
	  xmlDoc=parser.parseFromString(txt,"text/xml");
	  return xmlDoc;
	  }
}

var timer233=null;
var ultimo_pan_esperando=null;

function fuerapan(canal,tipo) {	
	vuelve_de_sobrepan();
	clearInterval(timer233);
}			
function sobrepan(canal,tipo) {	
	sobrepan1(canal,tipo);
	return;
	
	if (ultimo_pan_esperando != canal) {
		clearInterval(timer233);
		timer233 =setTimeout(function() {sobrepan1(canal,tipo)}, 1000);
		ultimo_pan_esperando=canal;
	}
}
function muestra_menu() {
	vuelve_de_sobrepan();
}
function sobrepan1(canal,tipo) {
	

	document.getElementById("bajo_guia2").innerHTML="<span class='inverso1'>"+canales2[canal][0]+"</span> "+descrip1(canal);
	
	document.getElementById("bajo_guia2").style.display="block";
	document.getElementById("bajo_guia").style.display="none";
	clearInterval(timersobrepan);
	timersobrepan = setTimeout("vuelve_de_sobrepan()",8000);
			 

	document.getElementById("bajo_guia2").innerHTML +=descrip2(canal);

}
function sobrepan2(mensaje) {
	document.getElementById("bajo_guia2_justin").innerHTML = mensaje;

}
function vuelve_de_sobrepan() {
	clearInterval(timersobrepan);
	document.getElementById("bajo_guia2").style.display="none";
	document.getElementById("bajo_guia").style.display="block";

}
/*----------------------------------FIN sobre pantalla (deberia ir en otro lado modularmente-----------------*/

var lugar_relativo_act=0;
var fila=0;
var table_faltan_parciales=0;
var mediapubli_rows=3;
var mediapubli_cols=2;
var filas=4;
var panwid=68;
var panhei=47;
var alto_letras=10;

function addRowToTable(table,contenido)
{
	
	var tbl = document.getElementById(table);
	if (lugar_relativo_act>=filas) {
		//reinicia
		lugar_relativo_act=1;
	}
	else {
		lugar_relativo_act +=1;
	}
	
	if (lugar_relativo_act==1) {			
	  var lastRow = tbl.rows.length;
	  var row = tbl.insertRow(lastRow);	      
	  fila=fila+1;
	}
	else {
	  var lastRow = tbl.rows.length;
	  var row = tbl.rows[lastRow-1];	  
	}
	

	  	var cellRight = row.insertCell(lugar_relativo_act-1);	  
		cellRight.innerHTML=contenido;  			

  

}
var timer40=null;
var objeto_glob=new Object();
function lista_canales(objeto,receptorhtml,previo) {	
	

	fila=0;

	objeto_glob=objeto;		
            
            		
	document.getElementById(receptorhtml).innerHTML =previo+"<table id ='tablaguia'></table>";
	lugar_relativo_act=0;
	lista_canales_sub (0,12,'tablaguia');
	primer_retardo=1500;//unsgeundo extra
	var o=0;
	for (i=12;i<=objeto.length;i+=12)	
	{
		o++;
		if (o>3) {return;}//en esta version hay un maximo
		ii=((i*1)+(12*1));
		var t="lista_canales_sub ("+i+","+ii+",'tablaguia')";
		setTimeout(t,((i/12)*500)+primer_retardo);	
	}
		
}




function lista_canales_sub (inicio,fin,receptorhtml) {
	
	


	objeto=objeto_glob.slice(inicio,fin); 
            	
	for (var i in objeto)
	{		
		
		var randomnumber=Math.floor(Math.random()*11)
		var aunenlinea=1;
		var tiempo=2000;
		if (i == 'clone') continue;

		tiempo= tiempo+200;
		if (estatuscanales_offset<tiempo_offset) {	
			if ((aunenlinea==1) &&  (estatuscanales[objeto[i][1]]==-1)) {
				aunenlinea=0;
			}
		}

		html1="";
		html1 = html1 + "<div onMouseOver=\"sobrepan('"+objeto[i][1]+"','"+objeto[i][14]+"')\"  onMouseOver=\"fuerapan('"+objeto[i][1]+"','"+objeto[i][14]+"')\" style:'margin:0px;padding:0px'><a   href=\"javascript:cambiar('"+objeto[i][1]+"','"+objeto[i][14]+"')\" class='panta' >";
		var img_id=" id='thumb_"+objeto[i][1]+"' ";
		var viewers_id=" id='viewers_"+objeto[i][1]+"' ";
		var marca_id=" id='marca_"+objeto[i][1]+"' ";
		var titulo_id=" id='canal_"+objeto[i][1]+"' ";
		
		if (aunenlinea==1) {
			if (televidentes[objeto[i][1]]==0) {
				html1 = html1 + "<img  border=0  "+img_id+" src='img/aguste.jpg' width='"+panwid+"' height='"+panhei+"'>";			
			}	
			else if (objeto[i][14]=="justin") {
				html1 = html1 + "<img border=0 "+img_id+" src='http://static-cdn.justin.tv/previews/live_user_"+objeto[i][15]+"-75x56.jpg?azar="+randomnumber+"' width='"+panwid+"' height='"+panhei+"'>";
			}	
			else if (objeto[i][14]=="mogulus") {
				html1 = html1 + "<img border=0  "+img_id+" src='http://thumbnail.api.livestream.com/thumbnail?name="+objeto[i][15]+"&azar="+randomnumber+"' width='"+panwid+"' height='"+panhei+"'>";
			}
			else if (objeto[i][16]!="") {
				html1 = html1 + "<img  border=0  "+img_id+" src='"+objeto[i][16]+"' width='"+panwid+"' height='"+panhei+"'>";
			}					
			else {
				if (dom=="todos") {html1 = html1 + "<img  border=0  "+img_id+" src='img/logo.gif' width='"+panwid+"' height='"+panhei+"'>";}
				else {html1 = html1 + "<img  border=0  "+img_id+" src='img/fav_cuadrado4.png' width='"+panwid+"' height='"+panhei+"'>";}
			}
		}
		else {
				html1 = html1 + "<img  border=0  "+img_id+" src='img/aguste.jpg' width='"+panwid+"' height='"+panhei+"'>";
		}
		//display:inline;
		//no hayq ue borrar esta linea!!!!
		html1 = html1 + "<br>";
//		html1 = html1 + "<div "+titulo_id+" style='display:inline;'>";
//		html1 = html1 + objeto[i][0];
//		html1 = html1 + "</div>";
		
		
		nombrecanal = "<div class='channelname' "+titulo_id+" style='display:inline;'>";
		nombrecanal = nombrecanal + objeto[i][0];
		nombrecanal = nombrecanal + "</div>";	
				
		marca="";
		if (objeto[i][14]=="sopcast") {
			marca="<img  align='baseline' border=0 src='img/sopcast.png'>";
			marca="<div  class='marca' "+marca_id+">"+marca+"</div>";
		}
		html1 = html1 + "<br><div class='viewers' "+viewers_id+"></div>";
		
		html1 = html1 +"<br>"+nombrecanal;
		html1 = html1 +"<br>"+marca;
		html1 = html1 + "</a></div>";
		
//alert(html1);		
		addRowToTable(receptorhtml,html1);
		

				
		if (typeof(objeto[i][1]) == "string") {
		if (objeto[i][14]=="justin" && televidentes[objeto[i][1]]!=0) {
				var t="pantas_guia('"+ objeto[i][1] +"')";
				setTimeout(t,tiempo);		
			}
		}

	}	

}
function pantas_guia(canal) {
	var rand_no = Math.random();
	flashObj.datos_canal("http://api.justin.tv/api/stream/list.json?channel="+canal+"&azar="+rand_no,"datos_res_canal2",canal);		
}

function cambia_guia2(objeto) {
	var html="";
	//document.getElementById("guia_contenido").innerHTML =lista_canales(objeto);
	lista_canales(objeto,"guia_contenido","");
	return;	
}

function sacafiltro(que) {
	

}
var ultimo_buscado="";

function cambio_submenu(tipo,buscado) {	

	

	
	temp1=new Object();
	temp2=new Object();
	temp3=new Object();
	
	var que_numero;
	var html="";
	
	

	
	
	
	que_numero=3;
	
		
	if (buscado=="todas" || buscado=="todos" ) {		
		temp1=filter(canales2, que_numero ,0);		
		buscado=-1;
	}
	else {	
		temp1=filter(canales2, que_numero ,buscado);						
	}


			if (pais_actual) { 
				temp2=filter(temp1, 6 ,pais_actual);
			}
			else {
				temp2=temp1.clone();				
			}
			if (idioma_actual) { 
				temp3=filter(temp2, 5 ,idioma_actual);
			}
			else {
				temp3=temp2.clone();				
			}			
			cat_actual=buscado;

		
	//aca falta aplicar el filtro de pais e idioma
	cambia_guia(temp3);
	
	
	var filtros="";
		
	if (ultimo_buscado!="") {
		eval ("document.getElementById('menu_"+ultimo_buscado+"').style.color ='"+color2+"';");
		eval ("document.getElementById('menu_"+ultimo_buscado+"').style.backgroundColor ='"+color1+"';");		
	}

	ultimo_buscado=buscado;
//	eval ("document.getElementById('menu_"+buscado+"').className ='menu_marcado';");
	eval ("document.getElementById('menu_"+buscado+"').style.color ='"+color1+"';");
	eval ("document.getElementById('menu_"+buscado+"').style.backgroundColor ='"+color2+"';");
	//eval ("alert(document.getElementById('menu_"+buscado+"').className);");
	
	return;//no cacho porqué esto llega esta aca no mas

	
	
}
function cambio_menu(cat) {
	

	
	if (cat=="porpais") {
		document.getElementById("botones_porcat").style.display ="none";
		document.getElementById("botones_porpaises").style.display ="block";
	}
	else if (cat=="porcat") {
		document.getElementById("botones_porcat").style.display ="block";
		document.getElementById("botones_porpaises").style.display ="none";
	}
	else if (cat=="favoritos") {				
		
		eval("document.getElementById('boton_"+ultimo_marcado+"').className = 'guia_menu_item_nomarcado';");
		eval("document.getElementById('boton_"+cat+"').className = 'guia_menu_marcado';");
		eval("document.getElementById('guia_"+cat+"').style.display = 'block';");
		eval("document.getElementById('guia_"+ultimo_marcado+"').style.display = 'none';");
		ultimo_marcado=cat;			
		
	}

}
    function show(muestra) {
       var m = document.getElementById(muestra);
          m.style.display = 'block';
    }   
    function hide(muestra) {
       var m = document.getElementById(muestra);
          m.style.display = 'none';
    }   


	var timer=null;
	var canal_chat_actual="";
	
function chatjustin(canal) {
			document.getElementById("chat").innerHTML="<iframe src='http://www.justin.tv/chat/embed?default_chat=jtv&channel="+canal+"' scrolling='auto' style='width:475px; height:460px' frameborder='0'></iframe>";
}	
function cambia_chat(tiempo) {
	var canal=canal_actual;
	if (canal_chat_actual == canal) {clearInterval(timer);return;}
	canal_chat_actual=canal;
	if (canal != 0) {
		
		if (canales2[canal][17]==0) {
			arriba_chat="";
			if (canales2[canal][14]=="justin") {
				arriba_chat="<a href='javascript:chatjustin(\""+canal+"\");'>"+idio("Entrar a chat de justin (Puede que necesites una cuenta justin)")+"</a>";	
			}
			document.getElementById("chat").innerHTML=arriba_chat+"<iframe src='swf_chat.html?"+canal+"' scrolling='no' style='width:475px; height:460' frameborder='0'></iframe>";
		}
		else {
			var temp1=canales2[canal][17];
			var arrtemp= temp1.split("-");
			if (arrtemp[0]=="meebo") {
				var id=arrtemp[1];			
				document.getElementById("chat").innerHTML="<iframe src='swf_chat_meebo.html?"+id+"' scrolling='no' style='width:475px; height:460' frameborder='0'></iframe>";
			}
		}
		timer = setTimeout("cambio_etiqueta('chat')",tiempo);
	}	
	else {
		document.getElementById("chat").innerHTML="";
		clearInterval(timer);
	}
}	



function popjustin(canal) {
	alert(idio("Este canal será abierto en una ventana flotante."));	
	parent.framevideo.justinpopwin1=window.open('http://es.justin.tv/'+canal+'/popout','justinpopwin','width=630,height=450,top=130,left=0,scrollbars=yes,resizable=no,toolbar=no,menu=no,location=no,status=yes,top=130,left=0');
	parent.framevideo.document.getElementById("video").innerHTML="<div style='width:350;height:450;'><br><br><span class='ennegreo'>Si solo escuchas el canal pero no lo ves haz <a href='javascript:parent.framevideo.justinpopwin1.focus();'>clic acá<a/></span></div>";
	void(0);
}
function popustream(canal) {
	alert("Este canal será abierto en una ventana flotante.");	
	parent.framevideo.justinpopwin1=window.open('http://www.ustream.tv/channel-popup/'+canales2[canal][15],'justinpopwin','width=500,height=400,top=130,left=0,scrollbars=no,resizable=no,toolbar=no,menu=no,location=no,status=yes,top=130,left=0');
	parent.framevideo.document.getElementById("video").innerHTML="<div style='width:350;height:450;'><br><br><span class='ennegreo'>Si solo escuchas el canal pero no lo ves haz <a href='javascript:parent.framevideo.justinpopwin1.focus();'>clic acá<a/></span></div>";
	void(0);
}
function wm_player(canal) {
	var url=canales2[canal][15];
	var html="";
     html = html + '<OBJECT ID=MediaPlayer ';
     html = html + 'CLASSID=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 ';
     html = html + 'CODEBASE=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 ';
     html = html + 'standby="Loading Microsoft Windows Media Player components..." ';
     html = html + 'TYPE="application/x-oleobject" width="500" height="400">';
     html = html + '<PARAM NAME="FileName" VALUE="' + url + '">';
     html = html + '<PARAM NAME="AutoStart" VALUE="true">';
     html = html + '<PARAM NAME="ShowStatusBar" VALUE="1">';
     html = html + '<PARAM NAME="ShowControls" VALUE="1">';

     //Netscape code
     html = html + '    <Embed type="application/x-mplayer2"';
     html = html + '        pluginspage="http://www.microsoft.com/windows/windowsmedia/"';
     html = html + '        filename="' + url + '"';
     html = html + '        src="' + url + '"';
     html = html + '        Name=MediaPlayer';
     html = html + '        ShowControls=1';
     html = html + '        ShowDisplay=0';
     html = html + '        ShowStatusBar=1';
     html = html + '        width="500"';
     html = html + '        height="400"';
     html = html + '        displaysize="4"';
     html = html + '        autosize=-1>';     
     html = html + '    </embed>';
     html = html + '</OBJECT>';
	
     return html;
     	
}

var idiomas = new Object(); 
idiomas['spanish'] = idio("Spanish");
idiomas['spanish1'] = idio("Spanish");
idiomas['spanish2'] = idio("Spanish");
idiomas['english'] = idio("English");
idiomas['catalan'] = idio("");

var categorias = new Object(); 
categorias['musica'] = idio("Music");
categorias['cine'] = idio("Movies and series");
categorias['variado'] = idio("General");
categorias['documentales'] = idio("Documentaries");
categorias['noticias'] = idio("News");
categorias['anime'] = idio("Animation");
categorias['infantil'] = idio("Child");
categorias['deportes'] = idio("Sport");
categorias['religioso'] = idio("Religious");

var subcategorias = new Object(); 
subcategorias ['futbol'] = idio("Soccer");
subcategorias ['local'] = idio("Local or regional");
subcategorias ['independiente'] = idio("");



function cambiar_por_numero(canal) {
	cambiar(can_por_num[canal]);
	cambio_submenu('cat',canales2[can_por_num[canal]][3]);
	//cambiar_arbol(canales2[can_por_num[canal]][3]);	
	var myNode = findObj("node"+canales2[can_por_num[canal]][3]);
	highlightObjLink(myNode);
	//alert("uno");
}
function cambiar_arbol(cat) {
	var myNode = findObj("node"+cat);	
	highlightObjLink(myNode);	
	
}
function descrip1(canal) {
	var html_detalles="";
	var temp="";
	temp  = (canales2[canal][6] != "") ? (idio("Country")+": <b>"+canales2[canal][6])+" </b>" : ""; html_detalles = html_detalles + temp;
	temp  = (canales2[canal][5] != "") ? (idio("Language")+": <b>"+idiomas[canales2[canal][5]])+" </b>" : ""; html_detalles = html_detalles + temp;
	temp  = ((categorias[canales2[canal][3]] != "") && (categorias[canales2[canal][3]] != undefined)) ? (idio("Category")+": <b>"+categorias[canales2[canal][3]])+" </b>" : ""; html_detalles = html_detalles + temp;
	temp  = ((subcategorias[canales2[canal][4]] != "") && (subcategorias[canales2[canal][4]] != undefined)) ? (" / <b>"+subcategorias[canales2[canal][4]])+" </b>" : ""; html_detalles = html_detalles + temp;	
	temp  = (canales2[canal][8] != "") ? (idio("Web Page")+": <b>"+canales2[canal][8])+" </b>" : ""; html_detalles = html_detalles + temp;
	return html_detalles;
}
function descrip2(canal) {
	var html_detalles="";
	var temp="";
	temp  = (canales2[canal][10] != "") ? (idio("Description")+": <b>"+canales2[canal][10])+" </b>" : ""; html_detalles = html_detalles + temp;
	return html_detalles;
}

vecescambio=0;

function ondemand(canal) {
}
function cambiar_justinclip(clipcanal) {
	var id=objetoclis[objetoclis_nom_num[clipcanal]][15];
	parent.framevideo.document.getElementById("video").innerHTML="<div id='video2'></div>";	
	parent.framevideo.document.getElementById("video_bajo").innerHTML="<div class='detalles1'>"+objetoclis[objetoclis_nom_num[clipcanal]][0]+"<br> <span class='small'>"+objetoclis[objetoclis_nom_num[clipcanal]][10]+"</span></div>";	
	parent.framevideo.abre_clip(id,"","video2")
}

function cambiar(canal,tipo) {
	if (tipo=="justinclip") {
		cambiar_justinclip(canal);
		return;
	}
	
	var win=window.open('http://favchannels.com/watch-tv-live-online/channel_'+canal+".html",'_new');
//FAKLTA aca debo agregar lode los domoinios (epsañol (numeros)  -ingles  (canales))!	
//	var win=window.open('http://es.favchannels.com/watch-tv-live-online/channel_'+canal+".html",'_new');

	return;
	
}
function cierratelecito() {
	document.getElementById("contendor_telecito").innerHTML="<div id='telecito_content'></div>";
}
function abre_telecito(swf) {
	document.getElementById("contendor_telecito").innerHTML="<div id='telecito_content'></div>";
	var flashvars = {

	};
	var params = {
	  wmode: "transparent",
	  allowScriptAccess: "always"	  
	};
	var attributes = {
	  id: "telecito",
	  name: "telecito"
	};		
	src="telecito/"+idioma3+swf;	
	

	swfobject.embedSWF(src, "telecito_content", "130", "100", "9.0.0", "expressInstall.swf", flashvars, params, attributes);	
	
}

function cambia_estatus2() {
	canal=canal_actual;
	document.getElementById('frameuser').contentWindow.cambia_estatus(num_por_can[canal],canales2[canal][0]);
}
function borrar1() {
}
function cambio_chkb_compartir(esto) {
	nuevo_estado=esto.checked;
	if (nuevo_estado == true) cambio_etiqueta("user");
	if (typeof(document.getElementById('frameuser'))  != "undefined")
	{
		resultado=document.getElementById('frameuser').contentWindow.user_cambia_mandar_status(nuevo_estado,esto);
		
		esto.checked=resultado;
		puede_cambiar_fb_status_efectivamente=resultado;

	}

}
function pone_fb_user(foto,nombre) {
}


function cambiar_publicidad1(canal) {

}
function cambia_publicidad_media(canal) {

}
function cambiar_publicidad2(canal) {	//arriba derecha

	
}
function acorta(ubicacion,nombre,h) {
	
	if (document.getElementById(ubicacion).style.display=="none") document.getElementById(ubicacion).style.display="block";	
	document.getElementById(nombre).height=h+'px';
}

function cambiar_publicidad3(canal) {	
		
}
function limpia_pais(canal) {

}
function limpia_pais2(pais) {

}
function cambiar_publicidad4(canal) {		


}

function previo() {

}
function alcualiza_li_favs () {

}


function sincro_favs0() {
	sincro_favs();
	document.getElementById("adfav").innerHTML ="";
}
function sincro_favs() {


	
	
}
function sacar_fav(canal) {


}
function ya_es_fav(canal) {

}
function scroll(x,y) {
}
function testeo2() {
}





function agregar(){



}

var last_publi=1;
function recarga_publib() {

}






function inicio2() {




//	var numero = (location.search.substring(1)!="")? location.search.substring(1) : top.location.search.substring(1);
//	var numero = numero.replace(/=/gi, "");

	var numero = "";
//	var numero = numero.replace(/=/gi, "");
	
	if (numero !="") {

	}
	else {//muetrsa un ejemplo al azar entre:canales:125 , 99,95,81, 79
		if (idioma=="en") {
			var randomnumber=Math.floor(Math.random()*9);
			
			var canalesinicio=new Array("noticias","noticias","musica","cine","deportes","documentales","cine","deportes","cine");
			timer_control = setTimeout(function () {cambio_submenu('cat',canalesinicio[randomnumber])},1000);			
			timer_control2 = setTimeout(function () {cambiar_arbol(canalesinicio[randomnumber])},2000);	
			
		}
	}

}


function iniciatodo() {
	inicios++;
	if (inicios==1) {

		doAtLoad();
		inicio2();
	}
}

	
