/* DO NOT EDIT. THIS IS A CACHE FILE AND WILL GET OVERWRITTEN RANDOMLY.
INSTEAD EDIT THE TEMPLATE FROM WITHIN THE ADMIN ZONE, OR BY MANUALLY EDITING A TEMPLATES_CUSTOM OVERRIDE. */


var SWFUpload;if(typeof SWFUpload=='undefined'){SWFUpload=function(settings){this.initSWFUpload(settings);};}
SWFUpload.prototype.initSWFUpload=function(settings){try{this.customSettings={};this.settings=settings;this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo();}catch(ex){delete SWFUpload.instances[this.movieName];throw ex;}};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(url){if(typeof(url)!=="string"||url.match(/^https?:\/\//i)||url.match(/^\//)){return url;}
var currentURL=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"");var indexSlash=window.location.pathname.lastIndexOf("/");if(indexSlash<=0){path="/";}else{path=window.location.pathname.substr(0,indexSlash)+"/";}
return path+url;};SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(settingName,defaultValue){this.settings[settingName]=(typeof this.settings[settingName]=='undefined')?defaultValue:this.settings[settingName];};this.ensureDefault("upload_url","");this.ensureDefault("preserve_relative_urls",false);this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",false);this.ensureDefault("requeue_on_error",false);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",true);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",false);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",false);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;if(!!this.settings.prevent_swf_caching){this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+new Date().getTime();}
if(!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 targetElement,tempParent;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added";}
targetElement=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder;if(typeof targetElement=='undefined'){throw"Could not find the placeholder element: "+this.settings.button_placeholder_id;}
tempParent=document.createElement("div");setInnerHTML(tempParent,this.getFlashHTML());var next=tempParent.firstChild.nextSibling;targetElement.parentNode.replaceChild(tempParent.firstChild,targetElement);if(next)targetElement.appendChild(next);if((typeof window[this.movieName]=='undefined')||(!window[this.movieName])){window[this.movieName]=this.getMovieElement();}};SWFUpload.prototype.getFlashHTML=function(){return['<object id="',this.movieName,'" type="application/x-shockwave-flash" data="',this.settings.flash_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.settings.flash_url,'" />','<param name="quality" value="high" />','<param name="menu" value="false" />','<param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+this.getFlashVars()+'" />','</object>','<object type="application/x-shockwave-flash" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="1" height="1">','<param name="movie" value="http://www.spacomics.com/data/swfupload/blank.swf" />','<param name="pluginspage" value="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" />','</object>'].join("");};SWFUpload.prototype.getFlashVars=function(){var paramString=this.buildParamString();var httpSuccessString=this.settings.http_success.join(",");return["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(httpSuccessString),"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&amp;params=",encodeURIComponent(paramString),"&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){this.movieElement=document.getElementById(this.movieName);}
if(this.movieElement===null){throw"Could not find Flash element";}
return this.movieElement;};SWFUpload.prototype.buildParamString=function(){var postParams=this.settings.post_params;var paramStringPairs=[];if(typeof(postParams)==="object"){for(var name in postParams){if(postParams.hasOwnProperty(name)){paramStringPairs.push(encodeURIComponent(name.toString())+"="+encodeURIComponent(postParams[name].toString()));}}}
return paramStringPairs.join("&amp;");};SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,false);var movieElement=null;movieElement=this.getMovieElement();if(movieElement&&typeof(movieElement.CallFunction)==="unknown"){for(var i in movieElement){try{if(typeof(movieElement[i])==="function"){movieElement[i]=null;}}catch(ex1){}}
try{movieElement.parentNode.removeChild(movieElement);}catch(ex){}}
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;return true;}catch(ex2){return false;}};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(name,value,default_value){if(typeof value=='undefined'){return(this.settings[name]=default_value);}else{return(this.settings[name]=value);}};SWFUpload.prototype.getSetting=function(name){if(typeof this.settings[name]!='undefined'){return this.settings[name];}
return"";};SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement();var returnValue,returnString;try{returnString=movieElement.CallFunction('<invoke name="'+functionName+'" returntype="javascript">'+__flash__argumentsToXML(argumentArray,0)+'</invoke>');returnValue=eval(returnString);}catch(ex){throw"Call to "+functionName+" failed";}
if(typeof returnValue!='undefined'&&typeof returnValue.post==="object"){returnValue=this.unescapeFilePostParams(returnValue);}
return returnValue;};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile");};SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles");};SWFUpload.prototype.startUpload=function(fileID){this.callFlash("StartUpload",[fileID]);};SWFUpload.prototype.cancelUpload=function(fileID,triggerErrorEvent){if(triggerErrorEvent!==false){triggerErrorEvent=true;}
this.callFlash("CancelUpload",[fileID,triggerErrorEvent]);};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload");};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats");};SWFUpload.prototype.setStats=function(statsObject){this.callFlash("SetStats",[statsObject]);};SWFUpload.prototype.getFile=function(fileID){if(typeof(fileID)==="number"){return this.callFlash("GetFileByIndex",[fileID]);}else{return this.callFlash("GetFile",[fileID]);}};SWFUpload.prototype.addFileParam=function(fileID,name,value){return this.callFlash("AddFileParam",[fileID,name,value]);};SWFUpload.prototype.removeFileParam=function(fileID,name){this.callFlash("RemoveFileParam",[fileID,name]);};SWFUpload.prototype.setUploadURL=function(url){this.settings.upload_url=url.toString();this.callFlash("SetUploadURL",[url]);};SWFUpload.prototype.setPostParams=function(paramsObject){this.settings.post_params=paramsObject;this.callFlash("SetPostParams",[paramsObject]);};SWFUpload.prototype.addPostParam=function(name,value){this.settings.post_params[name]=value;this.callFlash("SetPostParams",[this.settings.post_params]);};SWFUpload.prototype.removePostParam=function(name){delete this.settings.post_params[name];this.callFlash("SetPostParams",[this.settings.post_params]);};SWFUpload.prototype.setFileTypes=function(types,description){this.settings.file_types=types;this.settings.file_types_description=description;this.callFlash("SetFileTypes",[types,description]);};SWFUpload.prototype.setFileSizeLimit=function(fileSizeLimit){this.settings.file_size_limit=fileSizeLimit;this.callFlash("SetFileSizeLimit",[fileSizeLimit]);};SWFUpload.prototype.setFileUploadLimit=function(fileUploadLimit){this.settings.file_upload_limit=fileUploadLimit;this.callFlash("SetFileUploadLimit",[fileUploadLimit]);};SWFUpload.prototype.setFileQueueLimit=function(fileQueueLimit){this.settings.file_queue_limit=fileQueueLimit;this.callFlash("SetFileQueueLimit",[fileQueueLimit]);};SWFUpload.prototype.setFilePostName=function(filePostName){this.settings.file_post_name=filePostName;this.callFlash("SetFilePostName",[filePostName]);};SWFUpload.prototype.setUseQueryString=function(useQueryString){this.settings.use_query_string=useQueryString;this.callFlash("SetUseQueryString",[useQueryString]);};SWFUpload.prototype.setRequeueOnError=function(requeueOnError){this.settings.requeue_on_error=requeueOnError;this.callFlash("SetRequeueOnError",[requeueOnError]);};SWFUpload.prototype.setHTTPSuccess=function(http_status_codes){if(typeof http_status_codes==="string"){http_status_codes=http_status_codes.replace(" ","").split(",");}
this.settings.http_success=http_status_codes;this.callFlash("SetHTTPSuccess",[http_status_codes]);};SWFUpload.prototype.setAssumeSuccessTimeout=function(timeout_seconds){this.settings.assume_success_timeout=timeout_seconds;this.callFlash("SetAssumeSuccessTimeout",[timeout_seconds]);};SWFUpload.prototype.setDebugEnabled=function(debugEnabled){this.settings.debug_enabled=debugEnabled;this.callFlash("SetDebugEnabled",[debugEnabled]);};SWFUpload.prototype.setButtonImageURL=function(buttonImageURL){if(typeof buttonImageURL=='undefined'){buttonImageURL="";}
this.settings.button_image_url=buttonImageURL;this.callFlash("SetButtonImageURL",[buttonImageURL]);};SWFUpload.prototype.setButtonDimensions=function(width,height){this.settings.button_width=width;this.settings.button_height=height;var movie=this.getMovieElement();if(typeof movie!='undefined'){movie.style.width=width+"px";movie.style.height=height+"px";}
this.callFlash("SetButtonDimensions",[width,height]);};SWFUpload.prototype.setButtonText=function(html){this.settings.button_text=html;this.callFlash("SetButtonText",[html]);};SWFUpload.prototype.setButtonTextPadding=function(left,top){this.settings.button_text_top_padding=top;this.settings.button_text_left_padding=left;this.callFlash("SetButtonTextPadding",[left,top]);};SWFUpload.prototype.setButtonTextStyle=function(css){this.settings.button_text_style=css;this.callFlash("SetButtonTextStyle",[css]);};SWFUpload.prototype.setButtonDisabled=function(isDisabled){this.settings.button_disabled=isDisabled;this.callFlash("SetButtonDisabled",[isDisabled]);};SWFUpload.prototype.setButtonAction=function(buttonAction){this.settings.button_action=buttonAction;this.callFlash("SetButtonAction",[buttonAction]);};SWFUpload.prototype.setButtonCursor=function(cursor){this.settings.button_cursor=cursor;this.callFlash("SetButtonCursor",[cursor]);};SWFUpload.prototype.queueEvent=function(handlerName,argumentArray){if(typeof argumentArray=='undefined'){argumentArray=[];}else if(!(argumentArray instanceof Array)){argumentArray=[argumentArray];}
argumentArray.push(this);var self=this;if(typeof this.settings[handlerName]==="function"){this.eventQueue.push(function(){this.settings[handlerName].apply(this,argumentArray);});setTimeout(function(){self.executeNextEvent();},0);}else if(this.settings[handlerName]!==null){throw"Event handler "+handlerName+" is unknown or is not a function";}};SWFUpload.prototype.executeNextEvent=function(){var f=this.eventQueue?this.eventQueue.shift():null;if(typeof(f)==="function"){f.apply(this);}};SWFUpload.prototype.unescapeFilePostParams=function(file){var reg=/[$]([0-9a-f]{4})/i;var unescapedPost={};var uk;if(typeof file!='undefined'){for(var k in file.post){if(file.post.hasOwnProperty(k)){uk=k;var match;while((match=reg.exec(uk))!==null){uk=uk.replace(match[0],String.fromCharCode(parseInt("0x"+match[1],16)));}
unescapedPost[uk]=file.post[k];}}
file.post=unescapedPost;}
return file;};SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface");}catch(ex){return false;}};SWFUpload.prototype.flashReady=function(){var movieElement=this.getMovieElement();if(!movieElement){this.debug("Flash called back ready but the flash movie can't be found.");return;}
this.cleanUp(movieElement);this.queueEvent("swfupload_loaded_handler");};SWFUpload.prototype.cleanUp=function(movieElement){try{if(this.movieElement&&typeof(movieElement.CallFunction)==="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var key in movieElement){try{if(typeof(movieElement[key])==="function"){movieElement[key]=null;}}catch(ex){}}}}catch(ex1){}
window["__flash__removeCallback"]=function(instance,name){try{if(instance){instance[name]=null;}}catch(flashEx){}};};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler");};SWFUpload.prototype.fileQueued=function(file){file=this.unescapeFilePostParams(file);this.queueEvent("file_queued_handler",file);};SWFUpload.prototype.fileQueueError=function(file,errorCode,message){file=this.unescapeFilePostParams(file);this.queueEvent("file_queue_error_handler",[file,errorCode,message]);};SWFUpload.prototype.fileDialogComplete=function(numFilesSelected,numFilesQueued,numFilesInQueue){this.queueEvent("file_dialog_complete_handler",[numFilesSelected,numFilesQueued,numFilesInQueue]);};SWFUpload.prototype.uploadStart=function(file){file=this.unescapeFilePostParams(file);this.queueEvent("return_upload_start_handler",file);};SWFUpload.prototype.returnUploadStart=function(file){var returnValue;if(typeof this.settings.upload_start_handler==="function"){file=this.unescapeFilePostParams(file);returnValue=this.settings.upload_start_handler.call(this,file);}else{}
if(typeof returnValue==='undefined'){returnValue=true;}
returnValue=!!returnValue;this.callFlash("ReturnUploadStart",[returnValue]);};SWFUpload.prototype.uploadProgress=function(file,bytesComplete,bytesTotal){file=this.unescapeFilePostParams(file);this.queueEvent("upload_progress_handler",[file,bytesComplete,bytesTotal]);};SWFUpload.prototype.uploadError=function(file,errorCode,message){file=this.unescapeFilePostParams(file);this.queueEvent("upload_error_handler",[file,errorCode,message]);};SWFUpload.prototype.uploadSuccess=function(file,serverData,responseReceived){file=this.unescapeFilePostParams(file);this.queueEvent("upload_success_handler",[file,serverData,responseReceived]);};SWFUpload.prototype.uploadComplete=function(file){file=this.unescapeFilePostParams(file);this.queueEvent("upload_complete_handler",file);};SWFUpload.prototype.debug=function(message){this.queueEvent("debug_handler",message);};SWFUpload.prototype.debugMessage=function(message){if(this.settings.debug){var exceptionMessage,exceptionValues=[];if(typeof message==="object"&&typeof message.name==="string"&&typeof message.message==="string"){for(var key in message){if(message.hasOwnProperty(key)){exceptionValues.push(key+": "+message[key]);}}
exceptionMessage=exceptionValues.join("\n")||"";exceptionValues=exceptionMessage.split("\n");exceptionMessage="EXCEPTION: "+exceptionValues.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(exceptionMessage);}else{SWFUpload.Console.writeLine(message);}}};SWFUpload.Console={};SWFUpload.Console.writeLine=function(message){var console,documentForm;try{console=document.getElementById("SWFUpload_Console");if(!console){documentForm=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(documentForm);console=document.createElement("textarea");console.id="SWFUpload_Console";console.style.fontFamily="monospace";console.setAttribute("wrap","off");console.wrap="off";console.style.overflow="auto";console.style.width="700px";console.style.height="350px";console.style.margin="5px";documentForm.appendChild(console);}
console.value+=message+"\n";console.scrollTop=console.scrollHeight-console.clientHeight;}catch(ex){alert("Exception: "+ex.name+" Message: "+ex.message);}};function FileProgress(file,targetID){this.fileProgressID=file.id;this.opacity=100;this.height=0;this.fileProgressWrapper=document.getElementById(this.fileProgressID);if(!this.fileProgressWrapper){this.fileProgressWrapper=document.createElement("div");this.fileProgressWrapper.className="progressWrapper";this.fileProgressWrapper.id=this.fileProgressID;this.fileProgressElement=document.createElement("div");this.fileProgressElement.className="progressContainer";var progressCancel=document.createElement("a");progressCancel.className="progressCancel";progressCancel.href="#";progressCancel.style.visibility="hidden";progressCancel.appendChild(document.createTextNode(" "));var progressText=document.createElement("div");progressText.className="progressName";if(typeof file.name!='undefined')
progressText.appendChild(document.createTextNode(file.name));var progressBar=document.createElement("div");progressBar.className="progressBarInProgress";var progressStatus=document.createElement("div");progressStatus.className="progressBarStatus";setInnerHTML(progressStatus,"&nbsp;");this.fileProgressElement.appendChild(progressCancel);this.fileProgressElement.appendChild(progressText);this.fileProgressElement.appendChild(progressStatus);this.fileProgressElement.appendChild(progressBar);this.fileProgressWrapper.appendChild(this.fileProgressElement);document.getElementById(targetID).appendChild(this.fileProgressWrapper);}else{this.fileProgressElement=this.fileProgressWrapper.firstChild;if(typeof file.name!='undefined')
setInnerHTML(this.fileProgressElement.childNodes[1],file.name);}
this.height=this.fileProgressWrapper.offsetHeight;}
FileProgress.prototype.setProgress=function(percentage){this.fileProgressElement.className="progressContainer green";this.fileProgressElement.childNodes[3].className="progressBarInProgress";this.fileProgressElement.childNodes[3].style.width=percentage+"%";};FileProgress.prototype.setComplete=function(){this.appear();this.fileProgressElement.className="progressContainer blue";this.fileProgressElement.childNodes[3].className="progressBarComplete";this.fileProgressElement.childNodes[3].style.width="";var oSelf=this;setTimeout(function(){oSelf.disappear();},10000);};FileProgress.prototype.setError=function(){this.appear();this.fileProgressElement.className="progressContainer red";this.fileProgressElement.childNodes[3].className="progressBarError";this.fileProgressElement.childNodes[3].style.width="";var oSelf=this;setTimeout(function(){oSelf.disappear();},5000);};FileProgress.prototype.setCancelled=function(){this.appear();this.fileProgressElement.className="progressContainer";this.fileProgressElement.childNodes[3].className="progressBarError";this.fileProgressElement.childNodes[3].style.width="";var oSelf=this;setTimeout(function(){oSelf.disappear();},2000);};FileProgress.prototype.setStatus=function(status){setInnerHTML(this.fileProgressElement.childNodes[2],status);};FileProgress.prototype.toggleCancel=function(show,swfUploadInstance){this.fileProgressElement.childNodes[0].style.visibility=show?"visible":"hidden";if(swfUploadInstance){var fileID=this.fileProgressID;this.fileProgressElement.childNodes[0].onclick=function(){swfUploadInstance.cancelUpload(fileID);return false;};}};FileProgress.prototype.appear=function(){if(this.fileProgressWrapper.filters){try{this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity=100;}catch(e){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 reduceOpacityBy=15;var reduceHeightBy=4;var rate=30;if(this.opacity>0){this.opacity-=reduceOpacityBy;if(this.opacity<0){this.opacity=0;}
if(this.fileProgressWrapper.filters){try{this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity=this.opacity;}catch(e){this.fileProgressWrapper.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+this.opacity+")";}}else{this.fileProgressWrapper.style.opacity=this.opacity/100;}}
if(this.height>0){this.height-=reduceHeightBy;if(this.height<0){this.height=0;}
this.fileProgressWrapper.style.height=this.height+"px";}
if(this.height>0||this.opacity>0){var oSelf=this;setTimeout(function(){oSelf.disappear();},rate);}else{this.fileProgressWrapper.style.display="none";}};var formChecker=null;function swfUploadLoaded(ob){if(typeof ob.originalClickHandler!='undefined')return;var btnSubmit=document.getElementById(ob.settings.btnSubmitID);var old_onclick=btnSubmit.onclick;ob.originalClickHandler=old_onclick;btnSubmit.onclick=function(event){if(!event)event=window.event;ob.originalClickHandler=old_onclick;return doSubmit(event,ob);};var btnSubmit2=document.getElementById('preview_button');if(btnSubmit2)
{var old_onclick2=btnSubmit2.onclick;btnSubmit2.onclick=function(event){if(!event)event=window.event;ob.originalClickHandler=old_onclick2;return doSubmit(event,ob);};}}
function doSubmit(e,ob){if(formChecker!=null){clearInterval(formChecker);formChecker=null;}
var btnSubmit=document.getElementById(ob.settings.btnSubmitID);var txtFileName=document.getElementById(ob.settings.txtFileNameID);if(txtFileName.value=='')
{if(ob.settings.required)
{window.alert("This is a required field and must therefore be filled in");return false;}
window.form_submitting=btnSubmit.form;if(typeof ob.originalClickHandler=='undefined')
{if((btnSubmit.form.onsubmit)&&(false===btnSubmit.form.onsubmit()))return false;btnSubmit.form.submit();return true;}
return ob.originalClickHandler(e,ob,btnSubmit.form);}
e=e||window.event;if((typeof e!='undefined')&&(e))
{cancelBubbling(e);if(typeof e.preventDefault!='undefined')e.preventDefault();}
var txtID=document.getElementById(ob.settings.txtFileDbID);if(txtID.value=='-1')
{btnSubmit.disabled=true;ob.startUpload();}else
{if(typeof ob.originalClickHandler=='undefined')
{if((btnSubmit.form.onsubmit)&&(false===btnSubmit.form.onsubmit()))return false;btnSubmit.form.submit();return true;}
return ob.originalClickHandler(e,ob,btnSubmit.form);}
return false;}
function fileDialogStart(ob){var txtFileName=document.getElementById(ob.settings.txtFileNameID);txtFileName.value="";this.cancelUpload();}
function fileQueueError(file,errorCode,message){switch(errorCode){case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:alert("You have attempted to queue too many files.\n"+(message===0?"You have reached the upload limit.":"You may select "+(message>1?"up to "+message+" files.":"one file.")));return;case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:alert("You tried to upload a file which was larger than the maximum allowed size");this.debug("Error Code: File too big, File name: "+file.name+", File size: "+file.size+", Message: "+message);return;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:alert("The file you selected is empty.  Please select another file.");this.debug("Error Code: Zero byte file, File name: "+file.name+", File size: "+file.size+", Message: "+message);return;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:alert("Sorry, but that file type is not supported. The following file types are enabled: {2}.");this.debug("Error Code: Invalid File Type, File name: "+file.name+", File size: "+file.size+", Message: "+message);return;default:alert("Internal error");this.debug("Error Code: "+errorCode+", File name: "+file.name+", File size: "+file.size+", Message: "+message);return;}}
function fileQueued(file,ob){var txtFileName=document.getElementById(ob.settings.txtFileNameID);txtFileName.value=file.name;var name=ob.settings.txtName;dispatch_for_page_type(ob.settings.page_type,name,file.name);fireFakeChangeFor(name,'1');}
function dispatch_for_page_type(page_type,name,file_name)
{if(page_type=="attachment")
{var current_num=name.replace('file','');setAttachment('post',current_num,file_name);document.getElementById(name).onchange=null;}
if(page_type=="upload_multi")
{document.getElementById(name).onchange=null;var mid=name.lastIndexOf('_');var nameStub=name.substring(0,mid+1);var thisNum=name.substring(mid+1,name.length)-0;var nextNum=thisNum+1;var nextField=document.getElementById('txtFileName_multi_'+nextNum);var name=nameStub+nextNum;var thisId=name;if(!nextField)
{nextNum=thisNum+1;var nextField=document.createElement('input');nextField.className='input_upload';nextField.setAttribute('id','multi_'+nextNum);nextField.onchange=_ensureNextFieldUpload;nextField.setAttribute('type','file');nextField.name=nameStub+nextNum;var br=document.createElement('br');txtFileName.parentNode.parentNode.parentNode.appendChild(br);txtFileName.parentNode.parentNode.parentNode.appendChild(nextField);replaceFileInput('upload_multi',nextField.name);}}}
function fireFakeChangeFor(name,value)
{var rep=document.getElementById(name);if((typeof rep.onchange!='undefined')&&(rep.onchange))rep.onchange();rep.value=value;rep.virtual_value=value;if((typeof rep.simulated_events!='undefined')&&(typeof rep.simulated_events['change']!='undefined'))
{var e=rep.simulated_events['change'];var length=e.length;for(var i=0;i<length;i++)
e[i]();}}
function fileDialogComplete(numFilesSelected,numFilesQueued,_,ob){document.getElementById(ob.settings.btnSubmitID).disabled=false;}
function uploadProgress(file,bytesLoaded,bytesTotal){var percent=Math.ceil((bytesLoaded/bytesTotal)*100);var progress=new FileProgress(file,this.customSettings.progress_target);progress.setProgress(percent);progress.setStatus("Uploading...");}
function uploadSuccess(file,serverData,_,ob){var progress=new FileProgress(file,this.customSettings.progress_target);progress.setComplete();progress.setStatus("Complete.");progress.toggleCancel(false);if(serverData===" "){this.customSettings.upload_successful=false;}else{this.customSettings.upload_successful=true;document.getElementById(ob.settings.txtFileDbID).value=serverData;}}
function uploadComplete(file,ob){if(this.customSettings.upload_successful){this.setButtonDisabled(true);var btnSubmit=document.getElementById(ob.settings.btnSubmitID);btnSubmit.disabled=false;window.form_submitting=btnSubmit.form;if(typeof ob.originalClickHandler!='undefined')
{ob.originalClickHandler(null,ob,btnSubmit.form);}else
{if((btnSubmit.form.onsubmit)&&(false===btnSubmit.form.onsubmit()))return;btnSubmit.form.submit();}}else{var progress=new FileProgress(file,this.customSettings.progress_target);progress.setError();progress.setStatus("File rejected");progress.toggleCancel(false);var txtFileName=document.getElementById(ob.settings.txtFileNameID);if(txtFileName.value!="")
alert("Internal error");txtFileName.value="";fireFakeChangeFor(ob.settings.txtName,'');document.getElementById(ob.settings.btnSubmitID).disabled=false;}}
function uploadError(file,errorCode,message,ob){if(errorCode===SWFUpload.UPLOAD_ERROR.FILE_CANCELLED){return;}
var txtFileName=document.getElementById(ob.settings.txtFileNameID);txtFileName.value="";fireFakeChangeFor(ob.settings.txtName,'');document.getElementById(ob.settings.btnSubmitID).disabled=false;switch(errorCode){case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:alert("You may only upload one file per file field.");this.debug("Error Code: Upload Limit Exceeded, File name: "+file.name+", File size: "+file.size+", Message: "+message);return;case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:break;default:alert("An error occurred in the upload. Try again later.");this.debug("Error Code: "+errorCode+", File name: "+file.name+", File size: "+file.size+", Message: "+message);return;}
var progress=new FileProgress(file,this.customSettings.progress_target);progress.setError();progress.toggleCancel(false);switch(errorCode){case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:progress.setStatus("Upload Error");this.debug("Error Code: HTTP Error, File name: "+file.name+", Message: "+message);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:progress.setStatus("Upload Failed.");this.debug("Error Code: Upload Failed, File name: "+file.name+", File size: "+file.size+", Message: "+message);break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:progress.setStatus("Server (IO) Error");this.debug("Error Code: IO Error, File name: "+file.name+", Message: "+message);break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:progress.setStatus("Security Error");this.debug("Error Code: Security Error, File name: "+file.name+", Message: "+message);break;case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:progress.setStatus("Upload Cancelled");this.debug("Error Code: Upload Cancelled, File name: "+file.name+", Message: "+message);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:progress.setStatus("Upload Stopped");this.debug("Error Code: Upload Stopped, File name: "+file.name+", Message: "+message);break;}}
function preinitFileInput(page_type,name,_btnSubmitID)
{var rep=document.getElementById(name);rep.originally_disabled=rep.disabled;rep.disabled=true;addEventListenerAbstract(window,'load',function(){replaceFileInput(page_type,name,_btnSubmitID);});}
function replaceFileInput(page_type,name,_btnSubmitID)
{var rep=document.getElementById(name);if(!rep.originally_disabled)rep.disabled=false;if(''=='1')return;if(typeof window.no_java=='undefined')window.no_java=false;var java_method=false;if(!_btnSubmitID)
{_btnSubmitID='submit_button';if(!document.getElementById(_btnSubmitID))
{_btnSubmitID=null;var inputs=rep.form.elements;for(var i=0;i<inputs.length;i++)
{if((inputs[i].nodeName.toLowerCase()=='button')||(inputs[i].type=='image')||(inputs[i].type=='submit')||(inputs[i].type=='button'))
{if(!inputs[i].id)inputs[i].id='rand_id_'+Math.floor(Math.random()*10000);_btnSubmitID=inputs[i].id;if(inputs[i].getAttribute('accesskey')=='u')
break;}}}}
var maindiv=document.createElement('div');rep.parentNode.appendChild(maindiv);var subdiv=document.createElement('div');maindiv.appendChild(subdiv);if(!java_method)
{var nextField=document.createElement('input');nextField.setAttribute('size',27);nextField.setAttribute('id','txtFileName_'+name);nextField.setAttribute('type','text');nextField.value='';nextField.name='txtFileName_'+name;nextField.disabled=true;subdiv.appendChild(nextField);}
var placeholder=document.createElement('span');placeholder.id='spanButtonPlaceholder_'+name;subdiv.appendChild(placeholder,rep);var flashdiv=document.createElement('div');flashdiv.id='fsUploadProgress_'+name;flashdiv.className='flash';maindiv.appendChild(flashdiv);var hidFileID=document.createElement('input');hidFileID.setAttribute('id','hidFileID_'+name);hidFileID.name='hidFileID_'+name;hidFileID.setAttribute('type','hidden');hidFileID.value='-1';maindiv.appendChild(hidFileID);rep.style.display='none';rep.disabled=true;rep.name=name+'_old';rep.id=name+'_old';var rep2=document.createElement('input');rep2.type='text';rep2.simulated_events=rep.simulated_events;rep2.style.display='none';rep2.disabled=true;rep2.name=name;rep2.id=name;rep.parentNode.appendChild(rep2);var clearBtn=document.getElementById('clearBtn_'+name);if(clearBtn)clearBtn.style.display='none';if(java_method)
{var btnSubmit=document.getElementById(_btnSubmitID);var hidFileName=document.createElement('input');hidFileName.setAttribute('id','hidFileName_'+name);hidFileName.name='hidFileName_'+name;hidFileName.setAttribute('type','hidden');hidFileName.value='';maindiv.appendChild(hidFileName);var random=Math.floor(Math.random()*100000);var base="/public_html/uploads/incoming/";if(base.substr(base.length-1,1)!='/')base+='/';hidFileID.value=''+random+'.dat';var colorAt=rep.parentNode,backgroundColor;do
{backgroundColor=abstractGetComputedStyle(colorAt,'background-color');colorAt=colorAt.parentNode;}
while((colorAt)&&(backgroundColor)&&(backgroundColor=='transparent'));if((!backgroundColor)||(backgroundColor=='transparent'))backgroundColor='#FFFFFF';var foregroundColor=abstractGetComputedStyle(rep.parentNode,'color');if(!foregroundColor)foregroundColor='#000000';var matches;function decToHex(number)
{var hexbase="0123456789ABCDEF";return hexbase.charAt((number>>4)&0xf)+hexbase.charAt(number&0xf);}
matches=backgroundColor.match(/^\s*rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+)\s*\)\s*$/i);if(matches)backgroundColor='#'+decToHex(matches[1])+decToHex(matches[2])+decToHex(matches[3]);matches=foregroundColor.match(/^\s*rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+)\s*\)\s*$/i);if(matches)foregroundColor='#'+decToHex(matches[1])+decToHex(matches[2])+decToHex(matches[3]);var out='';var maxLength=(typeof btnSubmit.form.elements['MAX_FILE_SIZE']=='undefined')?'2000000000':(btnSubmit.form.elements['MAX_FILE_SIZE'].value);out+='<object width="430" height="29" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93">';out+=' <param name="codebase" value="http://www.spacomics.com/data/javaupload/" />';out+=' <param name="code" value="Uploader.class" />';out+=' <param name="archive" value="http://www.spacomics.com/data/javaupload/Uploader.jar?cachebreak='+random+',http://www.spacomics.com/data/javaupload/Net.jar" />';out+=' <param name="scriptable" VALUE="true" />';out+=' <param name="mayscript" VALUE="true" />';out+=' <param name="address" value="www.spacomics.com" />';out+=' <param name="username" value="anonymous" />';out+=' <param name="password" value="someone@example.com" />';out+=' <param name="uploadedFileName" value="'+base+random+'.dat" />';out+=' <param name="backgroundColor" value="'+backgroundColor+'" />';out+=' <param name="foregroundColor" value="'+foregroundColor+'" />';out+=' <param name="fileNameID" value="hidFileName_'+name+'" />';out+=' <param name="nameID" value="'+name+'" />';out+=' <param name="maxLength" value="'+maxLength+'" />';out+=' <param name="page_type" value="'+page_type+'" />';out+=' <param name="_btnSubmitID" value="'+_btnSubmitID+'" />';out+=' <param name="types" value="swf,flv,sql,odt,ods,ps,pdf,doc,ppt,csv,xls,docx,pptx,xlsx,pub,txt,psd,tga,tif,gif,png,bmp,jpg,jpeg,avi,mov,mpg,mpeg,mp4,asf,wmv,ram,ra,rm,qt,mov,zip,tar,rar,gz,wav,mp3,ogg,torrent,php" />';out+=' <param name="fail_message" value="You chose to not grant the Java file uploader\\naccess to upload files from your computer.\\nThat\&#039;s fine: we\&#039;re loading an alternative\\nuploader for you instead which doesn\&#039;t\\nneed special access.\\n\\nIf you need to upload a large file (more\\nthan 50 MB) we recommend you refresh\\nand grant permission, as this uploader\\nis able to be more robust that the alternatives." />';out+=' <param name="uploaded_message" value="Uploaded" />';out+=' <param name="reverting_title" value="Reverting to basic uploader" />';out+=' <param name="valid_types_label" value="Valid file types" />';out+=' <param name="refused_connection" value="FTP server refused connection." />';out+=' <param name="output_complete" value="Upload Complete" />';out+=' <param name="transfer_error" value="Transfer error" />';out+=' <param name="file_name_label" value="File Name:" />';out+=' <param name="browse_label" value="Browse..." />';out+=' <param name="upload_label" value="Upload" />';out+=' <param name="please_choose_file" value="Please choose a file" />';out+=' <param name="wrong_path" value="Output stream failed (wrong path?) for " />';out+=' <param name="max_size_label" value="maximum size" />';out+=' <param name="too_large" value="File too large" />';out+=' <comment>';out+='  <embed width="430" height="29" fail_message="You chose to not grant the Java file uploader\\naccess to upload files from your computer.\\nThat\&#039;s fine: we\&#039;re loading an alternative\\nuploader for you instead which doesn\&#039;t\\nneed special access.\\n\\nIf you need to upload a large file (more\\nthan 50 MB) we recommend you refresh\\nand grant permission, as this uploader\\nis able to be more robust that the alternatives." uploaded_message="Uploaded" reverting_title="Reverting to basic uploader" valid_types_label="Valid file types" refused_connection="FTP server refused connection." output_complete="Upload Complete" transfer_error="Transfer error" file_name_label="File Name:" browse_label="Browse..." upload_label="Upload" please_choose_file="Please choose a file" wrong_path="Output stream failed (wrong path?) for " max_size_label="maximum size" too_large="File too large" _btnSubmitID="'+_btnSubmitID+'" page_type="'+page_type+'" nameID="'+name+'" types="swf,flv,sql,odt,ods,ps,pdf,doc,ppt,csv,xls,docx,pptx,xlsx,pub,txt,psd,tga,tif,gif,png,bmp,jpg,jpeg,avi,mov,mpg,mpeg,mp4,asf,wmv,ram,ra,rm,qt,mov,zip,tar,rar,gz,wav,mp3,ogg,torrent,php" maxLength="'+maxLength+'" fileNameID="hidFileName_'+name+'" address="www.spacomics.com" username="anonymous" password="someone@example.com" uploadedFileName="'+base+random+'.dat" backgroundColor="'+backgroundColor+'" foregroundColor="'+foregroundColor+'" scriptable="true" mayscript="true" codebase="http://www.spacomics.com/data/javaupload/" code="Uploader.class" archive="http://www.spacomics.com/data/javaupload/Uploader.jar?cachebreak='+random+',http://www.spacomics.com/data/javaupload/Net.jar" type="application/x-java-applet" pluginspage="http://java.sun.com/products/plugin/index.html#download">';out+='  </embed>';out+=' </comment>';out+='</object>';setInnerHTML(flashdiv,out);var old_onclick=btnSubmit.onclick;btnSubmit.onclick=function(){if((rep2.value=='1')||(rep.className.indexOf('required')==-1))
{window.form_submitting=btnSubmit.form;old_onclick();return;}
window.alert('You must upload required files before submitting the form. Do this now, then the form will automatically submit again.');btnSubmit.disabled=true;var timer=window.setInterval(function(){if(rep2.value=='1')
{window.clearTimeout(timer);btnSubmit.disabled=false;window.form_submitting=btnSubmit.form;old_onclick();}},500);}
return;}
try
{var ob=new SWFUpload({txtFileNameID:'txtFileName_'+name,txtFileDbID:'hidFileID_'+name,txtName:name,page_type:page_type,btnSubmitID:_btnSubmitID,required:rep.className.indexOf('required')!=-1,upload_url:"http://www.spacomics.com/data/incoming_uploads.php"+keep_stub(true),file_post_name:"Filedata",file_size_limit:(typeof nextField.form.elements['MAX_FILE_SIZE']=='undefined')?'2 GB':(nextField.form.elements['MAX_FILE_SIZE'].value+' B'),file_types:(name.indexOf('file_novalidate')==-1)?"*.swf;*.flv;*.sql;*.odt;*.ods;*.ps;*.pdf;*.doc;*.ppt;*.csv;*.xls;*.docx;*.pptx;*.xlsx;*.pub;*.txt;*.psd;*.tga;*.tif;*.gif;*.png;*.bmp;*.jpg;*.jpeg;*.avi;*.mov;*.mpg;*.mpeg;*.mp4;*.asf;*.wmv;*.ram;*.ra;*.rm;*.qt;*.mov;*.zip;*.tar;*.rar;*.gz;*.wav;*.mp3;*.ogg;*.torrent;*.php":"*.*",file_types_description:"Allowed Files                                                                                                    ",file_upload_limit:"0",file_queue_limit:"1",swfupload_loaded_handler:swfUploadLoaded,file_dialog_start_handler:fileDialogStart,file_queued_handler:fileQueued,file_queue_error_handler:fileQueueError,file_dialog_complete_handler:fileDialogComplete,upload_progress_handler:uploadProgress,upload_error_handler:uploadError,upload_success_handler:uploadSuccess,upload_complete_handler:uploadComplete,button_image_url:"http://www.spacomics.com/themes/default/images/EN/pageitem/upload.png",button_placeholder_id:"spanButtonPlaceholder_"+name,button_width:66,button_height:20,button_window_mode:SWFUpload.WINDOW_MODE.TRANSPARENT,flash_url:"http://www.spacomics.com/data/swfupload/swfupload.swf",custom_settings:{progress_target:"fsUploadProgress_"+name,upload_successful:false},debug:false});var newClearBtn=document.createElement('input');newClearBtn.id='fsClear_'+name;newClearBtn.type='image';newClearBtn.setAttribute('src','http://www.spacomics.com/themes/default/images/EN/pageitem/clear.png');newClearBtn.style.marginLeft='8px';newClearBtn.style.verticalAlign='top';newClearBtn.value='Clear';subdiv.appendChild(newClearBtn);newClearBtn.onclick=function(){var txtFileName=document.getElementById('txtFileName_'+name);txtFileName.value="";fireFakeChangeFor(name,'');ob.setButtonDisabled(false);document.getElementById(ob.settings.txtFileDbID).value='-1';ob.customSettings.upload_successful=false;return false;};}
catch(e){restoreFormerInput(maindiv,rep2,rep,name,page_type,_btnSubmitID);}}
function restoreFormerInput(maindiv,rep2,rep,name,page_type,_btnSubmitID,thenRefresh)
{if(!maindiv)maindiv=document.getElementById('hidFileID_'+name).parentNode;if(!rep2)rep2=document.getElementById(name+'_old');if(!rep)rep=document.getElementById(name);var hidFileID=document.getElementById('hidFileID_'+name);if(hidFileID)
{hidFileID.parentNode.removeChild(hidFileID);}
var txtFileName=document.getElementById('txtFileName_'+name);if(txtFileName)
{txtFileName.parentNode.removeChild(txtFileName);}
maindiv.parentNode.removeChild(maindiv);rep2.parentNode.removeChild(rep2);rep.style.display='block';rep.disabled=false;rep.name=name;rep.id=name;if(thenRefresh)
{window.no_java=true;replaceFileInput(page_type,name,_btnSubmitID);}}
function isValidJVM()
{var pluginWanted='application/x-java-applet;version=';for(var i=0;i<navigator.plugins.length;i++)
{for(var j=0;j<navigator.plugins[i].length;j++)
{var full=navigator.plugins[i][j].type;if(full.substr(0,pluginWanted.length)==pluginWanted)
{if((full.substr(pluginWanted.length)!="1.0")&&(full.substr(pluginWanted.length)!="1.1")&&(full.substr(pluginWanted.length)!="1.2")&&(full.substr(pluginWanted.length)!="1.3")&&(full.substr(pluginWanted.length)!="1.4"))
return true;}}}
var checker=document.getElementById("java_checker_2");if(checker)if(_isValidJVM(checker))return true;var checker=document.getElementById("java_checker_1");if(checker)if(_isValidJVM(checker))return true;return false;}
function _isValidJVM(checker)
{return(checker.getVersion!=null&&checker.getVendor!=null&&checker.getVendor().indexOf("Sun")>-1&&checker.getVersion().substr(0,3)!="1.0"&&checker.getVersion().substr(0,3)!="1.1"&&checker.getVersion().substr(0,3)!="1.2"&&checker.getVersion().substr(0,3)!="1.3"&&checker.getVersion().substr(0,3)!="1.4");}
(function(){if(window.google&&google.gears){return;}
var factory=null;if(typeof GearsFactory!='undefined'){factory=new GearsFactory();}else{try{factory=new ActiveXObject('Gears.Factory');if(factory.getBuildInfo().indexOf('ie_mobile')!=-1){factory.privateSetGlobalObject(this);}}catch(e){if((typeof navigator.mimeTypes!='undefined')&&navigator.mimeTypes["application/x-googlegears"]){factory=document.createElement("object");factory.style.display="none";factory.width=0;factory.height=0;factory.type="application/x-googlegears";document.documentElement.appendChild(factory);}}}
if(!factory){return;}
if(!window.google){google={};}
if(!google.gears){google.gears={factory:factory};}})();function gears_upload(event)
{if(typeof window.extraAttachmentBase=='undefined')window.extraAttachmentBase=1000;var data=desktop.getDragData(event,'application/x-gears-files');if(data==undefined)return;var boundary='------multipartformboundary'+(new Date).getTime();var dashdash='--';var crlf='\r\n';var total=0;var nameBuildup='';for(var i=0;i<data.files.length;i++)
{var file=data.files[i];if((typeof file.size!='undefined')&&(file.size>3000000))
{window.alert('The dropped file is more than 3MB in size, which is more than we can handle via Drag & Drop without risking browser instability via too much memory usage. Please attach using the normal attachments mechanism.');continue;}
var builder=google.gears.factory.create('beta.blobbuilder');builder.append(dashdash);builder.append(boundary);builder.append(crlf);builder.append('Content-Disposition: form-data; name="Filedata"');if(file.name){builder.append('; filename="'+file.name+'"');}
builder.append(crlf);builder.append('Content-Type: application/octet-stream');builder.append(crlf);builder.append(crlf);builder.append(file.blob);builder.append(crlf);builder.append(dashdash);builder.append(boundary);builder.append(crlf);var hidfileid=document.createElement('input');hidfileid.type='hidden';hidfileid.name='hidFileID_file'+window.extraAttachmentBase;hidfileid.id=hidfileid.name;hidfileid.value='-1';document.getElementById('container_for_post').appendChild(hidfileid);var hidfilename=document.createElement('input');hidfilename.type='hidden';hidfilename.name='txtFileName_file'+window.extraAttachmentBase;hidfilename.id=hidfilename.name;hidfilename.value=file.name;document.getElementById('container_for_post').appendChild(hidfilename);var fileProgress={id:'progress_'+window.extraAttachmentBase,name:file.name};var progress=new FileProgress(fileProgress,'container_for_post');progress.setStatus("Uploading...");builder.append(dashdash);builder.append(boundary);builder.append(dashdash);builder.append(crlf);var request=google.gears.factory.create('beta.httprequest');request.onreadystatechange=build_gears_upload_handler(request,fileProgress,window.extraAttachmentBase);request.open("POST","http://www.spacomics.com/data/incoming_uploads.php"+keep_stub(true));request.setRequestHeader('content-type','multipart/form-data; boundary='+boundary);request.send(builder.getAsBlob());if(typeof event.stopPropagation!='undefined')event.stopPropagation();window.extraAttachmentBase++;}}
function build_gears_upload_handler(request,fileProgress,attachmentBase)
{return function(){switch(request.readyState){case 4:if(request.responseText==''){var progress=new FileProgress(fileProgress,'container_for_post');progress.setProgress(100);progress.setStatus("Upload Failed.");}else
{insertTextbox(document.getElementById('post'),"[attachment description=\""+fileProgress.name+"\" thumb=\"1\" type=\"island\"]new_"+attachmentBase+"[/attachment]\n");var progress=new FileProgress(fileProgress,'container_for_post');progress.setProgress(100);progress.setComplete();progress.setStatus("Complete.");document.getElementById('hidFileID_file'+attachmentBase).value=request.responseText;}
break;}};}
function html5_upload(event)
{var dt=event.dataTransfer;if(typeof dt=='undefined')return;var files=dt.files;if(typeof files=='undefined')return;var count=files.length;cancelBubbling(event);if(typeof event.preventDefault!='undefined')event.preventDefault();if(typeof window.extraAttachmentBase=='undefined')window.extraAttachmentBase=1000;var boundary='------multipartformboundary'+(new Date).getTime();var dashdash='--';var crlf='\r\n';for(var i=0;i<count;i++)
{var file=files.item(i);if((typeof file.size!='undefined')&&(file.size>3000000))
{window.alert('The dropped file is more than 3MB in size, which is more than we can handle via Drag & Drop without risking browser instability via too much memory usage. Please attach using the normal attachments mechanism.');continue;}
var request=new XMLHttpRequest();var fileUpload=request.upload;var hidfileid=document.createElement('input');hidfileid.type='hidden';hidfileid.name='hidFileID_file'+window.extraAttachmentBase;hidfileid.id=hidfileid.name;hidfileid.value='-1';document.getElementById('container_for_post').appendChild(hidfileid);var hidfilename=document.createElement('input');hidfilename.type='hidden';hidfilename.name='txtFileName_file'+window.extraAttachmentBase;hidfilename.id=hidfilename.name;hidfilename.value=file.name;document.getElementById('container_for_post').appendChild(hidfilename);fileUpload.fileProgress={id:'progress_'+window.extraAttachmentBase,name:file.name};fileUpload.addEventListener("progress",html5_upload_progress,false);request.onreadystatechange=build_gears_upload_handler(request,fileUpload.fileProgress,window.extraAttachmentBase);var data='';data+=(dashdash);data+=(boundary);data+=(crlf);data+=('Content-Disposition: form-data; name="Filedata"');if(file.name){data+=('; filename="'+file.name+'"');}
data+=(crlf);data+=('Content-Type: application/octet-stream');data+=(crlf);data+=(crlf);data+=((typeof file.getAsBinary=='undefined')?file.getAsBinaryString():file.getAsBinary());data+=(crlf);data+=(dashdash);data+=(boundary);data+=(crlf);request.open("POST","http://www.spacomics.com/data/incoming_uploads.php"+keep_stub(true));request.overrideMimeType('multipart/form-data; boundary='+boundary);request.setRequestHeader('content-type','multipart/form-data; boundary='+boundary);request.sendAsBinary(data);var progress=new FileProgress(fileUpload.fileProgress,'container_for_post');progress.setProgress(0);progress.setStatus("Uploading...");window.extraAttachmentBase++;}}
function html5_upload_progress(event)
{if(event.lengthComputable){var percentage=Math.round((event.loaded*100)/event.total);if(percentage<100){var progress=new FileProgress(event.target.fileProgress,'container_for_post');progress.setProgress(percentage);progress.setStatus("Uploading...");}}}