You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

803 lines
35 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>The source code</title>
  6. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  7. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  8. <style type="text/css">
  9. .highlight { display: block; background-color: #ddd; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  17. <body onload="prettyPrint(); highlight();">
  18. <pre class="prettyprint lang-js">/*! SWFObject v2.2 &lt;http://code.google.com/p/swfobject/&gt;
  19. is released under the MIT License &lt;http://www.opensource.org/licenses/mit-license.php&gt;
  20. */
  21. var swfobject = function() {
  22. var UNDEF = &quot;undefined&quot;,
  23. OBJECT = &quot;object&quot;,
  24. SHOCKWAVE_FLASH = &quot;Shockwave Flash&quot;,
  25. SHOCKWAVE_FLASH_AX = &quot;ShockwaveFlash.ShockwaveFlash&quot;,
  26. FLASH_MIME_TYPE = &quot;application/x-shockwave-flash&quot;,
  27. EXPRESS_INSTALL_ID = &quot;SWFObjectExprInst&quot;,
  28. ON_READY_STATE_CHANGE = &quot;onreadystatechange&quot;,
  29. win = window,
  30. doc = document,
  31. nav = navigator,
  32. plugin = false,
  33. domLoadFnArr = [main],
  34. regObjArr = [],
  35. objIdArr = [],
  36. listenersArr = [],
  37. storedAltContent,
  38. storedAltContentId,
  39. storedCallbackFn,
  40. storedCallbackObj,
  41. isDomLoaded = false,
  42. isExpressInstallActive = false,
  43. dynamicStylesheet,
  44. dynamicStylesheetMedia,
  45. autoHideShow = true,
  46. /* Centralized function for browser feature detection
  47. - User agent string detection is only used when no good alternative is possible
  48. - Is executed directly for optimal performance
  49. */
  50. ua = function() {
  51. var w3cdom = typeof doc.getElementById != UNDEF &amp;&amp; typeof doc.getElementsByTagName != UNDEF &amp;&amp; typeof doc.createElement != UNDEF,
  52. u = nav.userAgent.toLowerCase(),
  53. p = nav.platform.toLowerCase(),
  54. windows = p ? (/win/).test(p) : /win/.test(u),
  55. mac = p ? (/mac/).test(p) : /mac/.test(u),
  56. webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, &quot;$1&quot;)) : false, // returns either the webkit version or false if not webkit
  57. ie = !+&quot;\v1&quot;, // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
  58. playerVersion = [0,0,0],
  59. d = null;
  60. if (typeof nav.plugins != UNDEF &amp;&amp; typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
  61. d = nav.plugins[SHOCKWAVE_FLASH].description;
  62. if (d &amp;&amp; !(typeof nav.mimeTypes != UNDEF &amp;&amp; nav.mimeTypes[FLASH_MIME_TYPE] &amp;&amp; !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes[&quot;application/x-shockwave-flash&quot;].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
  63. plugin = true;
  64. ie = false; // cascaded feature detection for Internet Explorer
  65. d = d.replace(/^.*\s+(\S+\s+\S+$)/, &quot;$1&quot;);
  66. playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, &quot;$1&quot;), 10);
  67. playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, &quot;$1&quot;), 10);
  68. playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, &quot;$1&quot;), 10) : 0;
  69. }
  70. }
  71. else if (typeof win.ActiveXObject != UNDEF) {
  72. try {
  73. var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
  74. if (a) { // a will return null when ActiveX is disabled
  75. d = a.GetVariable(&quot;$version&quot;);
  76. if (d) {
  77. ie = true; // cascaded feature detection for Internet Explorer
  78. d = d.split(&quot; &quot;)[1].split(&quot;,&quot;);
  79. playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
  80. }
  81. }
  82. }
  83. catch(e) {}
  84. }
  85. return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
  86. }(),
  87. /* Cross-browser onDomLoad
  88. - Will fire an event as soon as the DOM of a web page is loaded
  89. - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
  90. - Regular onload serves as fallback
  91. */
  92. onDomLoad = function() {
  93. if (!ua.w3) { return; }
  94. if ((typeof doc.readyState != UNDEF &amp;&amp; doc.readyState == &quot;complete&quot;) || (typeof doc.readyState == UNDEF &amp;&amp; (doc.getElementsByTagName(&quot;body&quot;)[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically
  95. callDomLoadFunctions();
  96. }
  97. if (!isDomLoaded) {
  98. if (typeof doc.addEventListener != UNDEF) {
  99. doc.addEventListener(&quot;DOMContentLoaded&quot;, callDomLoadFunctions, false);
  100. }
  101. if (ua.ie &amp;&amp; ua.win) {
  102. doc.attachEvent(ON_READY_STATE_CHANGE, function() {
  103. if (doc.readyState == &quot;complete&quot;) {
  104. doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
  105. callDomLoadFunctions();
  106. }
  107. });
  108. if (win == top) { // if not inside an iframe
  109. (function(){
  110. if (isDomLoaded) { return; }
  111. try {
  112. doc.documentElement.doScroll(&quot;left&quot;);
  113. }
  114. catch(e) {
  115. setTimeout(arguments.callee, 0);
  116. return;
  117. }
  118. callDomLoadFunctions();
  119. })();
  120. }
  121. }
  122. if (ua.wk) {
  123. (function(){
  124. if (isDomLoaded) { return; }
  125. if (!(/loaded|complete/).test(doc.readyState)) {
  126. setTimeout(arguments.callee, 0);
  127. return;
  128. }
  129. callDomLoadFunctions();
  130. })();
  131. }
  132. addLoadEvent(callDomLoadFunctions);
  133. }
  134. }();
  135. function callDomLoadFunctions() {
  136. if (isDomLoaded) { return; }
  137. try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
  138. var t = doc.getElementsByTagName(&quot;body&quot;)[0].appendChild(createElement(&quot;span&quot;));
  139. t.parentNode.removeChild(t);
  140. }
  141. catch (e) { return; }
  142. isDomLoaded = true;
  143. var dl = domLoadFnArr.length;
  144. for (var i = 0; i &lt; dl; i++) {
  145. domLoadFnArr[i]();
  146. }
  147. }
  148. function addDomLoadEvent(fn) {
  149. if (isDomLoaded) {
  150. fn();
  151. }
  152. else {
  153. domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
  154. }
  155. }
  156. /* Cross-browser onload
  157. - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
  158. - Will fire an event as soon as a web page including all of its assets are loaded
  159. */
  160. function addLoadEvent(fn) {
  161. if (typeof win.addEventListener != UNDEF) {
  162. win.addEventListener(&quot;load&quot;, fn, false);
  163. }
  164. else if (typeof doc.addEventListener != UNDEF) {
  165. doc.addEventListener(&quot;load&quot;, fn, false);
  166. }
  167. else if (typeof win.attachEvent != UNDEF) {
  168. addListener(win, &quot;onload&quot;, fn);
  169. }
  170. else if (typeof win.onload == &quot;function&quot;) {
  171. var fnOld = win.onload;
  172. win.onload = function() {
  173. fnOld();
  174. fn();
  175. };
  176. }
  177. else {
  178. win.onload = fn;
  179. }
  180. }
  181. /* Main function
  182. - Will preferably execute onDomLoad, otherwise onload (as a fallback)
  183. */
  184. function main() {
  185. if (plugin) {
  186. testPlayerVersion();
  187. }
  188. else {
  189. matchVersions();
  190. }
  191. }
  192. /* Detect the Flash Player version for non-Internet Explorer browsers
  193. - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
  194. a. Both release and build numbers can be detected
  195. b. Avoid wrong descriptions by corrupt installers provided by Adobe
  196. c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
  197. - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
  198. */
  199. function testPlayerVersion() {
  200. var b = doc.getElementsByTagName(&quot;body&quot;)[0];
  201. var o = createElement(OBJECT);
  202. o.setAttribute(&quot;type&quot;, FLASH_MIME_TYPE);
  203. var t = b.appendChild(o);
  204. if (t) {
  205. var counter = 0;
  206. (function(){
  207. if (typeof t.GetVariable != UNDEF) {
  208. var d = t.GetVariable(&quot;$version&quot;);
  209. if (d) {
  210. d = d.split(&quot; &quot;)[1].split(&quot;,&quot;);
  211. ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
  212. }
  213. }
  214. else if (counter &lt; 10) {
  215. counter++;
  216. setTimeout(arguments.callee, 10);
  217. return;
  218. }
  219. b.removeChild(o);
  220. t = null;
  221. matchVersions();
  222. })();
  223. }
  224. else {
  225. matchVersions();
  226. }
  227. }
  228. /* Perform Flash Player and SWF version matching; static publishing only
  229. */
  230. function matchVersions() {
  231. var rl = regObjArr.length;
  232. if (rl &gt; 0) {
  233. for (var i = 0; i &lt; rl; i++) { // for each registered object element
  234. var id = regObjArr[i].id;
  235. var cb = regObjArr[i].callbackFn;
  236. var cbObj = {success:false, id:id};
  237. if (ua.pv[0] &gt; 0) {
  238. var obj = getElementById(id);
  239. if (obj) {
  240. if (hasPlayerVersion(regObjArr[i].swfVersion) &amp;&amp; !(ua.wk &amp;&amp; ua.wk &lt; 312)) { // Flash Player version &gt;= published SWF version: Houston, we have a match!
  241. setVisibility(id, true);
  242. if (cb) {
  243. cbObj.success = true;
  244. cbObj.ref = getObjectById(id);
  245. cb(cbObj);
  246. }
  247. }
  248. else if (regObjArr[i].expressInstall &amp;&amp; canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
  249. var att = {};
  250. att.data = regObjArr[i].expressInstall;
  251. att.width = obj.getAttribute(&quot;width&quot;) || &quot;0&quot;;
  252. att.height = obj.getAttribute(&quot;height&quot;) || &quot;0&quot;;
  253. if (obj.getAttribute(&quot;class&quot;)) { att.styleclass = obj.getAttribute(&quot;class&quot;); }
  254. if (obj.getAttribute(&quot;align&quot;)) { att.align = obj.getAttribute(&quot;align&quot;); }
  255. // parse HTML object param element's name-value pairs
  256. var par = {};
  257. var p = obj.getElementsByTagName(&quot;param&quot;);
  258. var pl = p.length;
  259. for (var j = 0; j &lt; pl; j++) {
  260. if (p[j].getAttribute(&quot;name&quot;).toLowerCase() != &quot;movie&quot;) {
  261. par[p[j].getAttribute(&quot;name&quot;)] = p[j].getAttribute(&quot;value&quot;);
  262. }
  263. }
  264. showExpressInstall(att, par, id, cb);
  265. }
  266. else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
  267. displayAltContent(obj);
  268. if (cb) { cb(cbObj); }
  269. }
  270. }
  271. }
  272. else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
  273. setVisibility(id, true);
  274. if (cb) {
  275. var o = getObjectById(id); // test whether there is an HTML object element or not
  276. if (o &amp;&amp; typeof o.SetVariable != UNDEF) {
  277. cbObj.success = true;
  278. cbObj.ref = o;
  279. }
  280. cb(cbObj);
  281. }
  282. }
  283. }
  284. }
  285. }
  286. function getObjectById(objectIdStr) {
  287. var r = null;
  288. var o = getElementById(objectIdStr);
  289. if (o &amp;&amp; o.nodeName == &quot;OBJECT&quot;) {
  290. if (typeof o.SetVariable != UNDEF) {
  291. r = o;
  292. }
  293. else {
  294. var n = o.getElementsByTagName(OBJECT)[0];
  295. if (n) {
  296. r = n;
  297. }
  298. }
  299. }
  300. return r;
  301. }
  302. /* Requirements for Adobe Express Install
  303. - only one instance can be active at a time
  304. - fp 6.0.65 or higher
  305. - Win/Mac OS only
  306. - no Webkit engines older than version 312
  307. */
  308. function canExpressInstall() {
  309. return !isExpressInstallActive &amp;&amp; hasPlayerVersion(&quot;6.0.65&quot;) &amp;&amp; (ua.win || ua.mac) &amp;&amp; !(ua.wk &amp;&amp; ua.wk &lt; 312);
  310. }
  311. /* Show the Adobe Express Install dialog
  312. - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
  313. */
  314. function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
  315. isExpressInstallActive = true;
  316. storedCallbackFn = callbackFn || null;
  317. storedCallbackObj = {success:false, id:replaceElemIdStr};
  318. var obj = getElementById(replaceElemIdStr);
  319. if (obj) {
  320. if (obj.nodeName == &quot;OBJECT&quot;) { // static publishing
  321. storedAltContent = abstractAltContent(obj);
  322. storedAltContentId = null;
  323. }
  324. else { // dynamic publishing
  325. storedAltContent = obj;
  326. storedAltContentId = replaceElemIdStr;
  327. }
  328. att.id = EXPRESS_INSTALL_ID;
  329. if (typeof att.width == UNDEF || (!(/%$/).test(att.width) &amp;&amp; parseInt(att.width, 10) &lt; 310)) {
  330. att.width = &quot;310&quot;;
  331. }
  332. if (typeof att.height == UNDEF || (!(/%$/).test(att.height) &amp;&amp; parseInt(att.height, 10) &lt; 137)) {
  333. att.height = &quot;137&quot;;
  334. }
  335. doc.title = doc.title.slice(0, 47) + &quot; - Flash Player Installation&quot;;
  336. var pt = ua.ie &amp;&amp; ua.win ? &quot;ActiveX&quot; : &quot;PlugIn&quot;,
  337. fv = &quot;MMredirectURL=&quot; + win.location.toString().replace(/&amp;/g,&quot;%26&quot;) + &quot;&amp;MMplayerType=&quot; + pt + &quot;&amp;MMdoctitle=&quot; + doc.title;
  338. if (typeof par.flashvars != UNDEF) {
  339. par.flashvars += &quot;&amp;&quot; + fv;
  340. }
  341. else {
  342. par.flashvars = fv;
  343. }
  344. // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
  345. // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
  346. if (ua.ie &amp;&amp; ua.win &amp;&amp; obj.readyState != 4) {
  347. var newObj = createElement(&quot;div&quot;);
  348. replaceElemIdStr += &quot;SWFObjectNew&quot;;
  349. newObj.setAttribute(&quot;id&quot;, replaceElemIdStr);
  350. obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
  351. obj.style.display = &quot;none&quot;;
  352. (function(){
  353. if (obj.readyState == 4) {
  354. obj.parentNode.removeChild(obj);
  355. }
  356. else {
  357. setTimeout(arguments.callee, 10);
  358. }
  359. })();
  360. }
  361. createSWF(att, par, replaceElemIdStr);
  362. }
  363. }
  364. /* Functions to abstract and display alternative content
  365. */
  366. function displayAltContent(obj) {
  367. if (ua.ie &amp;&amp; ua.win &amp;&amp; obj.readyState != 4) {
  368. // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
  369. // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
  370. var el = createElement(&quot;div&quot;);
  371. obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
  372. el.parentNode.replaceChild(abstractAltContent(obj), el);
  373. obj.style.display = &quot;none&quot;;
  374. (function(){
  375. if (obj.readyState == 4) {
  376. obj.parentNode.removeChild(obj);
  377. }
  378. else {
  379. setTimeout(arguments.callee, 10);
  380. }
  381. })();
  382. }
  383. else {
  384. obj.parentNode.replaceChild(abstractAltContent(obj), obj);
  385. }
  386. }
  387. function abstractAltContent(obj) {
  388. var ac = createElement(&quot;div&quot;);
  389. if (ua.win &amp;&amp; ua.ie) {
  390. ac.innerHTML = obj.innerHTML;
  391. }
  392. else {
  393. var nestedObj = obj.getElementsByTagName(OBJECT)[0];
  394. if (nestedObj) {
  395. var c = nestedObj.childNodes;
  396. if (c) {
  397. var cl = c.length;
  398. for (var i = 0; i &lt; cl; i++) {
  399. if (!(c[i].nodeType == 1 &amp;&amp; c[i].nodeName == &quot;PARAM&quot;) &amp;&amp; !(c[i].nodeType == 8)) {
  400. ac.appendChild(c[i].cloneNode(true));
  401. }
  402. }
  403. }
  404. }
  405. }
  406. return ac;
  407. }
  408. /* Cross-browser dynamic SWF creation
  409. */
  410. function createSWF(attObj, parObj, id) {
  411. var r, el = getElementById(id);
  412. if (ua.wk &amp;&amp; ua.wk &lt; 312) { return r; }
  413. if (el) {
  414. if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
  415. attObj.id = id;
  416. }
  417. if (ua.ie &amp;&amp; ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
  418. var att = &quot;&quot;;
  419. for (var i in attObj) {
  420. if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
  421. if (i.toLowerCase() == &quot;data&quot;) {
  422. parObj.movie = attObj[i];
  423. }
  424. else if (i.toLowerCase() == &quot;styleclass&quot;) { // 'class' is an ECMA4 reserved keyword
  425. att += ' class=&quot;' + attObj[i] + '&quot;';
  426. }
  427. else if (i.toLowerCase() != &quot;classid&quot;) {
  428. att += ' ' + i + '=&quot;' + attObj[i] + '&quot;';
  429. }
  430. }
  431. }
  432. var par = &quot;&quot;;
  433. for (var j in parObj) {
  434. if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
  435. par += '&lt;param name=&quot;' + j + '&quot; value=&quot;' + parObj[j] + '&quot; /&gt;';
  436. }
  437. }
  438. el.outerHTML = '&lt;object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;' + att + '&gt;' + par + '&lt;/object&gt;';
  439. objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
  440. r = getElementById(attObj.id);
  441. }
  442. else { // well-behaving browsers
  443. var o = createElement(OBJECT);
  444. o.setAttribute(&quot;type&quot;, FLASH_MIME_TYPE);
  445. for (var m in attObj) {
  446. if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
  447. if (m.toLowerCase() == &quot;styleclass&quot;) { // 'class' is an ECMA4 reserved keyword
  448. o.setAttribute(&quot;class&quot;, attObj[m]);
  449. }
  450. else if (m.toLowerCase() != &quot;classid&quot;) { // filter out IE specific attribute
  451. o.setAttribute(m, attObj[m]);
  452. }
  453. }
  454. }
  455. for (var n in parObj) {
  456. if (parObj[n] != Object.prototype[n] &amp;&amp; n.toLowerCase() != &quot;movie&quot;) { // filter out prototype additions from other potential libraries and IE specific param element
  457. createObjParam(o, n, parObj[n]);
  458. }
  459. }
  460. el.parentNode.replaceChild(o, el);
  461. r = o;
  462. }
  463. }
  464. return r;
  465. }
  466. function createObjParam(el, pName, pValue) {
  467. var p = createElement(&quot;param&quot;);
  468. p.setAttribute(&quot;name&quot;, pName);
  469. p.setAttribute(&quot;value&quot;, pValue);
  470. el.appendChild(p);
  471. }
  472. /* Cross-browser SWF removal
  473. - Especially needed to safely and completely remove a SWF in Internet Explorer
  474. */
  475. function removeSWF(id) {
  476. var obj = getElementById(id);
  477. if (obj &amp;&amp; obj.nodeName == &quot;OBJECT&quot;) {
  478. if (ua.ie &amp;&amp; ua.win) {
  479. obj.style.display = &quot;none&quot;;
  480. (function(){
  481. if (obj.readyState == 4) {
  482. removeObjectInIE(id);
  483. }
  484. else {
  485. setTimeout(arguments.callee, 10);
  486. }
  487. })();
  488. }
  489. else {
  490. obj.parentNode.removeChild(obj);
  491. }
  492. }
  493. }
  494. function removeObjectInIE(id) {
  495. var obj = getElementById(id);
  496. if (obj) {
  497. for (var i in obj) {
  498. if (typeof obj[i] == &quot;function&quot;) {
  499. obj[i] = null;
  500. }
  501. }
  502. obj.parentNode.removeChild(obj);
  503. }
  504. }
  505. /* Functions to optimize JavaScript compression
  506. */
  507. function getElementById(id) {
  508. var el = null;
  509. try {
  510. el = doc.getElementById(id);
  511. }
  512. catch (e) {}
  513. return el;
  514. }
  515. function createElement(el) {
  516. return doc.createElement(el);
  517. }
  518. /* Updated attachEvent function for Internet Explorer
  519. - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
  520. */
  521. function addListener(target, eventType, fn) {
  522. target.attachEvent(eventType, fn);
  523. listenersArr[listenersArr.length] = [target, eventType, fn];
  524. }
  525. /* Flash Player and SWF content version matching
  526. */
  527. function hasPlayerVersion(rv) {
  528. var pv = ua.pv, v = rv.split(&quot;.&quot;);
  529. v[0] = parseInt(v[0], 10);
  530. v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. &quot;9&quot; instead of &quot;9.0.0&quot;
  531. v[2] = parseInt(v[2], 10) || 0;
  532. return (pv[0] &gt; v[0] || (pv[0] == v[0] &amp;&amp; pv[1] &gt; v[1]) || (pv[0] == v[0] &amp;&amp; pv[1] == v[1] &amp;&amp; pv[2] &gt;= v[2])) ? true : false;
  533. }
  534. /* Cross-browser dynamic CSS creation
  535. - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
  536. */
  537. function createCSS(sel, decl, media, newStyle) {
  538. if (ua.ie &amp;&amp; ua.mac) { return; }
  539. var h = doc.getElementsByTagName(&quot;head&quot;)[0];
  540. if (!h) { return; } // to also support badly authored HTML pages that lack a head element
  541. var m = (media &amp;&amp; typeof media == &quot;string&quot;) ? media : &quot;screen&quot;;
  542. if (newStyle) {
  543. dynamicStylesheet = null;
  544. dynamicStylesheetMedia = null;
  545. }
  546. if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
  547. // create dynamic stylesheet + get a global reference to it
  548. var s = createElement(&quot;style&quot;);
  549. s.setAttribute(&quot;type&quot;, &quot;text/css&quot;);
  550. s.setAttribute(&quot;media&quot;, m);
  551. dynamicStylesheet = h.appendChild(s);
  552. if (ua.ie &amp;&amp; ua.win &amp;&amp; typeof doc.styleSheets != UNDEF &amp;&amp; doc.styleSheets.length &gt; 0) {
  553. dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
  554. }
  555. dynamicStylesheetMedia = m;
  556. }
  557. // add style rule
  558. if (ua.ie &amp;&amp; ua.win) {
  559. if (dynamicStylesheet &amp;&amp; typeof dynamicStylesheet.addRule == OBJECT) {
  560. dynamicStylesheet.addRule(sel, decl);
  561. }
  562. }
  563. else {
  564. if (dynamicStylesheet &amp;&amp; typeof doc.createTextNode != UNDEF) {
  565. dynamicStylesheet.appendChild(doc.createTextNode(sel + &quot; {&quot; + decl + &quot;}&quot;));
  566. }
  567. }
  568. }
  569. function setVisibility(id, isVisible) {
  570. if (!autoHideShow) { return; }
  571. var v = isVisible ? &quot;visible&quot; : &quot;hidden&quot;;
  572. if (isDomLoaded &amp;&amp; getElementById(id)) {
  573. getElementById(id).style.visibility = v;
  574. }
  575. else {
  576. createCSS(&quot;#&quot; + id, &quot;visibility:&quot; + v);
  577. }
  578. }
  579. /* Filter to avoid XSS attacks
  580. */
  581. function urlEncodeIfNecessary(s) {
  582. var regex = /[\\\&quot;&lt;&gt;\.;]/;
  583. var hasBadChars = regex.exec(s) != null;
  584. return hasBadChars &amp;&amp; typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
  585. }
  586. /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
  587. */
  588. var cleanup = function() {
  589. if (ua.ie &amp;&amp; ua.win) {
  590. window.attachEvent(&quot;onunload&quot;, function() {
  591. // remove listeners to avoid memory leaks
  592. var ll = listenersArr.length;
  593. for (var i = 0; i &lt; ll; i++) {
  594. listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
  595. }
  596. // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
  597. var il = objIdArr.length;
  598. for (var j = 0; j &lt; il; j++) {
  599. removeSWF(objIdArr[j]);
  600. }
  601. // cleanup library's main closures to avoid memory leaks
  602. for (var k in ua) {
  603. ua[k] = null;
  604. }
  605. ua = null;
  606. for (var l in swfobject) {
  607. swfobject[l] = null;
  608. }
  609. swfobject = null;
  610. window.detachEvent('onunload', arguments.callee);
  611. });
  612. }
  613. }();
  614. return {
  615. /* Public API
  616. - Reference: http://code.google.com/p/swfobject/wiki/documentation
  617. */
  618. registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
  619. if (ua.w3 &amp;&amp; objectIdStr &amp;&amp; swfVersionStr) {
  620. var regObj = {};
  621. regObj.id = objectIdStr;
  622. regObj.swfVersion = swfVersionStr;
  623. regObj.expressInstall = xiSwfUrlStr;
  624. regObj.callbackFn = callbackFn;
  625. regObjArr[regObjArr.length] = regObj;
  626. setVisibility(objectIdStr, false);
  627. }
  628. else if (callbackFn) {
  629. callbackFn({success:false, id:objectIdStr});
  630. }
  631. },
  632. getObjectById: function(objectIdStr) {
  633. if (ua.w3) {
  634. return getObjectById(objectIdStr);
  635. }
  636. },
  637. embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
  638. var callbackObj = {success:false, id:replaceElemIdStr};
  639. if (ua.w3 &amp;&amp; !(ua.wk &amp;&amp; ua.wk &lt; 312) &amp;&amp; swfUrlStr &amp;&amp; replaceElemIdStr &amp;&amp; widthStr &amp;&amp; heightStr &amp;&amp; swfVersionStr) {
  640. setVisibility(replaceElemIdStr, false);
  641. addDomLoadEvent(function() {
  642. widthStr += &quot;&quot;; // auto-convert to string
  643. heightStr += &quot;&quot;;
  644. var att = {};
  645. if (attObj &amp;&amp; typeof attObj === OBJECT) {
  646. for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
  647. att[i] = attObj[i];
  648. }
  649. }
  650. att.data = swfUrlStr;
  651. att.width = widthStr;
  652. att.height = heightStr;
  653. var par = {};
  654. if (parObj &amp;&amp; typeof parObj === OBJECT) {
  655. for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
  656. par[j] = parObj[j];
  657. }
  658. }
  659. if (flashvarsObj &amp;&amp; typeof flashvarsObj === OBJECT) {
  660. for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
  661. if (typeof par.flashvars != UNDEF) {
  662. par.flashvars += &quot;&amp;&quot; + k + &quot;=&quot; + flashvarsObj[k];
  663. }
  664. else {
  665. par.flashvars = k + &quot;=&quot; + flashvarsObj[k];
  666. }
  667. }
  668. }
  669. if (hasPlayerVersion(swfVersionStr)) { // create SWF
  670. var obj = createSWF(att, par, replaceElemIdStr);
  671. if (att.id == replaceElemIdStr) {
  672. setVisibility(replaceElemIdStr, true);
  673. }
  674. callbackObj.success = true;
  675. callbackObj.ref = obj;
  676. }
  677. else if (xiSwfUrlStr &amp;&amp; canExpressInstall()) { // show Adobe Express Install
  678. att.data = xiSwfUrlStr;
  679. showExpressInstall(att, par, replaceElemIdStr, callbackFn);
  680. return;
  681. }
  682. else { // show alternative content
  683. setVisibility(replaceElemIdStr, true);
  684. }
  685. if (callbackFn) { callbackFn(callbackObj); }
  686. });
  687. }
  688. else if (callbackFn) { callbackFn(callbackObj); }
  689. },
  690. switchOffAutoHideShow: function() {
  691. autoHideShow = false;
  692. },
  693. ua: ua,
  694. getFlashPlayerVersion: function() {
  695. return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
  696. },
  697. hasFlashPlayerVersion: hasPlayerVersion,
  698. createSWF: function(attObj, parObj, replaceElemIdStr) {
  699. if (ua.w3) {
  700. return createSWF(attObj, parObj, replaceElemIdStr);
  701. }
  702. else {
  703. return undefined;
  704. }
  705. },
  706. showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
  707. if (ua.w3 &amp;&amp; canExpressInstall()) {
  708. showExpressInstall(att, par, replaceElemIdStr, callbackFn);
  709. }
  710. },
  711. removeSWF: function(objElemIdStr) {
  712. if (ua.w3) {
  713. removeSWF(objElemIdStr);
  714. }
  715. },
  716. createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
  717. if (ua.w3) {
  718. createCSS(selStr, declStr, mediaStr, newStyleBoolean);
  719. }
  720. },
  721. addDomLoadEvent: addDomLoadEvent,
  722. addLoadEvent: addLoadEvent,
  723. getQueryParamValue: function(param) {
  724. var q = doc.location.search || doc.location.hash;
  725. if (q) {
  726. if (/\?/.test(q)) { q = q.split(&quot;?&quot;)[1]; } // strip question mark
  727. if (param == null) {
  728. return urlEncodeIfNecessary(q);
  729. }
  730. var pairs = q.split(&quot;&amp;&quot;);
  731. for (var i = 0; i &lt; pairs.length; i++) {
  732. if (pairs[i].substring(0, pairs[i].indexOf(&quot;=&quot;)) == param) {
  733. return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf(&quot;=&quot;) + 1)));
  734. }
  735. }
  736. }
  737. return &quot;&quot;;
  738. },
  739. // For internal usage only
  740. expressInstallCallback: function() {
  741. if (isExpressInstallActive) {
  742. var obj = getElementById(EXPRESS_INSTALL_ID);
  743. if (obj &amp;&amp; storedAltContent) {
  744. obj.parentNode.replaceChild(storedAltContent, obj);
  745. if (storedAltContentId) {
  746. setVisibility(storedAltContentId, true);
  747. if (ua.ie &amp;&amp; ua.win) { storedAltContent.style.display = &quot;block&quot;; }
  748. }
  749. if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
  750. }
  751. isExpressInstallActive = false;
  752. }
  753. }
  754. };
  755. }();
  756. </pre>
  757. </body>
  758. </html>