// JavaScript Document

function abrevideo(titulo,archivo,ref,code){
	var s1 = new SWFObject("player/player.swf","single","600","510","7");
	s1.addParam("allowfullscreen","true");
	s1.addVariable("file",archivo);
	s1.addVariable("image","images/preview.jpg");
	s1.addVariable("width","600");
	s1.addVariable("height","510");
	s1.addVariable('autostart','true');
	s1.addVariable('shuffle','false');
	s1.addVariable('skin','http://content.longtailvideo.com/skins/glow/glow.zip');
	s1.addVariable('plugins', 'hd-1');
	//s1.addVariable('plugins', 'qualitymonitor-2');
	s1.addVariable('hd.state', 'false');
	s1.write("player1");
	window.open("contador.php?ref="+ref,"cargas");
	document.getElementById('titulovideo').innerHTML="Estás viendo: "+titulo;
	document.getElementById('urlvideo').innerHTML="http://www.uvitel.tv/?"+code;
	ponebanner();
}

function abreplaylist(){
	var s1 = new SWFObject("player/player.swf","single","600","510","0");
	s1.addParam("allowfullscreen","true");
	s1.addVariable("file",'bin/playlist.xml.php');
	s1.addVariable("image","images/preview.jpg");
	s1.addVariable("width","600");
	s1.addVariable("height","510");
	s1.addVariable('autostart','true');
	s1.addVariable('shuffle','false');
	s1.addVariable('repeat','list');
	s1.addVariable('plugins', 'hd-1');
	//s1.addVariable('plugins', 'qualitymonitor-2');
	s1.addVariable('hd.state', 'false');
	s1.addVariable('skin','http://content.longtailvideo.com/skins/glow/glow.zip');
	//s1.addVariable('showdigits','false');
	//s1.addVariable('showincons','false');
	//s1.addVariable('showvolume','false');
	//s1.addVariable('usecaptions','false');
	s1.write("player1");
	txtvideo=document.getElementById('titulovideo').innerHTML="Estás viendo: PROGRAMACIÓN ONLINE";
	txtvideo=document.getElementById('urlvideo').innerHTML="No hay dirección para la programación";
	ponebanner();
}
function cargadatos(num,orden,tipo,pagina){
	//txtcargando=document.getElementById('capadevideos');
	//txtcargando.innerHTML="<table width=433 height=311><tr><td class='Estilo9'><font color=#000000><b>CARGANDO VIDEOS ... ESPERE ...</b></font></td></tr></table>";	
	window.open('bin/'+tipo+'.js.php?id='+num+'&orden='+orden+'&pagina='+pagina+'&time='+saltacache(),'cargas');
	ponebanner();
}
function cargalive(){
	// u974L5dA3Hp6kOBcY2cl8P5NTzN2nROk_7b9tZsIX2AuTLLiZ5THbSjTIl9USl4mZGgrUFCNze8TK_w8oUuZ5Q
	// &type=livestream&livestream.devkey=mIuD3JhqT5M3Of7j-QAV2Jcn5ID9sXlCihqmGw311c-ZedOV20z49JZ3eWc68axPDfBU32gHDyvpMMh75jypUSYpfaXtCzAMUarF_7yg4LE
	var s1 = new SWFObject("player/player.swf","single","600","510","0");
	s1.addParam("allowfullscreen","true");
	s1.addVariable("image","images/preview.jpg");
	s1.addVariable("width","600");
	s1.addVariable("height","510");
	s1.addVariable('autostart','true');
	s1.addVariable('shuffle','false');
	s1.addVariable('type', 'livestream');
	s1.addVariable('skin','http://content.longtailvideo.com/skins/glow/glow.zip');
	//s1.addVariable('streamer','');
	s1.addVariable('livestream.devkey', 'f2Mex-WwiYCkkc0UsU-0_vRS4o8Hf8Bg1Zol8DScJR6doAZAfKvmmi87x1vzRIfZsH7XtB4mM1GIZmmYdC4MWA');
	s1.addVariable("file",'uvitel');
	/*s1.addVariable('file','live.flv');*/
	/*
	s1.addVariable('streamer','rtmp://213.162.223.162:80/nautalis3live/');
	s1.addVariable('file','live-800');
	*/
	s1.write("player1");
	txtvideo=document.getElementById('titulovideo').innerHTML="Estás viendo: EMISIÓN EN DIRECTO DE UVITEL TV";
	txtvideo=document.getElementById('urlvideo').innerHTML="No hay dirección para el directo";
	window.open('bin/live.js.php','cargatxtlive');
	ponebanner();
}
function saltacache(){
	var mydate = new Date(); 
	var strDate = mydate.getTime()/1000; 
	return strDate = Math.ceil(strDate); 
}
function ponebanner(){
	window.open('bin/banners.js.php?time='+saltacache(),'cargabanners');
}
function envia(){
	alert('Próximamente podrás enviarnos tus videos.');
}
function buscador(){
	alert('Estamos trabajando en nuestro buscador, disculpe las molestias');
}
function abreinfo() {
	idcapa=document.getElementById("infouvitel");
	idcapa.style.visibility="visible";
	idcapa.style.display="block";	
}
function cierrainfo() {
	idcapa=document.getElementById("infouvitel");
	idcapa.style.visibility="hidden";
	idcapa.style.display="none";	
}
function colorea (identificador,opcion) {
	var colores=new Array();
	colores[0]="#E0E2E4";
	colores[1]="#B2B2B2";
	document.getElementById(identificador).style.backgroundColor=colores[opcion];
}

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-5256517-13']);
  _gaq.push(['_setDomainName', 'none']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

