/**
 * MENU Instantaneo localizador.
 * ALL rigths reserved.  Use only with permission of RO-BOTICA and Toni Ferrate
 */
 
var parametre;
c = new Array;
n = new Array;
d = new Array;

n[1]="Sistemas robóticos flexibles";
d[1]="index.asp"
c[1]=new Array(11,12,14,13,15,16,17);
	n[11]="Sistema LEGO Education";
	d[11]="lego_education.asp"
	c[11]=new Array(110,111,112,113,114)

		n[110]="LEGO Mindstorms NXT";
		d[110]="mindstorms_sys.asp"
		c[110]=new Array(1101,1102,1103)
			n[1101]="LEGO Mindstorms NXT 2.0"
			d[1101]="mindstorms.asp"
			
			n[1102]="LEGO Education Mindstorms NXT"
			d[1102]="mindstorms_sys.asp#education"
			
			n[1103]="Sensores y accesorios para Mindstorms NXT"
			d[1103]="mindstorms_accesorios.asp"
				
		n[111]="LEGO Education WeDo";
		d[111]="wedo_sys.asp"
				
		n[112]="Máquinas sencillas motorizadas";
		d[112]="LEGO_maquinas_motores.asp"
		
		n[113]="Máquinas tempranas";
		d[113]="LEGO_maquinas_tempranas.asp"
		
		n[114]="LEGO Technic";
		d[114]="LEGO_technic.asp"
	
	
	n[12]="Sistema BIOLOID"
	d[12]="Bioloid_sys.asp"
	c[12]=new Array(120,121,122,124,125,126)
		
		n[120]="Accesorios Bioloid"
		d[120]="bioloid_sys_parts.asp"
		
		n[121]="Bioloid Beginner Kit"
		d[121]="Bioloid_beg.asp"
		
		n[122]="Beginner to Comprehensive Kit"
		d[122]="bioloid-Beginner-to-Comprehensive-upgrade-kit.asp"

		n[124]="Bioloid Comprehensive kit"
		d[124]="Bioloid_comp.asp"
		
		n[125]="Bioloid Expert kit"
		d[125]="Bioloid_expert.asp"
		
		n[126]="Bioloid Premium kit"
		d[126]="bioloid_premium.asp"
		
		
		c[127]=new Array(1270,1271,1272,1273,1274,1275,1276,1277,1278,1279,12710,12711)
		
			n[1270]="Comprehensive FrameSet"
			d[1270]="Bioloid-frameset.asp"
			
			n[1271]="Sensores Dynamixel AX-S1"
			d[1271]="Bioloid-sensor-AX-S1.asp"
			
			n[1272]="Caja 6 actuadores AX12+"
			d[1272]="bioloid_sys_parts.asp"
			
			n[1273]="Servo Dynamixel AX-12"
			d[1273]="Bioloid-servo-AX12.asp"
		
			n[1274]="2 módulos wireless ZigBee"
			d[1274]="Bioloid-zig100.asp"
			
			n[1275]="ZIG2Serial"
			d[1275]="Bioloid-zig2serial.asp"
		
			n[1276]="USB2Dynamixel - USB para Bus Bioloid"
			d[1276]="Bioloid-USB2Dynamixel.asp"
			
			n[1277]="Controlador de Bioloid CM-5"
			d[1277]="Bioloid-controlador-CM-5.asp"
		
			n[1278]="Batería Bioloid NiMH 9,6V 2,3Ah"
			d[1278]="Bioloid-bateria.asp"
			
			n[1279]="SMPS2Dynamixel"
			d[1279]="bioloid-SMPS2Dynamixel.asp"
			
			n[12710]="Control remoto RC-100"
			d[12710]="bioloid-control-remoto-RC100.asp"
			
			n[12711]="Control remoto Zigbee RC-100Z"
			d[12711]="bioloid-control-remoto-RC100Z.asp"
		
		
	
	n[13]="Sistema RoboBuilder"
	d[13]="robobuilder.asp"
	c[13]=new Array(131,132,133,134)
		n[131]="RoboBuilder Beginner 5710K-E02"
		d[131]="robobuilder_5710K_E02.asp"
		
		n[132]="RoboBuilder Creator 5710K"
		d[132]="robobuilder_5710K.asp"
		
		n[133]="RoboBuilder Creator 5720T"
		d[133]="robobuilder_5720T.asp"
		
		n[134]="Sensores y motores"
		d[134]="robobuilder.asp#accesoris"
		
	n[14]="Sistema OLLO"
	d[14]="ollo.asp"
	c[14]=new Array(141,142,143)
		n[141]="OLLO Figura"
		d[141]="ollo_figura.asp"
		
		n[142]="OLLO Acción"
		d[142]="ollo_accion.asp"
		
		n[143]="OLLO Bicho"
		d[143]="ollo_bicho.asp"

	n[15]="Sistema FischerTechnik"
	d[15]="FischerTechnik.asp"	
	
	n[16]="Sistema POB"
	d[16]="pob.asp"	
	
	n[17]="Accesorios";
	d[17]="accesorios.asp"
	c[17]=new Array(171,172,173,174,175,176,177)
	
		n[171]="Accesorios Mindstoms NXT"
		d[171]="mindstorms_sys.asp#sensors"
		
		n[172]="Accesorios Bioloid"
		d[172]="bioloid_sys_parts.asp"

		n[173]="Accesorios RoboBuilder"
		d[173]="RoboBuilder.asp#accesoris"
		
		n[174]="Accesorios Robonova"
		d[174]="robonova_complementos.asp"
		
		n[175]="Actuadores Dynamixel"
		d[175]="dynamixel.asp"
		
		n[176]="Accesorios POB"
		d[176]="pob_sys.asp"
		c[176]=new Array(1761,1762, 1763, 1764)
		
			n[1761]="Placa POB-Bridge para LEGO NXT"
			d[1761]="pob_bridge.asp"
			
			n[1762]="POB-Eye cámara color de visión artificial"
			d[1762]="pob_eye.asp"
			
			n[1763]="Placas Dual-POB"
			d[1763]="pob_parts.asp"
			
			n[1764]="POB-Bot's con visión"
			d[1764]="pob.asp"
		
		n[177]="Accesorios Kondo"
		d[177]="kondo_accesorios.asp"
					
		

	
