/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.form.uploader.Base"],["require","dijit._Widget"],["require","dijit._Templated"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.form.uploader.Base"]){_4._hasResource["dojox.form.uploader.Base"]=true;_4.provide("dojox.form.uploader.Base");_4.require("dijit._Widget");_4.require("dijit._Templated");_4.declare("dojox.form.uploader.Base",[_5._Widget,_5._Templated],{getForm:function(){if(!this.form){var n=this.domNode;while(n&&n.tagName&&n!==document.body){if(n.tagName.toLowerCase()=="form"){this.form=n;break;}n=n.parentNode;}}return this.form;},getUrl:function(){if(this.uploadUrl){this.url=this.uploadUrl;}if(this.url){return this.url;}if(this.getForm()){this.url=this.form.action;}return this.url;},connectForm:function(){this.url=this.getUrl();if(!this._fcon&&!!this.getForm()){this._fcon=true;this.connect(this.form,"onsubmit",function(_7){_4.stopEvent(_7);this.submit(_4.formToObject(this.form));});}},supports:function(_8){if(!this._hascache){this._hascache={testDiv:_4.create("div"),testInput:_4.create("input",{type:"file"}),xhr:!!window.XMLHttpRequest?new XMLHttpRequest():{}};_4.style(this._hascache.testDiv,"opacity",0.7);}switch(_8){case "FormData":return !!window.FormData;case "sendAsBinary":return !!this._hascache.xhr.sendAsBinary;case "opacity":return _4.style(this._hascache.testDiv,"opacity")==0.7;case "multiple":if(this.force=="flash"||this.force=="iframe"){return false;}var _9=_4.attr(this._hascache.testInput,"multiple");return _9===true||_9===false;}return false;},getMimeType:function(){return "application/octet-stream";},getFileType:function(_a){return _a.substring(_a.lastIndexOf(".")+1).toUpperCase();},convertBytes:function(_b){var kb=Math.round(_b/1024*100000)/100000;var mb=Math.round(_b/1048576*100000)/100000;var gb=Math.round(_b/1073741824*100000)/100000;var _c=_b;if(kb>1){_c=kb.toFixed(1)+" kb";}if(mb>1){_c=mb.toFixed(1)+" mb";}if(gb>1){_c=gb.toFixed(1)+" gb";}return {kb:kb,mb:mb,gb:gb,bytes:_b,value:_c};}});}}};});