﻿<!-- Envío MAIL de contacto -->

	function sendRequestContacto() {
		// loading gif
		document.getElementById("respuesta_contacto").innerHTML = '<div style="margin:10px; padding:0;width:100%; text-align:center"><img src="img/loader.gif" border="0" /></div>';
		
		var formulario1 =document.getElementById("form_contacto");
		var myConn = new XHConn();
    	if (!myConn) alert("XMLHTTP no esta disponible. Inténtalo con un navegador más actual.");
		
	    var peticion = function (oXML) { 
		  if (oXML.responseText.match('OK')) {
			document.getElementById("respuesta_contacto").innerHTML =  '<div style="margin:10px; padding:0;width:100%; text-align:center"><span style="color:#fff; font-size:11px; font-weight:bold; text-decoration:none;">Mensaje enviado correctamente.<br />En breve nos pondremos en contacto contigo.</span><br /></div><br /><br />';
			 // si ha ido OK, limpianos el formulario
			 formulario1.reset();
			 
		  }
		  else {
			document.getElementById("respuesta_contacto").innerHTML =  '<div style="margin:10px; padding:0;width:100%; text-align:center"><span style="color:#990000; font-size:11px; font-weight:bold; text-decoration:none;">Ha habido problemas con el envío.<br /></span><span style="color:#fff; font-size:11px; font-weight:bold; text-decoration:none;">Vuelve a intentarlo y si continua el error pónte en contacto con el administrador.</span><br /></div><br /><br />';
		  }	
		 
		};
		
		myConn.connect("mail.php", "POST", "tipo_contacto="+formulario1.tipo_contacto.value+"&nom_cognoms="+formulario1.nom_cognoms.value+"&telf="+formulario1.telf.value+"&email="+formulario1.email.value+"&comentaris="+formulario1.comentaris.value, peticion);	 
	}


	function sendRequestSolicitud(req)
	{
	   // loading gif
		document.getElementById("respuesta_contacto").innerHTML = '<div style="margin:10px; padding:0;width:100%; text-align:center"><img src="img/loader.gif" border="0" /></div>';
		
		
		//alert(document.getElementById("form_informacion").telf.value);

		var formulario1 =document.getElementById("form_informacion");
		var myConn = new XHConn();
    	if (!myConn) alert("XMLHTTP no esta disponible. Inténtalo con un navegador más actual.");
		
	    var peticion = function (oXML) { 
		  if (oXML.responseText.match('OK')) {
			document.getElementById("respuesta_contacto").innerHTML =  '<div style="margin:10px; padding:0;width:100%; text-align:center"><span style="color:#fff; font-size:11px; font-weight:bold; text-decoration:none;">Mensaje enviado correctamente.<br />En breve nos pondremos en contacto contigo.</span><br /></div>';
			 // si ha ido OK, limpianos el formulario
			 formulario1.reset();
			 
		  }
		  else {
			document.getElementById("respuesta_contacto").innerHTML =  '<div style="margin:10px; padding:0;width:100%; text-align:center"><span style="color:#990000; font-size:11px; font-weight:bold; text-decoration:none;">Ha habido problemas con el envío.<br /></span><span style="color:#fff; font-size:11px; font-weight:bold; text-decoration:none;">Vuelve a intentarlo y si continua el error pónte en contacto con el administrador.</span><br /></div>';
		  }	
		 
		};
		
		myConn.connect("mail.php", "POST", "tipo_contacto="+formulario1.tipo_contacto.value+ "&datos_producto="+ formulario1.datos_producto.value +"&nom_cognoms="+formulario1.nom_cognoms.value+"&telf="+formulario1.telf.value+"&email="+formulario1.email.value+"&comentaris="+formulario1.comentaris.value, peticion);	   
		
	}

