Advertisement
Guest User

SWFUpload 2.50 beta 3 JS

a guest
Sep 15th, 2014
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var SWFUpload,swfobject;SWFUpload==undefined&&(SWFUpload=function(n){this.initSWFUpload(n)}),SWFUpload.prototype.initSWFUpload=function(n){try{this.customSettings={},this.settings={},this.eventQueue=[],this.movieName="SWFUpload_"+SWFUpload.movieCount++,this.movieElement=null,SWFUpload.instances[this.movieName]=this,this.initSettings(n),this.loadSupport(),this.swfuploadPreload()&&this.loadFlash(),this.displayDebugInfo()}catch(t){delete SWFUpload.instances[this.movieName];throw t;}},SWFUpload.instances={},SWFUpload.movieCount=0,SWFUpload.version="2.5.0 2010-01-15 Beta 2",SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130},SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290,RESIZE:-300},SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5},SWFUpload.UPLOAD_TYPE={NORMAL:-1,RESIZED:-2},SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120,JAVASCRIPT:-130,NONE:-130},SWFUpload.CURSOR={ARROW:-1,HAND:-2},SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"},SWFUpload.RESIZE_ENCODING={JPEG:-1,PNG:-2},SWFUpload.completeURL=function(n){try{var t="",i=-1;return typeof n!="string"||n.match(/^https?:\/\//i)||n.match(/^\//)||n===""?n:(i=window.location.pathname.lastIndexOf("/"),t=i<=0?"/":window.location.pathname.substr(0,i)+"/",t+n)}catch(r){return n}},SWFUpload.onload=function(){},SWFUpload.prototype.initSettings=function(n){this.ensureDefault=function(t,i){var r=n[t];this.settings[t]=r!=undefined?r:i},this.ensureDefault("upload_url",""),this.ensureDefault("preserve_relative_urls",!1),this.ensureDefault("file_post_name","Filedata"),this.ensureDefault("post_params",{}),this.ensureDefault("use_query_string",!1),this.ensureDefault("requeue_on_error",!1),this.ensureDefault("http_success",[]),this.ensureDefault("assume_success_timeout",0),this.ensureDefault("file_types","*.*"),this.ensureDefault("file_types_description","All Files"),this.ensureDefault("file_size_limit",0),this.ensureDefault("file_upload_limit",0),this.ensureDefault("file_queue_limit",0),this.ensureDefault("flash_url","swfupload.swf"),this.ensureDefault("flash9_url","swfupload_fp9.swf"),this.ensureDefault("prevent_swf_caching",!0),this.ensureDefault("button_image_url",""),this.ensureDefault("button_width",1),this.ensureDefault("button_height",1),this.ensureDefault("button_text",""),this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;"),this.ensureDefault("button_text_top_padding",0),this.ensureDefault("button_text_left_padding",0),this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES),this.ensureDefault("button_disabled",!1),this.ensureDefault("button_placeholder_id",""),this.ensureDefault("button_placeholder",null),this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW),this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW),this.ensureDefault("debug",!1),this.settings.debug_enabled=this.settings.debug,this.settings.return_upload_start_handler=this.returnUploadStart,this.ensureDefault("swfupload_preload_handler",null),this.ensureDefault("swfupload_load_failed_handler",null),this.ensureDefault("swfupload_loaded_handler",null),this.ensureDefault("file_dialog_start_handler",null),this.ensureDefault("file_queued_handler",null),this.ensureDefault("file_queue_error_handler",null),this.ensureDefault("file_dialog_complete_handler",null),this.ensureDefault("upload_resize_start_handler",null),this.ensureDefault("upload_start_handler",null),this.ensureDefault("upload_progress_handler",null),this.ensureDefault("upload_error_handler",null),this.ensureDefault("upload_success_handler",null),this.ensureDefault("upload_complete_handler",null),this.ensureDefault("mouse_click_handler",null),this.ensureDefault("mouse_out_handler",null),this.ensureDefault("mouse_over_handler",null),this.ensureDefault("debug_handler",this.debugMessage),this.ensureDefault("custom_settings",{}),this.customSettings=this.settings.custom_settings,!this.settings.prevent_swf_caching||(this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+ +new Date,this.settings.flash9_url=this.settings.flash9_url+(this.settings.flash9_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+ +new Date),this.settings.preserve_relative_urls||(this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url),this.settings.button_image_url=SWFUpload.completeURL(this.settings.button_image_url)),delete this.ensureDefault},SWFUpload.prototype.loadSupport=function(){this.support={loading:swfobject.hasFlashPlayerVersion("9.0.28"),imageResize:swfobject.hasFlashPlayerVersion("10.0.0")}},SWFUpload.prototype.loadFlash=function(){var n,i,r,u,t;if(!this.support.loading){this.queueEvent("swfupload_load_failed_handler",["Flash Player doesn't support SWFUpload"]);return}if(document.getElementById(this.movieName)!==null){this.support.loading=!1,this.queueEvent("swfupload_load_failed_handler",["Element ID already in use"]);return}if(n=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder,n==undefined){this.support.loading=!1,this.queueEvent("swfupload_load_failed_handler",["button place holder not found"]);return}r=(n.currentStyle&&n.currentStyle.display||window.getComputedStyle&&document.defaultView.getComputedStyle(n,null).getPropertyValue("display"))!=="block"?"span":"div",i=document.createElement(r),u=this.getFlashHTML();try{i.innerHTML=u}catch(f){this.support.loading=!1,this.queueEvent("swfupload_load_failed_handler",["Exception loading Flash HTML into placeholder"]);return}if(t=i.getElementsByTagName("object"),!t||t.length>1||t.length===0){this.support.loading=!1,this.queueEvent("swfupload_load_failed_handler",["Unable to find movie after adding to DOM"]);return}t.length===1&&(this.movieElement=t[0]),n.parentNode.replaceChild(i.firstChild,n),window[this.movieName]==undefined&&(window[this.movieName]=this.getMovieElement())},SWFUpload.prototype.getFlashHTML=function(){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">','<param name="wmode" value="',this.settings.button_window_mode,'" />','<param name="movie" value="',this.support.imageResize?this.settings.flash_url:this.settings.flash9_url,'" />','<param name="quality" value="high" />','<param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+this.getFlashVars()+'" />',"</object>"].join("")},SWFUpload.prototype.getFlashVars=function(){var n,t;return t=this.buildParamString(),n=this.settings.http_success.join(","),["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(n),"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&amp;params=",encodeURIComponent(t),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")},SWFUpload.prototype.getMovieElement=function(){if(this.movieElement==undefined&&(this.movieElement=document.getElementById(this.movieName)),this.movieElement===null)throw"Could not find Flash element";return this.movieElement},SWFUpload.prototype.buildParamString=function(){var t,n,i=[];if(n=this.settings.post_params,typeof n=="object")for(t in n)n.hasOwnProperty(t)&&i.push(encodeURIComponent(t.toString())+"="+encodeURIComponent(n[t].toString()));return i.join("&amp;")},SWFUpload.prototype.destroy=function(){var n;try{if(this.cancelUpload(null,!1),n=this.cleanUp(),n)try{n.parentNode.removeChild(n)}catch(t){}return window[this.movieName]=null,SWFUpload.instances[this.movieName]=null,delete SWFUpload.instances[this.movieName],this.movieElement=null,this.settings=null,this.customSettings=null,this.eventQueue=null,this.movieName=null,!0}catch(i){return!1}},SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url:               ",this.settings.upload_url,"\n","\t","flash_url:                ",this.settings.flash_url,"\n","\t","flash9_url:                ",this.settings.flash9_url,"\n","\t","use_query_string:         ",this.settings.use_query_string.toString(),"\n","\t","requeue_on_error:         ",this.settings.requeue_on_error.toString(),"\n","\t","http_success:             ",this.settings.http_success.join(", "),"\n","\t","assume_success_timeout:   ",this.settings.assume_success_timeout,"\n","\t","file_post_name:           ",this.settings.file_post_name,"\n","\t","post_params:              ",this.settings.post_params.toString(),"\n","\t","file_types:               ",this.settings.file_types,"\n","\t","file_types_description:   ",this.settings.file_types_description,"\n","\t","file_size_limit:          ",this.settings.file_size_limit,"\n","\t","file_upload_limit:        ",this.settings.file_upload_limit,"\n","\t","file_queue_limit:         ",this.settings.file_queue_limit,"\n","\t","debug:                    ",this.settings.debug.toString(),"\n","\t","prevent_swf_caching:      ",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id:    ",this.settings.button_placeholder_id.toString(),"\n","\t","button_placeholder:       ",this.settings.button_placeholder?"Set":"Not Set","\n","\t","button_image_url:         ",this.settings.button_image_url.toString(),"\n","\t","button_width:             ",this.settings.button_width.toString(),"\n","\t","button_height:            ",this.settings.button_height.toString(),"\n","\t","button_text:              ",this.settings.button_text.toString(),"\n","\t","button_text_style:        ",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding:  ",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","\t","button_action:            ",this.settings.button_action.toString(),"\n","\t","button_cursor:            ",this.settings.button_cursor.toString(),"\n","\t","button_disabled:          ",this.settings.button_disabled.toString(),"\n","\t","custom_settings:          ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_preload_handler assigned:  ",(typeof this.settings.swfupload_preload_handler=="function").toString(),"\n","\t","swfupload_load_failed_handler assigned:  ",(typeof this.settings.swfupload_load_failed_handler=="function").toString(),"\n","\t","swfupload_loaded_handler assigned:  ",(typeof this.settings.swfupload_loaded_handler=="function").toString(),"\n","\t","mouse_click_handler assigned:       ",(typeof this.settings.mouse_click_handler=="function").toString(),"\n","\t","mouse_over_handler assigned:        ",(typeof this.settings.mouse_over_handler=="function").toString(),"\n","\t","mouse_out_handler assigned:         ",(typeof this.settings.mouse_out_handler=="function").toString(),"\n","\t","file_dialog_start_handler assigned: ",(typeof this.settings.file_dialog_start_handler=="function").toString(),"\n","\t","file_queued_handler assigned:       ",(typeof this.settings.file_queued_handler=="function").toString(),"\n","\t","file_queue_error_handler assigned:  ",(typeof this.settings.file_queue_error_handler=="function").toString(),"\n","\t","upload_resize_start_handler assigned:      ",(typeof this.settings.upload_resize_start_handler=="function").toString(),"\n","\t","upload_start_handler assigned:      ",(typeof this.settings.upload_start_handler=="function").toString(),"\n","\t","upload_progress_handler assigned:   ",(typeof this.settings.upload_progress_handler=="function").toString(),"\n","\t","upload_error_handler assigned:      ",(typeof this.settings.upload_error_handler=="function").toString(),"\n","\t","upload_success_handler assigned:    ",(typeof this.settings.upload_success_handler=="function").toString(),"\n","\t","upload_complete_handler assigned:   ",(typeof this.settings.upload_complete_handler=="function").toString(),"\n","\t","debug_handler assigned:             ",(typeof this.settings.debug_handler=="function").toString(),"\n","Support:\n","\t","Load:                     ",this.support.loading?"Yes":"No","\n","\t","Image Resize:             ",this.support.imageResize?"Yes":"No","\n"].join(""))},SWFUpload.prototype.addSetting=function(n,t,i){return this.settings[n]=t==undefined?i:t},SWFUpload.prototype.getSetting=function(n){return this.settings[n]!=undefined?this.settings[n]:""},SWFUpload.prototype.callFlash=function(functionName,argumentArray){var movieElement,returnValue,returnString;argumentArray=argumentArray||[],movieElement=this.getMovieElement();try{movieElement!=undefined?(returnString=movieElement.CallFunction('<invoke name="'+functionName+'" returntype="javascript">'+__flash__argumentsToXML(argumentArray,0)+"</invoke>"),returnValue=eval(returnString)):this.debug("Can't call flash because the movie wasn't found.")}catch(ex){this.debug("Exception calling flash function '"+functionName+"': "+ex.message)}return returnValue!=undefined&&typeof returnValue.post=="object"&&(returnValue=this.unescapeFilePostParams(returnValue)),returnValue},SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")},SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")},SWFUpload.prototype.startUpload=function(n){this.callFlash("StartUpload",[n])},SWFUpload.prototype.startResizedUpload=function(n,t,i,r,u,f){this.callFlash("StartUpload",[n,{width:t,height:i,encoding:r,quality:u,allowEnlarging:f}])},SWFUpload.prototype.cancelUpload=function(n,t){t!==!1&&(t=!0),this.callFlash("CancelUpload",[n,t])},SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")},SWFUpload.prototype.requeueUpload=function(n){return this.callFlash("RequeueUpload",[n])},SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")},SWFUpload.prototype.setStats=function(n){this.callFlash("SetStats",[n])},SWFUpload.prototype.getFile=function(n){return typeof n=="number"?this.callFlash("GetFileByIndex",[n]):this.callFlash("GetFile",[n])},SWFUpload.prototype.getQueueFile=function(n){return typeof n=="number"?this.callFlash("GetFileByQueueIndex",[n]):this.callFlash("GetFile",[n])},SWFUpload.prototype.addFileParam=function(n,t,i){return this.callFlash("AddFileParam",[n,t,i])},SWFUpload.prototype.removeFileParam=function(n,t){this.callFlash("RemoveFileParam",[n,t])},SWFUpload.prototype.setUploadURL=function(n){this.settings.upload_url=n.toString(),this.callFlash("SetUploadURL",[n])},SWFUpload.prototype.setPostParams=function(n){this.settings.post_params=n,this.callFlash("SetPostParams",[n])},SWFUpload.prototype.addPostParam=function(n,t){this.settings.post_params[n]=t,this.callFlash("SetPostParams",[this.settings.post_params])},SWFUpload.prototype.removePostParam=function(n){delete this.settings.post_params[n],this.callFlash("SetPostParams",[this.settings.post_params])},SWFUpload.prototype.setFileTypes=function(n,t){this.settings.file_types=n,this.settings.file_types_description=t,this.callFlash("SetFileTypes",[n,t])},SWFUpload.prototype.setFileSizeLimit=function(n){this.settings.file_size_limit=n,this.callFlash("SetFileSizeLimit",[n])},SWFUpload.prototype.setFileUploadLimit=function(n){this.settings.file_upload_limit=n,this.callFlash("SetFileUploadLimit",[n])},SWFUpload.prototype.setFileQueueLimit=function(n){this.settings.file_queue_limit=n,this.callFlash("SetFileQueueLimit",[n])},SWFUpload.prototype.setFilePostName=function(n){this.settings.file_post_name=n,this.callFlash("SetFilePostName",[n])},SWFUpload.prototype.setUseQueryString=function(n){this.settings.use_query_string=n,this.callFlash("SetUseQueryString",[n])},SWFUpload.prototype.setRequeueOnError=function(n){this.settings.requeue_on_error=n,this.callFlash("SetRequeueOnError",[n])},SWFUpload.prototype.setHTTPSuccess=function(n){typeof n=="string"&&(n=n.replace(" ","").split(",")),this.settings.http_success=n,this.callFlash("SetHTTPSuccess",[n])},SWFUpload.prototype.setAssumeSuccessTimeout=function(n){this.settings.assume_success_timeout=n,this.callFlash("SetAssumeSuccessTimeout",[n])},SWFUpload.prototype.setDebugEnabled=function(n){this.settings.debug_enabled=n,this.callFlash("SetDebugEnabled",[n])},SWFUpload.prototype.setButtonImageURL=function(n){n==undefined&&(n=""),this.settings.button_image_url=n,this.callFlash("SetButtonImageURL",[n])},SWFUpload.prototype.setButtonDimensions=function(n,t){this.settings.button_width=n,this.settings.button_height=t;var i=this.getMovieElement();i!=undefined&&(i.style.width=n+"px",i.style.height=t+"px"),this.callFlash("SetButtonDimensions",[n,t])},SWFUpload.prototype.setButtonText=function(n){this.settings.button_text=n,this.callFlash("SetButtonText",[n])},SWFUpload.prototype.setButtonTextPadding=function(n,t){this.settings.button_text_top_padding=t,this.settings.button_text_left_padding=n,this.callFlash("SetButtonTextPadding",[n,t])},SWFUpload.prototype.setButtonTextStyle=function(n){this.settings.button_text_style=n,this.callFlash("SetButtonTextStyle",[n])},SWFUpload.prototype.setButtonDisabled=function(n){this.settings.button_disabled=n,this.callFlash("SetButtonDisabled",[n])},SWFUpload.prototype.setButtonAction=function(n){this.settings.button_action=n,this.callFlash("SetButtonAction",[n])},SWFUpload.prototype.setButtonCursor=function(n){this.settings.button_cursor=n,this.callFlash("SetButtonCursor",[n])},SWFUpload.prototype.queueEvent=function(n,t){var i=this;if(t==undefined?t=[]:t instanceof Array||(t=[t]),typeof this.settings[n]=="function")this.eventQueue.push(function(){this.settings[n].apply(this,t)}),setTimeout(function(){i.executeNextEvent()},0);else if(this.settings[n]!==null)throw"Event handler "+n+" is unknown or is not a function";},SWFUpload.prototype.executeNextEvent=function(){var n=this.eventQueue?this.eventQueue.shift():null;typeof n=="function"&&n.apply(this)},SWFUpload.prototype.unescapeFilePostParams=function(n){var f=/[$]([0-9a-f]{4})/i,u={},t,i,r;if(n!=undefined){for(i in n.post)if(n.post.hasOwnProperty(i)){for(t=i;(r=f.exec(t))!==null;)t=t.replace(r[0],String.fromCharCode(parseInt("0x"+r[1],16)));u[t]=n.post[i]}n.post=u}return n},SWFUpload.prototype.swfuploadPreload=function(){var n;if(typeof this.settings.swfupload_preload_handler=="function")n=this.settings.swfupload_preload_handler.call(this);else if(this.settings.swfupload_preload_handler!=undefined)throw"upload_start_handler must be a function";return n===undefined&&(n=!0),!!n},SWFUpload.prototype.flashReady=function(){var n=this.cleanUp();if(!n){this.debug("Flash called back ready but the flash movie can't be found.");return}this.queueEvent("swfupload_loaded_handler")},SWFUpload.prototype.cleanUp=function(){var t,n=this.getMovieElement();try{if(n&&typeof n.CallFunction=="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(t in n)try{typeof n[t]=="function"&&(n[t]=null)}catch(i){}}}catch(r){}return window.__flash__removeCallback=function(n,t){try{n&&(n[t]=null)}catch(i){}},n},SWFUpload.prototype.mouseClick=function(){this.queueEvent("mouse_click_handler")},SWFUpload.prototype.mouseOver=function(){this.queueEvent("mouse_over_handler")},SWFUpload.prototype.mouseOut=function(){this.queueEvent("mouse_out_handler")},SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")},SWFUpload.prototype.fileQueued=function(n){n=this.unescapeFilePostParams(n),this.queueEvent("file_queued_handler",n)},SWFUpload.prototype.fileQueueError=function(n,t,i){n=this.unescapeFilePostParams(n),this.queueEvent("file_queue_error_handler",[n,t,i])},SWFUpload.prototype.fileDialogComplete=function(n,t,i){this.queueEvent("file_dialog_complete_handler",[n,t,i])},SWFUpload.prototype.uploadResizeStart=function(n,t){n=this.unescapeFilePostParams(n),this.queueEvent("upload_resize_start_handler",[n,t.width,t.height,t.encoding,t.quality])},SWFUpload.prototype.uploadStart=function(n){n=this.unescapeFilePostParams(n),this.queueEvent("return_upload_start_handler",n)},SWFUpload.prototype.returnUploadStart=function(n){var t;if(typeof this.settings.upload_start_handler=="function")n=this.unescapeFilePostParams(n),t=this.settings.upload_start_handler.call(this,n);else if(this.settings.upload_start_handler!=undefined)throw"upload_start_handler must be a function";t===undefined&&(t=!0),t=!!t,this.callFlash("ReturnUploadStart",[t])},SWFUpload.prototype.uploadProgress=function(n,t,i){n=this.unescapeFilePostParams(n),this.queueEvent("upload_progress_handler",[n,t,i])},SWFUpload.prototype.uploadError=function(n,t,i){n=this.unescapeFilePostParams(n),this.queueEvent("upload_error_handler",[n,t,i])},SWFUpload.prototype.uploadSuccess=function(n,t,i){n=this.unescapeFilePostParams(n),this.queueEvent("upload_success_handler",[n,t,i])},SWFUpload.prototype.uploadComplete=function(n){n=this.unescapeFilePostParams(n),this.queueEvent("upload_complete_handler",n)},SWFUpload.prototype.debug=function(n){this.queueEvent("debug_handler",n)},SWFUpload.prototype.debugMessage=function(n){var i,t,r;if(this.settings.debug)if(t=[],typeof n=="object"&&typeof n.name=="string"&&typeof n.message=="string"){for(r in n)n.hasOwnProperty(r)&&t.push(r+": "+n[r]);i=t.join("\n")||"",t=i.split("\n"),i="EXCEPTION: "+t.join("\nEXCEPTION: "),SWFUpload.Console.writeLine(i)}else SWFUpload.Console.writeLine(n)},SWFUpload.Console={},SWFUpload.Console.writeLine=function(n){var t,i;try{t=document.getElementById("SWFUpload_Console"),t||(i=document.createElement("form"),document.getElementsByTagName("body")[0].appendChild(i),t=document.createElement("textarea"),t.id="SWFUpload_Console",t.style.fontFamily="monospace",t.setAttribute("wrap","off"),t.wrap="off",t.style.overflow="auto",t.style.width="700px",t.style.height="350px",t.style.margin="5px",i.appendChild(t)),t.value+=n+"\n",t.scrollTop=t.scrollHeight-t.clientHeight}catch(r){alert("Exception: "+r.name+" Message: "+r.message)}},swfobject=function(){function a(){var i,r,n;if(!l){try{i=t.getElementsByTagName("body")[0].appendChild(o("span")),i.parentNode.removeChild(i)}catch(u){return}for(l=!0,r=k.length,n=0;n<r;n++)k[n]()}}function lt(n){l?n():k[k.length]=n}function ct(n){if(typeof r.addEventListener!=i)r.addEventListener("load",n,!1);else if(typeof t.addEventListener!=i)t.addEventListener("load",n,!1);else if(typeof r.attachEvent!=i)ii(r,"onload",n);else if(typeof r.onload=="function"){var u=r.onload;r.onload=function(){u(),n()}}else r.onload=n}function dt(){wt?ri():ot()}function ri(){var s=t.getElementsByTagName("body")[0],u=o(e),r,f;u.setAttribute("type",g),r=s.appendChild(u),r?(f=0,function(){if(typeof r.GetVariable!=i){var t=r.GetVariable("$version");t&&(t=t.split(" ")[1].split(","),n.pv=[parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10)])}else if(f<10){f++,setTimeout(arguments.callee,10);return}s.removeChild(u),r=null,ot()}()):ot()}function ot(){var y=h.length,r,t,s,l,v;if(y>0)for(r=0;r<y;r++){var f=h[r].id,e=h[r].callbackFn,o={success:!1,id:f};if(n.pv[0]>0){if(t=u(f),t)if(!d(h[r].swfVersion)||n.wk&&n.wk<312)if(h[r].expressInstall&&ft()){s={},s.data=h[r].expressInstall,s.width=t.getAttribute("width")||"0",s.height=t.getAttribute("height")||"0",t.getAttribute("class")&&(s.styleclass=t.getAttribute("class")),t.getAttribute("align")&&(s.align=t.getAttribute("align"));var p={},a=t.getElementsByTagName("param"),w=a.length;for(l=0;l<w;l++)a[l].getAttribute("name").toLowerCase()!="movie"&&(p[a[l].getAttribute("name")]=a[l].getAttribute("value"));ut(s,p,f,e)}else gt(t),e&&e(o);else c(f,!0),e&&(o.success=!0,o.ref=et(f),e(o))}else c(f,!0),e&&(v=et(f),v&&typeof v.SetVariable!=i&&(o.success=!0,o.ref=v),e(o))}}function et(n){var r=null,t=u(n),f;return t&&t.nodeName=="OBJECT"&&(typeof t.SetVariable!=i?r=t:(f=t.getElementsByTagName(e)[0],f&&(r=f))),r}function ft(){return!p&&d("6.0.65")&&(n.win||n.mac)&&!(n.wk&&n.wk<312)}function ut(f,e,s,h){var c,v,l,a;p=!0,nt=h||null,pt={success:!1,id:s},c=u(s),c&&(c.nodeName=="OBJECT"?(y=rt(c),w=null):(y=c,w=s),f.id=kt,(typeof f.width==i||!/%$/.test(f.width)&&parseInt(f.width,10)<310)&&(f.width="310"),(typeof f.height==i||!/%$/.test(f.height)&&parseInt(f.height,10)<137)&&(f.height="137"),t.title=t.title.slice(0,47)+" - Flash Player Installation",v=n.ie&&n.win?"ActiveX":"PlugIn",l="MMredirectURL="+r.location.toString().replace(/&/g,"%26")+"&MMplayerType="+v+"&MMdoctitle="+t.title,typeof e.flashvars!=i?e.flashvars+="&"+l:e.flashvars=l,n.ie&&n.win&&c.readyState!=4&&(a=o("div"),s+="SWFObjectNew",a.setAttribute("id",s),c.parentNode.insertBefore(a,c),c.style.display="none",function(){c.readyState==4?c.parentNode.removeChild(c):setTimeout(arguments.callee,10)}()),it(f,e,s))}function gt(t){if(n.ie&&n.win&&t.readyState!=4){var i=o("div");t.parentNode.insertBefore(i,t),i.parentNode.replaceChild(rt(t),i),t.style.display="none",function(){t.readyState==4?t.parentNode.removeChild(t):setTimeout(arguments.callee,10)}()}else t.parentNode.replaceChild(rt(t),t)}function rt(t){var u=o("div"),f,i,s,r;if(n.win&&n.ie)u.innerHTML=t.innerHTML;else if(f=t.getElementsByTagName(e)[0],f&&(i=f.childNodes,i))for(s=i.length,r=0;r<s;r++)i[r].nodeType==1&&i[r].nodeName=="PARAM"||i[r].nodeType==8||u.appendChild(i[r].cloneNode(!0));return u}function it(t,r,f){var v,y=u(f),p,s,w,a,c,h,l;if(n.wk&&n.wk<312)return v;if(y)if(typeof t.id==i&&(t.id=f),n.ie&&n.win){p="";for(s in t)t[s]!=Object.prototype[s]&&(s.toLowerCase()=="data"?r.movie=t[s]:s.toLowerCase()=="styleclass"?p+=' class="'+t[s]+'"':s.toLowerCase()!="classid"&&(p+=" "+s+'="'+t[s]+'"'));w="";for(a in r)r[a]!=Object.prototype[a]&&(w+='<param name="'+a+'" value="'+r[a]+'" />');y.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+p+">"+w+"</object>",b[b.length]=t.id,v=u(t.id)}else{c=o(e),c.setAttribute("type",g);for(h in t)t[h]!=Object.prototype[h]&&(h.toLowerCase()=="styleclass"?c.setAttribute("class",t[h]):h.toLowerCase()!="classid"&&c.setAttribute(h,t[h]));for(l in r)r[l]!=Object.prototype[l]&&l.toLowerCase()!="movie"&&ni(c,l,r[l]);y.parentNode.replaceChild(c,y),v=c}return v}function ni(n,t,i){var r=o("param");r.setAttribute("name",t),r.setAttribute("value",i),n.appendChild(r)}function st(t){var i=u(t);i&&i.nodeName=="OBJECT"&&(n.ie&&n.win?(i.style.display="none",function(){i.readyState==4?ti(t):setTimeout(arguments.callee,10)}()):i.parentNode.removeChild(i))}function ti(n){var t=u(n),i;if(t){for(i in t)typeof t[i]=="function"&&(t[i]=null);t.parentNode.removeChild(t)}}function u(n){var i=null;try{i=t.getElementById(n)}catch(r){}return i}function o(n){return t.createElement(n)}function ii(n,t,i){n.attachEvent(t,i),v[v.length]=[n,t,i]}function d(t){var r=n.pv,i=t.split(".");return i[0]=parseInt(i[0],10),i[1]=parseInt(i[1],10)||0,i[2]=parseInt(i[2],10)||0,r[0]>i[0]||r[0]==i[0]&&r[1]>i[1]||r[0]==i[0]&&r[1]==i[1]&&r[2]>=i[2]?!0:!1}function vt(r,u,s,h){var a,c,l;n.ie&&n.mac||(a=t.getElementsByTagName("head")[0],a)&&(c=s&&typeof s=="string"?s:"screen",h&&(f=null,tt=null),f&&tt==c||(l=o("style"),l.setAttribute("type","text/css"),l.setAttribute("media",c),f=a.appendChild(l),n.ie&&n.win&&typeof t.styleSheets!=i&&t.styleSheets.length>0&&(f=t.styleSheets[t.styleSheets.length-1]),tt=c),n.ie&&n.win?f&&typeof f.addRule==e&&f.addRule(r,u):f&&typeof t.createTextNode!=i&&f.appendChild(t.createTextNode(r+" {"+u+"}")))}function c(n,t){if(yt){var i=t?"visible":"hidden";l&&u(n)?u(n).style.visibility=i:vt("#"+n,"visibility:"+i)}}function ht(n){var t=/[\\\"<>\.;]/,r=t.exec(n)!=null;return r&&typeof encodeURIComponent!=i?encodeURIComponent(n):n}var i="undefined",e="object",at="Shockwave Flash",ui="ShockwaveFlash.ShockwaveFlash",g="application/x-shockwave-flash",kt="SWFObjectExprInst",bt="onreadystatechange",r=window,t=document,s=navigator,wt=!1,k=[dt],h=[],b=[],v=[],y,w,nt,pt,l=!1,p=!1,f,tt,yt=!0,n=function(){var l=typeof t.getElementById!=i&&typeof t.getElementsByTagName!=i&&typeof t.createElement!=i,f=s.userAgent.toLowerCase(),o=s.platform.toLowerCase(),a=o?/win/.test(o):/win/.test(f),v=o?/mac/.test(o):/mac/.test(f),y=/webkit/.test(f)?parseFloat(f.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,h=!+"\v1",u=[0,0,0],n=null,c;if(typeof s.plugins!=i&&typeof s.plugins[at]==e)n=s.plugins[at].description,!n||typeof s.mimeTypes!=i&&s.mimeTypes[g]&&!s.mimeTypes[g].enabledPlugin||(wt=!0,h=!1,n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),u[0]=parseInt(n.replace(/^(.*)\..*$/,"$1"),10),u[1]=parseInt(n.replace(/^.*\.(.*)\s.*$/,"$1"),10),u[2]=/[a-zA-Z]/.test(n)?parseInt(n.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0);else if(typeof r.ActiveXObject!=i)try{c=new ActiveXObject(ui),c&&(n=c.GetVariable("$version"),n&&(h=!0,n=n.split(" ")[1].split(","),u=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]))}catch(p){}return{w3:l,pv:u,wk:y,ie:h,win:a,mac:v}}(),fi=function(){n.w3&&((typeof t.readyState!=i&&t.readyState=="complete"||typeof t.readyState==i&&(t.getElementsByTagName("body")[0]||t.body))&&a(),l||(typeof t.addEventListener!=i&&t.addEventListener("DOMContentLoaded",a,!1),n.ie&&n.win&&(t.attachEvent(bt,function(){t.readyState=="complete"&&(t.detachEvent(bt,arguments.callee),a())}),r==top&&function(){if(!l){try{t.documentElement.doScroll("left")}catch(n){setTimeout(arguments.callee,0);return}a()}}()),n.wk&&function(){if(!l){if(!/loaded|complete/.test(t.readyState)){setTimeout(arguments.callee,0);return}a()}}(),ct(a)))}(),ei=function(){n.ie&&n.win&&window.attachEvent("onunload",function(){for(var e=v.length,r,i,u,f,t=0;t<e;t++)v[t][0].detachEvent(v[t][1],v[t][2]);for(r=b.length,i=0;i<r;i++)st(b[i]);for(u in n)n[u]=null;n=null;for(f in swfobject)swfobject[f]=null;swfobject=null})}();return{registerObject:function(t,i,r,u){if(n.w3&&t&&i){var f={};f.id=t,f.swfVersion=i,f.expressInstall=r,f.callbackFn=u,h[h.length]=f,c(t,!1)}else u&&u({success:!1,id:t})},getObjectById:function(t){if(n.w3)return et(t)},embedSWF:function(t,r,u,f,o,s,h,l,a,v){var y={success:!1,id:r};n.w3&&!(n.wk&&n.wk<312)&&t&&r&&u&&f&&o?(c(r,!1),lt(function(){var n,b,p,k,w,g;if(u+="",f+="",n={},a&&typeof a===e)for(b in a)n[b]=a[b];if(n.data=t,n.width=u,n.height=f,p={},l&&typeof l===e)for(k in l)p[k]=l[k];if(h&&typeof h===e)for(w in h)typeof p.flashvars!=i?p.flashvars+="&"+w+"="+h[w]:p.flashvars=w+"="+h[w];if(d(o))g=it(n,p,r),n.id==r&&c(r,!0),y.success=!0,y.ref=g;else{if(s&&ft()){n.data=s,ut(n,p,r,v);return}c(r,!0)}v&&v(y)})):v&&v(y)},switchOffAutoHideShow:function(){yt=!1},ua:n,getFlashPlayerVersion:function(){return{major:n.pv[0],minor:n.pv[1],release:n.pv[2]}},hasFlashPlayerVersion:d,createSWF:function(t,i,r){return n.w3?it(t,i,r):undefined},showExpressInstall:function(t,i,r,u){n.w3&&ft()&&ut(t,i,r,u)},removeSWF:function(t){n.w3&&st(t)},createCSS:function(t,i,r,u){n.w3&&vt(t,i,r,u)},addDomLoadEvent:lt,addLoadEvent:ct,getQueryParamValue:function(n){var r=t.location.search||t.location.hash,u,i;if(r){if(/\?/.test(r)&&(r=r.split("?")[1]),n==null)return ht(r);for(u=r.split("&"),i=0;i<u.length;i++)if(u[i].substring(0,u[i].indexOf("="))==n)return ht(u[i].substring(u[i].indexOf("=")+1))}return""},expressInstallCallback:function(){if(p){var t=u(kt);t&&y&&(t.parentNode.replaceChild(y,t),w&&(c(w,!0),n.ie&&n.win&&(y.style.display="block")),nt&&nt(pt)),p=!1}}}}(),swfobject.addDomLoadEvent(function(){typeof SWFUpload.onload=="function"&&SWFUpload.onload.call(window)});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement