// JavaScript Document
function cargar(opcion) {
<!--	
switch (opcion) {
 	case 1:
	 with(document.images) {
	     jul.src = "../img/gif/fot_act.gif";
		 agos.src = "../img/gif/fot_02_EvolProj.gif";
		 sept.src = "../img/gif/fot_03_EvolProj.gif";
     }
	document.cargarS.location.href = "../img/swf/eprojectes/jul.htm";
	break;
	case 2:
	 with(document.images) {
	     jul.src = "../img/gif/fot_01_EvolProj.gif";
		 agos.src = "../img/gif/fot_act.gif";
		 sept.src = "../img/gif/fot_03_EvolProj.gif";
    }
	document.cargarS.location.href  = "../img/swf/eprojectes/ago.htm";
	//alert(document.iframe[0].);
	break;
	case 3:
	 with(document.images) {
	     jul.src = "../img/gif/fot_01_EvolProj.gif";
		 agos.src =  "../img/gif/fot_02_EvolProj.gif";
		 sept.src = "../img/gif/fot_act.gif";
    }
    document.cargarS.location.href = "../img/swf/eprojectes/set.htm"; 
	break;
  }
}	

// funcin transformaci
function transf(num) {
	var texto;
	switch(num) {
	  case 1:
	  document.images.imgSector.src = "../img/gif/titSectorCostaA_1.gif"
	  texto = "<p class='TextoNaranja'>Entre el carrer perllongaci&oacute; de Cervantes, Sant Ignasi de Loiola, el mar i el carrer Ind&uacute;stria. Conegut com el sector Campsa.<br>"
      texto += "La proposta consisteix a transformar l&rsquo;&uacute;s industrial en residencial, incorporant nous equipaments i zones verdes i resolent el degradat entorn costaner i enlla&ccedil;ar-lo amb el nou passeig mar&iacute;tim. Tamb&eacute; es vol reduir l&rsquo;impacte del pas del ferrocarril.<br>"
      texto += "La idea principal &eacute;s obrir les visuals de tots els carrers perpendiculars al mar, configurar la perllongaci&oacute; del passeig mar&iacute;tim i de l&rsquo;avinguda Eduard Maristany.<br>"
      texto += "Hi ha tres zones verdes importants. Una davant de l&rsquo;edifici de la Llauna, al costat de l&rsquo;edifici de l&rsquo;An&iacute;s del Mono i connectada al pont del petroli. L&rsquo;altra, al costat de l&rsquo;edifici de la Caci i connectada amb la tercera a trav&eacute;s d&rsquo;un pont que travessa la via del tren.<br>"
      texto +="L&rsquo;edificabilitat est&agrave; configurada a... En aquesta &agrave;rea hi ha diferents elements singulars preservats: l &rsquo;edifici de la f&agrave;brica d&rsquo;An&iacute;s del Mono, l&rsquo;edifici de la Caci, l&rsquo;edifici de la Llauna, i el pont del petroli.</p>"
	  
	  document.getElementById("capa1").innerHTML = texto;
	  break;
	  
	  case 2:
	  document.images.imgSector.src = "../img/gif/titSectorCostaA_2.gif";
	  texto = "<p class='TextoNaranja'>Entre el carrer de la Mar J&ograve;nica i la perllongaci&oacute; del carrer Cervantes, el mar i una franja del barri del Gorg delimitada pels carrers Ponent, Antoni Bori i l&rsquo;avinguda Marqu&eacute;s de Montroig. &Eacute;s el sector Port de Badalona. El disseny d&rsquo;aquest port supera la intervenci&oacute; a&iuml;llada, &eacute;s un port de ciutat. Aquest disseny es comen&ccedil;a "
	  texto += "a perfilar l&rsquo;any 1987, a partir d&rsquo;un concurs d&rsquo;idees que guanya M. De Sol&agrave; Morales, que conven&ccedil; per la forma i l&rsquo;escassa modificaci&oacute; del litoral. L&rsquo;empla&ccedil;ament elegit permet consolidar l&rsquo;eix urb&agrave; del Tur&oacute; de&rsquo;n Carig &ndash;on encara s&rsquo;havia de construir el Pavell&oacute; Ol&iacute;mpic Municipal- i imprimeix car&agrave;cter urb&agrave; a la d&agrave;rsena, transformant i regenerant l&rsquo;espai ocupat per la Cros. La proposta complementa l&rsquo;oferta de centralitat al voltant del carrer de Mar"      
	  texto += " i la Rambla &ndash;en planifica l&rsquo;acc&eacute;s directe- i fa permeables tots els barris de muntanya a mar. Des del juliol de 2000 &ndash;a partir d&rsquo;una decisi&oacute; del Consell d&rsquo;Administraci&oacute;- la construcci&oacute; del Port est&agrave; estructurada en dues fases: la primera fase va de la via del tren fins al mar i la segona t&eacute; com a eix la construcci&oacute; del canal.</p>"
	   document.getElementById("capa1").innerHTML = texto;
	  break;
	  
	case 3:
	 document.images.imgSector.src = "../img/gif/titSectorCostaA_3.gif";
	 texto = "<p class='TextoNaranja'>Entre el carrer perllongaci&oacute; de Cervantes, Sant Ignasi de Loiola, el mar i el carrer Ind&uacute;stria. Conegut com el sector Campsa.<br>"
     texto += "La proposta consisteix a transformar l&rsquo;&uacute;s industrial en residencial, incorporant nous equipaments i zones verdes i resolent el degradat entorn costaner i enlla&ccedil;ar-lo amb el nou passeig mar&iacute;tim. Tamb&eacute; es vol reduir l&rsquo;impacte del pas del ferrocarril.<br>"
     texto += "La idea principal &eacute;s obrir les visuals de tots els carrers perpendiculars al mar, configurar la perllongaci&oacute; del passeig mar&iacute;tim i de l&rsquo;avinguda Eduard Maristany.<br>"
     texto += "Hi ha tres zones verdes importants. Una davant de l&rsquo;edifici de la Llauna, al costat de l&rsquo;edifici de l&rsquo;An&iacute;s del Mono i connectada al pont del petroli. L&rsquo;altra, al costat de l&rsquo;edifici de la Caci i connectada amb la tercera a trav&eacute;s d&rsquo;un pont que travessa la via del tren.<br>"
     texto += "L&rsquo;edificabilitat est&agrave; configurada a ....<br>"
     texto += "En aquesta &agrave;rea hi ha diferents elements singulars preservats: l &rsquo;edifici de la f&agrave;brica d&rsquo;An&iacute;s del Mono, l&rsquo;edifici de la Caci, l&rsquo;edifici de la Llauna, i el pont del petroli.</p>"
	 document.getElementById("capa1").innerHTML = texto;
	 break;

	}
}

