function inicio(){
		//URL crea.xml.	
		request = new PeticionBD('xweb_cliente_promocion_vigente.crea.xml',
								 ["p_nomcli"
								 ,"p_apeuno"
								 ,"p_apedos"
								 ,"p_codprm"
								 ,"p_email"
								 ,"p_mesper"
								 ,"p_tfnper"
								 ,"p_tfncto"
								 ],EnvOk);
	}
	//Funcion que llamamos despues de crear, para decirle que el envio ha ido bien al cliente que ha rellenado el formulario
	function EnvOk(){
		alert('Su solicitud ha sido archivada, nos pondremos en contacto con usted cuando finalice su permanencia.');
		document.foDatos.reset ();
	}
	
//Función para enviar los datos del formulario
	function enviar(){
	  if (document.foDatos.acepto.checked == false) {
			alert("Lea y acepte las condiciones de privacidad");
			return false;
		}
	if (document.foDatos.p_nomcli.value==""){
        alert("Debe introducir su nombre.")
        return false;
    }
	if (document.foDatos.p_tfnper.value == ""){
		alert("Debe introducir el número de teléfono de portabilidad.")
		return false;
	}    
    if(document.foDatos.p_email.value==""){
        if (document.foDatos.p_tfncto.value==""){
          alert("Debe introducir el email o un número de contacto.")
          return false;
        }  
    }else{
        mail = document.foDatos.p_email.value;
				mail_1 = mail.split("@");
				mail_2 = mail.split(".");
				if ((mail_1.length != 2) || (mail_2.length < 2)) {
					alert("Introduce una direccion de email correcta");
					return false;
				}
		}
			
		if (document.foDatos.acepto.checked == false) {
			alert("Lea y acepte las condiciones de privacidad");
			return false;
		}
		
    
     			
		nomclie = document.foDatos.p_nomcli.value;
		apeuno = document.foDatos.p_apeuno.value;
		apedos = document.foDatos.p_apedos.value;						
		codprm = document.foDatos.p_codprm.value;
		email  = document.foDatos.p_email.value;
    mesper = document.foDatos.p_mesper.value;
    tfnper = document.foDatos.p_tfnper.value;
    tfncto = document.foDatos.p_tfncto.value;
    			
		request.Iniciar([nomclie,apeuno,apedos,codprm,email,mesper,tfnper,tfncto]);
			
	}