//>>built
define("dojox/form/FileUploader","dojo/_base/kernel dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/window dojo/_base/sniff dojo/query dojo/dom dojo/dom-style dojo/dom-geometry dojo/dom-attr dojo/dom-class dojo/dom-construct dojo/dom-form dojo/_base/config dijit/_base/manager dojo/io/iframe dojo/_base/Color dojo/_base/unload dijit/_Widget dijit/_TemplatedMixin dijit/_Contained dojox/embed/Flash dojox/embed/flashVars dojox/html/styles".split(" "),function(y,z,k,m,
f,A,q,r,u,d,t,n,g,h,B,C,p,D,v,E,F,G,H,w,x,I){y.deprecated("dojox.form.FileUploader","Use dojox.form.Uploader","2.0");return z("dojox.form.FileUploader",[F,G,H],{swfPath:C.uploaderPath||require.toUrl("dojox/form/resources/fileuploader.swf"),templateString:'\x3cdiv\x3e\x3cdiv dojoAttachPoint\x3d"progNode"\x3e\x3cdiv dojoAttachPoint\x3d"progTextNode"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv dojoAttachPoint\x3d"insideNode" class\x3d"uploaderInsideNode"\x3e\x3c/div\x3e\x3c/div\x3e',uploadUrl:"",isDebug:!1,devMode:!1,
baseClass:"dojoxUploaderNorm",hoverClass:"dojoxUploaderHover",activeClass:"dojoxUploaderActive",disabledClass:"dojoxUploaderDisabled",force:"",uploaderType:"",flashObject:null,flashMovie:null,insideNode:null,deferredUploading:1,fileListId:"",uploadOnChange:!1,selectMultipleFiles:!0,htmlFieldName:"uploadedfile",flashFieldName:"flashUploadFiles",fileMask:null,minFlashVersion:9,tabIndex:-1,showProgress:!1,progressMessage:"Loading",progressBackgroundUrl:require.toUrl("dijit/themes/tundra/images/buttonActive.png"),
progressBackgroundColor:"#ededed",progressWidgetId:"",skipServerCheck:!1,serverTimeout:5E3,log:function(){this.isDebug&&console.log(Array.prototype.slice.call(arguments).join(" "))},constructor:function(){this._subs=[]},postMixInProperties:function(){this.fileList=[];this._cons=[];this.fileMask=this.fileMask||[];this.fileInputs=[];this.fileCount=0;this._disabled=this.flashReady=!1;this.force=this.force.toLowerCase();this.uploaderType=(w.available>=this.minFlashVersion||"flash"==this.force)&&"html"!=
this.force?"flash":"html";this.deferredUploading=!0===this.deferredUploading?1:this.deferredUploading;this._refNode=this.srcNodeRef;this.getButtonStyle()},startup:function(){},postCreate:function(){this.inherited(arguments);this.setButtonStyle();if("flash"==this.uploaderType)var a="createFlashUploader";else this.uploaderType="html",a="createHtmlUploader";this[a]();this.fileListId&&this.connect(u.byId(this.fileListId),"click",function(b){b=b.target.parentNode.parentNode.parentNode;b.id&&-1<b.id.indexOf("file_")&&
this.removeFile(b.id.split("file_")[1])});E.addOnUnload(this,this.destroy)},getHiddenNode:function(a){if(!a)return null;var b=null;for(a=a.parentNode;a&&"body"!=a.tagName.toLowerCase();){if("none"==d.get(a,"display")){b=a;break}a=a.parentNode}return b},getButtonStyle:function(){var a=this.srcNodeRef;(this._hiddenNode=this.getHiddenNode(a))&&d.set(this._hiddenNode,"display","block");if(!a&&this.button&&this.button.domNode){var b=!0;a=this.button.domNode.className+" dijitButtonNode";var c=this.getText(r(".dijitButtonText",
this.button.domNode)[0]);this.srcNodeRef=a=h.place('\x3cbutton id\x3d"'+this.button.id+'" class\x3d"'+a+'"\x3e'+c+"\x3c/button\x3e",this.button.domNode,"after");this.button.destroy();this.baseClass="dijitButton";this.hoverClass="dijitButtonHover";this.pressClass="dijitButtonActive";this.disabledClass="dijitButtonDisabled"}else!this.srcNodeRef&&this.button&&(a=this.button);n.get(a,"class")&&(this.baseClass+=" "+n.get(a,"class"));n.set(a,"class",this.baseClass);this.norm=this.getStyle(a);this.width=
this.norm.w;this.height=this.norm.h;"flash"==this.uploaderType?(this.over=this.getTempNodeStyle(a,this.baseClass+" "+this.hoverClass,b),this.down=this.getTempNodeStyle(a,this.baseClass+" "+this.activeClass,b),this.dsbl=this.getTempNodeStyle(a,this.baseClass+" "+this.disabledClass,b),this.fhtml={cn:this.getText(a),nr:this.norm,ov:this.over,dn:this.down,ds:this.dsbl}):(this.fhtml={cn:this.getText(a),nr:this.norm},"middle"==this.norm.va&&(this.norm.lh=this.norm.h));this.devMode&&(this.log("classes - base:",
this.baseClass," hover:",this.hoverClass,"active:",this.activeClass),this.log("fhtml:",this.fhtml),this.log("norm:",this.norm),this.log("over:",this.over),this.log("down:",this.down))},setButtonStyle:function(){d.set(this.domNode,{width:this.fhtml.nr.w+"px",height:this.fhtml.nr.h+"px",padding:"0px",lineHeight:"normal",position:"relative"});"html"==this.uploaderType&&"middle"==this.norm.va&&d.set(this.domNode,"lineHeight",this.norm.lh+"px");this.showProgress?(this.progTextNode.innerHTML=this.progressMessage,
d.set(this.progTextNode,{width:this.fhtml.nr.w+"px",height:this.fhtml.nr.h+0+"px",padding:"0px",margin:"0px",left:"0px",lineHeight:this.fhtml.nr.h+0+"px",position:"absolute"}),d.set(this.progNode,{width:this.fhtml.nr.w+"px",height:this.fhtml.nr.h+0+"px",padding:"0px",margin:"0px",left:"0px",position:"absolute",display:"none",backgroundImage:"url("+this.progressBackgroundUrl+")",backgroundPosition:"bottom",backgroundRepeat:"repeat-x",backgroundColor:this.progressBackgroundColor})):h.destroy(this.progNode);
d.set(this.insideNode,{position:"absolute",top:"0px",left:"0px",display:""});g.add(this.domNode,this.srcNodeRef.className);-1<this.fhtml.nr.d.indexOf("inline")&&g.add(this.domNode,"dijitInline");try{this.insideNode.innerHTML=this.fhtml.cn}catch(b){if("flash"==this.uploaderType){this.insideNode=this.insideNode.parentNode.removeChild(this.insideNode);A.body().appendChild(this.insideNode);this.insideNode.innerHTML=this.fhtml.cn;var a=f.connect(this,"onReady",this,function(){f.disconnect(a);this.insideNode=
this.insideNode.parentNode.removeChild(this.insideNode);this.domNode.appendChild(this.insideNode)})}else this.insideNode.appendChild(document.createTextNode(this.fhtml.cn))}this._hiddenNode&&d.set(this._hiddenNode,"display","none")},onChange:function(a){},onProgress:function(a){},onComplete:function(a){},onCancel:function(){},onError:function(a){},onReady:function(a){},onLoad:function(a){},submit:function(a){a=a?B.toObject(a):null;this.upload(a);return!1},upload:function(a){if(!this.fileList.length||
!this.uploadUrl)return!1;this.showProgress||this.set("disabled",!0);if(this.progressWidgetId){var b=p.byId(this.progressWidgetId).domNode;"none"==d.get(b,"display")&&(this.restoreProgDisplay="none",d.set(b,"display","block"));"hidden"==d.get(b,"visibility")&&(this.restoreProgDisplay="hidden",d.set(b,"visibility","visible"))}a&&!a.target&&(this.postData=a);this.log("upload type:",this.uploaderType," - postData:",this.postData);for(a=0;a<this.fileList.length;a++)b=this.fileList[a],b.bytesLoaded=0,b.bytesTotal=
b.size||1E5,b.percent=0;"flash"==this.uploaderType?this.uploadFlash():this.uploadHTML();return!1},removeFile:function(a,b){var c;for(c=0;c<this.fileList.length;c++)if(this.fileList[c].name==a){b||this.fileList.splice(c,1);break}"flash"==this.uploaderType?this.flashMovie.removeFile(a):b||(h.destroy(this.fileInputs[c]),this.fileInputs.splice(c,1),this._renumberInputs());this.fileListId&&h.destroy("file_"+a)},destroy:function(){"flash"!=this.uploaderType||this.flashMovie?(m.forEach(this._subs,f.unsubscribe,
dojo),m.forEach(this._cons,f.disconnect,dojo),this.scrollConnect&&f.disconnect(this.scrollConnect),"flash"==this.uploaderType?(this.flashObject.destroy(),delete this.flashObject):(h.destroy(this._fileInput),h.destroy(this._formNode)),this.inherited(arguments)):this._cons.push(f.connect(this,"onLoad",this,"destroy"))},_displayProgress:function(a){!0===a?("flash"==this.uploaderType?d.set(this.insideNode,"top","-2500px"):d.set(this.insideNode,"display","none"),d.set(this.progNode,"display","")):!1===
a?(d.set(this.insideNode,{display:"",top:"0"}),d.set(this.progNode,"display","none")):d.set(this.progNode,"width",a*this.fhtml.nr.w+"px")},_animateProgress:function(){this._displayProgress(!0);var a=!1,b=f.connect(this,"_complete",function(){f.disconnect(b);a=!0}),c=0,e=setInterval(k.hitch(this,function(){c+=5;c>this.fhtml.nr.w&&(c=0,a=!0);this._displayProgress(c/this.fhtml.nr.w);a&&(clearInterval(e),setTimeout(k.hitch(this,function(){this._displayProgress(!1)}),500))}),50)},_error:function(a){"string"==
typeof a&&(a=Error(a));this.onError(a)},_addToFileList:function(){if(this.fileListId){var a="";m.forEach(this.fileList,function(b){a+='\x3ctable id\x3d"file_'+b.name+'" class\x3d"fileToUpload"\x3e\x3ctr\x3e\x3ctd class\x3d"fileToUploadClose"\x3e\x3c/td\x3e\x3ctd class\x3d"fileToUploadName"\x3e'+b.name+'\x3c/td\x3e\x3ctd class\x3d"fileToUploadSize"\x3e'+(b.size?Math.ceil(.001*b.size)+"kb":"")+"\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e"},this);u.byId(this.fileListId).innerHTML=a}},_change:function(a){q("ie")&&
m.forEach(a,function(b){b.name=b.name.split("\\")[b.name.split("\\").length-1]});this.selectMultipleFiles?this.fileList=this.fileList.concat(a):(this.fileList[0]&&this.removeFile(this.fileList[0].name,!0),this.fileList=a);this._addToFileList();this.onChange(a);this.uploadOnChange?("html"==this.uploaderType&&this._buildFileInput(),this.upload()):"html"==this.uploaderType&&this.selectMultipleFiles&&(this._buildFileInput(),this._connectInput())},_complete:function(a){a=k.isArray(a)?a:[a];m.forEach(a,
function(b){b.ERROR&&this._error(b.ERROR)},this);m.forEach(this.fileList,function(b){b.bytesLoaded=1;b.bytesTotal=1;b.percent=100;this._progress(b)},this);m.forEach(this.fileList,function(b){this.removeFile(b.name,!0)},this);this.onComplete(a);this.fileList=[];this._resetHTML();this.set("disabled",!1);this.restoreProgDisplay&&setTimeout(k.hitch(this,function(){d.set(p.byId(this.progressWidgetId).domNode,"none"==this.restoreProgDisplay?"display":"visibility",this.restoreProgDisplay)}),500)},_progress:function(a){for(var b=
0,c=0,e=0;e<this.fileList.length;e++){var l=this.fileList[e];l.name==a.name&&(l.bytesLoaded=a.bytesLoaded,l.bytesTotal=a.bytesTotal,l.percent=Math.ceil(l.bytesLoaded/l.bytesTotal*100),this.log(l.name,"percent:",l.percent));c+=Math.ceil(.001*l.bytesLoaded);b+=Math.ceil(.001*l.bytesTotal)}a=Math.ceil(c/b*100);this.progressWidgetId&&p.byId(this.progressWidgetId).update({progress:a+"%"});this.showProgress&&this._displayProgress(.01*a);this.onProgress(this.fileList)},_getDisabledAttr:function(){return this._disabled},
_setDisabledAttr:function(a){if(this._disabled!=a){if("flash"==this.uploaderType){if(!this.flashReady){var b=f.connect(this,"onLoad",this,function(){f.disconnect(b);this._setDisabledAttr(a)});return}this._disabled=a;this.flashMovie.doDisable(a)}else this._disabled=a,d.set(this._fileInput,"display",this._disabled?"none":"");g.toggle(this.domNode,this.disabledClass,a)}},_onFlashBlur:function(){this.flashMovie.blur();if(!this.nextFocusObject&&this.tabIndex)for(var a=r("[tabIndex]"),b=0;b<a.length;b++)if(a[b].tabIndex>=
Number(this.tabIndex)+1){this.nextFocusObject=a[b];break}this.nextFocusObject.focus()},_disconnect:function(){m.forEach(this._cons,f.disconnect,dojo)},uploadHTML:function(){this.selectMultipleFiles&&h.destroy(this._fileInput);this._setHtmlPostData();this.showProgress&&this._animateProgress();D.send({url:this.uploadUrl.toString(),form:this._formNode,handleAs:"json",error:k.hitch(this,function(a){this._error("HTML Upload Error:"+a.message)}),load:k.hitch(this,function(a,b,c){this._complete(a)})})},
createHtmlUploader:function(){this._buildForm();this._setFormStyle();this._buildFileInput();this._connectInput();this._styleContent();d.set(this.insideNode,"visibility","visible");this.onReady()},_connectInput:function(){this._disconnect();this._cons.push(f.connect(this._fileInput,"mouseover",this,function(a){g.add(this.domNode,this.hoverClass);this.onMouseOver(a)}));this._cons.push(f.connect(this._fileInput,"mouseout",this,function(a){setTimeout(k.hitch(this,function(){g.remove(this.domNode,this.activeClass);
g.remove(this.domNode,this.hoverClass);this.onMouseOut(a);this._checkHtmlCancel("off")}),0)}));this._cons.push(f.connect(this._fileInput,"mousedown",this,function(a){g.add(this.domNode,this.activeClass);g.remove(this.domNode,this.hoverClass);this.onMouseDown(a)}));this._cons.push(f.connect(this._fileInput,"mouseup",this,function(a){g.remove(this.domNode,this.activeClass);this.onMouseUp(a);this.onClick(a);this._checkHtmlCancel("up")}));this._cons.push(f.connect(this._fileInput,"change",this,function(){this._checkHtmlCancel("change");
var a=this._fileInput.value;a?this._change([{name:a,type:"",size:0}]):this._change([])}));0<=this.tabIndex&&n.set(this.domNode,"tabIndex",this.tabIndex)},_checkHtmlCancel:function(a){"change"==a&&(this.dialogIsOpen=!1);"up"==a&&(this.dialogIsOpen=!0);if("off"==a){if(this.dialogIsOpen)this.onCancel();this.dialogIsOpen=!1}},_styleContent:function(){var a=this.fhtml.nr;d.set(this.insideNode,{width:a.w+"px",height:"middle"==a.va?a.h+"px":"auto",textAlign:a.ta,paddingTop:a.p[0]+"px",paddingRight:a.p[1]+
"px",paddingBottom:a.p[2]+"px",paddingLeft:a.p[3]+"px"});try{d.set(this.insideNode,"lineHeight","inherit")}catch(b){}},_resetHTML:function(){"html"==this.uploaderType&&this._formNode&&(this.fileInputs=[],r("*",this._formNode).forEach(function(a){h.destroy(a)}),this.fileCount=0,this._buildFileInput(),this._connectInput())},_buildForm:function(){this._formNode||(9>q("ie")||q("ie")&&q("quirks")?(this._formNode=document.createElement('\x3cform enctype\x3d"multipart/form-data" method\x3d"post"\x3e'),this._formNode.encoding=
"multipart/form-data",this._formNode.id=p.getUniqueId("FileUploaderForm"),this.domNode.appendChild(this._formNode)):this._formNode=h.create("form",{enctype:"multipart/form-data",method:"post",id:p.getUniqueId("FileUploaderForm")},this.domNode))},_buildFileInput:function(){this._fileInput&&(this._disconnect(),this._fileInput.id+=this.fileCount,d.set(this._fileInput,"display","none"));this._fileInput=document.createElement("input");this.fileInputs.push(this._fileInput);var a=this.htmlFieldName;this.selectMultipleFiles&&
(a+=this.fileCount,this.fileCount++);n.set(this._fileInput,{id:this.id,name:a,type:"file"});g.add(this._fileInput,"dijitFileInputReal");this._formNode.appendChild(this._fileInput);a=t.getMarginBox(this._fileInput);d.set(this._fileInput,{position:"relative",left:this.fhtml.nr.w-a.w+"px",opacity:0})},_renumberInputs:function(){if(this.selectMultipleFiles){var a;this.fileCount=0;m.forEach(this.fileInputs,function(b){a=this.htmlFieldName+this.fileCount;this.fileCount++;n.set(b,"name",a)},this)}},_setFormStyle:function(){I.insertCssRule("#"+
this._formNode.id+" input","font-size:"+Math.max(2,Math.max(Math.ceil(this.fhtml.nr.w/60),Math.ceil(this.fhtml.nr.h/15)))+"em");d.set(this.domNode,{overflow:"hidden",position:"relative"});d.set(this.insideNode,"position","absolute")},_setHtmlPostData:function(){if(this.postData)for(var a in this.postData)h.create("input",{type:"hidden",name:a,value:this.postData[a]},this._formNode)},uploadFlash:function(){try{if(this.showProgress){this._displayProgress(!0);var a=f.connect(this,"_complete",this,function(){f.disconnect(a);
this._displayProgress(!1)})}var b={},c;for(c in this.postData)b[c]=this.postData[c];this.flashMovie.doUpload(b)}catch(e){this._error("FileUploader - Sorry, the SWF failed to initialize."+e)}},createFlashUploader:function(){if(this.uploadUrl=this.uploadUrl.toString())if(0>this.uploadUrl.toLowerCase().indexOf("http")&&0!=this.uploadUrl.indexOf("/")){var a=window.location.href.split("/");a.pop();a=a.join("/")+"/";this.uploadUrl=a+this.uploadUrl;this.log("SWF Fixed - Relative loc:",a," abs loc:",this.uploadUrl)}else this.log("SWF URL unmodified:",
this.uploadUrl);a={expressInstall:!0,path:this.swfPath.uri||this.swfPath,width:this.fhtml.nr.w,height:this.fhtml.nr.h,allowScriptAccess:"always",allowNetworking:"all",vars:{uploadDataFieldName:this.flashFieldName,uploadUrl:this.uploadUrl,uploadOnSelect:this.uploadOnChange,deferredUploading:this.deferredUploading||0,selectMultipleFiles:this.selectMultipleFiles,id:this.id,isDebug:this.isDebug,devMode:this.devMode,flashButton:x.serialize("fh",this.fhtml),fileMask:x.serialize("fm",this.fileMask),noReturnCheck:this.skipServerCheck,
serverTimeout:this.serverTimeout},params:{scale:"noscale",wmode:"opaque",allowScriptAccess:"always",allowNetworking:"all"}};this.flashObject=new w(a,this.insideNode);this.flashObject.onError=k.hitch(function(b){this._error("Flash Error: "+b)});this.flashObject.onReady=k.hitch(this,function(){d.set(this.insideNode,"visibility","visible");this.log("FileUploader flash object ready");this.onReady(this)});this.flashObject.onLoad=k.hitch(this,function(b){this.flashMovie=b;this.flashReady=!0;this.onLoad(this)});
this._connectFlash()},_connectFlash:function(){this._doSub("/filesSelected","_change");this._doSub("/filesUploaded","_complete");this._doSub("/filesProgress","_progress");this._doSub("/filesError","_error");this._doSub("/filesCanceled","onCancel");this._doSub("/stageBlur","_onFlashBlur");this._doSub("/up","onMouseUp");this._doSub("/down","onMouseDown");this._doSub("/over","onMouseOver");this._doSub("/out","onMouseOut");this.connect(this.domNode,"focus",function(){this.flashMovie.focus();this.flashMovie.doFocus()});
0<=this.tabIndex&&n.set(this.domNode,"tabIndex",this.tabIndex)},_doSub:function(a,b){this._subs.push(f.subscribe(this.id+a,this,b))},urlencode:function(a){return a&&"none"!=a?a.replace(/:/g,"||").replace(/\./g,"^^").replace("url(","").replace(")","").replace(/'/g,"").replace(/"/g,""):!1},isButton:function(a){a=a.tagName.toLowerCase();return"button"==a||"input"==a},getTextStyle:function(a){var b={};b.ff=d.get(a,"fontFamily");if(b.ff){b.ff=b.ff.replace(", ",",");b.ff=b.ff.replace(/"|'/g,"");b.ff="sans-serif"==
b.ff?"Arial":b.ff;b.fw=d.get(a,"fontWeight");b.fi=d.get(a,"fontStyle");b.fs=parseInt(d.get(a,"fontSize"),10);if(-1<d.get(a,"fontSize").indexOf("%"))for(var c=a;c.tagName;){if(-1==d.get(c,"fontSize").indexOf("%")){b.fs=parseInt(d.get(c,"fontSize"),10);break}"body"==c.tagName.toLowerCase()&&(b.fs=.16*parseInt(d.get(c,"fontSize"),10));c=c.parentNode}b.fc=(new v(d.get(a,"color"))).toHex();b.fc=parseInt(b.fc.substring(1,Infinity),16)}b.lh=d.get(a,"lineHeight");b.ta=d.get(a,"textAlign");b.ta="start"!=b.ta&&
b.ta?b.ta:"left";b.va=this.isButton(a)?"middle":b.lh==b.h?"middle":d.get(a,"verticalAlign");return b},getText:function(a){a=k.trim(a.innerHTML);-1<a.indexOf("\x3c")&&(a=escape(a));return a},getStyle:function(a){var b={},c=t.getContentBox(a),e=t.getPadExtents(a);b.p=[e.t,e.w-e.l,e.h-e.t,e.l];b.w=c.w+e.w;b.h=c.h+e.h;b.d=d.get(a,"display");c=new v(d.get(a,"backgroundColor"));b.bc=0==c.a?"#ffffff":c.toHex();b.bc=parseInt(b.bc.substring(1,Infinity),16);if(c=this.urlencode(d.get(a,"backgroundImage")))b.bi=
{url:c,rp:d.get(a,"backgroundRepeat"),pos:escape(d.get(a,"backgroundPosition"))},b.bi.pos||(c=d.get(a,"backgroundPositionX"),e=d.get(a,"backgroundPositionY"),b.bi.pos=escape(("left"==c?"0%":"right"==c?"100%":c)+" "+("top"==e?"0%":"bottom"==e?"100%":e)));return k.mixin(b,this.getTextStyle(a))},getTempNodeStyle:function(a,b,c){if(c){c=h.place("\x3c"+a.tagName+"\x3e\x3cspan\x3e"+a.innerHTML+"\x3c/span\x3e\x3c/"+a.tagName+"\x3e",a.parentNode);var e=c.firstChild;g.add(e,a.className);g.add(c,b);a=this.getStyle(e)}else c=
h.place("\x3c"+a.tagName+"\x3e"+a.innerHTML+"\x3c/"+a.tagName+"\x3e",a.parentNode),g.add(c,a.className),g.add(c,b),c.id=a.id,a=this.getStyle(c);h.destroy(c);return a}})});