/**	
	Libreria JavaScript IQ-Objects / IODA 
    Copyright (C) 2005 - 2007  Carlos José Acuña Daza - InterQ Ltda

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
	*/
var strExpandIcon = "&nbsp;+&nbsp;";
var strColapseIcon = "&nbsp;-&nbsp;";
var colapsePrevius = true;

function expandcontent(id_p, expand_id, main_id)
{
   var expanObj = document.getElementById(expand_id);
   var thisObj  = document.getElementById(id_p);
   var mainObj  = document.getElementById(main_id);
   
   if(expanObj.style.display == 'block')
   {
      expanObj.style.display = 'none';
      if(!document.all)
        thisObj.innerHTML = thisObj.innerHTML.replace(strColapseIcon,strExpandIcon);
   }
   else
   {
      expanObj.style.display = 'block';
      if(!document.all)
        thisObj.innerHTML = thisObj.innerHTML.replace(strExpandIcon,strColapseIcon);
   }
   
   // Colapsamos los elmentos previos de iguales niveles
   if(colapsePrevius)
   {
      var subItems = mainObj.getElementsByTagName("div");      
      //var subItems = new Array(5)
      for (i=0;i<subItems.length;i++)
      {
         if(subItems[i].id != expand_id)
         {
            subItems[i].style.display = 'none';            
         }
      }
      
      if(!document.all)
      {
        var subItems2 = mainObj.getElementsByTagName("A");      
        //var subItems = new Array(5)
        for (i=0;i<subItems2.length;i++)
        {
         if(subItems2[i].id != id_p)
         {
            subItems2[i].innerHTML = subItems2[i].innerHTML.replace(strColapseIcon,strExpandIcon);
         }
        }
      }
   }
   
   return false;
}