function imgGuiaMas(imag, array) {
 fotoActual = eval("document.images."+imag+".src");
 fotoActual = fotoActual.substring(fotoActual.lastIndexOf("/")+1,fotoActual.length);
 conjFotos = array.split(",");
 totalImg = conjFotos.length;
 
 for (i=0;i<totalImg;i++) {
	 if (fotoActual == conjFotos[i]) {
		 if (i!=totalImg) {
			 eval("document.images."+imag+".src = '../upload/" + conjFotos[i+1]+"';");
		 } else { 
		     eval("document.images."+imag+".src = '../upload/" + conjFotos[0]+"';");
		 }
	  }
  }	
}

function imgGuiaMen(imag, array) {
 fotoActual = eval("document.images."+imag+".src");
 fotoActual = fotoActual.substring(fotoActual.lastIndexOf("/")+1,fotoActual.length);
 conjFotos = array.split(",");
 totalImg = conjFotos.length;
 
 for (i=0;i<totalImg;i++) {
	 if (fotoActual == conjFotos[i]) {
		 if (i!=0) {
			
			 eval("document.images."+imag+".src = '../upload/" + conjFotos[i-1]+"';");
		 } else { 
		
		     eval("document.images."+imag+".src = '../upload/" + conjFotos[0]+"';");
		 }
	  }
  }
}
//-->	

