/* Código javascript de la página de EUROsociAL Fiscalidad*/

  //Array de elementos activos, el primero es submenú y el segundo estrategias
  var idActivo = Array();
  idActivo[0] = 0;
  idActivo[1] = 0;

  function toggleActivo(id, pos, effectShow, effectHide)
  {
    if(!effectShow)
    {
      effectShow = 'Element.show';
    }

    if(!effectHide)
    {
      effectHide = 'Element.hide';
    }

    idElementoActivo = idActivo[pos];
    if($(idElementoActivo) && (idElementoActivo != id))
    {
      //Element.hide(idElementoActivo);
      eval(effectHide+'(\''+idElementoActivo+'\')');
    }

    if(Element.visible(id))
    {
      eval(effectHide+'(\''+id+'\')');
      //Element.hide(id);
      idActivo[pos] = 0;
    }
    else
    {
      eval(effectShow+'(\''+id+'\')');
      //Element.show(id);
      idActivo[pos] = id;
    }
    return false;
  }

  function resizeProporcional(image,width,height,clase)
  {
    var heightImg = height;

    image.width = Math.min(width,image.width*heightImg/image.height);
    image.height = heightImg;

    if(clase != "")
    {
      image.style.display = clase;
    }

    image.style.position = "relative";
    image.style.top = 0;
  }
