// JavaScript Document
function mostrarContenido()
{
	document.getElementById('cargando').style.display="none";
	new Effect.BlindDown('capaMos',{duration: 2});
	setTimeout("document.getElementById('capaMos').style.border='0px'",3000);
}
function ocultarVideo()
{
	document.getElementById('video').innerHTML="";
	new Effect.Fold("video",{duration:1});
	setTimeout("ocultarCapa('video');",2000);
}
function mostrarVideo(video)
{
	tam=TamVentana()
	document.getElementById('video').innerHTML="";
	document.getElementById('video').style.left=((tam[0]-165)/2)+"px";
	document.getElementById('video').style.top=((tam[1]-130)/2)+"px";
	new Effect.Grow("video",{duration: 1});
	setTimeout("document.getElementById('video').innerHTML=\"<div align='right' style='padding:1px'><a href='javascript:;' onclick='ocultarVideo()'>[Cerrar]</a></div><embed src='http://blip.tv/play/AanbIg' type='application/x-shockwave-flash' width='320' height='240' allowscriptaccess='always' allowfullscreen='true' />\"",1000);
}

var opcionAbierta="";
function mostrar(opcion)
{
  //alert(document.getElementsByTagName("div").length);
	/*if(opcionAbierta!="")
	{
    
		/*for(i=0;i<document.getElementsByName(opcionAbierta).length;i++)
			document.getElementsByName(opcionAbierta)[i].style.display="none";
		/*if(opcionAbierta!="actualitat")
			document.getElementById(opcionAbierta).style.borderBottom="0px";*/
	//}
	//opcionAbierta=opcion;
	//if(document.getElementsByTagName("div")[0].style.display=="block")
    for(i=0;i<document.getElementsByTagName("div").length;i++)
      if(document.getElementsByTagName("div")[i].getAttribute('name')==opcion)
		    if(document.getElementsByTagName("div")[i].style.display=="block")
          document.getElementsByTagName("div")[i].style.display="none";
        else
          document.getElementsByTagName("div")[i].style.display="block";
    if(document.getElementById("im"+opcion).src.split("/web/imagenes/flechaIz.gif").length!=1)
      document.getElementById("im"+opcion).src="/web/imagenes/flechaAb.gif";
    else
      document.getElementById("im"+opcion).src="/web/imagenes/flechaIz.gif";
    
	/*else
    for(i=0;i<document.getElementsByName(opcion).length;i++)
		  document.getElementsByName(opcion)[i].style.display="block";
	alert(document.getElementsByName(opcion).length);*/
	//document.getElementById(opcion).style.borderBottom="1px #000000 solid";
}


/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=0 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=2 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
}

function TamVentana() {
  var Tamanyo = [0, 0];
  if (typeof window.innerWidth != 'undefined')
  {
    Tamanyo = [
        window.innerWidth,
        window.innerHeight
    ];
  }
  else if (typeof document.documentElement != 'undefined'
      && typeof document.documentElement.clientWidth !=
      'undefined' && document.documentElement.clientWidth != 0)
  {
 Tamanyo = [
        document.documentElement.clientWidth,
        document.documentElement.clientHeight
    ];
  }
  else   {
    Tamanyo = [
        document.getElementsByTagName('body')[0].clientWidth,
        document.getElementsByTagName('body')[0].clientHeight
    ];
  }
  return Tamanyo;
}

function mostrarCapa(capa)
{
	var tam=TamVentana();
	document.getElementById(capa).style.left=((tam[0]-400)/2)+"px";
	document.getElementById(capa).style.top=((tam[1]-200)/2)+"px";
	document.getElementById(capa).style.display="block";
}

function ocultarCapa(capa)
{
	document.getElementById(capa).style.display="none";
}

function verDia(dia)
{
	document.getElementById('subcita').innerHTML=document.getElementById('cita'+dia).innerHTML;
	document.getElementById('cabCita').innerHTML=dia;
	mostrarCapa('cita');
}


if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee


var capa = null; // Almacena la capa que se mueve 
var _IE_ = navigator.userAgent.indexOf("MSIE") != -1; // Si es IE 
 
/* 
 * Libera la capa del movimiento 
 */ 
function liberaCapa() { 
	capa = null; 
} 
 
/* 
 * Cuando se pincha en la barra de la capa 
 * se almacena la capa y se guarda la posición 
 * del ratón respecto a la esquina superior 
 * izquierda de la capa, para así mover la capa 
 * desde el punto pichado y no desde la equina 
 */ 
function clickCapa(e, obj) { 
	capa = obj.parentNode; 
	 
	// En IE y Opera se usa otra propiedad del evento 
	if (_IE_) { 
		difX = e.offsetX; 
		difY = e.offsetY; 
	} else { 
		difX = e.layerX; 
		difY = e.layerY; 
	} 
} 
 
/* 
 * Mientras se mueva el ratón por el 
 * body se mueve la capa 
 */ 
function mueveCapa(e) { 
	if (capa != null) { 
		capa.style.top = (e.clientY-difY)+document.body.scrollTop+"px"; 
		capa.style.left = (e.clientX-difX)+document.body.scrollLeft+"px"; 
	} 
}

function obtenerObjeto(Id)                                                                 
{                 
  var obj = null;                                                                                                      

  // Netscape 6,7 y Explorer 5                                                         

  if (document.getElementById) {                                                       
	obj = document.getElementById(Id)                                                                                                                                                                                        
  }                                                                                    
  // Explorer 4                                                                       
  else if (document.all) {                                                             
	obj = document.all[Id];                                                      
  }                                                                                    
  // Netscape 4                                                                        
  else if (document.layers) {                                                          
	obj = document.layers[Id];                                                  
  }      
  return obj;      
}