function envia_doc(){
	alert("enviadoc");
	/*$.ajax({
		type: "POST",
		url: "secciones/tumaremagnum/inserta_foto.php",
		processData: true,
		data: "nombre="+nombre+"&titulo="+titulo,
		success: function(msg){
			//alert(msg);
			ocultaTodo();
			$("#mensaje_ok").fadeIn("slow");
			document.getElementById("publica_foto").reset();
		}
	});*/
}


function envia_dades(){	


	
	nom_cognoms=document.getElementById("nom_cognoms").value;
	email=document.getElementById("email").value;
	doc=document.getElementById("doc").value;
	var filter=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;

	
	if((nom_cognoms == "")||(nom_cognoms == "NOM I COGNOMS")||(nom_cognoms == "NOMBRE Y APELLIDOS")||( email == "")||( email == "ADREÇA ELECTRONICA")||( email == "CORREO ELECTRONICO")||(!filter.test(email))||(doc=="")){		
		amagaCartells();		
		if((nom_cognoms =="")||(nom_cognoms == "NOM I COGNOMS")||(nom_cognoms == "NOMBRE Y APELLIDOS")){			
			$("#no_nom").fadeIn("slow");
											
		}				
		if((email=="")||( email == "ADREÇA ELECTRONICA")||( email == "CORREO ELECTRONICO")){			
			$("#no_mail").fadeIn("slow");
			
			
		}else{
			if(!filter.test(email)){			
				$("#wrong_mail").fadeIn("slow");
	
				
			}
		}
		if(doc==""){			
			$("#no_doc").fadeIn("slow");
		
		}	
	}else{		
		document.forms.subscripcio.submit();
	}
}


function envia_dades_clients(){	

	usuari=document.getElementById("usuari").value;
	pass=document.getElementById("pass").value;	
	
	
	if((usuari == "")||( pass == "")){		
		amagaCartells();		
		if(usuari ==""){			
			$("#no_nom").fadeIn("slow");
			document.forms.login.reset();									
		}				
		if(pass==""){			
			$("#no_mail").fadeIn("slow");
			document.forms.login.reset();
			
		}
	}else{			
				
		$.ajax({			
			type: "POST",
			data: "usuari="+usuari+"&pass="+pass,	   		
			url: "secciones/area_clients/login.php",	

			success: function(msg){					
				amagaCartells();				
				$("#mensaje_ko").fadeIn("slow");
				document.forms.login.reset();
			}
	   		
		});	  
	}
}



function amagaCartells(){
	$("#no_nom").fadeOut("slow");
	$("#no_mail").fadeOut("slow");
	$("#wrong_mail").fadeOut("slow");
	$("#mensaje_ok").fadeOut("slow");
	$("#mensaje_ko").fadeOut("slow");
}


		