

function envia_dades(){	

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

	
	if((nom == "")||(nom == "Entra nom")||(nom == "Entra nombre")||(nom == "Enter name")||( email == "")||( email == "exemple@mail.com")||( email == "ejemplo@mail.com")||( email == "example@mail.com")||(!filter.test(email))||(msg=="")||( msg == "Entra Text")||( msg == "Entra Texto")||( msg == "Enter Text")){
		amagaCartells();				
		if((nom =="")||(nom == "Entra nom")||(nom == "Entra nombre")||(nom == "Enter name")){						
			$("#no_nom").fadeIn("slow");
		}				
		if((email=="")||( email == "exemple@mail.com")||( email == "ejemplo@mail.com")||( email == "example@mail.com")){			
			$("#no_email").fadeIn("slow");
			
			
		}else{
			if(!filter.test(email)){			
				$("#wrong_mail").fadeIn("slow");
			}
		}
		if((msg=="")||( msg == "Entra Text")||( msg == "Entra Texto")||( msg == "Enter Text")){			
			$("#no_msg").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_email").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_email").fadeOut("slow");
	$("#wrong_mail").fadeOut("slow");
	$("#no_msg").fadeOut("slow");
	//$("#mensaje_ok").fadeOut("slow");
	//$("#mensaje_ko").fadeOut("slow");	
}


function mostraText(id,id_img){
	
	document.getElementById(id).style.visibility = 'visible';
	document.getElementById(id_img).style.opacity = (70 / 100);
	
	//document.getElementById(id_img).style.alpha=70;
}

function amagaText(id,id_img){
	
	document.getElementById(id).style.visibility = 'hidden';
	document.getElementById(id_img).style.opacity = 1;
	
	//document.getElementById(id_img).style.alpha=100;
}

/*$(document).ready(function(){

			$.slideshow(
			{
				container : 'flash',
				loader: 'imgs/slideshow_loader.gif',
				linksPosition: 'top',
				linksClass: 'pagelinks',
				linksSeparator : ' | ',
				fadeDuration : 800,
				activeLinkClass: 'activeSlide',
				nextslideClass: 'nextSlide',
				prevslideClass: 'prevSlide',
				captionPosition: 'bottom',
				captionClass: 'slideCaption',
				autoplay: 10,
				random: false,
				images : [
					{
						src: 'imgs/slide/39031.JPG',
						caption: ''
					},
					{
						src: 'imgs/slide/39032.JPG',
						caption: ''
					},
					{
						src: 'imgs/slide/39033.JPG',
						caption: ''
					},
					{
						src: 'imgs/slide/39034.JPG',
						caption: ''
					},
					{
						src: 'imgs/slide/39035.JPG',
						caption: ''
					},
					{
						src: 'imgs/slide/39036.JPG',
						caption: ''
					},
					
					{
						src: 'imgs/slide/39037.JPG',
						caption: ''
					}
					
				]
			}
			
		)	
		
		
});*/
 