function validarForm() 
{ 
	var resultat;
	var args = validarForm.arguments;
	var obligatori=false
	if (((args.length-1) % 4)!=0) resultat = false;
	else
	{
		var i=1;
		var error = "";
		var val;
		var obj = "";
		while(i<args.length)
		{
			var obligatori = (args[i+3].indexOf('R')!=-1);			

			if ((args[i+2] != "S")&&(args[i+2] != "D")&&(args[i+2] != "CB"))
				val = eval('document.' + args[0] + '.' + args[i] + '.value');
			res = 0;
			if ((args[i+2] == "T") && obligatori) error += comprovarText(val,args[i+1]);
			if ((args[i+2] == "AR") && obligatori) error += comprovarArticulo(val,args[i+1]);
			if (args[i+2] == "CK") error += comprovarCheck(args[0],args[i], txtCheck);
			if (args[i+2] == "F") error += comprovarExtension(args[0],args[i],args[i],args[i+1],obligatori);
			if (args[i+2] == "N") error += comprovarNumero(val,args[i+1],obligatori);
			if (args[i+2] == "E") error += comprovarEmail(val,args[i+1],obligatori);
			if (args[i+2] == "D") error += comprovarFecha(args[0],args[i],args[i+1],args[i+3]);
			if (args[i+2] == "S") error += comprovarSelect(args[0],args[i],args[i+1],args[i+3]);
			if (args[i+2] == "CB") error += comprovarCheckBox(args[0], args[i],args[i+1]);
			
			i=i+4;
		}
		if(error!="")
		{
		 alert(textoInicioFrase
			+ error
			+ textoFinalFrase);
		}
		resultat = (error=="");
	}
	return resultat;
}

function comprovarText(pText, ptextoCampo)
{
	if (pText == "")  return(textoObligatorio.replace("#nombre#", ptextoCampo));
	else	return "";
}

function comprovarNumero(pNumero,ptextoCampo, pObligatori)
{
	var error="";
	if ((pNumero == "") && pObligatori) return(textoObligatorio.replace("#nombre#", ptextoCampo));
	if (pNumero != "")
	{
		if (isNaN(pNumero)) return(textoIncorrecto.replace("#nombre#", ptextoCampo));	
	}
	return error;
}

function comprovarEmail(pEmail, ptextoCampo, pObligatori)
{
	var error = "";
	if ((pEmail =="") && (pObligatori))
		return(textoObligatorio.replace("#nombre#", ptextoCampo));
	if (pEmail !="")
	{ 
  var arroba = pEmail.indexOf('@');
  var punt = pEmail.indexOf('.',arroba);
  if ((arroba<1) || (punt<1) || (arroba==(pEmail.length-1)) || (punt==(pEmail.length-1)) || (punt<arroba))
		return(textoIncorrecto.replace("#nombre#", ptextoCampo));	
	}	
	return error;
}

function comprovarCheckBox(pNomForm, pNomCamp, ptextoCampo)
{
	var campo = eval('document.' + pNomForm + '.' + pNomCamp);
	if(campo.checked==false)
 	 return (textoObligatorio.replace("#nombre#", ptextoCampo))
	else
	 return "";
}

function envioMail(){
	var t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, contenedor;

	condicionsGenerals = document.getElementById('condicionsGenerals').checked;
	
	if (condicionsGenerals == true){
		
		var res = validarForm("fReserves",
			"nom","Nom","T","R",
			"eslora","Eslora","T","R",
			"manega","Manega","T","R",
			"nomPropietari","Nom propietari","T","R",
			"telefon","Telfon","T","R",
			"email","Correu electrnic","E","R",
			"dataEntrada","Data entrada","T","R",
			"dataSortida","Data sortida","T","R"
		);

		if (res){
			//document.fRegistrar.submit();

			t1 = document.getElementById('nom').value;
			t2 = document.getElementById('matricula').value;
			t3 = document.getElementById('eslora').value;
			t4 = document.getElementById('manega').value;
			t5 = document.getElementById('calat').value;
			t6 = document.getElementById('nomPropietari').value;
			t7 = document.getElementById('telefon').value;
			t8 = document.getElementById('email').value;
			t9 = document.getElementById('dataEntrada').value;
			t10 = document.getElementById('dataSortida').value;
			ajax=nuevoAjax();
			ajax.open("POST", "reserves_Envio.php",true);
			ajax.onreadystatechange=function() {
				if (ajax.readyState==4) {
					alert("Datos enviados correctamente");
				}
			}
			ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			ajax.send("nom="+t1+"&matricula="+t2+"&eslora="+t3+"&manega="+t4+"&calat="+t5+"&nomPropietari="+t6+"&telefon="+t7+"&email="+t8+"&dataEntrada="+t9+"&dataSortida="+t10)
		}
	}else{
		alert("s obligatori aceptar les condicions generals de contractaci");
	}
}

