﻿window.onload = rolloverInit;

function rolloverInit()
{
var nombreImagen;
for(var i = 0; i< document.images.length; i++)
	{
	    nombreImagen = document.images[i].id;
		if (document.images[i].parentNode.tagName == "A" && nombreImagen.substring(0, 8) == "Imagenes")
		{
			setupRollover(document.images[i]);
		}
	}
//	mostrardiv(1);
document.getElementById("Imagenes/botones/btn-descripcion").src = document.getElementById("Imagenes/botones/btn-descripcion").encendidaImage.src;

}

function setupRollover(thisImage)
{
	thisImage.apagadaImage = new Image();
	thisImage.apagadaImage.src = thisImage.src;
	//thisImage.onmouseout = rollOut;
	thisImage.encendidaImage = new Image();
	thisImage.encendidaImage.src = thisImage.id + "_on.jpg";
	//thisImage.onmouseover = rollOver;
	thisImage.onclick = rollClick ;
}

function rollOut()
{
	this.src = this.outImage.src;
}
function rollOver()
{
	this.src = this.overImage.src;
}

function rollClick()
{
document.getElementById("Imagenes/botones/btn-descripcion").src = document.getElementById("Imagenes/botones/btn-descripcion").apagadaImage.src;
document.getElementById("Imagenes/botones/btn-caracteristicas").src = document.getElementById("Imagenes/botones/btn-caracteristicas").apagadaImage.src;
document.getElementById("Imagenes/botones/btn-beneficios").src = document.getElementById("Imagenes/botones/btn-beneficios").apagadaImage.src;
	this.src = this.encendidaImage.src;
}

function mostrardiv(valor ) {

switch(valor)
{
case 1:

//Quito Imagen de fondo al Fondo General
document.getElementById("FondoGeneral").className = 'ProductosDescripcionFondo';


//Escondo los elementos de Caracteristicas
document.getElementById("ProductoCaracteristicasTextoIzquierda").style.display = 'none'
document.getElementById("ProductoCaracteristicasImagenDerecha").style.display = 'none'
document.getElementById("ProductoCaracteristicasTextoDerecha").style.display = 'none'
//Escondo Beneficios
document.getElementById("ProductoBeneficiosTexto1").style.display = 'none';
document.getElementById("ProductoBeneficiosTitulo").style.display = 'none'

//Muestro los elementos de Descripcion
document.getElementById("ProductoDescripcionImagen").style.display = 'block';
document.getElementById("ProductoDescripcionTexto1").style.display = 'block';
document.getElementById("ProductoDescripcionTexto2").style.display = 'block';


document.getElementById("Imagenes/botones/btn-descripcion").src = document.getElementById("Imagenes/botones/btn-descripcion").encendidaImage.src;
document.getElementById("Imagenes/botones/btn-caracteristicas").src = document.getElementById("Imagenes/botones/btn-caracteristicas").apagadaImage.src;
document.getElementById("Imagenes/botones/btn-beneficios").src = document.getElementById("Imagenes/botones/btn-beneficios").apagadaImage.src;

break ;
case 2:
if (document.title == "RP3 - Punto de Venta")
{
document.getElementById("FondoGeneral").className = 'ProductosCaracteristicasFondoPOS'
}
if (document.title == "RP3 - Merchandising")
{
document.getElementById("FondoGeneral").className = 'ProductosCaracteristicasFondoMerchandising'
}
if (document.title == "RP3 - Customer Relationship Management")
{
document.getElementById("FondoGeneral").className = 'ProductosCaracteristicasFondoCRM'
}
if (document.title == "RP3 - Crédito")
{
document.getElementById("FondoGeneral").className = 'ProductosCaracteristicasFondoCredito'
}
if (document.title == "RP3 - Contabilidad y Finanzas")
{
document.getElementById("FondoGeneral").className = 'ProductosCaracteristicasFondoFinanzas'
}
if (document.title == "RP3 - Nónima")
{
document.getElementById("FondoGeneral").className = 'ProductosCaracteristicasFondoNomina'
}
if (document.title == "RP3 - Activo Fijo")
{
document.getElementById("FondoGeneral").className = 'ProductosCaracteristicasFondoActivoFijo'
}
if (document.title == "RP3 - Sistema de Atención de Reclamos")
{
document.getElementById("FondoGeneral").className = 'ProductosCaracteristicasFondoSAR'
}

if (document.title == "RP3 - Administración de Bodegas")
{
document.getElementById("FondoGeneral").className = 'ProductosCaracteristicasFondoWMS'
}

if (document.title == "RP3 - Retail Business Intelligence")
{
document.getElementById("FondoGeneral").className = 'ProductosCaracteristicasFondoRBI'
}

if (document.title == "RP3 - Balance Scorecard")
{
document.getElementById("FondoGeneral").className = 'ProductosCaracteristicasFondoBSC'
}

//document.getElementById("FondoGeneral").style.backgroundRepeat = 'no-repeat';

//Escondo los elementos de Descripcion
document.getElementById("ProductoDescripcionImagen").style.display = 'none';
document.getElementById("ProductoDescripcionTexto1").style.display = 'none';
document.getElementById("ProductoDescripcionTexto2").style.display = 'none';

//Escondo Beneficios
document.getElementById("ProductoBeneficiosTexto1").style.display = 'none';
document.getElementById("ProductoBeneficiosTitulo").style.display = 'none'

//Muestro los elementos de Caracteristicas
document.getElementById("ProductoCaracteristicasTextoIzquierda").style.display = 'block'
document.getElementById("ProductoCaracteristicasImagenDerecha").style.display = 'block'
document.getElementById("ProductoCaracteristicasTextoDerecha").style.display = 'block'

document.getElementById("Imagenes/botones/btn-descripcion").src = document.getElementById("Imagenes/botones/btn-descripcion").apagadaImage.src;
document.getElementById("Imagenes/botones/btn-caracteristicas").src = document.getElementById("Imagenes/botones/btn-caracteristicas").encendidaImage.src;
document.getElementById("Imagenes/botones/btn-beneficios").src = document.getElementById("Imagenes/botones/btn-beneficios").apagadaImage.src;

break ;

case 3:
document.getElementById("FondoGeneral").className = 'ProductosBeneficiosFondo'

//Escondo Otras Secciones
//Escondo los elementos de Descripcion
document.getElementById("ProductoDescripcionImagen").style.display = 'none';
document.getElementById("ProductoDescripcionTexto1").style.display = 'none';
document.getElementById("ProductoDescripcionTexto2").style.display = 'none';
//Escondo los elementos de Caracteristicas
document.getElementById("ProductoCaracteristicasTextoIzquierda").style.display = 'none'
document.getElementById("ProductoCaracteristicasImagenDerecha").style.display = 'none'
document.getElementById("ProductoCaracteristicasTextoDerecha").style.display = 'none'

//Muestro Secciones de Beneficios:
document.getElementById("ProductoBeneficiosTexto1").style.display = 'block';
document.getElementById("ProductoBeneficiosTitulo").style.display = 'block'

document.getElementById("Imagenes/botones/btn-descripcion").src = document.getElementById("Imagenes/botones/btn-descripcion").apagadaImage.src;
document.getElementById("Imagenes/botones/btn-caracteristicas").src = document.getElementById("Imagenes/botones/btn-caracteristicas").apagadaImage.src;
document.getElementById("Imagenes/botones/btn-beneficios").src = document.getElementById("Imagenes/botones/btn-beneficios").encendidaImage.src;


break;
}

}
function cerrar() {
div = document.getElementById('flotante');
div.style.display='none';
}
