/*  
    Cambia las variables que aparecen a continuacion para adaptar el aspecto visual de las pestañas
*/

   var rows = new Array;
   var num_rows = 2;		//numero de filas
   var top = 584;		//posicion de las pestañas con respecto al borde superior
   				//OJO, si cambia, hay que cambiar tambien el atributo top de tab-body del CSS
   var left = 440;		//posicion de las pestañas con respecto al borde izquierdo
   var width = 730;		//anchura

   var tab_off = "transparent";	//color pestaña no seleccionada
   var tab_on = "transparent";	//color pestaña seleccionada

   // ¡¡ no edites o cambies esta linea !!
   for ( var x = 1; x <= num_rows; x++ ) { rows[x] = new Array; }
 

   /*  
      Define tantas filas como quieras en el bloque a continuacion.
      Observa que cada fila debe corresponderse con una etiqueta "DIV"
      en el codigo HTML, y que esta etiqueta debe tener como identificador
      T seguido de los numeros que indican fila y columna

      Por ejemplo:  row[1][5] necesita un div con un id igual a "T15"

      Observar los ejemplos que se muestran en los comentarios:
   */
	rows[1][1] = "En línea";	//paso 1 // Requiere: <div id="T11" class="tab-body">  ... </div>
	rows[1][2] = "En la tienda";	//paso 2 // Requiere: <div id="T12" class="tab-body">  ... </div>  


 //rows[1][1] = "<img src=\"images/col_iz2.jpg\" border=0>";	//paso 1 // Requiere: <div id="T11" class="tab-body">  ... </div>
   //rows[1][2] = "<img src=\"images/col_iz3.jpg\" border=0>";	//paso 2 // Requiere: <div id="T12" class="tab-body">  ... </div>

  // rows[2][1] = "Paso 3";	// Requires: <div id="T21" class="tab-body">  ... </div>
  // rows[2][2] = "Paso 4";	// Requires: <div id="T22" class="tab-body">  ... </div>
  // rows[2][3] = "Paso 5";	// Requires: <div id="T23" class="tab-body">  ... </div>



/* No cambies nada a partir de aqui */
            
var NS4 = (document.layers) ? 1 : 0;
var IE = (document.all) ? 1 : 0;
var DOM = 0; 
if (parseInt(navigator.appVersion) >=5) {DOM=1};

var lastHeader;
var currShow;

function changeCont(tgt,header) {

    target=('T' +tgt);
    
    if (DOM) {

        // Esconde el ultimo y cambia el color de la pestaña al valor original
        currShow.style.visibility="hidden";
        if ( lastHeader ) { 
           lastHeader.style.background = tab_off; 
           lastHeader.style.fontWeight="normal"; 
        }
    
        // Muestra este y cambia el color de la pestaña a color de seleccionada
        var flipOn = document.getElementById(target);			
        flipOn.style.visibility="visible";

        var thisTab = document.getElementById(header);			
        thisTab.style.background = tab_on;
        thisTab.style.fontWeight = "bold";

        // Guarda para la proxima vez
        currShow=document.getElementById(target);
        lastHeader = document.getElementById(header);

        return false;
    }

    else if (IE) {

        // Esconde el ultimo y cambia el color de la pestaña al valor original
        currShow.style.visibility = 'hidden';
        if (lastHeader) { 
            lastHeader.style.background = tab_off; 
            lastHeader.style.fontWeight="normal";
        }

        // Muestra este y cambia el color de la pestaña a color de seleccionada
        document.all[target].style.visibility = 'visible';
        document.all[header].style.background = tab_on;
        document.all[header].style.fontWeight = 'bold';

        // Guarda para la proxima vez
        currShow=document.all[target];
        lastHeader=document.all[header];

        return false;
    }
        
    else if (NS4) {

        // Esconde el ultimo y cambia el color de la pestaña al valor original
        currShow.visibility = 'hide';
        // if (lastHeader) { lastHeader.bgColor = tab_off; }

        // Muestra este y cambia el color de la pestaña a color de seleccionada
        document.layers[target].visibility = 'show';
        // document.layers[header].bgColor  = tab_on;

        // Guarda para la proxima vez
        currShow=document.layers[target];
        // lastHeader=document.layers[header];

        return false;
    }
        
    // && (version >=4)
    else {
        window.location=('#f' +target);
        return true;
    }


}

