var PluginObject=function(src,options){this.options={version:1,version_fail_message:'The current version of the %PluginType% plugin is too old. You currently have version %PluginVersion% but you need at least version %PluginRequiredVersion% to view this plugin. We suggest that you upgrade %PluginType% to the latest version. To upgrade please <a href="%PluginUpgradeUrl%" target="_blank">click here</a>. However, you may wish to try running the plugin in your current version <a href="%PluginObjectNoDetectUrl%">click here</a>.',version_fail_redirect:false,detect_key:'detect_plugin',auto_embed:true,embed_id:undefined,memorise_detect_status:true,cookie_expiry:new Date().getTime()+31449600000,cookie_path:'/',cookie_domain:null,cookie_secure:false,placeholder:false,placeholder_alt:'PluginObject placeholder.',placeholder_title:'Click to view plugin.',width:100,height:100,id:null,use_plugin:null,file_extension:null,params:{},variables:{},attributes:{}};this.Controller=null;this.Plugin=null;this._id=null;this._initiate(src,options)};PluginObject.Plugins=new Object();PluginObject.Controls=new Object();PluginObject.References=new Object();RETURN_HTML=-1239876450;PluginObject.prototype={Version:'1.0.0',_events:{},registerEvent:function(event,object){this._events[event]=object},hasEvent:function(event){return typeof this._events[event]!='undefined'},dispatchEvent:function(event,args){if(this._events[event]){if(typeof this._events[event].func=='function'){return this._events[event].func.apply(this._events[event].obj,args)}}return null},removeEvent:function(event){delete this._events[event]},setMany:function(type,object){for(var i in object){this.options[type][i]=object[i]}},setAttributes:function(object){this.setMany('attributes',object)},setAttribute:function(name,value){this.options.attributes[name]=value},getAttribute:function(name){return this.options.attributes[name]},addParams:function(object){this.setMany('params',object)},addParam:function(name,value){this.options.params[name]=value},getParams:function(){return this.options.params},addVariables:function(object){this.setMany('variables',object)},addVariable:function(name,value){this.options.variables[name]=value},getVariable:function(name){return this.options.variables[name]},getVariables:function(){return this.options.variables},getVariablePairs:function(){var variablePairs=[];var key;var variables=this.getVariables();for(key in variables){variablePairs.push(key+"="+variables[key])}return variablePairs},_initiate:function(src,options){if(!document.createElement||!document.getElementById){return}this.options.id='PluginObject_'+PluginObject.Util.generateRandomID(20);this._id=PluginObject.Util.generateRandomID(20);PluginObject.Util.mergeObjects(this.options,options||{});var alias=this.options.use_plugin!=null?this.options.use_plugin:false;this.use_plugin=PluginObject.Util.getPluginType(src,alias,this.options.file_extension);this.options.detect_key+='_'+this.use_plugin.toLowerCase();var detection=PluginObject.Util.getRequestParameter(this.options.detect_key);this.skip_detect=detection=='false';if(detection=='true'||detection=='false'){if(this.options.memorise_detect_status){var t=new Date().getTime();var e=this.options.cookie_expiry;var c='PluginObject'+this.use_plugin+'Memory='+detection+'; expires='+new Date((t>e?t+e:e)).toGMTString()+(this.options.cookie_path?'; path='+this.options.cookie_path:'')+(this.options.cookie_domain?'; domain='+this.options.cookie_domain:'')+(this.options.cookie_secure?'; secure':'')}}else{if(this.options.memorise_detect_status){var p=document.cookie.indexOf(escape('PluginObject'+this.use_plugin+'Memory')+'=');var cv=false;if(p!=-1){var pv=p+'PluginObject'+this.use_plugin+'Memory='.length;var ep=document.cookie.indexOf(';',pv);if(ep!=-1){cv=unescape(document.cookie.substring(pv,ep))}else{cv=unescape(document.cookie.substring(pv))}this.skip_detect=true}}}this.setAttribute('src',src);if(this.options.element_id){this.setAttribute('id',this.options.element_id)}else{this.setAttribute('id','PluginObject_plugin_'+this._id)}this.setAttribute('width',this.options.width);this.setAttribute('height',this.options.height);if(this.options.version){this.setAttribute('version',new PluginObject.Util.PlayerVersion(this.options.version.toString().split('.')))}else{this.setAttribute('version',new PluginObject.Util.PlayerVersion([1,0,0]))}this.Plugin=new PluginObject.Plugins[this.use_plugin]();this._absorbUncommonFunctions();if(typeof PluginObject.Controls[this.use_plugin]=='function'){this.Controller=new PluginObject.Controls[this.use_plugin]()}this.Plugin._initiate(this,src,this.options);this.setAttribute('classid',this.options._class_id);this.setAttribute('type',this.options._type);if(this.options.auto_embed){this.write(this.options.embed_id)}},_absorbUncommonFunctions:function(){for(var i in this.Plugin){if(i.substr(0,1)=='__'){if(typeof this.Plugin[i]=='function'){this[i]=function(){var args=arguments;args.push(this);this.Plugin[i.substr(2,i.length)].apply(this.Plugin,args)}}}}},_activateFromPlaceholder:function(){this.options.placeholder=null;var activate=true;if(this.hasEvent('placeholderActivation')){activate=this.dispatchEvent('placeholderActivation',[this,'PluginObject_placeholder_'+this._id,'PluginObject_wrapper_'+this._id])}if(activate){this.activate()}},activate:function(){document.getElementById('PluginObject_placeholder_'+this._id).style.display='none';if(!this.options.element_id){this.options.embed_id='PluginObject_wrapper_'+this._id}else{this.options.embed_id=this.options.element_id}this.write(this.options.embed_id)},_getPlaceholderHTML:function(){var html;if(!(html=this.dispatchEvent('prePlaceholderHTML',[this]))){PluginObject.References[this._id]=this;if(typeof this.Plugin._getPlaceholderHTML=='function'){html=this.Plugin._getPlaceholderHTML(this)}else{html='<img id="PluginObject_placeholder_'+this._id+'" src="'+this.options.placeholder+'" width="'+this.options.width+'" height="'+this.options.height+'" title="'+this.options.placeholder_title+'" alt="'+this.options.placeholder_alt+'" style="cursor:pointer;" onclick="PluginObject.References[\''+this._id+'\']._activateFromPlaceholder();" />'}if(!this.options.element_id){html='<div id="PluginObject_wrapper_'+this._id+'">'+html+'</div>'}var modified_html;if((modified_html=this.dispatchEvent('postPlaceholderHTML',[html]))){html=modified_html}}return html},write:function(element_id){var element;if(typeof element_id=='string'){if(!(element=document.getElementById(element_id))){throw('PluginObject [ERROR] - PluginObject was unable to write the '+this.use_plugin+' plugin ('+this.getAttribute('src')+') to "'+element_id+'" because the element was not found in the DOM.')}}this.dispatchEvent('preWriteGet',[]);if(this.skip_detect||this.Plugin._detect(this,this.getAttribute('version'))){var init_controller=false;if(this.options.placeholder){this.pluginHTML=this._getPlaceholderHTML()}else{this.pluginHTML=this._getHTML();init_controller=true}var modified_html;if((modified_html=this.dispatchEvent('preWrite',[this,this.pluginHTML,(this.options.placeholder)]))){this.pluginHTML=modified_html}if(element_id===RETURN_HTML){return this.pluginHTML}if(typeof element=='undefined'){if(!PluginObject.Util.document_has_loaded){document.write(this.pluginHTML)}else{throw('PluginObject [ERROR] - PluginObject was unable to write the '+this.use_plugin+' plugin ('+this.getAttribute('src')+') because the element the page has already loaded. You must specify an "embed_id" for PluginObject to write into.')}}else{element.innerHTML=this.pluginHTML}this.dispatchEvent('postWrite',[this,element_id,(this.options.placeholder)]);if(init_controller){if(this.Controller!=null){if(this.Controller._initiate){this.Controller._initiate(element_id,PluginObject.References[this._id])}}}return true}else{if(this.options.version_fail_redirect){document.location.replace(this.options.version_fail_redirect)}else{var message=this.options.version_fail_message;message=message.split('%PluginType%').join(this.use_plugin);message=message.split('%PluginVersion%').join(this.installedVer.toString());message=message.split('%PluginRequiredVersion%').join(this.getAttribute('version'));message=message.split('%PluginUpgradeUrl%').join(this.options.upgrade_url);var url=document.location.href;url+=(url.indexOf('?')==-1?'?':'&')+this.options.detect_key+'=false';message=message.split('%PluginObjectNoDetectUrl%').join(url);if(typeof element=='undefined'){if(!PluginObject.Util.document_has_loaded){document.write(message)}else{}}else{element.innerHTML=message}}}return false},_getHTML:function(embedable,force_embed){if(typeof this.Plugin._getHTML=='function'){return this.Plugin._getHTML(this,embedable,force_embed)}var html='';var params=this.getParams();if((PluginObject.Util.is_netscape&&!embedable)||force_embed){this.dispatchEvent('preNetscapeBuild',[this]);html='<embed type="'+this.getAttribute('type')+'" src="'+this.getAttribute('src')+'" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'"';html+=' id="'+this.getAttribute('id')+'" name="'+this.getAttribute('id')+'" ';for(var key in params){html+=[key]+'="'+params[key]+'" '}html+='/>';this.dispatchEvent('postNetscapeBuild',[this])}else{this.dispatchEvent('preExplorerBuild',[this]);html='<object id="'+this.getAttribute('id')+'" classid="'+this.getAttribute('classid')+'" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'">';html+='<param name="src" value="'+this.getAttribute('src')+'" />';for(var key in params){html+='<param name="'+key+'" value="'+params[key]+'" />'}if(embedable){html+=this._getHTML(embedable,true)}html+="</object>";this.dispatchEvent('postExplorerBuild',[this])}return html},getEmbedCode:function(){return this._getHTML(true).split(' id="'+this.getAttribute('id')+'"').join('').split(' name="'+this.getAttribute('id')+'"').join('')},getMySpaceEmbedCode:function(){return this._getHTML(false,true).split(' id="'+this.getAttribute('id')+'"').join('').split(' name="'+this.getAttribute('id')+'"').join('')}};PluginObject.prototype.embed=PluginObject.prototype.write;if(Array.prototype.push==null){Array.prototype.push=function(item){this[this.length]=item;return this.length}}if(Array.prototype.inArray==null){Array.prototype.inArray=function(item){var l=this.length;for(var i=0;i<l;i++){if(this[i]==item){return true}}return false}}PluginObject.Util=new Object();PluginObject.Util={ExtensionTranslation:{},AliasTranslation:{},is_netscape:!(!(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length)),oldLoad:function(){},getRequestParameter:function(param){var q=document.location.search||document.location.hash;if(q){var startIndex=q.indexOf(param+'=');var endIndex=(q.indexOf('&',startIndex)>-1)?q.indexOf('&',startIndex):q.length;if(q.length>1&&startIndex>-1){return q.substring(q.indexOf('=',startIndex)+1,endIndex)}}return''},getPluginType:function(src,alias,extension){if(alias){var obj=PluginObject.Util.AliasTranslation;var ref=alias}else{var obj=PluginObject.Util.ExtensionTranslation;if(!extension){var qmark_pos=src.indexOf('?');if(qmark_pos!=-1){src=src.substr(0,qmark_pos)}ref=src.split('.').pop().toLowerCase()}else{ref=extension}}for(var plugin in obj){if(obj[plugin].inArray(ref)){return plugin}}if(alias){throw('PluginObject [ERROR] : "'+extension+'" is not an alias of a known plugin type.')}else{throw('PluginObject [ERROR] : There is no plugin associated with files that have the extension "'+extension+'".')}return null},mergeObjects:function(destination,source){for(var property in source){destination[property]=source[property]}return destination},observeEvent:function(element,name,observer,useCapture){if(element.addEventListener){element.addEventListener(name,observer,useCapture)}else if(element.attachEvent){element.attachEvent('on'+name,observer)}},generateRandomID:function(len){var source='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789012345678901234567890123456789'.split('');var total=source.length;var str='';for(var i=0;i<len;i++){var index=Math.floor(Math.random()*total);str+=source[index]}return str}};PluginObject.Util.PlayerVersion=function(arrVersion){this.major=parseInt(arrVersion[0])!=null?parseInt(arrVersion[0]):0;this.minor=parseInt(arrVersion[1])||0;this.rev=parseInt(arrVersion[2])||0};PluginObject.Util.PlayerVersion.prototype.versionIsValid=function(version){if(this.major<version.major){return false}if(this.major>version.major){return true}if(this.minor<version.minor){return false}if(this.minor>version.minor){return true}if(this.rev<version.rev){return false}return true};PluginObject.Util.PlayerVersion.prototype.toString=function(){return this.major+'.'+this.minor+'.'+this.rev};PluginObject.Util.document_has_loaded=false;PluginObject.Util.observeEvent(window,'load',function(){PluginObject.Util.document_has_loaded=true});var GET=PluginObject.Util.getRequestParameter;PluginObject.Util.ExtensionTranslation.Flash=['swf'];PluginObject.Util.AliasTranslation.Flash=['swf','flash'];PluginObject.Plugins.Flash=function(){};PluginObject.Plugins.Flash.prototype={options:{upgrade_url:'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash',_class_id:'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000',_type:'application/x-shockwave-flash',quality:'high',use_express_install:false,do_express_install:false,xi_redirect_url:window.location},_initiate:function(constructor,src,options){PluginObject.Util.mergeObjects(constructor.options,this.options||{});constructor.installedVer=this._getPlayerVersion(constructor);constructor.addParam('quality',constructor.options.quality);var colour=constructor.options.bgcolor?constructor.options.bgcolor:(constructor.options.bgcolour?constructor.options.bgcolour:false);if(colour){constructor.addParam('bgcolor',constructor.options.bgcolor)}constructor.setAttribute('useExpressInstall',constructor.options.use_express_install);constructor.setAttribute('doExpressInstall',constructor.options.do_express_install);constructor.setAttribute('xiRedirectUrl',constructor.options.xi_redirect_url);constructor.registerEvent('preExplorerBuild',{func:function(constructor){if(constructor.getAttribute('do_express_install')){constructor.addParam('MMplayerType','ActiveX');constructor.addParam('wmode','transparent')}var pairs=constructor.getVariablePairs().join('&');if(pairs.length>0){constructor.addParam('flashvars',pairs)}}});constructor.registerEvent('preNetscapeBuild',{func:function(constructor){if(constructor.getAttribute('do_express_install')){constructor.addVariable('MMplayerType','PlugIn')}var pairs=constructor.getVariablePairs().join('&');if(pairs.length>0){constructor.addParam('flashvars',pairs)}}})},_getPlayerVersion:function(constructor){var PlayerVersion=new PluginObject.Util.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){PlayerVersion=new PluginObject.Util.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{try{var axo=new ActiveXObject('ShockwaveFlash.ShockwaveFlash');for(var i=3;axo!=null;i++){axo=new ActiveXObject('ShockwaveFlash.ShockwaveFlash.'+i);PlayerVersion=new PluginObject.Util.PlayerVersion([i,0,0])}}catch(e){}var reqVer=constructor.getAttribute('version');if(reqVer&&PlayerVersion.major>reqVer.major){return PlayerVersion}if(!reqVer||((reqVer.minor!=0||reqVer.rev!=0)&&PlayerVersion.major==reqVer.major)||PlayerVersion.major!=6||constructor.options.use_express_install){try{PlayerVersion=new PluginObject.Util.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","))}catch(e){}}}return PlayerVersion},_detect:function(constructor,version){return(constructor.installedVer.versionIsValid(version))}};PluginObject.Util.cleanupSWFs=function(){var objects=document.getElementsByTagName('object');for(var i=0;i<objects.length;i++){for(var x in objects[i]){if(typeof objects[i][x]=='function'){objects[i][x]=null}}}};PluginObject.Util.observeEvent(window,'unload',function(){PluginObject.Util.cleanupSWFs()});