/** * swfobject v1.5: flash player detection and embed - http://blog.deconcept.com/swfobject/ * * swfobject is (c) 2007 geoff stearns and is released under the mit license: * http://www.opensource.org/licenses/mit-license.php * */ if(typeof deconcept == "undefined") var deconcept = new object(); if(typeof deconcept.util == "undefined") deconcept.util = new object(); if(typeof deconcept.swfobjectutil == "undefined") deconcept.swfobjectutil = new object(); deconcept.swfobject = function(swf, id, w, h, ver, c, quality, xiredirecturl, redirecturl, detectkey) { if (!document.getelementbyid) { return; } this.detect_key = detectkey ? detectkey : 'detectflash'; this.skipdetect = deconcept.util.getrequestparameter(this.detect_key); this.params = new object(); this.variables = new object(); this.attributes = new array(); if(swf) { this.setattribute('swf', swf); } if(id) { this.setattribute('id', id); } if(w) { this.setattribute('width', w); } if(h) { this.setattribute('height', h); } if(ver) { this.setattribute('version', new deconcept.playerversion(ver.tostring().split("."))); } this.installedver = deconcept.swfobjectutil.getplayerversion(); if (!window.opera && document.all && this.installedver.major > 7) { // only add the onunload cleanup if the flash player version supports external interface and we are in ie deconcept.swfobject.doprepunload = true; } if(c) { this.addparam('bgcolor', c); } var q = quality ? quality : 'high'; this.addparam('quality', q); this.setattribute('useexpressinstall', false); this.setattribute('doexpressinstall', false); var xir = (xiredirecturl) ? xiredirecturl : window.location; this.setattribute('xiredirecturl', xir); this.setattribute('redirecturl', ''); if(redirecturl) { this.setattribute('redirecturl', redirecturl); } } deconcept.swfobject.prototype = { useexpressinstall: function(path) { this.xiswfpath = !path ? "expressinstall.swf" : path; this.setattribute('useexpressinstall', true); }, setattribute: function(name, value){ this.attributes[name] = value; }, getattribute: function(name){ return this.attributes[name]; }, addparam: function(name, value){ this.params[name] = value; }, getparams: function(){ return this.params; }, addvariable: function(name, value){ this.variables[name] = value; }, getvariable: function(name){ return this.variables[name]; }, getvariables: function(){ return this.variables; }, getvariablepairs: function(){ var variablepairs = new array(); var key; var variables = this.getvariables(); for(key in variables){ variablepairs[variablepairs.length] = key +"="+ variables[key]; } return variablepairs; }, getswfhtml: function() { var swfnode = ""; if (navigator.plugins && navigator.mimetypes && navigator.mimetypes.length) { // netscape plugin architecture if (this.getattribute("doexpressinstall")) { this.addvariable("mmplayertype", "plugin"); this.setattribute('swf', this.xiswfpath); } swfnode = ' 0){ swfnode += 'flashvars='+ pairs +'&realfull=1&moz=1"'; } swfnode += '/>'; } else { // pc ie if (this.getattribute("doexpressinstall")) { this.addvariable("mmplayertype", "activex"); this.setattribute('swf', this.xiswfpath); } swfnode = ''; swfnode += ''; var params = this.getparams(); for(var key in params) { swfnode += ''; } var pairs = this.getvariablepairs().join("&"); if(pairs.length > 0) {swfnode += '';} swfnode += ""; } return swfnode; }, write: function(elementid){ if(this.getattribute('useexpressinstall')) { // check to see if we need to do an express install var expressinstallreqver = new deconcept.playerversion([6,0,65]); if (this.installedver.versionisvalid(expressinstallreqver) && !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); } } if(this.skipdetect || this.getattribute('doexpressinstall') || this.installedver.versionisvalid(this.getattribute('version'))){ }else{ if(this.getattribute('redirecturl') != "") { document.location.replace(this.getattribute('redirecturl')); } } var n = (typeof elementid == 'string') ? document.getelementbyid(elementid) : elementid; n.innerhtml = this.getswfhtml(); return true; } } /* ---- detection functions ---- */ deconcept.swfobjectutil.getplayerversion = function(){ var playerversion = new deconcept.playerversion([0,0,0]); if(navigator.plugins && navigator.mimetypes.length){ var x = navigator.plugins["shockwave flash"]; if(x && x.description) { playerversion = new deconcept.playerversion(x.description.replace(/([a-za-z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")); } }else if (navigator.useragent && navigator.useragent.indexof("windows ce") >= 0){ // if windows ce var axo = 1; var counter = 3; while(axo) { try { counter++; axo = new activexobject("shockwaveflash.shockwaveflash."+ counter); // document.write("player v: "+ counter); playerversion = new deconcept.playerversion([counter,0,0]); } catch (e) { axo = null; } } } else { // win ie (non mobile) // do minor version lookup in ie, but avoid fp6 crashing issues // see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/ try{ var axo = new activexobject("shockwaveflash.shockwaveflash.7"); }catch(e){ try { var axo = new activexobject("shockwaveflash.shockwaveflash.6"); playerversion = new deconcept.playerversion([6,0,21]); axo.allowscriptaccess = "always"; // error if player version < 6.0.47 (thanks to michael williams @ adobe for this code) } catch(e) { if (playerversion.major == 6) { return playerversion; } } try { axo = new activexobject("shockwaveflash.shockwaveflash"); } catch(e) {} } if (axo != null) { playerversion = new deconcept.playerversion(axo.getvariable("$version").split(" ")[1].split(",")); } } return playerversion; } deconcept.playerversion = function(arrversion){ this.major = arrversion[0] != null ? parseint(arrversion[0]) : 0; this.minor = arrversion[1] != null ? parseint(arrversion[1]) : 0; this.rev = arrversion[2] != null ? parseint(arrversion[2]) : 0; } deconcept.playerversion.prototype.versionisvalid = function(fv){ if(this.major < fv.major) return false; if(this.major > fv.major) return true; if(this.minor < fv.minor) return false; if(this.minor > fv.minor) return true; if(this.rev < fv.rev) return false; return true; } /* ---- get value of query string param ---- */ deconcept.util = { getrequestparameter: function(param) { var q = document.location.search || document.location.hash; if (param == null) { return q; } if(q) { var pairs = q.substring(1).split("&"); for (var i=0; i < pairs.length; i++) { if (pairs[i].substring(0, pairs[i].indexof("=")) == param) { return pairs[i].substring((pairs[i].indexof("=")+1)); } } } return ""; } } /* fix for video streaming bug */ deconcept.swfobjectutil.cleanupswfs = function() { var objects = document.getelementsbytagname("object"); for (var i = objects.length - 1; i >= 0; i--) { objects[i].style.display = 'none'; for (var x in objects[i]) { if (typeof objects[i][x] == 'function') { objects[i][x] = function(){}; } } } } // fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/ if (deconcept.swfobject.doprepunload) { if (!deconcept.unloadset) { deconcept.swfobjectutil.prepunload = function() { __flash_unloadhandler = function(){}; __flash_savedunloadhandler = function(){}; window.attachevent("onunload", deconcept.swfobjectutil.cleanupswfs); } window.attachevent("onbeforeunload", deconcept.swfobjectutil.prepunload); deconcept.unloadset = true; } } /* add document.getelementbyid if needed (mobile ie < 5) */ if (!document.getelementbyid && document.all) { document.getelementbyid = function(id) { return document.all[id]; }} /* add some aliases for ease of use/backwards compatibility */ var getqueryparamvalue = deconcept.util.getrequestparameter; var flashobject = deconcept.swfobject; // for legacy support var swfobject = deconcept.swfobject; /* |xgv00|12f3bac2d2a43155a8555a3c07859656 */