// JavaScript Document





function OcultarFAVORITOS()
{
setTimeout("ResizeOKD(\"DivFAVORITOS\", 120,  0)", 10);
VERFOAVORITOS=0;
}

function MostrarFAVORITOS()
{
 								  
  setTimeout("ResizeOK(\"DivFAVORITOS\", 0,  120)", 10);
  VERFOAVORITOS=1;								  

 }



VERFOAVORITOS=0;

function AnimarFavoritos()
{
 if(VERFOAVORITOS==1)
   {
   OcultarHtml('trFavoritos');
   OcultarFAVORITOS();
   // setTimeout("OcultarHtml('DivFAVORITOS');", 1);
   
   }
   else
   {
   MostrarHtml('trFavoritos');
   MostrarFAVORITOS();
   //setTimeout("MostrarHtml('DivFAVORITOS');", 1);
   
   }

}  

function AmpliarVideo(VideoId,NAncho,NAlto)
			{
			  
			  prop=NAncho/document.getElementById(VideoId).offsetWidth;
			  
			  if(window.innerWidth)ancho=window.innerWidth;
			  if(document.body.offsetWidth)ancho=document.body.offsetWidth;
			  
              document.getElementById(VideoId).style.width=NAncho+'px';
			  document.getElementById(VideoId).style.height=NAlto+'px';
			  
			   document.getElementById(VideoId).style.left=parseInt( ((ancho-NAncho)  /2 )-100)+'px';
			   document.getElementById(VideoId).style.top=140+'px';
 			}  
            
			
			function Restaurar(VideoId,NAncho,NAlto)
			{
			  prop=NAncho/document.getElementById(VideoId).offsetWidth;
			  
			  
			  if(window.innerWidth)ancho=window.innerWidth;
			  if(document.body.offsetWidth)ancho=document.body.offsetWidth;
			  
              document.getElementById(VideoId).style.width=NAncho+'px';
			  document.getElementById(VideoId).style.height=NAlto+'px';
			  
			   document.getElementById(VideoId).style.left='';
			   document.getElementById(VideoId).style.top='';
 			}  



function CambiarEstilo(objeto,NuevoEstilo)
{
  document.getElementById(objeto).className = NuevoEstilo;
}



function ventimg(alto, ancho, enlace,nombrev)
{
  forma = "width=" + alto + ", " + "height=" + ancho + ", " + "scrollbars=no, resizable=no, directories=no, location=no, menubar=no, status=no, toolbar=no";
  window.open(enlace, nombrev, forma);
}



var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)


var posicX = 0
var posicY = 0

 
 

function posicRatonXY(e) {
if (IE) { posicX = event.clientX + document.body.scrollLeft;
posicY = event.clientY + document.body.scrollTop}
else { posicX = e.pageX; posicY = e.pageY };
if (posicX < 0) {posicX = 0};
if (posicY < 0) {posicY = 0};

 //alert(posicX+' '+posicY);
return true }

 
 document.onmousemove = posicRatonXY;
 
 
function OcultarHtml(Elemento)
{document.getElementById(Elemento).style.display = 'none';
}

function MostrarHtml(Elemento)
{document.getElementById(Elemento).style.display = 'block';
} 
 
function OcultarElemento(Elemento) {
document.getElementById(Elemento).style.display = 'none';
  document.getElementById(Elemento).style.top=1 ;
  document.getElementById(Elemento).style.left=1 ;
  document.getElementById(Elemento).style.width=1 ;
  document.getElementById(Elemento).style.height=1 ;
}
function MostrarElemento(Elemento, PosX, PosY) 
{ 
 
 document.getElementById(Elemento).style.display = 'block';
  document.getElementById(Elemento).style.top=PosY ;
  document.getElementById(Elemento).style.left=PosX ; 
}

function ResizeOK(Objeto, HastaW, HastaH)
{
  //document.getElementById(Objeto).style.width=0;;
   //document.getElementById(Objeto).style.height='1px';;
  //animateWidth(Objeto, HastaW);
  animateHeight(Objeto, HastaH);
  
}

function ResizeOKD(Objeto, HastaW, HastaH)
{
  //document.getElementById(Objeto).style.width=0;;
   //document.getElementById(Objeto).style.height='1px';;
  //animateWidth(Objeto, HastaW);
  animateHeightD(Objeto, HastaH);
  
}

function animateWidth(id, size)
{
el = document.getElementById(id);
var w_size1 = el.offsetWidth;
if (w_size1 < size)
{
el.style.width = w_size1 + 40+"px";
setTimeout("animateWidth('" + id + "','" + size + "')", 1);
}
}

function animateHeight(id, size)
{
el = document.getElementById(id);
var h_size1 = el.offsetHeight;
if(h_size1 > size)el.style.height = size+"px";

if (h_size1+8 < size)
{
el.style.height = h_size1 +8+"px";
 setTimeout("animateHeight('" + id + "','" + size + "')", 1);
}
else
   el.style.height = size+"px";
 
}

function animateHeightD(id, size)
{
el = document.getElementById(id);
var h_size1 = el.offsetHeight;
if(h_size1 < size)el.style.height = size+"px";

if (h_size1-8 > size)
{
el.style.height = h_size1 -8+"px";
 setTimeout("animateHeightD('" + id + "','" + size + "')", 1);
}
else
   el.style.height = size+"px";
 
}

