//************* FUNCIONS PANELL *************//
//*** Requereix wPanellAmp es l'amplada ***//


function FUN_PANELL_ONOFF(pIdpan,pOnoff)
{
 var wTex = 'tex'+pIdpan+'DIV';
 var wBar = 'bar'+pIdpan+'DIV';

 if (n) 
  {
   wVisible = pOnoff ? 'show':'hide'
   document.layers[wTex].visibility = wVisible;
   document.layers[wBar].visibility = wVisible;
  }
 else
 {
  wVisible = pOnoff ? 'visible':'hidden'
  document.all[wTex].style.visibility = wVisible;
  document.all[wBar].style.visibility = wVisible;
  //wTex.style.visibility = wVisible;
  //wBar.style.visibility = wVisible;
  
 }
}


function FUN_PANELL(pIdpan,pYpan,pParaula)
{
 var wLyrtex;
 var wLyrbar;
 var wAmplada = 0;
 var wAmple = 0;
 var wTex = 'tex'+pIdpan+'DIV';
 var wBar = 'bar'+pIdpan+'DIV';

 if (n) 
  {
   wLyrtex = document.layers[wTex];
   wLyrbar = document.layers[wBar];
  }
 else
 {
  wLyrtex = document.all[wTex].style;
  wLyrbar = document.all[wBar].style;
  //wLyrtex = wTex.style;
  //wLyrbar = wBar.style;
  
 }

 var wTaula = '<table width="'+wPanellAmp+'" border="0" cellspacing="0" cellpadding="0"><tr class="petit">'

 if (arguments.length > 3)
  {
   for (wI=0; wI<(arguments.length - 2); wI+=2)
    {
     wAmplada += arguments[3+wI];
     wAmple=arguments[3+wI];
     if (arguments[3+wI]==0) wAmple=wPanellAmp-wAmplada
     wTaula += '<td width="'+wAmple+'" class="petit">' + arguments[2+wI]+'</td>'
    } 
  }
  else wTaula += '<td class="petit">' + pParaula +'</td>'

 wTaula += '</tr></table>'

 wLyrtex.top = pYpan;
 wLyrbar.top = pYpan;
 VOLCAR(wTex,wTaula); 

 FUN_PANELL_ONOFF(pIdpan,1);
}

