var FlashSnifferURL = "detectFlash.swf";
var latestPluginRevision = new Object();
latestPluginRevision["6.0"] = new Object();
latestPluginRevision["5.0"] = new Object();
latestPluginRevision["4.0"] = new Object();
latestPluginRevision["3.0"] = new Object();
latestPluginRevision["2.0"] = new Object();
latestPluginRevision["6.0"]["Windows"] = 47;
latestPluginRevision["6.0"]["Macintosh"] = 47;
latestPluginRevision["5.0"]["Windows"] = 42;
latestPluginRevision["5.0"]["Macintosh"] = 41;
latestPluginRevision["4.0"]["Windows"] = 28;
latestPluginRevision["4.0"]["Macintosh"] = 27;
latestPluginRevision["4.0"]["Unix"] = 12;
latestPluginRevision["3.0"]["Windows"] = 10;
latestPluginRevision["3.0"]["Macintosh"] = 10;
latestPluginRevision["2.0"]["Windows"] = 11;
latestPluginRevision["2.0"]["Macintosh"] = 11;
var flashControlInstalled;
var flashControlVersion;
function flashInfo() {
	if ( navigator.plugins && navigator.plugins.length > 0 ) {
		this.implementation = "Plug-in";
		this.autoInstallable = false;
		if ( navigator.plugins["Shockwave Flash"] ) {
			this.installed = true;
			var words = navigator.plugins["Shockwave Flash"].description.split( " " );
			for ( var i = 0; i < words.length; ++i ) {
				if ( isNaN( parseInt( words[i] ) ) ) {
					continue;
				}
				this.version = words[i];
				this.revision = parseInt(words[i + 1].substring(1));
			}
		} else {
			this.installed = false;
		}
	} else if ( flashControlInstalled != null ) {
		this.implementation = "ActiveX control";
		this.installed = flashControlInstalled;
		this.version = flashControlVersion;
		this.autoInstallable = true;
	} else if ( flashDetectedSelf() ) {
		this.installed = true;
		this.implementation = "Plug-in";
		this.autoInstallable = false;
	}
	this.canPlay = flashCanPlay;
}
var flashPluginsPage = "http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash";
function flashDispatch( contentURL, contentVersion, requireLatestRevision, upgradeURL, install, installURL, altURL, overridePluginsPage, disableAutoInstall ) {
	if ( disableAutoInstall == null ) {
		alert( "Numero errato di argomenti per la versione flashDispatch()" );
		return;
	}
	if ( overridePluginsPage && installURL.substring( 0, 7 ) != "http://" ) {
		alert( "Riferimento relativo o errato alla pagina " + installURL + ": funzione flashDispatch()");
		return;
	}
	var player = new flashInfo();
	if ( player.installed == null ) {
		var sniffer =
			'<embed hidden="true" type="application/x-shockwave-flash"' +
			' width="18" height="18"' +
			' bgcolor=' + document.bgcolor + '"' +
			' src="' + FlashSnifferURL +
			'?contentURL=' + contentURL + '?' +
			'&contentVersion=' + contentVersion +
			'&requireLatestRevision=' + requireLatestRevision +
			'&latestRevision=' + flashLatestPluginRevision( contentVersion ) +
			'&upgradeURL=' + upgradeURL + '"' +
			' loop="false" menu="false"' +
			' pluginspage="' + ( overridePluginsPage ? installURL : flashPluginsPage ) +
			'"></embed>';
			document.open();
			document.write( '<html><head><title>' );
			document.write( 'Checking for the Flash Player' );
			document.write( '</title></head>' );
			document.write( '<body bgcolor="' + document.bgcolor + '">' );
			document.write( sniffer );
			document.write( '</body>' );
			document.write( '</html>' );
			document.close();
	} else if ( player.installed ) {
		if ( player.canPlay( contentVersion, requireLatestRevision ) ) {
			location = contentURL;
		} else {
			if ( disableAutoInstall ) {
				location = upgradeURL;
			} else {
				location = player.autoInstallable ? contentURL : upgradeURL;
			}
		}
	} else if ( install ) {
		if ( disableAutoInstall ) {
			location = installURL;
		} else {
			location = player.autoInstallable ? contentURL : installURL;
		}
	} else {
		location = altURL;
	}
}
function flashRememberIfDetectedSelf( count, units ) {
	if ( document.location.search.indexOf( "?" ) != - 1 ) {
		if ( ! count ) {
			count = 60;
		}
		if ( ! units ) {
			units = "days";
		}
		var msecs = new Object();
		msecs.minute = msecs.minutes = 60000;
		msecs.hour = msecs.hours = 60 * msecs.minute;
		msecs.day = msecs.days = 24 * msecs.hour;
		var expires = new Date();
		expires.setTime( expires.getTime() + count * msecs[units] );
		document.cookie = 'FlashDetectedSelf=true ; expires=' + expires.toGMTString();
	}
}
function flashDemur( count, units ) {
	if ( ! count ) {
		count = 60;
	}
	if ( ! units ) {
		units = "days";
	}
	var msecs = new Object();
	msecs.minute = msecs.minutes = 60000;
	msecs.hour = msecs.hours = 60 * msecs.minute;
	msecs.day = msecs.days = 24 * msecs.hour;
	var expires = new Date();
	expires.setTime( expires.getTime() + count * msecs[units] );
	document.cookie = 'FlashUserDemurred=true ; expires=' + expires.toGMTString();
	if ( ! FlashUserDemurred() ) {
		alert("Your browser must accept cookies in order to save this information.  Try changing your preferences.");
		return false;
	} else {
		return true;
	}
}
function flashUserDemurred() {
	return ( document.cookie.indexOf( "FlashUserDemurred" ) != - 1 );
}
function flashLatestPluginRevision( playerVersion ) {
	var latestRevision;
	var platform;
	if (navigator.appVersion.indexOf( "Win" ) != - 1 ) {
		platform = "Windows";
	} else if ( navigator.appVersion.indexOf( "Macintosh" ) != - 1 ) {
		platform = "Macintosh";
	} else if ( navigator.appVersion.indexOf( "X11" ) != - 1 ) {
		platform = "Unix";
	}
	latestRevision = latestPluginRevision[playerVersion][platform];
	return latestRevision;
}
function flashCanPlay( contentVersion, requireLatestRevision ) {
	var canPlay;
	if ( this.version ) {
		canPlay = ( parseInt( contentVersion ) <= this.version );
		if ( requireLatestRevision ) {
			if ( this.revision && this.revision < flashLatestPluginRevision( this.version ) ) {
				canPlay = false;
			}
		}
	} else {
		canPlay = flashDetectedSelf();
	}
	return canPlay;
}
function flashDetectedSelf() {
	return ( document.cookie.indexOf("flashDetectedSelf") != - 1 );
}
function changeMovie2Image( id, imageName ) {
	player = new flashInfo();
	if ( ! player.canPlay( '6.0',false ) ) {
		document.getElementById( id ).innerHTML = '<img src="' + imageName + '" alt="Filmato flash non visualizabile" />';
	}
}