/* AJAX */
	var xmlhttp
	var ids = ["Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0",
	  "Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP",
	  "Microsoft.XMLHTTP"];

	for(var i=0; !xmlhttp && i<ids.length; i++) {
		try { xmlhttp = new ActiveXObject(ids[i]); }
		catch(ex) { xmlhttp = false; }
	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	  xmlhttp = new XMLHttpRequest();
	}

/* CARGA LA PÁGINA EN LA ZONA CENTRAL */
	function cargaPag(fichero){
		if(fichero!=""){
			xmlhttp.open('POST',fichero,false);
			xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');

			xmlhttp.send();

			if (xmlhttp.readyState==4) {
				resp = xmlhttp.responseText;
				document.getElementById('CCZmain').innerHTML = resp;
			}
		}
	}

/* ENVIO DE CORREOS */
	function enviar(){
		if ((form1.nombre.value=="") || (form1.email.value=="")) {
			alert("Por favor, introduce el nombre y el email para poder procesar tu mensaje.");
		}else{
			var email=form1.email.value;
			var arroba=email.indexOf('@');
			if(arroba>0) {
				arroba=arroba+1;
				if( (email.indexOf('@',arroba)==-1) && (email.indexOf('.',arroba)>1)) {
					xmlhttp.open('POST','CCZ_00Correo.asp',false);
					xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');

					xmlhttp.send("empresa=" + escape(form1.empresa.value) +
								 "&nombre=" + escape(form1.nombre.value) +
								 "&direccion=" + escape(form1.direccion.value) +
								 "&localidad=" + escape(form1.localidad.value) +
								 "&codigop=" + escape(form1.codigop.value) +
								 "&provincia=" + escape(form1.provincia.value) +
								 "&email=" + escape(form1.email.value) +
								 "&telefono=" + escape(form1.telefono.value) +
								 "&fax=" + escape(form1.fax.value) +
								 "&comentarios=" + escape(form1.comentarios.value));

					if (xmlhttp.readyState==4) {
						resp = xmlhttp.responseText;
						document.getElementById('CCZmain').innerHTML = resp;
					}
				}else{
					alert("La dirección email es incorrecta.");
				}
			}else{
				alert("La dirección email es incorrecta.");
			}
		}
	}

/* MENÚ */

	var imagesMenHor = new Array("IMG/0menHorFondo.gif","IMG/0menHorFondoON.gif","IMG/0menHorFondoACT.gif");
	var imgMenHor = new Array();

	var menHor = new Array();
	menHor[0]=false;menHor[1]=false;menHor[2]=false;

	var imagesMenVer = new Array("IMG/1menVerOpc00.jpg","IMG/1menVerOpc00ON.jpg","IMG/1menVerOpc00ACT.jpg",
								 "IMG/1menVerOpc01.jpg","IMG/1menVerOpc01ON.jpg","IMG/1menVerOpc01ACT.jpg",
								 "IMG/1menVerOpc02.jpg","IMG/1menVerOpc02ON.jpg","IMG/1menVerOpc02ACT.jpg",
								 "IMG/1menVerOpc03.jpg","IMG/1menVerOpc03ON.jpg","IMG/1menVerOpc03ACT.jpg"
								 );
	var imgMenVer = new Array();

	var menVer = new Array();
	menVer[0]=false;menVer[1]=false;menVer[2]=false;menVer[3]=false;

	var sMenVer = new Array();
	sMenVer[0]=false;sMenVer[1]=false;sMenVer[2]=false;sMenVer[3]=false;sMenVer[4]=false;sMenVer[5]=false;

/* SubMenu Canalones*/
	sMV00 = '					<TABLE CELLSPACING=0 CELLPADDING=0 border=0 style="width:100%;">\n';
	sMV00 += '							<TR><TD style="height:2px;background:#000000"></TD></TR>\n';
	sMV00 += '							<TR><TD id="mSV00" class="0sMenVer" onmouseover="onSMenVer(this,0);" onmouseout="outSMenVer(this,0);" onclick="clickSMenVer(this,0);">Evacuaci&oacute;n de aguas pluviales</TD></TR>\n';
	sMV00 += '							<TR><TD id="mSV01" class="0sMenVer" onmouseover="onSMenVer(this,1);" onmouseout="outSMenVer(this,1);" onclick="clickSMenVer(this,1);">Desarrollos canal&oacute;n y bajante</TD></TR>\n';
	sMV00 += '							<TR><TD id="mSV02" class="0sMenVer" onmouseover="onSMenVer(this,2);" onmouseout="outSMenVer(this,2);" onclick="clickSMenVer(this,2);">Montaje</TD></TR>\n';
	sMV00 += '							<TR><TD><A id="mSV03" class="0sMenVer" onmouseover="onSMenVer(this,3);" onmouseout="outSMenVer(this,3);" HREF="CCZ_00Catalogo.pdf" TARGET="_blank" style="text-decoration:none;color:#000000;width:173px;padding-top:2px">';
	sMV00 += 'Cat&aacute;logo (PDF - 7,16 Mb)</A></TD></TR>\n';
	sMV00 += '							<TR><TD style="height:1px;background:#FFFFFF"></TD></TR>\n';
	sMV00 += '							<TR><TD style="height:1px;background:#666666"></TD></TR>\n';
	sMV00 += '						</TABLE>\n';

