// JavaScript Document



eventos(window,"load",inicializar,false);
var seleccion=0;
var altura=0,altura2=0,altura3=0;
var bajar=0,bajar2=0,bajar3=0;

function inicializar()
{
	var opcion1=document.getElementById("opcion1");
	eventos(opcion1,"mouseover",entrar,false);
	
	var opcion1=document.getElementById("opcion1");
	eventos(opcion1,"mouseout",salir,false);

    var opcion2=document.getElementById("opcion2");
	eventos(opcion2,"mouseover",entrar2,false);
	
	var opcion2=document.getElementById("opcion2");
	eventos(opcion2,"mouseout",salir2,false);

	/*var opcion3=document.getElementById("opcion3");
	eventos(opcion3,"mouseover",entrar3,false);
	
	var opcion3=document.getElementById("opcion3");
	eventos(opcion3,"mouseout",salir3,false);
	
	var img1=document.getElementById("img1");
	eventos(img1,"click",parar,false);*/

	moverimg();
}
var valor=0;
var parada=0;

var incremento=new Array(6);
incremento[0]=100;
incremento[1]=300;
incremento[2]=500;
incremento[3]=700;
incremento[4]=900;
incremento[5]=1100;

function moverimg()
{
   var i=0;
   if (parada==0)
   {
	for (i=1;i<7;i++)
	{
		var img1=document.getElementById("img"+i);
		img1.style.left=(incremento[i-1]-1) + "px";
		incremento[i-1]=incremento[i-1]-1;
		if (incremento[i-1]< -195)
		{
			incremento[i-1]=1005;
		}
	}
	setTimeout(moverimg,10);
   }
}
/*function parar(event)
{
	if (parada==0)
	{
		parada=1;
		zoom=document.getElementById("oculto");
		if (window.event)
		{
			zoom.src=event.srcElement.src;
		}
		else
		{
			zoom.src=event.target.src;
		}
		
		zoom.style.zIndex=100;
		aumentar();
	}
	else
	{
		parada=0;
		moverimg();
	}
}
*/
function entrar()
{
	bajar=0;
	desplegar();
}
function salir()
{
	bajar=1;
	subir();
}
function entrar2()
{
	bajar2=0;
	desplegar2();
}
function salir2()
{
	bajar2=1;
	subir2();
}
/*function entrar3()
{
	bajar3=0;
	desplegar3();
}
function salir3()
{
	bajar3=1;
	subir3();
}
*/
function desplegar()
{
	var menu=document.getElementById("menu1");
	altura=altura+3;
	menu.style.height=altura+"px";
	menu.style.zIndex=100;
	if ((altura<360)&& bajar==0)
	{
		setTimeout(desplegar,5);
	}
}
function subir()
{
	var menu=document.getElementById("menu1");
	altura=altura-3;
	menu.style.height=altura+"px";
	if (altura>1 && bajar==1)
	{
		setTimeout(subir,1);
	}
}
function desplegar2()
{
	var menu=document.getElementById("menu2");
	altura2=altura2+3;
	menu.style.height=altura2+"px";
	
	if ((altura2<330)&& bajar2==0)
	{
		setTimeout(desplegar2,5);
	}
}
function subir2()
{
	var menu=document.getElementById("menu2");
	altura2=altura2-3;
	menu.style.height=altura2+"px";
	if (altura2>1 && bajar2==1)
	{
		setTimeout(subir2,1);
	}
}
/*function desplegar3()
{
	var menu=document.getElementById("menu3");
	altura3=altura3+3;
	menu.style.height=altura3+"px";
	
	if ((altura3<85)&& bajar3==0)
	{
		setTimeout(desplegar3,5);
	}
	
}
function subir3()
{
	var menu=document.getElementById("menu3");
	altura3=altura3-3;
	menu.style.height=altura3+"px";
	if (altura3>1 && bajar3==1)
	{
		setTimeout(subir3,1);
	}
}*/

function eventos(elemento,accion,funcion,captura)
{
	if (elemento.attachEvent)
	{
		elemento.attachEvent("on" + accion,funcion);
	}
	else 
	{
		elemento.addEventListener(accion,funcion,captura);
	}
}
/*
//variable con el texto a mostrar 
var texto = "ˇˇTRABAJAMOS PENSANDO" 
//variable con la posicion en el texto. Inicializar siempre a 0 
var pos = 0 

function dame_texto(){ 
    //incremento la posicion en 1 y extraigo el texto a mostrar en este momento. 
   pos = pos + 1 
    if (pos == texto.length){ 
       //si hemos llegado al final, volvemos la posición al principio 
      pos = 0 
      return texto 
   }else{ 
   return texto.substring(0,pos) 
  } 
} 

function anima_texto(){ 
    xInnerHtml('encabezado1',dame_texto()) 
   setTimeout(anima_texto,100) 
} 
*/
