//funcions per validar formularis -------------------
function valida_FormCistella() {
    if (document.FormCistella.FormNom.value.length==0){ 
       alert("(cat) El camp NOM és obligatori.\n\n(esp) El campo NOMBRE es obligatorio.") 
       document.FormCistella.FormNom.focus() 
       return false; 
    }
    if (document.FormCistella.FormDir.value.length==0){ 
       alert("(cat) El camp DIRECCIÓ D'ENTREGA és obligatori.\n\n(esp) El campo DIRECCIÓN DE ENVIO es obligatorio.") 
       document.FormCistella.FormDir.focus() 
       return false; 
    }	
    if (document.FormCistella.FormCP.value.length==0){ 
       alert("(cat) El camp C. POSTAL és obligatori.\n\n(esp) El campo C. POSTAL es obligatorio.") 
       document.FormCistella.FormCP.focus() 
       return false; 
    }	
    if (document.FormCistella.FormPoble.value.length==0){ 
       alert("(cat) El camp LOCALITAT D'ENVIAMENT és obligatori.\n\n(esp) El campo LOCAL DE ENVIO es obligatorio.") 
       document.FormCistella.FormPoble.focus() 
       return false; 
    }
    if (document.FormCistella.FormPais.value.length==0){ 
       alert("(cat) El camp PAIS D'ENVIAMENT és obligatori.\n\n(esp) El campo PAÍS DE ENVIO es obligatorio.") 
       document.FormCistella.FormPais.focus() 
       return false; 
    }
    if ((document.FormCistella.FormTelf.value.length==0) && (document.FormCistella.FormMovil.value.length==0)){ 
       alert("(cat) És obligatori un TELEFON o MOBIL de contacte.\n\n(esp) Es obligatorio un TELEFONO o MOVIL de contacto.") 
       document.FormCistella.FormTelf.focus() 
       return false; 
    }		
	if (document.FormCistella.FormMail.value.length==0) {
		  alert("(cat) El camp MAIL és obligatori.\n\n(esp) El campo EMAIL es obligatorio.") 
		  document.FormCistella.FormMail.focus() 
		  return false; 	
	} else {
		if ((document.FormCistella.FormMail.value.length>0) && (document.FormCistella.FormMail.value.indexOf("@") < 1)){ 
		  alert("(cat) El camp MAIL no és un e-mail vàlid.\n\n(esp) El campo EMAIL no es un e-mail válido.") 
		  document.FormCistella.FormMail.focus() 
		  return false; 
		}
	}
    if (document.FormCistella.FormNIF.value.length==0){ 
       alert("(cat) El camp NIF és obligatori.\n\n(esp) El campo NIF es obligatorio.") 
       document.FormCistella.FormNIF.focus() 
       return false; 
    }
	if (document.FormCistella.ChkCondicio.checked==false) {
		alert("(cat) Aceptar las condiciones")
		document.FormCistella.ChkCondicio.focus()
		return false;
	}
}
function valida_FormAuto() {
    if (document.FormAuto.FormNom.value.length==0){ 
       alert("(cat) El camp NOM és obligatori.\n\n(esp) El campo NOMBRE es obligatorio.") 
       document.FormAuto.FormNom.focus() 
       return false; 
    }
    if ((document.FormAuto.FormTelf.value.length==0) && (document.FormAuto.FormMovil.value.length==0)){ 
       alert("(cat) És obligatori un TELEFON o MOBIL de contacte.\n\n(esp) Es obligatorio un TELEFONO o MOVIL de contacto.") 
       document.FormAuto.FormTelf.focus() 
       return false; 
    }		
	if (document.FormAuto.FormMail.value.length==0) {
		  alert("(cat) El camp MAIL és obligatori.\n\n(esp) El campo EMAIL es obligatorio.") 
		  document.FormAuto.FormMail.focus() 
		  return false; 	
	} else {
		if ((document.FormAuto.FormMail.value.length>0) && (document.FormAuto.FormMail.value.indexOf("@") < 1)){ 
		  alert("(cat) El camp MAIL no és un e-mail vàlid.\n\n(esp) El campo EMAIL no es un e-mail válido.") 
		  document.FormAuto.FormMail.focus() 
		  return false; 
		}
	}
}
function MsgConfirm(msg,enllac){
	if (confirm(msg)){
		window.location=enllac
	}
}
//-->