1/** 2 * SWFObject v2.0: 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 */ 8if(typeof deconcept == "undefined") var deconcept = new Object(); 9if(typeof deconcept.util == "undefined") deconcept.util = new Object(); 10if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object(); 11deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) { 12 if (!document.getElementById) { return; } 13 this.DETECT_KEY = detectKey ? detectKey : 'detectflash'; 14 this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY); 15 this.params = new Object(); 16 this.variables = new Object(); 17 this.attributes = new Array(); 18 if(swf) { this.setAttribute('swf', swf); } 19 if(id) { this.setAttribute('id', id); } 20 if(w) { this.setAttribute('width', w); } 21 if(h) { this.setAttribute('height', h); } 22 if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); } 23 this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion(); 24 if (!window.opera && document.all && this.installedVer.major > 7) { 25 deconcept.SWFObject.doPrepUnload = true; 26 } 27 if(c) { this.addParam('bgcolor', c); } 28 var q = quality ? quality : 'high'; 29 this.addParam('quality', q); 30 this.setAttribute('useExpressInstall', false); 31 this.setAttribute('doExpressInstall', false); 32 var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location; 33 this.setAttribute('xiRedirectUrl', xir); 34 this.setAttribute('redirectUrl', ''); 35 if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); } 36} 37deconcept.SWFObject.prototype = { 38 useExpressInstall: function(path) { 39 this.xiSWFPath = !path ? "expressinstall.swf" : path; 40 this.setAttribute('useExpressInstall', true); 41 }, 42 setAttribute: function(name, value){ 43 this.attributes[name] = value; 44 }, 45 getAttribute: function(name){ 46 return this.attributes[name]; 47 }, 48 addParam: function(name, value){ 49 this.params[name] = value; 50 }, 51 getParams: function(){ 52 return this.params; 53 }, 54 addVariable: function(name, value){ 55 this.variables[name] = value; 56 }, 57 getVariable: function(name){ 58 return this.variables[name]; 59 }, 60 getVariables: function(){ 61 return this.variables; 62 }, 63 getVariablePairs: function(){ 64 var variablePairs = new Array(); 65 var key; 66 var variables = this.getVariables(); 67 for(key in variables){ 68 variablePairs.push(key +"="+ variables[key]); 69 } 70 return variablePairs; 71 }, 72 getSWFHTML: function() { 73 var swfNode = ""; 74 if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture 75 if (this.getAttribute("doExpressInstall")) { 76 this.addVariable("MMplayerType", "PlugIn"); 77 this.setAttribute('swf', this.xiSWFPath); 78 } 79 swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"'; 80 swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" '; 81 var params = this.getParams(); 82 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; } 83 var pairs = this.getVariablePairs().join("&"); 84 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; } 85 swfNode += '/>'; 86 } else { // PC IE 87 if (this.getAttribute("doExpressInstall")) { 88 this.addVariable("MMplayerType", "ActiveX"); 89 this.setAttribute('swf', this.xiSWFPath); 90 } 91 swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'">'; 92 swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />'; 93 var params = this.getParams(); 94 for(var key in params) { 95 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />'; 96 } 97 var pairs = this.getVariablePairs().join("&"); 98 if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';} 99 swfNode += "</object>"; 100 } 101 return swfNode; 102 }, 103 write: function(elementId){ 104 if(this.getAttribute('useExpressInstall')) { 105 var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]); 106 if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) { 107 this.setAttribute('doExpressInstall', true); 108 this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl'))); 109 document.title = document.title.slice(0, 47) + " - Flash Player Installation"; 110 this.addVariable("MMdoctitle", document.title); 111 } 112 } 113 if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){ 114 var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
115 n.innerHTML = this.getSWFHTML(); 116 return true; 117 }else{ 118 if(this.getAttribute('redirectUrl') != "") { 119 document.location.replace(this.getAttribute('redirectUrl')); 120 } 121 } 122 return false; 123 } 124} 125 126deconcept.SWFObjectUtil.getPlayerVersion = function(){ 127 var PlayerVersion = new deconcept.PlayerVersion([0,0,0]); 128 if(navigator.plugins && navigator.mimeTypes.length){ 129 var x = navigator.plugins["Shockwave Flash"]; 130 if(x && x.description) { 131 PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")); 132 } 133 }else{ 134 try{ 135 var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); 136 }catch(e){ 137 try { 138 var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); 139 PlayerVersion = new deconcept.PlayerVersion([6,0,21]); 140 axo.AllowScriptAccess = "always"; 141 } catch(e) { 142 if (PlayerVersion.major == 6) { 143 return PlayerVersion; 144 } 145 } 146 try { 147 axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); 148 } catch(e) {} 149 } 150 if (axo != null) { 151 PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(",")); 152 } 153 } 154 return PlayerVersion; 155} 156deconcept.PlayerVersion = function(arrVersion){ 157 this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0; 158 this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0; 159 this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0; 160} 161deconcept.PlayerVersion.prototype.versionIsValid = function(fv){ 162 if(this.major < fv.major) return false; 163 if(this.major > fv.major) return true; 164 if(this.minor < fv.minor) return false; 165 if(this.minor > fv.minor) return true; 166 if(this.rev < fv.rev) return false; 167 return true; 168} 169deconcept.util = { 170 getRequestParameter: function(param) { 171 var q = document.location.search || document.location.hash; 172 if(q) { 173 var pairs = q.substring(1).split("&"); 174 for (var i=0; i < pairs.length; i++) { 175 if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) { 176 return pairs[i].substring((pairs[i].indexOf("=")+1)); 177 } 178 } 179 } 180 return ""; 181 } 182} 183/* fix for video streaming bug */ 184deconcept.SWFObjectUtil.cleanupSWFs = function() { 185 var objects = document.getElementsByTagName("OBJECT"); 186 for (var i=0; i < objects.length; i++) { 187 objects[i].style.display = 'none'; 188 for (var x in objects[i]) { 189 if (typeof objects[i][x] == 'function') { 190 objects[i][x] = function(){}; 191 } 192 } 193 } 194} 195if (deconcept.SWFObject.doPrepUnload) { 196 deconcept.SWFObjectUtil.prepUnload = function() { 197 __flash_unloadHandler = function(){}; 198 __flash_savedUnloadHandler = function(){}; 199 window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs); 200 } 201 window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload); 202} 203 204if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }} 205 206var getQueryParamValue = deconcept.util.getRequestParameter; 207var FlashObject = deconcept.SWFObject; // for legacy support 208var SWFObject = deconcept.SWFObject;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.