function validar(f){
	if((f.nom.value=="") || (f.nom.value==" ") || (f.nom.value=="  ") || (f.nom.value=="   ") || f.nom.value.length<=3){
		mensaje= new Array();
		mensaje[1]="No ha introducido su nombre";
		mensaje[2]="Your name has not been introduced";
		mensaje[3]="Il n'a pas introduit son nom";
		mensaje[4]="Sie haben Ihre Name nicht eingeführt";
		alert(mensaje[f.len.value]);
		f.nom.focus();
		return false;
	}
	if((f.emp.value=="") || (f.emp.value==" ") || (f.emp.value=="  ") || (f.emp.value=="   ") || f.emp.value.length<=5 ){
		mensaje= new Array();
		mensaje[1]="No ha introducido la empresa a la que pertenece";
		mensaje[2]="The company you belong to has not been inputted";
		mensaje[3]="Il n'a pas introduit l'entreprise  à laquelle il appartient";
		mensaje[4]="Sie haben Ihre Firma nicht eingeführt";
		alert(mensaje[f.len.value]);
		f.emp.focus();
		return false;
	}
	if((f.pob.value=="") || (f.pob.value==" ") || (f.pob.value=="  ") || (f.pob.value=="   ") || f.pob.value.length<=3){
		mensaje= new Array();
		mensaje[1]="No ha introducido la población";
		mensaje[2]="Your town has not been inputted";
		mensaje[3]="Il n'a pas introduit la population";
		mensaje[4]="Sie haben Ihre Stadt  nicht eingeführt";
		alert(mensaje[f.len.value]);
		f.pob.focus();
		return false;
	}
	if((f.prov.value=="") || (f.prov.value==" ") || (f.prov.value=="  ") || (f.prov.value=="   ") || f.prov.value.length<=3){
		mensaje= new Array();
		mensaje[1]="No ha introducido la provincia";
		mensaje[2]="Your province has not been inputted";
		mensaje[3]="Il n'a pas introduit la province";
		mensaje[4]="Sie haben Ihre Provinz nicht eingeführt";
		alert(mensaje[f.len.value]);
		f.prov.focus();
		return false;
	}
	if((f.tlf.value=="") || (f.tlf.value==" ") || (f.tlf.value=="  ") || (f.tlf.value=="   ") || f.tlf.value.length<=8){
		mensaje= new Array();
		mensaje[1]="No ha introducido el teléfono";
		mensaje[2]="Your telephone number has not been inputted";
		mensaje[3]="Il n'a pas introduit le téléphone";
		mensaje[4]="Sie haben Ihre Telefon nicht eingeführt";
		alert(mensaje[f.len.value]);
		f.tlf.focus();
		return false;
	}
	if((f.mail.value=="") || (f.mail.value==" ") || (f.mail.value=="  ") || (f.mail.value=="   ")){
		mensaje= new Array();
		mensaje[1]="No ha introducido e-mail del usuario";
		mensaje[2]="The user e-mail has not been inputted";
		mensaje[3]="Il n'a pas introduit e-mail de l'utilisateur";
		mensaje[4]="Sie haben Ihre Benutzer e-mail nicht eingeführt";
		alert(mensaje[f.len.value]);
		f.mail.focus();
		return false;
	}
	if(f.mail.value!=""){
		if((f.mail.value.indexOf(".") == -1) || (f.mail.value.indexOf("@") == -1) || (f.mail.value.indexOf(" ") != -1) || (f.mail.value.indexOf(",") != -1) || (f.mail.value.length < 6)){
			mensaje= new Array();
			mensaje[1]="Debe introducir su e-mail correctamente";
			mensaje[2]="You must input your e-mail correctly";
			mensaje[3]="Il doit correctement introduire son e-mail";
			mensaje[4]="Sie sollen Ihre e-mail korrekt einführen";
			alert(mensaje[f.len.value]);
			f.mail.focus();
			return false;
		}
	}
	if((f.user.value=="") || (f.user.value==" ") || (f.user.value=="  ") || (f.user.value=="   ")){
		mensaje= new Array();
		mensaje[1]="No ha introducido el nombre de usuario";
		mensaje[2]="The user name has not been introduced";
		mensaje[3]="Il n'a pas introduit le nom d'utilisateur";
		mensaje[4]="Sie haben Ihre Benutzer Name nicht eingeführt";
		alert(mensaje[f.len.value]);
		f.user.focus();
		return false;
	}
	if(f.user.value.length<=5){
		mensaje= new Array();
		mensaje[1]="El nombre de usuario debe tener una longitud mínima de 6 caracteres";
		mensaje[2]="The user name should be at least 6 typeface long";
		mensaje[3]="Le nom d'utilisateur doit avoir une longueur minimale de 6 caractères";
		mensaje[4]="Der Benutzer Name sollte eine Mindestlänge von 6 Charakteren haben";
		alert(mensaje[f.len.value]);
		f.user.focus();
		return false;
	}
	if((f.pass.value=="") || (f.pass.value=="") || (f.pass.value=="") || (f.pass.value=="")){
		mensaje= new Array();
		mensaje[1]="No ha introducido la contraseña de usuario";
		mensaje[2]="The user password has not been introduced";
		mensaje[3]="Il n'a pas introduit le mot de passe d'utilisateur";
		mensaje[4]="Sie haben der Benutzer Kontrollschein nicht eingeführt";
		alert(mensaje[f.len.value]);
		f.pass.focus();
		return false;
	}
	if(f.pass.value.length<=5){
		mensaje= new Array();
		mensaje[1]="La contraseña de usuario debe tener una longitud mínima de 6 caracteres";
		mensaje[2]="The user password should be at least 6 typeface long";
		mensaje[3]="Le mot de passe d'utilisateur doit avoir une longueur minimale de 6 caractères";
		mensaje[4]="Der Benutzer Kontrollschein sollte eine Mindestlänge von 6 Charakteren haben";
		alert(mensaje[f.len.value]);
		f.pass.focus();
		return false;
	}
	if(f.pass.value==f.user.value){
		mensaje= new Array();
		mensaje[1]="El usuario y la contraseña no pueden ser iguales";
		mensaje[2]="The user and the password cannot be the same";
		mensaje[3]="L'utilisateur et le mot de passe ne peuvent pas être égaux";
		mensaje[4]="Der Benutzer und der Kontrollschein, kann nicht gleich sein";
		alert(mensaje[f.len.value]);
		f.pass.value="";
		f.pass.focus();
		return false;
	}
	return true;
}

