// Funciones para crear pesta�as.
	
	var target = '';
	var tab = new Array(15);
	for (var i = 0; i < tab.length; i++ ) tab[i] = new item(i);

	//var On_Color = '#006699';
	//var On_Color = '#34B1F2';	
	//var On_Color = '#139FE7';	
        var On_Color = '#007D00';	
	var Off_Color = '#CECFCE';
	var Disabled_Color = '#CECFEE';


	function inicializaTabs()
	{
		target = '';
		tab = new Array(15);
		for (var i = 0; i < tab.length; i++ ) tab[i] = new item(i);
	}

	function item(Id)
	{
	  this.id = Id, this.label = '', this.url = '', this.image = '', this.target = target, this.estado ='';
	}

	function DrawTab( Label, URL, Target, Type )
	{
	  if ( !Type ) Type = 'Off'  
	  
	  if ( Type == 'First On' )
	  {
		Str = '<div align=\"left\"> <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>'
		Str += '  <td nowrap height=20><img src=\"img/izqOn.png\" width=8 height=20 border=0 alt=\"\"></td>'
		Str += '  <td nowrap height=20 background=\"img/fondoOn.png\" align=\"CENTER\" valign=\"MIDDLE\" class=OnTab>&nbsp;'+Label+'</td>'
		Str += '  <td nowrap height=20><img src=\"img/derOn.png\" width=9 height=20 border=0 alt=\"\"></td>'
	  } else if ( Type == 'First Off' )
	  {
		Str = '<div align=\"left\"> <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>'
		Str += '  <td nowrap height=20><img src=\"img/izq.gif\" width=8 height=20 border=0 alt=\"\"></td>'
		Str += '  <td nowrap align=\"CENTER\" valign=\"MIDDLE\" background=\"img/fondo.png\">&nbsp;<a class=OffTab href=\"'+URL+'\" target=\"'+Target+'\">'+Label+'</a></td>'
		Str += '  <td nowrap height=20><img src=\"img/der.gif\" width=9 height=20 border=0 alt=\" \"></td>'
	  } else if ( Type == 'First Disabled' )
	  {
		Str = '<div align=\"left\"> <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>'
		Str += '  <td nowrap height=20><img src=\"img/izq.gif\" width=8 height=20 border=0 alt=\"\"></td>'
		Str += '  <td nowrap align=\"CENTER\" valign=\"MIDDLE\" class=DisabledTab background=\"img/fondo.png\">&nbsp;'+Label+'</td>'
		Str += '  <td nowrap height=20 ><img src=\"img/der.gif\" width=9 height=20 border=0 alt=\" \"></td>'
	  } else if ( Type == 'Off' )
	  {
		Str = '  <td nowrap height=20><img src=\"img/izq.gif\" width=8 height=20 border=0 alt=\"\"></td>'
		Str += '  <td nowrap align=\"CENTER\" valign=\"MIDDLE\" background=\"img/fondo.png\">&nbsp;<a class=OffTab href=\"'+URL+'\" target=\"'+Target+'\">'+Label+'</a></td>'
		Str += '  <td nowrap height=20><img src=\"img/der.gif\" width=9 height=20 border=0 alt=\"\"></td>'
	  } else if ( Type == 'Before On' )
	  {
		Str = '  <td nowrap height=20><img src=\"img/izq.gif\" width=8 height=20 border=0 alt=\"\"></td>'
		Str += '  <td nowrap align=\"CENTER\" valign=\"MIDDLE\" background=\"img/fondo.png\">&nbsp;<a class=OffTab href=\"'+URL+'\" target=\"'+Target+'\">'+Label+'</a></td>'
		Str += '  <td nowrap height=20><img src=\"img/der.gif\" width=9 height=20 border=0 alt=\"\"></td>'
	  } else if ( Type == 'On' )
	  {
		Str = '  <td nowrap height=20><img src=\"img/izqOn.png\" width=8 height=20 border=0 alt=\"\"></td>'
		Str += '  <td nowrap align=\"CENTER\" valign=\"MIDDLE\" class=OnTab background=\"img/fondoOn.png\">&nbsp;'+Label+'</td>'
		Str += '  <td nowrap height=20><img src=\"img/derOn.png\" width=9 height=20 border=0 alt=\"\"></td>'
	  } else if ( Type == 'Disabled' )
	  {
		Str = '  <td nowrap height=20><img src=\"img/izq.gif\" width=8 height=20 border=0 alt=\"\"></td>'
		Str += '  <td nowrap align=\"CENTER\" valign=\"MIDDLE\" class=DisabledTab background=\"img/fondo.png\">&nbsp;'+Label+'</td>'
		Str += '  <td nowrap height=20><img src=\"img/der.gif\" width=9 height=20 border=0 alt=\"\"></td>'
	  }
	  
	  document.write( Str );
	  // document.close();
	}


	function creaFolder()
	{
	  var OnTab = activa


	  if ( OnTab == 1 )
	  {
		if(tab[1].estado)
		{
			if(tab[1].estado == "inactivo")
			{
				DrawTab( tab[1].label, tab[1].url, tab[1].target, 'First Disabled' );
			} else {
				DrawTab( tab[1].label, tab[1].url, tab[1].target, 'First On' );
			}
		} else
		{
			DrawTab( tab[1].label, tab[1].url, tab[1].target, 'First On' );
		}

	  
	  } else
	  {
		if(tab[1].estado)
		{
			if(tab[1].estado == "inactivo")
			{
				DrawTab( tab[1].label, tab[1].url, tab[1].target, 'First Disabled' );
			} else
			{
				DrawTab( tab[1].label, tab[1].url, tab[1].target, 'First Off' );
			}
		} else
		{
			DrawTab( tab[1].label, tab[1].url, tab[1].target, 'First Off' );
		}
	  }
	  
	for (var i = 2; i <= TabMaxVal; i++)
	{
		if(tab[i].estado)
		{
			if(tab[i].estado == "inactivo")
			{
				DrawTab( tab[i].label, tab[i].url, tab[i].target, 'Disabled' );
			} else
			{
				if ( i == OnTab )
				{
					DrawTab( tab[i].label, tab[i].url, tab[i].target, 'On' );
				} else
				{
					if ( i == OnTab-1 )
					{
						DrawTab( tab[i].label, tab[i].url, tab[i].target, 'Before On' );
					} else
					{
						DrawTab( tab[i].label, tab[i].url, tab[i].target, 'Off' );
					}
				}
			}
		} else
		{
			if ( i == OnTab )
			{
				DrawTab( tab[i].label, tab[i].url, tab[i].target, 'On' );
			} else
			{
				if ( i == OnTab-1 )
				{
					DrawTab( tab[i].label, tab[i].url, tab[i].target, 'Before On' );
				} else
				{
					DrawTab( tab[i].label, tab[i].url, tab[i].target, 'Off' );
				}
			}
		}

	}

	  document.write( '<td nowrap>&nbsp;</td></tr></table></div>' );
	  // document.close();
  }

  function creaBarra(texto)
  {
	  var block = '<TABLE width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">'
   	  //block += '<tr bgcolor=\"' + On_Color + '\"><td nowrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td class=OnTab>' + texto + '&nbsp;</td></tr>'
   	  block += '<tr bgcolor=\"' + On_Color + '\"><td nowrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>' + texto + '&nbsp;</td></tr>'
   	  //block += '<tr width=\"100%\" bgcolor=\"' + On_Color + '\"><td nowrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td class=OnTab>' + texto + '&nbsp;</td></tr>'
   	  //block += '<tr bgcolor=\"' + On_Color + '\"><td colspan=\"2\" width=\"100%\" class=OnTab>' + texto + '&nbsp;</td></tr>'
          block += '</TABLE>'
	  document.write(block);
	  // document.close();
  }
