swfupload.js 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792
  1. /**
  2. * SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com
  3. *
  4. * mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/, http://www.vinterwebb.se/
  5. *
  6. * SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilzn and Mammon Media and is released under the MIT License:
  7. * http://www.opensource.org/licenses/mit-license.php
  8. *
  9. * SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License:
  10. * http://www.opensource.org/licenses/mit-license.php
  11. *
  12. * SWFObject v2.2 <http://code.google.com/p/swfobject/>
  13. * is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
  14. */
  15. /* ******************* */
  16. /* Constructor & Init */
  17. /* ******************* */
  18. var SWFUpload;
  19. var swfobject;
  20. if (SWFUpload == undefined) {
  21. SWFUpload = function (settings) {
  22. this.initSWFUpload(settings);
  23. };
  24. }
  25. SWFUpload.prototype.initSWFUpload = function (userSettings) {
  26. try {
  27. this.customSettings = {}; // A container where developers can place their own settings associated with this instance.
  28. this.settings = {};
  29. this.eventQueue = [];
  30. this.movieName = "SWFUpload_" + SWFUpload.movieCount++;
  31. this.movieElement = null;
  32. // Setup global control tracking
  33. SWFUpload.instances[this.movieName] = this;
  34. // Load the settings. Load the Flash movie.
  35. this.initSettings(userSettings);
  36. this.loadSupport();
  37. if (this.swfuploadPreload()) {
  38. this.loadFlash();
  39. }
  40. this.displayDebugInfo();
  41. } catch (ex) {
  42. delete SWFUpload.instances[this.movieName];
  43. throw ex;
  44. }
  45. };
  46. /* *************** */
  47. /* Static Members */
  48. /* *************** */
  49. SWFUpload.instances = {};
  50. SWFUpload.movieCount = 0;
  51. SWFUpload.version = "2.5.0 2010-01-15 Beta 2";
  52. SWFUpload.QUEUE_ERROR = {
  53. QUEUE_LIMIT_EXCEEDED: -100,
  54. FILE_EXCEEDS_SIZE_LIMIT: -110,
  55. ZERO_BYTE_FILE: -120,
  56. INVALID_FILETYPE: -130
  57. };
  58. SWFUpload.UPLOAD_ERROR = {
  59. HTTP_ERROR: -200,
  60. MISSING_UPLOAD_URL: -210,
  61. IO_ERROR: -220,
  62. SECURITY_ERROR: -230,
  63. UPLOAD_LIMIT_EXCEEDED: -240,
  64. UPLOAD_FAILED: -250,
  65. SPECIFIED_FILE_ID_NOT_FOUND: -260,
  66. FILE_VALIDATION_FAILED: -270,
  67. FILE_CANCELLED: -280,
  68. UPLOAD_STOPPED: -290,
  69. RESIZE: -300
  70. };
  71. SWFUpload.FILE_STATUS = {
  72. QUEUED: -1,
  73. IN_PROGRESS: -2,
  74. ERROR: -3,
  75. COMPLETE: -4,
  76. CANCELLED: -5
  77. };
  78. SWFUpload.UPLOAD_TYPE = {
  79. NORMAL: -1,
  80. RESIZED: -2
  81. };
  82. SWFUpload.BUTTON_ACTION = {
  83. SELECT_FILE: -100,
  84. SELECT_FILES: -110,
  85. START_UPLOAD: -120,
  86. JAVASCRIPT: -130, // DEPRECATED
  87. NONE: -130
  88. };
  89. SWFUpload.CURSOR = {
  90. ARROW: -1,
  91. HAND: -2
  92. };
  93. SWFUpload.WINDOW_MODE = {
  94. WINDOW: "window",
  95. TRANSPARENT: "transparent",
  96. OPAQUE: "opaque"
  97. };
  98. SWFUpload.RESIZE_ENCODING = {
  99. JPEG: -1,
  100. PNG: -2
  101. };
  102. // Private: takes a URL, determines if it is relative and converts to an absolute URL
  103. // using the current site. Only processes the URL if it can, otherwise returns the URL untouched
  104. SWFUpload.completeURL = function (url) {
  105. try {
  106. var path = "", indexSlash = -1;
  107. if (typeof(url) !== "string" || url.match(/^https?:\/\//i) || url.match(/^\//) || url === "") {
  108. return url;
  109. }
  110. indexSlash = window.location.pathname.lastIndexOf("/");
  111. if (indexSlash <= 0) {
  112. path = "/";
  113. } else {
  114. path = window.location.pathname.substr(0, indexSlash) + "/";
  115. }
  116. return path + url;
  117. } catch (ex) {
  118. return url;
  119. }
  120. };
  121. // Public: assign a new function to onload to use swfobject's domLoad functionality
  122. SWFUpload.onload = function () {
  123. };
  124. /* ******************** */
  125. /* Instance Members */
  126. /* ******************** */
  127. // Private: initSettings ensures that all the
  128. // settings are set, getting a default value if one was not assigned.
  129. SWFUpload.prototype.initSettings = function (userSettings) {
  130. this.ensureDefault = function (settingName, defaultValue) {
  131. var setting = userSettings[settingName];
  132. if (setting != undefined) {
  133. this.settings[settingName] = setting;
  134. } else {
  135. this.settings[settingName] = defaultValue;
  136. }
  137. };
  138. // Upload backend settings
  139. this.ensureDefault("upload_url", "");
  140. this.ensureDefault("preserve_relative_urls", false);
  141. this.ensureDefault("file_post_name", "Filedata");
  142. this.ensureDefault("post_params", {});
  143. this.ensureDefault("use_query_string", false);
  144. this.ensureDefault("requeue_on_error", false);
  145. this.ensureDefault("http_success", []);
  146. this.ensureDefault("assume_success_timeout", 0);
  147. // File Settings
  148. this.ensureDefault("file_types", "*.*");
  149. this.ensureDefault("file_types_description", "All Files");
  150. this.ensureDefault("file_size_limit", 0); // Default zero means "unlimited"
  151. this.ensureDefault("file_upload_limit", 0);
  152. this.ensureDefault("file_queue_limit", 0);
  153. // Flash Settings
  154. this.ensureDefault("flash_url", "swfupload.swf");
  155. this.ensureDefault("flash9_url", "swfupload_fp9.swf");
  156. this.ensureDefault("prevent_swf_caching", true);
  157. // Button Settings
  158. this.ensureDefault("button_image_url", "");
  159. this.ensureDefault("button_width", 1);
  160. this.ensureDefault("button_height", 1);
  161. this.ensureDefault("button_text", "");
  162. this.ensureDefault("button_text_style", "color: #000000; font-size: 16pt;");
  163. this.ensureDefault("button_text_top_padding", 0);
  164. this.ensureDefault("button_text_left_padding", 0);
  165. this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES);
  166. this.ensureDefault("button_disabled", false);
  167. this.ensureDefault("button_placeholder_id", "");
  168. this.ensureDefault("button_placeholder", null);
  169. this.ensureDefault("button_cursor", SWFUpload.CURSOR.ARROW);
  170. this.ensureDefault("button_window_mode", SWFUpload.WINDOW_MODE.WINDOW);
  171. // Debug Settings
  172. this.ensureDefault("debug", false);
  173. this.settings.debug_enabled = this.settings.debug; // Here to maintain v2 API
  174. // Event Handlers
  175. this.settings.return_upload_start_handler = this.returnUploadStart;
  176. this.ensureDefault("swfupload_preload_handler", null);
  177. this.ensureDefault("swfupload_load_failed_handler", null);
  178. this.ensureDefault("swfupload_loaded_handler", null);
  179. this.ensureDefault("file_dialog_start_handler", null);
  180. this.ensureDefault("file_queued_handler", null);
  181. this.ensureDefault("file_queue_error_handler", null);
  182. this.ensureDefault("file_dialog_complete_handler", null);
  183. this.ensureDefault("upload_resize_start_handler", null);
  184. this.ensureDefault("upload_start_handler", null);
  185. this.ensureDefault("upload_progress_handler", null);
  186. this.ensureDefault("upload_error_handler", null);
  187. this.ensureDefault("upload_success_handler", null);
  188. this.ensureDefault("upload_complete_handler", null);
  189. this.ensureDefault("mouse_click_handler", null);
  190. this.ensureDefault("mouse_out_handler", null);
  191. this.ensureDefault("mouse_over_handler", null);
  192. this.ensureDefault("debug_handler", this.debugMessage);
  193. this.ensureDefault("custom_settings", {});
  194. // Other settings
  195. this.customSettings = this.settings.custom_settings;
  196. // Update the flash url if needed
  197. if (!!this.settings.prevent_swf_caching) {
  198. this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime();
  199. this.settings.flash9_url = this.settings.flash9_url + (this.settings.flash9_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime();
  200. }
  201. if (!this.settings.preserve_relative_urls) {
  202. this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);
  203. this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url);
  204. }
  205. delete this.ensureDefault;
  206. };
  207. // Initializes the supported functionality based the Flash Player version, state, and event that occur during initialization
  208. SWFUpload.prototype.loadSupport = function () {
  209. this.support = {
  210. loading: swfobject.hasFlashPlayerVersion("9.0.28"),
  211. imageResize: swfobject.hasFlashPlayerVersion("10.0.0")
  212. };
  213. };
  214. // Private: loadFlash replaces the button_placeholder element with the flash movie.
  215. SWFUpload.prototype.loadFlash = function () {
  216. var targetElement, tempParent, wrapperType, flashHTML, els;
  217. if (!this.support.loading) {
  218. this.queueEvent("swfupload_load_failed_handler", ["Flash Player doesn't support SWFUpload"]);
  219. return;
  220. }
  221. // Make sure an element with the ID we are going to use doesn't already exist
  222. if (document.getElementById(this.movieName) !== null) {
  223. this.support.loading = false;
  224. this.queueEvent("swfupload_load_failed_handler", ["Element ID already in use"]);
  225. return;
  226. }
  227. // Get the element where we will be placing the flash movie
  228. targetElement = document.getElementById(this.settings.button_placeholder_id) || this.settings.button_placeholder;
  229. if (targetElement == undefined) {
  230. this.support.loading = false;
  231. this.queueEvent("swfupload_load_failed_handler", ["button place holder not found"]);
  232. return;
  233. }
  234. wrapperType = (targetElement.currentStyle && targetElement.currentStyle["display"] || window.getComputedStyle && document.defaultView.getComputedStyle(targetElement, null).getPropertyValue("display")) !== "block" ? "span" : "div";
  235. // Append the container and load the flash
  236. tempParent = document.createElement(wrapperType);
  237. flashHTML = this.getFlashHTML();
  238. try {
  239. tempParent.innerHTML = flashHTML; // Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers)
  240. } catch (ex) {
  241. this.support.loading = false;
  242. this.queueEvent("swfupload_load_failed_handler", ["Exception loading Flash HTML into placeholder"]);
  243. return;
  244. }
  245. // Try to get the movie element immediately
  246. els = tempParent.getElementsByTagName("object");
  247. if (!els || els.length > 1 || els.length === 0) {
  248. this.support.loading = false;
  249. this.queueEvent("swfupload_load_failed_handler", ["Unable to find movie after adding to DOM"]);
  250. return;
  251. } else if (els.length === 1) {
  252. this.movieElement = els[0];
  253. }
  254. targetElement.parentNode.replaceChild(tempParent.firstChild, targetElement);
  255. // Fix IE Flash/Form bug
  256. if (window[this.movieName] == undefined) {
  257. window[this.movieName] = this.getMovieElement();
  258. }
  259. };
  260. // Private: getFlashHTML generates the object tag needed to embed the flash in to the document
  261. SWFUpload.prototype.getFlashHTML = function (flashVersion) {
  262. // Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
  263. return ['<object id="', this.movieName, '" type="application/x-shockwave-flash" data="', (this.support.imageResize ? this.settings.flash_url : this.settings.flash9_url), '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
  264. '<param name="wmode" value="', this.settings.button_window_mode, '" />',
  265. '<param name="movie" value="', (this.support.imageResize ? this.settings.flash_url : this.settings.flash9_url), '" />',
  266. '<param name="quality" value="high" />',
  267. '<param name="allowScriptAccess" value="always" />',
  268. '<param name="flashvars" value="' + this.getFlashVars() + '" />',
  269. '</object>'].join("");
  270. };
  271. // Private: getFlashVars builds the parameter string that will be passed
  272. // to flash in the flashvars param.
  273. SWFUpload.prototype.getFlashVars = function () {
  274. // Build a string from the post param object
  275. var httpSuccessString, paramString;
  276. paramString = this.buildParamString();
  277. httpSuccessString = this.settings.http_success.join(",");
  278. // Build the parameter string
  279. return ["movieName=", encodeURIComponent(this.movieName),
  280. "&amp;uploadURL=", encodeURIComponent(this.settings.upload_url),
  281. "&amp;useQueryString=", encodeURIComponent(this.settings.use_query_string),
  282. "&amp;requeueOnError=", encodeURIComponent(this.settings.requeue_on_error),
  283. "&amp;httpSuccess=", encodeURIComponent(httpSuccessString),
  284. "&amp;assumeSuccessTimeout=", encodeURIComponent(this.settings.assume_success_timeout),
  285. "&amp;params=", encodeURIComponent(paramString),
  286. "&amp;filePostName=", encodeURIComponent(this.settings.file_post_name),
  287. "&amp;fileTypes=", encodeURIComponent(this.settings.file_types),
  288. "&amp;fileTypesDescription=", encodeURIComponent(this.settings.file_types_description),
  289. "&amp;fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit),
  290. "&amp;fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit),
  291. "&amp;fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit),
  292. "&amp;debugEnabled=", encodeURIComponent(this.settings.debug_enabled),
  293. "&amp;buttonImageURL=", encodeURIComponent(this.settings.button_image_url),
  294. "&amp;buttonWidth=", encodeURIComponent(this.settings.button_width),
  295. "&amp;buttonHeight=", encodeURIComponent(this.settings.button_height),
  296. "&amp;buttonText=", encodeURIComponent(this.settings.button_text),
  297. "&amp;buttonTextTopPadding=", encodeURIComponent(this.settings.button_text_top_padding),
  298. "&amp;buttonTextLeftPadding=", encodeURIComponent(this.settings.button_text_left_padding),
  299. "&amp;buttonTextStyle=", encodeURIComponent(this.settings.button_text_style),
  300. "&amp;buttonAction=", encodeURIComponent(this.settings.button_action),
  301. "&amp;buttonDisabled=", encodeURIComponent(this.settings.button_disabled),
  302. "&amp;buttonCursor=", encodeURIComponent(this.settings.button_cursor)
  303. ].join("");
  304. };
  305. // Public: get retrieves the DOM reference to the Flash element added by SWFUpload
  306. // The element is cached after the first lookup
  307. SWFUpload.prototype.getMovieElement = function () {
  308. if (this.movieElement == undefined) {
  309. this.movieElement = document.getElementById(this.movieName);
  310. }
  311. if (this.movieElement === null) {
  312. throw "Could not find Flash element";
  313. }
  314. return this.movieElement;
  315. };
  316. // Private: buildParamString takes the name/value pairs in the post_params setting object
  317. // and joins them up in to a string formatted "name=value&amp;name=value"
  318. SWFUpload.prototype.buildParamString = function () {
  319. var name, postParams, paramStringPairs = [];
  320. postParams = this.settings.post_params;
  321. if (typeof(postParams) === "object") {
  322. for (name in postParams) {
  323. if (postParams.hasOwnProperty(name)) {
  324. paramStringPairs.push(encodeURIComponent(name.toString()) + "=" + encodeURIComponent(postParams[name].toString()));
  325. }
  326. }
  327. }
  328. return paramStringPairs.join("&amp;");
  329. };
  330. // Public: Used to remove a SWFUpload instance from the page. This method strives to remove
  331. // all references to the SWF, and other objects so memory is properly freed.
  332. // Returns true if everything was destroyed. Returns a false if a failure occurs leaving SWFUpload in an inconsistant state.
  333. // Credits: Major improvements provided by steffen
  334. SWFUpload.prototype.destroy = function () {
  335. var movieElement;
  336. try {
  337. // Make sure Flash is done before we try to remove it
  338. this.cancelUpload(null, false);
  339. movieElement = this.cleanUp();
  340. // Remove the SWFUpload DOM nodes
  341. if (movieElement) {
  342. // Remove the Movie Element from the page
  343. try {
  344. movieElement.parentNode.removeChild(movieElement);
  345. } catch (ex) {
  346. }
  347. }
  348. // Remove IE form fix reference
  349. window[this.movieName] = null;
  350. // Destroy other references
  351. SWFUpload.instances[this.movieName] = null;
  352. delete SWFUpload.instances[this.movieName];
  353. this.movieElement = null;
  354. this.settings = null;
  355. this.customSettings = null;
  356. this.eventQueue = null;
  357. this.movieName = null;
  358. return true;
  359. } catch (ex2) {
  360. return false;
  361. }
  362. };
  363. // Public: displayDebugInfo prints out settings and configuration
  364. // information about this SWFUpload instance.
  365. // This function (and any references to it) can be deleted when placing
  366. // SWFUpload in production.
  367. SWFUpload.prototype.displayDebugInfo = function () {
  368. this.debug(
  369. [
  370. "---SWFUpload Instance Info---\n",
  371. "Version: ", SWFUpload.version, "\n",
  372. "Movie Name: ", this.movieName, "\n",
  373. "Settings:\n",
  374. "\t", "upload_url: ", this.settings.upload_url, "\n",
  375. "\t", "flash_url: ", this.settings.flash_url, "\n",
  376. "\t", "flash9_url: ", this.settings.flash9_url, "\n",
  377. "\t", "use_query_string: ", this.settings.use_query_string.toString(), "\n",
  378. "\t", "requeue_on_error: ", this.settings.requeue_on_error.toString(), "\n",
  379. "\t", "http_success: ", this.settings.http_success.join(", "), "\n",
  380. "\t", "assume_success_timeout: ", this.settings.assume_success_timeout, "\n",
  381. "\t", "file_post_name: ", this.settings.file_post_name, "\n",
  382. "\t", "post_params: ", this.settings.post_params.toString(), "\n",
  383. "\t", "file_types: ", this.settings.file_types, "\n",
  384. "\t", "file_types_description: ", this.settings.file_types_description, "\n",
  385. "\t", "file_size_limit: ", this.settings.file_size_limit, "\n",
  386. "\t", "file_upload_limit: ", this.settings.file_upload_limit, "\n",
  387. "\t", "file_queue_limit: ", this.settings.file_queue_limit, "\n",
  388. "\t", "debug: ", this.settings.debug.toString(), "\n",
  389. "\t", "prevent_swf_caching: ", this.settings.prevent_swf_caching.toString(), "\n",
  390. "\t", "button_placeholder_id: ", this.settings.button_placeholder_id.toString(), "\n",
  391. "\t", "button_placeholder: ", (this.settings.button_placeholder ? "Set" : "Not Set"), "\n",
  392. "\t", "button_image_url: ", this.settings.button_image_url.toString(), "\n",
  393. "\t", "button_width: ", this.settings.button_width.toString(), "\n",
  394. "\t", "button_height: ", this.settings.button_height.toString(), "\n",
  395. "\t", "button_text: ", this.settings.button_text.toString(), "\n",
  396. "\t", "button_text_style: ", this.settings.button_text_style.toString(), "\n",
  397. "\t", "button_text_top_padding: ", this.settings.button_text_top_padding.toString(), "\n",
  398. "\t", "button_text_left_padding: ", this.settings.button_text_left_padding.toString(), "\n",
  399. "\t", "button_action: ", this.settings.button_action.toString(), "\n",
  400. "\t", "button_cursor: ", this.settings.button_cursor.toString(), "\n",
  401. "\t", "button_disabled: ", this.settings.button_disabled.toString(), "\n",
  402. "\t", "custom_settings: ", this.settings.custom_settings.toString(), "\n",
  403. "Event Handlers:\n",
  404. "\t", "swfupload_preload_handler assigned: ", (typeof this.settings.swfupload_preload_handler === "function").toString(), "\n",
  405. "\t", "swfupload_load_failed_handler assigned: ", (typeof this.settings.swfupload_load_failed_handler === "function").toString(), "\n",
  406. "\t", "swfupload_loaded_handler assigned: ", (typeof this.settings.swfupload_loaded_handler === "function").toString(), "\n",
  407. "\t", "mouse_click_handler assigned: ", (typeof this.settings.mouse_click_handler === "function").toString(), "\n",
  408. "\t", "mouse_over_handler assigned: ", (typeof this.settings.mouse_over_handler === "function").toString(), "\n",
  409. "\t", "mouse_out_handler assigned: ", (typeof this.settings.mouse_out_handler === "function").toString(), "\n",
  410. "\t", "file_dialog_start_handler assigned: ", (typeof this.settings.file_dialog_start_handler === "function").toString(), "\n",
  411. "\t", "file_queued_handler assigned: ", (typeof this.settings.file_queued_handler === "function").toString(), "\n",
  412. "\t", "file_queue_error_handler assigned: ", (typeof this.settings.file_queue_error_handler === "function").toString(), "\n",
  413. "\t", "upload_resize_start_handler assigned: ", (typeof this.settings.upload_resize_start_handler === "function").toString(), "\n",
  414. "\t", "upload_start_handler assigned: ", (typeof this.settings.upload_start_handler === "function").toString(), "\n",
  415. "\t", "upload_progress_handler assigned: ", (typeof this.settings.upload_progress_handler === "function").toString(), "\n",
  416. "\t", "upload_error_handler assigned: ", (typeof this.settings.upload_error_handler === "function").toString(), "\n",
  417. "\t", "upload_success_handler assigned: ", (typeof this.settings.upload_success_handler === "function").toString(), "\n",
  418. "\t", "upload_complete_handler assigned: ", (typeof this.settings.upload_complete_handler === "function").toString(), "\n",
  419. "\t", "debug_handler assigned: ", (typeof this.settings.debug_handler === "function").toString(), "\n",
  420. "Support:\n",
  421. "\t", "Load: ", (this.support.loading ? "Yes" : "No"), "\n",
  422. "\t", "Image Resize: ", (this.support.imageResize ? "Yes" : "No"), "\n"
  423. ].join("")
  424. );
  425. };
  426. /* Note: addSetting and getSetting are no longer used by SWFUpload but are included
  427. the maintain v2 API compatibility
  428. */
  429. // Public: (Deprecated) addSetting adds a setting value. If the value given is undefined or null then the default_value is used.
  430. SWFUpload.prototype.addSetting = function (name, value, default_value) {
  431. if (value == undefined) {
  432. return (this.settings[name] = default_value);
  433. } else {
  434. return (this.settings[name] = value);
  435. }
  436. };
  437. // Public: (Deprecated) getSetting gets a setting. Returns an empty string if the setting was not found.
  438. SWFUpload.prototype.getSetting = function (name) {
  439. if (this.settings[name] != undefined) {
  440. return this.settings[name];
  441. }
  442. return "";
  443. };
  444. // Private: callFlash handles function calls made to the Flash element.
  445. // Calls are made with a setTimeout for some functions to work around
  446. // bugs in the ExternalInterface library.
  447. SWFUpload.prototype.callFlash = function (functionName, argumentArray) {
  448. var movieElement, returnValue, returnString;
  449. argumentArray = argumentArray || [];
  450. movieElement = this.getMovieElement();
  451. // Flash's method if calling ExternalInterface methods (code adapted from MooTools).
  452. try {
  453. if (movieElement != undefined) {
  454. returnString = movieElement.CallFunction('<invoke name="' + functionName + '" returntype="javascript">' + __flash__argumentsToXML(argumentArray, 0) + '</invoke>');
  455. returnValue = eval(returnString);
  456. } else {
  457. this.debug("Can't call flash because the movie wasn't found.");
  458. }
  459. } catch (ex) {
  460. this.debug("Exception calling flash function '" + functionName + "': " + ex.message);
  461. }
  462. // Unescape file post param values
  463. if (returnValue != undefined && typeof returnValue.post === "object") {
  464. returnValue = this.unescapeFilePostParams(returnValue);
  465. }
  466. return returnValue;
  467. };
  468. /* *****************************
  469. -- Flash control methods --
  470. Your UI should use these
  471. to operate SWFUpload
  472. ***************************** */
  473. // WARNING: this function does not work in Flash Player 10
  474. // Public: selectFile causes a File Selection Dialog window to appear. This
  475. // dialog only allows 1 file to be selected.
  476. SWFUpload.prototype.selectFile = function () {
  477. this.callFlash("SelectFile");
  478. };
  479. // WARNING: this function does not work in Flash Player 10
  480. // Public: selectFiles causes a File Selection Dialog window to appear/ This
  481. // dialog allows the user to select any number of files
  482. // Flash Bug Warning: Flash limits the number of selectable files based on the combined length of the file names.
  483. // If the selection name length is too long the dialog will fail in an unpredictable manner. There is no work-around
  484. // for this bug.
  485. SWFUpload.prototype.selectFiles = function () {
  486. this.callFlash("SelectFiles");
  487. };
  488. // Public: startUpload starts uploading the first file in the queue unless
  489. // the optional parameter 'fileID' specifies the ID
  490. SWFUpload.prototype.startUpload = function (fileID) {
  491. this.callFlash("StartUpload", [fileID]);
  492. };
  493. // Public: startUpload starts uploading the first file in the queue unless
  494. // the optional parameter 'fileID' specifies the ID
  495. SWFUpload.prototype.startResizedUpload = function (fileID, width, height, encoding, quality, allowEnlarging) {
  496. this.callFlash("StartUpload", [fileID, { "width": width, "height": height, "encoding": encoding, "quality": quality, "allowEnlarging": allowEnlarging }]);
  497. };
  498. // Public: cancelUpload cancels any queued file. The fileID parameter may be the file ID or index.
  499. // If you do not specify a fileID the current uploading file or first file in the queue is cancelled.
  500. // If you do not want the uploadError event to trigger you can specify false for the triggerErrorEvent parameter.
  501. SWFUpload.prototype.cancelUpload = function (fileID, triggerErrorEvent) {
  502. if (triggerErrorEvent !== false) {
  503. triggerErrorEvent = true;
  504. }
  505. this.callFlash("CancelUpload", [fileID, triggerErrorEvent]);
  506. };
  507. // Public: stopUpload stops the current upload and requeues the file at the beginning of the queue.
  508. // If nothing is currently uploading then nothing happens.
  509. SWFUpload.prototype.stopUpload = function () {
  510. this.callFlash("StopUpload");
  511. };
  512. // Public: requeueUpload requeues any file. If the file is requeued or already queued true is returned.
  513. // If the file is not found or is currently uploading false is returned. Requeuing a file bypasses the
  514. // file size, queue size, upload limit and other queue checks. Certain files can't be requeued (e.g, invalid or zero bytes files).
  515. SWFUpload.prototype.requeueUpload = function (indexOrFileID) {
  516. return this.callFlash("RequeueUpload", [indexOrFileID]);
  517. };
  518. /* ************************
  519. * Settings methods
  520. * These methods change the SWFUpload settings.
  521. * SWFUpload settings should not be changed directly on the settings object
  522. * since many of the settings need to be passed to Flash in order to take
  523. * effect.
  524. * *********************** */
  525. // Public: getStats gets the file statistics object.
  526. SWFUpload.prototype.getStats = function () {
  527. return this.callFlash("GetStats");
  528. };
  529. // Public: setStats changes the SWFUpload statistics. You shouldn't need to
  530. // change the statistics but you can. Changing the statistics does not
  531. // affect SWFUpload accept for the successful_uploads count which is used
  532. // by the upload_limit setting to determine how many files the user may upload.
  533. SWFUpload.prototype.setStats = function (statsObject) {
  534. this.callFlash("SetStats", [statsObject]);
  535. };
  536. // Public: getFile retrieves a File object by ID or Index. If the file is
  537. // not found then 'null' is returned.
  538. SWFUpload.prototype.getFile = function (fileID) {
  539. if (typeof(fileID) === "number") {
  540. return this.callFlash("GetFileByIndex", [fileID]);
  541. } else {
  542. return this.callFlash("GetFile", [fileID]);
  543. }
  544. };
  545. // Public: getFileFromQueue retrieves a File object by ID or Index. If the file is
  546. // not found then 'null' is returned.
  547. SWFUpload.prototype.getQueueFile = function (fileID) {
  548. if (typeof(fileID) === "number") {
  549. return this.callFlash("GetFileByQueueIndex", [fileID]);
  550. } else {
  551. return this.callFlash("GetFile", [fileID]);
  552. }
  553. };
  554. // Public: addFileParam sets a name/value pair that will be posted with the
  555. // file specified by the Files ID. If the name already exists then the
  556. // exiting value will be overwritten.
  557. SWFUpload.prototype.addFileParam = function (fileID, name, value) {
  558. return this.callFlash("AddFileParam", [fileID, name, value]);
  559. };
  560. // Public: removeFileParam removes a previously set (by addFileParam) name/value
  561. // pair from the specified file.
  562. SWFUpload.prototype.removeFileParam = function (fileID, name) {
  563. this.callFlash("RemoveFileParam", [fileID, name]);
  564. };
  565. // Public: setUploadUrl changes the upload_url setting.
  566. SWFUpload.prototype.setUploadURL = function (url) {
  567. this.settings.upload_url = url.toString();
  568. this.callFlash("SetUploadURL", [url]);
  569. };
  570. // Public: setPostParams changes the post_params setting
  571. SWFUpload.prototype.setPostParams = function (paramsObject) {
  572. this.settings.post_params = paramsObject;
  573. this.callFlash("SetPostParams", [paramsObject]);
  574. };
  575. // Public: addPostParam adds post name/value pair. Each name can have only one value.
  576. SWFUpload.prototype.addPostParam = function (name, value) {
  577. this.settings.post_params[name] = value;
  578. this.callFlash("SetPostParams", [this.settings.post_params]);
  579. };
  580. // Public: removePostParam deletes post name/value pair.
  581. SWFUpload.prototype.removePostParam = function (name) {
  582. delete this.settings.post_params[name];
  583. this.callFlash("SetPostParams", [this.settings.post_params]);
  584. };
  585. // Public: setFileTypes changes the file_types setting and the file_types_description setting
  586. SWFUpload.prototype.setFileTypes = function (types, description) {
  587. this.settings.file_types = types;
  588. this.settings.file_types_description = description;
  589. this.callFlash("SetFileTypes", [types, description]);
  590. };
  591. // Public: setFileSizeLimit changes the file_size_limit setting
  592. SWFUpload.prototype.setFileSizeLimit = function (fileSizeLimit) {
  593. this.settings.file_size_limit = fileSizeLimit;
  594. this.callFlash("SetFileSizeLimit", [fileSizeLimit]);
  595. };
  596. // Public: setFileUploadLimit changes the file_upload_limit setting
  597. SWFUpload.prototype.setFileUploadLimit = function (fileUploadLimit) {
  598. this.settings.file_upload_limit = fileUploadLimit;
  599. this.callFlash("SetFileUploadLimit", [fileUploadLimit]);
  600. };
  601. // Public: setFileQueueLimit changes the file_queue_limit setting
  602. SWFUpload.prototype.setFileQueueLimit = function (fileQueueLimit) {
  603. this.settings.file_queue_limit = fileQueueLimit;
  604. this.callFlash("SetFileQueueLimit", [fileQueueLimit]);
  605. };
  606. // Public: setFilePostName changes the file_post_name setting
  607. SWFUpload.prototype.setFilePostName = function (filePostName) {
  608. this.settings.file_post_name = filePostName;
  609. this.callFlash("SetFilePostName", [filePostName]);
  610. };
  611. // Public: setUseQueryString changes the use_query_string setting
  612. SWFUpload.prototype.setUseQueryString = function (useQueryString) {
  613. this.settings.use_query_string = useQueryString;
  614. this.callFlash("SetUseQueryString", [useQueryString]);
  615. };
  616. // Public: setRequeueOnError changes the requeue_on_error setting
  617. SWFUpload.prototype.setRequeueOnError = function (requeueOnError) {
  618. this.settings.requeue_on_error = requeueOnError;
  619. this.callFlash("SetRequeueOnError", [requeueOnError]);
  620. };
  621. // Public: setHTTPSuccess changes the http_success setting
  622. SWFUpload.prototype.setHTTPSuccess = function (http_status_codes) {
  623. if (typeof http_status_codes === "string") {
  624. http_status_codes = http_status_codes.replace(" ", "").split(",");
  625. }
  626. this.settings.http_success = http_status_codes;
  627. this.callFlash("SetHTTPSuccess", [http_status_codes]);
  628. };
  629. // Public: setHTTPSuccess changes the http_success setting
  630. SWFUpload.prototype.setAssumeSuccessTimeout = function (timeout_seconds) {
  631. this.settings.assume_success_timeout = timeout_seconds;
  632. this.callFlash("SetAssumeSuccessTimeout", [timeout_seconds]);
  633. };
  634. // Public: setDebugEnabled changes the debug_enabled setting
  635. SWFUpload.prototype.setDebugEnabled = function (debugEnabled) {
  636. this.settings.debug_enabled = debugEnabled;
  637. this.callFlash("SetDebugEnabled", [debugEnabled]);
  638. };
  639. // Public: setButtonImageURL loads a button image sprite
  640. SWFUpload.prototype.setButtonImageURL = function (buttonImageURL) {
  641. if (buttonImageURL == undefined) {
  642. buttonImageURL = "";
  643. }
  644. this.settings.button_image_url = buttonImageURL;
  645. this.callFlash("SetButtonImageURL", [buttonImageURL]);
  646. };
  647. // Public: setButtonDimensions resizes the Flash Movie and button
  648. SWFUpload.prototype.setButtonDimensions = function (width, height) {
  649. this.settings.button_width = width;
  650. this.settings.button_height = height;
  651. var movie = this.getMovieElement();
  652. if (movie != undefined) {
  653. movie.style.width = width + "px";
  654. movie.style.height = height + "px";
  655. }
  656. this.callFlash("SetButtonDimensions", [width, height]);
  657. };
  658. // Public: setButtonText Changes the text overlaid on the button
  659. SWFUpload.prototype.setButtonText = function (html) {
  660. this.settings.button_text = html;
  661. this.callFlash("SetButtonText", [html]);
  662. };
  663. // Public: setButtonTextPadding changes the top and left padding of the text overlay
  664. SWFUpload.prototype.setButtonTextPadding = function (left, top) {
  665. this.settings.button_text_top_padding = top;
  666. this.settings.button_text_left_padding = left;
  667. this.callFlash("SetButtonTextPadding", [left, top]);
  668. };
  669. // Public: setButtonTextStyle changes the CSS used to style the HTML/Text overlaid on the button
  670. SWFUpload.prototype.setButtonTextStyle = function (css) {
  671. this.settings.button_text_style = css;
  672. this.callFlash("SetButtonTextStyle", [css]);
  673. };
  674. // Public: setButtonDisabled disables/enables the button
  675. SWFUpload.prototype.setButtonDisabled = function (isDisabled) {
  676. this.settings.button_disabled = isDisabled;
  677. this.callFlash("SetButtonDisabled", [isDisabled]);
  678. };
  679. // Public: setButtonAction sets the action that occurs when the button is clicked
  680. SWFUpload.prototype.setButtonAction = function (buttonAction) {
  681. this.settings.button_action = buttonAction;
  682. this.callFlash("SetButtonAction", [buttonAction]);
  683. };
  684. // Public: setButtonCursor changes the mouse cursor displayed when hovering over the button
  685. SWFUpload.prototype.setButtonCursor = function (cursor) {
  686. this.settings.button_cursor = cursor;
  687. this.callFlash("SetButtonCursor", [cursor]);
  688. };
  689. /* *******************************
  690. Flash Event Interfaces
  691. These functions are used by Flash to trigger the various
  692. events.
  693. All these functions a Private.
  694. Because the ExternalInterface library is buggy the event calls
  695. are added to a queue and the queue then executed by a setTimeout.
  696. This ensures that events are executed in a determinate order and that
  697. the ExternalInterface bugs are avoided.
  698. ******************************* */
  699. SWFUpload.prototype.queueEvent = function (handlerName, argumentArray) {
  700. // Warning: Don't call this.debug inside here or you'll create an infinite loop
  701. var self = this;
  702. if (argumentArray == undefined) {
  703. argumentArray = [];
  704. } else if (!(argumentArray instanceof Array)) {
  705. argumentArray = [argumentArray];
  706. }
  707. if (typeof this.settings[handlerName] === "function") {
  708. // Queue the event
  709. this.eventQueue.push(function () {
  710. this.settings[handlerName].apply(this, argumentArray);
  711. });
  712. // Execute the next queued event
  713. setTimeout(function () {
  714. self.executeNextEvent();
  715. }, 0);
  716. } else if (this.settings[handlerName] !== null) {
  717. throw "Event handler " + handlerName + " is unknown or is not a function";
  718. }
  719. };
  720. // Private: Causes the next event in the queue to be executed. Since events are queued using a setTimeout
  721. // we must queue them in order to garentee that they are executed in order.
  722. SWFUpload.prototype.executeNextEvent = function () {
  723. // Warning: Don't call this.debug inside here or you'll create an infinite loop
  724. var f = this.eventQueue ? this.eventQueue.shift() : null;
  725. if (typeof(f) === "function") {
  726. f.apply(this);
  727. }
  728. };
  729. // Private: unescapeFileParams is part of a workaround for a flash bug where objects passed through ExternalInterface cannot have
  730. // properties that contain characters that are not valid for JavaScript identifiers. To work around this
  731. // the Flash Component escapes the parameter names and we must unescape again before passing them along.
  732. SWFUpload.prototype.unescapeFilePostParams = function (file) {
  733. var reg = /[$]([0-9a-f]{4})/i, unescapedPost = {}, uk, k, match;
  734. if (file != undefined) {
  735. for (k in file.post) {
  736. if (file.post.hasOwnProperty(k)) {
  737. uk = k;
  738. while ((match = reg.exec(uk)) !== null) {
  739. uk = uk.replace(match[0], String.fromCharCode(parseInt("0x" + match[1], 16)));
  740. }
  741. unescapedPost[uk] = file.post[k];
  742. }
  743. }
  744. file.post = unescapedPost;
  745. }
  746. return file;
  747. };
  748. // Private: This event is called by SWFUpload Init after we've determined what the user's Flash Player supports.
  749. // Use the swfupload_preload_handler event setting to execute custom code when SWFUpload has loaded.
  750. // Return false to prevent SWFUpload from loading and allow your script to do something else if your required feature is
  751. // not supported
  752. SWFUpload.prototype.swfuploadPreload = function () {
  753. var returnValue;
  754. if (typeof this.settings.swfupload_preload_handler === "function") {
  755. returnValue = this.settings.swfupload_preload_handler.call(this);
  756. } else if (this.settings.swfupload_preload_handler != undefined) {
  757. throw "upload_start_handler must be a function";
  758. }
  759. // Convert undefined to true so if nothing is returned from the upload_start_handler it is
  760. // interpretted as 'true'.
  761. if (returnValue === undefined) {
  762. returnValue = true;
  763. }
  764. return !!returnValue;
  765. }
  766. // Private: This event is called by Flash when it has finished loading. Don't modify this.
  767. // Use the swfupload_loaded_handler event setting to execute custom code when SWFUpload has loaded.
  768. SWFUpload.prototype.flashReady = function () {
  769. // Check that the movie element is loaded correctly with its ExternalInterface methods defined
  770. var movieElement = this.cleanUp();
  771. if (!movieElement) {
  772. this.debug("Flash called back ready but the flash movie can't be found.");
  773. return;
  774. }
  775. this.queueEvent("swfupload_loaded_handler");
  776. };
  777. // Private: removes Flash added fuctions to the DOM node to prevent memory leaks in IE.
  778. // This function is called by Flash each time the ExternalInterface functions are created.
  779. SWFUpload.prototype.cleanUp = function () {
  780. var key, movieElement = this.getMovieElement();
  781. // Pro-actively unhook all the Flash functions
  782. try {
  783. if (movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE
  784. this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");
  785. for (key in movieElement) {
  786. try {
  787. if (typeof(movieElement[key]) === "function") {
  788. movieElement[key] = null;
  789. }
  790. } catch (ex) {
  791. }
  792. }
  793. }
  794. } catch (ex1) {
  795. }
  796. // Fix Flashes own cleanup code so if the SWF Movie was removed from the page
  797. // it doesn't display errors.
  798. window["__flash__removeCallback"] = function (instance, name) {
  799. try {
  800. if (instance) {
  801. instance[name] = null;
  802. }
  803. } catch (flashEx) {
  804. }
  805. };
  806. return movieElement;
  807. };
  808. /* When the button_action is set to None this event gets fired and executes the mouse_click_handler */
  809. SWFUpload.prototype.mouseClick = function () {
  810. this.queueEvent("mouse_click_handler");
  811. };
  812. SWFUpload.prototype.mouseOver = function () {
  813. this.queueEvent("mouse_over_handler");
  814. };
  815. SWFUpload.prototype.mouseOut = function () {
  816. this.queueEvent("mouse_out_handler");
  817. };
  818. /* This is a chance to do something before the browse window opens */
  819. SWFUpload.prototype.fileDialogStart = function () {
  820. this.queueEvent("file_dialog_start_handler");
  821. };
  822. /* Called when a file is successfully added to the queue. */
  823. SWFUpload.prototype.fileQueued = function (file) {
  824. file = this.unescapeFilePostParams(file);
  825. this.queueEvent("file_queued_handler", file);
  826. };
  827. /* Handle errors that occur when an attempt to queue a file fails. */
  828. SWFUpload.prototype.fileQueueError = function (file, errorCode, message) {
  829. file = this.unescapeFilePostParams(file);
  830. this.queueEvent("file_queue_error_handler", [file, errorCode, message]);
  831. };
  832. /* Called after the file dialog has closed and the selected files have been queued.
  833. You could call startUpload here if you want the queued files to begin uploading immediately. */
  834. SWFUpload.prototype.fileDialogComplete = function (numFilesSelected, numFilesQueued, numFilesInQueue) {
  835. this.queueEvent("file_dialog_complete_handler", [numFilesSelected, numFilesQueued, numFilesInQueue]);
  836. };
  837. SWFUpload.prototype.uploadResizeStart = function (file, resizeSettings) {
  838. file = this.unescapeFilePostParams(file);
  839. this.queueEvent("upload_resize_start_handler", [file, resizeSettings.width, resizeSettings.height, resizeSettings.encoding, resizeSettings.quality]);
  840. };
  841. SWFUpload.prototype.uploadStart = function (file) {
  842. file = this.unescapeFilePostParams(file);
  843. this.queueEvent("return_upload_start_handler", file);
  844. };
  845. SWFUpload.prototype.returnUploadStart = function (file) {
  846. var returnValue;
  847. if (typeof this.settings.upload_start_handler === "function") {
  848. file = this.unescapeFilePostParams(file);
  849. returnValue = this.settings.upload_start_handler.call(this, file);
  850. } else if (this.settings.upload_start_handler != undefined) {
  851. throw "upload_start_handler must be a function";
  852. }
  853. // Convert undefined to true so if nothing is returned from the upload_start_handler it is
  854. // interpretted as 'true'.
  855. if (returnValue === undefined) {
  856. returnValue = true;
  857. }
  858. returnValue = !!returnValue;
  859. this.callFlash("ReturnUploadStart", [returnValue]);
  860. };
  861. SWFUpload.prototype.uploadProgress = function (file, bytesComplete, bytesTotal) {
  862. file = this.unescapeFilePostParams(file);
  863. this.queueEvent("upload_progress_handler", [file, bytesComplete, bytesTotal]);
  864. };
  865. SWFUpload.prototype.uploadError = function (file, errorCode, message) {
  866. file = this.unescapeFilePostParams(file);
  867. this.queueEvent("upload_error_handler", [file, errorCode, message]);
  868. };
  869. SWFUpload.prototype.uploadSuccess = function (file, serverData, responseReceived) {
  870. file = this.unescapeFilePostParams(file);
  871. this.queueEvent("upload_success_handler", [file, serverData, responseReceived]);
  872. };
  873. SWFUpload.prototype.uploadComplete = function (file) {
  874. file = this.unescapeFilePostParams(file);
  875. this.queueEvent("upload_complete_handler", file);
  876. };
  877. /* Called by SWFUpload JavaScript and Flash functions when debug is enabled. By default it writes messages to the
  878. internal debug console. You can override this event and have messages written where you want. */
  879. SWFUpload.prototype.debug = function (message) {
  880. this.queueEvent("debug_handler", message);
  881. };
  882. /* **********************************
  883. Debug Console
  884. The debug console is a self contained, in page location
  885. for debug message to be sent. The Debug Console adds
  886. itself to the body if necessary.
  887. The console is automatically scrolled as messages appear.
  888. If you are using your own debug handler or when you deploy to production and
  889. have debug disabled you can remove these functions to reduce the file size
  890. and complexity.
  891. ********************************** */
  892. // Private: debugMessage is the default debug_handler. If you want to print debug messages
  893. // call the debug() function. When overriding the function your own function should
  894. // check to see if the debug setting is true before outputting debug information.
  895. SWFUpload.prototype.debugMessage = function (message) {
  896. var exceptionMessage, exceptionValues, key;
  897. if (this.settings.debug) {
  898. exceptionValues = [];
  899. // Check for an exception object and print it nicely
  900. if (typeof message === "object" && typeof message.name === "string" && typeof message.message === "string") {
  901. for (key in message) {
  902. if (message.hasOwnProperty(key)) {
  903. exceptionValues.push(key + ": " + message[key]);
  904. }
  905. }
  906. exceptionMessage = exceptionValues.join("\n") || "";
  907. exceptionValues = exceptionMessage.split("\n");
  908. exceptionMessage = "EXCEPTION: " + exceptionValues.join("\nEXCEPTION: ");
  909. SWFUpload.Console.writeLine(exceptionMessage);
  910. } else {
  911. SWFUpload.Console.writeLine(message);
  912. }
  913. }
  914. };
  915. SWFUpload.Console = {};
  916. SWFUpload.Console.writeLine = function (message) {
  917. var console, documentForm;
  918. try {
  919. console = document.getElementById("SWFUpload_Console");
  920. if (!console) {
  921. documentForm = document.createElement("form");
  922. document.getElementsByTagName("body")[0].appendChild(documentForm);
  923. console = document.createElement("textarea");
  924. console.id = "SWFUpload_Console";
  925. console.style.fontFamily = "monospace";
  926. console.setAttribute("wrap", "off");
  927. console.wrap = "off";
  928. console.style.overflow = "auto";
  929. console.style.width = "700px";
  930. console.style.height = "350px";
  931. console.style.margin = "5px";
  932. documentForm.appendChild(console);
  933. }
  934. console.value += message + "\n";
  935. console.scrollTop = console.scrollHeight - console.clientHeight;
  936. } catch (ex) {
  937. alert("Exception: " + ex.name + " Message: " + ex.message);
  938. }
  939. };
  940. /* SWFObject v2.2 <http://code.google.com/p/swfobject/>
  941. is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
  942. */
  943. swfobject = function () {
  944. var D = "undefined", r = "object", S = "Shockwave Flash", W = "ShockwaveFlash.ShockwaveFlash", q = "application/x-shockwave-flash", R = "SWFObjectExprInst", x = "onreadystatechange", O = window, j = document, t = navigator, T = false, U = [h], o = [], N = [], I = [], l, Q, E, B, J = false, a = false, n, G, m = true, M = function () {
  945. var aa = typeof j.getElementById != D && typeof j.getElementsByTagName != D && typeof j.createElement != D, ah = t.userAgent.toLowerCase(), Y = t.platform.toLowerCase(), ae = Y ? /win/.test(Y) : /win/.test(ah), ac = Y ? /mac/.test(Y) : /mac/.test(ah), af = /webkit/.test(ah) ? parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, X = !+"\v1", ag = [0, 0, 0], ab = null;
  946. if (typeof t.plugins != D && typeof t.plugins[S] == r) {
  947. ab = t.plugins[S].description;
  948. if (ab && !(typeof t.mimeTypes != D && t.mimeTypes[q] && !t.mimeTypes[q].enabledPlugin)) {
  949. T = true;
  950. X = false;
  951. ab = ab.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
  952. ag[0] = parseInt(ab.replace(/^(.*)\..*$/, "$1"), 10);
  953. ag[1] = parseInt(ab.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
  954. ag[2] = /[a-zA-Z]/.test(ab) ? parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0
  955. }
  956. } else {
  957. if (typeof O.ActiveXObject != D) {
  958. try {
  959. var ad = new ActiveXObject(W);
  960. if (ad) {
  961. ab = ad.GetVariable("$version");
  962. if (ab) {
  963. X = true;
  964. ab = ab.split(" ")[1].split(",");
  965. ag = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)]
  966. }
  967. }
  968. } catch (Z) {
  969. }
  970. }
  971. }
  972. return{w3: aa, pv: ag, wk: af, ie: X, win: ae, mac: ac}
  973. }(), k = function () {
  974. if (!M.w3) {
  975. return
  976. }
  977. if ((typeof j.readyState != D && j.readyState == "complete") || (typeof j.readyState == D && (j.getElementsByTagName("body")[0] || j.body))) {
  978. f()
  979. }
  980. if (!J) {
  981. if (typeof j.addEventListener != D) {
  982. j.addEventListener("DOMContentLoaded", f, false)
  983. }
  984. if (M.ie && M.win) {
  985. j.attachEvent(x, function () {
  986. if (j.readyState == "complete") {
  987. j.detachEvent(x, arguments.callee);
  988. f()
  989. }
  990. });
  991. if (O == top) {
  992. (function () {
  993. if (J) {
  994. return
  995. }
  996. try {
  997. j.documentElement.doScroll("left")
  998. } catch (X) {
  999. setTimeout(arguments.callee, 0);
  1000. return
  1001. }
  1002. f()
  1003. })()
  1004. }
  1005. }
  1006. if (M.wk) {
  1007. (function () {
  1008. if (J) {
  1009. return
  1010. }
  1011. if (!/loaded|complete/.test(j.readyState)) {
  1012. setTimeout(arguments.callee, 0);
  1013. return
  1014. }
  1015. f()
  1016. })()
  1017. }
  1018. s(f)
  1019. }
  1020. }();
  1021. function f() {
  1022. if (J) {
  1023. return
  1024. }
  1025. try {
  1026. var Z = j.getElementsByTagName("body")[0].appendChild(C("span"));
  1027. Z.parentNode.removeChild(Z)
  1028. } catch (aa) {
  1029. return
  1030. }
  1031. J = true;
  1032. var X = U.length;
  1033. for (var Y = 0; Y < X; Y++) {
  1034. U[Y]()
  1035. }
  1036. }
  1037. function K(X) {
  1038. if (J) {
  1039. X()
  1040. } else {
  1041. U[U.length] = X
  1042. }
  1043. }
  1044. function s(Y) {
  1045. if (typeof O.addEventListener != D) {
  1046. O.addEventListener("load", Y, false)
  1047. } else {
  1048. if (typeof j.addEventListener != D) {
  1049. j.addEventListener("load", Y, false)
  1050. } else {
  1051. if (typeof O.attachEvent != D) {
  1052. i(O, "onload", Y)
  1053. } else {
  1054. if (typeof O.onload == "function") {
  1055. var X = O.onload;
  1056. O.onload = function () {
  1057. X();
  1058. Y()
  1059. }
  1060. } else {
  1061. O.onload = Y
  1062. }
  1063. }
  1064. }
  1065. }
  1066. }
  1067. function h() {
  1068. if (T) {
  1069. V()
  1070. } else {
  1071. H()
  1072. }
  1073. }
  1074. function V() {
  1075. var X = j.getElementsByTagName("body")[0];
  1076. var aa = C(r);
  1077. aa.setAttribute("type", q);
  1078. var Z = X.appendChild(aa);
  1079. if (Z) {
  1080. var Y = 0;
  1081. (function () {
  1082. if (typeof Z.GetVariable != D) {
  1083. var ab = Z.GetVariable("$version");
  1084. if (ab) {
  1085. ab = ab.split(" ")[1].split(",");
  1086. M.pv = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)]
  1087. }
  1088. } else {
  1089. if (Y < 10) {
  1090. Y++;
  1091. setTimeout(arguments.callee, 10);
  1092. return
  1093. }
  1094. }
  1095. X.removeChild(aa);
  1096. Z = null;
  1097. H()
  1098. })()
  1099. } else {
  1100. H()
  1101. }
  1102. }
  1103. function H() {
  1104. var ag = o.length;
  1105. if (ag > 0) {
  1106. for (var af = 0; af < ag; af++) {
  1107. var Y = o[af].id;
  1108. var ab = o[af].callbackFn;
  1109. var aa = {success: false, id: Y};
  1110. if (M.pv[0] > 0) {
  1111. var ae = c(Y);
  1112. if (ae) {
  1113. if (F(o[af].swfVersion) && !(M.wk && M.wk < 312)) {
  1114. w(Y, true);
  1115. if (ab) {
  1116. aa.success = true;
  1117. aa.ref = z(Y);
  1118. ab(aa)
  1119. }
  1120. } else {
  1121. if (o[af].expressInstall && A()) {
  1122. var ai = {};
  1123. ai.data = o[af].expressInstall;
  1124. ai.width = ae.getAttribute("width") || "0";
  1125. ai.height = ae.getAttribute("height") || "0";
  1126. if (ae.getAttribute("class")) {
  1127. ai.styleclass = ae.getAttribute("class")
  1128. }
  1129. if (ae.getAttribute("align")) {
  1130. ai.align = ae.getAttribute("align")
  1131. }
  1132. var ah = {};
  1133. var X = ae.getElementsByTagName("param");
  1134. var ac = X.length;
  1135. for (var ad = 0; ad < ac; ad++) {
  1136. if (X[ad].getAttribute("name").toLowerCase() != "movie") {
  1137. ah[X[ad].getAttribute("name")] = X[ad].getAttribute("value")
  1138. }
  1139. }
  1140. P(ai, ah, Y, ab)
  1141. } else {
  1142. p(ae);
  1143. if (ab) {
  1144. ab(aa)
  1145. }
  1146. }
  1147. }
  1148. }
  1149. } else {
  1150. w(Y, true);
  1151. if (ab) {
  1152. var Z = z(Y);
  1153. if (Z && typeof Z.SetVariable != D) {
  1154. aa.success = true;
  1155. aa.ref = Z
  1156. }
  1157. ab(aa)
  1158. }
  1159. }
  1160. }
  1161. }
  1162. }
  1163. function z(aa) {
  1164. var X = null;
  1165. var Y = c(aa);
  1166. if (Y && Y.nodeName == "OBJECT") {
  1167. if (typeof Y.SetVariable != D) {
  1168. X = Y
  1169. } else {
  1170. var Z = Y.getElementsByTagName(r)[0];
  1171. if (Z) {
  1172. X = Z
  1173. }
  1174. }
  1175. }
  1176. return X
  1177. }
  1178. function A() {
  1179. return !a && F("6.0.65") && (M.win || M.mac) && !(M.wk && M.wk < 312)
  1180. }
  1181. function P(aa, ab, X, Z) {
  1182. a = true;
  1183. E = Z || null;
  1184. B = {success: false, id: X};
  1185. var ae = c(X);
  1186. if (ae) {
  1187. if (ae.nodeName == "OBJECT") {
  1188. l = g(ae);
  1189. Q = null
  1190. } else {
  1191. l = ae;
  1192. Q = X
  1193. }
  1194. aa.id = R;
  1195. if (typeof aa.width == D || (!/%$/.test(aa.width) && parseInt(aa.width, 10) < 310)) {
  1196. aa.width = "310"
  1197. }
  1198. if (typeof aa.height == D || (!/%$/.test(aa.height) && parseInt(aa.height, 10) < 137)) {
  1199. aa.height = "137"
  1200. }
  1201. j.title = j.title.slice(0, 47) + " - Flash Player Installation";
  1202. var ad = M.ie && M.win ? "ActiveX" : "PlugIn", ac = "MMredirectURL=" + O.location.toString().replace(/&/g, "%26") + "&MMplayerType=" + ad + "&MMdoctitle=" + j.title;
  1203. if (typeof ab.flashvars != D) {
  1204. ab.flashvars += "&" + ac
  1205. } else {
  1206. ab.flashvars = ac
  1207. }
  1208. if (M.ie && M.win && ae.readyState != 4) {
  1209. var Y = C("div");
  1210. X += "SWFObjectNew";
  1211. Y.setAttribute("id", X);
  1212. ae.parentNode.insertBefore(Y, ae);
  1213. ae.style.display = "none";
  1214. (function () {
  1215. if (ae.readyState == 4) {
  1216. ae.parentNode.removeChild(ae)
  1217. } else {
  1218. setTimeout(arguments.callee, 10)
  1219. }
  1220. })()
  1221. }
  1222. u(aa, ab, X)
  1223. }
  1224. }
  1225. function p(Y) {
  1226. if (M.ie && M.win && Y.readyState != 4) {
  1227. var X = C("div");
  1228. Y.parentNode.insertBefore(X, Y);
  1229. X.parentNode.replaceChild(g(Y), X);
  1230. Y.style.display = "none";
  1231. (function () {
  1232. if (Y.readyState == 4) {
  1233. Y.parentNode.removeChild(Y)
  1234. } else {
  1235. setTimeout(arguments.callee, 10)
  1236. }
  1237. })()
  1238. } else {
  1239. Y.parentNode.replaceChild(g(Y), Y)
  1240. }
  1241. }
  1242. function g(ab) {
  1243. var aa = C("div");
  1244. if (M.win && M.ie) {
  1245. aa.innerHTML = ab.innerHTML
  1246. } else {
  1247. var Y = ab.getElementsByTagName(r)[0];
  1248. if (Y) {
  1249. var ad = Y.childNodes;
  1250. if (ad) {
  1251. var X = ad.length;
  1252. for (var Z = 0; Z < X; Z++) {
  1253. if (!(ad[Z].nodeType == 1 && ad[Z].nodeName == "PARAM") && !(ad[Z].nodeType == 8)) {
  1254. aa.appendChild(ad[Z].cloneNode(true))
  1255. }
  1256. }
  1257. }
  1258. }
  1259. }
  1260. return aa
  1261. }
  1262. function u(ai, ag, Y) {
  1263. var X, aa = c(Y);
  1264. if (M.wk && M.wk < 312) {
  1265. return X
  1266. }
  1267. if (aa) {
  1268. if (typeof ai.id == D) {
  1269. ai.id = Y
  1270. }
  1271. if (M.ie && M.win) {
  1272. var ah = "";
  1273. for (var ae in ai) {
  1274. if (ai[ae] != Object.prototype[ae]) {
  1275. if (ae.toLowerCase() == "data") {
  1276. ag.movie = ai[ae]
  1277. } else {
  1278. if (ae.toLowerCase() == "styleclass") {
  1279. ah += ' class="' + ai[ae] + '"'
  1280. } else {
  1281. if (ae.toLowerCase() != "classid") {
  1282. ah += " " + ae + '="' + ai[ae] + '"'
  1283. }
  1284. }
  1285. }
  1286. }
  1287. }
  1288. var af = "";
  1289. for (var ad in ag) {
  1290. if (ag[ad] != Object.prototype[ad]) {
  1291. af += '<param name="' + ad + '" value="' + ag[ad] + '" />'
  1292. }
  1293. }
  1294. aa.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + ah + ">" + af + "</object>";
  1295. N[N.length] = ai.id;
  1296. X = c(ai.id)
  1297. } else {
  1298. var Z = C(r);
  1299. Z.setAttribute("type", q);
  1300. for (var ac in ai) {
  1301. if (ai[ac] != Object.prototype[ac]) {
  1302. if (ac.toLowerCase() == "styleclass") {
  1303. Z.setAttribute("class", ai[ac])
  1304. } else {
  1305. if (ac.toLowerCase() != "classid") {
  1306. Z.setAttribute(ac, ai[ac])
  1307. }
  1308. }
  1309. }
  1310. }
  1311. for (var ab in ag) {
  1312. if (ag[ab] != Object.prototype[ab] && ab.toLowerCase() != "movie") {
  1313. e(Z, ab, ag[ab])
  1314. }
  1315. }
  1316. aa.parentNode.replaceChild(Z, aa);
  1317. X = Z
  1318. }
  1319. }
  1320. return X
  1321. }
  1322. function e(Z, X, Y) {
  1323. var aa = C("param");
  1324. aa.setAttribute("name", X);
  1325. aa.setAttribute("value", Y);
  1326. Z.appendChild(aa)
  1327. }
  1328. function y(Y) {
  1329. var X = c(Y);
  1330. if (X && X.nodeName == "OBJECT") {
  1331. if (M.ie && M.win) {
  1332. X.style.display = "none";
  1333. (function () {
  1334. if (X.readyState == 4) {
  1335. b(Y)
  1336. } else {
  1337. setTimeout(arguments.callee, 10)
  1338. }
  1339. })()
  1340. } else {
  1341. X.parentNode.removeChild(X)
  1342. }
  1343. }
  1344. }
  1345. function b(Z) {
  1346. var Y = c(Z);
  1347. if (Y) {
  1348. for (var X in Y) {
  1349. if (typeof Y[X] == "function") {
  1350. Y[X] = null
  1351. }
  1352. }
  1353. Y.parentNode.removeChild(Y)
  1354. }
  1355. }
  1356. function c(Z) {
  1357. var X = null;
  1358. try {
  1359. X = j.getElementById(Z)
  1360. } catch (Y) {
  1361. }
  1362. return X
  1363. }
  1364. function C(X) {
  1365. return j.createElement(X)
  1366. }
  1367. function i(Z, X, Y) {
  1368. Z.attachEvent(X, Y);
  1369. I[I.length] = [Z, X, Y]
  1370. }
  1371. function F(Z) {
  1372. var Y = M.pv, X = Z.split(".");
  1373. X[0] = parseInt(X[0], 10);
  1374. X[1] = parseInt(X[1], 10) || 0;
  1375. X[2] = parseInt(X[2], 10) || 0;
  1376. return(Y[0] > X[0] || (Y[0] == X[0] && Y[1] > X[1]) || (Y[0] == X[0] && Y[1] == X[1] && Y[2] >= X[2])) ? true : false
  1377. }
  1378. function v(ac, Y, ad, ab) {
  1379. if (M.ie && M.mac) {
  1380. return
  1381. }
  1382. var aa = j.getElementsByTagName("head")[0];
  1383. if (!aa) {
  1384. return
  1385. }
  1386. var X = (ad && typeof ad == "string") ? ad : "screen";
  1387. if (ab) {
  1388. n = null;
  1389. G = null
  1390. }
  1391. if (!n || G != X) {
  1392. var Z = C("style");
  1393. Z.setAttribute("type", "text/css");
  1394. Z.setAttribute("media", X);
  1395. n = aa.appendChild(Z);
  1396. if (M.ie && M.win && typeof j.styleSheets != D && j.styleSheets.length > 0) {
  1397. n = j.styleSheets[j.styleSheets.length - 1]
  1398. }
  1399. G = X
  1400. }
  1401. if (M.ie && M.win) {
  1402. if (n && typeof n.addRule == r) {
  1403. n.addRule(ac, Y)
  1404. }
  1405. } else {
  1406. if (n && typeof j.createTextNode != D) {
  1407. n.appendChild(j.createTextNode(ac + " {" + Y + "}"))
  1408. }
  1409. }
  1410. }
  1411. function w(Z, X) {
  1412. if (!m) {
  1413. return
  1414. }
  1415. var Y = X ? "visible" : "hidden";
  1416. if (J && c(Z)) {
  1417. c(Z).style.visibility = Y
  1418. } else {
  1419. v("#" + Z, "visibility:" + Y)
  1420. }
  1421. }
  1422. function L(Y) {
  1423. var Z = /[\\\"<>\.;]/;
  1424. var X = Z.exec(Y) != null;
  1425. return X && typeof encodeURIComponent != D ? encodeURIComponent(Y) : Y
  1426. }
  1427. var d = function () {
  1428. if (M.ie && M.win) {
  1429. window.attachEvent("onunload", function () {
  1430. var ac = I.length;
  1431. for (var ab = 0; ab < ac; ab++) {
  1432. I[ab][0].detachEvent(I[ab][1], I[ab][2])
  1433. }
  1434. var Z = N.length;
  1435. for (var aa = 0; aa < Z; aa++) {
  1436. y(N[aa])
  1437. }
  1438. for (var Y in M) {
  1439. M[Y] = null
  1440. }
  1441. M = null;
  1442. for (var X in swfobject) {
  1443. swfobject[X] = null
  1444. }
  1445. swfobject = null
  1446. })
  1447. }
  1448. }();
  1449. return{registerObject: function (ab, X, aa, Z) {
  1450. if (M.w3 && ab && X) {
  1451. var Y = {};
  1452. Y.id = ab;
  1453. Y.swfVersion = X;
  1454. Y.expressInstall = aa;
  1455. Y.callbackFn = Z;
  1456. o[o.length] = Y;
  1457. w(ab, false)
  1458. } else {
  1459. if (Z) {
  1460. Z({success: false, id: ab})
  1461. }
  1462. }
  1463. }, getObjectById: function (X) {
  1464. if (M.w3) {
  1465. return z(X)
  1466. }
  1467. }, embedSWF: function (ab, ah, ae, ag, Y, aa, Z, ad, af, ac) {
  1468. var X = {success: false, id: ah};
  1469. if (M.w3 && !(M.wk && M.wk < 312) && ab && ah && ae && ag && Y) {
  1470. w(ah, false);
  1471. K(function () {
  1472. ae += "";
  1473. ag += "";
  1474. var aj = {};
  1475. if (af && typeof af === r) {
  1476. for (var al in af) {
  1477. aj[al] = af[al]
  1478. }
  1479. }
  1480. aj.data = ab;
  1481. aj.width = ae;
  1482. aj.height = ag;
  1483. var am = {};
  1484. if (ad && typeof ad === r) {
  1485. for (var ak in ad) {
  1486. am[ak] = ad[ak]
  1487. }
  1488. }
  1489. if (Z && typeof Z === r) {
  1490. for (var ai in Z) {
  1491. if (typeof am.flashvars != D) {
  1492. am.flashvars += "&" + ai + "=" + Z[ai]
  1493. } else {
  1494. am.flashvars = ai + "=" + Z[ai]
  1495. }
  1496. }
  1497. }
  1498. if (F(Y)) {
  1499. var an = u(aj, am, ah);
  1500. if (aj.id == ah) {
  1501. w(ah, true)
  1502. }
  1503. X.success = true;
  1504. X.ref = an
  1505. } else {
  1506. if (aa && A()) {
  1507. aj.data = aa;
  1508. P(aj, am, ah, ac);
  1509. return
  1510. } else {
  1511. w(ah, true)
  1512. }
  1513. }
  1514. if (ac) {
  1515. ac(X)
  1516. }
  1517. })
  1518. } else {
  1519. if (ac) {
  1520. ac(X)
  1521. }
  1522. }
  1523. }, switchOffAutoHideShow: function () {
  1524. m = false
  1525. }, ua: M, getFlashPlayerVersion: function () {
  1526. return{major: M.pv[0], minor: M.pv[1], release: M.pv[2]}
  1527. }, hasFlashPlayerVersion: F, createSWF: function (Z, Y, X) {
  1528. if (M.w3) {
  1529. return u(Z, Y, X)
  1530. } else {
  1531. return undefined
  1532. }
  1533. }, showExpressInstall: function (Z, aa, X, Y) {
  1534. if (M.w3 && A()) {
  1535. P(Z, aa, X, Y)
  1536. }
  1537. }, removeSWF: function (X) {
  1538. if (M.w3) {
  1539. y(X)
  1540. }
  1541. }, createCSS: function (aa, Z, Y, X) {
  1542. if (M.w3) {
  1543. v(aa, Z, Y, X)
  1544. }
  1545. }, addDomLoadEvent: K, addLoadEvent: s, getQueryParamValue: function (aa) {
  1546. var Z = j.location.search || j.location.hash;
  1547. if (Z) {
  1548. if (/\?/.test(Z)) {
  1549. Z = Z.split("?")[1]
  1550. }
  1551. if (aa == null) {
  1552. return L(Z)
  1553. }
  1554. var Y = Z.split("&");
  1555. for (var X = 0; X < Y.length; X++) {
  1556. if (Y[X].substring(0, Y[X].indexOf("=")) == aa) {
  1557. return L(Y[X].substring((Y[X].indexOf("=") + 1)))
  1558. }
  1559. }
  1560. }
  1561. return""
  1562. }, expressInstallCallback: function () {
  1563. if (a) {
  1564. var X = c(R);
  1565. if (X && l) {
  1566. X.parentNode.replaceChild(l, X);
  1567. if (Q) {
  1568. w(Q, true);
  1569. if (M.ie && M.win) {
  1570. l.style.display = "block"
  1571. }
  1572. }
  1573. if (E) {
  1574. E(B)
  1575. }
  1576. }
  1577. a = false
  1578. }
  1579. }}
  1580. }();
  1581. swfobject.addDomLoadEvent(function () {
  1582. if (typeof(SWFUpload.onload) === "function") {
  1583. SWFUpload.onload.call(window);
  1584. }
  1585. });