

function vesSeccio(quinaSeccio){
	location.href = quinaSeccio;
}

function enviaFormulari(){

	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 != "")&&(email != "")&&(msg != "")&&(filter.test(email))){
		
		$("#no_nom").addClass('ocult');		
		$("#no_missatge").addClass('ocult');
		$("#no_mail").addClass('ocult');
		$("#wrong_mail").addClass('ocult');		
		
		document.forms.formulari.submit();
			
	}else{
		if(nom == ""){
			$("#no_nom").removeClass('ocult');
		}else{
			$("#no_nom").addClass('ocult');
		}

		
		if(msg == ""){
			$("#no_missatge").removeClass('ocult');
		}else{
			$("#no_missatge").addClass('ocult');
		}
		

		if(email == ""){
			$("#no_mail").removeClass('ocult');
			$("#wrong_mail").addClass('ocult');
		}else{
			if(!filter.test(email)){
				$("#no_mail").addClass('ocult');
				$("#wrong_mail").removeClass('ocult');
			}else{
				$("#no_mail").addClass('ocult');
				$("#wrong_mail").addClass('ocult');
			}
		}
		
	}

}


function enviaFormulariComentari(){

	nom = document.getElementById("nom").value;
	missatge = document.getElementById("missatge").value;
	
	if((nom != "")&&(missatge != "")&&(missatge != undefined)){
		
		$("#no_nom").addClass('ocult');
		$("#no_missatge").addClass('ocult');

		document.forms.formulari.submit();
			
	}else{
		if((nom == "")||(nom == undefined)){
			$("#no_nom").removeClass('ocult');
		}else{
			$("#no_nom").addClass('ocult');
		}

		
		if((missatge == "")||(missatge == undefined)){
			$("#no_missatge").removeClass('ocult');
		}else{
			$("#no_missatge").addClass('ocult');
		}
	}

}


/*var message="";

function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false");*/
