
var cual=0,ptablon=0,pmenu=0,espera,imagenes=new Array(),puntos=new Array(),exp55;
var i1,i2,i3,ca1,ca2;
puntos.length=3;imagenes.length=7;
puntos[0]=new Image();
puntos[0].src='http://www.ieslosviveros.es/dibujos/puntorojo.gif';
puntos[1]=new Image();
puntos[1].src='http://www.ieslosviveros.es/dibujos/puntomarron.gif';
puntos[2]=new Image();
puntos[2].src='http://www.ieslosviveros.es/dibujos/puntoazul.gif';
imagenes[0]=new Image();
imagenes[0].src='http://www.ieslosviveros.es/dibujos/imagen1a.jpg';
imagenes[1]=new Image();
imagenes[1].src='http://www.ieslosviveros.es/dibujos/imagen2a.jpg';
imagenes[2]=new Image();
imagenes[2].src='http://www.ieslosviveros.es/dibujos/imagen3a.jpg';
imagenes[3]=new Image();
imagenes[3].src='http://www.ieslosviveros.es/dibujos/imagen4a.jpg';
imagenes[4]=new Image();
imagenes[4].src='http://www.ieslosviveros.es/dibujos/imagen5a.jpg';
imagenes[5]=new Image();
imagenes[5].src='http://www.ieslosviveros.es/dibujos/imagen6a.jpg';
imagenes[6]=new Image();
imagenes[6].src='http://www.ieslosviveros.es/dibujos/imagen7a.jpg';
i1=navigator.appVersion.indexOf('MSIE');
if (i1>=0)
  {
  i2=navigator.appVersion.indexOf(' ',i1);
  i3=navigator.appVersion.indexOf(';',i1);
  ca1=navigator.appVersion.substring(i2+1,i3);
  i1=ca1.indexOf('.');
  ca2=ca1.substring(0,i1);
  ca1=ca1.substring(i1+1);
  i1=parseInt(ca2,10);i2=parseInt(ca1,10);
  exp55=(i1>5 || i2>4);
  }
function entra(donde,cual,cambiar)
  {
  //alert (cual);
  var i1,pun=document.getElementById("op"+cual);
  if (cual==17)
    {
    donde.style.color='#000080';
    pun.src=puntos[2].src;
    }
  else
    {
    donde.style.color='#ff0000';
    pun.src=puntos[0].src;
    }
  if (cambiar)
    {
    pun=document.getElementById("op9");
    with (pun)
      if (cual!=7) src=puntos[1].src;
      else src=puntos[2].src;
    for (i1=1;i1<25;i1++)
      {
      pun=document.getElementById("tit"+i1);
     // with (pun.style)
       // if (i1==cual) {display=''; }
       // else {display='none' ;}
      pun=document.getElementById("inf"+i1);
      with (pun.style)
        if (i1==cual) {display='';}
        else display='none';
      }
	
        
    clearInterval(espera);pmenu=-1;bajatablon(1);
    }
  }
function sale(donde,cual)
  {
  var pun=document.getElementById("op"+cual);
  donde.style.color='#800000';
  pun.src=puntos[1].src;
  }
function cambia()
  {
  var i1,con=document.getElementById("insti"),enlace=document.getElementById("enla");
  cual++;if (cual>6) cual=0;
  //enlace.href="tablero.hhh";
  with (con)
    {
    if (exp55)
      if (filters)
        with (filters[0])
          {
          duration=3;
          overlap=1;
          Apply();
          Play();
          }
    src=imagenes[cual].src;
    }
  }
function subetablon(cual)
  {
  var i1,ta,tta;
  if (cual==0)
    {
    ta=document.getElementById("tablon");
    tta=document.getElementById("ttablon");
    i1=tta.clientHeight-18;
    ptablon--;
    if (ptablon<-i1 && i1>0) ptablon=-i1;
    if (i1<0 && ptablon<-500) ptablon=-500;
    ta.style.top=ptablon+'px';
    }
  else
    {
    ta=document.getElementById("menu");
    tta=document.getElementById("tmenu");
    i1=tta.clientHeight-13;
    pmenu--;
    if (pmenu<-i1 && i1>0) pmenu=-i1;
    if (i1<0 && pmenu<-160) pmenu=-160;
    ta.style.top=pmenu+'px';
    }
  }
