// JavaScript Document

function flvFTFO1(){//v1.11
if (!document.layers){
	var v1=arguments,v2=MM_findObj(v1[0]),v3,v4,v5,v6,v7,v8,v9,v10;
		if (v2){for (v3=1;v3<v1.length;v3++){v6=v1[v3].split(",");v7=v6[0];v8=v6[1];v10=false;
			for (v4=0;v4<v2.length;v4++){v5=v2[v4];if (v5.id==v7||v5.name==v7){v10=true;break;}
			}
		if (!v10){v5=MM_findObj(v7);v10=(!v5)?false:true;
		}
		if (v10){if (v8=="t"){v5.disabled=!v5.disabled;
		}
		else {v9=(v8=="e")?false:true;v5.disabled=v9;}
				}
			}
		}
	}
}

function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

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_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' deve essere un indirizzo e-mail valido.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' deve essere un numero.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' deve essere un numero compreso fra '+min+' e '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' è obbligatorio.\n'; }
  } if (errors) alert('Sono avvenuti i seguenti errori:\n'+errors);
  document.MM_returnValue = (errors == '');
}
