
var msg  = "<div id='spacer' style='width:100px; height:250px'></div>"
	msg += "<strong>You need to upgrade your Flash Player</strong><br/>"
	msg += "This web site require the Adobe Flash Player 8.0 plug-in.<br/>"
	msg += "You can download the plug-in by clicking on the link below.<br/><br/>"
	msg += "<a href='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW'>"
	msg += "<img src='splash/get_flash_player.gif' alt='Get Adobe Flash Player' border='0' />"
	msg += "</a>"


if(typeof ptx=="undefined"){
	var ptx=new Object();
}

if(typeof ptx.SWFObjectUtil=="undefined"){
	ptx.SWFObjectUtil=new Object();
}

ptx.SWFObject=function(swfAddress,swfId,swfWidth,swfHeight,swfVersion,swfBgcolor,swfOPT_Quality,swfOPT_RedirectUrl,swfOPT_RedirectEscapeValue){
	if(!document.getElementById){
		return;
	}
	
//se nell'indirizzo della pagina c'è il parametro detectflash = false, salta il controllo del plugin
this.DETECT_KEY=swfOPT_RedirectEscapeValue?swfOPT_RedirectEscapeValue:"detectflash";
this.skipDetect=ptx.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();

if(swfAddress){	this.setAttribute("swf", swfAddress);}
if(swfId){		this.setAttribute("id", swfId);}
if(swfWidth){	this.setAttribute("width", swfWidth);}
if(swfHeight){	this.setAttribute("height", swfHeight);}
if(swfVersion){	this.setAttribute("version",new ptx.PlayerVersion(swfVersion.toString().split(".")));}

if(swfBgcolor){	this.addParam("bgcolor",swfBgcolor);}

this.installedVer=ptx.SWFObjectUtil.getPlayerVersion();

var quality=swfOPT_Quality?swfOPT_Quality:"high";
this.addParam("quality",quality);


this.setAttribute("redirectUrl","");
if(swfOPT_RedirectUrl){this.setAttribute("redirectUrl",swfOPT_RedirectUrl);}};


ptx.SWFObject.prototype={
	
	setAttribute:function(_e,_f){ this.attributes[_e]=_f; },
	getAttribute:function(_10){ return this.attributes[_10]; },
	addParam:function(_11,_12){ this.params[_11]=_12; },
	getParams:function(){ return this.params; },
	addVariable:function(_13,_14){ this.variables[_13]=_14; },
	getVariable:function(_15){ return this.variables[_15]; },
	getVariables:function(){ return this.variables; },
	
	//crea un array di variabili che poi passa alla funzione getSWFHTML,
	//per poi essere scritte
 	getVariablePairs:function(){
		var arrVars=new Array();
		var varName;
		var varValue=this.getVariables();
		for(varName in varValue){
			arrVars.push(varName+"="+varValue[varName]); 
		}
		return arrVars;
		},
		
	getSWFHTML:function(){
		var txtHtml="";
		if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
			txtHtml="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
			txtHtml+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
			
			var _1a=this.getParams();
			for(var key in _1a){
				txtHtml+=[key]+"=\""+_1a[key]+"\" ";
			}
			var _1c=this.getVariablePairs().join("&");
			if(_1c.length>0){
				txtHtml+="flashvars=\""+_1c+"\"";
			}
			txtHtml+="/>";
		}else{

			txtHtml="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
			txtHtml+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
			var _1d=this.getParams();
			for(var key in _1d){txtHtml+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
			var _1f=this.getVariablePairs().join("&");
			if(_1f.length>0){
				txtHtml+="<param name=\"flashvars\" value=\""+_1f+"\" />";
			}
			txtHtml+="</object>";
			}
			return txtHtml;},
			
	write:function(txtToWrite){
		var loc = document.getElementById(txtToWrite)

		if(this.skipDetect||this.installedVer.versionIsValid(this.getAttribute("version"))){
			//var n=(typeof txtToWrite=="string")?document.getElementById(txtToWrite):txtToWrite;
			loc.innerHTML=this.getSWFHTML();
			return true;
		}else{
			//imposta un URL nel caso in cui si volesse reindirizzare la pagina in mancanza del plugin
			if(this.getAttribute("redirectUrl")!=""){
				document.location.replace(this.getAttribute("redirectUrl"));
			}else{
			loc.innerHTML=msg
			}
		}

		return false;}//fine write

};// fine ptx.SWFObject.prototype


ptx.SWFObjectUtil.getPlayerVersion=function(){
	var flVersionInstalled=new ptx.PlayerVersion([0,0,0]);
	if(navigator.plugins&&navigator.mimeTypes.length){
		var flPlugins=navigator.plugins["Shockwave Flash"];
		if(flPlugins&&flPlugins.description){
			flVersionInstalled=new ptx.PlayerVersion(flPlugins.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
			}else{
			//try catch block 01
			try{
				var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
			}catch(e){
				try{
					var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
					flVersionInstalled=new ptx.PlayerVersion([6,0,21]);
					axo.AllowScriptAccess="always";
				}catch(e){
					if(flVersionInstalled.major==6){
					return flVersionInstalled;
				}
			}
			//try catch block 02
			try{
				axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			}catch(e){
			}
			//fine try(01 e 02)
		}
	
		if(axo!=null){
			flVersionInstalled=new ptx.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return flVersionInstalled;
};


ptx.PlayerVersion=function(_27){
this.major=_27[0]!=null?parseInt(_27[0]):0;
this.minor=_27[1]!=null?parseInt(_27[1]):0;
this.rev=_27[2]!=null?parseInt(_27[2]):0;
};
ptx.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){
return false;
}return true;};

ptx.getRequestParameter=function(_29){
	
	var q=document.location.search||document.location.hash;
	if(q){
		var _2b=q.substring(1).split("&");
		
		for(var i=0;i<_2b.length;i++){
			if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
				return _2b[i].substring((_2b[i].indexOf("=")+1));
			}
		}
	}
	
	return "";
};




if(Array.prototype.push==null){
	Array.prototype.push=function(_31){
		this[this.length]=_31;
		return this.length;
	};
}
var getQueryParamValue=ptx.getRequestParameter;
var SWFObject=ptx.SWFObject;


