
function MM_validateForm() { //v4.0
  if (document.getElementById){
    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=document.getElementById(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 contenere un indirizzo.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' deve contenere 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 contenere un numero compreso tra '+min+' e '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('Errori:\n'+errors);
    document.MM_returnValue = (errors == '');
} }

function MM_validateForm_IT() { //v4.0
  if (document.getElementById){
    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=document.getElementById(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.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' deve contenere 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 contenere un numero compreso tra '+min+' e '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' è obbligatorio.\n'; }
    } if (errors) alert('Errori:\n'+errors);
    document.MM_returnValue = (errors == '');
} }


function insFlash(dove,cosa,parametri,larghezza,altezza,wmode,bgcolor,id,hasReqestedVersion) {
	
	if(hasReqestedVersion){
		
		if(wmode){
			var traspObject = "<param name=\"wmode\" value=\"transparent\" />";
			var traspEmbed = " wmode=\"transparent\""
		}else{
			var traspObject = "";
			var traspEmbed = ""
		}

		//document.getElementById("mt-htmlmenu").className = "mt-out";
		
		stringa = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\""+larghezza+"\" height=\""+altezza+"\" id=\""+id+"\">";
		stringa += "<param name=\"movie\" value=\""+cosa+"\" />";
		stringa += "<param name=\"quality\" value=\"high\" />";
		stringa += "<param name=\"showmenu\" value=\"false\" />";
		stringa += traspObject;
		stringa += "<param name=\"flashVars\" value=\""+parametri+"\" />";
		stringa += "<param name=\"bgcolor\" value=\""+bgcolor+"\" />";
		stringa += "<embed src=\""+cosa+"\" flashVars=\""+parametri+"\" quality=\"high\" showmenu=\"false\""+traspEmbed+" bgcolor=\""+bgcolor+"\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""+larghezza+"\" height=\""+altezza+"\" name=\""+id+"\"></embed>";
		stringa += "</object>";
		
		document.getElementById(dove).innerHTML = stringa;
		return;
		
	}else{
		
		document.location.href = "/noflash.asp";
		return;
		
	}
}

function mostra(elemento,contenuto) {
	  var srcElemento = document.getElementById(elemento);
	  if(srcElemento != null) {
	   srcElemento.innerHTML=contenuto;
	  }
  }