function envioMailDemanarInfo(){

		var res = validarForm("fDemanarInfo",
			"nom","Nombre","T","R",
			"correuMail","Email","E","R"
		);

		if (res){
			//document.fDemanarInfo.submit();

			t1 = document.getElementById('tracte').value;
			t2 = document.getElementById('nom').value;
			t3 = document.getElementById('cognom').value;
			t4 = document.getElementById('cognom2').value;
			t5 = document.getElementById('adreca').value;
			t6 = document.getElementById('poblacio').value;
			t7 = document.getElementById('codi').value;
			t8 = document.getElementById('telefon').value;
			t9 = document.getElementById('fax').value;
			t10 = document.getElementById('correuMail').value;
			t11 = document.getElementById('nomEmp').value;
			t12 = document.getElementById('adrecaEmp').value;
			t13 = document.getElementById('poblacioEmp').value;
			t14 = document.getElementById('codiEmp').value;
			t15 = document.getElementById('telefonEmp').value;
			t16 = document.getElementById('faxEmp').value;
			t17 = document.getElementById('emailEmp').value;
			t18 = document.getElementById('amarrador').value;
			t19 = document.getElementById('aparcament').value;
			t20 = document.getElementById('pallol').value;
			t21 = document.getElementById('garatge').value;
			t22 = document.getElementById('Local').value;
			t23 = document.getElementById('Modalitat').value;
			t24 = document.getElementById('tipus').value;
			alert(t24);
			t25 = document.getElementById('activitats').value;

			ajax=nuevoAjax();
			ajax.open("POST", "demanarInfo_Envio.php",true);
			ajax.onreadystatechange=function() {
				if (ajax.readyState==4) {
					alert("El seu formulari s'ha enviat correctament\nEn breu ens posarem en contacte.");

					document.getElementById('tracte').value = "";
					document.getElementById('nom').value = "";
					document.getElementById('cognom').value = "";
					document.getElementById('cognom2').value = "";
					document.getElementById('adreca').value = "";
					document.getElementById('poblacio').value = "";
					document.getElementById('codi').value = "";
					document.getElementById('telefon').value = "";
					document.getElementById('fax').value = "";
					document.getElementById('correuMail').value = "";
					document.getElementById('nomEmp').value = "";
					document.getElementById('adrecaEmp').value = "";
					document.getElementById('poblacioEmp').value = "";
					document.getElementById('codiEmp').value = "";
					document.getElementById('telefonEmp').value = "";
					document.getElementById('faxEmp').value = "";
					document.getElementById('emailEmp').value = "";
					document.getElementById('amarrador').checked = 0;
					document.getElementById('aparcament').checked = 0;
					document.getElementById('pallol').checked = 0;
					document.getElementById('garatge').checked = 0;
					document.getElementById('Local').checked = 0;
						var aItems = document.getElementsByName("Modalitat");
						for (var i = 0; i < aItems.length; i++){
							aItems[i].checked = false;
						}
						var aItems = document.getElementsByName("tipus");
						for (var i = 0; i < aItems.length; i++){
							aItems[i].checked = false;
						}
					document.getElementById('activitats').value = "";
				}
			}
			ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			ajax.send("tracte="+t1+"&nom="+t2+"&cognom="+t3+"&cognom2="+t4+"&adreca="+t5+"&poblacio="+t6+"&codi="+t7+"&telefon="+t8+"&fax="+t9+"&correuMail="+t10+"&nomEmp="+t11+"&adrecaEmp="+t12+"&poblacioEmp="+t13+"&codiEmp="+t14+"&telefonEmp="+t15+"&faxEmp="+t16+"&emailEmp="+t17+"&amarrador="+t18+"&aparcament="+t19+"&pallol="+t20+"&garatge="+t21+"&Local="+t22+"&Modalitat="+t23+"&tipus="+t24+"&activitats="+t25)
		}
}

