function comprovar_camps_obligaroris_formulari(lang,siEmail) {
	if ( lang == 'en') {
		var missatge='INCOMPLETE DATA\n\nCompulsory field';
		var missEmail = 'Incorrect email address';
	} else {
		var missatge='DADES INCOMPLETES\n\nCamps amb   !   son oligatoris';
		var missEmail ='Email incorrecte';
	}
	if (siEmail == '1') {
		if (document.formulari.email.name)	{
				xEmail = document.formulari.email.value;
				filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
				if (!filter.test(xEmail)) {
						alert(missEmail);
						return false;
				}
		}
	}
	var errorCamp=0;
	var errorEmail=0;
	var cadena = document.formulari.camps_obligatoris.value.split(',');
	for (i=0; i<cadena.length; i++) {		
		if (document.formulari.elements[cadena[i]].value == "")	{
				errorCamp++;	
		}
	}
	if (errorCamp > 0) {
		alert(missatge);
		return false;
	} else {		
		document.formulari.submit();
		return true;
	}
}
function MuestraXip( valor ) {
	if( valor == "S" ) {
		document.getElementById( "xip1" ).style.display = "block";
		document.getElementById( "xip2" ).style.display = "block";
	} else {
		document.getElementById( "xip1" ).style.display = "none";
		document.getElementById( "xip2" ).style.display = "none";
	}	
}

function finestra(theURL,winName,anchoV,altoV,X,Y,scro) {
	var anchoP = screen.width;
	var altoP = screen.height;
	if (X =='' || Y =='') {
		var posX = eval((anchoP-anchoV)/2);
		var posY = eval((altoP-altoV)/2);
	} else {
		var posX = eval(X);
		var posY = eval(Y);
	}
	if (winName == '') {
	  var tipusFinestra = "target=blank";
	}
	else {
	  var tipusFinestra = winName;
	}
	window.open	(theURL,tipusFinestra,'status=no,resizable=no,scrollbars='+scro+',left='+posX+',top='+posY+',width='+anchoV+',height='+altoV+'');
}
function MuestraConceptos( valor ) {
	if( valor == "ent" ) {
		document.getElementById( "concep1" ).style.display = "block";
		document.getElementById( "concep2" ).style.display = "block";
		document.getElementById( "concep3" ).style.display = "none";
	} else if( valor == "sor" ) {
		document.getElementById( "concep1" ).style.display = "block";
		document.getElementById( "concep2" ).style.display = "none";
		document.getElementById( "concep3" ).style.display = "block";	
	
	} else {
		document.getElementById( "concep1" ).style.display = "none";
		document.getElementById( "concep2" ).style.display = "none";
		document.getElementById( "concep3" ).style.display = "none";
	}	
}
function MuestraConceptosAltres( valor ) {
	if( valor == "alt" ) {
		document.getElementById( "concepte_altres" ).style.display = "block";	
	} else {
		document.getElementById( "concepte_altres" ).style.display = "none";
	}	
}