

function vesASeccio(quinaSeccio){
	location.href = quinaSeccio;
}


function enviaFormulariComentari(seg){
	
	nom = document.getElementById("nom2").value;
	missatge = document.getElementById("missatge").value;
	seguridad = document.getElementById("seguridad").value;	
	
	if((nom != "")&&(missatge != "")&&(seguridad != "")){
		
		$("#no_nom").addClass('ocult');
		$("#no_missatge").addClass('ocult');
		$("#no_seguridad").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');
		}
		
		if((seguridad == "")||(seguridad == undefined)){
			$("#no_seguridad").removeClass('ocult');
		}else{
			$("#no_seguridad").addClass('ocult');
		}
	}

}



function enviaFormulariAmic(){
	
	nom1 = document.getElementById("nom1").value;
	nom2 = document.getElementById("nom2").value;
	mail1 = document.getElementById("mail1").value;	
	mail2 = document.getElementById("mail2").value;	
	
	if((nom1 != "")&&(nom2 != "")&&(mail1 != "")&&(mail2 != "")){
		
		$("#no_nom").addClass('ocult');
		$("#no_mail").addClass('ocult');
		$("#no_nom2").addClass('ocult');
		$("#no_mail2").addClass('ocult');

		document.forms.formulari.submit();
			
	}else{
		if((nom1 == "")||(nom1 == undefined)){
			$("#no_nom").removeClass('ocult');
		}else{
			$("#no_nom").addClass('ocult');
		}

		
		if((nom2 == "")||(nom2 == undefined)){
			$("#no_nom2").removeClass('ocult');
		}else{
			$("#no_nom2").addClass('ocult');
		}
		
		if((mail1 == "")||(mail1 == undefined)){
			$("#no_mail").removeClass('ocult');
		}else{
			$("#no_mail").addClass('ocult');
		}
		
		if((mail2 == "")||(mail2 == undefined)){
			$("#no_mail2").removeClass('ocult');
		}else{
			$("#no_mail2").addClass('ocult');
		}
		
	}

}


function enviaFormulariContacte(){
	
	nom1 = document.getElementById("nom1").value;
	mail1 = document.getElementById("mail1").value;	
	observa = document.getElementById("observa").value;	
	
	if((nom1 != "")&&(mail1 != "")&&(observa != "")){
		
		$("#no_nom").addClass('ocult');
		$("#no_mail").addClass('ocult');
		$("#no_observacions").addClass('ocult');

		document.forms.formulari.submit();
			
	}else{
		if((nom1 == "")||(nom1 == undefined)){
			$("#no_nom").removeClass('ocult');
		}else{
			$("#no_nom").addClass('ocult');
		}

		if((mail1 == "")||(mail1 == undefined)){
			$("#no_mail").removeClass('ocult');
		}else{
			$("#no_mail").addClass('ocult');
		}
		
		if((observa == "")||(observa == undefined)){
			$("#no_observacions").removeClass('ocult');
		}else{
			$("#no_observacions").addClass('ocult');
		}		
	}
}




TIME_WATCHING = 5000;

function slideSwitch(){

	clearInterval(interval_id1);

	var $active = $('#slideshow2 span.active');

	if ( $active.length == 0 ) $active = $('#slideshow2 span:last');

	// use this to pull the images in the order they appear in the markup
	var $next =  $active.next().length ? $active.next()
		: $('#slideshow2 span:first');

	$active.addClass('last-active');

	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 2000, function() {
			$active.removeClass('active last-active');
			interval_id1 = setInterval( "slideSwitch()", TIME_WATCHING );
		});
}


function activa_Slides(time1){
	interval_id1 = setInterval( "slideSwitch()", time1 );
}






function slideSwitch2(){

	clearInterval(interval_id2);

	var $active = $('#slideshow3 span.active');

	if ( $active.length == 0 ) $active = $('#slideshow3 span:last');

	// use this to pull the images in the order they appear in the markup
	var $next =  $active.next().length ? $active.next()
		: $('#slideshow3 span:first');

	$active.addClass('last-active');

	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 2000, function() {
			$active.removeClass('active last-active');
			interval_id2 = setInterval( "slideSwitch2()", TIME_WATCHING );
		});
}


function activa_Slides2(time2){
	interval_id2 = setInterval( "slideSwitch2()", time2 );
}