function valcontacto(f){
	if((f.nom.value=="") || (f.nom.value==" ") || (f.nom.value=="  ") || (f.nom.value=="   ")){
		mensaje= new Array();
		mensaje[1]="No ha introducido su nombre";
		mensaje[2]="Your name has not been introduced";
		mensaje[3]="Il n'a pas introduit son nom";
		mensaje[4]="Sie haben Ihre Name nicht eingeführt";
		alert(mensaje[f.len.value]);
		f.nom.focus();
		return false;
	}
	if((f.cont.value=="") || (f.cont.value==" ") || (f.cont.value=="  ") || (f.cont.value=="   ")){
		mensaje= new Array();
		mensaje[1]="Introduzca su consulta";
		mensaje[2]="Input your enquiry";
		mensaje[3]="Introduisez sa consultation";
		mensaje[4]="Führen Sie Ihre Besprechung bitte ein";
		alert(mensaje[f.len.value]);
		f.cont.focus();
		return false;
	}
	if((f.mail.value=="") || (f.mail.value==" ") || (f.mail.value=="  ") || (f.mail.value=="   ")){
		mensaje= new Array();
		mensaje[1]="Introduzca su correo electrónico para poder responderle";
		mensaje[2]="Input your e-mail for us to reply";
		mensaje[3]="Introduisez son courrier électronique pour pouvoir le répondre";
		mensaje[4]="Führen Sie Ihre e-mail,damit wir Ihnen antworten können";
		alert(mensaje[f.len.value]);
		f.mail.focus();
		return false;
	}
}

function valbuscar(f){
	if((f.nom.value=="") || (f.nom.value==" ") || (f.nom.value=="  ") || (f.nom.value=="   ")){
		mensaje= new Array();
		mensaje[1]="Introduzca su consulta";
		mensaje[2]="Input your enquiry";
		mensaje[3]="Introduisez sa consultation";
		mensaje[4]="Führen Sie Ihre Besprechung bitte ein";
		alert(mensaje[f.len.value]);
		f.nom.focus();
		return false;
	}
}


function texto(thetext, thewidth, thecolor){
	if(ns6||ie){
		if(typeof thewidth!="undefined")
			tipobj.style.width=thewidth+"px"
		if (typeof thecolor!="undefined" && thecolor!="")
			tipobj.style.backgroundColor=thecolor
		tipobj.innerHTML=thetext
		enabletip=true
		return false
	}
}

