function PluginEmbeder(){
//alert(navigator.plugins.length)
/*axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
alert( axo.GetVariable("$flashVer"));return*/
this.detectVersion=[]
this.pluginComMethod="none"//auto - javascript/fscommand zależnie od browsera|javascript
this.type="application/x-shockwave-flash"
this.attributes={}
this.addAttribute=function(n,v){
	this.attributes[n]=v
}
this.variables={}
this.addVariable=function(n,v){
	this.variables[n]=v
}
this.getHTML=function(){
	var ua={}
	ua.ie=/msie/.test(navigator.userAgent.toLowerCase())
	if(window.location.search.indexOf("debug-flex")>-1){
		var re=/\/(.*)\.swf/
		re.test(this.attributes["file"])
		//String(this.attributes["file"]).
	}
	//alert(ua.ie)
	ua.win=ua.ie && /windows/.test(navigator.userAgent.toLowerCase())
	if(this.detectVersion.length==3){
		var detector=new adobe.FlashVerDetector()
		var isRequired=detector.compare(this.detectVersion[0],this.detectVersion[1],this.detectVersion[2])
		var isAutoInstall=detector.isAutoInstall()
		if(!isRequired && window.pluginEmbederDetectNoValidVersion){
			return ""
		}
		if(!isRequired && !window.pluginEmbederDetectNoValidVersion){
			window.pluginEmbederDetectNoValidVersion=true
			if (!isRequired && isAutoInstall && ua.ie) {
		    this.addVariable("MMdoctitle",document.title)
			document.title =  "Flash Player Install - "+document.title;
			this.addVariable("MMredirectURL",window.location)
			this.addVariable("MMplayerType",ua.ie ? "ActiveX" : "PlugIn")
			this.addAttribute("file","/modules/PluginEmbeder/playerProductInstall.swf")
		}else if(!isRequired){
			var str="<a href='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash'>"
			str+="<img src='/modules/PluginEmbeder/pobierz_pl.gif' border='0' alt='Get Flash Player'/>"
			str+="</a>"
			return str
		}
		}
		
}

	var str='<object type="'+this.type+'" width="'+this.attributes.width+'" height="'+this.attributes.height+'"' 
	
	if(!ua.ie){
		str+=' data="'+this.attributes.file+'"'
	}
	if(this.attributes.id){
		str+=' id="'+this.attributes.id+'" name="'+this.attributes.id+'"'
		if(this.pluginComMethod=="auto"){
			if(ua.win){
				this.addVariable("canUseFscommand","true")
			}else{
				this.addVariable("fscommandFunctionName",this.attributes.id+"_DoFSCommand")
			}
		}else if(this.pluginComMethod=="javascript"){
			this.addVariable("fscommandFunctionName",this.attributes.id+"_DoFSCommand")
		}
	}
	if(this.attributes.style){
		str+=' style="'+this.attributes.style+'"'
	}
	if(this.attributes.className){
		str+=' class="'+this.attributes.className+'"'
	}
	str+='>'
	str+='<param name="movie" value="'+this.attributes.file+'" />'
	if(this.type=="application/x-shockwave-flash"){
		var re=/file|width|height|id|style|class/
		for(var el in this.attributes){
			if(re.test(el)){
				continue;
			}
			str+='<param name="'+el+'" value="'+this.attributes[el]+'" />'
		}
		
		var fva=new Array()
		for(var el in this.variables){
			fva.push(el+"="+this.variables[el])
		}
		if(fva.length>0){
			str+='<param name="flashvars" value="'+fva.join("&")+'" />'
		}
	}
	
	
	str+='</object>'
	//alert(str)
	return str
}
this.assignToElement=function(elId){
	document.getElementById(elId).innerHTML=this.getHTML()
}
this.getRef=function(){
	if(navigator.appName.indexOf("Microsoft") != -1){
		return window[this.attributes.id]
	}else{
		return document[this.attributes.id]
	}	
}
}
