source: extensions/pwgCumulus/js/swfobject.js @ 6299

Last change on this file since 6299 was 5201, checked in by nikrou, 14 years ago

Initial version

File size: 5.9 KB
Line 
1/**
2 * SWFObject v1.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
3 *
4 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
5 * http://www.opensource.org/licenses/mit-license.php
6 *
7 * **SWFObject is the SWF embed script formarly known as FlashObject. The name was changed for
8 *   legal reasons.
9 */
10if(typeof deconcept=="undefined"){var deconcept=new Object();}
11if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
12if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
13deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
14if(!document.createElement||!document.getElementById){return;}
15this.DETECT_KEY=_b?_b:"detectflash";
16this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
17this.params=new Object();
18this.variables=new Object();
19this.attributes=new Array();
20if(_1){this.setAttribute("swf",_1);}
21if(id){this.setAttribute("id",id);}
22if(w){this.setAttribute("width",w);}
23if(h){this.setAttribute("height",h);}
24if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
25this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
26if(c){this.addParam("bgcolor",c);}
27var q=_8?_8:"high";
28this.addParam("quality",q);
29this.setAttribute("useExpressInstall",_7);
30this.setAttribute("doExpressInstall",false);
31var _d=(_9)?_9:window.location;
32this.setAttribute("xiRedirectUrl",_d);
33this.setAttribute("redirectUrl","");
34if(_a){this.setAttribute("redirectUrl",_a);}};
35deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
36this.attributes[_e]=_f;
37},getAttribute:function(_10){
38return this.attributes[_10];
39},addParam:function(_11,_12){
40this.params[_11]=_12;
41},getParams:function(){
42return this.params;
43},addVariable:function(_13,_14){
44this.variables[_13]=_14;
45},getVariable:function(_15){
46return this.variables[_15];
47},getVariables:function(){
48return this.variables;
49},getVariablePairs:function(){
50var _16=new Array();
51var key;
52var _18=this.getVariables();
53for(key in _18){
54_16.push(key+"="+_18[key]);}
55return _16;
56},getSWFHTML:function(){
57var _19="";
58if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
59if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
60_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
61_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
62var _1a=this.getParams();
63for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
64var _1c=this.getVariablePairs().join("&");
65if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}
66_19+="/>";
67}else{
68if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
69_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
70_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
71var _1d=this.getParams();
72for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
73var _1f=this.getVariablePairs().join("&");
74if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}
75_19+="</object>";}
76return _19;
77},write:function(_20){
78if(this.getAttribute("useExpressInstall")){
79var _21=new deconcept.PlayerVersion([6,0,65]);
80if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
81this.setAttribute("doExpressInstall",true);
82this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
83document.title=document.title.slice(0,47)+" - Flash Player Installation";
84this.addVariable("MMdoctitle",document.title);}}
85if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
86var n=(typeof _20=="string")?document.getElementById(_20):_20;
87n.innerHTML=this.getSWFHTML();
88return true;
89}else{
90if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
91return false;}};
92deconcept.SWFObjectUtil.getPlayerVersion=function(_23,_24){
93var _25=new deconcept.PlayerVersion([0,0,0]);
94if(navigator.plugins&&navigator.mimeTypes.length){
95var x=navigator.plugins["Shockwave Flash"];
96if(x&&x.description){_25=new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
97}else{try{
98var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
99for(var i=3;axo!=null;i++){
100axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
101_25=new deconcept.PlayerVersion([i,0,0]);}}
102catch(e){}
103if(_23&&_25.major>_23.major){return _25;}
104if(!_23||((_23.minor!=0||_23.rev!=0)&&_25.major==_23.major)||_25.major!=6||_24){
105try{_25=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}
106catch(e){}}}
107return _25;};
108deconcept.PlayerVersion=function(_29){
109this.major=parseInt(_29[0])!=null?parseInt(_29[0]):0;
110this.minor=parseInt(_29[1])||0;
111this.rev=parseInt(_29[2])||0;};
112deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
113if(this.major<fv.major){return false;}
114if(this.major>fv.major){return true;}
115if(this.minor<fv.minor){return false;}
116if(this.minor>fv.minor){return true;}
117if(this.rev<fv.rev){return false;}return true;};
118deconcept.util={getRequestParameter:function(_2b){
119var q=document.location.search||document.location.hash;
120if(q){
121var _2d=q.indexOf(_2b+"=");
122var _2e=(q.indexOf("&",_2d)>-1)?q.indexOf("&",_2d):q.length;
123if(q.length>1&&_2d>-1){
124return q.substring(q.indexOf("=",_2d)+1,_2e);
125}}return "";}};
126if(Array.prototype.push==null){
127Array.prototype.push=function(_2f){
128this[this.length]=_2f;
129return this.length;};}
130var getQueryParamValue=deconcept.util.getRequestParameter;
131var FlashObject=deconcept.SWFObject; // for backwards compatibility
132var SWFObject=deconcept.SWFObject;
133
Note: See TracBrowser for help on using the repository browser.