n[2]="Kits por tipo";
d[2]="index.asp"
c[2]=new Array(21,22,23);
	n[21]="Humanoides";
	d[21]="robots_humanoides.asp"
	c[21]=new Array(210,2114,211,212,213,214,215,216,217,218,219,2110,2111,2112,2113,2114,2115)
	
		n[210]="i-Sobot"
		d[210]="isobot.asp"
	
		n[211]="Desktop Hobby robot PLEN"
		d[211]="plen.asp"
		
		n[212]="RoboBuilder Creator 5710K"
		d[212]="robobuilder_5710K_E02.asp"
		
		n[213]="RoboBuilder Creator 5720T"
		d[213]="robobuilder_5720T.asp"
		
		n[214]="Kiosho Manoi PF01"
		d[214]="manoiPF01.asp"

		n[215]="Kiosho Manoi AT01 "
		d[215]="manoi_AT0.asp"
		
		n[216]="KT-X Gladiator 19 + gamepad"
		d[216]="kt-x_gladiator.asp"
		
		n[217]="KT-X Standard 17 + gamepad"
		d[217]="kt-x.asp"
		
		n[218]="Bioloid Comprehensive Kit"
		d[218]="bioloid_comp.asp"

		n[219]="Robonova-1 (Kit) con control remoto"
		d[219]="robonova.asp"
		c[219]=new Array(2191,21101)
		
			n[2191]="Accesorios Robonova"
			d[2191]="robonova_complementos.asp"



		n[2110]="Robonova-1 listo para andar"
		d[2110]="robonova.asp"
		c[2110]=new Array(21101,2191)
			
			n[2191]="Accesorios Robonova"
			d[2191]="robonova_complementos.asp"
		
		
		n[2111]="Kondo KHR-2HV (Kit)"
		d[2111]="KHR-2HV.asp"
		
		n[2112]="Robovie-M V3 (kit)"
		d[2112]="robovie.asp"
		
		n[2113]="Kondo KHR-2HV Complete Pack"
		d[2113]="KHR-2HV Complete pack.asp"
		
		n[2114]="MechRC - Pack educativo"
		d[2114]="mechrc.asp"
		
		n[2115]="Kondo KHR-3HV (kit)"
		d[2115]="Kondo KHR-3HV.asp"
		
		
	n[22]="No humanoides";
	d[22]="ruedas.asp"
	c[22]=new Array(220,221,222,223,224,225,226,227,228)
	
		n[220]="Brazo robot articulado"
		d[220]="brazo-robot.asp.asp"

		n[221]="Kit básico robot Moway"
		d[221]="mini-robot-educacional-moway.asp"
		
		n[222]="Robot MA-VIN (KIT)"
		d[222]="MA-VIN.asp"
		
		n[223]="Bioloid Beginner Kit"
		d[223]="bioloid_beg.asp"
		
		n[224]="LEGO Mindstorms - Kit"
		d[224]="mindstorms.asp"
		
		n[225]="LEGO Mindstorms - Pack educativo"
		d[225]="mindstorms_pack.asp"
		
		n[226]="Kit básico robot Moway"
		d[226]="mini-robot-educacional-moway.asp"
		
		n[227]="Bioloid Beginner Kit"
		d[227]="bioloid_beg.asp"
		
		n[228]="Robot MA-VIN"
		d[228]="ma-vin.asp"
	
	n[23]="Infantiles";
	d[23]="infantil.asp"
	

	