function envioMailDemanarInfo_Cast(){

		var res = validarForm("fDemanarInfo",
			"nom","Nombre","T","R",
			"correuMail","Email","E","R"
		);

		if (res){
			//document.fDemanarInfo.submit();

			t1 = document.getElementById('tracte').value;
			t2 = document.getElementById('nom').value;
			t3 = document.getElementById('cognom').value;
			t4 = document.getElementById('cognom2').value;
			t5 = document.getElementById('adreca').value;
			t6 = document.getElementById('poblacio').value;
			t7 = document.getElementById('codi').value;
			t8 = document.getElementById('telefon').value;
			t9 = document.getElementById('fax').value;
			t10 = document.getElementById('correuMail').value;
			t11 = document.getElementById('nomEmp').value;
			t12 = document.getElementById('adrecaEmp').value;
			t13 = document.getElementById('poblacioEmp').value;
			t14 = document.getElementById('codiEmp').value;
			t15 = document.getElementById('telefonEmp').value;
			t16 = document.getElementById('faxEmp').value;
			t17 = document.getElementById('emailEmp').value;
			t18 = document.getElementById('amarrador').value;
			t19 = document.getElementById('aparcament').value;
			t20 = document.getElementById('pallol').value;
			t21 = document.getElementById('garatge').value;
			t22 = document.getElementById('Local').value;
			t23 = document.getElementById('Modalitat').value;
			t24 = document.getElementById('tipus').value;
			t25 = document.getElementById('activitats').value;

			ajax=nuevoAjax();
			ajax.open("POST", "demanarInfo_Envio.php",true);
			ajax.onreadystatechange=function() {
				if (ajax.readyState==4) {
					alert("Su formulario se ha enviado correctamente.\nEn breve nos pondremos en contacto.");

						document.getElementById('tracte').value = "";
						document.getElementById('nom').value = "";
						document.getElementById('cognom').value = "";
						document.getElementById('cognom2').value = "";
						document.getElementById('adreca').value = "";
						document.getElementById('poblacio').value = "";
						document.getElementById('codi').value = "";
						document.getElementById('telefon').value = "";
						document.getElementById('fax').value = "";
						document.getElementById('correuMail').value = "";
						document.getElementById('nomEmp').value = "";
						document.getElementById('adrecaEmp').value = "";
						document.getElementById('poblacioEmp').value = "";
						document.getElementById('codiEmp').value = "";
						document.getElementById('telefonEmp').value = "";
						document.getElementById('faxEmp').value = "";
						document.getElementById('emailEmp').value = "";
						document.getElementById('amarrador').checked = 0;
						document.getElementById('aparcament').checked = 0;
						document.getElementById('pallol').checked = 0;
						document.getElementById('garatge').checked = 0;
						document.getElementById('Local').checked = 0;
							var aItems = document.getElementsByName("Modalitat");
							for (var i = 0; i < aItems.length; i++){
								aItems[i].checked = false;
							}
							var aItems = document.getElementsByName("tipus");
							for (var i = 0; i < aItems.length; i++){
								aItems[i].checked = false;
							}
						document.getElementById('activitats').value = "";
				}
			}
			ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			ajax.send("tracte="+t1+"&nom="+t2+"&cognom="+t3+"&cognom2="+t4+"&adreca="+t5+"&poblacio="+t6+"&codi="+t7+"&telefon="+t8+"&fax="+t9+"&correuMail="+t10+"&nomEmp="+t11+"&adrecaEmp="+t12+"&poblacioEmp="+t13+"&codiEmp="+t14+"&telefonEmp="+t15+"&faxEmp="+t16+"&emailEmp="+t17+"&amarrador="+t18+"&aparcament="+t19+"&pallol="+t20+"&garatge="+t21+"&Local="+t22+"&Modalitat="+t23+"&tipus="+t24+"&activitats="+t25)
		}
}

