
/* VISUALIZAMOS CAMPO DEL FORMULARIO EN FUNCION DEL VALOR DEL SELECT */
function tipoUser(){
	if (document.formu_06.oxcxx_Tipo.value == 'Empresa')
	{
		document.formu_06.xncxx_Empleados.style.backgroundColor = "#FFFFFF";
		document.formu_06.xncxx_Empleados.disabled = false;
		document.formu_06.xncxx_Empleados.name = "oncxx_Empleados";
		document.formu_06.xncxx_Empleados.id = "oncxx_Empleados";
		document.getElementById('Emple').style.color = "#FFFFFF";
	} 
	
	if (document.formu_06.oxcxx_Tipo.value != 'Empresa')
	{
		document.formu_06.xncxx_Empleados.style.backgroundColor = "#C0C0C0";
		document.formu_06.xncxx_Empleados.disabled = true;
		document.formu_06.xncxx_Empleados.value = "";
		document.formu_06.xncxx_Empleados.name = "xncxx_Empleados";
		document.formu_06.xncxx_Empleados.id = "xncxx_Empleados";
	} 		
	
}








// Funcionamiento del rollover del menu en IE //
navHover = function() {
	var lis = document.getElementById("menu").getElementsByTagName("LI");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover=function() {
			this.className+=" iehover";
		}
		lis[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", navHover);

// Función para la fecha //
function fecha(){
	var this_month = new Array(12);
	this_month[0]  = "Enero";
	this_month[1]  = "Febrero";
	this_month[2]  = "Marzo";
	this_month[3]  = "Abril";
	this_month[4]  = "Mayo";
	this_month[5]  = "Junio";
	this_month[6]  = "Julio";
	this_month[7]  = "Agosto";
	this_month[8]  = "Septiembre";
	this_month[9]  = "Octubre";
	this_month[10] = "Noviembre";
	this_month[11] = "Diciembre";
	
	var this_day_e = new Array(7);
	this_day_e[0]  = "Domingo";
	this_day_e[1]  = "Lunes";
	this_day_e[2]  = "Martes";
	this_day_e[3]  = "Mi&eacute;rcoles";
	this_day_e[4]  = "Jueves";
	this_day_e[5]  = "Viernes";
	this_day_e[6]  = "S&aacute;bado";
	
	var today = new Date();
	var day   = today.getDate();
	var month = today.getMonth();
	var year  = today.getYear();
	var dia = today.getDay();
    if (year < 1000) {
       year += 1900; }
	   
	document.write ("<span>" + this_day_e[dia] + ", " + day + " de " + this_month[month] + " de " + year + "</span>");
}

//  ROTATIVO DE IMAGENES  //
var visible = 1; //Siempre esta como visible la primera imagen
var opacidad = 1;

function rotativo() {
	goROTATIVO = setInterval("cambio()", 4000);
}

function cambio() {
	clearInterval(goROTATIVO)
	cambiar = setInterval("oculta()", 5);
}

/*
///////ROTACIÓN DE BANNERS CON 3 IMAGENES.
function oculta(){
	var element_IMG_1 = document.getElementById("img_1");
	var element_IMG_2 = document.getElementById("img_2");
	var element_IMG_3 = document.getElementById("img_3");

	if(visible == 1)
		contenedor = element_IMG_1;
	else if(visible == 2)
		contenedor = element_IMG_2;
	else
		contenedor = element_IMG_3;
		
	opacidad -= 0.02;
	
	if(document.all && !window.opera)
		contenedor.style.filter = "alpha(opacity=" + opacidad * 100 + ")";
	else if(window.opera)
		contenedor.style.opacity = opacidad;
	else
		contenedor.style.MozOpacity = opacidad;
	
	if(opacidad <= 0)
	{
		clearInterval(cambiar);
		if(visible == 1)
		{
			element_IMG_1.style.zIndex = 10;
			element_IMG_2.style.zIndex = 30;
			element_IMG_3.style.zIndex = 20;
			if(document.all && !window.opera)
				element_IMG_1.style.filter = "alpha(opacity=100)";
			else if(window.opera)
				element_IMG_1.style.opacity = 1;
			else
				element_IMG_1.style.MozOpacity = 1;
			
			visible = 2;
			opacidad = 1;
			
			goROTATIVO = setInterval("cambio()", 4000);
		}
		else if(visible == 2)
		{
			element_IMG_2.style.zIndex = 10;
			element_IMG_3.style.zIndex = 30;
			element_IMG_1.style.zIndex = 20;
			if(document.all && !window.opera)
				element_IMG_2.style.filter = "alpha(opacity=100)";
			else if(window.opera)
				element_IMG_2.style.opacity = 1;
			else
				element_IMG_2.style.MozOpacity = 1;
			
			visible = 3;
			opacidad = 1;
			
			goROTATIVO = setInterval("cambio()", 4000);
		}
		else
		{
			element_IMG_3.style.zIndex = 10;
			element_IMG_1.style.zIndex = 30;
			element_IMG_2.style.zIndex = 20;
			if(document.all && !window.opera)
				element_IMG_3.style.filter = "alpha(opacity=100)";
			else if(window.opera)
				element_IMG_3.style.opacity = 1;
			else
				element_IMG_3.style.MozOpacity = 1;
			
			visible = 1;
			opacidad = 1;
			
			goROTATIVO = setInterval("cambio()", 4000);
		}
	}
}
*/

function oculta(){
	var element_IMG_1 = document.getElementById("img_1");
	var element_IMG_2 = document.getElementById("img_2");
	//var element_IMG_3 = document.getElementById("img_3");

	if(visible == 1)
		contenedor = element_IMG_1;
	else
		contenedor = element_IMG_2;		
/*	else if(visible == 2)
		contenedor = element_IMG_2;
	else
		contenedor = element_IMG_3;*/
		
	opacidad -= 0.02;
	
	if(document.all && !window.opera)
		contenedor.style.filter = "alpha(opacity=" + opacidad * 100 + ")";
	else if(window.opera)
		contenedor.style.opacity = opacidad;
	else
		contenedor.style.MozOpacity = opacidad;
	
	if(opacidad <= 0)
	{
		clearInterval(cambiar);
		if(visible == 1)
		{
			element_IMG_1.style.zIndex = 10;
			element_IMG_2.style.zIndex = 30;
			//element_IMG_3.style.zIndex = 20;
			if(document.all && !window.opera)
				element_IMG_1.style.filter = "alpha(opacity=100)";
			else if(window.opera)
				element_IMG_1.style.opacity = 1;
			else
				element_IMG_1.style.MozOpacity = 1;
			
			visible = 2;
			opacidad = 1;
			
			goROTATIVO = setInterval("cambio()", 4000);
		}
		else
		{
			element_IMG_2.style.zIndex = 10;
			//element_IMG_3.style.zIndex = 30;
			element_IMG_1.style.zIndex = 20;
			if(document.all && !window.opera)
				element_IMG_2.style.filter = "alpha(opacity=100)";
			else if(window.opera)
				element_IMG_2.style.opacity = 1;
			else
				element_IMG_2.style.MozOpacity = 1;
			
			visible = 1;
			opacidad = 1;
			
			goROTATIVO = setInterval("cambio()", 4000);
		}	
/*		else if(visible == 2)
		{
			element_IMG_2.style.zIndex = 10;
			element_IMG_3.style.zIndex = 30;
			element_IMG_1.style.zIndex = 20;
			if(document.all && !window.opera)
				element_IMG_2.style.filter = "alpha(opacity=100)";
			else if(window.opera)
				element_IMG_2.style.opacity = 1;
			else
				element_IMG_2.style.MozOpacity = 1;
			
			visible = 3;
			opacidad = 1;
			
			goROTATIVO = setInterval("cambio()", 4000);
		}
		else
		{
			element_IMG_3.style.zIndex = 10;
			element_IMG_1.style.zIndex = 30;
			element_IMG_2.style.zIndex = 20;
			if(document.all && !window.opera)
				element_IMG_3.style.filter = "alpha(opacity=100)";
			else if(window.opera)
				element_IMG_3.style.opacity = 1;
			else
				element_IMG_3.style.MozOpacity = 1;
			
			visible = 1;
			opacidad = 1;
			
			goROTATIVO = setInterval("cambio()", 4000);
		}*/
	}
}

// Función para abrir popups //
function wOpen(ruta,target,w,h,atributos){
	var ancho = w;
	var alto = h;
	var top = (screen.height/2) - (alto/2+40);
	var left = (screen.width/2) - (ancho/2);
	
	if(w!=""){
		if(atributos!=""){
			window.open(ruta,target,"width=" + w + ",height=" + h + ",left=" + left + ",top=" + top + "," + atributos);
		}
		else{
			window.open(ruta,target,"width=" + w + ",height=" + h + ",left=" + left + ",top=" + top);
		}
	}
	else{
		window.open(ruta,target)
	}
}






// Mostrar/ocultar productos //
var visible;
visible = "";
function mostrar(obj){
	if(visible != "") 
		visible.style.display = "none";
		document.getElementById(obj).style.display = "block";
		visible = document.getElementById(obj);
		window.scroll(0,2000); // horizontal y vertical 


}