n[4]="Robots domésticos";
d[4]="index.asp"
c[4]=new Array(41,42,44);

	n[41]="Robots aspirador Roomba";
	d[41]="aspiradoras.asp";
	c[41]=new Array(410,411,412,413,415)
	
		n[410]="iRobot Roomba 520"
		d[410]="Roomba_520.asp"
		
		n[411]="iRobot Roomba 530"
		d[411]="iRobot_Roomba_530.asp"
		
		n[412]="iRobot Roomba 555"
		d[412]="Roomba_555.asp"
		
		n[413]="iRobot Roomba 580"
		d[413]="iRobot_Roomba_580.asp"
		
		n[414]="iRobot Roomba 563 Pet"
		d[414]="Roomba_563.asp"
		
		n[415]="iRobot Roomba 581"
		d[415]="Roomba_581.asp"
	
	n[44]="Telepresencia";
	d[44]="telepresencia.asp"
	c[44]=new Array(441,442);
		n[441]="Rovio Wi-Fi"
		d[441]="rovio.asp"
		
		n[442]="Spykee Wi-Fi"
		d[442]="meccano_spykee.asp"
		
	
	n[42]="Gadgets";
	d[42]="gadgets.asp"
	c[42]=new Array(420,421, 4225, 422, 423, 424, 425, 426, 427, 428, 429, 4210, 4211, 4212,4213,4214,4215,4216,4217,4218,4219,4220,4221,4222,4223,4224)
	
		n[420]="Metal Robots Meccano"
		d[420]="meccano_metal_robots.asp"
		
		n[421]="Conejo Nabaztag"
		d[421]="nabaztag.asp"
		
		n[422]="Robot dinosaurio Pleo"
		d[422]="pleo.asp"
		
		n[423]="Robot con pila CAM-10"
		d[423]="cam10.asp"
	
		n[424]="Robot futbolista"
		d[424]="botball.asp"
		
		n[425]="Robots a cuerda"
		d[425]="corda.asp"
		
		n[426]="Kits para soldar"
		d[426]="kits_soldar.asp"
		c[426]=new Array(4261,4262)
		
			n[4261]="kit sound reversing car"
			d[4261]="sound_reversing_car.asp"	
			
			n[4262]="Hexapod Monster"
			d[4262]="hexapod_monster.asp"	
		
		n[427]="Insecto Hexbug Alpha"
		d[427]="insecto-robot-hexbug-alpha.asp"
		
		n[428]="Insecto Hexbug Bravo"
		d[428]="insecto-robot-hexbug-bravo.asp"
		
		n[429]="Insecto Hexbug Charlie"
		d[429]="insecto-robot-hexbug-charlie.asp"
		
		n[4210]="Insecto Hexbug Delta"
		d[4210]="insecto-robot-hexbug-delta.asp"
		
		n[4211]="Insecto Hexbug Echo"
		d[4211]="insecto-robot-hexbug-echo.asp"
		
		n[4212]="Caja 10 Hexbug"
		d[4212]="caja-10-bichos-hexbug.asp"
		
		n[4213]="Cangrejo Hexbug Rojo"
		d[4213]="Cangrejo-Hexbug-Rojo.asp"
			
		n[4214]="Cangrejo Hexbug Verde"
		d[4214]="Cangrejo-Hexbug-Verde.asp"
		
		n[4215]="Cangrejo Hexbug Azul"
		d[4215]="Cangrejo-Hexbug-Azul.asp"
		
		n[4216]="Cangrejo Hexbug Negro"
		d[4216]="Cangrejo-Hexbug-Negro.asp"
		
		n[4217]="Cangrejo Hexbug Turquesa"
		d[4217]="Cangrejo-Hexbug-Azul claro.asp"
		
		n[4218]="Caja 5 cangrejos Hexbug"
		d[4218]="caja-5-cangrejos-hexbug.asp"
		
		n[4219]="Gusano Hexbug rojo"
		d[4219]="gusano-hexbug-rojo.asp"
		
		n[4220]="Gusano Hexbug verde"
		d[4220]="gusano-hexbug-verde.asp"
		
		n[4221]="Gusano Hexbug azul"
		d[4221]="gusano-hexbug-azul.asp"
		
		n[4222]="Gusano Hexbug negro"
		d[4222]="gusano-hexbug-negro.asp"
		
		n[4223]="Gusano Hexbug plomo"
		d[4223]="gusano-hexbug-plomo.asp"
		
		n[4224]="Caja 5 gusanos Hexbug"
		d[4224]="caja-5-gusanos-hexbug.asp"
		
		n[4225]="Knockman"
		d[4225]="knockman.asp"
	
	

	