function envioMailDemanarInfo_Eng(){

		var res = validarForm("fDemanarInfo",
			"nom","Nombre","T","R",
			"correuMail","Email","E","R"
		);

		if (res){
			//document.fDemanarInfo.submit();

			t1 = document.getElementById('tracte').value;
			t2 = document.getElementById('nom').value;
			t3 = document.getElementById('cognom').value;
			t4 = document.getElementById('cognom2').value;
			t5 = document.getElementById('adreca').value;
			t6 = document.getElementById('poblacio').value;
			t7 = document.getElementById('codi').value;
			t8 = document.getElementById('telefon').value;
			t9 = document.getElementById('fax').value;
			t10 = document.getElementById('correuMail').value;
			t11 = document.getElementById('nomEmp').value;
			t12 = document.getElementById('adrecaEmp').value;
			t13 = document.getElementById('poblacioEmp').value;
			t14 = document.getElementById('codiEmp').value;
			t15 = document.getElementById('telefonEmp').value;
			t16 = document.getElementById('faxEmp').value;
			t17 = document.getElementById('emailEmp').value;
			t18 = document.getElementById('amarrador').value;
			t19 = document.getElementById('aparcament').value;
			t20 = document.getElementById('pallol').value;
			t21 = document.getElementById('garatge').value;
			t22 = document.getElementById('Local').value;
			t23 = document.getElementById('Modalitat').value;
			t24 = document.getElementById('tipus').value;
			t25 = document.getElementById('activitats').value;

			ajax=nuevoAjax();
			ajax.open("POST", "demanarInfo_Envio.php",true);
			ajax.onreadystatechange=function() {
				if (ajax.readyState==4) {
					alert("Your form was submitted successfully.");

						document.getElementById('tracte').value = "";
						document.getElementById('nom').value = "";
						document.getElementById('cognom').value = "";
						document.getElementById('cognom2').value = "";
						document.getElementById('adreca').value = "";
						document.getElementById('poblacio').value = "";
						document.getElementById('codi').value = "";
						document.getElementById('telefon').value = "";
						document.getElementById('fax').value = "";
						document.getElementById('correuMail').value = "";
						document.getElementById('nomEmp').value = "";
						document.getElementById('adrecaEmp').value = "";
						document.getElementById('poblacioEmp').value = "";
						document.getElementById('codiEmp').value = "";
						document.getElementById('telefonEmp').value = "";
						document.getElementById('faxEmp').value = "";
						document.getElementById('emailEmp').value = "";
						document.getElementById('amarrador').checked = 0;
						document.getElementById('aparcament').checked = 0;
						document.getElementById('pallol').checked = 0;
						document.getElementById('garatge').checked = 0;
						document.getElementById('Local').checked = 0;
							var aItems = document.getElementsByName("Modalitat");
							for (var i = 0; i < aItems.length; i++){
								aItems[i].checked = false;
							}
							var aItems = document.getElementsByName("tipus");
							for (var i = 0; i < aItems.length; i++){
								aItems[i].checked = false;
							}
						document.getElementById('activitats').value = "";
				}
			}
			ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			ajax.send("tracte="+t1+"&nom="+t2+"&cognom="+t3+"&cognom2="+t4+"&adreca="+t5+"&poblacio="+t6+"&codi="+t7+"&telefon="+t8+"&fax="+t9+"&correuMail="+t10+"&nomEmp="+t11+"&adrecaEmp="+t12+"&poblacioEmp="+t13+"&codiEmp="+t14+"&telefonEmp="+t15+"&faxEmp="+t16+"&emailEmp="+t17+"&amarrador="+t18+"&aparcament="+t19+"&pallol="+t20+"&garatge="+t21+"&Local="+t22+"&Modalitat="+t23+"&tipus="+t24+"&activitats="+t25)
		}
}