function DrawTabs() {

    var output = '';

    for ( var x = 1; x <= num_rows; x++ ) { 

        if( x > 1 ) { 
          top = top + 20;
          left = left - 15;
          width = width + 15;
        }

        output += '<div id="tabstop" style="position:absolute; ';
        output += 'left:' + left + 'px;';
        output += 'top:' + top + 'px; ';
        output += 'width:' + width + 'px; z-index:1;">\n';
        output += '<table border="0" cellpadding="0" cellspacing="10">\n';                    
        output += '<tr valign="top">\n';

           for ( var z = 1; z < rows[x].length; z++ ) {

              var tid = "tab" + x + z;
              var did = x + z;
              output += '<td id="' + tid +'" class="tab-button"><a href="#" style="color: #9fa6ac; text-decoration: none;" onClick="changeCont(\'' + x + z + '\', \'' + tid + '\'); return false;" onFocus="if(this.blur)this.blur()">' + rows[x][z] + '</a>\n</td>\n';
           }

        output += '</tr>\n';
        output += '</table>\n';
        output += '</div>\n\n';

    }

    self.document.write(output);

}

       
function IniciaTabs() {
    
    if (DOM) { currShow=document.getElementById('T11');}
    else if (IE) { currShow=document.all['T11'];}
    else if (NS4) { currShow=document.layers["T11"];};       
    changeCont("11", "tab11");
 
}

window.onload = IniciaTabs;
if (document.captureEvents) {			//N4 requiere invocar la funcion captureEvents
	document.captureEvents(Event.LOAD)
}

function ventanaPopUp (pagina,ancho,alto,scroll_b){
	var opciones=("toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars="+scroll_b+", resizable=no, width="+ancho+", height="+alto+"");
	var w=window.open(pagina,"ventana",opciones);
}
var cuenta=0;
function validar(){
	if(document.buscador.buscar.value.length==0){
		alert("Por favor completa todos los campos del formulario.");
		return false;
	}else{
		document.buscador.submit();
	}

}
function ingresar_correo(){
	if(document.implogin.imapuser.value.length == 0 || document.implogin.pass.value.length == 0)
		alert("Todos los campos son obligatorios.");
	else{
		if(document.implogin.imapuser.value.indexOf("@")==-1)
			document.implogin.imapuser.value = document.implogin.imapuser.value + "@" + "netsaluti.com";
			document.implogin.submit();
	}					
	
}
// Browser Slide-Show script.
// With image cross fade effect for those browsers that support it.
var slideCache = new Array();
function RunSlideShow(pictureName,imageFiles,displaySecs)
{
var imageSeparator = imageFiles.indexOf(";");
var nextImage = imageFiles.substring(0,imageSeparator);
if (document.all)
{
document.getElementById(pictureName).style.filter="blendTrans(duration=2)";
document.getElementById(pictureName).filters.blendTrans.Apply();
}
document.getElementById(pictureName).src = nextImage;
if (document.all)
{
document.getElementById(pictureName).filters.blendTrans.Play();
}
var futureImages= imageFiles.substring(imageSeparator+1,imageFiles.length)
+ ';' + nextImage;
setTimeout("RunSlideShow('"+pictureName+"','"+futureImages+"',"+displaySecs+")",
displaySecs*1000);
// Cache the next image to improve performance.
imageSeparator = futureImages.indexOf(";");
nextImage = futureImages.substring(0,imageSeparator);
if (slideCache[nextImage] == null) {
slideCache[nextImage] = new Image;
slideCache[nextImage].src = nextImage;
}
}



