Web UI for ARGUS server
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.

798 lines
33 KiB

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