/* ------------------------------------------------------------------
Fichero...: menu.js
Tipo......: fuente JavaScript
Propósito.: implementación menú 
Autor(es).: A.Alonso (aaa-Nexus5)
------------------------------------------------------------------- */

function mnu_setLengua(sIdLengua)
	{
	parent.m_sIdLengua=sIdLengua;
	parent.frames.menu.location.reload();
	parent.frames.contenido.location.reload();
	}

	
function mnu_init()
	{
	
		items=new Array();
		items[0]=new mnu_item(0,"About Us","../htm/info.htm","contenido");
		items[1]=new mnu_item(0,"Outdoor Training","../htm/ot.htm","contenido");	
		items[2]=new mnu_item(1,"Técnicas de Equipo","../htm/equipo.htm","contenido");	
		items[3]=new mnu_item(1,"Stages","../htm/programas.htm","contenido");	
		items[4]=new mnu_item(1,"Otros Programas","../htm/progrot.htm","contenido");	
		items[5]=new mnu_item(1,"Actividades","../htm/actividades.htm","contenido");		
		items[6]=new mnu_item(1,"Retorno Inversión","../htm/roi.htm","contenido");
		items[7]=new mnu_item(0,"Fidelizaci&oacuten","../htm/fidel.htm","contenido");		
		items[8]=new mnu_item(1,"Programas","../htm/progfide.htm","contenido");
		items[9]=new mnu_item(0,"Contact Us","../htm/contacto.htm","contenido");

	}

function mnu_setTextos()
	{
	switch (parent.m_sIdLengua)
		{
		case ("es"):
			items[0].texto="Orixin";			
			items[1].texto="Outdoor Training";
			items[2].texto="Técnicas de Equipo";
			items[3].texto="Stages";
			items[4].texto="Otros Programas";
			items[5].texto="Actividades";
			items[6].texto="Retorno Inversión";
			items[7].texto="Fidelización";
			items[8].texto="Programas";
			items[9].texto="Contactar";

/*			items[0].texto="Acerca de Orixin";			
			items[1].texto="Técnicas de equipo";
			items[2].texto="Retorno de Inversión";
			items[3].texto="Aragón";
			items[4].texto="Programas";
			items[5].texto="Campo de Aventura";
			items[6].texto="Programa Cultural";
			items[7].texto="Formación";
			items[8].texto="Team Building";
			items[9].texto="Teruel, diferente";
			items[10].texto="Vía Romana";
			items[11].texto="Actividades";
			items[12].texto="Contactar con Orixin";*/
			break;
		case ("en"):
			items[0].texto="Orixin";			
			items[1].texto="Outdoor Training";
			items[2].texto="Team Building";
			items[3].texto="Stages";
			items[4].texto="Other Programmes";
			items[5].texto="Activities";
			items[6].texto="ROI";
			items[7].texto="Fidelization";
			items[8].texto="Programmes";
			items[9].texto="Contact Us";


			/*items[0].texto="About Us";			
			items[1].texto="Team Building";
			items[2].texto="Return of Investment";
			items[3].texto="Aragón";
			items[4].texto="Programmes";
			items[5].texto="Adventure Camp";
			items[6].texto="Culture Camp";
			items[7].texto="Training Journey";
			items[8].texto="Team Building";
			items[9].texto="Teruel, different";
			items[10].texto="Roman Way";
			items[11].texto="Activities";
			items[12].texto="Contact Us";*/
			break;
		case ("fr"):
			items[0].texto="Orixin";			
			items[1].texto="Outdoor Training";
			items[2].texto="Programas";
			items[3].texto="Fidelización";
			items[4].texto="Programas";
			items[5].texto="Contactar";

			/*items[0].texto="Sur Nous";			
			items[1].texto="Techniques d´Èquipe";
			items[2].texto="Retour d'Invest.";
			items[3].texto="Aragón";
			items[4].texto="Programmes";
			items[5].texto="Camp d´Aventure";
			items[6].texto="Champ Culturel";
			items[7].texto="Formation";
			items[8].texto="Team Building";
			items[9].texto="Teruel, différent";
			items[10].texto="Voie Romaine";
			items[11].texto="Activités";
			items[12].texto="Contactez Nous";*/
			break;
		}
	}

function mnu_item(nivel,texto,url,frame) 
	{
	this.nivel=nivel;
	this.texto=texto;
	this.url=url;
	this.frame=frame;
	}
	
function mnu_display() 
	{
	var i=0;
	for(i=0;i<items.length;i++) 
		{
		document.write("<a href='"+items[i].url+"'");
		document.write("class='mnu_item'");
		if (items[i].nivel>=0)
			{
			document.write("onmouseover='itm_mouseover("+i+")'");		
			document.write("onmouseout='itm_mouseout("+i+")'");		
			}
		document.write("target='"+items[i].frame+"'");
		document.write(">");		
		document.write("<img height='15px' width='15px' border='0' src='"+itm_imagen(items[i].nivel)+"'");
		document.write("class='mnu_imagen'");		
		document.write("name='mnu_item"+i+"'");
		if (items[i].nivel>0) document.write("hspace=10");
		document.write(">");		
		document.write("</img>");
		document.write(items[i].texto);
		document.write("</a>");		
		document.write("<br>");				
		}
	}

function itm_imagen(nivel)
	{
	switch(nivel)
		{
		case (-1):
			return "../gif/topo_hab.gif";
			break;		
		case (0):
			return "../gif/topo_hab.gif";
			break;
		case (1): 
			return "../gif/topo_hab.gif";
			break;
		}
	}

function itm_mouseover(i)
	{
	document.images["mnu_item"+i].src="../gif/topo_ani.gif";
	}

function itm_mouseout(i)
	{
	document.images["mnu_item"+i].src="../gif/topo.gif";
	}


var framepath=parent.contenido;

var scrollamount=5; 
var okscroll=false;
var godown=true;
var goleft=true;

function scrollpage(){
  status='';
  if(okscroll)(godown)? framepath.scrollBy(0,scrollamount) : framepath.scrollBy(0,-scrollamount);
  if(okscroll)(goleft)? framepath.scrollBy(scrollamount,0) : framepath.scrollBy(-scrollamount,0);
}

function setscroll(ismore){
  if(ismore){
    if(scrollamount<30)scrollamount+=2;
  }
  else{
    if(scrollamount>=3)scrollamount+=-2;
  }
}

window.onload=function(){
  setInterval('scrollpage()', 50);
}

