<!--
function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0
  var ok=false; document.MM_returnValue = false;
  with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
    ok=(plugins && plugins[plgIn]);
  } else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
    if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
    else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
    else ok=autoGo; }
  if (!ok) theURL=altURL; if (theURL) window.location=theURL;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

/*function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}*/
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'block':(v=='hide')?'none':v; }
    obj.display=v; }
}
/*FUNZIONI PER LA TENDINA*/
function aum(obj,incr,dimfin) {
						if (incr<=dimfin)
						{
							obj.style.height=incr+"px";
							incr=incr+2;
							opentime = window.setTimeout(function(){aum(obj,incr,dimfin);}, 10);
						} else {
							clearTimeout(opentime);
						}

}
function dim(obj,dimfin,incr) {
						if (dimfin<=incr)
						{
							obj.style.height=incr+"px";
							incr=incr-2;
							opentime = window.setTimeout(function(){dim(obj,dimfin,incr);}, 10);
						} else {
							clearTimeout(opentime);
							obj.style.display="none";
							obj.style.height="auto";
						}

}
function getdimension(a) {
	b=document.getElementById(a).offsetHeight;
	return b;
}
function mostra_div(nome_div)
{
	document.getElementById(nome_div).style.visibility='visible';
}
function nascondi_div(nome_div)
{
	document.getElementById(nome_div).style.visibility='hidden';
}
function togli_div(nome_div)
{
	document.getElementById(nome_div).style.display='none';
}
function cambia_src(nome_div,valore)
{
	document.getElementById(nome_div).src=valore;
	alert(valore);
}
function apri(a)
{
		var cippi=document.getElementById(a)
		cippi.style.display="block";
		dimfin=getdimension(a)+5;
		cippi.style.height="0px";
		aum(cippi,20,dimfin);
}
function chiudi(a)
{
		var cippi=document.getElementById(a)
		cippi.style.display="none";
		dim_in=getdimension(a);
		dim(cippi,0,dim_in);
}
function cambia_testo(dove,testo)
{	
	document.getElementById(dove).innerHTML=testo;
}
function position_image_big()
{
	var myWidth = 0, myHeight = 0;
  	if( typeof( window.innerWidth ) == 'number' ) {
	    //Non-IE
	    myWidth = window.innerWidth;
	    myHeight = window.innerHeight;
  	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	    //IE 6+ in 'standards compliant mode'
	    myWidth = document.documentElement.clientWidth;
	    myHeight = document.documentElement.clientHeight;
  	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	    //IE 4 compatible
	    myWidth = document.body.clientWidth;
	    myHeight = document.body.clientHeight;
  	}
	X=((myWidth/2)-(document.getElementById('IMG').width/2));   
	Y=((myHeight/2)-(document.getElementById('IMG').height/2));
	document.getElementById('SBIG').style.left=X+"px";
	document.getElementById('SBIG').style.top=Y+"px";
	setTimeout("position_image_big()",1500);
}
function zoom_soci()
{
	document.getElementById('SBIG').style.left="200px";
	document.getElementById('SBIG').style.top="100px";
}
function ctrl_campo_reg(valore)
{
	if(document.formo.eval(valore).value=="")
	{
		document.getElementById(valore).style.visibility="visible";
	}
	else
	{
		document.getElementById(valore).style.visibility="hidden";
	}
}
function ctrl_campo_reg_sel(valore)
{
	//alert(document.formo.eval(valore).options[document.formo.eval(valore).selectedIndex].value);
	if(document.formo.eval(valore).options[document.formo.eval(valore).selectedIndex].value==0)
	{
		document.getElementById(valore).style.visibility="visible";
	}
	else
	{
		document.getElementById(valore).style.visibility="hidden";
	}
}
function ridirigi(url)
{
	parent.location.href=url;
}
function agriqualita()
{
	pnagr = window.open("html/statici/agriqualita/pane.php","pagr","toolbar=no,directories=no,resizable=NO,scrollbars=no,width=650,height=500,left=80,top=90");
	pnagr.focus();
}
//-->
var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

function checkmail(e){
var returnval=emailfilter.test(e.value)
if (returnval==false){
alert("Verifica il tuo indirizzo e-mail. Formato non valido.")
e.select()
}
return returnval
}