www.gusucode.com > 200套html5精品模板51_75 > 055/js/flashobject.js

    if(typeof com=="undefined"){var com=new Object()}if(typeof com.deconcept=="undefined"){com.deconcept=new Object()}if(typeof com.deconcept.util=="undefined"){com.deconcept.util=new Object()}if(typeof com.deconcept.FlashObjectUtil=="undefined"){com.deconcept.FlashObjectUtil=new Object()}com.deconcept.FlashObject=function(n,b,o,e,j,l,g,f,d,m,k){if(!document.createElement||!document.getElementById){return}this.DETECT_KEY=k?k:"detectflash";this.skipDetect=com.deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();this.useExpressInstall=g;if(n){this.setAttribute("swf",n)}if(b){this.setAttribute("id",b)}if(o){this.setAttribute("width",o)}if(e){this.setAttribute("height",e)}if(j){this.setAttribute("version",new com.deconcept.PlayerVersion(j.toString().split(".")))}this.installedVer=com.deconcept.FlashObjectUtil.getPlayerVersion(this.getAttribute("version"),g);if(l){this.addParam("bgcolor",l)}var a=f?f:"high";this.addParam("quality",a);var i=(d)?d:window.location;this.setAttribute("xiRedirectUrl",i);this.setAttribute("redirectUrl","");if(m){this.setAttribute("redirectUrl",m)}};com.deconcept.FlashObject.prototype={setAttribute:function(a,b){this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addParam:function(b,a){this.params[b]=a},getParams:function(){return this.params},addVariable:function(b,a){this.variables[b]=a},getVariable:function(a){return this.variables[a]},getVariables:function(){return this.variables},createParamTag:function(c,a){var b=document.createElement("param");b.setAttribute("name",c);b.setAttribute("value",a);return b},getVariablePairs:function(){var a=new Array();var c;var b=this.getVariables();for(c in b){a.push(c+"="+b[c])}return a},getFlashHTML:function(){var d="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn")}d='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'"';d+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var c=this.getParams();for(var e in c){d+=[e]+'="'+c[e]+'" '}var a=this.getVariablePairs().join("&");if(a.length>0){d+='flashvars="'+a+'"'}d+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX")}d='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'">';d+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var b=this.getParams();for(var e in b){d+='<param name="'+e+'" value="'+b[e]+'" />'}var f=this.getVariablePairs().join("&");if(f.length>0){d+='<param name="flashvars" value="'+f+'" />'}d+="</object>"}return d},write:function(b){if(this.useExpressInstall){var a=new com.deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(a)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}else{this.setAttribute("doExpressInstall",false)}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var c=(typeof b=="string")?document.getElementById(b):b;c.innerHTML=this.getFlashHTML()}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}}};com.deconcept.FlashObjectUtil.getPlayerVersion=function(g,f){var d=new com.deconcept.PlayerVersion(0,0,0);if(navigator.plugins&&navigator.mimeTypes.length){var a=navigator.plugins["Shockwave Flash"];if(a&&a.description){d=new com.deconcept.PlayerVersion(a.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{try{var c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");for(var b=3;c!=null;b++){c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+b);d=new com.deconcept.PlayerVersion([b,0,0])}}catch(h){}if(g&&d.major>g.major){return d}if(!g||((g.minor!=0||g.rev!=0)&&d.major==g.major)||d.major!=6||f){try{d=new com.deconcept.PlayerVersion(c.GetVariable("$version").split(" ")[1].split(","))}catch(h){}}}return d};com.deconcept.PlayerVersion=function(a){this.major=parseInt(a[0])||0;this.minor=parseInt(a[1])||0;this.rev=parseInt(a[2])||0};com.deconcept.PlayerVersion.prototype.versionIsValid=function(a){if(this.major<a.major){return false}if(this.major>a.major){return true}if(this.minor<a.minor){return false}if(this.minor>a.minor){return true}if(this.rev<a.rev){return false}return true};com.deconcept.util={getRequestParameter:function(c){var d=document.location.search||document.location.hash;if(d){var b=d.indexOf(c+"=");var a=(d.indexOf("&",b)>-1)?d.indexOf("&",b):d.length;if(d.length>1&&b>-1){return d.substring(d.indexOf("=",b)+1,a)}}return""},removeChildren:function(a){while(a.hasChildNodes()){a.removeChild(a.firstChild)}}};if(Array.prototype.push==null){Array.prototype.push=function(a){this[this.length]=a;return this.length}}var getQueryParamValue=com.deconcept.util.getRequestParameter;var FlashObject=com.deconcept.FlashObject;