var flaCheck = 7;

var flashInst = "si";
var flaVer = 0;
var maxCheck = flaCheck+16;
var minCheck = flaCheck-4;
MSDetect = "false";

if (navigator.plugins && navigator.plugins.length){
  x = navigator.plugins["Shockwave Flash"];
  if (x){
    if (x.description){
	y = x.description;
	flaVer = y.charAt(y.indexOf('.')-2) + y.charAt(y.indexOf('.')-1);

	if (isNaN(flaVer)) {
	  flaVer = y.charAt(y.indexOf('.')-1);
	}

	if (isNaN(flaVer)) {
	  flaVer = 0;
	}
    }
  }
  else
    flaVer = 0;
}
else if (navigator.mimeTypes && navigator.mimeTypes.length){
  x = navigator.mimeTypes['application/x-shockwave-flash'];
  if (x && x.enabledPlugin)
    flaVer = flaCheck;
  else
    flaVer = 0;
}
else
  MSDetect = "true";

if (flaVer != 0 && flaVer < flaCheck){
  flashInst = "no";
}

if (MSDetect == "true") {
  document.write('<scr' + 'ipt type="text/vbscr' + 'ipt"> \n');
  document.write('on error resume next \n');
  document.write('For i = minCheck to maxCheck \n');
  document.write('If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then \n');
  document.write('Else \n');
  document.write('flaVer = i \n');
  document.write('End If \n');
  document.write('Next \n');
  document.write('If flaVer < flaCheck Then \n');
  document.write('flashInst = "no" \n');
  document.write('End If \n');
  document.write('</scr' + 'ipt> \n');
}

function init() {
  if (!document.getElementById) return
  var imgOriginSrc;
  var imgTemp = new Array();
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('hsrc')) {
      imgTemp[i] = new Image();
      imgTemp[i].src = imgarr[i].getAttribute('hsrc');
      imgarr[i].onmouseover = function() {
        imgOriginSrc = this.getAttribute('src');
        this.setAttribute('src',this.getAttribute('hsrc'))
      }
      imgarr[i].onmouseout = function() {
        this.setAttribute('src',imgOriginSrc)
      }
    }
  }
}
onload=init;

function ControllaForm() {
  var controllo = false; 
  if (document.form1.username.value == "" ){
    controllo=true;
    alert("Inserire il proprio Username");
    document.form1.username.focus();
  }
  else if (document.form1.password.value == "" ){
    controllo=true;
    alert("Inserire la Password");
    document.form1.password.focus();
  }
  if (controllo){return false}else{document.form1.submit()} 
}