function FileProgress(n,t){var i,u,f,r;this.fileProgressID=n.id,this.opacity=100,this.height=0,this.fileProgressWrapper=document.getElementById(this.fileProgressID),this.fileProgressWrapper?(this.fileProgressElement=this.fileProgressWrapper.firstChild,this.reset()):(this.fileProgressWrapper=document.createElement("div"),this.fileProgressWrapper.className="progressWrapper",this.fileProgressWrapper.id=this.fileProgressID,this.fileProgressElement=document.createElement("div"),this.fileProgressElement.className="progressContainer",i=document.createElement("a"),i.className="progressCancel",i.href="#",i.style.visibility="hidden",i.appendChild(document.createTextNode(" ")),u=document.createElement("div"),u.className="progressName",u.appendChild(document.createTextNode(n.name)),f=document.createElement("div"),f.className="progressBarInProgress",r=document.createElement("div"),r.className="progressBarStatus",r.innerHTML=" ",this.fileProgressElement.appendChild(i),this.fileProgressElement.appendChild(u),this.fileProgressElement.appendChild(r),this.fileProgressElement.appendChild(f),this.fileProgressWrapper.appendChild(this.fileProgressElement),document.getElementById(t).appendChild(this.fileProgressWrapper)),this.height=this.fileProgressWrapper.offsetHeight,this.setTimer(null)}function fileQueued(n){try{var t=new FileProgress(n,this.customSettings.progressTarget);t.setStatus("Pending..."),t.toggleCancel(!0,this)}catch(i){this.debug(i)}}function fileQueueError(n,t,i){try{if(t===SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED){alert("You have attempted to queue too many files.\n"+(i===0?"You have reached the upload limit.":"You may select "+(i>1?"up to "+i+" files.":"one file.")));return}var r=new FileProgress(n,this.customSettings.progressTarget);r.setError(),r.toggleCancel(!1);switch(t){case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:r.setStatus("File is too big."),this.debug("Error Code: File too big, File name: "+n.name+", File size: "+n.size+", Message: "+i);break;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:r.setStatus("Cannot upload Zero Byte files."),this.debug("Error Code: Zero byte file, File name: "+n.name+", File size: "+n.size+", Message: "+i);break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:r.setStatus("Invalid File Type."),this.debug("Error Code: Invalid File Type, File name: "+n.name+", File size: "+n.size+", Message: "+i);break;default:n!==null&&r.setStatus("Unhandled Error"),this.debug("Error Code: "+t+", File name: "+n.name+", File size: "+n.size+", Message: "+i)}}catch(u){this.debug(u)}}function fileDialogComplete(n){try{n>0&&(document.getElementById(this.customSettings.cancelButtonId).disabled=!1),this.startUpload()}catch(i){this.debug(i)}}function uploadStart(n){try{var t=new FileProgress(n,this.customSettings.progressTarget);t.setStatus("Uploading..."),t.toggleCancel(!0,this)}catch(i){}return!0}function uploadProgress(n,t,i){try{var u=Math.ceil(t/i*100),r=new FileProgress(n,this.customSettings.progressTarget);r.setProgress(u),r.setStatus("Uploading...")}catch(f){this.debug(f)}}function uploadSuccess(n){try{var i=new FileProgress(n,this.customSettings.progressTarget);i.setComplete(),i.setStatus("Complete."),i.toggleCancel(!1)}catch(r){this.debug(r)}}function uploadError(n,t,i){try{var r=new FileProgress(n,this.customSettings.progressTarget);r.setError(),r.toggleCancel(!1);switch(t){case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:r.setStatus("Upload Error: "+i),this.debug("Error Code: HTTP Error, File name: "+n.name+", Message: "+i);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:r.setStatus("Upload Failed."),this.debug("Error Code: Upload Failed, File name: "+n.name+", File size: "+n.size+", Message: "+i);break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:r.setStatus("Server (IO) Error"),this.debug("Error Code: IO Error, File name: "+n.name+", Message: "+i);break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:r.setStatus("Security Error"),this.debug("Error Code: Security Error, File name: "+n.name+", Message: "+i);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:r.setStatus("Upload limit exceeded."),this.debug("Error Code: Upload Limit Exceeded, File name: "+n.name+", File size: "+n.size+", Message: "+i);break;case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:r.setStatus("Failed Validation. Upload skipped."),this.debug("Error Code: File Validation Failed, File name: "+n.name+", File size: "+n.size+", Message: "+i);break;case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:this.getStats().files_queued===0&&(document.getElementById(this.customSettings.cancelButtonId).disabled=!0),r.setStatus("Cancelled"),r.setCancelled();break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:r.setStatus("Stopped");break;default:r.setStatus("Unhandled Error: "+t),this.debug("Error Code: "+t+", File name: "+n.name+", File size: "+n.size+", Message: "+i)}}catch(u){this.debug(u)}}function uploadComplete(){this.getStats().files_queued===0&&(document.getElementById(this.customSettings.cancelButtonId).disabled=!0)}function queueComplete(n){var t=document.getElementById("divStatus");t.innerHTML=n+" file"+(n===1?"":"s")+" uploaded."}var swfobject,SWFUpload;FileProgress.prototype.setTimer=function(n){this.fileProgressElement.FP_TIMER=n},FileProgress.prototype.getTimer=function(){return this.fileProgressElement.FP_TIMER||null},FileProgress.prototype.reset=function(){this.fileProgressElement.className="progressContainer",this.fileProgressElement.childNodes[2].innerHTML=" ",this.fileProgressElement.childNodes[2].className="progressBarStatus",this.fileProgressElement.childNodes[3].className="progressBarInProgress",this.fileProgressElement.childNodes[3].style.width="0%",this.appear()},FileProgress.prototype.setProgress=function(n){this.fileProgressElement.className="progressContainer green",this.fileProgressElement.childNodes[3].className="progressBarInProgress",this.fileProgressElement.childNodes[3].style.width=n+"%",this.appear()},FileProgress.prototype.setComplete=function(){this.fileProgressElement.className="progressContainer blue",this.fileProgressElement.childNodes[3].className="progressBarComplete",this.fileProgressElement.childNodes[3].style.width="";var n=this;this.setTimer(setTimeout(function(){n.disappear()},1e4))},FileProgress.prototype.setError=function(){this.fileProgressElement.className="progressContainer red",this.fileProgressElement.childNodes[3].className="progressBarError",this.fileProgressElement.childNodes[3].style.width="";var n=this;this.setTimer(setTimeout(function(){n.disappear()},5e3))},FileProgress.prototype.setCancelled=function(){this.fileProgressElement.className="progressContainer",this.fileProgressElement.childNodes[3].className="progressBarError",this.fileProgressElement.childNodes[3].style.width="";var n=this;this.setTimer(setTimeout(function(){n.disappear()},2e3))},FileProgress.prototype.setStatus=function(n){this.fileProgressElement.childNodes[2].innerHTML=n},FileProgress.prototype.toggleCancel=function(n,t){this.fileProgressElement.childNodes[0].style.visibility=n?"visible":"hidden";if(t){var i=this.fileProgressID;this.fileProgressElement.childNodes[0].onclick=function(){return t.cancelUpload(i),!1}}},FileProgress.prototype.appear=function(){this.getTimer()!==null&&(clearTimeout(this.getTimer()),this.setTimer(null));if(this.fileProgressWrapper.filters)try{this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity=100}catch(n){this.fileProgressWrapper.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=100)"}else this.fileProgressWrapper.style.opacity=1;this.fileProgressWrapper.style.height="",this.height=this.fileProgressWrapper.offsetHeight,this.opacity=100,this.fileProgressWrapper.style.display=""},FileProgress.prototype.disappear=function(){var i=15,r=4,t=30,n;if(this.opacity>0){this.opacity-=i,this.opacity<0&&(this.opacity=0);if(this.fileProgressWrapper.filters)try{this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity=this.opacity}catch(u){this.fileProgressWrapper.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+this.opacity+")"}else this.fileProgressWrapper.style.opacity=this.opacity/100}this.height>0&&(this.height-=r,this.height<0&&(this.height=0),this.fileProgressWrapper.style.height=this.height+"px"),this.height>0||this.opacity>0?(n=this,this.setTimer(setTimeout(function(){n.disappear()},t))):(this.fileProgressWrapper.style.display="none",this.setTimer(null))},typeof SWFUpload=="function"&&(SWFUpload.prototype.initSettings=function(n){return function(){typeof n=="function"&&n.call(this),this.refreshCookies(!1)}}(SWFUpload.prototype.initSettings),SWFUpload.prototype.refreshCookies=function(n){n===undefined&&(n=!0),n=!!n;for(var f=this.settings.post_params,e=document.cookie.split(";"),s=e.length,t,r,u,o,i=0;i0&&(u=t.substring(0,r),o=t.substring(r+1),f[u]=o)}n&&this.setPostParams(f)}),SWFUpload==undefined&&(SWFUpload=function(n){this.initSWFUpload(n)}),SWFUpload.prototype.initSWFUpload=function(n){try{this.customSettings={},this.settings=n,this.eventQueue=[],this.movieName="SWFUpload_"+SWFUpload.movieCount++,this.movieElement=null,SWFUpload.instances[this.movieName]=this,this.initSettings(),this.loadFlash(),this.displayDebugInfo()}catch(t){delete SWFUpload.instances[this.movieName];throw t;}},SWFUpload.instances={},SWFUpload.movieCount=0,SWFUpload.version="2.2.0 2009-03-25",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},SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5},SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120},SWFUpload.CURSOR={ARROW:-1,HAND:-2},SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"},SWFUpload.completeURL=function(n){if(typeof n!="string"||n.match(/^https?:\/\//i)||n.match(/^\//))return n;var i=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),t=window.location.pathname.lastIndexOf("/");return t>0?path=window.location.pathname.substr(0,t)+"/":path="/",path+n},SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(n,t){this.settings[n]=this.settings[n]==undefined?t:this.settings[n]},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("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_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_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("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.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.loadFlash=function(){var n,t;if(document.getElementById(this.movieName)!==null)throw"ID "+this.movieName+" is already in use. The Flash Object could not be added";n=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder;if(n==undefined)throw"Could not find the placeholder element: "+this.settings.button_placeholder_id;t=document.createElement("div"),t.innerHTML=this.getFlashHTML(),n.parentNode.replaceChild(t.firstChild,n),window[this.movieName]==undefined&&(window[this.movieName]=this.getMovieElement())},SWFUpload.prototype.getFlashHTML=function(){return['','','','','','','',""].join("")},SWFUpload.prototype.getFlashVars=function(){var t=this.buildParamString(),n=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&uploadURL=",encodeURIComponent(this.settings.upload_url),"&useQueryString=",encodeURIComponent(this.settings.use_query_string),"&requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&httpSuccess=",encodeURIComponent(n),"&assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&params=",encodeURIComponent(t),"&filePostName=",encodeURIComponent(this.settings.file_post_name),"&fileTypes=",encodeURIComponent(this.settings.file_types),"&fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&buttonWidth=",encodeURIComponent(this.settings.button_width),"&buttonHeight=",encodeURIComponent(this.settings.button_height),"&buttonText=",encodeURIComponent(this.settings.button_text),"&buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&buttonAction=",encodeURIComponent(this.settings.button_action),"&buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")},SWFUpload.prototype.getMovieElement=function(){this.movieElement==undefined&&(this.movieElement=document.getElementById(this.movieName));if(this.movieElement===null)throw"Could not find Flash element";return this.movieElement},SWFUpload.prototype.buildParamString=function(){var t=this.settings.post_params,i=[],n;if(typeof t=="object")for(n in t)t.hasOwnProperty(n)&&i.push(encodeURIComponent(n.toString())+"="+encodeURIComponent(t[n].toString()));return i.join("&")},SWFUpload.prototype.destroy=function(){var n,t;try{this.cancelUpload(null,!1),n=null,n=this.getMovieElement();if(n&&typeof n.CallFunction=="unknown"){for(t in n)try{typeof n[t]=="function"&&(n[t]=null)}catch(u){}try{n.parentNode.removeChild(n)}catch(r){}}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","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_disabled: ",this.settings.button_disabled.toString(),"\n","\t","custom_settings: ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned: ",(typeof this.settings.swfupload_loaded_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_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"].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(n,t){t=t||[];var u=this.getMovieElement(),i,r;try{r=u.CallFunction(''+__flash__argumentsToXML(t,0)+""),i=eval(r)}catch(f){throw"Call to "+n+" failed";}return i!=undefined&&typeof i.post=="object"&&(i=this.unescapeFilePostParams(i)),i},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.cancelUpload=function(n,t){t!==!1&&(t=!0),this.callFlash("CancelUpload",[n,t])},SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")},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.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){t==undefined?t=[]:t instanceof Array||(t=[t]);var i=this;if(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)){t=i;while((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.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(n){return!1}},SWFUpload.prototype.flashReady=function(){var n=this.getMovieElement();if(!n){this.debug("Flash called back ready but the flash movie can't be found.");return}this.cleanUp(n),this.queueEvent("swfupload_loaded_handler")},SWFUpload.prototype.cleanUp=function(n){try{if(this.movieElement&&typeof n.CallFunction=="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var t in n)try{typeof n[t]=="function"&&(n[t]=null)}catch(r){}}}catch(i){}window.__flash__removeCallback=function(n,t){try{n&&(n[t]=null)}catch(i){}}},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.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 r,t,i;if(this.settings.debug){t=[];if(typeof n=="object"&&typeof n.name=="string"&&typeof n.message=="string"){for(i in n)n.hasOwnProperty(i)&&t.push(i+": "+n[i]);r=t.join("\n")||"",t=r.split("\n"),r="EXCEPTION: "+t.join("\nEXCEPTION: "),SWFUpload.Console.writeLine(r)}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)}},typeof SWFUpload=="function"&&(SWFUpload.queue={},SWFUpload.prototype.initSettings=function(n){return function(){typeof n=="function"&&n.call(this),this.queueSettings={},this.queueSettings.queue_cancelled_flag=!1,this.queueSettings.queue_upload_count=0,this.queueSettings.user_upload_complete_handler=this.settings.upload_complete_handler,this.queueSettings.user_upload_start_handler=this.settings.upload_start_handler,this.settings.upload_complete_handler=SWFUpload.queue.uploadCompleteHandler,this.settings.upload_start_handler=SWFUpload.queue.uploadStartHandler,this.settings.queue_complete_handler=this.settings.queue_complete_handler||null}}(SWFUpload.prototype.initSettings),SWFUpload.prototype.startUpload=function(n){this.queueSettings.queue_cancelled_flag=!1,this.callFlash("StartUpload",[n])},SWFUpload.prototype.cancelQueue=function(){this.queueSettings.queue_cancelled_flag=!0,this.stopUpload();var n=this.getStats();while(n.files_queued>0)this.cancelUpload(),n=this.getStats()},SWFUpload.queue.uploadStartHandler=function(n){var t;return typeof this.queueSettings.user_upload_start_handler=="function"&&(t=this.queueSettings.user_upload_start_handler.call(this,n)),t=t===!1?!1:!0,this.queueSettings.queue_cancelled_flag=!t,t},SWFUpload.queue.uploadCompleteHandler=function(n){var r=this.queueSettings.user_upload_complete_handler,t,i;n.filestatus===SWFUpload.FILE_STATUS.COMPLETE&&this.queueSettings.queue_upload_count++,t=typeof r=="function"?r.call(this,n)===!1?!1:!0:n.filestatus===SWFUpload.FILE_STATUS.QUEUED?!1:!0,t&&(i=this.getStats(),i.files_queued>0&&this.queueSettings.queue_cancelled_flag===!1?this.startUpload():this.queueSettings.queue_cancelled_flag===!1?(this.queueEvent("queue_complete_handler",[this.queueSettings.queue_upload_count]),this.queueSettings.queue_upload_count=0):(this.queueSettings.queue_cancelled_flag=!1,this.queueSettings.queue_upload_count=0))}),typeof SWFUpload=="function"&&(SWFUpload.speed={},SWFUpload.prototype.initSettings=function(n){return function(){typeof n=="function"&&n.call(this),this.ensureDefault=function(n,t){this.settings[n]=this.settings[n]==undefined?t:this.settings[n]},this.fileSpeedStats={},this.speedSettings={},this.ensureDefault("moving_average_history_size","10"),this.speedSettings.user_file_queued_handler=this.settings.file_queued_handler,this.speedSettings.user_file_queue_error_handler=this.settings.file_queue_error_handler,this.speedSettings.user_upload_start_handler=this.settings.upload_start_handler,this.speedSettings.user_upload_error_handler=this.settings.upload_error_handler,this.speedSettings.user_upload_progress_handler=this.settings.upload_progress_handler,this.speedSettings.user_upload_success_handler=this.settings.upload_success_handler,this.speedSettings.user_upload_complete_handler=this.settings.upload_complete_handler,this.settings.file_queued_handler=SWFUpload.speed.fileQueuedHandler,this.settings.file_queue_error_handler=SWFUpload.speed.fileQueueErrorHandler,this.settings.upload_start_handler=SWFUpload.speed.uploadStartHandler,this.settings.upload_error_handler=SWFUpload.speed.uploadErrorHandler,this.settings.upload_progress_handler=SWFUpload.speed.uploadProgressHandler,this.settings.upload_success_handler=SWFUpload.speed.uploadSuccessHandler,this.settings.upload_complete_handler=SWFUpload.speed.uploadCompleteHandler,delete this.ensureDefault}}(SWFUpload.prototype.initSettings),SWFUpload.speed.fileQueuedHandler=function(n){if(typeof this.speedSettings.user_file_queued_handler=="function")return n=SWFUpload.speed.extendFile(n),this.speedSettings.user_file_queued_handler.call(this,n)},SWFUpload.speed.fileQueueErrorHandler=function(n,t,i){if(typeof this.speedSettings.user_file_queue_error_handler=="function")return n=SWFUpload.speed.extendFile(n),this.speedSettings.user_file_queue_error_handler.call(this,n,t,i)},SWFUpload.speed.uploadStartHandler=function(n){if(typeof this.speedSettings.user_upload_start_handler=="function")return n=SWFUpload.speed.extendFile(n,this.fileSpeedStats),this.speedSettings.user_upload_start_handler.call(this,n)},SWFUpload.speed.uploadErrorHandler=function(n,t,i){return n=SWFUpload.speed.extendFile(n,this.fileSpeedStats),SWFUpload.speed.removeTracking(n,this.fileSpeedStats),typeof this.speedSettings.user_upload_error_handler=="function"?this.speedSettings.user_upload_error_handler.call(this,n,t,i):void 0},SWFUpload.speed.uploadProgressHandler=function(n,t,i){return this.updateTracking(n,t),n=SWFUpload.speed.extendFile(n,this.fileSpeedStats),typeof this.speedSettings.user_upload_progress_handler=="function"?this.speedSettings.user_upload_progress_handler.call(this,n,t,i):void 0},SWFUpload.speed.uploadSuccessHandler=function(n,t){if(typeof this.speedSettings.user_upload_success_handler=="function")return n=SWFUpload.speed.extendFile(n,this.fileSpeedStats),this.speedSettings.user_upload_success_handler.call(this,n,t)},SWFUpload.speed.uploadCompleteHandler=function(n){return n=SWFUpload.speed.extendFile(n,this.fileSpeedStats),SWFUpload.speed.removeTracking(n,this.fileSpeedStats),typeof this.speedSettings.user_upload_complete_handler=="function"?this.speedSettings.user_upload_complete_handler.call(this,n):void 0},SWFUpload.speed.extendFile=function(n,t){var i;return t&&(i=t[n.id]),i?(n.currentSpeed=i.currentSpeed,n.averageSpeed=i.averageSpeed,n.movingAverageSpeed=i.movingAverageSpeed,n.timeRemaining=i.timeRemaining,n.timeElapsed=i.timeElapsed,n.percentUploaded=i.percentUploaded,n.sizeUploaded=i.bytesUploaded):(n.currentSpeed=0,n.averageSpeed=0,n.movingAverageSpeed=0,n.timeRemaining=0,n.timeElapsed=0,n.percentUploaded=0,n.sizeUploaded=0),n},SWFUpload.prototype.updateTracking=function(n,t){var i=this.fileSpeedStats[n.id],e;i||(this.fileSpeedStats[n.id]=i={}),t=t||i.bytesUploaded||0,t<0&&(t=0),t>n.size&&(t=n.size),e=+new Date;if(i.startTime)if(i.startTime>e)this.debug("When backwards in time");else{var r=+new Date,o=i.lastTime,u=r-o,f=t-i.bytesUploaded;if(f===0||u===0)return i;i.lastTime=r,i.bytesUploaded=t,i.currentSpeed=f*8/(u/1e3),i.averageSpeed=i.bytesUploaded*8/((r-i.startTime)/1e3),i.movingAverageHistory.push(i.currentSpeed),i.movingAverageHistory.length>this.settings.moving_average_history_size&&i.movingAverageHistory.shift(),i.movingAverageSpeed=SWFUpload.speed.calculateMovingAverage(i.movingAverageHistory),i.timeRemaining=(n.size-i.bytesUploaded)*8/i.movingAverageSpeed,i.timeElapsed=(r-i.startTime)/1e3,i.percentUploaded=i.bytesUploaded/n.size*100}else i.startTime=+new Date,i.lastTime=i.startTime,i.currentSpeed=0,i.averageSpeed=0,i.movingAverageSpeed=0,i.movingAverageHistory=[],i.timeRemaining=0,i.timeElapsed=0,i.percentUploaded=t/n.size,i.bytesUploaded=t;return i},SWFUpload.speed.removeTracking=function(n,t){try{t[n.id]=null,delete t[n.id]}catch(i){}},SWFUpload.speed.formatUnits=function(n,t,i,r){var u,f,s,e,h,o;if(n===0)return"0 "+i[i.length-1];if(r){for(f=n,e=i.length>=t.length?i[t.length-1]:"",u=0;u=t[u]){f=(n/t[u]).toFixed(2),e=i.length>=u?" "+i[u]:"";break}return f+e}for(h=[],o=n,u=0;uu?" "+i[u]:"",f=o/s,f=u0&&(o=o%s,h.push(f+e));return h.join(" ")},SWFUpload.speed.formatBPS=function(n){var i=[1073741824,1048576,1024,1],t=["Gbps","Mbps","Kbps","bps"];return SWFUpload.speed.formatUnits(n,i,t,!0)},SWFUpload.speed.formatTime=function(n){var i=[86400,3600,60,1],t=["d","h","m","s"];return SWFUpload.speed.formatUnits(n,i,t,!1)},SWFUpload.speed.formatBytes=function(n){var i=[1073741824,1048576,1024,1],t=["GB","MB","KB","bytes"];return SWFUpload.speed.formatUnits(n,i,t,!0)},SWFUpload.speed.formatPercent=function(n){return n.toFixed(2)+" %"},SWFUpload.speed.calculateMovingAverage=function(n){var r=[],i,h=0,e=0,s=0,l=0,c=0,t,f=0,u=0,o;i=n.length;if(i<8)for(u=i,t=0;to||r[t]<-o||(u++,f+=n[t])}return f/u}),swfobject=function(){function yt(){v.readyState=="complete"&&(v.parentNode.removeChild(v),p())}function p(){var f,r,u,i;if(nt)return;if(n.ie&&n.win){f=e("span");try{r=t.getElementsByTagName("body")[0].appendChild(f),r.parentNode.removeChild(r)}catch(o){return}}for(nt=!0,it&&(clearInterval(it),it=null),u=d.length,i=0;i0?(i=u(r),i&&(o[t].width=i.getAttribute("width")?i.getAttribute("width"):"0",o[t].height=i.getAttribute("height")?i.getAttribute("height"):"0",y(o[t].swfVersion)?(n.webkit&&n.webkit<312&&pt(i),h(r,!0)):o[t].expressInstall&&!c&&y("6.0.65")&&(n.win||n.mac)?lt(o[t]):bt(i))):h(r,!0)}function pt(n){var s=n.getElementsByTagName(f)[0],o,u,h,i,r,c,t;if(s){o=e("embed"),u=s.attributes;if(u)for(h=u.length,i=0;i');y.outerHTML='"+nt+"",k[k.length]=t.id,b=u(t.id)}else if(n.webkit&&n.webkit<312){l=e("embed"),l.setAttribute("type",g);for(h in t)t[h]!=Object.prototype[h]&&(h.toLowerCase()=="data"?l.setAttribute("src",t[h]):h.toLowerCase()=="styleclass"?l.setAttribute("class",t[h]):h.toLowerCase()!="classid"&&l.setAttribute(h,t[h]));for(v in r)r[v]!=Object.prototype[v]&&v.toLowerCase()!="movie"&&l.setAttribute(v,r[v]);y.parentNode.replaceChild(l,y),b=l}else{a=e(f),a.setAttribute("type",g);for(c in t)t[c]!=Object.prototype[c]&&(c.toLowerCase()=="styleclass"?a.setAttribute("class",t[c]):c.toLowerCase()!="classid"&&a.setAttribute(c,t[c]));for(p in r)r[p]!=Object.prototype[p]&&p.toLowerCase()!="movie"&&wt(a,p,r[p]);y.parentNode.replaceChild(a,y),b=a}}return b}function wt(n,t,i){var r=e("param");r.setAttribute("name",t),r.setAttribute("value",i),n.appendChild(r)}function st(t){var i=u(t);i&&(i.nodeName=="OBJECT"||i.nodeName=="EMBED")&&(n.ie&&n.win?i.readyState==4?ot(t):r.attachEvent("onload",function(){ot(t)}):i.parentNode.removeChild(i))}function ot(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 e(n){return t.createElement(n)}function w(n,t,i){n.attachEvent(t,i),a[a.length]=[n,t,i]}function y(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 et(r,u){var h,o,s;if(n.ie&&n.mac)return;h=t.getElementsByTagName("head")[0],o=e("style"),o.setAttribute("type","text/css"),o.setAttribute("media","screen"),n.ie&&n.win||typeof t.createTextNode==i||o.appendChild(t.createTextNode(r+" {"+u+"}")),h.appendChild(o),n.ie&&n.win&&typeof t.styleSheets!=i&&t.styleSheets.length>0&&(s=t.styleSheets[t.styleSheets.length-1],typeof s.addRule==f&&s.addRule(r,u))}function h(n,t){var i=t?"visible":"hidden";nt&&u(n)?u(n).style.visibility=i:et("#"+n,"visibility:"+i)}function ct(n){var i=/[\\\"<>\.;]/,t=i.exec(n)!=null;return t?encodeURIComponent(n):n}var i="undefined",f="object",vt="Shockwave Flash",ut="ShockwaveFlash.ShockwaveFlash",g="application/x-shockwave-flash",ht="SWFObjectExprInst",r=window,t=document,s=navigator,d=[],o=[],k=[],a=[],v,it=null,l=null,tt=null,nt=!1,c=!1,n=function(){var y=typeof t.getElementById!=i&&typeof t.getElementsByTagName!=i&&typeof t.createElement!=i,e=[0,0,0],n=null,u,h;if(typeof s.plugins!=i&&typeof s.plugins[vt]==f)n=s.plugins[vt].description,!n||typeof s.mimeTypes!=i&&s.mimeTypes[g]&&!s.mimeTypes[g].enabledPlugin||(n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),e[0]=parseInt(n.replace(/^(.*)\..*$/,"$1"),10),e[1]=parseInt(n.replace(/^.*\.(.*)\s.*$/,"$1"),10),e[2]=/r/.test(n)?parseInt(n.replace(/^.*r(.*)$/,"$1"),10):0);else if(typeof r.ActiveXObject!=i){u=null,h=!1;try{u=new ActiveXObject(ut+".7")}catch(w){try{u=new ActiveXObject(ut+".6"),e=[6,0,21],u.AllowScriptAccess="always"}catch(w){e[0]==6&&(h=!0)}if(!h)try{u=new ActiveXObject(ut)}catch(w){}}if(!h&&u)try{n=u.GetVariable("$version"),n&&(n=n.split(" ")[1].split(","),e=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)])}catch(w){}}var c=s.userAgent.toLowerCase(),o=s.platform.toLowerCase(),p=/webkit/.test(c)?parseFloat(c.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,l=!1,a=o?/win/.test(o):/win/.test(c),v=o?/mac/.test(o):/mac/.test(c);/*@cc_on l=!0;@if(@_win32)a=!0;@elif(@_mac)v=!0;@end@*/return{w3cdom:y,pv:e,webkit:p,ie:l,win:a,mac:v}}(),gt=function(){if(!n.w3cdom)return;b(kt);if(n.ie&&n.win)try{t.write("