/*
	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
*/

/*
	This is an optimized version of Dojo, built for deployment and not for
	development. To get sources and documentation, please visit:

		http://dojotoolkit.org
*/

if(!dojo._hasResource["dojo.data.util.filter"]){dojo._hasResource["dojo.data.util.filter"]=true;dojo.provide("dojo.data.util.filter");dojo.getObject("data.util.filter",true,dojo);dojo.data.util.filter.patternToRegExp=function(_1,_2){var _3="^";var c=null;for(var i=0;i<_1.length;i++){c=_1.charAt(i);switch(c){case "\\":_3+=c;i++;_3+=_1.charAt(i);break;case "*":_3+=".*";break;case "?":_3+=".";break;case "$":case "^":case "/":case "+":case ".":case "|":case "(":case ")":case "{":case "}":case "[":case "]":_3+="\\";default:_3+=c;}}_3+="$";if(_2){return new RegExp(_3,"mi");}else{return new RegExp(_3,"m");}};}if(!dojo._hasResource["dojo.data.util.sorter"]){dojo._hasResource["dojo.data.util.sorter"]=true;dojo.provide("dojo.data.util.sorter");dojo.getObject("data.util.sorter",true,dojo);dojo.data.util.sorter.basicComparator=function(a,b){var r=-1;if(a===null){a=undefined;}if(b===null){b=undefined;}if(a==b){r=0;}else{if(a>b||a==null){r=1;}}return r;};dojo.data.util.sorter.createSortFunction=function(_4,_5){var _6=[];function _7(_8,_9,_a,s){return function(_b,_c){var a=s.getValue(_b,_8);var b=s.getValue(_c,_8);return _9*_a(a,b);};};var _d;var _e=_5.comparatorMap;var bc=dojo.data.util.sorter.basicComparator;for(var i=0;i<_4.length;i++){_d=_4[i];var _f=_d.attribute;if(_f){var dir=(_d.descending)?-1:1;var _10=bc;if(_e){if(typeof _f!=="string"&&("toString" in _f)){_f=_f.toString();}_10=_e[_f]||bc;}_6.push(_7(_f,dir,_10,_5));}}return function(_11,_12){var i=0;while(i<_6.length){var ret=_6[i++](_11,_12);if(ret!==0){return ret;}}return 0;};};}if(!dojo._hasResource["dojo.data.util.simpleFetch"]){dojo._hasResource["dojo.data.util.simpleFetch"]=true;dojo.provide("dojo.data.util.simpleFetch");dojo.getObject("data.util.simpleFetch",true,dojo);dojo.data.util.simpleFetch.fetch=function(_13){_13=_13||{};if(!_13.store){_13.store=this;}var _14=this;var _15=function(_16,_17){if(_17.onError){var _18=_17.scope||dojo.global;_17.onError.call(_18,_16,_17);}};var _19=function(_1a,_1b){var _1c=_1b.abort||null;var _1d=false;var _1e=_1b.start?_1b.start:0;var _1f=(_1b.count&&(_1b.count!==Infinity))?(_1e+_1b.count):_1a.length;_1b.abort=function(){_1d=true;if(_1c){_1c.call(_1b);}};var _20=_1b.scope||dojo.global;if(!_1b.store){_1b.store=_14;}if(_1b.onBegin){_1b.onBegin.call(_20,_1a.length,_1b);}if(_1b.sort){_1a.sort(dojo.data.util.sorter.createSortFunction(_1b.sort,_14));}if(_1b.onItem){for(var i=_1e;(i<_1a.length)&&(i<_1f);++i){var _21=_1a[i];if(!_1d){_1b.onItem.call(_20,_21,_1b);}}}if(_1b.onComplete&&!_1d){var _22=null;if(!_1b.onItem){_22=_1a.slice(_1e,_1f);}_1b.onComplete.call(_20,_22,_1b);}};this._fetchItems(_13,_19,_15);return _13;};}if(!dojo._hasResource["dojo.date.stamp"]){dojo._hasResource["dojo.date.stamp"]=true;dojo.provide("dojo.date.stamp");dojo.getObject("date.stamp",true,dojo);dojo.date.stamp.fromISOString=function(_23,_24){if(!dojo.date.stamp._isoRegExp){dojo.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;}var _25=dojo.date.stamp._isoRegExp.exec(_23),_26=null;if(_25){_25.shift();if(_25[1]){_25[1]--;}if(_25[6]){_25[6]*=1000;}if(_24){_24=new Date(_24);dojo.forEach(dojo.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(_27){return _24["get"+_27]();}),function(_28,_29){_25[_29]=_25[_29]||_28;});}_26=new Date(_25[0]||1970,_25[1]||0,_25[2]||1,_25[3]||0,_25[4]||0,_25[5]||0,_25[6]||0);if(_25[0]<100){_26.setFullYear(_25[0]||1970);}var _2a=0,_2b=_25[7]&&_25[7].charAt(0);if(_2b!="Z"){_2a=((_25[8]||0)*60)+(Number(_25[9])||0);if(_2b!="-"){_2a*=-1;}}if(_2b){_2a-=_26.getTimezoneOffset();}if(_2a){_26.setTime(_26.getTime()+_2a*60000);}}return _26;};dojo.date.stamp.toISOString=function(_2c,_2d){var _2e=function(n){return (n<10)?"0"+n:n;};_2d=_2d||{};var _2f=[],_30=_2d.zulu?"getUTC":"get",_31="";if(_2d.selector!="time"){var _32=_2c[_30+"FullYear"]();_31=["0000".substr((_32+"").length)+_32,_2e(_2c[_30+"Month"]()+1),_2e(_2c[_30+"Date"]())].join("-");}_2f.push(_31);if(_2d.selector!="date"){var _33=[_2e(_2c[_30+"Hours"]()),_2e(_2c[_30+"Minutes"]()),_2e(_2c[_30+"Seconds"]())].join(":");var _34=_2c[_30+"Milliseconds"]();if(_2d.milliseconds){_33+="."+(_34<100?"0":"")+_2e(_34);}if(_2d.zulu){_33+="Z";}else{if(_2d.selector!="time"){var _35=_2c.getTimezoneOffset();var _36=Math.abs(_35);_33+=(_35>0?"-":"+")+_2e(Math.floor(_36/60))+":"+_2e(_36%60);}}_2f.push(_33);}return _2f.join("T");};}if(!dojo._hasResource["dojo.data.ItemFileReadStore"]){dojo._hasResource["dojo.data.ItemFileReadStore"]=true;dojo.provide("dojo.data.ItemFileReadStore");dojo.declare("dojo.data.ItemFileReadStore",null,{constructor:function(_37){this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this._jsonFileUrlPattern=_37.url;this._jsonFileUrl=_37.url;this._ccUrl=_37.url;this.url=_37.url;this._jsonData=_37.data;this.data=null;this._datatypeMap=_37.typeMap||{};if(!this._datatypeMap["Date"]){this._datatypeMap["Date"]={type:Date,deserialize:function(_38){return dojo.date.stamp.fromISOString(_38);}};}this._features={"dojo.data.api.Read":true,"dojo.data.api.Identity":true};this._itemsByIdentity=null;this._storeRefPropName="_S";this._itemNumPropName="_0";this._rootItemPropName="_RI";this._reverseRefMap="_RRM";this._loadInProgress=false;this._queuedFetches=[];if(_37.urlPreventCache!==undefined){this.urlPreventCache=_37.urlPreventCache?true:false;}if(_37.hierarchical!==undefined){this.hierarchical=_37.hierarchical?true:false;}if(_37.clearOnClose){this.clearOnClose=true;}if("failOk" in _37){this.failOk=_37.failOk?true:false;}},url:"",_ccUrl:"",data:null,typeMap:null,clearOnClose:false,urlPreventCache:false,failOk:false,hierarchical:true,_assertIsItem:function(_39){if(!this.isItem(_39)){throw new Error("dojo.data.ItemFileReadStore: Invalid item argument.");}},_setSearchUrlPattern:function(_3a,_3b){this._jsonFileUrlPattern=_3a;this._jsonFileUrl=_3a;this._itemName=_3b;},_parseSearchUrl:function(_3c){if(this._jsonFileUrlPattern==""){this._loadFinished=true;return;}this._jsonFileUrl=this._jsonFileUrlPattern.replace("%{searchString}",_3c);this._loadFinished=false;},_assertIsAttribute:function(_3d){if(typeof _3d!=="string"){throw new Error("dojo.data.ItemFileReadStore: Invalid attribute argument.");}},getValue:function(_3e,_3f,_40){var _41=this.getValues(_3e,_3f);return (_41.length>0)?_41[0]:_40;},getValues:function(_42,_43){this._assertIsItem(_42);this._assertIsAttribute(_43);return (_42[_43]||[]).slice(0);},getAttributes:function(_44){this._assertIsItem(_44);var _45=[];for(var key in _44){if((key!==this._storeRefPropName)&&(key!==this._itemNumPropName)&&(key!==this._rootItemPropName)&&(key!==this._reverseRefMap)){_45.push(key);}}return _45;},hasAttribute:function(_46,_47){this._assertIsItem(_46);this._assertIsAttribute(_47);return (_47 in _46);},containsValue:function(_48,_49,_4a){var _4b=undefined;if(typeof _4a==="string"){_4b=dojo.data.util.filter.patternToRegExp(_4a,false);}return this._containsValue(_48,_49,_4a,_4b);},_containsValue:function(_4c,_4d,_4e,_4f){return dojo.some(this.getValues(_4c,_4d),function(_50){if(_50!==null&&!dojo.isObject(_50)&&_4f){if(_50.toString().match(_4f)){return true;}}else{if(_4e===_50){return true;}}});},isItem:function(_51){if(_51&&_51[this._storeRefPropName]===this){if(this._arrayOfAllItems[_51[this._itemNumPropName]]===_51){return true;}}return false;},isItemLoaded:function(_52){return this.isItem(_52);},loadItem:function(_53){this._assertIsItem(_53.item);},getFeatures:function(){return this._features;},getLabel:function(_54){if(this._labelAttr&&this.isItem(_54)){return this.getValue(_54,this._labelAttr);}return undefined;},getLabelAttributes:function(_55){if(this._labelAttr){return [this._labelAttr];}return null;},_fetchItems:function(_56,_57,_58){var _59=this,_5a=function(_5b,_5c){var _5d=[],i,key;if(_5b.query){var _5e,_5f=_5b.queryOptions?_5b.queryOptions.ignoreCase:false;var _60={};for(key in _5b.query){_5e=_5b.query[key];if(typeof _5e==="string"){_60[key]=dojo.data.util.filter.patternToRegExp(_5e,_5f);}else{if(_5e instanceof RegExp){_60[key]=_5e;}}}for(i=0;i<_5c.length;++i){var _61=true;var _62=_5c[i];if(_62===null){_61=false;}else{for(key in _5b.query){_5e=_5b.query[key];if(!_59._containsValue(_62,key,_5e,_60[key])){_61=false;}}}if(_61){_5d.push(_62);}}_57(_5d,_5b);}else{for(i=0;i<_5c.length;++i){var _63=_5c[i];if(_63!==null){_5d.push(_63);}}_57(_5d,_5b);}};if(this._loadFinished){_5a(_56,this._getItemsArray(_56.queryOptions));}else{if(this._jsonFileUrl!==this._ccUrl){dojo.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store,"+" not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");this._ccUrl=this._jsonFileUrl;this.url=this._jsonFileUrl;}else{if(this.url!==this._ccUrl){this._jsonFileUrl=this.url;this._ccUrl=this.url;}}if(this.data!=null){this._jsonData=this.data;this.data=null;}if(this._jsonFileUrl){if(this._loadInProgress){this._queuedFetches.push({args:_56,filter:_5a});}else{this._loadInProgress=true;var _64={url:encodeURI(_59._jsonFileUrl),handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk};var _65=dojo.xhrGet(_64);_65.addCallback(function(_66){try{_59._getItemsFromLoadedData2(_66);_59._loadFinished=true;_59._loadInProgress=false;_5a(_56,_59._getItemsArray(_56.queryOptions));_59._handleQueuedFetches();}catch(e){_59._loadFinished=true;_59._loadInProgress=false;_58(e,_56);}});_65.addErrback(function(_67){_59._loadInProgress=false;_58(_67,_56);});var _68=null;if(_56.abort){_68=_56.abort;}_56.abort=function(){var df=_65;if(df&&df.fired===-1){df.cancel();df=null;}if(_68){_68.call(_56);}};}}else{if(this._jsonData){try{this._loadFinished=true;this._getItemsFromLoadedData2(this._jsonData);this._jsonData=null;_5a(_56,this._getItemsArray(_56.queryOptions));}catch(e){_58(e,_56);}}else{_58(new Error("dojo.data.ItemFileReadStore: No JSON source data was provided as either URL or a nested Javascript object."),_56);}}}},_handleQueuedFetches:function(){if(this._queuedFetches.length>0){for(var i=0;i<this._queuedFetches.length;i++){var _69=this._queuedFetches[i],_6a=_69.args,_6b=_69.filter;if(_6b){_6b(_6a,this._getItemsArray(_6a.queryOptions));}else{this.fetchItemByIdentity(_6a);}}this._queuedFetches=[];}},_getItemsArray:function(_6c){if(_6c&&_6c.deep){return this._arrayOfAllItems;}return this._arrayOfTopLevelItems;},close:function(_6d){if(this.clearOnClose&&this._loadFinished&&!this._loadInProgress){if(((this._jsonFileUrl==""||this._jsonFileUrl==null)&&(this.url==""||this.url==null))&&this.data==null){console.debug("dojo.data.ItemFileReadStore: WARNING!  Data reload "+" information has not been provided."+"  Please set 'url' or 'data' to the appropriate value before"+" the next fetch");}this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this._itemsByIdentity=null;this._loadInProgress=false;this._queuedFetches=[];}},_getItemsFromLoadedData2:function(_6e){this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];var _6f;for(i=0;i<_6e[this._itemName].length;++i){this._arrayOfTopLevelItems[i]=new Object();this._arrayOfTopLevelItems[i][this._itemName]=_6e[this._itemName][i];_6f=this._arrayOfTopLevelItems[i];this._arrayOfAllItems[i]=_6f;_6f[this._rootItemPropName]=true;}var key;for(i=0;i<this._arrayOfAllItems.length;++i){_6f=this._arrayOfAllItems[i];for(key in _6f){if(key!==this._rootItemPropName){var _70=_6f[key];if(_70!==null){_6f[key]=[_70];}}}}for(i=0;i<this._arrayOfAllItems.length;++i){_6f=this._arrayOfAllItems[i];_6f[this._storeRefPropName]=this;_6f[this._itemNumPropName]=i;}},_getItemsFromLoadedData:function(_71){var _72=false,_73=this;function _74(_75){var _76=((_75!==null)&&(typeof _75==="object")&&(!dojo.isArray(_75)||_72)&&(!dojo.isFunction(_75))&&(_75.constructor==Object||dojo.isArray(_75))&&(typeof _75._reference==="undefined")&&(typeof _75._type==="undefined")&&(typeof _75._value==="undefined")&&_73.hierarchical);return _76;};function _77(_78){_73._arrayOfAllItems.push(_78);for(var _79 in _78){var _7a=_78[_79];if(_7a){if(dojo.isArray(_7a)){var _7b=_7a;for(var k=0;k<_7b.length;++k){var _7c=_7b[k];if(_74(_7c)){_77(_7c);}}}else{if(_74(_7a)){_77(_7a);}}}}};this._labelAttr=_71.label;var i,_7d;this._arrayOfAllItems=[];this._arrayOfTopLevelItems=_71.items;for(i=0;i<this._arrayOfTopLevelItems.length;++i){_7d=this._arrayOfTopLevelItems[i];if(dojo.isArray(_7d)){_72=true;}_77(_7d);_7d[this._rootItemPropName]=true;}var _7e={},key;for(i=0;i<this._arrayOfAllItems.length;++i){_7d=this._arrayOfAllItems[i];for(key in _7d){if(key!==this._rootItemPropName){var _7f=_7d[key];if(_7f!==null){if(!dojo.isArray(_7f)){_7d[key]=[_7f];}}else{_7d[key]=[null];}}_7e[key]=key;}}while(_7e[this._storeRefPropName]){this._storeRefPropName+="_";}while(_7e[this._itemNumPropName]){this._itemNumPropName+="_";}while(_7e[this._reverseRefMap]){this._reverseRefMap+="_";}var _80;var _81=_71.identifier;if(_81){this._itemsByIdentity={};this._features["dojo.data.api.Identity"]=_81;for(i=0;i<this._arrayOfAllItems.length;++i){_7d=this._arrayOfAllItems[i];_80=_7d[_81];var _82=_80[0];if(!Object.hasOwnProperty.call(this._itemsByIdentity,_82)){this._itemsByIdentity[_82]=_7d;}else{if(this._jsonFileUrl){throw new Error("dojo.data.ItemFileReadStore:  The json data as specified by: ["+this._jsonFileUrl+"] is malformed.  Items within the list have identifier: ["+_81+"].  Value collided: ["+_82+"]");}else{if(this._jsonData){throw new Error("dojo.data.ItemFileReadStore:  The json data provided by the creation arguments is malformed.  Items within the list have identifier: ["+_81+"].  Value collided: ["+_82+"]");}}}}}else{this._features["dojo.data.api.Identity"]=Number;}for(i=0;i<this._arrayOfAllItems.length;++i){_7d=this._arrayOfAllItems[i];_7d[this._storeRefPropName]=this;_7d[this._itemNumPropName]=i;}for(i=0;i<this._arrayOfAllItems.length;++i){_7d=this._arrayOfAllItems[i];for(key in _7d){_80=_7d[key];for(var j=0;j<_80.length;++j){_7f=_80[j];if(_7f!==null&&typeof _7f=="object"){if(("_type" in _7f)&&("_value" in _7f)){var _83=_7f._type;var _84=this._datatypeMap[_83];if(!_84){throw new Error("dojo.data.ItemFileReadStore: in the typeMap constructor arg, no object class was specified for the datatype '"+_83+"'");}else{if(dojo.isFunction(_84)){_80[j]=new _84(_7f._value);}else{if(dojo.isFunction(_84.deserialize)){_80[j]=_84.deserialize(_7f._value);}else{throw new Error("dojo.data.ItemFileReadStore: Value provided in typeMap was neither a constructor, nor a an object with a deserialize function");}}}}if(_7f._reference){var _85=_7f._reference;if(!dojo.isObject(_85)){_80[j]=this._getItemByIdentity(_85);}else{for(var k=0;k<this._arrayOfAllItems.length;++k){var _86=this._arrayOfAllItems[k],_87=true;for(var _88 in _85){if(_86[_88]!=_85[_88]){_87=false;}}if(_87){_80[j]=_86;}}}if(this.referenceIntegrity){var _89=_80[j];if(this.isItem(_89)){this._addReferenceToMap(_89,_7d,key);}}}else{if(this.isItem(_7f)){if(this.referenceIntegrity){this._addReferenceToMap(_7f,_7d,key);}}}}}}}},_addReferenceToMap:function(_8a,_8b,_8c){},getIdentity:function(_8d){var _8e=this._features["dojo.data.api.Identity"];if(_8e===Number){return _8d[this._itemNumPropName];}else{var _8f=_8d[_8e];if(_8f){return _8f[0];}}return null;},fetchItemByIdentity:function(_90){var _91,_92;if(!this._loadFinished){var _93=this;if(this._jsonFileUrl!==this._ccUrl){dojo.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store,"+" not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");this._ccUrl=this._jsonFileUrl;this.url=this._jsonFileUrl;}else{if(this.url!==this._ccUrl){this._jsonFileUrl=this.url;this._ccUrl=this.url;}}if(this.data!=null&&this._jsonData==null){this._jsonData=this.data;this.data=null;}if(this._jsonFileUrl){if(this._loadInProgress){this._queuedFetches.push({args:_90});}else{this._loadInProgress=true;var _94={url:encodeURI(_93._jsonFileUrl),handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk};var _95=dojo.xhrGet(_94);_95.addCallback(function(_96){var _97=_90.scope?_90.scope:dojo.global;try{_93._getItemsFromLoadedData2(_96);_93._loadFinished=true;_93._loadInProgress=false;_91=_93._getItemByIdentity(_90.identity);if(_90.onItem){_90.onItem.call(_97,_91);}_93._handleQueuedFetches();}catch(error){_93._loadInProgress=false;if(_90.onError){_90.onError.call(_97,error);}}});_95.addErrback(function(_98){_93._loadInProgress=false;if(_90.onError){var _99=_90.scope?_90.scope:dojo.global;_90.onError.call(_99,_98);}});}}else{if(this._jsonData){_93._getItemsFromLoadedData2(_93._jsonData);_93._jsonData=null;_93._loadFinished=true;_91=_93._getItemByIdentity(_90.identity);if(_90.onItem){_92=_90.scope?_90.scope:dojo.global;_90.onItem.call(_92,_91);}}}}else{_91=this._getItemByIdentity(_90.identity);if(_90.onItem){_92=_90.scope?_90.scope:dojo.global;_90.onItem.call(_92,_91);}}},_getItemByIdentity:function(_9a){var _9b=null;if(this._itemsByIdentity&&Object.hasOwnProperty.call(this._itemsByIdentity,_9a)){_9b=this._itemsByIdentity[_9a];}else{if(Object.hasOwnProperty.call(this._arrayOfAllItems,_9a)){_9b=this._arrayOfAllItems[_9a];}}if(_9b===undefined){_9b=null;}return _9b;},getIdentityAttributes:function(_9c){var _9d=this._features["dojo.data.api.Identity"];if(_9d===Number){return null;}else{return [_9d];}},_forceLoad:function(){var _9e=this;if(this._jsonFileUrl!==this._ccUrl){dojo.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store,"+" not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");this._ccUrl=this._jsonFileUrl;this.url=this._jsonFileUrl;}else{if(this.url!==this._ccUrl){this._jsonFileUrl=this.url;this._ccUrl=this.url;}}if(this.data!=null){this._jsonData=this.data;this.data=null;}if(this._jsonFileUrl){var _9f={url:this._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk,sync:true};var _a0=dojo.xhrGet(_9f);_a0.addCallback(function(_a1){try{if(_9e._loadInProgress!==true&&!_9e._loadFinished){_9e._getItemsFromLoadedData2(_a1);_9e._loadFinished=true;}else{if(_9e._loadInProgress){throw new Error("dojo.data.ItemFileReadStore:  Unable to perform a synchronous load, an async load is in progress.");}}}catch(e){console.log(e);throw e;}});_a0.addErrback(function(_a2){throw _a2;});}else{if(this._jsonData){_9e._getItemsFromLoadedData2(_9e._jsonData);_9e._jsonData=null;_9e._loadFinished=true;}}}});dojo.extend(dojo.data.ItemFileReadStore,dojo.data.util.simpleFetch);}if(!dojo._hasResource["dojo.dnd.common"]){dojo._hasResource["dojo.dnd.common"]=true;dojo.provide("dojo.dnd.common");dojo.getObject("dnd",true,dojo);dojo.dnd.getCopyKeyState=dojo.isCopyKey;dojo.dnd._uniqueId=0;dojo.dnd.getUniqueId=function(){var id;do{id=dojo._scopeName+"Unique"+(++dojo.dnd._uniqueId);}while(dojo.byId(id));return id;};dojo.dnd._empty={};dojo.dnd.isFormElement=function(e){var t=e.target;if(t.nodeType==3){t=t.parentNode;}return " button textarea input select option ".indexOf(" "+t.tagName.toLowerCase()+" ")>=0;};}if(!dojo._hasResource["dojo.window"]){dojo._hasResource["dojo.window"]=true;dojo.provide("dojo.window");dojo.getObject("window",true,dojo);dojo.window.getBox=function(){var _a3=(dojo.doc.compatMode=="BackCompat")?dojo.body():dojo.doc.documentElement;var _a4=dojo._docScroll();return {w:_a3.clientWidth,h:_a3.clientHeight,l:_a4.x,t:_a4.y};};dojo.window.get=function(doc){if(dojo.isIE&&window!==document.parentWindow){doc.parentWindow.execScript("document._parentWindow = window;","Javascript");var win=doc._parentWindow;doc._parentWindow=null;return win;}return doc.parentWindow||doc.defaultView;};dojo.window.scrollIntoView=function(_a5,pos){try{_a5=dojo.byId(_a5);var doc=_a5.ownerDocument||dojo.doc,_a6=doc.body||dojo.body(),_a7=doc.documentElement||_a6.parentNode,_a8=dojo.isIE,_a9=dojo.isWebKit;if((!(dojo.isMoz||_a8||_a9||dojo.isOpera)||_a5==_a6||_a5==_a7)&&(typeof _a5.scrollIntoView!="undefined")){_a5.scrollIntoView(false);return;}var _aa=doc.compatMode=="BackCompat",_ab=_aa?_a6:_a7,_ac=_a9?_a6:_ab,_ad=_ab.clientWidth,_ae=_ab.clientHeight,rtl=!dojo._isBodyLtr(),_af=pos||dojo.position(_a5),el=_a5.parentNode,_b0=function(el){return ((_a8<=6||(_a8&&_aa))?false:(dojo.style(el,"position").toLowerCase()=="fixed"));};if(_b0(_a5)){return;}while(el){if(el==_a6){el=_ac;}var _b1=dojo.position(el),_b2=_b0(el);if(el==_ac){_b1.w=_ad;_b1.h=_ae;if(_ac==_a7&&_a8&&rtl){_b1.x+=_ac.offsetWidth-_b1.w;}if(_b1.x<0||!_a8){_b1.x=0;}if(_b1.y<0||!_a8){_b1.y=0;}}else{var pb=dojo._getPadBorderExtents(el);_b1.w-=pb.w;_b1.h-=pb.h;_b1.x+=pb.l;_b1.y+=pb.t;}if(el!=_ac){var _b3=el.clientWidth,_b4=_b1.w-_b3;if(_b3>0&&_b4>0){_b1.w=_b3;if(_a8&&rtl){_b1.x+=_b4;}}_b3=el.clientHeight;_b4=_b1.h-_b3;if(_b3>0&&_b4>0){_b1.h=_b3;}}if(_b2){if(_b1.y<0){_b1.h+=_b1.y;_b1.y=0;}if(_b1.x<0){_b1.w+=_b1.x;_b1.x=0;}if(_b1.y+_b1.h>_ae){_b1.h=_ae-_b1.y;}if(_b1.x+_b1.w>_ad){_b1.w=_ad-_b1.x;}}var l=_af.x-_b1.x,t=_af.y-Math.max(_b1.y,0),r=l+_af.w-_b1.w,bot=t+_af.h-_b1.h;if(r*l>0){var s=Math[l<0?"max":"min"](l,r);_af.x+=el.scrollLeft;el.scrollLeft+=(_a8>=8&&!_aa&&rtl)?-s:s;_af.x-=el.scrollLeft;}if(bot*t>0){_af.y+=el.scrollTop;el.scrollTop+=Math[t<0?"max":"min"](t,bot);_af.y-=el.scrollTop;}el=(el!=_ac)&&!_b2&&el.parentNode;}}catch(error){console.error("scrollIntoView: "+error);_a5.scrollIntoView(false);}};}if(!dojo._hasResource["dojo.dnd.autoscroll"]){dojo._hasResource["dojo.dnd.autoscroll"]=true;dojo.provide("dojo.dnd.autoscroll");dojo.getObject("dnd",true,dojo);dojo.dnd.getViewport=dojo.window.getBox;dojo.dnd.V_TRIGGER_AUTOSCROLL=32;dojo.dnd.H_TRIGGER_AUTOSCROLL=32;dojo.dnd.V_AUTOSCROLL_VALUE=16;dojo.dnd.H_AUTOSCROLL_VALUE=16;dojo.dnd.autoScroll=function(e){var v=dojo.window.getBox(),dx=0,dy=0;if(e.clientX<dojo.dnd.H_TRIGGER_AUTOSCROLL){dx=-dojo.dnd.H_AUTOSCROLL_VALUE;}else{if(e.clientX>v.w-dojo.dnd.H_TRIGGER_AUTOSCROLL){dx=dojo.dnd.H_AUTOSCROLL_VALUE;}}if(e.clientY<dojo.dnd.V_TRIGGER_AUTOSCROLL){dy=-dojo.dnd.V_AUTOSCROLL_VALUE;}else{if(e.clientY>v.h-dojo.dnd.V_TRIGGER_AUTOSCROLL){dy=dojo.dnd.V_AUTOSCROLL_VALUE;}}window.scrollBy(dx,dy);};dojo.dnd._validNodes={"div":1,"p":1,"td":1};dojo.dnd._validOverflow={"auto":1,"scroll":1};dojo.dnd.autoScrollNodes=function(e){for(var n=e.target;n;){if(n.nodeType==1&&(n.tagName.toLowerCase() in dojo.dnd._validNodes)){var s=dojo.getComputedStyle(n);if(s.overflow.toLowerCase() in dojo.dnd._validOverflow){var b=dojo._getContentBox(n,s),t=dojo.position(n,true);var w=Math.min(dojo.dnd.H_TRIGGER_AUTOSCROLL,b.w/2),h=Math.min(dojo.dnd.V_TRIGGER_AUTOSCROLL,b.h/2),rx=e.pageX-t.x,ry=e.pageY-t.y,dx=0,dy=0;if(dojo.isWebKit||dojo.isOpera){rx+=dojo.body().scrollLeft;ry+=dojo.body().scrollTop;}if(rx>0&&rx<b.w){if(rx<w){dx=-w;}else{if(rx>b.w-w){dx=w;}}}if(ry>0&&ry<b.h){if(ry<h){dy=-h;}else{if(ry>b.h-h){dy=h;}}}var _b5=n.scrollLeft,_b6=n.scrollTop;n.scrollLeft=n.scrollLeft+dx;n.scrollTop=n.scrollTop+dy;if(_b5!=n.scrollLeft||_b6!=n.scrollTop){return;}}}try{n=n.parentNode;}catch(x){n=null;}}dojo.dnd.autoScroll(e);};}if(!dojo._hasResource["dojo.dnd.Mover"]){dojo._hasResource["dojo.dnd.Mover"]=true;dojo.provide("dojo.dnd.Mover");dojo.declare("dojo.dnd.Mover",null,{constructor:function(_b7,e,_b8){this.node=dojo.byId(_b7);var pos=e.touches?e.touches[0]:e;this.marginBox={l:pos.pageX,t:pos.pageY};this.mouseButton=e.button;var h=(this.host=_b8),d=_b7.ownerDocument;this.events=[dojo.connect(d,"onmousemove",this,"onFirstMove"),dojo.connect(d,"ontouchmove",this,"onFirstMove"),dojo.connect(d,"onmousemove",this,"onMouseMove"),dojo.connect(d,"ontouchmove",this,"onMouseMove"),dojo.connect(d,"onmouseup",this,"onMouseUp"),dojo.connect(d,"ontouchend",this,"onMouseUp"),dojo.connect(d,"ondragstart",dojo.stopEvent),dojo.connect(d.body,"onselectstart",dojo.stopEvent)];if(h&&h.onMoveStart){h.onMoveStart(this);}},onMouseMove:function(e){dojo.dnd.autoScroll(e);var m=this.marginBox,pos=e.touches?e.touches[0]:e;this.host.onMove(this,{l:m.l+pos.pageX,t:m.t+pos.pageY},e);dojo.stopEvent(e);},onMouseUp:function(e){if(dojo.isWebKit&&dojo.isMac&&this.mouseButton==2?e.button==0:this.mouseButton==e.button){this.destroy();}dojo.stopEvent(e);},onFirstMove:function(e){var s=this.node.style,l,t,h=this.host;switch(s.position){case "relative":case "absolute":l=Math.round(parseFloat(s.left))||0;t=Math.round(parseFloat(s.top))||0;break;default:s.position="absolute";var m=dojo.marginBox(this.node);var b=dojo.doc.body;var bs=dojo.getComputedStyle(b);var bm=dojo._getMarginBox(b,bs);var bc=dojo._getContentBox(b,bs);l=m.l-(bc.l-bm.l);t=m.t-(bc.t-bm.t);break;}this.marginBox.l=l-this.marginBox.l;this.marginBox.t=t-this.marginBox.t;if(h&&h.onFirstMove){h.onFirstMove(this,e);}dojo.disconnect(this.events.shift());dojo.disconnect(this.events.shift());},destroy:function(){dojo.forEach(this.events,dojo.disconnect);var h=this.host;if(h&&h.onMoveStop){h.onMoveStop(this);}this.events=this.node=this.host=null;}});}if(!dojo._hasResource["dojo.dnd.Moveable"]){dojo._hasResource["dojo.dnd.Moveable"]=true;dojo.provide("dojo.dnd.Moveable");dojo.declare("dojo.dnd.Moveable",null,{handle:"",delay:0,skip:false,constructor:function(_b9,_ba){this.node=dojo.byId(_b9);if(!_ba){_ba={};}this.handle=_ba.handle?dojo.byId(_ba.handle):null;if(!this.handle){this.handle=this.node;}this.delay=_ba.delay>0?_ba.delay:0;this.skip=_ba.skip;this.mover=_ba.mover?_ba.mover:dojo.dnd.Mover;this.events=[dojo.connect(this.handle,"onmousedown",this,"onMouseDown"),dojo.connect(this.handle,"ontouchstart",this,"onMouseDown"),dojo.connect(this.handle,"ondragstart",this,"onSelectStart"),dojo.connect(this.handle,"onselectstart",this,"onSelectStart")];},markupFactory:function(_bb,_bc){return new dojo.dnd.Moveable(_bc,_bb);},destroy:function(){dojo.forEach(this.events,dojo.disconnect);this.events=this.node=this.handle=null;},onMouseDown:function(e){if(this.skip&&dojo.dnd.isFormElement(e)){return;}if(this.delay){this.events.push(dojo.connect(this.handle,"onmousemove",this,"onMouseMove"),dojo.connect(this.handle,"ontouchmove",this,"onMouseMove"),dojo.connect(this.handle,"onmouseup",this,"onMouseUp"),dojo.connect(this.handle,"ontouchend",this,"onMouseUp"));var pos=e.touches?e.touches[0]:e;this._lastX=pos.pageX;this._lastY=pos.pageY;}else{this.onDragDetected(e);}dojo.stopEvent(e);},onMouseMove:function(e){var pos=e.touches?e.touches[0]:e;if(Math.abs(pos.pageX-this._lastX)>this.delay||Math.abs(pos.pageY-this._lastY)>this.delay){this.onMouseUp(e);this.onDragDetected(e);}dojo.stopEvent(e);},onMouseUp:function(e){for(var i=0;i<2;++i){dojo.disconnect(this.events.pop());}dojo.stopEvent(e);},onSelectStart:function(e){if(!this.skip||!dojo.dnd.isFormElement(e)){dojo.stopEvent(e);}},onDragDetected:function(e){new this.mover(this.node,e,this);},onMoveStart:function(_bd){dojo.publish("/dnd/move/start",[_bd]);dojo.addClass(dojo.body(),"dojoMove");dojo.addClass(this.node,"dojoMoveItem");},onMoveStop:function(_be){dojo.publish("/dnd/move/stop",[_be]);dojo.removeClass(dojo.body(),"dojoMove");dojo.removeClass(this.node,"dojoMoveItem");},onFirstMove:function(_bf,e){},onMove:function(_c0,_c1,e){this.onMoving(_c0,_c1);var s=_c0.node.style;s.left=_c1.l+"px";s.top=_c1.t+"px";this.onMoved(_c0,_c1);},onMoving:function(_c2,_c3){},onMoved:function(_c4,_c5){}});}if(!dojo._hasResource["dojo.dnd.move"]){dojo._hasResource["dojo.dnd.move"]=true;dojo.provide("dojo.dnd.move");dojo.declare("dojo.dnd.move.constrainedMoveable",dojo.dnd.Moveable,{constraints:function(){},within:false,markupFactory:function(_c6,_c7){return new dojo.dnd.move.constrainedMoveable(_c7,_c6);},constructor:function(_c8,_c9){if(!_c9){_c9={};}this.constraints=_c9.constraints;this.within=_c9.within;},onFirstMove:function(_ca){var c=this.constraintBox=this.constraints.call(this,_ca);c.r=c.l+c.w;c.b=c.t+c.h;if(this.within){var mb=dojo._getMarginSize(_ca.node);c.r-=mb.w;c.b-=mb.h;}},onMove:function(_cb,_cc){var c=this.constraintBox,s=_cb.node.style;this.onMoving(_cb,_cc);_cc.l=_cc.l<c.l?c.l:c.r<_cc.l?c.r:_cc.l;_cc.t=_cc.t<c.t?c.t:c.b<_cc.t?c.b:_cc.t;s.left=_cc.l+"px";s.top=_cc.t+"px";this.onMoved(_cb,_cc);}});dojo.declare("dojo.dnd.move.boxConstrainedMoveable",dojo.dnd.move.constrainedMoveable,{box:{},markupFactory:function(_cd,_ce){return new dojo.dnd.move.boxConstrainedMoveable(_ce,_cd);},constructor:function(_cf,_d0){var box=_d0&&_d0.box;this.constraints=function(){return box;};}});dojo.declare("dojo.dnd.move.parentConstrainedMoveable",dojo.dnd.move.constrainedMoveable,{area:"content",markupFactory:function(_d1,_d2){return new dojo.dnd.move.parentConstrainedMoveable(_d2,_d1);},constructor:function(_d3,_d4){var _d5=_d4&&_d4.area;this.constraints=function(){var n=this.node.parentNode,s=dojo.getComputedStyle(n),mb=dojo._getMarginBox(n,s);if(_d5=="margin"){return mb;}var t=dojo._getMarginExtents(n,s);mb.l+=t.l,mb.t+=t.t,mb.w-=t.w,mb.h-=t.h;if(_d5=="border"){return mb;}t=dojo._getBorderExtents(n,s);mb.l+=t.l,mb.t+=t.t,mb.w-=t.w,mb.h-=t.h;if(_d5=="padding"){return mb;}t=dojo._getPadExtents(n,s);mb.l+=t.l,mb.t+=t.t,mb.w-=t.w,mb.h-=t.h;return mb;};}});dojo.dnd.constrainedMover=dojo.dnd.move.constrainedMover;dojo.dnd.boxConstrainedMover=dojo.dnd.move.boxConstrainedMover;dojo.dnd.parentConstrainedMover=dojo.dnd.move.parentConstrainedMover;}if(!dojo._hasResource["dojo.back"]){dojo._hasResource["dojo.back"]=true;dojo.provide("dojo.back");dojo.getObject("back",true,dojo);(function(){var _d6=dojo.back,_d7=_d6.getHash=function(){var h=window.location.hash;if(h.charAt(0)=="#"){h=h.substring(1);}return dojo.isMozilla?h:decodeURIComponent(h);},_d8=_d6.setHash=function(h){if(!h){h="";}window.location.hash=encodeURIComponent(h);_d9=history.length;};var _da=(typeof (window)!=="undefined")?window.location.href:"";var _db=(typeof (window)!=="undefined")?_d7():"";var _dc=null;var _dd=null;var _de=null;var _df=null;var _e0=[];var _e1=[];var _e2=false;var _e3=false;var _d9;function _e4(){var _e5=_e1.pop();if(!_e5){return;}var _e6=_e1[_e1.length-1];if(!_e6&&_e1.length==0){_e6=_dc;}if(_e6){if(_e6.kwArgs["back"]){_e6.kwArgs["back"]();}else{if(_e6.kwArgs["backButton"]){_e6.kwArgs["backButton"]();}else{if(_e6.kwArgs["handle"]){_e6.kwArgs.handle("back");}}}}_e0.push(_e5);};_d6.goBack=_e4;function _e7(){var _e8=_e0.pop();if(!_e8){return;}if(_e8.kwArgs["forward"]){_e8.kwArgs.forward();}else{if(_e8.kwArgs["forwardButton"]){_e8.kwArgs.forwardButton();}else{if(_e8.kwArgs["handle"]){_e8.kwArgs.handle("forward");}}}_e1.push(_e8);};_d6.goForward=_e7;function _e9(url,_ea,_eb){return {"url":url,"kwArgs":_ea,"urlHash":_eb};};function _ec(url){var _ed=url.split("?");if(_ed.length<2){return null;}else{return _ed[1];}};function _ee(){var url=(dojo.config["dojoIframeHistoryUrl"]||dojo.moduleUrl("dojo","resources/iframe_history.html"))+"?"+(new Date()).getTime();_e2=true;if(_df){dojo.isWebKit?_df.location=url:window.frames[_df.name].location=url;}else{}return url;};function _ef(){if(!_e3){var hsl=_e1.length;var _f0=_d7();if((_f0===_db||window.location.href==_da)&&(hsl==1)){_e4();return;}if(_e0.length>0){if(_e0[_e0.length-1].urlHash===_f0){_e7();return;}}if((hsl>=2)&&(_e1[hsl-2])){if(_e1[hsl-2].urlHash===_f0){_e4();return;}}}};_d6.init=function(){if(dojo.byId("dj_history")){return;}var src=dojo.config["dojoIframeHistoryUrl"]||dojo.moduleUrl("dojo","resources/iframe_history.html");if(dojo._postLoad){console.error("dojo.back.init() must be called before the DOM has loaded. "+"If using xdomain loading or djConfig.debugAtAllCosts, include dojo.back "+"in a build layer.");}else{document.write("<iframe style=\"border:0;width:1px;height:1px;position:absolute;visibility:hidden;bottom:0;right:0;\" name=\"dj_history\" id=\"dj_history\" src=\""+src+"\"></iframe>");}};_d6.setInitialState=function(_f1){_dc=_e9(_da,_f1,_db);};_d6.addToHistory=function(_f2){_e0=[];var _f3=null;var url=null;if(!_df){if(dojo.config["useXDomain"]&&!dojo.config["dojoIframeHistoryUrl"]){console.warn("dojo.back: When using cross-domain Dojo builds,"+" please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl"+" to the path on your domain to iframe_history.html");}_df=window.frames["dj_history"];}if(!_de){_de=dojo.create("a",{style:{display:"none"}},dojo.body());}if(_f2["changeUrl"]){_f3=""+((_f2["changeUrl"]!==true)?_f2["changeUrl"]:(new Date()).getTime());if(_e1.length==0&&_dc.urlHash==_f3){_dc=_e9(url,_f2,_f3);return;}else{if(_e1.length>0&&_e1[_e1.length-1].urlHash==_f3){_e1[_e1.length-1]=_e9(url,_f2,_f3);return;}}_e3=true;setTimeout(function(){_d8(_f3);_e3=false;},1);_de.href=_f3;if(dojo.isIE){url=_ee();var _f4=_f2["back"]||_f2["backButton"]||_f2["handle"];var tcb=function(_f5){if(_d7()!=""){setTimeout(function(){_d8(_f3);},1);}_f4.apply(this,[_f5]);};if(_f2["back"]){_f2.back=tcb;}else{if(_f2["backButton"]){_f2.backButton=tcb;}else{if(_f2["handle"]){_f2.handle=tcb;}}}var _f6=_f2["forward"]||_f2["forwardButton"]||_f2["handle"];var tfw=function(_f7){if(_d7()!=""){_d8(_f3);}if(_f6){_f6.apply(this,[_f7]);}};if(_f2["forward"]){_f2.forward=tfw;}else{if(_f2["forwardButton"]){_f2.forwardButton=tfw;}else{if(_f2["handle"]){_f2.handle=tfw;}}}}else{if(!dojo.isIE){if(!_dd){_dd=setInterval(_ef,200);}}}}else{url=_ee();}_e1.push(_e9(url,_f2,_f3));};_d6._iframeLoaded=function(evt,_f8){var _f9=_ec(_f8.href);if(_f9==null){if(_e1.length==1){_e4();}return;}if(_e2){_e2=false;return;}if(_e1.length>=2&&_f9==_ec(_e1[_e1.length-2].url)){_e4();}else{if(_e0.length>0&&_f9==_ec(_e0[_e0.length-1].url)){_e7();}}};})();}

