﻿var Flash_Code={initialize:function(){this.$_required_player_version='6,0,65,0';this.$_notice_message='An update to Adobe\u00AE Flash Player is available.\n\nWould you like to download it now?';this.$_download_uri='http://www.adobe.com/products/flashplayer/';this.$_properties={'attributes':{'object_only':{'classid':'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000','codebase':'','standby':'Loading media...'},'embed_only':{'name':'','pluginspage':Flash_Code.$_download_uri,'src':'','swliveconnect':'true'},'common':{'align':'','height':'','type':'application/x-shockwave-flash','width':''},'event_handler':{'onkeydown':'','onkeypress':'','onkeyup':'','onclick':'','ondblclick':'','onmousedown':'','onmousemove':'','onmouseout':'','onmouseover':'','onmouseup':''},'core':{'accesskey':'','class':'','dir':'','id':'','lang':'','style':'','tabindex':'','title':''}},'parameters':{'object_only':{'movie':''},'embed_only':{},'common':{'allowfullscreen':'','allownetworking':'','allowscriptaccess':'','base':'.','bgcolor':'','devicefont':'false','flashvars':'','loop':'false','menu':'false','play':'true','quality':'best','salign':'','scale':'showall','seamlesstabbing':'true','wmode':'transparent'}},'extra':{'playerversion':Flash_Code.$_required_player_version},'defaults':{}}},embedMovie:function(a,b,c){var d='';if(this.isInstalledPlayerSuitable(a.playerversion)){var e;if(!this.announceMissingProperties(a)){d=this.getCode(a);if(this.isString(b)){e=this.isObject(self.document.getElementById)?self.document.getElementById(b):null;if(!this.isObject(e)){d='\n<div id="'+b+'">'+d+'</div>\n'}}if(this.isObject(e)){e.innerHTML=d;this.showElement(e,e.style.display)}else{self.document.write(d)}}}else{this.doFlashAlternate(c)}return d},getRequiredPlayerVersion:function(){return this.$_required_player_version},setRequiredPlayerVersion:function(a){var b=this.getFormattedVersion(a);if(this.isString(b)){this.$_required_player_version=b}},isInstalledPlayerSuitable:function(a){var b=false;var c=this.getInstalledPlayerVersion();if(this.isString(c)){var d=this.getVersionAsObject(c);if(this.isObject(d)){this.setRequiredPlayerVersion(a);var e=this.getVersionAsObject(this.getRequiredPlayerVersion());var f='';if(this.isObject(e)){b=true;for(f in e){if(parseInt(d[f],10)<parseInt(e[f],10)){b=false;break}}}}}return b},getInstalledPlayerVersion:function(){var a=this.getPluginVersion();if(!this.isString(a)){a=this.getActiveXObjectVersion()}return a},getPluginVersion:function(){var a='';if(this.isArray(self.navigator.plugins)){for(var b=0;b<self.navigator.plugins.length;b++){if(self.navigator.plugins[b].name.indexOf('Shockwave Flash')===0){a=this.getFormattedVersion(self.navigator.plugins[self.navigator.plugins[b].name].description);break}}}return a},getActiveXObjectVersion:function(){var a='';if(self.navigator.appVersion.hasSubstring('win')&&self.navigator.appVersion.hasSubstring('msie')){if(!self.navigator.userAgent.hasSubstring('opera')){var b;var c='';var d=new Date().getFullYear()-1970;var e={'2':'2,0,0,11','3':'3,0,18,0','4':'4,0,11,0','6':'6,0,21,0'};var f=new Error();for(var g=d;g>0;g--){c=g.toString();try{b=new ActiveXObject('ShockwaveFlash.ShockwaveFlash'+(g<=2?'':'.'+c));if(this.isString(e[c])){a=e[c]}switch(g){case 2:case 3:case 4:break;case 6:b.AllowScriptAccess='always';default:a=this.getFormattedVersion(b.GetVariable('$version'));break}break}catch(f){continue}}}}return a},getFormattedVersion:function(a){var b='';if(this.isString(a)){var c=a.match(/([\d]+)/g);if(c.length>0&&parseInt(c[0],10)>=2){if(c.length==2){c.splice(1,0,'0')}while(c.length<4){c.push('0')}c.length=4;b=c.join(',')}}return b},getVersionAsObject:function(a){var b={};var c=this.getFormattedVersion(a);if(this.isString(c)){var d=c.split(',');b={major:d[0],minor:d[1],revision:d[2],build:d[3]}}return b},displayNotice:function(a){if(confirm(this.isString(a)?a:this.$_notice_message)){self.location.href=this.$_download_uri}},getCode:function(a){var b='';var c=this.getProperties(this.getDefaultProperties(),a);var d=this.$_properties.attributes;var e=this.$_properties.parameters;this.setRequiredPlayerVersion(c.playerversion);c.codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.getRequiredPlayerVersion();c.name=c.id;c.src=c.movie;b+='\n<object';b+=this.getAttributeCode(d.object_only,c);b+=this.getAttributeCode(d.common,c);b+=this.getAttributeCode(d.core,c);b+=this.getAttributeCode(d.event,c);b+='>\n';b+=this.getParameterCode(e.object_only,c);b+=this.getParameterCode(e.common,c);b+='  <embed';b+=this.getAttributeCode(d.embed_only,c);b+=this.getAttributeCode(d.common,c);b+=this.getAttributeCode(e.common,c);b+=this.getAttributeCode(d.core,c);b+=' />\n';b+='</object>\n';return b},getAuxiliaryCode:function(a,b,c){var d='';var e='';a=a.toLowerCase();for(e in b){if(this.isString(c[e])){switch(a){case'attribute':d+=' '+e+'="'+c[e]+'"';break;case'parameter':d+='  <param name="'+e+'" value="'+c[e]+'" />\n';break}}}return d},getAttributeCode:function(a,b){return this.getAuxiliaryCode('attribute',a,b)},getParameterCode:function(a,b){return this.getAuxiliaryCode('parameter',a,b)},getDefaultProperties:function(a){var b='';if(arguments[arguments.length-1]!=arguments.callee){a=this.$_properties}for(b in a){if(typeof a[b]=='string'){Flash_Code.$_properties.defaults[b]=a[b]}else{if(Flash_Code.isObject(a[b])){arguments.callee(a[b],arguments.callee)}}}if(arguments[arguments.length-1]!=arguments.callee){return this.$_properties.defaults}},getProperties:function(a,b){var c={};var d='';for(d in a){c[d]=a[d]}for(d in b){if(this.isString(b[d])||this.isPositiveNumber(b[d])){c[d]=b[d].toString()}}return c},announceMissingProperties:function(a){var b=null;var c=[];var d={movie:'string',width:'number',height:'number'};var e='';b=false;for(e in d){if(!this.isString(a[e])||(d[e]=='number'&&!this.isPositiveNumber(parseInt(a[e],10)))){c.push(e)}}if(this.isArray(c)){b=true;alert('These properties need to be properly specified:\n\n\t'+c.join('\n\t'))}return b},doFlashAlternate:function(a){var b=false;if(this.isString(a)&&a.indexOf(' ')<0){var c=a.replace(/[^\$\d\w]/gi,'');var d=this.isObject(self.document.getElementById)?self.document.getElementById(c):null;if(d!==null){this.showElement(d,d.style.display);b=true}else{if(this.isFunction(eval('self.'+c))){eval('self.'+c+'()');b=true}}}if(!b){this.displayNotice(a)}},showElement:function(a,b){if(this.isObject(a.style)){a.style.display=this.isString(b)&&b.toLowerCase()=='block'?'block':'inline';a.style.visibility='visible'}},isString:function(a){return typeof a=='string'&&a.length>0},isNumber:function(a){return typeof a=='number'&&isFinite(a)},isPositiveNumber:function(a){return this.isNumber(a)&&a>=0},isArray:function(a){return(a instanceof Array||(typeof a=='object'&&this.isNumber(a.length)))&&a.length>0},isFunction:function(a){return a instanceof Function||(typeof a=='function'&&this.isObject(a.arguments))},isObject:function(a){return!(a===null||typeof a=='undefined')}};String.prototype.hasSubstring=function(a,b){var c=false;for(var d=0;d<arguments.length;d++){if(typeof arguments[d]=='string'&&arguments[d].length>0){if((arguments[arguments.length-1]!==true&&this.toLowerCase().indexOf(arguments[d].toLowerCase())>=0)||this.indexOf(arguments[d])>=0){c=true;break}}}return c};Flash_Code.initialize();