c[0]=new Array(1,2,4);

	
	

function initMenu(Id)
{
  var CatIdArray = new Array;
  var ChosenCatIdArray = new Array;
  var CategoryId;
  var chosenCategory;
  var numChildren;
  var CatId;
  var CatName;
  var level;
  var index;
  var i;
  var j;
  // make sure the CategoryId is valid
  if (n[Id] == null)
  {
    changeMenu(-1);
    return;
  }

  // initilize
  CategoryId = Id;

  // category leaf-level = 0
  level = 0;

  // loop through category list until reaching c[0]
  while (CategoryId != 0 && level < 4)
  {
	ChosenCatIdArray[level] = CategoryId;

  outerloop:
    for (i = 0; i < c.length; i++)
    {
	  if (c[i] == null)
	    continue;

      for (j = 0; j < c[i].length; j++)
      {
        if (c[i][j] == CategoryId)
        {
          CategoryId = i;
          CatIdArray[level] = CategoryId;
    	  break outerloop;
	    }
	  }

    }

    level++;
  }

  // if can't reach the top-level of categories, return
  if (CategoryId != 0)
  {
    changeMenu(-1);
    return;
  }

  // reverse the array, so category root-level = 0
  CatIdArray.reverse();
  ChosenCatIdArray.reverse();

  // display categories
  for (index = 0 ; index < CatIdArray.length; index++)
  {
    CatMenu[index].length = 0;

    chosenCategory = CatIdArray[index];
	 numChildren = c[chosenCategory].length;

    for (i = 0; i < numChildren; i++)
    {
      CatId = c[chosenCategory][i];
      CatName = (c[CatId]==null) ? n[CatId] : n[CatId]+ "-->";
      CatMenu[index].options[i] = new Option(CatName, CatId);

      if (CatId == ChosenCatIdArray[index])
	     CatMenu[index].options[i].selected = true;
		 CatMenu[index].options[i].click = true;
    }

    CatMenu[index].length = numChildren;

    // add a blank entry to the end of columnns
    if (index > 0)
	   CatMenu[index].options[numChildren] = new Option("-----------------------------------");
  }

  // clear out rest of the empty menus, if there are some
  for (i = index; i < CatMenu.length; i++)
  {
    CatMenu[i].length = 0;
    CatMenu[i].options[0] = new Option("-----------------------------------");
  }

}