function envioQueVolsSaber_Cat(){

		var res = validarForm("fQueVolsSaber",
			"nom","Nom","T","R",
			"cognoms","Cognoms","T","R",
			"email","Correu electrònic","E","R",
			"telefon","Telèfon","T","R",
			"comentaris","Comentaris","T","R"			
		);

		if (res){
			//document.fDemanarInfo.submit();

			t1 = document.getElementById('nom').value;
			t2 = document.getElementById('cognoms').value;
			t3 = document.getElementById('email').value;
			t4 = document.getElementById('telefon').value;
			t5 = document.getElementById('comentaris').value;

			ajax=nuevoAjax();
			ajax.open("POST", "queVolSaber_Envio.php",true);
			ajax.onreadystatechange=function() {
				if (ajax.readyState==4) {
					alert("El seu formulari s'ha enviat correctament\nEn breu ens posarem en contacte.");

						document.getElementById('nom').value = "";
						document.getElementById('cognoms').value = "";
						document.getElementById('email').value = "";
						document.getElementById('telefon').value = "";
						document.getElementById('comentaris').value = "";
				}
			}
			ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			ajax.send("nom="+t1+"&cognoms="+t2+"&email="+t3+"&telefon="+t4+"&comentaris="+t5)
		}
}

function envioQueVolsSaber_Cast(){

		var res = validarForm("fQueVolsSaber",
			"nom","Nombre","T","R",
			"cognoms","Apellidos","T","R",
			"email","Correo electrónico","E","R",
			"telefon","Teléfono","T","R",
			"comentaris","Comentarios","T","R"			
		);

		if (res){
			//document.fDemanarInfo.submit();

			t1 = document.getElementById('nom').value;
			t2 = document.getElementById('cognoms').value;
			t3 = document.getElementById('email').value;
			t4 = document.getElementById('telefon').value;
			t5 = document.getElementById('comentaris').value;

			ajax=nuevoAjax();
			ajax.open("POST", "queVolSaber_Envio.php",true);
			ajax.onreadystatechange=function() {
				if (ajax.readyState==4) {
					alert("Su formulario se ha enviado correctamente.\nEn breve nos pondremos en contacto.");

						document.getElementById('nom').value = "";
						document.getElementById('cognoms').value = "";
						document.getElementById('email').value = "";
						document.getElementById('telefon').value = "";
						document.getElementById('comentaris').value = "";
				}
			}
			ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			ajax.send("nom="+t1+"&cognoms="+t2+"&email="+t3+"&telefon="+t4+"&comentaris="+t5)
		}
}

function envioQueVolsSaber_Eng(){

		var res = validarForm("fQueVolsSaber",
			"nom","Name","T","R",
			"cognoms","Surnames","T","R",
			"email","Your E-mail","E","R",
			"telefon","Telephone","T","R",
			"comentaris","Commemts","T","R"			
		);

		if (res){
			//document.fDemanarInfo.submit();

			t1 = document.getElementById('nom').value;
			t2 = document.getElementById('cognoms').value;
			t3 = document.getElementById('email').value;
			t4 = document.getElementById('telefon').value;
			t5 = document.getElementById('comentaris').value;

			ajax=nuevoAjax();
			ajax.open("POST", "queVolSaber_Envio.php",true);
			ajax.onreadystatechange=function() {
				if (ajax.readyState==4) {
					alert("Your form was submitted successfully.");

						document.getElementById('nom').value = "";
						document.getElementById('cognoms').value = "";
						document.getElementById('email').value = "";
						document.getElementById('telefon').value = "";
						document.getElementById('comentaris').value = "";
				}
			}
			ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			ajax.send("nom="+t1+"&cognoms="+t2+"&email="+t3+"&telefon="+t4+"&comentaris="+t5)
		}
}

function nuevoAjax() 
{ 
        var xmlhttp=false; 
        try 
        { 
                // Creacion del objeto AJAX para navegadores no IE 
                xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
        } 
        catch(e) 
        { 
                try 
                { 
                        // Creacion del objet AJAX para IE 
                        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
                } 
                catch(E) 
                { 
                        if (!xmlhttp && typeof XMLHttpRequest!="undefined") xmlhttp=new XMLHttpRequest(); 
                } 
        } 
        return xmlhttp; 
}

function obrir_Finestra(URL,PARAM3){
   window.open(URL,"PopUp",PARAM3)
}