﻿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(E,A,C){var D="";if(this.isInstalledPlayerSuitable(E.playerversion)){var B;if(!this.announceMissingProperties(E)){D=this.getCode(E);if(this.isString(A)){B=this.isObject(self.document.getElementById)?self.document.getElementById(A):null;if(!this.isObject(B)){D='\n<div id="'+A+'">'+D+"</div>\n"}}if(this.isObject(B)){B.innerHTML=D;this.showElement(B,B.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(C){var F=false;var B=this.getInstalledPlayerVersion();if(this.isString(B)){var D=this.getVersionAsObject(B);if(this.isObject(D)){this.setRequiredPlayerVersion(C);var A=this.getVersionAsObject(this.getRequiredPlayerVersion());var E="";if(this.isObject(A)){F=true;for(E in A){if(parseInt(D[E],10)<parseInt(A[E],10)){F=false;break}}}}}return F},getInstalledPlayerVersion:function(){var A=this.getPluginVersion();if(!this.isString(A)){A=this.getActiveXObjectVersion()}return A},getPluginVersion:function(){var B="";if(this.isArray(self.navigator.plugins)){for(var A=0;A<self.navigator.plugins.length;A++){if(self.navigator.plugins[A].name.indexOf("Shockwave Flash")===0){B=this.getFormattedVersion(self.navigator.plugins[self.navigator.plugins[A].name].description);break}}}return B},getActiveXObjectVersion:function(){var D="";if(self.navigator.appVersion.hasSubstring("win")&&self.navigator.appVersion.hasSubstring("msie")){if(!self.navigator.userAgent.hasSubstring("opera")){var G;var A="";var F=new Date().getFullYear()-1970;var C={"2":"2,0,0,11","3":"3,0,18,0","4":"4,0,11,0","6":"6,0,21,0"};var E=new Error();for(var B=F;B>0;B--){A=B.toString();try{G=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"+(B<=2?"":"."+A));if(this.isString(C[A])){D=C[A]}switch(B){case 2:case 3:case 4:break;case 6:G.AllowScriptAccess="always";default:D=this.getFormattedVersion(G.GetVariable("$version"));break}break}catch(E){continue}}}}return D},getFormattedVersion:function(A){var C="";if(this.isString(A)){var B=A.match(/([\d]+)/g);if(B.length>0&&parseInt(B[0],10)>=2){if(B.length==2){B.splice(1,0,"0")}while(B.length<4){B.push("0")}B.length=4;C=B.join(",")}}return C},getVersionAsObject:function(B){var A={};var D=this.getFormattedVersion(B);if(this.isString(D)){var C=D.split(",");A={major:C[0],minor:C[1],revision:C[2],build:C[3]}}return A},displayNotice:function(A){if(confirm(this.isString(A)?A:this.$_notice_message)){self.location.href=this.$_download_uri}},getCode:function(E){var D="";var B=this.getProperties(this.getDefaultProperties(),E);var A=this.$_properties.attributes;var C=this.$_properties.parameters;this.setRequiredPlayerVersion(B.playerversion);B.codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+this.getRequiredPlayerVersion();B.name=B.id;B.src=B.movie;D+="\n<object";D+=this.getAttributeCode(A.object_only,B);D+=this.getAttributeCode(A.common,B);D+=this.getAttributeCode(A.core,B);D+=this.getAttributeCode(A.event,B);D+=">\n";D+=this.getParameterCode(C.object_only,B);D+=this.getParameterCode(C.common,B);D+="  <embed";D+=this.getAttributeCode(A.embed_only,B);D+=this.getAttributeCode(A.common,B);D+=this.getAttributeCode(C.common,B);D+=this.getAttributeCode(A.core,B);D+=" />\n";D+="</object>\n";return D},getAuxiliaryCode:function(E,B,D){var A="";var C="";E=E.toLowerCase();for(C in B){if(this.isString(D[C])){switch(E){case"attribute":A+=" "+C+'="'+D[C]+'"';break;case"parameter":A+='  <param name="'+C+'" value="'+D[C]+'" />\n';break}}}return A},getAttributeCode:function(A,B){return this.getAuxiliaryCode("attribute",A,B)},getParameterCode:function(A,B){return this.getAuxiliaryCode("parameter",A,B)},getDefaultProperties:function(B){var A="";if(arguments[arguments.length-1]!=arguments.callee){B=this.$_properties}for(A in B){if(typeof B[A]=="string"){Flash_Code.$_properties.defaults[A]=B[A]}else{if(Flash_Code.isObject(B[A])){arguments.callee(B[A],arguments.callee)}}}if(arguments[arguments.length-1]!=arguments.callee){return this.$_properties.defaults}},getProperties:function(A,C){var D={};var B="";for(B in A){D[B]=A[B]}for(B in C){if(this.isString(C[B])||this.isPositiveNumber(C[B])){D[B]=C[B].toString()}}return D},announceMissingProperties:function(E){var A=null;var B=[];var C={movie:"string",width:"number",height:"number"};var D="";A=false;for(D in C){if(!this.isString(E[D])||(C[D]=="number"&&!this.isPositiveNumber(parseInt(E[D],10)))){B.push(D)}}if(this.isArray(B)){A=true;alert("These properties need to be properly specified:\n\n\t"+B.join("\n\t"))}return A},doFlashAlternate:function(str_flash_alternate){var is_alternate_done=false;if(this.isString(str_flash_alternate)&&str_flash_alternate.indexOf(" ")<0){var identifier=str_flash_alternate.replace(/[^\$\d\w]/gi,"");var element=this.isObject(self.document.getElementById)?self.document.getElementById(identifier):null;if(element!==null){this.showElement(element,element.style.display);is_alternate_done=true}else{if(this.isFunction(eval("self."+identifier))){eval("self."+identifier+"()");is_alternate_done=true}}}if(!is_alternate_done){this.displayNotice(str_flash_alternate)}},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(D,B){var A=false;for(var C=0;C<arguments.length;C++){if(typeof arguments[C]=="string"&&arguments[C].length>0){if((arguments[arguments.length-1]!==true&&this.toLowerCase().indexOf(arguments[C].toLowerCase())>=0)||this.indexOf(arguments[C])>=0){A=true;break}}}return A};Flash_Code.initialize();
