function validate_fr(str,exp)
	{
	if(bersaglio=str.value.match(exp))
	{
		alert(" la stringa del campo "+str.name+" ("+str.value+") contiene caratteri speciali \n     ----> "+bersaglio+" <----\nnon validi\n ");
	 	str.value=memoria;	
		str.focus();
	}
	else
	{	
		if(str.name=="mail")
			{
				if(str.value)
				{
					if(str.value.match(/^[\w]{0,}\.?-?_?[\w]{1,}\@[\w]{2,}\.[\w]{2,4}$/gi)){}
					else
					{
						alert(" la stringa del campo "+str.name+" non contiene un indirizzo Email valido");
						//alert("seguenti l'ha bersaglioccato "+str.value);
						str.value = memoria;	
					}
				}
		}
	if(str.name=="telefono"|str.name=="tel"|str.name=="fax" |str.name=="cap" | str.name=="cellulare" )
		{ //alert(str.name);
		if(str.value.match(/^\+?[\d\/\s]+$/i)){}
		else
			{
			alert("La stringa del campo "+str.name+" non contiene un numero valido");
			str.value=memoria;	
			}
		}
	}
}


//--------------------------------------------------------------------------------------------------------------------------


function controllo1(h,blocca,no_controllo)
{
salta = no_controllo.split("|");
//alert(h);
//nome_form = h;
msg="";
//alert(h.elements.length);
for (i=0; i<(h.elements.length); i++)
	{
	for (e=0; e<(salta.length); e++)
		{
		if(!h.elements[i].value && !(h.elements[i].name== salta[e]))
				{
 						msg=msg + "il campo " + h.elements[i].name + " non è stato compilato, \n";
				}
		}
	}

if(msg)
		{
		if(blocca==0){
			res = confirm("ATTENZIONE:\n"+msg + "\nsi desidera proseguire ugualmente alla compilazione del Database?\n\nPer correggere l'eventuale errore premere ANNULLA\n\nPer proseguire premere OK")
			if (res)
					{
					h.submit();
					}
				}
		if (blocca==1)
				{
					alert("I seguenti campi sono vuoti: \n\n"+ msg+ "\n\n In questa parte dell'Amministrazione \noccorre compilare tutti i campi")
				}
		}
		else
		{
			h.submit();
		}
}


//-------------------------------------------------------------------------------------------------------------------

function apri(_url,_target,stile){
	if(!stile){
		stile = 'toolbar=no,scrollbars=1, height=530, width=310, top=100, left=100';
	}
	_target = window.open(_url, _target, stile);
}