function changeMenu(cm)
{
  var chosenCategory;
  var numChildren;
  var CatId;
  var CatName;
  var i;

  // make sure user didn't click on an empty box
  if ((cm != -1) && (CatMenu[cm].length <= 1))
    return;

  // get the chosen category from this CatMenu
  if (cm == -1) 
    chosenCategory = 0;
  else
  {
    if (CatMenu[cm].selectedIndex == -1)
      return;
    chosenCategory = CatMenu[cm].options[CatMenu[cm].selectedIndex].value;
  }

  // if no children, then user is done; 
  if (c[chosenCategory]==null)
  {
    document.producto.cat.value = chosenCategory;
//document.location="tienda"+chosenCategory+".htm";
//	document.location=d[chosenCategory];
	parametre=n[chosenCategory];
    numChildren = 0;
  }
  else
  {
    if (cm != -1) 
    {
      if (document.producto.name != "ChangePreferencesShow")
        document.producto.cat.value = chosenCategory;
		
      else
        document.producto.cat.value = chosenCategory;
    }
    numChildren = c[chosenCategory].length;
  }

  // fill up the next based on the chosenCategory
  if ((cm+1) < CatMenu.length)
  {
    for (i = 0; i < numChildren; i++)
    {
      CatId = c[chosenCategory][i];
      CatName = (c[CatId]==null) ? n[CatId] : n[CatId]+ " -->";
      CatMenu[cm+1].options[i] = new Option(CatName, CatId);
	  CatMenu[cm+1].options[i].style.cursor = "pointer";
    }
    CatMenu[cm+1].length = numChildren;
  }

  // clear out all menus to the right of this menu
  for (i = cm+2; i < CatMenu.length; i++)
  {
    CatMenu[i].length = 0;
  }

  // add a blank entry to the end of each columnn that was affected
  for (i = cm+1; i < CatMenu.length; i++)
  {
    if (i) 
      CatMenu[i].options[CatMenu[i].length] = new Option("------------------------------");
  }
}
// This JS comment is also at the end of the HTML comment above -->


function go(){
	document.producto.action=d[document.producto.cat.value];
	document.producto.submit();
}

function inici(){
	// gather all the CatMenus on the page into an array
		CatMenu = new Array;
		j = 0;
		//for (i = 0; i < document.producto.elements.length; i++)
		for (i = 0; i < 5; i++)
		{
		  if (document.producto.elements[i].name.indexOf("CatMenu") != -1)
		    CatMenu[j++] = document.producto.elements[i];
		}
		
		// start it off
		initMenu(document.producto.cat.value);
}

function ins(src,color_entrada) { 
    src.bgColor=color_entrada;
	src.style.cursor="hand";
	src.style.cursor="pointer";
} 
function out(src,color_default) { 
    src.bgColor=color_default;
	src.style.cursor="default"; 
} 
