// x stx e animaz

var flaCheck = 8;

var flashInst = "si";	// per animaz
var flashOK = 0;	// 1 si, 0 no
var flaVer = 0;
//var maxCheck = flaCheck+15;
//var minCheck = flaCheck-3;

function getFlashVersion()	// solo ie
{ 
  // ie 
  try { 
    try { 
      var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6'); 
      try { axo.AllowScriptAccess = 'always'; } 
      catch(e) { return '6,0,0'; } 
    } catch(e) {} 
    return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1]; 
  // other browsers 
  } catch(e) { 
    try { 
      if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){ 
        return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1]; 
      } 
    } catch(e) {} 
  } 
  return '0,0,0'; 
} 

if (navigator.plugins && navigator.plugins.length)	// moz
{

  var plug = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
  if (plug) {
    var words = navigator.plugins["Shockwave Flash"].description.split(" ");
    for (var i = 0; i < words.length; ++i) {
      if (isNaN(parseInt(words[i])))
        continue;
        var flaAr = words[i].split(".");
        flaVer = flaAr[0]; 
    }
  }

}else{	// ie

  if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) 
  {
//    document.write('<SCR' + 'IPT LANGUAGE=\"VBScript\">\n on error resume next\n For ii = minCheck to maxCheck\n If Not(IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" & ii))) Then\n Else\n flashOK = 1\n flaVer = ii\n  End If\n Next</SCR' + 'IPT>'); 
    var flaVer = getFlashVersion().split(',').shift(); 
  }

}

if (flaVer > 0) { flashOK = 1; }
if (flaVer < flaCheck) { flashInst = "no"; }





// popup
function dis() {
if(document.getElementById) document.getElementById("Pub1").style.visibility = "hidden";
}




// crypt
function cryptEm(nome,dominio,ext) {
   var str1 = "maiAAAlto:";
   location.href = str1.substr(0,3) + str1.substr(6,4) + nome + "@" + dominio + "." + ext;
}




// popup 
function pop(url,w,h) {
 var l = Math.floor((screen.width-w)/2);
 var t = Math.floor((screen.height-h)/2);
 window.open(url,"","width=" + w + ",height=" + h + ",top=" + t + ",left=" + l + ", status=no, menubar=no, toolbar=no scrollbar=yes");
}




// fla dinamici
function mostraFla(nome,idFla,largo,alto,colSf,flashInst) {
	if (flashInst != "no") {
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + largo + '" height="' + alto + '" id="' + idFla + '" align="middle">');
		document.write('<param name="allowScriptAccess" value="sameDomain" />');
		document.write('<param name="movie" value="' + nome + '?rand=' + Math.random()*1000 + '" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="' + colSf + '" /><embed src="' + nome + '?rand=' + Math.random()*1000 + '" quality="high" bgcolor="' + colSf + '" width="' + largo + '" height="' + alto + '" wmode="transparent" name="' + idFla + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
		document.write('</object>');
	}
}




// alert con caratteri particolari
function alertCode(str) 
{
	var newDiv = document.createElement(newDiv);
	newDiv.innerHTML = str;

	var txt = newDiv.innerHTML;

	var re = /"/g; 
	txt.replace(re,'&quot;');

	var re2 = /'/g; 
	txt.replace(re2,'&#39;');

	return txt;	
}




// alpha
function alpha(id, opacity) {
	var object = document.getElementById(id).style;
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}

function bordo(id, colore) {
	var object = document.getElementById(id).style;
	object.border='1px solid ' + colore;
}




document.write('<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>');