function bajatablon(cual)
  {
  var i1,ta,tta;
  if (cual==0)
    {
    ta=document.getElementById("tablon");
    ptablon++;
    if (ptablon>0) ptablon=0;
    ta.style.top=ptablon+'px';
    }
  else
    {
    ta=document.getElementById("menu");
    pmenu++;
    if (pmenu>0) pmenu=0;
    ta.style.top=pmenu+'px';
    }
  }
function muevetablon(arriba,cual)
  {
  var ca1;
  clearInterval(espera);
  if (arriba) ca1='subetablon('+cual+')';
  else ca1='bajatablon('+cual+')';
  espera=setInterval(ca1,30);
  }
function paratablon()
  {
  clearInterval(espera);
  }
function finaltablon(arriba,cual)
  {
  var i1,i2,al;
  clearInterval(espera);
  if (document.all)
    if (arriba)
      {
      if (cual==0)
        {
        al=Math.abs(parseInt(tablon.style.top));
        i2=-1;
        with (anuncio)
          for (i1=0;i1<children.length;i1++)
            if (i2<0 && children[i1].children.length>0 && children[i1].offsetTop>al && children[i1].id!='')
              i2=children[i1].offsetTop;
        if (i2>=0) ptablon=-i2+1;
        else ptablon++;
        }
      else pmenu=-500;
      subetablon(cual);
      }
    else
      {
      if (cual==0)
        {
        al=Math.abs(parseInt(tablon.style.top));
        i2=-1;
        with (anuncio)
          for (i1=0;i1<children.length;i1++)
            if (children[i1].children.length>0 && children[i1].offsetTop<al && children[i1].id!='')
              i2=children[i1].offsetTop;
        ptablon=-i2-1;
        }
      else pmenu=-1;
      bajatablon(cual);
      }
  else
    if (arriba)
      {
      if (cual==0)
        {
        al2=document.getElementById("parte1")
        al=screen.height-150;
        al=al*parseInt(al2.height)/100-40;
        ptablon=-al;
        }
      else
        {
        al2=document.getElementById("parte2")
        al=screen.height-150;
        al=al*parseInt(al2.height)/100-120;
        pmenu=-al;
        }
      subetablon(cual);
      }
    else
      {
      if (cual==0) ptablon=-1;
      else pmenu=-1;
      bajatablon(cual);  
      }
  window.focus();
  return false;
  }
function mueveseparacion(baja,como)
  {
  var i1,i2,i3,par=document.getElementById("parte1");
  i1=parseInt(par.height);
  if (i1<10) i1=10;
  if (i1>85) i1=85;
  if (como==1)
    if (baja)
      if (parseInt(par.height)>44) i1=85;
      else i1=45;
    else 
     if (parseInt(par.height)<46) i1=10;
     else i1=45;
  else if (baja) i1++; else i1--;
  if (i1<10) i1=10;
  if (i1>85) i1=85;
  i2=i1;i3=95-i1;
  if (i1==10)
    {
    par.style.display='none';
    i2=1;i3=100;
    }
  else par.style.display='';
  par=document.getElementById("parte2");
  if (i1==85)
    {
    par.style.display='none';
    i2=100;i3=1;
    }
  else par.style.display='';
  par=document.getElementById("separacion");
  if (i2==1 || i2==100) par.style.display='none';
  else par.style.display='';
  par=document.getElementById("parte1");
  par.height=i2+'%';
  par=document.getElementById("parte2");
  par.height=i3+'%';
  window.focus();
  if (como==1) clearInterval(espera);
  return false;
  }
function muevesepara(baja,como)
  {
  clearInterval(espera);
  espera=setInterval('mueveseparacion('+baja+','+como+')',30);
  return false;
  }
function parasepara()
  {
  clearInterval(espera);
  }
function pon()
  {
  var i1,i2,ca1,vis;
  setInterval('cambia()',5000);
  if (document.all)
    {
  
    logoj.alt=titulo.innerText;
    if (visita.innerHTML!='&nbsp; ')
      {
  //alert ("vis ");//+fanu.children.tags('IFRAME')[0].src);

      //fvi.children.tags('IFRAME')[0].src='http://www.ieslosviveros.es/index.txt';
     // fanu.children.tags('IFRAME')[0].src='http://www.ieslosviveros.es/index.txt';
    //  alert("fanu");//+fanu.children.tags('IFRAME')[0].src);
      }
    }
  vis=document.getElementById("tablon");
  vis.style.display='';
  }



