var menuSel  = null;
var imSel = null;
function menuPressFuera (oNodo, idImagen)
   {
		oNodo.className = "intFondoMenuNorm";	
		oImg = document.getElementById(idImagen);
		oImg.src = "images/interna/vinetaMenuNorm.gif";
		oImg.width=20;		    
   }
function sobreMenuInt (oNodo, idImagen)
   {
		oNodo.className = "intFondoMenuOver";						
		oImg = document.getElementById(idImagen);
		oImg.src = "images/interna/vinetaMenuOver.gif";
		oImg.width=38;
   }
function fueraMenuInt (oNodo, idImagen)
   {
	    if (oNodo != menuSel)
		   {
				oNodo.className = "intFondoMenuNorm";	
				oImg = document.getElementById(idImagen);
				oImg.src = "images/interna/vinetaMenuNorm.gif";
				oImg.width=20;		    
		   }
   }   
function cambiaContenido (celda, img, pagina, contenedor, extra)   
   {
	   if (menuSel != null)
	     {
		   menuPressFuera(menuSel, imSel);	   
		 }
	   menuSel = celda;
	   imSel = img;
	   despliegaInfo("</br><img src='images/cargando.gif' width='20' height='20' />Cargando información</br>", contenedor);	   
   	   var oXMLHttp = zXmlHttp.createRequest();
	   oXMLHttp.open("get", pagina, true);	
	   oXMLHttp.onreadystatechange = function ()
		   {
		       if (oXMLHttp.readyState == 4)
			     {
				     if (oXMLHttp.status == 200)
					    {
						    despliegaInfo(oXMLHttp.responseText, contenedor);
						}else
						{
						    despliegaInfo("Ocurre un error de comunicación: "+ oXMLHttp.statusText, contenedor)
						}
				 }
		   }	
		document.documentElement.scrollTop = 100;	
		oXMLHttp.send(null);	
		if (extra)
		   {
			   //alert (extra);
			   document.getElementById("banner_img").src = "images/admision/"+extra;
		   }
   }
function despliegaInfo(contenido, contenedor )
   {
      var divR = document.getElementById(contenedor);
	  divR.innerHTML = contenido;	  
   }   
   
function rotativo (oDivTit, oDivtexto, oImg, oLiga)
   {
	   this.oTitulo = document.getElementById(oDivTit);
	   this.oTexto = document.getElementById(oDivtexto);	   
	   this.oImg = document.getElementById(oImg);
	   this.oLiga = document.getElementById(oLiga);	
	   this.arrElementos = null;
	   this.actual = 0;
   }
   
rotativo.prototype.init = function()
   {
	   this.arrElementos = new Array();
   }

rotativo.prototype.siguiente = function ()
  {
	  this.oImg.src = "/images/cargando.gif";
	   this.oImg.width="30";
	   this.oImg.height="30";
	  ultimo =  this.arrElementos.length - 1;
	  if (this.arrElementos.length > 0)
	     {
			 if (this.actual < ultimo)
			    {
					this.actual ++;
				}
			  else
			    {
				this.actual = 0;
				}
		 }
	  this.escribe();
  }
rotativo.prototype.anterior = function ()
  {
  	  this.oImg.src = "/images/cargando.gif";
	   this.oImg.width="30";
	   this.oImg.height="30";	  
	  ultimo =  this.arrElementos.length - 1;
	  if (this.arrElementos.length > 0)
	     {
			 if (this.actual > 0)
			    {
					this.actual = this.actual - 1;
				}
			  else
			    {
					this.actual = ultimo;
				}
		 }
	  this.escribe();
  }  
rotativo.prototype.escribe = function ()
  {   	   
	   oElemento = this.arrElementos[this.actual];
  	   this.oTitulo.innerHTML = oElemento.titulo;
	   this.oTexto.innerHTML = oElemento.texto;
	   this.oImg.src = oElemento.imagen;
	   this.oImg.width="80";
	   this.oImg.height="60";
	   this.oLiga.href = oElemento.liga;
  }
rotativo.prototype.agrega = function (titulo, texto, imagen, liga)
  {
	  oElemento = new Object();
	  oElemento.titulo = titulo;
	  oElemento.texto = texto;
	  oElemento.imagen = imagen;
	  oElemento.liga = liga;
	  this.arrElementos.push(oElemento);
  }