function esctexto(){
	if(ns6||ie){
		enabletip=false
		tipobj.style.visibility="hidden"
		pointerobj.style.visibility="hidden"
		tipobj.style.left="-1000px"
		tipobj.style.backgroundColor=''
		tipobj.style.width=''
	}
}

// FUNCIONES AJAX
function nuevoAjax(){
	var xmlhttp=false;
	try{ xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); }
	catch(e){
		try{ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
		catch(E){ xmlhttp=false; }
	}
	if(!xmlhttp && typeof XMLHttpRequest!='undefined'){ xmlhttp = new XMLHttpRequest(); }
	return xmlhttp;
}

// Función que carga la página dada
function cargarpagina(pagina_requerida, id_contenedor){
	if(pagina_requerida.readyState==4 && (pagina_requerida.status==200 || window.location.href.indexOf("http")==-1)){
        var scs=pagina_requerida.responseText.extractScript();
        document.getElementById (id_contenedor).innerHTML=pagina_requerida.responseText.stripScript();
        scs.evalScript();
	}
}

// Función para la carga de páginas el la principal
function llamarasincrono(url,id_contenedor){
	var element=document.getElementById(id_contenedor);
	pagina_requerida=nuevoAjax();
	element.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="center"><img src="imagenes/carga.gif"></td></tr></table>';
	pagina_requerida.onreadystatechange=function(){ // función de respuesta
		cargarpagina(pagina_requerida,id_contenedor)
	}
	pagina_requerida.open('GET',url,true)
	pagina_requerida.send(null)
}

// Función para el envío de solicitudes de abono
function cargarcontenido(url,id_contenedor){
	var element=document.getElementById(id_contenedor);
	var op,enlace;
	op=document.Form.op.value;
	if(op==1){
		var nom,cont,mail,len;
		nom=encodeURIComponent(document.Form.nom.value);
		cont=encodeURIComponent(document.Form.cont.value);
		mail=encodeURIComponent(document.Form.mail.value);
		len=document.Form.len.value;
		enlace=url+"?nom="+nom+"&cont="+cont+"&mail="+mail+"&len="+len;
	}else if(op==2){
		var nom,tlf,emp,mail,pob,prov,user,pass,mvl,cif,fax,cp,len,dir,pais,control;
		nom=encodeURIComponent(document.Form.nom.value);				tlf=document.Form.tlf.value;
		emp=encodeURIComponent(document.Form.emp.value);				mail=encodeURIComponent(document.Form.mail.value);
		pob=encodeURIComponent(document.Form.pob.value);				prov=encodeURIComponent(document.Form.prov.value);
		user=encodeURIComponent(document.Form.user.value);				pass=encodeURIComponent(document.Form.pass.value);
		mvl=document.Form.mvl.value;									cif=document.Form.cif.value;
		fax=document.Form.fax.value;									cp=document.Form.cp.value;
		len=document.Form.len.value;									dir=encodeURIComponent(document.Form.dir.value);
		pais=encodeURIComponent(document.Form.pais.value);				control=document.Form.control.value;
		enlace=url+"?nom="+nom+"&tlf="+tlf+"&emp="+emp+"&mail="+mail+"&pob="+pob+"&prov="+prov+"&user="+user+"&pass="+pass+"&mvl="+mvl+"&cif="+cif+"&fax="+fax+"&cp="+cp+"&len="+len+"&dir="+dir+"&pais="+pais+"&control="+control;
	}else if(op==3){
		var mail,len;
		mail=encodeURIComponent(document.Form.mail.value);
		len=document.Form.len.value;
		enlace=url+"?mail="+mail+"&len="+len;
	}else if(op==4){
		var nom,len;
		nom=encodeURIComponent(document.Form.nom.value);
		len=document.Form.len.value;
		enlace=url+"?nom="+nom+"&len="+len;
	}
	
	ajax=nuevoAjax();
	element.innerHTML='<table width="100%" height="100%"><tr><td align="center" valign="center"><img src="imagenes/carga.gif"></td></tr></table>';
	ajax.onreadystatechange=function(){ cargarpagina(ajax,id_contenedor); }
	ajax.open("GET",enlace,true);
	ajax.setRequestHeader("content-type","application/x-www-form-urlencoded;charset=UTF-8");
	ajax.send(null);
}