/* SubMenu Paneles*/
	sMV02 = '					<TABLE CELLSPACING=0 CELLPADDING=0 border=0 style="width:100%;">\n';
	sMV02 += '							<TR><TD style="height:2px;background:#000000"></TD></TR>\n';
	sMV02 += '							<TR><TD id="mSV04" class="0sMenVer" onmouseover="onSMenVer(this,4);" onmouseout="outSMenVer(this,4);" onclick="clickSMenVer(this,4);">Caracter&iacute;sticas t&eacute;cnicas</TD></TR>\n';
	sMV02 += '							<TR><TD id="mSV05" class="0sMenVer" onmouseover="onSMenVer(this,5);" onmouseout="outSMenVer(this,5);" onclick="clickSMenVer(this,5);">Detalles construc. y montaje</TD></TR>\n';
	sMV02 += '							<TR><TD style="height:1px;background:#FFFFFF"></TD></TR>\n';
	sMV02 += '							<TR><TD style="height:1px;background:#666666"></TD></TR>\n';
	sMV02 += '						</TABLE>\n';

	function cargarimagenes(){
		var i=0;
		for(i in imagesMenHor){
			imgMenHor[i] = new Image();
			imgMenHor[i].src = imagesMenHor[i];
		}
		for(i in imagesMenVer){
			imgMenVer[i] = new Image();
			imgMenVer[i].src = imagesMenVer[i];
		}
	}

/* JS - MENU HORIIZONTAL */
	function onMenHor(opcion,ind){
		if(!menHor[ind]){
			with(opcion){
				background = imgMenHor[1].src;
				style.color = "#FFFFFF";
				style.fontWeight="normal";
			}
		}
	}
	function outMenHor(opcion,ind){
		if(!menHor[ind]){
			with(opcion){
				background = imgMenHor[0].src;
				style.color = "#333333";
				style.fontWeight="normal";
			}
		}
	}
	function clickMenHor(opcion,ind){
		//if(!menHor[eval(ind)]){
			switch(eval(ind)){
				case 0: cargaPag("CCZ_01Quienes.asp");
						break;
				case 1: cargaPag("CCZ_02Contacto.asp");
						break;
				case 2: cargaPag("CCZ_03Obras.asp");
						break;
			}

			limpiarMenHor();
			limpiarMenVer();
			with(opcion){
				background = imgMenHor[2].src;
				style.color="#FFFFFF";
				style.fontWeight="bold";
			}
			menHor[ind] = true;
		//}
	}
	function limpiarMenHor(){
		if(menHor[0] || menHor[1] || menHor[2]){
			for(i=0;i<3;i++){
				menHor[i]=false;
				outMenHor(document.getElementById("mH0" + i));
			}
		}
	}

/* JS - MENU VERTICAL */
	function onMenVer(opcion,ind){
		if(!menVer[eval(ind)]){
			opcion.src=imgMenVer[3*eval(ind)+1].src;
		}
	}
	function outMenVer(opcion,ind){
		if(opcion != undefined)
			if(!menVer[eval(ind)]){
				opcion.src=imgMenVer[3*eval(ind)].src;
			}
	}
	function clickMenVer(opcion,ind){
//		if(!menVer[eval(ind)]){
			limpiarMenVer();
			if(ind>0) limpiarMenHor();
			switch(eval(ind)){
				case 0: document.getElementById("sMV00").innerHTML = sMV00;
						break;
				case 1: cargaPag("CCZ_20Ventanas.asp");
						break;
				case 2: cargaPag("CCZ_30Paneles.asp")
						document.getElementById("sMV02").innerHTML = sMV02;
						break;
				case 3: cargaPag("CCZ_40Cubiertas.asp");
						break;
			}
			opcion.src=imgMenVer[3*eval(ind)+2].src;
			menVer[ind]=true;

//		}
	}
	function limpiarMenVer(){
		if(menVer[0] || menVer[1] || menVer[2] || menVer[3]){
			for(i=0;i<menVer.length;i++){
				menVer[i]=false;
				outMenVer(document.getElementById("mV0" + i),i);
			}
			document.getElementById("sMV00").innerHTML = "";
			document.getElementById("sMV02").innerHTML = "";
		}
		limpiarSMenVer();
	}
/* JS - subMENU VERTICAL */
	function onSMenVer(opcion,ind){
		if(!sMenVer[eval(ind)]){
			with(opcion.style){
				background = "#B32D1C";
				color = "#FFFFFF";
			}
		}
	}
	function outSMenVer(opcion,ind){
		if(opcion != undefined)
			if(!sMenVer[eval(ind)]){
				with(opcion.style){
					background = "#FEF0E1";
					color = "#000000";
				}
			}
	}
	function clickSMenVer(opcion,ind){
		if(!sMenVer[eval(ind)]){
			limpiarMenHor();
			limpiarSMenVer();

			switch(eval(ind)){
				case 0: cargaPag("CCZ_11CanalEvacuacion.asp");
						break;
				case 1: cargaPag("CCZ_12CanalBajantes.asp");
						break;
				case 2: cargaPag("CCZ_13CanalMontaje.asp");
						break;
				case 3: //window.open('CCZ_00Catalogo.pdf','Catalogo','');
						break;
				case 4: cargaPag("CCZ_31PanelCaract.asp");
						break;
				case 5: cargaPag("CCZ_32PanelDetalle.asp");
						break;
			}
			with(opcion.style){
				background = "#444444";
				color = "#FFFFFF";
			}
			sMenVer[ind]=true;

		}
	}
	function limpiarSMenVer(){
		if(sMenVer[0] || sMenVer[1] || sMenVer[2] || sMenVer[3] || sMenVer[4] || sMenVer[5]){
			for(i=0;i<sMenVer.length;i++){
				sMenVer[i]=false;
				outSMenVer(document.getElementById("mSV0" + i),i);
			}
		}
	}

/* ABRE UN POPUP CON UNA IMAGEN*/
function abrirPopUp(titulo,imagen) {
    open("CCZ_90PopupFoto.asp?Titulo=" + titulo + "&Imagen=" + imagen, "popUp", "toolbar=no,directories=no,menubar=no,status=no");
}