// b3rtFlashLoader 1.2
// Copyright 2008, H. poort
// This software may not be used without a valid license

function b3rtFlashLoader(){this.swfLocation='';this.containerId='';this.width=-1;this.height=-1;this.elementId='';this.codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0';this.pluginspage='http://www.macromedia.com/go/getflashplayer';this.versionMajor=-1;this.versionMinor=-1;this.versionRevision=-1;this.isCorrectVersion=true;this.incorrectVersionMessage='';this.params={};this.flashVars={};this.calculateVersion()};b3rtFlashLoader.prototype.setParam=function(a,b){this.params[a]=b};b3rtFlashLoader.prototype.getParam=function(a){if(a in this.params)return this.params[a];else return null};b3rtFlashLoader.prototype.setFlashVar=function(a,b){this.flashVars[a]=b};b3rtFlashLoader.prototype.getFlashVar=function(a){if(a in this.flashVars)return this.flashVars[a];else return null};b3rtFlashLoader.prototype.wantVersion=function(a,b,c,d,e){if(this.versionMajor<a)this.isCorrectVersion=false;if(((typeof b)!='undefined')&&(this.versionMajor==a)&&(this.versionMinor<b))this.isCorrectVersion=false;if(((typeof c)!='undefined')&&(this.versionMajor==a)&&(this.versionMinor==b)&&(this.versionRevision<c))this.isCorrectVersion=false;if((typeof d)=='string')this.incorrectVersionMessage=d;if(e)this.incorrectVersionMessage+=this.versionMajor+'.'+this.versionMinor+'.'+this.versionRevision;return this.isCorrectVersion};b3rtFlashLoader.prototype.calculateVersion=function(){var a=[];if((typeof window.ActiveXObject)=='function'){var b=null;try{b=new ActiveXObject('ShockwaveFlash.ShockwaveFlash')}catch(ex){}if(b){var c=b.GetVariable('$version');if(c)a=c.replace(new RegExp('([a-z]+\\s+)','gi'),'').split(',')}}else if((typeof navigator.plugins)=='object'){if(((typeof navigator.plugins['Shockwave Flash'])=='object')&&((typeof navigator.plugins['Shockwave Flash'].description)=='string')){var d=navigator.plugins['Shockwave Flash'];a=d.description.replace(new RegExp('([a-z]+\\s+)','gi'),'').replace(new RegExp('\\s+r|\\s+b[0-9]+','gi'),'.').split('.')}}if(a.length>=3){this.versionMajor=parseInt(a[0]);this.versionMinor=parseInt(a[1]);this.versionRevision=parseInt(a[2])}};b3rtFlashLoader.prototype.checkConfiguration=function(){if(((typeof this.swfLocation)!='string')||!this.swfLocation)return false;if(((typeof this.containerId)!='string')||!this.containerId)return false;if((typeof this.width)!='number')return false;if((typeof this.height)!='number')return false;if((typeof this.elementId)!='string')return false;return true};b3rtFlashLoader.prototype.go=function(){if(!this.checkConfiguration())return false;if(!this.isCorrectVersion){if(this.incorrectVersionMessage.length>0)alert(this.incorrectVersionMessage);return false}var a=document.getElementById(this.containerId);if(!a)return false;var b=[];for(var c in this.flashVars)b[b.length]=c+'='+this.flashVars[c];var d='';d+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';if(this.width>-1)d+=' width="'+this.width+'"';if(this.height>-1)d+=' height="'+this.height+'"';if(this.elementId)d+=' id="'+this.elementId+'"';if(this.codebase)d+=' codebase="'+this.codebase+'"';d+='>';d+='<param name="movie" value="'+this.swfLocation+'" />';for(var e in this.params)d+='<param name="'+e+'" value="'+this.params[e]+'" />';if(b.length)d+='<param name="flashvars" value="'+b.join('&')+'" />';d+='<embed type="application/x-shockwave-flash" src="'+this.swfLocation+'"';if(this.width>-1)d+=' width="'+this.width+'"';if(this.height>-1)d+=' height="'+this.height+'"';if(this.elementId)d+=' id="'+this.elementId+'"';if(this.pluginspage)d+=' pluginspage="'+this.pluginspage+'"';for(var e in this.params)d+=' '+e+'="'+this.params[e]+'"';if(b.length)d+=' flashvars="'+b.join('&')+'"';d+='></embed>';d+='</object>';a.innerHTML=d;return true};