dojo.provide("custom.layers.dojo2");dojo.kwCompoundRequire({common:["dojo.html.common","dojo.html.style"]});dojo.provide("dojo.html.*");dojo.provide("dojo.widget.html.stabile");dojo.widget.html.stabile={_sqQuotables:new RegExp("([\\\\'])","g"),_depth:0,_recur:false,depthLimit:2};dojo.widget.html.stabile.getState=function(A){dojo.widget.html.stabile.setup();return dojo.widget.html.stabile.widgetState[A]};dojo.widget.html.stabile.setState=function(C,B,A){dojo.widget.html.stabile.setup();dojo.widget.html.stabile.widgetState[C]=B;if(A){dojo.widget.html.stabile.commit(dojo.widget.html.stabile.widgetState)}};dojo.widget.html.stabile.setup=function(){if(!dojo.widget.html.stabile.widgetState){var A=dojo.widget.html.stabile._getStorage().value;dojo.widget.html.stabile.widgetState=A?dj_eval("("+A+")"):{}}};dojo.widget.html.stabile.commit=function(A){dojo.widget.html.stabile._getStorage().value=dojo.widget.html.stabile.description(A)};dojo.widget.html.stabile.description=function(K,F){var D=dojo.widget.html.stabile._depth;var I=function(){return this.description(this,true)};try{if(K===void (0)){return"undefined"}if(K===null){return"null"}if(typeof (K)=="boolean"||typeof (K)=="number"||K instanceof Boolean||K instanceof Number){return K.toString()}if(typeof (K)=="string"||K instanceof String){var J=K.replace(dojo.widget.html.stabile._sqQuotables,"\\$1");J=J.replace(/\n/g,"\\n");J=J.replace(/\r/g,"\\r");return"'"+J+"'"}if(K instanceof Date){return"new Date("+H.getFullYear+","+H.getMonth()+","+H.getDate()+")"}var H;if(K instanceof Array||K.push){if(D>=dojo.widget.html.stabile.depthLimit){return"[ ... ]"}H="[";var G=true;dojo.widget.html.stabile._depth++;for(var B=0;B<K.length;B++){if(G){G=false}else{H+=","}H+=arguments.callee(K[B],F)}return H+"]"}if(K.constructor==Object||K.toString==I){if(D>=dojo.widget.html.stabile.depthLimit){return"{ ... }"}if(typeof (K.hasOwnProperty)!="function"&&K.prototype){throw new Error("description: "+K+" not supported by script engine")}var G=true;H="{";dojo.widget.html.stabile._depth++;for(var E in K){if(K[E]==void (0)||typeof (K[E])=="function"){continue}if(G){G=false}else{H+=", "}var A=E;if(!A.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/)){A=arguments.callee(E,F)}H+=A+": "+arguments.callee(K[E],F)}return H+"}"}if(F){if(dojo.widget.html.stabile._recur){var C=Object.prototype.toString;return C.apply(K,[])}else{dojo.widget.html.stabile._recur=true;return K.toString()}}else{throw new Error("Unknown type: "+K);return"'unknown'"}}finally{dojo.widget.html.stabile._depth=D}};dojo.widget.html.stabile._getStorage=function(){if(dojo.widget.html.stabile.dataField){return dojo.widget.html.stabile.dataField}var A=document.forms._dojo_form;return dojo.widget.html.stabile.dataField=A?A.stabile:{value:""}};dojo.provide("dojo.widget.PopupContainer");dojo.require("dojo.html.style");dojo.require("dojo.html.layout");dojo.require("dojo.html.selection");dojo.require("dojo.html.iframe");dojo.require("dojo.event.*");dojo.require("dojo.widget.*");dojo.require("dojo.widget.HtmlWidget");dojo.declare("dojo.widget.PopupContainerBase",null,function(){this.queueOnAnimationFinish=[]},{isShowingNow:false,currentSubpopup:null,beginZIndex:1000,parentPopup:null,parent:null,popupIndex:0,aroundBox:dojo.html.boxSizing.BORDER_BOX,openedForWindow:null,processKey:function(A){return false},applyPopupBasicStyle:function(){with(this.domNode.style){display="none";position="absolute"}},aboutToShow:function(){},open:function(x,y,_16,_17,_18,_19){if(this.isShowingNow){return }if(this.animationInProgress){this.queueOnAnimationFinish.push(this.open,arguments);return }this.aboutToShow();var _1a=false,_1b,_1c;if(typeof x=="object"){_1b=x;_1c=_17;_17=_16;_16=y;_1a=true}this.parent=_16;dojo.body().appendChild(this.domNode);_17=_17||_16.domNode||[];var _1d=null;this.isTopLevel=true;while(_16){if(_16!==this&&(_16.setOpenedSubpopup!=undefined&&_16.applyPopupBasicStyle!=undefined)){_1d=_16;this.isTopLevel=false;_1d.setOpenedSubpopup(this);break}_16=_16.parent}this.parentPopup=_1d;this.popupIndex=_1d?_1d.popupIndex+1:1;if(this.isTopLevel){var _1e=dojo.html.isNode(_17)?_17:null;dojo.widget.PopupManager.opened(this,_1e)}if(this.isTopLevel&&!dojo.withGlobal(this.openedForWindow||dojo.global(),dojo.html.selection.isCollapsed)){this._bookmark=dojo.withGlobal(this.openedForWindow||dojo.global(),dojo.html.selection.getBookmark)}else{this._bookmark=null}if(_17 instanceof Array){_17={left:_17[0],top:_17[1],width:0,height:0}}with(this.domNode.style){display="";zIndex=this.beginZIndex+this.popupIndex}if(_1a){this.move(_1b,_19,_1c)}else{this.move(x,y,_19,_18)}this.domNode.style.display="none";this.explodeSrc=_17;this.show();this.isShowingNow=true},move:function(B,G,A,F){var E=(typeof B=="object");if(E){var D=A;var C=B;A=G;if(!D){D={BL:"TL",TL:"BL"}}dojo.html.placeOnScreenAroundElement(this.domNode,C,A,this.aroundBox,D)}else{if(!F){F="TL,TR,BL,BR"}dojo.html.placeOnScreen(this.domNode,B,G,A,true,F)}},close:function(A){if(A){this.domNode.style.display="none"}if(this.animationInProgress){this.queueOnAnimationFinish.push(this.close,[]);return }this.closeSubpopup(A);this.hide();if(this.bgIframe){this.bgIframe.hide();this.bgIframe.size({left:0,top:0,width:0,height:0})}if(this.isTopLevel){dojo.widget.PopupManager.closed(this)}this.isShowingNow=false;if(this.parent){setTimeout(dojo.lang.hitch(this,function(){try{if(this.parent.focus){this.parent.focus()}else{this.parent.domNode.focus()}}catch(C){dojo.debug("No idea how to focus to parent",C)}}),10)}if(this._bookmark&&dojo.withGlobal(this.openedForWindow||dojo.global(),dojo.html.selection.isCollapsed)){if(this.openedForWindow){this.openedForWindow.focus()}try{dojo.withGlobal(this.openedForWindow||dojo.global(),"moveToBookmark",dojo.html.selection,[this._bookmark])}catch(B){}}this._bookmark=null},closeAll:function(A){if(this.parentPopup){this.parentPopup.closeAll(A)}else{this.close(A)}},setOpenedSubpopup:function(A){this.currentSubpopup=A},closeSubpopup:function(A){if(this.currentSubpopup==null){return }this.currentSubpopup.close(A);this.currentSubpopup=null},onShow:function(){dojo.widget.PopupContainer.superclass.onShow.apply(this,arguments);this.openedSize={w:this.domNode.style.width,h:this.domNode.style.height};if(dojo.render.html.ie){if(!this.bgIframe){this.bgIframe=new dojo.html.BackgroundIframe();this.bgIframe.setZIndex(this.domNode)}this.bgIframe.size(this.domNode);this.bgIframe.show()}this.processQueue()},processQueue:function(){if(!this.queueOnAnimationFinish.length){return }var B=this.queueOnAnimationFinish.shift();var A=this.queueOnAnimationFinish.shift();B.apply(this,A)},onHide:function(){dojo.widget.HtmlWidget.prototype.onHide.call(this);if(this.openedSize){with(this.domNode.style){width=this.openedSize.w;height=this.openedSize.h}}this.processQueue()}});dojo.widget.defineWidget("dojo.widget.PopupContainer",[dojo.widget.HtmlWidget,dojo.widget.PopupContainerBase],{isContainer:true,fillInTemplate:function(){this.applyPopupBasicStyle();dojo.widget.PopupContainer.superclass.fillInTemplate.apply(this,arguments)}});dojo.widget.PopupManager=new function(){this.currentMenu=null;this.currentButton=null;this.currentFocusMenu=null;this.focusNode=null;this.registeredWindows=[];this.registerWin=function(A){if(!A.__PopupManagerRegistered){dojo.event.connect(A.document,"onmousedown",this,"onClick");dojo.event.connect(A,"onscroll",this,"onClick");dojo.event.connect(A.document,"onkey",this,"onKey");A.__PopupManagerRegistered=true;this.registeredWindows.push(A)}};this.registerAllWindows=function(B){if(!B){B=dojo.html.getDocumentWindow(window.top&&window.top.document||window.document)}this.registerWin(B);for(var A=0;A<B.frames.length;A++){try{var D=dojo.html.getDocumentWindow(B.frames[A].document);if(D){this.registerAllWindows(D)}}catch(C){}}};this.unRegisterWin=function(A){if(A.__PopupManagerRegistered){dojo.event.disconnect(A.document,"onmousedown",this,"onClick");dojo.event.disconnect(A,"onscroll",this,"onClick");dojo.event.disconnect(A.document,"onkey",this,"onKey");A.__PopupManagerRegistered=false}};this.unRegisterAllWindows=function(){for(var A=0;A<this.registeredWindows.length;++A){this.unRegisterWin(this.registeredWindows[A])}this.registeredWindows=[]};dojo.addOnLoad(this,"registerAllWindows");dojo.addOnUnload(this,"unRegisterAllWindows");this.closed=function(A){if(this.currentMenu==A){this.currentMenu=null;this.currentButton=null;this.currentFocusMenu=null}};this.opened=function(A,B){if(A==this.currentMenu){return }if(this.currentMenu){this.currentMenu.close()}this.currentMenu=A;this.currentFocusMenu=A;this.currentButton=B};this.setFocusedMenu=function(A){this.currentFocusMenu=A};this.onKey=function(B){if(!B.key){return }if(!this.currentMenu||!this.currentMenu.isShowingNow){return }var A=this.currentFocusMenu;while(A){if(A.processKey(B)){B.preventDefault();B.stopPropagation();break}A=A.parentPopup||A.parentMenu}},this.onClick=function(C){if(!this.currentMenu){return }var B=dojo.html.getScroll().offset;var A=this.currentMenu;while(A){if(dojo.html.overElement(A.domNode,C)||dojo.html.isDescendantOf(C.target,A.domNode)){return }A=A.currentSubpopup}if(this.currentButton&&dojo.html.overElement(this.currentButton,C)){return }this.currentMenu.closeAll(true)}};dojo.provide("dojo.widget.ComboBox");dojo.require("dojo.widget.*");dojo.require("dojo.event.*");dojo.require("dojo.io.*");dojo.require("dojo.string");dojo.declare("dojo.widget.incrementalComboBoxDataProvider",null,function(A){this.searchUrl=A.dataUrl;this._cache={};this._inFlight=false;this._lastRequest=null;this.allowCache=false},{_addToCache:function(B,A){if(this.allowCache){this._cache[B]=A}},startSearch:function(F,E){if(this._inFlight){}var B=encodeURIComponent(F);var D=dojo.string.substituteParams(this.searchUrl,{searchString:B});var C=this;var A=this._lastRequest=dojo.io.bind({url:D,method:"get",mimetype:"text/json",load:function(I,G,H){C._inFlight=false;if(!dojo.lang.isArray(G)){var K=[];for(var J in G){K.push([G[J],J])}G=K}C._addToCache(F,G);if(A==C._lastRequest){E(G)}}});this._inFlight=true}});dojo.declare("dojo.widget.basicComboBoxDataProvider",null,function(F,B){this._data=[];this.searchLimit=30;this.searchType="STARTSTRING";this.caseSensitive=false;if(!dj_undef("dataUrl",F)&&!dojo.string.isBlank(F.dataUrl)){this._getData(F.dataUrl)}else{if((B)&&(B.nodeName.toLowerCase()=="select")){var H=B.getElementsByTagName("option");var C=H.length;var G=[];for(var A=0;A<C;A++){var D=H[A].textContent||H[A].innerText||H[A].innerHTML;var E=[String(D),String(H[A].value)];G.push(E);if(H[A].selected){F.setAllValues(E[0],E[1])}}this.setData(G)}}},{_getData:function(A){dojo.io.bind({url:A,load:dojo.lang.hitch(this,function(F,E,B){if(!dojo.lang.isArray(E)){var C=[];for(var D in E){C.push([E[D],D])}E=C}this.setData(E)}),mimetype:"text/json"})},startSearch:function(A,B){this._performSearch(A,B)},_performSearch:function(H,C){var E=this.searchType;var D=[];if(!this.caseSensitive){H=H.toLowerCase()}for(var B=0;B<this._data.length;B++){if((this.searchLimit>0)&&(D.length>=this.searchLimit)){break}var G=new String((!this.caseSensitive)?this._data[B][0].toLowerCase():this._data[B][0]);if(G.length<H.length){continue}if(E=="STARTSTRING"){if(H==G.substr(0,H.length)){D.push(this._data[B])}}else{if(E=="SUBSTRING"){if(G.indexOf(H)>=0){D.push(this._data[B])}}else{if(E=="STARTWORD"){var A=G.indexOf(H);if(A==0){D.push(this._data[B])}if(A<=0){continue}var F=false;while(A!=-1){if(" ,/(".indexOf(G.charAt(A-1))!=-1){F=true;break}A=G.indexOf(H,A+1)}if(!F){continue}else{D.push(this._data[B])}}}}}C(D)},setData:function(A){this._data=A}});dojo.widget.defineWidget("dojo.widget.ComboBox",dojo.widget.HtmlWidget,{forceValidOption:false,searchType:"stringstart",dataProvider:null,autoComplete:true,searchDelay:100,dataUrl:"",fadeTime:200,maxListLength:8,mode:"local",selectedResult:null,dataProviderClass:"",buttonSrc:dojo.uri.moduleUri("dojo.widget","templates/images/combo_box_arrow.png"),dropdownToggle:"fade",templatePath:dojo.uri.moduleUri("dojo.widget","templates/ComboBox.html"),templateCssPath:dojo.uri.moduleUri("dojo.widget","templates/ComboBox.css"),setValue:function(A){this.comboBoxValue.value=A;if(this.textInputNode.value!=A){this.textInputNode.value=A;dojo.widget.html.stabile.setState(this.widgetId,this.getState(),true);this.onValueChanged(A)}},onValueChanged:function(A){},getValue:function(){return this.comboBoxValue.value},getState:function(){return{value:this.getValue()}},setState:function(A){this.setValue(A.value)},enable:function(){this.disabled=false;this.textInputNode.removeAttribute("disabled")},disable:function(){this.disabled=true;this.textInputNode.setAttribute("disabled",true)},_getCaretPos:function(A){if(dojo.lang.isNumber(A.selectionStart)){return A.selectionStart}else{if(dojo.render.html.ie){var C=document.selection.createRange().duplicate();var B=A.createTextRange();C.move("character",0);B.move("character",0);try{B.setEndPoint("EndToEnd",C);return String(B.text).replace(/\r/g,"").length}catch(D){return 0}}}},_setCaretPos:function(B,A){A=parseInt(A);this._setSelectedRange(B,A,A)},_setSelectedRange:function(_6a,_6b,end){if(!end){end=_6a.value.length}if(_6a.setSelectionRange){_6a.focus();_6a.setSelectionRange(_6b,end)}else{if(_6a.createTextRange){var _6d=_6a.createTextRange();with(_6d){collapse(true);moveEnd("character",end);moveStart("character",_6b);select()}}else{_6a.value=_6a.value;_6a.blur();_6a.focus();var _6e=parseInt(_6a.value.length)-end;var _6f=String.fromCharCode(37);var tcc=_6f.charCodeAt(0);for(var x=0;x<_6e;x++){var te=document.createEvent("KeyEvents");te.initKeyEvent("keypress",true,true,null,false,false,false,false,tcc,tcc);_6a.dispatchEvent(te)}}}},_handleKeyEvents:function(A){if(A.ctrlKey||A.altKey||!A.key){return }this._prev_key_backspace=false;this._prev_key_esc=false;var B=dojo.event.browser.keys;var C=true;switch(A.key){case B.KEY_DOWN_ARROW:if(!this.popupWidget.isShowingNow){this._startSearchFromInput()}this._highlightNextOption();dojo.event.browser.stopEvent(A);return ;case B.KEY_UP_ARROW:this._highlightPrevOption();dojo.event.browser.stopEvent(A);return ;case B.KEY_TAB:if(!this.autoComplete&&this.popupWidget.isShowingNow&&this._highlighted_option){dojo.event.browser.stopEvent(A);this._selectOption({target:this._highlighted_option,noHide:false});this._setSelectedRange(this.textInputNode,this.textInputNode.value.length,null)}else{this._selectOption();return }break;case B.KEY_ENTER:if(this.popupWidget.isShowingNow){dojo.event.browser.stopEvent(A)}if(this.autoComplete){this._selectOption();return }case" ":if(this.popupWidget.isShowingNow&&this._highlighted_option){dojo.event.browser.stopEvent(A);this._selectOption();this._hideResultList();return }break;case B.KEY_ESCAPE:this._hideResultList();this._prev_key_esc=true;return ;case B.KEY_BACKSPACE:this._prev_key_backspace=true;if(!this.textInputNode.value.length){this.setAllValues("","");this._hideResultList();C=false}break;case B.KEY_RIGHT_ARROW:case B.KEY_LEFT_ARROW:C=false;break;default:if(A.charCode==0){C=false}}if(this.searchTimer){clearTimeout(this.searchTimer)}if(C){this._blurOptionNode();this.searchTimer=setTimeout(dojo.lang.hitch(this,this._startSearchFromInput),this.searchDelay)}},compositionEnd:function(A){A.key=A.keyCode;this._handleKeyEvents(A)},onKeyUp:function(A){this.setValue(this.textInputNode.value)},setSelectedValue:function(A){this.comboBoxSelectionValue.value=A},setAllValues:function(A,B){this.setSelectedValue(B);this.setValue(A)},_focusOptionNode:function(A){if(this._highlighted_option!=A){this._blurOptionNode();this._highlighted_option=A;dojo.html.addClass(this._highlighted_option,"dojoComboBoxItemHighlight")}},_blurOptionNode:function(){if(this._highlighted_option){dojo.html.removeClass(this._highlighted_option,"dojoComboBoxItemHighlight");this._highlighted_option=null}},_highlightNextOption:function(){if((!this._highlighted_option)||!this._highlighted_option.parentNode){this._focusOptionNode(this.optionsListNode.firstChild)}else{if(this._highlighted_option.nextSibling){this._focusOptionNode(this._highlighted_option.nextSibling)}}dojo.html.scrollIntoView(this._highlighted_option)},_highlightPrevOption:function(){if(this._highlighted_option&&this._highlighted_option.previousSibling){this._focusOptionNode(this._highlighted_option.previousSibling)}else{this._highlighted_option=null;this._hideResultList();return }dojo.html.scrollIntoView(this._highlighted_option)},_itemMouseOver:function(A){if(A.target===this.optionsListNode){return }this._focusOptionNode(A.target);dojo.html.addClass(this._highlighted_option,"dojoComboBoxItemHighlight")},_itemMouseOut:function(A){if(A.target===this.optionsListNode){return }this._blurOptionNode()},onResize:function(){var B=dojo.html.getContentBox(this.textInputNode);if(B.height<=0){dojo.lang.setTimeout(this,"onResize",100);return }var A={width:B.height,height:B.height};dojo.html.setContentBox(this.downArrowNode,A)},fillInTemplate:function(_80,_81){dojo.html.applyBrowserClass(this.domNode);var _82=this.getFragNodeRef(_81);if(!this.name&&_82.name){this.name=_82.name}this.comboBoxValue.name=this.name;this.comboBoxSelectionValue.name=this.name+"_selected";dojo.html.copyStyle(this.domNode,_82);dojo.html.copyStyle(this.textInputNode,_82);dojo.html.copyStyle(this.downArrowNode,_82);with(this.downArrowNode.style){width="0px";height="0px"}var _83;if(this.dataProviderClass){if(typeof this.dataProviderClass=="string"){_83=dojo.evalObjPath(this.dataProviderClass)}else{_83=this.dataProviderClass}}else{if(this.mode=="remote"){_83=dojo.widget.incrementalComboBoxDataProvider}else{_83=dojo.widget.basicComboBoxDataProvider}}this.dataProvider=new _83(this,this.getFragNodeRef(_81));this.popupWidget=new dojo.widget.createWidget("PopupContainer",{toggle:this.dropdownToggle,toggleDuration:this.toggleDuration});dojo.event.connect(this,"destroy",this.popupWidget,"destroy");this.optionsListNode=this.popupWidget.domNode;this.domNode.appendChild(this.optionsListNode);dojo.html.addClass(this.optionsListNode,"dojoComboBoxOptions");dojo.event.connect(this.optionsListNode,"onclick",this,"_selectOption");dojo.event.connect(this.optionsListNode,"onmouseover",this,"_onMouseOver");dojo.event.connect(this.optionsListNode,"onmouseout",this,"_onMouseOut");dojo.event.connect(this.optionsListNode,"onmouseover",this,"_itemMouseOver");dojo.event.connect(this.optionsListNode,"onmouseout",this,"_itemMouseOut")},_openResultList:function(D){if(this.disabled){return }this._clearResultList();if(!D.length){this._hideResultList()}if((this.autoComplete)&&(D.length)&&(!this._prev_key_backspace)&&(this.textInputNode.value.length>0)){var C=this._getCaretPos(this.textInputNode);if((C+1)>this.textInputNode.value.length){this.textInputNode.value+=D[0][0].substr(C);this._setSelectedRange(this.textInputNode,C,this.textInputNode.value.length)}}var B=true;while(D.length){var A=D.shift();if(A){var E=document.createElement("div");E.appendChild(document.createTextNode(A[0]));E.setAttribute("resultName",A[0]);E.setAttribute("resultValue",A[1]);E.className="dojoComboBoxItem "+((B)?"dojoComboBoxItemEven":"dojoComboBoxItemOdd");B=(!B);this.optionsListNode.appendChild(E)}}this._showResultList()},_onFocusInput:function(){this._hasFocus=true},_onBlurInput:function(){this._hasFocus=false;this._handleBlurTimer(true,500)},_handleBlurTimer:function(A,B){if(this.blurTimer&&(A||B)){clearTimeout(this.blurTimer)}if(B){this.blurTimer=dojo.lang.setTimeout(this,"_checkBlurred",B)}},_onMouseOver:function(A){if(!this._mouseover_list){this._handleBlurTimer(true,0);this._mouseover_list=true}},_onMouseOut:function(A){var B=A.relatedTarget;try{if(!B||B.parentNode!=this.optionsListNode){this._mouseover_list=false;this._handleBlurTimer(true,100);this._tryFocus()}}catch(C){}},_isInputEqualToResult:function(B){var A=this.textInputNode.value;if(!this.dataProvider.caseSensitive){A=A.toLowerCase();B=B.toLowerCase()}return(A==B)},_isValidOption:function(){var B=dojo.html.firstElement(this.optionsListNode);var A=false;while(!A&&B){if(this._isInputEqualToResult(B.getAttribute("resultName"))){A=true}else{B=dojo.html.nextElement(B)}}return A},_checkBlurred:function(){if(!this._hasFocus&&!this._mouseover_list){this._hideResultList();if(!this.textInputNode.value.length){this.setAllValues("","");return }var A=this._isValidOption();if(this.forceValidOption&&!A){this.setAllValues("","");return }if(!A){this.setSelectedValue("")}}},_selectOption:function(A){var B=null;if(!A){A={target:this._highlighted_option}}if(!dojo.html.isDescendantOf(A.target,this.optionsListNode)){if(!this.textInputNode.value.length){return }B=dojo.html.firstElement(this.optionsListNode);if(!B||!this._isInputEqualToResult(B.getAttribute("resultName"))){return }}else{B=A.target}while((B.nodeType!=1)||(!B.getAttribute("resultName"))){B=B.parentNode;if(B===dojo.body()){return false}}this.selectedResult=[B.getAttribute("resultName"),B.getAttribute("resultValue")];this.setAllValues(B.getAttribute("resultName"),B.getAttribute("resultValue"));if(!A.noHide){this._hideResultList();this._setSelectedRange(this.textInputNode,0,null)}this._tryFocus()},_clearResultList:function(){if(this.optionsListNode.innerHTML){this.optionsListNode.innerHTML=""}},_hideResultList:function(){this.popupWidget.close()},_showResultList:function(){var _95=this.optionsListNode.childNodes;if(_95.length){var _96=Math.min(_95.length,this.maxListLength);with(this.optionsListNode.style){display="";if(_96==_95.length){height=""}else{height=_96*dojo.html.getMarginBox(_95[0]).height+"px"}width=(dojo.html.getMarginBox(this.domNode).width-2)+"px"}this.popupWidget.open(this.domNode,this,this.downArrowNode)}else{this._hideResultList()}},handleArrowClick:function(){this._handleBlurTimer(true,0);this._tryFocus();if(this.popupWidget.isShowingNow){this._hideResultList()}else{this._startSearch("")}},_tryFocus:function(){try{this.textInputNode.focus()}catch(A){}},_startSearchFromInput:function(){this._startSearch(this.textInputNode.value)},_startSearch:function(A){this.dataProvider.startSearch(A,dojo.lang.hitch(this,"_openResultList"))},postCreate:function(){this.onResize();dojo.event.connect(this.textInputNode,"onblur",this,"_onBlurInput");dojo.event.connect(this.textInputNode,"onfocus",this,"_onFocusInput");if(this.disabled){this.disable()}var A=dojo.widget.html.stabile.getState(this.widgetId);if(A){this.setState(A)}}});dojo.provide("dojo.widget.Select");dojo.require("dojo.widget.*");dojo.widget.defineWidget("dojo.widget.Select",dojo.widget.ComboBox,{forceValidOption:true,setValue:function(A){this.comboBoxValue.value=A;dojo.widget.html.stabile.setState(this.widgetId,this.getState(),true);this.onValueChanged(A)},setLabel:function(A){this.comboBoxSelectionValue.value=A;if(this.textInputNode.value!=A){this.textInputNode.value=A}},getLabel:function(){return this.comboBoxSelectionValue.value},getState:function(){return{value:this.getValue(),label:this.getLabel()}},onKeyUp:function(A){this.setLabel(this.textInputNode.value)},setState:function(A){this.setValue(A.value);this.setLabel(A.label)},setAllValues:function(B,A){this.setLabel(B);this.setValue(A)}});dojo.provide("dojo.widget.Button");dojo.require("dojo.lang.extras");dojo.require("dojo.html.selection");dojo.require("dojo.widget.*");dojo.widget.defineWidget("dojo.widget.Button",dojo.widget.HtmlWidget,{isContainer:true,caption:"",templatePath:dojo.uri.moduleUri("dojo.widget","templates/ButtonTemplate.html"),templateCssPath:dojo.uri.moduleUri("dojo.widget","templates/ButtonTemplate.css"),width2height:1/3,fillInTemplate:function(){if(this.caption){this.containerNode.appendChild(document.createTextNode(this.caption))}dojo.html.disableSelection(this.containerNode)},postCreate:function(){this._sizeMyself()},_sizeMyself:function(){if(this.domNode.parentNode){var A=document.createElement("span");dojo.html.insertBefore(A,this.domNode)}dojo.body().appendChild(this.domNode);this._sizeMyselfHelper();if(A){dojo.html.insertBefore(this.domNode,A);dojo.html.removeNode(A)}},_sizeMyselfHelper:function(){var B=dojo.html.getMarginBox(this.containerNode);this.height=B.height;this.containerWidth=B.width;var A=this.height*this.width2height;this.containerNode.style.left=A+"px";if(this.disabled){dojo.html.prependClass(this.domNode,"dojoButtonDisabled");this.domNode.removeAttribute("tabIndex");dojo.widget.wai.setAttr(this.domNode,"waiState","disabled",true)}else{dojo.html.removeClass(this.domNode,"dojoButtonDisabled");this.domNode.setAttribute("tabIndex","0");dojo.widget.wai.setAttr(this.domNode,"waiState","disabled",false)}this.domNode.style.height=this.height+"px";this.domNode.style.width=(this.containerWidth+2*A)+"px"},onMouseOver:function(A){if(this.disabled){return }if(!dojo.html.hasClass(this.buttonNode,"dojoButtonHover")){dojo.html.prependClass(this.buttonNode,"dojoButtonHover")}},onMouseDown:function(A){if(this.disabled){return }dojo.html.prependClass(this.buttonNode,"dojoButtonDepressed");dojo.html.removeClass(this.buttonNode,"dojoButtonHover")},onMouseUp:function(A){if(this.disabled){return }dojo.html.prependClass(this.buttonNode,"dojoButtonHover");dojo.html.removeClass(this.buttonNode,"dojoButtonDepressed")},onMouseOut:function(A){if(this.disabled){return }if(A.toElement&&dojo.html.isDescendantOf(A.toElement,this.buttonNode)){return }dojo.html.removeClass(this.buttonNode,"dojoButtonHover");dojo.html.removeClass(this.buttonNode,"dojoButtonDepressed")},onKey:function(B){if(!B.key){return }var A=dojo.widget.getWidgetById(this.menuId);if(B.key==B.KEY_ENTER||B.key==" "){this.onMouseDown(B);this.buttonClick(B);dojo.lang.setTimeout(this,"onMouseUp",75,B);dojo.event.browser.stopEvent(B)}if(A&&A.isShowingNow&&B.key==B.KEY_DOWN_ARROW){dojo.event.disconnect(this.domNode,"onblur",this,"onBlur")}},onFocus:function(A){var B=dojo.widget.getWidgetById(this.menuId);if(B){dojo.event.connectOnce(this.domNode,"onblur",this,"onBlur")}},onBlur:function(B){var A=dojo.widget.getWidgetById(this.menuId);if(!A){return }if(A.close&&A.isShowingNow){A.close()}},buttonClick:function(B){if(!this.disabled){try{this.domNode.focus()}catch(A){}this.onClick(B)}},onClick:function(A){},_setImage:function(A){},_toggleMenu:function(A){var B=dojo.widget.getWidgetById(A);if(!B){return }if(B.open&&!B.isShowingNow){var C=dojo.html.getAbsolutePosition(this.domNode,false);B.open(C.x,C.y+this.height,this);dojo.event.disconnect(this.domNode,"onblur",this,"onBlur")}else{if(B.close&&B.isShowingNow){B.close()}else{B.toggle()}}},setCaption:function(A){this.caption=A;this.containerNode.innerHTML=A;this._sizeMyself()},setDisabled:function(A){this.disabled=A;this._sizeMyself()}});dojo.widget.defineWidget("dojo.widget.DropDownButton",dojo.widget.Button,{menuId:"",downArrow:"templates/images/whiteDownArrow.gif",disabledDownArrow:"templates/images/whiteDownArrow.gif",fillInTemplate:function(){dojo.widget.DropDownButton.superclass.fillInTemplate.apply(this,arguments);this.arrow=document.createElement("img");dojo.html.setClass(this.arrow,"downArrow");dojo.widget.wai.setAttr(this.domNode,"waiState","haspopup",this.menuId)},_sizeMyselfHelper:function(){this.arrow.src=dojo.uri.moduleUri("dojo.widget",this.disabled?this.disabledDownArrow:this.downArrow);this.containerNode.appendChild(this.arrow);dojo.widget.DropDownButton.superclass._sizeMyselfHelper.call(this)},onClick:function(A){this._toggleMenu(this.menuId)}});dojo.widget.defineWidget("dojo.widget.ComboButton",dojo.widget.Button,{menuId:"",templatePath:dojo.uri.moduleUri("dojo.widget","templates/ComboButtonTemplate.html"),splitWidth:2,arrowWidth:5,_sizeMyselfHelper:function(C){var D=dojo.html.getMarginBox(this.containerNode);this.height=D.height;this.containerWidth=D.width;var B=this.height/3;if(this.disabled){dojo.widget.wai.setAttr(this.domNode,"waiState","disabled",true);this.domNode.removeAttribute("tabIndex")}else{dojo.widget.wai.setAttr(this.domNode,"waiState","disabled",false);this.domNode.setAttribute("tabIndex","0")}this.leftImage.height=this.rightImage.height=this.centerImage.height=this.arrowBackgroundImage.height=this.height;this.leftImage.width=B+1;this.centerImage.width=this.containerWidth;this.buttonNode.style.height=this.height+"px";this.buttonNode.style.width=B+this.containerWidth+"px";this._setImage(this.disabled?this.disabledImg:this.inactiveImg);this.arrowBackgroundImage.width=this.arrowWidth;this.rightImage.width=B+1;this.rightPart.style.height=this.height+"px";this.rightPart.style.width=this.arrowWidth+B+"px";this._setImageR(this.disabled?this.disabledImg:this.inactiveImg);this.domNode.style.height=this.height+"px";var A=this.containerWidth+this.splitWidth+this.arrowWidth+2*B;this.domNode.style.width=A+"px"},_setImage:function(A){this.leftImage.src=dojo.uri.moduleUri("dojo.widget",A+"l.gif");this.centerImage.src=dojo.uri.moduleUri("dojo.widget",A+"c.gif")},rightOver:function(A){if(this.disabled){return }dojo.html.prependClass(this.rightPart,"dojoButtonHover");this._setImageR(this.activeImg)},rightDown:function(A){if(this.disabled){return }dojo.html.prependClass(this.rightPart,"dojoButtonDepressed");dojo.html.removeClass(this.rightPart,"dojoButtonHover");this._setImageR(this.pressedImg)},rightUp:function(A){if(this.disabled){return }dojo.html.prependClass(this.rightPart,"dojoButtonHover");dojo.html.removeClass(this.rightPart,"dojoButtonDepressed");this._setImageR(this.activeImg)},rightOut:function(A){if(this.disabled){return }dojo.html.removeClass(this.rightPart,"dojoButtonHover");dojo.html.removeClass(this.rightPart,"dojoButtonDepressed");this._setImageR(this.inactiveImg)},rightClick:function(B){if(this.disabled){return }try{this.domNode.focus()}catch(A){}this._toggleMenu(this.menuId)},_setImageR:function(A){this.arrowBackgroundImage.src=dojo.uri.moduleUri("dojo.widget",A+"c.gif");this.rightImage.src=dojo.uri.moduleUri("dojo.widget",A+"r.gif")},onKey:function(A){if(!A.key){return }var B=dojo.widget.getWidgetById(this.menuId);if(A.key==A.KEY_ENTER||A.key==" "){this.onMouseDown(A);this.buttonClick(A);dojo.lang.setTimeout(this,"onMouseUp",75,A);dojo.event.browser.stopEvent(A)}else{if(A.key==A.KEY_DOWN_ARROW&&A.altKey){this.rightDown(A);this.rightClick(A);dojo.lang.setTimeout(this,"rightUp",75,A);dojo.event.browser.stopEvent(A)}else{if(B&&B.isShowingNow&&A.key==A.KEY_DOWN_ARROW){dojo.event.disconnect(this.domNode,"onblur",this,"onBlur")}}}}});dojo.provide("dojo.widget.Menu2");dojo.declare("dojo.widget.MenuBase",null,function(){this.eventNames={open:""}},{isContainer:true,isMenu:true,eventNaming:"default",templateCssPath:dojo.uri.moduleUri("dojo.widget","templates/Menu2.css"),submenuDelay:500,initialize:function(C,B){if(this.eventNaming=="default"){for(var A in this.eventNames){this.eventNames[A]=this.widgetId+"/"+A}}},_moveToNext:function(A){this._highlightOption(1);return true},_moveToPrevious:function(A){this._highlightOption(-1);return true},_moveToParentMenu:function(A){if(this._highlighted_option&&this.parentMenu){if(A._menu2UpKeyProcessed){return true}else{this._highlighted_option.onUnhover();this.closeSubmenu();A._menu2UpKeyProcessed=true}}return false},_moveToChildMenu:function(A){if(this._highlighted_option&&this._highlighted_option.submenuId){this._highlighted_option._onClick(true);return true}return false},_selectCurrentItem:function(A){if(this._highlighted_option){this._highlighted_option._onClick();return true}return false},processKey:function(A){if(A.ctrlKey||A.altKey||!A.key){return false}var B=false;switch(A.key){case A.KEY_DOWN_ARROW:B=this._moveToNext(A);break;case A.KEY_UP_ARROW:B=this._moveToPrevious(A);break;case A.KEY_RIGHT_ARROW:B=this._moveToChildMenu(A);break;case A.KEY_LEFT_ARROW:B=this._moveToParentMenu(A);break;case" ":case A.KEY_ENTER:if(B=this._selectCurrentItem(A)){break}case A.KEY_ESCAPE:case A.KEY_TAB:this.close(true);B=true;break}return B},_findValidItem:function(B,A){if(A){A=B>0?A.getNextSibling():A.getPreviousSibling()}for(var C=0;C<this.children.length;++C){if(!A){A=B>0?this.children[0]:this.children[this.children.length-1]}if(A.onHover&&A.isShowing()){return A}A=B>0?A.getNextSibling():A.getPreviousSibling()}},_highlightOption:function(C){var B;if((!this._highlighted_option)){B=this._findValidItem(C)}else{B=this._findValidItem(C,this._highlighted_option)}if(B){if(this._highlighted_option){this._highlighted_option.onUnhover()}B.onHover();dojo.html.scrollIntoView(B.domNode);try{var A=dojo.html.getElementsByClass("dojoMenuItem2Label",B.domNode)[0];A.focus()}catch(D){}}},onItemClick:function(A){},closeSubmenu:function(A){if(this.currentSubmenu==null){return }this.currentSubmenu.close(A);this.currentSubmenu=null;this.currentSubmenuTrigger.is_open=false;this.currentSubmenuTrigger._closedSubmenu(A);this.currentSubmenuTrigger=null}});dojo.widget.defineWidget("dojo.widget.PopupMenu2",[dojo.widget.HtmlWidget,dojo.widget.PopupContainerBase,dojo.widget.MenuBase],function(){this.targetNodeIds=[]},{templateString:'<table class="dojoPopupMenu2" border=0 cellspacing=0 cellpadding=0 style="display: none; position: absolute;"><tbody dojoAttachPoint="containerNode"></tbody></table>',submenuOverlap:5,contextMenuForWindow:false,parentMenu:null,postCreate:function(){if(this.contextMenuForWindow){var A=dojo.body();this.bindDomNode(A)}else{if(this.targetNodeIds.length>0){dojo.lang.forEach(this.targetNodeIds,this.bindDomNode,this)}}this._subscribeSubitemsOnOpen()},_subscribeSubitemsOnOpen:function(){var B=this.getChildrenOfType(dojo.widget.MenuItem2);for(var A=0;A<B.length;A++){dojo.event.topic.subscribe(this.eventNames.open,B[A],"menuOpen")}},getTopOpenEvent:function(){var A=this;while(A.parentMenu){A=A.parentMenu}return A.openEvent},bindDomNode:function(A){A=dojo.byId(A);var B=dojo.html.getElementWindow(A);if(dojo.html.isTag(A,"iframe")=="iframe"){B=dojo.html.iframeContentWindow(A);A=dojo.withGlobal(B,dojo.body)}dojo.widget.Menu2.OperaAndKonqFixer.fixNode(A);dojo.event.kwConnect({srcObj:A,srcFunc:"oncontextmenu",targetObj:this,targetFunc:"onOpen",once:true});if(dojo.render.html.moz&&B.document.designMode.toLowerCase()=="on"){dojo.event.browser.addListener(A,"contextmenu",dojo.lang.hitch(this,"onOpen"))}dojo.widget.PopupManager.registerWin(B)},unBindDomNode:function(B){var A=dojo.byId(B);dojo.event.kwDisconnect({srcObj:A,srcFunc:"oncontextmenu",targetObj:this,targetFunc:"onOpen",once:true});dojo.widget.Menu2.OperaAndKonqFixer.cleanNode(A)},_openAsSubmenu:function(C,B,A){if(this.isShowingNow){return }this.parentMenu=C;this.open(B,C,B,A)},close:function(A){if(this.animationInProgress){dojo.widget.PopupContainerBase.prototype.close.call(this,A);return }if(this._highlighted_option){this._highlighted_option.onUnhover()}dojo.widget.PopupContainerBase.prototype.close.call(this,A);this.parentMenu=null},closeAll:function(A){if(this.parentMenu){this.parentMenu.closeAll(A)}else{this.close(A)}},_openSubmenu:function(B,A){B._openAsSubmenu(this,A.arrow,{TR:"TL",TL:"TR"});this.currentSubmenu=B;this.currentSubmenuTrigger=A;this.currentSubmenuTrigger.is_open=true},focus:function(){if(this.currentSubmenuTrigger){if(this.currentSubmenuTrigger.caption){try{this.currentSubmenuTrigger.caption.focus()}catch(A){}}else{try{this.currentSubmenuTrigger.domNode.focus()}catch(A){}}}},onOpen:function(E){this.openEvent=E;if(E.target){this.openedForWindow=dojo.html.getElementWindow(E.target)}else{this.openedForWindow=null}var A=E.pageX,F=E.pageY;var D=dojo.html.getElementWindow(E.target);var C=D._frameElement||D.frameElement;if(C){var B=dojo.html.abs(C,true);A+=B.x-dojo.withGlobal(D,dojo.html.getScroll).left;F+=B.y-dojo.withGlobal(D,dojo.html.getScroll).top}this.open(A,F,null,[A,F]);dojo.event.browser.stopEvent(E)}});dojo.widget.defineWidget("dojo.widget.MenuItem2",dojo.widget.HtmlWidget,function(){this.eventNames={engage:""}},{templateString:'<tr class="dojoMenuItem2" dojoAttachEvent="onMouseOver: onHover; onMouseOut: onUnhover; onClick: _onClick; onKey:onKey;"><td><div class="${this.iconClass}" style="${this.iconStyle}"></div></td><td tabIndex="-1" class="dojoMenuItem2Label" dojoAttachPoint="caption">${this.caption}</td><td class="dojoMenuItem2Accel">${this.accelKey}</td><td><div class="dojoMenuItem2Submenu" style="display:${this.arrowDisplay};" dojoAttachPoint="arrow"></div></td></tr>',is_hovering:false,hover_timer:null,is_open:false,topPosition:0,caption:"Untitled",accelKey:"",iconSrc:"",disabledClass:"dojoMenuItem2Disabled",iconClass:"dojoMenuItem2Icon",submenuId:"",eventNaming:"default",highlightClass:"dojoMenuItem2Hover",postMixInProperties:function(){this.iconStyle="";if(this.iconSrc){if((this.iconSrc.toLowerCase().substring(this.iconSrc.length-4)==".png")&&(dojo.render.html.ie55||dojo.render.html.ie60)){this.iconStyle="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.iconSrc+"', sizingMethod='image')"}else{this.iconStyle="background-image: url("+this.iconSrc+")"}}this.arrowDisplay=this.submenuId?"block":"none";dojo.widget.MenuItem2.superclass.postMixInProperties.apply(this,arguments)},fillInTemplate:function(){dojo.html.disableSelection(this.domNode);if(this.disabled){this.setDisabled(true)}if(this.eventNaming=="default"){for(var A in this.eventNames){this.eventNames[A]=this.widgetId+"/"+A}}},onHover:function(){this.onUnhover();if(this.is_hovering){return }if(this.is_open){return }if(this.parent._highlighted_option){this.parent._highlighted_option.onUnhover()}this.parent.closeSubmenu();this.parent._highlighted_option=this;dojo.widget.PopupManager.setFocusedMenu(this.parent);this._highlightItem();if(this.is_hovering){this._stopSubmenuTimer()}this.is_hovering=true;this._startSubmenuTimer()},onUnhover:function(){if(!this.is_open){this._unhighlightItem()}this.is_hovering=false;this.parent._highlighted_option=null;if(this.parent.parentMenu){dojo.widget.PopupManager.setFocusedMenu(this.parent.parentMenu)}this._stopSubmenuTimer()},_onClick:function(B){var A=false;if(this.disabled){return false}if(this.submenuId){if(!this.is_open){this._stopSubmenuTimer();this._openSubmenu()}A=true}else{this.onUnhover();this.parent.closeAll(true)}this.onClick();dojo.event.topic.publish(this.eventNames.engage,this);if(A&&B){dojo.widget.getWidgetById(this.submenuId)._highlightOption(1)}return },onClick:function(){this.parent.onItemClick(this)},_highlightItem:function(){dojo.html.addClass(this.domNode,this.highlightClass)},_unhighlightItem:function(){dojo.html.removeClass(this.domNode,this.highlightClass)},_startSubmenuTimer:function(){this._stopSubmenuTimer();if(this.disabled){return }var B=this;var A=function(){return function(){B._openSubmenu()}}();this.hover_timer=dojo.lang.setTimeout(A,this.parent.submenuDelay)},_stopSubmenuTimer:function(){if(this.hover_timer){dojo.lang.clearTimeout(this.hover_timer);this.hover_timer=null}},_openSubmenu:function(){if(this.disabled){return }this.parent.closeSubmenu();var A=dojo.widget.getWidgetById(this.submenuId);if(A){this.parent._openSubmenu(A,this)}},_closedSubmenu:function(){this.onUnhover()},setDisabled:function(A){this.disabled=A;if(this.disabled){dojo.html.addClass(this.domNode,this.disabledClass)}else{dojo.html.removeClass(this.domNode,this.disabledClass)}},enable:function(){this.setDisabled(false)},disable:function(){this.setDisabled(true)},menuOpen:function(A){}});dojo.widget.defineWidget("dojo.widget.MenuSeparator2",dojo.widget.HtmlWidget,{templateString:'<tr class="dojoMenuSeparator2"><td colspan=4><div class="dojoMenuSeparator2Top"></div><div class="dojoMenuSeparator2Bottom"></div></td></tr>',postCreate:function(){dojo.html.disableSelection(this.domNode)}});dojo.widget.defineWidget("dojo.widget.MenuBar2",[dojo.widget.HtmlWidget,dojo.widget.MenuBase],{menuOverlap:2,templateString:'<div class="dojoMenuBar2" dojoAttachPoint="containerNode" tabIndex="0"></div>',close:function(A){if(this._highlighted_option){this._highlighted_option.onUnhover()}this.closeSubmenu(A)},closeAll:function(A){this.close(A)},processKey:function(A){if(A.ctrlKey||A.altKey){return false}var B=false;switch(A.key){case A.KEY_DOWN_ARROW:B=this._moveToChildMenu(A);break;case A.KEY_UP_ARROW:B=this._moveToParentMenu(A);break;case A.KEY_RIGHT_ARROW:B=this._moveToNext(A);break;case A.KEY_LEFT_ARROW:B=this._moveToPrevious(A);break;default:B=dojo.widget.MenuBar2.superclass.processKey.apply(this,arguments);break}return B},postCreate:function(){dojo.widget.MenuBar2.superclass.postCreate.apply(this,arguments);this.isShowingNow=true},_openSubmenu:function(B,A){B._openAsSubmenu(this,A.domNode,{BL:"TL",TL:"BL"});this.currentSubmenu=B;this.currentSubmenuTrigger=A;this.currentSubmenuTrigger.is_open=true}});dojo.widget.defineWidget("dojo.widget.MenuBarItem2",dojo.widget.MenuItem2,{templateString:'<span class="dojoMenuItem2" dojoAttachEvent="onMouseOver: onHover; onMouseOut: onUnhover; onClick: _onClick;">${this.caption}</span>'});dojo.widget.Menu2.OperaAndKonqFixer=new function(){var C=true;var B=false;if(!dojo.lang.isFunction(dojo.doc().oncontextmenu)){dojo.doc().oncontextmenu=function(){C=false;B=true}}if(dojo.doc().createEvent){try{var A=dojo.doc().createEvent("MouseEvents");A.initMouseEvent("contextmenu",1,1,dojo.global(),1,0,0,0,0,0,0,0,0,0,null);dojo.doc().dispatchEvent(A)}catch(A){}}else{C=false}if(B){delete dojo.doc().oncontextmenu}this.fixNode=function(D){if(C){if(!dojo.lang.isFunction(D.oncontextmenu)){D.oncontextmenu=function(E){}}if(dojo.render.html.opera){D._menufixer_opera=function(E){if(E.ctrlKey){this.oncontextmenu(E)}};dojo.event.connect(D,"onclick",D,"_menufixer_opera")}else{D._menufixer_konq=function(E){if(E.button==2){E.preventDefault();this.oncontextmenu(E)}};dojo.event.connect(D,"onmousedown",D,"_menufixer_konq")}}};this.cleanNode=function(D){if(C){if(D._menufixer_opera){dojo.event.disconnect(D,"onclick",D,"_menufixer_opera");delete D._menufixer_opera}else{if(D._menufixer_konq){dojo.event.disconnect(D,"onmousedown",D,"_menufixer_konq");delete D._menufixer_konq}}if(D.oncontextmenu){delete D.oncontextmenu}}}};dojo.provide("dojo.lfx.shadow");dojo.require("dojo.lang.common");dojo.require("dojo.uri.Uri");dojo.lfx.shadow=function(A){this.shadowPng=dojo.uri.moduleUri("dojo.html","images/shadow");this.shadowThickness=8;this.shadowOffset=15;this.init(A)};dojo.extend(dojo.lfx.shadow,{init:function(D){this.node=D;this.pieces={};var A=-1*this.shadowThickness;var C=this.shadowOffset;var B=this.shadowOffset+this.shadowThickness;this._makePiece("tl","top",C,"left",A);this._makePiece("l","top",B,"left",A,"scale");this._makePiece("tr","top",C,"left",0);this._makePiece("r","top",B,"left",0,"scale");this._makePiece("bl","top",0,"left",A);this._makePiece("b","top",0,"left",0,"crop");this._makePiece("br","top",0,"left",0)},_makePiece:function(E,B,A,H,G,F){var C;var D=this.shadowPng+E.toUpperCase()+".png";if(dojo.render.html.ie55||dojo.render.html.ie60){C=dojo.doc().createElement("div");C.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+D+"'"+(F?", sizingMethod='"+F+"'":"")+")"}else{C=dojo.doc().createElement("img");C.src=D}C.style.position="absolute";C.style[B]=A+"px";C.style[H]=G+"px";C.style.width=this.shadowThickness+"px";C.style.height=this.shadowThickness+"px";this.pieces[E]=C;this.node.appendChild(C)},size:function(_10c,_10d){var _10e=_10d-(this.shadowOffset+this.shadowThickness+1);if(_10e<0){_10e=0}if(_10d<1){_10d=1}if(_10c<1){_10c=1}with(this.pieces){l.style.height=_10e+"px";r.style.height=_10e+"px";b.style.width=(_10c-1)+"px";bl.style.top=(_10d-1)+"px";b.style.top=(_10d-1)+"px";br.style.top=(_10d-1)+"px";tr.style.left=(_10c-1)+"px";r.style.left=(_10c-1)+"px";br.style.left=(_10c-1)+"px"}}});dojo.provide("dojo.widget.html.layout");dojo.require("dojo.lang.common");dojo.require("dojo.string.extras");dojo.require("dojo.html.style");dojo.require("dojo.html.layout");dojo.widget.html.layout=function(_10f,_110,_111){dojo.html.addClass(_10f,"dojoLayoutContainer");_110=dojo.lang.filter(_110,function(_112,idx){_112.idx=idx;return dojo.lang.inArray(["top","bottom","left","right","client","flood"],_112.layoutAlign)});if(_111&&_111!="none"){var rank=function(_115){switch(_115.layoutAlign){case"flood":return 1;case"left":case"right":return(_111=="left-right")?2:3;case"top":case"bottom":return(_111=="left-right")?3:2;default:return 4}};_110.sort(function(a,b){return(rank(a)-rank(b))||(a.idx-b.idx)})}var f={top:dojo.html.getPixelValue(_10f,"padding-top",true),left:dojo.html.getPixelValue(_10f,"padding-left",true)};dojo.lang.mixin(f,dojo.html.getContentBox(_10f));dojo.lang.forEach(_110,function(_119){var elm=_119.domNode;var pos=_119.layoutAlign;with(elm.style){left=f.left+"px";top=f.top+"px";bottom="auto";right="auto"}dojo.html.addClass(elm,"dojoAlign"+dojo.string.capitalize(pos));if((pos=="top")||(pos=="bottom")){dojo.html.setMarginBox(elm,{width:f.width});var h=dojo.html.getMarginBox(elm).height;f.height-=h;if(pos=="top"){f.top+=h}else{elm.style.top=f.top+f.height+"px"}if(_119.onResized){_119.onResized()}}else{if(pos=="left"||pos=="right"){var w=dojo.html.getMarginBox(elm).width;if(_119.resizeTo){_119.resizeTo(w,f.height)}else{dojo.html.setMarginBox(elm,{width:w,height:f.height})}f.width-=w;if(pos=="left"){f.left+=w}else{elm.style.left=f.left+f.width+"px"}}else{if(pos=="flood"||pos=="client"){if(_119.resizeTo){_119.resizeTo(f.width,f.height)}else{dojo.html.setMarginBox(elm,{width:f.width,height:f.height})}}}}})};dojo.html.insertCssText(".dojoLayoutContainer{ position: relative; display: block; overflow: hidden; }\nbody .dojoAlignTop, body .dojoAlignBottom, body .dojoAlignLeft, body .dojoAlignRight { position: absolute; overflow: hidden; }\nbody .dojoAlignClient { position: absolute }\n.dojoAlignClient { overflow: auto; }\n");dojo.require("dojo.lang.common");dojo.require("dojo.lang.func");dojo.require("dojo.lang.declare");dojo.provide("dojo.dnd.DragAndDrop");dojo.declare("dojo.dnd.DragSource",null,{type:"",onDragEnd:function(A){},onDragStart:function(A){},onSelected:function(A){},unregister:function(){dojo.dnd.dragManager.unregisterDragSource(this)},reregister:function(){dojo.dnd.dragManager.registerDragSource(this)}});dojo.declare("dojo.dnd.DragObject",null,{type:"",register:function(){var A=dojo.dnd.dragManager;if(A.registerDragObject){A.registerDragObject(this)}},onDragStart:function(A){},onDragMove:function(A){},onDragOver:function(A){},onDragOut:function(A){},onDragEnd:function(A){},onDragLeave:dojo.lang.forward("onDragOut"),onDragEnter:dojo.lang.forward("onDragOver"),ondragout:dojo.lang.forward("onDragOut"),ondragover:dojo.lang.forward("onDragOver")});dojo.declare("dojo.dnd.DropTarget",null,{acceptsType:function(A){if(!dojo.lang.inArray(this.acceptedTypes,"*")){if(!dojo.lang.inArray(this.acceptedTypes,A)){return false}}return true},accepts:function(A){if(!dojo.lang.inArray(this.acceptedTypes,"*")){for(var B=0;B<A.length;B++){if(!dojo.lang.inArray(this.acceptedTypes,A[B].type)){return false}}}return true},unregister:function(){dojo.dnd.dragManager.unregisterDropTarget(this)},onDragOver:function(A){},onDragOut:function(A){},onDragMove:function(A){},onDropStart:function(A){},onDrop:function(A){},onDropEnd:function(){}},function(){this.acceptedTypes=[]});dojo.dnd.DragEvent=function(){this.dragSource=null;this.dragObject=null;this.target=null;this.eventStatus="success"};dojo.declare("dojo.dnd.DragManager",null,{selectedSources:[],dragObjects:[],dragSources:[],registerDragSource:function(A){},dropTargets:[],registerDropTarget:function(A){},lastDragTarget:null,currentDragTarget:null,onKeyDown:function(){},onMouseOut:function(){},onMouseMove:function(){},onMouseUp:function(){}});dojo.provide("dojo.dnd.HtmlDragManager");dojo.require("dojo.event.*");dojo.require("dojo.lang.array");dojo.require("dojo.html.common");dojo.require("dojo.html.layout");dojo.declare("dojo.dnd.HtmlDragManager",dojo.dnd.DragManager,{disabled:false,nestedTargets:false,mouseDownTimer:null,dsCounter:0,dsPrefix:"dojoDragSource",dropTargetDimensions:[],currentDropTarget:null,previousDropTarget:null,_dragTriggered:false,selectedSources:[],dragObjects:[],dragSources:[],dropTargets:[],currentX:null,currentY:null,lastX:null,lastY:null,mouseDownX:null,mouseDownY:null,threshold:7,dropAcceptable:false,cancelEvent:function(A){A.stopPropagation();A.preventDefault()},registerDragSource:function(A){if(A.domNode){var C=this.dsPrefix;var B=C+"Idx_"+(this.dsCounter++);A.dragSourceId=B;this.dragSources[B]=A;A.domNode.setAttribute(C,B);if(dojo.render.html.ie){dojo.event.browser.addListener(A.domNode,"ondragstart",this.cancelEvent)}}},unregisterDragSource:function(B){if(B.domNode){var C=this.dsPrefix;var A=B.dragSourceId;delete B.dragSourceId;delete this.dragSources[A];B.domNode.setAttribute(C,null);if(dojo.render.html.ie){dojo.event.browser.removeListener(B.domNode,"ondragstart",this.cancelEvent)}}},registerDropTarget:function(A){this.dropTargets.push(A)},unregisterDropTarget:function(A){var B=dojo.lang.find(this.dropTargets,A,true);if(B>=0){this.dropTargets.splice(B,1)}},getDragSource:function(C){var A=C.target;if(A===dojo.body()){return }var B=dojo.html.getAttribute(A,this.dsPrefix);while((!B)&&(A)){A=A.parentNode;if((!A)||(A===dojo.body())){return }B=dojo.html.getAttribute(A,this.dsPrefix)}return this.dragSources[B]},onKeyDown:function(A){},onMouseDown:function(C){if(this.disabled){return }if(dojo.render.html.ie){if(C.button!=1){return }}else{if(C.which!=1){return }}var A=C.target.nodeType==dojo.html.TEXT_NODE?C.target.parentNode:C.target;if(dojo.html.isTag(A,"button","textarea","input","select","option")){return }var B=this.getDragSource(C);if(!B){return }if(!dojo.lang.inArray(this.selectedSources,B)){this.selectedSources.push(B);B.onSelected()}this.mouseDownX=C.pageX;this.mouseDownY=C.pageY;C.preventDefault();dojo.event.connect(document,"onmousemove",this,"onMouseMove")},onMouseUp:function(B,A){if(this.selectedSources.length==0){return }this.mouseDownX=null;this.mouseDownY=null;this._dragTriggered=false;B.dragSource=this.dragSource;if((!B.shiftKey)&&(!B.ctrlKey)){if(this.currentDropTarget){this.currentDropTarget.onDropStart()}dojo.lang.forEach(this.dragObjects,function(E){var C=null;if(!E){return }if(this.currentDropTarget){B.dragObject=E;var D=this.currentDropTarget.domNode.childNodes;if(D.length>0){B.dropTarget=D[0];while(B.dropTarget==E.domNode){B.dropTarget=B.dropTarget.nextSibling}}else{B.dropTarget=this.currentDropTarget.domNode}if(this.dropAcceptable){C=this.currentDropTarget.onDrop(B)}else{this.currentDropTarget.onDragOut(B)}}B.dragStatus=this.dropAcceptable&&C?"dropSuccess":"dropFailure";dojo.lang.delayThese([function(){try{E.dragSource.onDragEnd(B)}catch(G){var H={};for(var F in B){if(F=="type"){H.type="mouseup";continue}H[F]=B[F]}E.dragSource.onDragEnd(H)}},function(){E.onDragEnd(B)}])},this);this.selectedSources=[];this.dragObjects=[];this.dragSource=null;if(this.currentDropTarget){this.currentDropTarget.onDropEnd()}}else{}dojo.event.disconnect(document,"onmousemove",this,"onMouseMove");this.currentDropTarget=null},onScroll:function(){for(var A=0;A<this.dragObjects.length;A++){if(this.dragObjects[A].updateDragOffset){this.dragObjects[A].updateDragOffset()}}if(this.dragObjects.length){this.cacheTargetLocations()}},_dragStartDistance:function(B,F){if((!this.mouseDownX)||(!this.mouseDownX)){return }var D=Math.abs(B-this.mouseDownX);var E=D*D;var C=Math.abs(F-this.mouseDownY);var A=C*C;return parseInt(Math.sqrt(E+A),10)},cacheTargetLocations:function(){dojo.profile.start("cacheTargetLocations");this.dropTargetDimensions=[];dojo.lang.forEach(this.dropTargets,function(C){var B=C.domNode;if(!B||!C.accepts([this.dragSource])){return }var A=dojo.html.getAbsolutePosition(B,true);var D=dojo.html.getBorderBox(B);this.dropTargetDimensions.push([[A.x,A.y],[A.x+D.width,A.y+D.height],C])},this);dojo.profile.end("cacheTargetLocations")},onMouseMove:function(D){if((dojo.render.html.ie)&&(D.button!=1)){this.currentDropTarget=null;this.onMouseUp(D,true);return }if((this.selectedSources.length)&&(!this.dragObjects.length)){var B;var A;if(!this._dragTriggered){this._dragTriggered=(this._dragStartDistance(D.pageX,D.pageY)>this.threshold);if(!this._dragTriggered){return }B=D.pageX-this.mouseDownX;A=D.pageY-this.mouseDownY}this.dragSource=this.selectedSources[0];dojo.lang.forEach(this.selectedSources,function(H){if(!H){return }var G=H.onDragStart(D);if(G){G.onDragStart(D);G.dragOffset.y+=A;G.dragOffset.x+=B;G.dragSource=H;this.dragObjects.push(G)}},this);this.previousDropTarget=null;this.cacheTargetLocations()}dojo.lang.forEach(this.dragObjects,function(G){if(G){G.onDragMove(D)}});if(this.currentDropTarget){var F=dojo.html.toCoordinateObject(this.currentDropTarget.domNode,true);var C=[[F.x,F.y],[F.x+F.width,F.y+F.height]]}if((!this.nestedTargets)&&(C)&&(this.isInsideBox(D,C))){if(this.dropAcceptable){this.currentDropTarget.onDragMove(D,this.dragObjects)}}else{var E=this.findBestTarget(D);if(E.target===null){if(this.currentDropTarget){this.currentDropTarget.onDragOut(D);this.previousDropTarget=this.currentDropTarget;this.currentDropTarget=null}this.dropAcceptable=false;return }if(this.currentDropTarget!==E.target){if(this.currentDropTarget){this.previousDropTarget=this.currentDropTarget;this.currentDropTarget.onDragOut(D)}this.currentDropTarget=E.target;D.dragObjects=this.dragObjects;this.dropAcceptable=this.currentDropTarget.onDragOver(D)}else{if(this.dropAcceptable){this.currentDropTarget.onDragMove(D,this.dragObjects)}}}},findBestTarget:function(C){var B=this;var A=new Object();A.target=null;A.points=null;dojo.lang.every(this.dropTargetDimensions,function(D){if(!B.isInsideBox(C,D)){return true}A.target=D[2];A.points=D;return Boolean(B.nestedTargets)});return A},isInsideBox:function(B,A){if((B.pageX>A[0][0])&&(B.pageX<A[1][0])&&(B.pageY>A[0][1])&&(B.pageY<A[1][1])){return true}return false},onMouseOver:function(A){},onMouseOut:function(A){}});dojo.dnd.dragManager=new dojo.dnd.HtmlDragManager();(function(){var B=document;var A=dojo.dnd.dragManager;dojo.event.connect(B,"onkeydown",A,"onKeyDown");dojo.event.connect(B,"onmouseover",A,"onMouseOver");dojo.event.connect(B,"onmouseout",A,"onMouseOut");dojo.event.connect(B,"onmousedown",A,"onMouseDown");dojo.event.connect(B,"onmouseup",A,"onMouseUp");dojo.event.connect(window,"onscroll",A,"onScroll")})();dojo.provide("dojo.dnd.HtmlDragAndDrop");dojo.require("dojo.html.display");dojo.require("dojo.html.util");dojo.require("dojo.html.selection");dojo.require("dojo.html.iframe");dojo.require("dojo.lang.extras");dojo.require("dojo.lfx.*");dojo.require("dojo.event.*");dojo.declare("dojo.dnd.HtmlDragSource",dojo.dnd.DragSource,{dragClass:"",onDragStart:function(){var A=new dojo.dnd.HtmlDragObject(this.dragObject,this.type);if(this.dragClass){A.dragClass=this.dragClass}if(this.constrainToContainer){A.constrainTo(this.constrainingContainer||this.domNode.parentNode)}return A},setDragHandle:function(A){A=dojo.byId(A);dojo.dnd.dragManager.unregisterDragSource(this);this.domNode=A;dojo.dnd.dragManager.registerDragSource(this)},setDragTarget:function(A){this.dragObject=A},constrainTo:function(A){this.constrainToContainer=true;if(A){this.constrainingContainer=A}},onSelected:function(){for(var A=0;A<this.dragObjects.length;A++){dojo.dnd.dragManager.selectedSources.push(new dojo.dnd.HtmlDragSource(this.dragObjects[A]))}},addDragObjects:function(B){for(var A=0;A<arguments.length;A++){this.dragObjects.push(dojo.byId(arguments[A]))}}},function(B,A){B=dojo.byId(B);this.dragObjects=[];this.constrainToContainer=false;if(B){this.domNode=B;this.dragObject=B;this.type=(A)||(this.domNode.nodeName.toLowerCase());dojo.dnd.DragSource.prototype.reregister.call(this)}});dojo.declare("dojo.dnd.HtmlDragObject",dojo.dnd.DragObject,{dragClass:"",opacity:0.5,createIframe:true,disableX:false,disableY:false,createDragNode:function(){var node=this.domNode.cloneNode(true);if(this.dragClass){dojo.html.addClass(node,this.dragClass)}if(this.opacity<1){dojo.html.setOpacity(node,this.opacity)}var ltn=node.tagName.toLowerCase();var isTr=(ltn=="tr");if((isTr)||(ltn=="tbody")){var doc=this.domNode.ownerDocument;var _174=doc.createElement("table");if(isTr){var _175=doc.createElement("tbody");_174.appendChild(_175);_175.appendChild(node)}else{_174.appendChild(node)}var _176=((isTr)?this.domNode:this.domNode.firstChild);var _177=((isTr)?node:node.firstChild);var _178=_176.childNodes;var _179=_177.childNodes;for(var i=0;i<_178.length;i++){if((_179[i])&&(_179[i].style)){_179[i].style.width=dojo.html.getContentBox(_178[i]).width+"px"}}node=_174}if((dojo.render.html.ie55||dojo.render.html.ie60)&&this.createIframe){with(node.style){top="0px";left="0px"}var _17b=document.createElement("div");_17b.appendChild(node);this.bgIframe=new dojo.html.BackgroundIframe(_17b);_17b.appendChild(this.bgIframe.iframe);node=_17b}node.style.zIndex=999;return node},onDragStart:function(e){dojo.html.clearSelection();this.scrollOffset=dojo.html.getScroll().offset;this.dragStartPosition=dojo.html.getAbsolutePosition(this.domNode,true);this.dragOffset={y:this.dragStartPosition.y-e.pageY,x:this.dragStartPosition.x-e.pageX};this.dragClone=this.createDragNode();this.containingBlockPosition=this.domNode.offsetParent?dojo.html.getAbsolutePosition(this.domNode.offsetParent,true):{x:0,y:0};if(this.constrainToContainer){this.constraints=this.getConstraints()}with(this.dragClone.style){position="absolute";top=this.dragOffset.y+e.pageY+"px";left=this.dragOffset.x+e.pageX+"px"}dojo.body().appendChild(this.dragClone);dojo.event.topic.publish("dragStart",{source:this})},getConstraints:function(){if(this.constrainingContainer.nodeName.toLowerCase()=="body"){var D=dojo.html.getViewport();var C=D.width;var H=D.height;var B=dojo.html.getScroll().offset;var A=B.x;var G=B.y}else{var E=dojo.html.getContentBox(this.constrainingContainer);C=E.width;H=E.height;A=this.containingBlockPosition.x+dojo.html.getPixelValue(this.constrainingContainer,"padding-left",true)+dojo.html.getBorderExtent(this.constrainingContainer,"left");G=this.containingBlockPosition.y+dojo.html.getPixelValue(this.constrainingContainer,"padding-top",true)+dojo.html.getBorderExtent(this.constrainingContainer,"top")}var F=dojo.html.getMarginBox(this.domNode);return{minX:A,minY:G,maxX:A+C-F.width,maxY:G+H-F.height}},updateDragOffset:function(){var A=dojo.html.getScroll().offset;if(A.y!=this.scrollOffset.y){var B=A.y-this.scrollOffset.y;this.dragOffset.y+=B;this.scrollOffset.y=A.y}if(A.x!=this.scrollOffset.x){var B=A.x-this.scrollOffset.x;this.dragOffset.x+=B;this.scrollOffset.x=A.x}},onDragMove:function(B){this.updateDragOffset();var A=this.dragOffset.x+B.pageX;var C=this.dragOffset.y+B.pageY;if(this.constrainToContainer){if(A<this.constraints.minX){A=this.constraints.minX}if(C<this.constraints.minY){C=this.constraints.minY}if(A>this.constraints.maxX){A=this.constraints.maxX}if(C>this.constraints.maxY){C=this.constraints.maxY}}this.setAbsolutePosition(A,C);dojo.event.topic.publish("dragMove",{source:this})},setAbsolutePosition:function(A,B){if(!this.disableY){this.dragClone.style.top=B+"px"}if(!this.disableX){this.dragClone.style.left=A+"px"}},onDragEnd:function(E){switch(E.dragStatus){case"dropSuccess":dojo.html.removeNode(this.dragClone);this.dragClone=null;break;case"dropFailure":var C=dojo.html.getAbsolutePosition(this.dragClone,true);var B={left:this.dragStartPosition.x+1,top:this.dragStartPosition.y+1};var D=dojo.lfx.slideTo(this.dragClone,B,300);var A=this;dojo.event.connect(D,"onEnd",function(F){dojo.html.removeNode(A.dragClone);A.dragClone=null});D.play();break}dojo.event.topic.publish("dragEnd",{source:this})},constrainTo:function(A){this.constrainToContainer=true;if(A){this.constrainingContainer=A}else{this.constrainingContainer=this.domNode.parentNode}}},function(B,A){this.domNode=dojo.byId(B);this.type=A;this.constrainToContainer=false;this.dragSource=null;dojo.dnd.DragObject.prototype.register.call(this)});dojo.declare("dojo.dnd.HtmlDropTarget",dojo.dnd.DropTarget,{vertical:false,onDragOver:function(D){if(!this.accepts(D.dragObjects)){return false}this.childBoxes=[];for(var B=0,C;B<this.domNode.childNodes.length;B++){C=this.domNode.childNodes[B];if(C.nodeType!=dojo.html.ELEMENT_NODE){continue}var E=dojo.html.getAbsolutePosition(C,true);var A=dojo.html.getBorderBox(C);this.childBoxes.push({top:E.y,bottom:E.y+A.height,left:E.x,right:E.x+A.width,height:A.height,width:A.width,node:C})}return true},_getNodeUnderMouse:function(e){for(var i=0,_19c;i<this.childBoxes.length;i++){with(this.childBoxes[i]){if(e.pageX>=left&&e.pageX<=right&&e.pageY>=top&&e.pageY<=bottom){return i}}}return -1},createDropIndicator:function(){this.dropIndicator=document.createElement("div");with(this.dropIndicator.style){position="absolute";zIndex=999;if(this.vertical){borderLeftWidth="1px";borderLeftColor="black";borderLeftStyle="solid";height=dojo.html.getBorderBox(this.domNode).height+"px";top=dojo.html.getAbsolutePosition(this.domNode,true).y+"px"}else{borderTopWidth="1px";borderTopColor="black";borderTopStyle="solid";width=dojo.html.getBorderBox(this.domNode).width+"px";left=dojo.html.getAbsolutePosition(this.domNode,true).x+"px"}}},onDragMove:function(H,F){var E=this._getNodeUnderMouse(H);if(!this.dropIndicator){this.createDropIndicator()}var G=this.vertical?dojo.html.gravity.WEST:dojo.html.gravity.NORTH;var D=false;if(E<0){if(this.childBoxes.length){var C=(dojo.html.gravity(this.childBoxes[0].node,H)&G);if(C){D=true}}else{var C=true}}else{var B=this.childBoxes[E];var C=(dojo.html.gravity(B.node,H)&G);if(B.node===F[0].dragSource.domNode){D=true}else{var A=C?(E>0?this.childBoxes[E-1]:B):(E<this.childBoxes.length-1?this.childBoxes[E+1]:B);if(A.node===F[0].dragSource.domNode){D=true}}}if(D){this.dropIndicator.style.display="none";return }else{this.dropIndicator.style.display=""}this.placeIndicator(H,F,E,C);if(!dojo.html.hasParent(this.dropIndicator)){dojo.body().appendChild(this.dropIndicator)}},placeIndicator:function(D,F,E,C){var B=this.vertical?"left":"top";var A;if(E<0){if(this.childBoxes.length){A=C?this.childBoxes[0]:this.childBoxes[this.childBoxes.length-1]}else{this.dropIndicator.style[B]=dojo.html.getAbsolutePosition(this.domNode,true)[this.vertical?"x":"y"]+"px"}}else{A=this.childBoxes[E]}if(A){this.dropIndicator.style[B]=(C?A[B]:A[this.vertical?"right":"bottom"])+"px";if(this.vertical){this.dropIndicator.style.height=A.height+"px";this.dropIndicator.style.top=A.top+"px"}else{this.dropIndicator.style.width=A.width+"px";this.dropIndicator.style.left=A.left+"px"}}},onDragOut:function(A){if(this.dropIndicator){dojo.html.removeNode(this.dropIndicator);delete this.dropIndicator}},onDrop:function(D){this.onDragOut(D);var A=this._getNodeUnderMouse(D);var C=this.vertical?dojo.html.gravity.WEST:dojo.html.gravity.NORTH;if(A<0){if(this.childBoxes.length){if(dojo.html.gravity(this.childBoxes[0].node,D)&C){return this.insert(D,this.childBoxes[0].node,"before")}else{return this.insert(D,this.childBoxes[this.childBoxes.length-1].node,"after")}}return this.insert(D,this.domNode,"append")}var B=this.childBoxes[A];if(dojo.html.gravity(B.node,D)&C){return this.insert(D,B.node,"before")}else{return this.insert(D,B.node,"after")}},insert:function(D,C,A){var B=D.dragObject.domNode;if(A=="before"){return dojo.html.insertBefore(B,C)}else{if(A=="after"){return dojo.html.insertAfter(B,C)}else{if(A=="append"){C.appendChild(B);return true}}}return false}},function(B,A){if(arguments.length==0){return }this.domNode=dojo.byId(B);dojo.dnd.DropTarget.call(this);if(A&&dojo.lang.isString(A)){A=[A]}this.acceptedTypes=A||[];dojo.dnd.dragManager.registerDropTarget(this)});dojo.kwCompoundRequire({common:["dojo.dnd.DragAndDrop"],browser:["dojo.dnd.HtmlDragAndDrop"],dashboard:["dojo.dnd.HtmlDragAndDrop"]});dojo.provide("dojo.dnd.*");dojo.provide("dojo.dnd.HtmlDragMove");dojo.declare("dojo.dnd.HtmlDragMoveSource",dojo.dnd.HtmlDragSource,{onDragStart:function(){var A=new dojo.dnd.HtmlDragMoveObject(this.dragObject,this.type);if(this.constrainToContainer){A.constrainTo(this.constrainingContainer)}return A},onSelected:function(){for(var A=0;A<this.dragObjects.length;A++){dojo.dnd.dragManager.selectedSources.push(new dojo.dnd.HtmlDragMoveSource(this.dragObjects[A]))}}});dojo.declare("dojo.dnd.HtmlDragMoveObject",dojo.dnd.HtmlDragObject,{onDragStart:function(C){dojo.html.clearSelection();this.dragClone=this.domNode;if(dojo.html.getComputedStyle(this.domNode,"position")!="absolute"){this.domNode.style.position="relative"}var B=parseInt(dojo.html.getComputedStyle(this.domNode,"left"));var A=parseInt(dojo.html.getComputedStyle(this.domNode,"top"));this.dragStartPosition={x:isNaN(B)?0:B,y:isNaN(A)?0:A};this.scrollOffset=dojo.html.getScroll().offset;this.dragOffset={y:this.dragStartPosition.y-C.pageY,x:this.dragStartPosition.x-C.pageX};this.containingBlockPosition={x:0,y:0};if(this.constrainToContainer){this.constraints=this.getConstraints()}dojo.event.connect(this.domNode,"onclick",this,"_squelchOnClick")},onDragEnd:function(A){},setAbsolutePosition:function(A,B){if(!this.disableY){this.domNode.style.top=B+"px"}if(!this.disableX){this.domNode.style.left=A+"px"}},_squelchOnClick:function(A){dojo.event.browser.stopEvent(A);dojo.event.disconnect(this.domNode,"onclick",this,"_squelchOnClick")}});dojo.provide("dojo.widget.ResizeHandle");dojo.require("dojo.widget.*");dojo.require("dojo.html.layout");dojo.require("dojo.event.*");dojo.widget.defineWidget("dojo.widget.ResizeHandle",dojo.widget.HtmlWidget,{targetElmId:"",templateCssPath:dojo.uri.moduleUri("dojo.widget","templates/ResizeHandle.css"),templateString:'<div class="dojoHtmlResizeHandle"><div></div></div>',postCreate:function(){dojo.event.connect(this.domNode,"onmousedown",this,"_beginSizing")},_beginSizing:function(A){if(this._isSizing){return false}this.targetWidget=dojo.widget.byId(this.targetElmId);this.targetDomNode=this.targetWidget?this.targetWidget.domNode:dojo.byId(this.targetElmId);if(!this.targetDomNode){return }this._isSizing=true;this.startPoint={x:A.clientX,y:A.clientY};var B=dojo.html.getMarginBox(this.targetDomNode);this.startSize={w:B.width,h:B.height};dojo.event.kwConnect({srcObj:dojo.body(),srcFunc:"onmousemove",targetObj:this,targetFunc:"_changeSizing",rate:25});dojo.event.connect(dojo.body(),"onmouseup",this,"_endSizing");A.preventDefault()},_changeSizing:function(D){try{if(!D.clientX||!D.clientY){return }}catch(D){return }var B=this.startPoint.x-D.clientX;var A=this.startPoint.y-D.clientY;var F=this.startSize.w-B;var C=this.startSize.h-A;if(this.minSize){var E=dojo.html.getMarginBox(this.targetDomNode);if(F<this.minSize.w){F=E.width}if(C<this.minSize.h){C=E.height}}if(this.targetWidget){this.targetWidget.resizeTo(F,C)}else{dojo.html.setMarginBox(this.targetDomNode,{width:F,height:C})}D.preventDefault()},_endSizing:function(A){dojo.event.disconnect(dojo.body(),"onmousemove",this,"_changeSizing");dojo.event.disconnect(dojo.body(),"onmouseup",this,"_endSizing");this._isSizing=false}});dojo.provide("dojo.widget.FloatingPane");dojo.require("dojo.widget.*");dojo.require("dojo.widget.Manager");dojo.require("dojo.html.layout");dojo.require("dojo.html.iframe");dojo.require("dojo.html.selection");dojo.require("dojo.widget.ContentPane");dojo.require("dojo.widget.Dialog");dojo.declare("dojo.widget.FloatingPaneBase",null,{title:"",iconSrc:"",hasShadow:false,constrainToContainer:false,taskBarId:"",resizable:true,titleBarDisplay:true,windowState:"normal",displayCloseAction:false,displayMinimizeAction:false,displayMaximizeAction:false,_max_taskBarConnectAttempts:5,_taskBarConnectAttempts:0,templatePath:dojo.uri.moduleUri("dojo.widget","templates/FloatingPane.html"),templateCssPath:dojo.uri.moduleUri("dojo.widget","templates/FloatingPane.css"),fillInFloatingPaneTemplate:function(B,D){var C=this.getFragNodeRef(D);dojo.html.copyStyle(this.domNode,C);dojo.body().appendChild(this.domNode);if(!this.isShowing()){this.windowState="minimized"}if(this.iconSrc==""){dojo.html.removeNode(this.titleBarIcon)}else{this.titleBarIcon.src=this.iconSrc.toString()}if(this.titleBarDisplay){this.titleBar.style.display="";dojo.html.disableSelection(this.titleBar);this.titleBarIcon.style.display=(this.iconSrc==""?"none":"");this.minimizeAction.style.display=(this.displayMinimizeAction?"":"none");this.maximizeAction.style.display=(this.displayMaximizeAction&&this.windowState!="maximized"?"":"none");this.restoreAction.style.display=(this.displayMaximizeAction&&this.windowState=="maximized"?"":"none");this.closeAction.style.display=(this.displayCloseAction?"":"none");this.drag=new dojo.dnd.HtmlDragMoveSource(this.domNode);if(this.constrainToContainer){this.drag.constrainTo()}this.drag.setDragHandle(this.titleBar);var A=this;dojo.event.topic.subscribe("dragMove",function(E){if(E.source.domNode==A.domNode){dojo.event.topic.publish("floatingPaneMove",{source:A})}})}if(this.resizable){this.resizeBar.style.display="";this.resizeHandle=dojo.widget.createWidget("ResizeHandle",{targetElmId:this.widgetId,id:this.widgetId+"_resize"});this.resizeBar.appendChild(this.resizeHandle.domNode)}if(this.hasShadow){this.shadow=new dojo.lfx.shadow(this.domNode)}this.bgIframe=new dojo.html.BackgroundIframe(this.domNode);if(this.taskBarId){this._taskBarSetup()}dojo.body().removeChild(this.domNode)},postCreate:function(){if(dojo.hostenv.post_load_){this._setInitialWindowState()}else{dojo.addOnLoad(this,"_setInitialWindowState")}},maximizeWindow:function(B){var C=dojo.html.getMarginBox(this.domNode);this.previous={width:C.width||this.width,height:C.height||this.height,left:this.domNode.style.left,top:this.domNode.style.top,bottom:this.domNode.style.bottom,right:this.domNode.style.right};if(this.domNode.parentNode.style.overflow.toLowerCase()!="hidden"){this.parentPrevious={overflow:this.domNode.parentNode.style.overflow};dojo.debug(this.domNode.parentNode.style.overflow);this.domNode.parentNode.style.overflow="hidden"}this.domNode.style.left=dojo.html.getPixelValue(this.domNode.parentNode,"padding-left",true)+"px";this.domNode.style.top=dojo.html.getPixelValue(this.domNode.parentNode,"padding-top",true)+"px";if((this.domNode.parentNode.nodeName.toLowerCase()=="body")){var E=dojo.html.getViewport();var A=dojo.html.getPadding(dojo.body());this.resizeTo(E.width-A.width,E.height-A.height)}else{var D=dojo.html.getContentBox(this.domNode.parentNode);this.resizeTo(D.width,D.height)}this.maximizeAction.style.display="none";this.restoreAction.style.display="";if(this.resizeHandle){this.resizeHandle.domNode.style.display="none"}this.drag.setDragHandle(null);this.windowState="maximized"},minimizeWindow:function(B){this.hide();for(var A in this.parentPrevious){this.domNode.parentNode.style[A]=this.parentPrevious[A]}this.lastWindowState=this.windowState;this.windowState="minimized"},restoreWindow:function(B){if(this.windowState=="minimized"){this.show();if(this.lastWindowState=="maximized"){this.domNode.parentNode.style.overflow="hidden";this.windowState="maximized"}else{this.windowState="normal"}}else{if(this.windowState=="maximized"){for(var A in this.previous){this.domNode.style[A]=this.previous[A]}for(var A in this.parentPrevious){this.domNode.parentNode.style[A]=this.parentPrevious[A]}this.resizeTo(this.previous.width,this.previous.height);this.previous=null;this.parentPrevious=null;this.restoreAction.style.display="none";this.maximizeAction.style.display=this.displayMaximizeAction?"":"none";if(this.resizeHandle){this.resizeHandle.domNode.style.display=""}this.drag.setDragHandle(this.titleBar);this.windowState="normal"}else{}}},toggleDisplay:function(){if(this.windowState=="minimized"){this.restoreWindow()}else{this.minimizeWindow()}},closeWindow:function(A){dojo.html.removeNode(this.domNode);this.destroy()},onMouseDown:function(A){this.bringToTop()},bringToTop:function(){var D=dojo.widget.manager.getWidgetsByType(this.widgetType);var B=[];for(var A=0;A<D.length;A++){if(this.widgetId!=D[A].widgetId){B.push(D[A])}}B.sort(function(F,E){return F.domNode.style.zIndex-E.domNode.style.zIndex});B.push(this);var C=100;for(A=0;A<B.length;A++){B[A].domNode.style.zIndex=C+A*2}},_setInitialWindowState:function(){if(this.isShowing()){this.width=-1;var A=dojo.html.getMarginBox(this.domNode);this.resizeTo(A.width,A.height)}if(this.windowState=="maximized"){this.maximizeWindow();this.show();return }if(this.windowState=="normal"){this.show();return }if(this.windowState=="minimized"){this.hide();return }this.windowState="minimized"},_taskBarSetup:function(){var A=dojo.widget.getWidgetById(this.taskBarId);if(!A){if(this._taskBarConnectAttempts<this._max_taskBarConnectAttempts){dojo.lang.setTimeout(this,this._taskBarSetup,50);this._taskBarConnectAttempts++}else{dojo.debug("Unable to connect to the taskBar")}return }A.addChild(this)},showFloatingPane:function(){this.bringToTop()},onFloatingPaneShow:function(){var A=dojo.html.getMarginBox(this.domNode);this.resizeTo(A.width,A.height)},resizeTo:function(B,A){dojo.html.setMarginBox(this.domNode,{width:B,height:A});dojo.widget.html.layout(this.domNode,[{domNode:this.titleBar,layoutAlign:"top"},{domNode:this.resizeBar,layoutAlign:"bottom"},{domNode:this.containerNode,layoutAlign:"client"}]);dojo.widget.html.layout(this.containerNode,this.children,"top-bottom");this.bgIframe.onResized();if(this.shadow){this.shadow.size(B,A)}this.onResized()},checkSize:function(){},destroyFloatingPane:function(){if(this.resizeHandle){this.resizeHandle.destroy();this.resizeHandle=null}}});dojo.widget.defineWidget("dojo.widget.FloatingPane",[dojo.widget.ContentPane,dojo.widget.FloatingPaneBase],{fillInTemplate:function(A,B){this.fillInFloatingPaneTemplate(A,B);dojo.widget.FloatingPane.superclass.fillInTemplate.call(this,A,B)},postCreate:function(){dojo.widget.FloatingPaneBase.prototype.postCreate.apply(this,arguments);dojo.widget.FloatingPane.superclass.postCreate.apply(this,arguments)},show:function(){dojo.widget.FloatingPane.superclass.show.apply(this,arguments);this.showFloatingPane()},onShow:function(){dojo.widget.FloatingPane.superclass.onShow.call(this);this.onFloatingPaneShow()},destroy:function(){this.destroyFloatingPane();dojo.widget.FloatingPane.superclass.destroy.apply(this,arguments)}});dojo.widget.defineWidget("dojo.widget.ModalFloatingPane",[dojo.widget.FloatingPane,dojo.widget.ModalDialogBase],{windowState:"minimized",displayCloseAction:true,postCreate:function(){dojo.widget.ModalDialogBase.prototype.postCreate.call(this);dojo.widget.ModalFloatingPane.superclass.postCreate.call(this)},show:function(){this.showModalDialog();dojo.widget.ModalFloatingPane.superclass.show.apply(this,arguments);this.bg.style.zIndex=this.domNode.style.zIndex-1},hide:function(){this.hideModalDialog();dojo.widget.ModalFloatingPane.superclass.hide.apply(this,arguments)},closeWindow:function(){this.hide();dojo.widget.ModalFloatingPane.superclass.closeWindow.apply(this,arguments)}});if(!this["dojo"]){alert('"dojo/__package__.js" is now located at "dojo/dojo.js". Please update your includes accordingly')}dojo.require("dojo.lang.declare");dojo.provide("dojo.widget.TreeWithNode");dojo.declare("dojo.widget.TreeWithNode",null,function(){},{loadStates:{UNCHECKED:"UNCHECKED",LOADING:"LOADING",LOADED:"LOADED"},state:"UNCHECKED",objectId:"",isContainer:true,lockLevel:0,lock:function(){this.lockLevel++},unlock:function(){if(!this.lockLevel){dojo.raise(this.widgetType+" unlock: not locked")}this.lockLevel--},expandLevel:0,loadLevel:0,hasLock:function(){return this.lockLevel>0},isLocked:function(){var A=this;while(true){if(A.lockLevel){return true}if(!A.parent||A.isTree){break}A=A.parent}return false},flushLock:function(){this.lockLevel=0},actionIsDisabled:function(B){var A=false;if(dojo.lang.inArray(this.actionsDisabled,B)){A=true}if(this.isTreeNode){if(!this.tree.allowAddChildToLeaf&&B==this.actions.ADDCHILD&&!this.isFolder){A=true}}return A},actionIsDisabledNow:function(A){return this.actionIsDisabled(A)||this.isLocked()},setChildren:function(D){if(this.isTreeNode&&!this.isFolder){this.setFolder()}else{if(this.isTreeNode){this.state=this.loadStates.LOADED}}var G=this.children.length>0;if(G&&D){this.destroyChildren()}if(D){this.children=D}var F=this.children.length>0;if(this.isTreeNode&&F!=G){this.viewSetHasChildren()}for(var C=0;C<this.children.length;C++){var E=this.children[C];if(!(E instanceof dojo.widget.Widget)){E=this.children[C]=this.tree.createNode(E);var B=true}else{var B=false}if(!E.parent){E.parent=this;if(this.tree!==E.tree){E.updateTree(this.tree)}E.viewAddLayout();this.containerNode.appendChild(E.domNode);var A={child:E,index:C,parent:this,childWidgetCreated:B};delete dojo.widget.manager.topWidgets[E.widgetId];dojo.event.topic.publish(this.tree.eventNames.afterAddChild,A)}if(this.tree.eagerWidgetInstantiation){dojo.lang.forEach(this.children,function(H){H.setChildren()})}}},doAddChild:function(B,A){return this.addChild(B,A,true)},addChild:function(B,A,C){if(dojo.lang.isUndefined(A)){A=this.children.length}if(!B.isTreeNode){dojo.raise("You can only add TreeNode widgets to a "+this.widgetType+" widget!");return }this.children.splice(A,0,B);B.parent=this;B.addedTo(this,A,C);delete dojo.widget.manager.topWidgets[B.widgetId]},onShow:function(){this.animationInProgress=false},onHide:function(){this.animationInProgress=false}});dojo.provide("dojo.widget.TreeNodeV3");dojo.require("dojo.event.*");dojo.require("dojo.io.*");dojo.widget.defineWidget("dojo.widget.TreeNodeV3",[dojo.widget.HtmlWidget,dojo.widget.TreeWithNode],function(){this.actionsDisabled=[];this.object={}},{tryLazyInit:true,actions:{MOVE:"MOVE",DETACH:"DETACH",EDIT:"EDIT",ADDCHILD:"ADDCHILD",SELECT:"SELECT"},labelClass:"",contentClass:"",expandNode:null,labelNode:null,nodeDocType:"",selected:false,getnodeDocType:function(){return this.nodeDocType},cloneProperties:["actionsDisabled","tryLazyInit","nodeDocType","objectId","object","title","isFolder","isExpanded","state"],clone:function(A){var B=new this.constructor();for(var C=0;C<this.cloneProperties.length;C++){var E=this.cloneProperties[C];B[E]=dojo.lang.shallowCopy(this[E],true)}if(this.tree.unsetFolderOnEmpty&&!A&&this.isFolder){B.isFolder=false}B.toggleObj=this.toggleObj;dojo.widget.manager.add(B);B.tree=this.tree;B.buildRendering({},{});B.initialize({},{});if(A&&this.children.length){for(var C=0;C<this.children.length;C++){var D=this.children[C];if(D.clone){B.children.push(D.clone(A))}else{B.children.push(dojo.lang.shallowCopy(D,A))}}B.setChildren()}return B},markProcessing:function(){this.markProcessingSavedClass=dojo.html.getClass(this.expandNode);dojo.html.setClass(this.expandNode,this.tree.classPrefix+"ExpandLoading")},unmarkProcessing:function(){dojo.html.setClass(this.expandNode,this.markProcessingSavedClass)},buildRendering:function(A,C,B){if(A.tree){this.tree=dojo.lang.isString(A.tree)?dojo.widget.manager.getWidgetById(A.tree):A.tree}else{if(B&&B.tree){this.tree=B.tree}}if(!this.tree){dojo.raise("Can't evaluate tree from arguments or parent")}this.domNode=this.tree.nodeTemplate.cloneNode(true);this.expandNode=this.domNode.firstChild;this.contentNode=this.domNode.childNodes[1];this.labelNode=this.contentNode.firstChild;if(this.labelClass){dojo.html.addClass(this.labelNode,this.labelClass)}if(this.contentClass){dojo.html.addClass(this.contentNode,this.contentClass)}this.domNode.widgetId=this.widgetId;this.labelNode.innerHTML=this.title},isTreeNode:true,object:{},title:"",isFolder:null,contentNode:null,expandClass:"",isExpanded:false,containerNode:null,getInfo:function(){var A={widgetId:this.widgetId,objectId:this.objectId,index:this.getParentIndex()};return A},setFolder:function(){this.isFolder=true;this.viewSetExpand();if(!this.containerNode){this.viewAddContainer()}dojo.event.topic.publish(this.tree.eventNames.afterSetFolder,{source:this})},initialize:function(B,D,A){if(B.isFolder){this.isFolder=true}if(this.children.length||this.isFolder){this.setFolder()}else{this.viewSetExpand()}for(var C=0;C<this.actionsDisabled.length;C++){this.actionsDisabled[C]=this.actionsDisabled[C].toUpperCase()}dojo.event.topic.publish(this.tree.eventNames.afterChangeTree,{oldTree:null,newTree:this.tree,node:this})},unsetFolder:function(){this.isFolder=false;this.viewSetExpand();dojo.event.topic.publish(this.tree.eventNames.afterUnsetFolder,{source:this})},insertNode:function(B,A){if(!A){A=0}if(A==0){dojo.html.prependChild(this.domNode,B.containerNode)}else{dojo.html.insertAfter(this.domNode,B.children[A-1].domNode)}},updateTree:function(H){if(this.tree===H){return }var G=this.tree;dojo.lang.forEach(this.getDescendants(),function(I){I.tree=H});if(G.classPrefix!=H.classPrefix){var D=[this.domNode];var F;var C=new RegExp("(^|\\s)"+G.classPrefix,"g");while(F=D.pop()){for(var A=0;A<F.childNodes.length;A++){var E=F.childNodes[A];if(E.nodeDocType!=1){continue}dojo.html.setClass(E,dojo.html.getClass(E).replace(C,"$1"+H.classPrefix));D.push(E)}}}var B={oldTree:G,newTree:H,node:this};dojo.event.topic.publish(this.tree.eventNames.afterChangeTree,B);dojo.event.topic.publish(H.eventNames.afterChangeTree,B)},addedTo:function(E,C,D){if(this.tree!==E.tree){this.updateTree(E.tree)}if(E.isTreeNode){if(!E.isFolder){E.setFolder();E.state=E.loadStates.LOADED}}var B=E.children.length;this.insertNode(E,C);this.viewAddLayout();if(B>1){if(C==0&&E.children[1] instanceof dojo.widget.Widget){E.children[1].viewUpdateLayout()}if(C==B-1&&E.children[B-2] instanceof dojo.widget.Widget){E.children[B-2].viewUpdateLayout()}}else{if(E.isTreeNode){E.viewSetHasChildren()}}if(!D){var A={child:this,index:C,parent:E};dojo.event.topic.publish(this.tree.eventNames.afterAddChild,A)}},createSimple:function(D,C){if(D.tree){var B=D.tree}else{if(C){var B=C.tree}else{dojo.raise("createSimple: can't evaluate tree")}}B=dojo.widget.byId(B);var E=new B.defaultChildWidget();for(var A in D){E[A]=D[A]}E.toggleObj=dojo.lfx.toggle[E.toggle.toLowerCase()]||dojo.lfx.toggle.plain;dojo.widget.manager.add(E);E.buildRendering(D,{},C);E.initialize(D,{},C);if(E.parent){delete dojo.widget.manager.topWidgets[E.widgetId]}return E},viewUpdateLayout:function(){this.viewRemoveLayout();this.viewAddLayout()},viewAddContainer:function(){this.containerNode=this.tree.containerNodeTemplate.cloneNode(true);this.domNode.appendChild(this.containerNode)},viewAddLayout:function(){if(this.parent.isTree){dojo.html.setClass(this.domNode,dojo.html.getClass(this.domNode)+" "+this.tree.classPrefix+"IsRoot")}if(this.isLastChild()){dojo.html.setClass(this.domNode,dojo.html.getClass(this.domNode)+" "+this.tree.classPrefix+"IsLast")}},viewRemoveLayout:function(){dojo.html.removeClass(this.domNode,this.tree.classPrefix+"IsRoot");dojo.html.removeClass(this.domNode,this.tree.classPrefix+"IsLast")},viewGetExpandClass:function(){if(this.isFolder){return this.isExpanded?"ExpandOpen":"ExpandClosed"}else{return"ExpandLeaf"}},viewSetExpand:function(){var B=this.tree.classPrefix+this.viewGetExpandClass();var A=new RegExp("(^|\\s)"+this.tree.classPrefix+"Expand\\w+","g");dojo.html.setClass(this.domNode,dojo.html.getClass(this.domNode).replace(A,"")+" "+B);this.viewSetHasChildrenAndExpand()},viewGetChildrenClass:function(){return"Children"+(this.children.length?"Yes":"No")},viewSetHasChildren:function(){var B=this.tree.classPrefix+this.viewGetChildrenClass();var A=new RegExp("(^|\\s)"+this.tree.classPrefix+"Children\\w+","g");dojo.html.setClass(this.domNode,dojo.html.getClass(this.domNode).replace(A,"")+" "+B);this.viewSetHasChildrenAndExpand()},viewSetHasChildrenAndExpand:function(){var B=this.tree.classPrefix+"State"+this.viewGetChildrenClass()+"-"+this.viewGetExpandClass();var A=new RegExp("(^|\\s)"+this.tree.classPrefix+"State[\\w-]+","g");dojo.html.setClass(this.domNode,dojo.html.getClass(this.domNode).replace(A,"")+" "+B)},viewUnfocus:function(){dojo.html.removeClass(this.labelNode,this.tree.classPrefix+"LabelFocused")},viewFocus:function(){dojo.html.addClass(this.labelNode,this.tree.classPrefix+"LabelFocused")},viewEmphasize:function(){dojo.html.clearSelection(this.labelNode);dojo.html.addClass(this.labelNode,this.tree.classPrefix+"NodeEmphasized")},viewUnemphasize:function(){dojo.html.removeClass(this.labelNode,this.tree.classPrefix+"NodeEmphasized")},detach:function(){if(!this.parent){return }var B=this.parent;var A=this.getParentIndex();this.doDetach.apply(this,arguments);dojo.event.topic.publish(this.tree.eventNames.afterDetach,{child:this,parent:B,index:A})},doDetach:function(){var C=this.parent;if(!C){return }var B=this.getParentIndex();this.viewRemoveLayout();dojo.widget.DomWidget.prototype.removeChild.call(C,this);var A=C.children.length;if(A>0){if(B==0){C.children[0].viewUpdateLayout()}if(B==A){C.children[A-1].viewUpdateLayout()}}else{if(C.isTreeNode){C.viewSetHasChildren()}}if(this.tree.unsetFolderOnEmpty&&!C.children.length&&C.isTreeNode){C.unsetFolder()}this.parent=null},destroy:function(){dojo.event.topic.publish(this.tree.eventNames.beforeNodeDestroy,{source:this});this.detach();return dojo.widget.HtmlWidget.prototype.destroy.apply(this,arguments)},expand:function(){if(this.isExpanded){return }if(this.tryLazyInit){this.setChildren();this.tryLazyInit=false}this.isExpanded=true;this.viewSetExpand();this.showChildren()},collapse:function(){if(!this.isExpanded){return }this.isExpanded=false;this.hideChildren()},hideChildren:function(){this.tree.toggleObj.hide(this.containerNode,this.tree.toggleDuration,this.explodeSrc,dojo.lang.hitch(this,"onHideChildren"))},showChildren:function(){this.tree.toggleObj.show(this.containerNode,this.tree.toggleDuration,this.explodeSrc,dojo.lang.hitch(this,"onShowChildren"))},onShowChildren:function(){this.onShow();dojo.event.topic.publish(this.tree.eventNames.afterExpand,{source:this})},onHideChildren:function(){this.viewSetExpand();this.onHide();dojo.event.topic.publish(this.tree.eventNames.afterCollapse,{source:this})},setTitle:function(B){var A=this.title;this.labelNode.innerHTML=this.title=B;dojo.event.topic.publish(this.tree.eventNames.afterSetTitle,{source:this,oldTitle:A})},toString:function(){return"["+this.widgetType+", "+this.title+"]"}});dojo.provide("dojo.widget.TreeV3");dojo.require("dojo.widget.*");dojo.require("dojo.event.*");dojo.require("dojo.io.*");dojo.require("dojo.widget.HtmlWidget");dojo.widget.defineWidget("dojo.widget.TreeV3",[dojo.widget.HtmlWidget,dojo.widget.TreeWithNode],function(){this.eventNames={};this.DndAcceptTypes=[];this.actionsDisabled=[];this.listeners=[];this.tree=this},{DndMode:"",defaultChildWidget:null,defaultChildTitle:"New Node",eagerWidgetInstantiation:false,eventNamesDefault:{afterTreeCreate:"afterTreeCreate",beforeTreeDestroy:"beforeTreeDestroy",beforeNodeDestroy:"beforeNodeDestroy",afterChangeTree:"afterChangeTree",afterSetFolder:"afterSetFolder",afterUnsetFolder:"afterUnsetFolder",beforeMoveFrom:"beforeMoveFrom",beforeMoveTo:"beforeMoveTo",afterMoveFrom:"afterMoveFrom",afterMoveTo:"afterMoveTo",afterAddChild:"afterAddChild",afterDetach:"afterDetach",afterExpand:"afterExpand",beforeExpand:"beforeExpand",afterSetTitle:"afterSetTitle",afterCollapse:"afterCollapse",beforeCollapse:"beforeCollapse"},classPrefix:"Tree",style:"",allowAddChildToLeaf:true,unsetFolderOnEmpty:true,DndModes:{BETWEEN:1,ONTO:2},DndAcceptTypes:"",templateCssPath:dojo.uri.moduleUri("dojo.widget","templates/TreeV3.css"),templateString:'<div style="${this.style}">\n</div>',isExpanded:true,isTree:true,createNode:function(C){C.tree=this.widgetId;if(C.widgetName){return dojo.widget.createWidget(C.widgetName,C)}else{if(this.defaultChildWidget.prototype.createSimple){return this.defaultChildWidget.prototype.createSimple(C)}else{var B=this.defaultChildWidget.prototype.ns;var A=this.defaultChildWidget.prototype.widgetType;return dojo.widget.createWidget(B+":"+A,C)}}},makeNodeTemplate:function(){var D=document.createElement("div");dojo.html.setClass(D,this.classPrefix+"Node "+this.classPrefix+"ExpandLeaf "+this.classPrefix+"ChildrenNo");this.nodeTemplate=D;var C=document.createElement("div");var B=this.classPrefix+"Expand";if(dojo.render.html.ie){B=B+" "+this.classPrefix+"IEExpand"}dojo.html.setClass(C,B);this.expandNodeTemplate=C;var A=document.createElement("span");dojo.html.setClass(A,this.classPrefix+"Label");this.labelNodeTemplate=A;var E=document.createElement("div");var B=this.classPrefix+"Content";if(dojo.render.html.ie&&!dojo.render.html.ie70){B=B+" "+this.classPrefix+"IEContent"}dojo.html.setClass(E,B);this.contentNodeTemplate=E;D.appendChild(C);D.appendChild(E);E.appendChild(A)},makeContainerNodeTemplate:function(){var A=document.createElement("div");A.style.display="none";dojo.html.setClass(A,this.classPrefix+"Container");this.containerNodeTemplate=A},actions:{ADDCHILD:"ADDCHILD"},getInfo:function(){var A={widgetId:this.widgetId,objectId:this.objectId};return A},adjustEventNames:function(){for(var A in this.eventNamesDefault){if(dojo.lang.isUndefined(this.eventNames[A])){this.eventNames[A]=this.widgetId+"/"+this.eventNamesDefault[A]}}},adjustDndMode:function(){var B=this;var A=0;dojo.lang.forEach(this.DndMode.split(";"),function(C){var D=B.DndModes[dojo.string.trim(C).toUpperCase()];if(D){A=A|D}});this.DndMode=A},destroy:function(){dojo.event.topic.publish(this.tree.eventNames.beforeTreeDestroy,{source:this});return dojo.widget.HtmlWidget.prototype.destroy.apply(this,arguments)},initialize:function(B){this.domNode.widgetId=this.widgetId;for(var C=0;C<this.actionsDisabled.length;C++){this.actionsDisabled[C]=this.actionsDisabled[C].toUpperCase()}if(!B.defaultChildWidget){this.defaultChildWidget=dojo.widget.TreeNodeV3}else{this.defaultChildWidget=dojo.lang.getObjPathValue(B.defaultChildWidget)}this.adjustEventNames();this.adjustDndMode();this.makeNodeTemplate();this.makeContainerNodeTemplate();this.containerNode=this.domNode;dojo.html.setClass(this.domNode,this.classPrefix+"Container");var A=this;dojo.lang.forEach(this.listeners,function(E){var D=dojo.lang.isString(E)?dojo.widget.byId(E):E;D.listenTree(A)})},postCreate:function(){dojo.event.topic.publish(this.eventNames.afterTreeCreate,{source:this})},move:function(E,C,B){if(!E.parent){dojo.raise(this.widgetType+": child can be moved only while it's attached")}var A=E.parent;var I=E.tree;var H=E.getParentIndex();var G=C.tree;var C=C;var F=B;var D={oldParent:A,oldTree:I,oldIndex:H,newParent:C,newTree:G,newIndex:F,child:E};dojo.event.topic.publish(I.eventNames.beforeMoveFrom,D);dojo.event.topic.publish(G.eventNames.beforeMoveTo,D);this.doMove.apply(this,arguments);dojo.event.topic.publish(I.eventNames.afterMoveFrom,D);dojo.event.topic.publish(G.eventNames.afterMoveTo,D)},doMove:function(C,B,A){C.doDetach();B.doAddChild(C,A)},toString:function(){return"["+this.widgetType+" ID:"+this.widgetId+"]"}});dojo.provide("dojo.widget.TreeCommon");dojo.require("dojo.widget.*");dojo.declare("dojo.widget.TreeCommon",null,{listenTreeEvents:[],listenedTrees:{},listenNodeFilter:null,listenTree:function(A){var C=this;if(this.listenedTrees[A.widgetId]){return }dojo.lang.forEach(this.listenTreeEvents,function(E){var D="on"+E.charAt(0).toUpperCase()+E.substr(1);dojo.event.topic.subscribe(A.eventNames[E],C,D)});var B;if(this.listenNodeFilter){this.processDescendants(A,this.listenNodeFilter,this.listenNode,true)}this.listenedTrees[A.widgetId]=true},listenNode:function(){},unlistenNode:function(){},unlistenTree:function(A,C){var B=this;if(!this.listenedTrees[A.widgetId]){return }dojo.lang.forEach(this.listenTreeEvents,function(E){var D="on"+E.charAt(0).toUpperCase()+E.substr(1);dojo.event.topic.unsubscribe(A.eventNames[E],B,D)});if(this.listenNodeFilter){this.processDescendants(A,this.listenNodeFilter,this.unlistenNode,true)}delete this.listenedTrees[A.widgetId]},checkPathCondition:function(A,B){while(A&&!A.widgetId){if(B.call(null,A)){return true}A=A.parentNode}return false},domElement2TreeNode:function(A){while(A&&!A.widgetId){A=A.parentNode}if(!A){return null}var B=dojo.widget.byId(A.widgetId);if(!B.isTreeNode){return null}return B},processDescendants:function(E,F,D,C){var B=this;if(!C){if(!F.call(B,E)){return }D.call(B,E)}var A=[E];while(E=A.pop()){dojo.lang.forEach(E.children,function(G){if(F.call(B,G)){D.call(B,G);A.push(G)}})}}});dojo.provide("dojo.widget.TreeTimeoutIterator");dojo.require("dojo.event.*");dojo.require("dojo.json");dojo.require("dojo.io.*");dojo.declare("dojo.widget.TreeTimeoutIterator",null,function(D,C,B){var A=this;this.currentParent=D;this.callFunc=C;this.callObj=B?B:this;this.stack=[]},{maxStackDepth:Number.POSITIVE_INFINITY,stack:null,currentParent:null,currentIndex:0,filterFunc:function(){return true},finishFunc:function(){return true},setFilter:function(A,B){this.filterFunc=A;this.filterObj=B},setMaxLevel:function(A){this.maxStackDepth=A-2},forward:function(B){var A=this;if(this.timeout){var C=setTimeout(function(){A.processNext();clearTimeout(C)},A.timeout)}else{return this.processNext()}},start:function(A){if(A){return this.callFunc.call(this.callObj,this.currentParent,this)}return this.processNext()},processNext:function(){var E;var D=this;var C;var B;if(this.maxStackDepth==-2){return }while(true){var A=this.currentParent.children;if(A&&A.length){do{B=A[this.currentIndex]}while(this.currentIndex++<A.length&&!(C=this.filterFunc.call(this.filterObj,B)));if(C){if(B.isFolder&&this.stack.length<=this.maxStackDepth){this.moveParent(B,0)}return this.callFunc.call(this.callObj,B,this)}}if(this.stack.length){this.popParent();continue}break}return this.finishFunc.call(this.finishObj)},setFinish:function(A,B){this.finishFunc=A;this.finishObj=B},popParent:function(){var A=this.stack.pop();this.currentParent=A[0];this.currentIndex=A[1]},moveParent:function(B,A){this.stack.push([this.currentParent,this.currentIndex]);this.currentParent=B;this.currentIndex=A}});dojo.provide("dojo.widget.TreeBasicControllerV3");dojo.require("dojo.event.*");dojo.require("dojo.json");dojo.require("dojo.io.*");dojo.widget.defineWidget("dojo.widget.TreeBasicControllerV3",[dojo.widget.HtmlWidget,dojo.widget.TreeCommon],function(){this.listenedTrees={}},{listenTreeEvents:["afterSetFolder","afterTreeCreate","beforeTreeDestroy"],listenNodeFilter:function(A){return A instanceof dojo.widget.Widget},editor:null,initialize:function(A){if(A.editor){this.editor=dojo.widget.byId(A.editor);this.editor.controller=this}},getInfo:function(A){return A.getInfo()},onBeforeTreeDestroy:function(A){this.unlistenTree(A.source)},onAfterSetFolder:function(A){if(A.source.expandLevel>0){this.expandToLevel(A.source,A.source.expandLevel)}if(A.source.loadLevel>0){this.loadToLevel(A.source,A.source.loadLevel)}},_focusNextVisible:function(B){if(B.isFolder&&B.isExpanded&&B.children.length>0){A=B.children[0]}else{while(B.isTreeNode&&B.isLastChild()){B=B.parent}if(B.isTreeNode){var A=B.parent.children[B.getParentIndex()+1]}}if(A&&A.isTreeNode){this._focusLabel(A);return A}},_focusPreviousVisible:function(C){var B=C;if(!C.isFirstChild()){var A=C.parent.children[C.getParentIndex()-1];C=A;while(C.isFolder&&C.isExpanded&&C.children.length>0){B=C;C=C.children[C.children.length-1]}}else{C=C.parent}if(C&&C.isTreeNode){B=C}if(B&&B.isTreeNode){this._focusLabel(B);return B}},_focusZoomIn:function(B){var A=B;if(B.isFolder&&!B.isExpanded){this.expand(B)}else{if(B.children.length>0){B=B.children[0]}}if(B&&B.isTreeNode){A=B}if(A&&A.isTreeNode){this._focusLabel(A);return A}},_focusZoomOut:function(A){var B=A;if(A.isFolder&&A.isExpanded){this.collapse(A)}else{A=A.parent}if(A&&A.isTreeNode){B=A}if(B&&B.isTreeNode){this._focusLabel(B);return B}},onFocusNode:function(B){var A=this.domElement2TreeNode(B.target);if(A){A.viewFocus();dojo.event.browser.stopEvent(B)}},onBlurNode:function(C){var B=this.domElement2TreeNode(C.target);if(!B){return }var A=B.labelNode;A.setAttribute("tabIndex","-1");B.viewUnfocus();dojo.event.browser.stopEvent(C);B.tree.domNode.setAttribute("tabIndex","0")},_focusLabel:function(C){var B=C.tree.lastFocused;var A;if(B&&B.labelNode){A=B.labelNode;dojo.event.disconnect(A,"onblur",this,"onBlurNode");A.setAttribute("tabIndex","-1");dojo.html.removeClass(A,"TreeLabelFocused")}A=C.labelNode;A.setAttribute("tabIndex","0");C.tree.lastFocused=C;dojo.html.addClass(A,"TreeLabelFocused");dojo.event.connectOnce(A,"onblur",this,"onBlurNode");dojo.event.connectOnce(A,"onfocus",this,"onFocusNode");A.focus()},onKey:function(C){if(!C.key||C.ctrkKey||C.altKey){return }var B=this.domElement2TreeNode(C.target);if(!B){return }var A=B.tree;if(A.lastFocused&&A.lastFocused.labelNode){B=A.lastFocused}switch(C.key){case C.KEY_TAB:if(C.shiftKey){A.domNode.setAttribute("tabIndex","-1")}break;case C.KEY_RIGHT_ARROW:this._focusZoomIn(B);dojo.event.browser.stopEvent(C);break;case C.KEY_LEFT_ARROW:this._focusZoomOut(B);dojo.event.browser.stopEvent(C);break;case C.KEY_UP_ARROW:this._focusPreviousVisible(B);dojo.event.browser.stopEvent(C);break;case C.KEY_DOWN_ARROW:this._focusNextVisible(B);dojo.event.browser.stopEvent(C);break}},onFocusTree:function(B){if(!B.currentTarget){return }try{var C=this.getWidgetByNode(B.currentTarget);if(!C||!C.isTree){return }var A=this.getWidgetByNode(C.domNode.firstChild);if(A&&A.isTreeNode){if(C.lastFocused&&C.lastFocused.isTreeNode){A=C.lastFocused}this._focusLabel(A)}}catch(B){}},onAfterTreeCreate:function(B){var A=B.source;dojo.event.browser.addListener(A.domNode,"onKey",dojo.lang.hitch(this,this.onKey));dojo.event.browser.addListener(A.domNode,"onmousedown",dojo.lang.hitch(this,this.onTreeMouseDown));dojo.event.browser.addListener(A.domNode,"onclick",dojo.lang.hitch(this,this.onTreeClick));dojo.event.browser.addListener(A.domNode,"onfocus",dojo.lang.hitch(this,this.onFocusTree));A.domNode.setAttribute("tabIndex","0");if(A.expandLevel){this.expandToLevel(A,A.expandLevel)}if(A.loadLevel){this.loadToLevel(A,A.loadLevel)}},onTreeMouseDown:function(A){},onTreeClick:function(D){var C=D.target;var A=this.domElement2TreeNode(C);if(!A||!A.isTreeNode){return }var B=function(E){return E===A.expandNode};if(this.checkPathCondition(C,B)){this.processExpandClick(A)}this._focusLabel(A)},processExpandClick:function(A){if(A.isExpanded){this.collapse(A)}else{this.expand(A)}},batchExpandTimeout:20,expandAll:function(A){return this.expandToLevel(A,Number.POSITIVE_INFINITY)},collapseAll:function(C){var B=this;var A=function(D){return(D instanceof dojo.widget.Widget)&&D.isFolder&&D.isExpanded};if(C.isTreeNode){this.processDescendants(C,A,this.collapse)}else{if(C.isTree){dojo.lang.forEach(C.children,function(D){B.processDescendants(D,A,B.collapse)})}}},expandToNode:function(B,A){n=A?B:B.parent;s=[];while(!n.isExpanded){s.push(n);n=n.parent}dojo.lang.forEach(s,function(C){C.expand()})},expandToLevel:function(C,A){var F=this;var B=function(H){var G=H.isFolder||H.children&&H.children.length;return G};var E=function(G,H){F.expand(G,true);H.forward()};var D=new dojo.widget.TreeTimeoutIterator(C,E,this);D.setFilter(B);D.timeout=this.batchExpandTimeout;D.setMaxLevel(C.isTreeNode?A-1:A);return D.start(C.isTreeNode)},getWidgetByNode:function(C){var B;var A=C;while(!(B=A.widgetId)){A=A.parentNode;if(A==null){break}}if(B){return dojo.widget.byId(B)}else{if(C==null){return null}else{return dojo.widget.manager.byNode(C)}}},expand:function(A){if(A.isFolder){A.expand()}},collapse:function(A){if(A.isFolder){A.collapse()}},canEditLabel:function(A){if(A.actionIsDisabledNow(A.actions.EDIT)){return false}return true},editLabelStart:function(A){if(!this.canEditLabel(A)){return false}if(!this.editor.isClosed()){this.editLabelFinish(this.editor.saveOnBlur)}this.doEditLabelStart(A)},editLabelFinish:function(A){this.doEditLabelFinish(A)},doEditLabelStart:function(A){if(!this.editor){dojo.raise(this.widgetType+": no editor specified")}this.editor.open(A)},doEditLabelFinish:function(D,B){if(!this.editor){dojo.raise(this.widgetType+": no editor specified")}var C=this.editor.node;var A=this.editor.getContents();this.editor.close(D);if(D){var F={title:A};if(B){dojo.lang.mixin(F,B)}if(C.isPhantom){var H=C.parent;var G=C.getParentIndex();C.destroy();dojo.widget.TreeBasicControllerV3.prototype.doCreateChild.call(this,H,G,F)}else{var E=B&&B.title?B.title:A;C.setTitle(E)}}else{if(C.isPhantom){C.destroy()}}},makeDefaultNode:function(B,A){var C={title:B.tree.defaultChildTitle};return dojo.widget.TreeBasicControllerV3.prototype.doCreateChild.call(this,B,A,C)},runStages:function(G,F,A,E,D,B){if(G&&!G.apply(this,B)){return false}if(F&&!F.apply(this,B)){return false}var C=A.apply(this,B);if(E){E.apply(this,B)}if(!C){return C}if(D){D.apply(this,B)}return C}});dojo.lang.extend(dojo.widget.TreeBasicControllerV3,{createAndEdit:function(C,B){var D={title:C.tree.defaultChildTitle};if(!this.canCreateChild(C,B,D)){return false}var A=this.doCreateChild(C,B,D);if(!A){return false}this.exposeCreateChild(C,B,D);A.isPhantom=true;if(!this.editor.isClosed()){this.editLabelFinish(this.editor.saveOnBlur)}this.doEditLabelStart(A)}});dojo.lang.extend(dojo.widget.TreeBasicControllerV3,{canClone:function(D,C,B,A){return true},clone:function(A,D,C,B){return this.runStages(this.canClone,this.prepareClone,this.doClone,this.finalizeClone,this.exposeClone,arguments)},exposeClone:function(B,A){if(A.isTreeNode){this.expand(A)}},doClone:function(E,D,C,A){var B=E.clone(A);D.addChild(B,C);return B}});dojo.lang.extend(dojo.widget.TreeBasicControllerV3,{canDetach:function(A){if(A.actionIsDisabledNow(A.actions.DETACH)){return false}return true},detach:function(A){return this.runStages(this.canDetach,this.prepareDetach,this.doDetach,this.finalizeDetach,this.exposeDetach,arguments)},doDetach:function(A,C,B){A.detach()}});dojo.lang.extend(dojo.widget.TreeBasicControllerV3,{canDestroyChild:function(A){if(A.parent&&!this.canDetach(A)){return false}return true},destroyChild:function(A){return this.runStages(this.canDestroyChild,this.prepareDestroyChild,this.doDestroyChild,this.finalizeDestroyChild,this.exposeDestroyChild,arguments)},doDestroyChild:function(A){A.destroy()}});dojo.lang.extend(dojo.widget.TreeBasicControllerV3,{canMoveNotANode:function(B,A){if(B.treeCanMove){return B.treeCanMove(A)}return true},canMove:function(B,C){if(!B.isTreeNode){return this.canMoveNotANode(B,C)}if(B.actionIsDisabledNow(B.actions.MOVE)){return false}if(B.parent!==C&&C.actionIsDisabledNow(C.actions.ADDCHILD)){return false}var A=C;while(A.isTreeNode){if(A===B){return false}A=A.parent}return true},move:function(C,B,A){return this.runStages(this.canMove,this.prepareMove,this.doMove,this.finalizeMove,this.exposeMove,arguments)},doMove:function(C,B,A){C.tree.move(C,B,A);return true},exposeMove:function(B,A){if(A.isTreeNode){this.expand(A)}}});dojo.lang.extend(dojo.widget.TreeBasicControllerV3,{canCreateChild:function(B,A,C){if(B.actionIsDisabledNow(B.actions.ADDCHILD)){return false}return true},createChild:function(B,A,C){if(!C){C={title:B.tree.defaultChildTitle}}return this.runStages(this.canCreateChild,this.prepareCreateChild,this.doCreateChild,this.finalizeCreateChild,this.exposeCreateChild,[B,A,C])},prepareCreateChild:function(){return true},finalizeCreateChild:function(){},doCreateChild:function(A,D,B){var C=A.tree.createNode(B);A.addChild(C,D);return C},exposeCreateChild:function(A){return this.expand(A)}});dojo.provide("dojo.Deferred");dojo.require("dojo.lang.func");dojo.Deferred=function(A){this.chain=[];this.id=this._nextId();this.fired=-1;this.paused=0;this.results=[null,null];this.canceller=A;this.silentlyCancelled=false};dojo.lang.extend(dojo.Deferred,{getFunctionFromArgs:function(){var A=arguments;if((A[0])&&(!A[1])){if(dojo.lang.isFunction(A[0])){return A[0]}else{if(dojo.lang.isString(A[0])){return dj_global[A[0]]}}}else{if((A[0])&&(A[1])){return dojo.lang.hitch(A[0],A[1])}}return null},makeCalled:function(){var A=new dojo.Deferred();A.callback();return A},repr:function(){var A;if(this.fired==-1){A="unfired"}else{if(this.fired==0){A="success"}else{A="error"}}return"Deferred("+this.id+", "+A+")"},toString:dojo.lang.forward("repr"),_nextId:(function(){var A=1;return function(){return A++}})(),cancel:function(){if(this.fired==-1){if(this.canceller){this.canceller(this)}else{this.silentlyCancelled=true}if(this.fired==-1){this.errback(new Error(this.repr()))}}else{if((this.fired==0)&&(this.results[0] instanceof dojo.Deferred)){this.results[0].cancel()}}},_pause:function(){this.paused++},_unpause:function(){this.paused--;if((this.paused==0)&&(this.fired>=0)){this._fire()}},_continue:function(A){this._resback(A);this._unpause()},_resback:function(A){this.fired=((A instanceof Error)?1:0);this.results[this.fired]=A;this._fire()},_check:function(){if(this.fired!=-1){if(!this.silentlyCancelled){dojo.raise("already called!")}this.silentlyCancelled=false;return }},callback:function(A){this._check();this._resback(A)},errback:function(A){this._check();if(!(A instanceof Error)){A=new Error(A)}this._resback(A)},addBoth:function(A,C){var B=this.getFunctionFromArgs(A,C);if(arguments.length>2){B=dojo.lang.curryArguments(null,B,arguments,2)}return this.addCallbacks(B,B)},addCallback:function(A,C){var B=this.getFunctionFromArgs(A,C);if(arguments.length>2){B=dojo.lang.curryArguments(null,B,arguments,2)}return this.addCallbacks(B,null)},addErrback:function(A,C){var B=this.getFunctionFromArgs(A,C);if(arguments.length>2){B=dojo.lang.curryArguments(null,B,arguments,2)}return this.addCallbacks(null,B);return this.addCallbacks(null,C)},addCallbacks:function(A,B){this.chain.push([A,B]);if(this.fired>=0){this._fire()}return this},_fire:function(){var B=this.chain;var E=this.fired;var D=this.results[E];var C=this;var A=null;while(B.length>0&&this.paused==0){var H=B.shift();var G=H[E];if(G==null){continue}try{D=G(D);E=((D instanceof Error)?1:0);if(D instanceof dojo.Deferred){A=function(I){C._continue(I)};this._pause()}}catch(F){E=1;D=F}}this.fired=E;this.results[E]=D;if((A)&&(this.paused)){D.addBoth(A)}}});dojo.provide("dojo.DeferredList");dojo.DeferredList=function(E,G,F,D,C){this.list=E;this.resultList=new Array(this.list.length);this.chain=[];this.id=this._nextId();this.fired=-1;this.paused=0;this.results=[null,null];this.canceller=C;this.silentlyCancelled=false;if(this.list.length===0&&!G){this.callback(this.resultList)}this.finishedCount=0;this.fireOnOneCallback=G;this.fireOnOneErrback=F;this.consumeErrors=D;var B=0;var A=this;dojo.lang.forEach(this.list,function(I){var H=B;I.addCallback(function(J){A._cbDeferred(H,true,J)});I.addErrback(function(J){A._cbDeferred(H,false,J)});B++})};dojo.inherits(dojo.DeferredList,dojo.Deferred);dojo.lang.extend(dojo.DeferredList,{_cbDeferred:function(C,B,A){this.resultList[C]=[B,A];this.finishedCount+=1;if(this.fired!==0){if(B&&this.fireOnOneCallback){this.callback([C,A])}else{if(!B&&this.fireOnOneErrback){this.errback(A)}else{if(this.finishedCount==this.list.length){this.callback(this.resultList)}}}}if(!B&&this.consumeErrors){A=null}return A},gatherResults:function(A){var B=new dojo.DeferredList(A,false,true,false);B.addCallback(function(C){var D=[];for(var E=0;E<C.length;E++){D.push(C[E][1])}return D});return B}});dojo.provide("dojo.widget.TreeLoadingControllerV3");dojo.require("dojo.event.*");dojo.require("dojo.json");dojo.require("dojo.io.*");dojo.declare("dojo.Error",Error,function(B,A){this.message=B;this.extra=A;this.stack=(new Error()).stack});dojo.declare("dojo.CommunicationError",dojo.Error,function(){this.name="CommunicationError"});dojo.declare("dojo.LockedError",dojo.Error,function(){this.name="LockedError"});dojo.declare("dojo.FormatError",dojo.Error,function(){this.name="FormatError"});dojo.declare("dojo.RpcError",dojo.Error,function(){this.name="RpcError"});dojo.widget.defineWidget("dojo.widget.TreeLoadingControllerV3",dojo.widget.TreeBasicControllerV3,{RpcUrl:"",RpcActionParam:"action",preventCache:true,checkValidRpcResponse:function(C,D){if(C!="load"){var B={};for(var A=1;A<arguments.length;A++){dojo.lang.mixin(B,arguments[A])}return new dojo.CommunicationError(D,B)}if(typeof D!="object"){return new dojo.FormatError("Wrong server answer format "+(D&&D.toSource?D.toSource():D)+" type "+(typeof D),D)}if(!dojo.lang.isUndefined(D.error)){return new dojo.RpcError(D.error,D)}return false},getDeferredBindHandler:function(A){return dojo.lang.hitch(this,function(C,D){var B=this.checkValidRpcResponse.apply(this,arguments);if(B){A.errback(B);return }A.callback(D)})},getRpcUrl:function(F){if(this.RpcUrl=="local"){var D=document.location.href.substr(0,document.location.href.lastIndexOf("/"));var E=D+"/local/"+F;return E}if(!this.RpcUrl){dojo.raise("Empty RpcUrl: can't load")}var C=this.RpcUrl;if(C.indexOf("/")!=0){var B=document.location.href.replace(/:\/\/.*/,"");var A=document.location.href.substring(B.length+3);if(A.lastIndexOf("/")!=A.length-1){A=A.replace(/\/[^\/]+$/,"/")}if(A.lastIndexOf("/")!=A.length-1){A=A+"/"}C=B+"://"+A+C}return C+(C.indexOf("?")>-1?"&":"?")+this.RpcActionParam+"="+F},loadProcessResponse:function(A,B){if(!dojo.lang.isArray(B)){throw new dojo.FormatError("loadProcessResponse: Not array loaded: "+B)}A.setChildren(B)},runRpc:function(A){var C=this;var B=new dojo.Deferred();dojo.io.bind({url:A.url,handle:this.getDeferredBindHandler(B),mimetype:"text/javascript",preventCache:this.preventCache,sync:A.sync,content:{data:dojo.json.serialize(A.params)}});return B},loadRemote:function(B,A){var E=this;var D={node:this.getInfo(B),tree:this.getInfo(B.tree)};var C=this.runRpc({url:this.getRpcUrl("getChildren"),sync:A,params:D});C.addCallback(function(F){return E.loadProcessResponse(B,F)});return C},batchExpandTimeout:0,recurseToLevel:function(D,C,B,A,I,E){if(C==0){return }if(!I){var H=B.call(A,D,E)}else{var H=dojo.Deferred.prototype.makeCalled()}var G=this;var F=function(){var L=D.children;var K=[];for(var J=0;J<L.length;J++){K.push(G.recurseToLevel(L[J],C-1,B,A,E))}return new dojo.DeferredList(K)};H.addCallback(F);return H},expandToLevel:function(A,C,B){return this.recurseToLevel(A,A.isTree?C+1:C,this.expand,this,A.isTree,B)},loadToLevel:function(C,B,A){return this.recurseToLevel(C,C.isTree?B+1:B,this.loadIfNeeded,this,C.isTree,A)},loadAll:function(B,A){return this.loadToLevel(B,Number.POSITIVE_INFINITY,A)},expand:function(D,C){var B=this;var A=this.startProcessing(D);A.addCallback(function(){return B.loadIfNeeded(D,C)});A.addCallback(function(E){dojo.widget.TreeBasicControllerV3.prototype.expand(D);return E});A.addBoth(function(E){B.finishProcessing(D);return E});return A},loadIfNeeded:function(C,B){var A;if(C.state==C.loadStates.UNCHECKED&&C.isFolder&&!C.children.length){A=this.loadRemote(C,B)}else{A=new dojo.Deferred();A.callback()}return A},runStages:function(B,A,C,G,H,D){var F=this;if(B&&!B.apply(this,D)){return false}var E=dojo.Deferred.prototype.makeCalled();if(A){E.addCallback(function(){return A.apply(F,D)})}if(C){E.addCallback(function(){var I=C.apply(F,D);return I})}if(G){E.addBoth(function(I){G.apply(F,D);return I})}if(H){E.addCallback(function(I){H.apply(F,D);return I})}return E},startProcessing:function(C){var B=new dojo.Deferred();var A=dojo.lang.isArray(C)?C:arguments;for(var D=0;D<A.length;D++){if(A[D].isLocked()){B.errback(new dojo.LockedError("item locked "+A[D],A[D]));return B}if(A[D].isTreeNode){A[D].markProcessing()}A[D].lock()}B.callback();return B},finishProcessing:function(C){var A=dojo.lang.isArray(C)?C:arguments;for(var B=0;B<A.length;B++){if(!A[B].hasLock()){continue}A[B].unlock();if(A[B].isTreeNode){A[B].unmarkProcessing()}}},refreshChildren:function(A,B){return this.runStages(null,this.prepareRefreshChildren,this.doRefreshChildren,this.finalizeRefreshChildren,this.exposeRefreshChildren,arguments)},prepareRefreshChildren:function(A,B){var C=this.startProcessing(A);A.destroyChildren();A.state=A.loadStates.UNCHECKED;return C},doRefreshChildren:function(B,A){return this.loadRemote(B,A)},finalizeRefreshChildren:function(B,A){this.finishProcessing(B)},exposeRefreshChildren:function(A,B){A.expand()},move:function(A,C,B){return this.runStages(this.canMove,this.prepareMove,this.doMove,this.finalizeMove,this.exposeMove,arguments)},doMove:function(C,B,A){C.tree.move(C,B,A);return true},prepareMove:function(C,D,B,E){var A=this.startProcessing(D);A.addCallback(dojo.lang.hitch(this,function(){return this.loadIfNeeded(D,E)}));return A},finalizeMove:function(B,A){this.finishProcessing(A)},prepareCreateChild:function(D,C,B,A){var E=this.startProcessing(D);E.addCallback(dojo.lang.hitch(this,function(){return this.loadIfNeeded(D,A)}));return E},finalizeCreateChild:function(A){this.finishProcessing(A)},prepareClone:function(F,E,C,A,D){var B=this.startProcessing(F,E);B.addCallback(dojo.lang.hitch(this,function(){return this.loadIfNeeded(E,D)}));return B},finalizeClone:function(B,A){this.finishProcessing(B,A)}});dojo.provide("dojo.widget.TreeSelectorV3");dojo.require("dojo.widget.HtmlWidget");dojo.widget.defineWidget("dojo.widget.TreeSelectorV3",[dojo.widget.HtmlWidget,dojo.widget.TreeCommon],function(){this.eventNames={};this.listenedTrees={};this.selectedNodes=[];this.lastClicked={}},{listenTreeEvents:["afterTreeCreate","afterCollapse","afterChangeTree","afterDetach","beforeTreeDestroy"],listenNodeFilter:function(A){return A instanceof dojo.widget.Widget},allowedMulti:true,dblselectTimeout:300,eventNamesDefault:{select:"select",deselect:"deselect",dblselect:"dblselect"},onAfterTreeCreate:function(B){var A=B.source;dojo.event.browser.addListener(A.domNode,"onclick",dojo.lang.hitch(this,this.onTreeClick));if(dojo.render.html.ie){dojo.event.browser.addListener(A.domNode,"ondblclick",dojo.lang.hitch(this,this.onTreeDblClick))}dojo.event.browser.addListener(A.domNode,"onKey",dojo.lang.hitch(this,this.onKey))},onKey:function(B){if(!B.key||B.ctrkKey||B.altKey){return }switch(B.key){case B.KEY_ENTER:var A=this.domElement2TreeNode(B.target);if(A){this.processNode(A,B)}}},onAfterChangeTree:function(A){if(!A.oldTree&&A.node.selected){this.select(A.node)}if(!A.newTree||!this.listenedTrees[A.newTree.widgetId]){if(this.selectedNode&&A.node.children){this.deselectIfAncestorMatch(A.node)}}},initialize:function(B){for(var A in this.eventNamesDefault){if(dojo.lang.isUndefined(this.eventNames[A])){this.eventNames[A]=this.widgetId+"/"+this.eventNamesDefault[A]}}},onBeforeTreeDestroy:function(A){this.unlistenTree(A.source)},onAfterCollapse:function(A){this.deselectIfAncestorMatch(A.source)},onTreeDblClick:function(A){this.onTreeClick(A)},checkSpecialEvent:function(A){return A.shiftKey||A.ctrlKey},onTreeClick:function(C){var B=this.domElement2TreeNode(C.target);if(!B){return }var A=function(D){return D===B.labelNode};if(this.checkPathCondition(C.target,A)){this.processNode(B,C)}},processNode:function(E,C){if(E.actionIsDisabled(E.actions.SELECT)){return }if(dojo.lang.inArray(this.selectedNodes,E)){if(this.checkSpecialEvent(C)){this.deselect(E);return }var B=this;var D=0;var A;while(this.selectedNodes.length>D){A=this.selectedNodes[D];if(A!==E){this.deselect(A);continue}D++}var F=this.checkRecentClick(E);eventName=F?this.eventNames.dblselect:this.eventNames.select;if(F){eventName=this.eventNames.dblselect;this.forgetLastClicked()}else{eventName=this.eventNames.select;this.setLastClicked(E)}dojo.event.topic.publish(eventName,{node:E});return }this.deselectIfNoMulti(C);this.setLastClicked(E);this.select(E)},forgetLastClicked:function(){this.lastClicked={}},setLastClicked:function(A){this.lastClicked.date=new Date();this.lastClicked.node=A},checkRecentClick:function(A){var B=new Date()-this.lastClicked.date;if(this.lastClicked.node&&B<this.dblselectTimeout){return true}else{return false}},deselectIfNoMulti:function(A){if(!this.checkSpecialEvent(A)||!this.allowedMulti){this.deselectAll()}},deselectIfAncestorMatch:function(B){var A=this;dojo.lang.forEach(this.selectedNodes,function(C){var D=C;C=C.parent;while(C&&C.isTreeNode){if(C===B){A.deselect(D);return }C=C.parent}})},onAfterDetach:function(A){this.deselectIfAncestorMatch(A.child)},select:function(B){var A=dojo.lang.find(this.selectedNodes,B,true);if(A>=0){return }this.selectedNodes.push(B);dojo.event.topic.publish(this.eventNames.select,{node:B})},deselect:function(B){var A=dojo.lang.find(this.selectedNodes,B,true);if(A<0){return }this.selectedNodes.splice(A,1);dojo.event.topic.publish(this.eventNames.deselect,{node:B})},deselectAll:function(){while(this.selectedNodes.length){this.deselect(this.selectedNodes[0])}}});dojo.provide("dojo.widget.TreeExpandToNodeOnSelect");dojo.require("dojo.widget.HtmlWidget");dojo.widget.defineWidget("dojo.widget.TreeExpandToNodeOnSelect",dojo.widget.HtmlWidget,{selector:"",controller:"",withSelected:false,initialize:function(){this.selector=dojo.widget.byId(this.selector);this.controller=dojo.widget.byId(this.controller);dojo.event.topic.subscribe(this.selector.eventNames.select,this,"onSelect")},onSelectEvent:function(A){this.controller.expandToNode(A.node,this.withSelected)}});dojo.provide("dojo.widget.TreeToggleOnSelect");dojo.require("dojo.widget.HtmlWidget");dojo.widget.defineWidget("dojo.widget.TreeToggleOnSelect",dojo.widget.HtmlWidget,{selector:"",controller:"",selectEvent:"select",initialize:function(){this.selector=dojo.widget.byId(this.selector);this.controller=dojo.widget.byId(this.controller);dojo.event.topic.subscribe(this.selector.eventNames[this.selectEvent],this,"onSelectEvent")},onSelectEvent:function(A){var B=A.node;B.isExpanded?this.controller.collapse(B):this.controller.expand(B)}});dojo.provide("dojo.widget.TreeEmphasizeOnSelect");dojo.require("dojo.widget.HtmlWidget");dojo.require("dojo.html.selection");dojo.widget.defineWidget("dojo.widget.TreeEmphasizeOnSelect",dojo.widget.HtmlWidget,{selector:"",initialize:function(){this.selector=dojo.widget.byId(this.selector);dojo.event.topic.subscribe(this.selector.eventNames.select,this,"onSelect");dojo.event.topic.subscribe(this.selector.eventNames.deselect,this,"onDeselect")},onSelect:function(A){A.node.viewEmphasize()},onDeselect:function(A){A.node.viewUnemphasize()}});dojo.provide("dojo.widget.RichText");dojo.require("dojo.widget.*");dojo.require("dojo.html.layout");dojo.require("dojo.html.selection");dojo.require("dojo.event.*");dojo.require("dojo.string.extras");dojo.require("dojo.uri.Uri");if(!djConfig.useXDomain||djConfig.allowXdRichTextSave){if(dojo.hostenv.post_load_){(function(){var A=dojo.doc().createElement("textarea");A.id="dojo.widget.RichText.savedContent";A.style="display:none;position:absolute;top:-100px;left:-100px;height:3px;width:3px;overflow:hidden;";dojo.body().appendChild(A)})()}else{try{dojo.doc().write('<textarea id="dojo.widget.RichText.savedContent" style="display:none;position:absolute;top:-100px;left:-100px;height:3px;width:3px;overflow:hidden;"></textarea>')}catch(e){}}}dojo.widget.defineWidget("dojo.widget.RichText",dojo.widget.HtmlWidget,function(){this.contentPreFilters=[];this.contentPostFilters=[];this.contentDomPreFilters=[];this.contentDomPostFilters=[];this.editingAreaStyleSheets=[];if(dojo.render.html.moz){this.contentPreFilters.push(this._fixContentForMoz)}this._keyHandlers={};if(dojo.Deferred){this.onLoadDeferred=new dojo.Deferred()}},{inheritWidth:false,focusOnLoad:false,saveName:"",styleSheets:"",_content:"",height:"",minHeight:"1em",isClosed:true,isLoaded:false,useActiveX:false,relativeImageUrls:false,_SEPARATOR:"@@**%%__RICHTEXTBOUNDRY__%%**@@",onLoadDeferred:null,fillInTemplate:function(){dojo.event.topic.publish("dojo.widget.RichText::init",this);this.open();dojo.event.connect(this,"onKeyPressed",this,"afterKeyPress");dojo.event.connect(this,"onKeyPress",this,"keyPress");dojo.event.connect(this,"onKeyDown",this,"keyDown");dojo.event.connect(this,"onKeyUp",this,"keyUp");this.setupDefaultShortcuts()},setupDefaultShortcuts:function(){var B=this.KEY_CTRL;var A=function(D,C){return arguments.length==1?function(){this.execCommand(D)}:function(){this.execCommand(D,C)}};this.addKeyHandler("b",B,A("bold"));this.addKeyHandler("i",B,A("italic"));this.addKeyHandler("u",B,A("underline"));this.addKeyHandler("a",B,A("selectall"));this.addKeyHandler("s",B,function(){this.save(true)});this.addKeyHandler("1",B,A("formatblock","h1"));this.addKeyHandler("2",B,A("formatblock","h2"));this.addKeyHandler("3",B,A("formatblock","h3"));this.addKeyHandler("4",B,A("formatblock","h4"));this.addKeyHandler("\\",B,A("insertunorderedlist"));if(!dojo.render.html.ie){this.addKeyHandler("Z",B,A("redo"))}},events:["onBlur","onFocus","onKeyPress","onKeyDown","onKeyUp","onClick"],open:function(_3c1){if(this.onLoadDeferred.fired>=0){this.onLoadDeferred=new dojo.Deferred()}var h=dojo.render.html;if(!this.isClosed){this.close()}dojo.event.topic.publish("dojo.widget.RichText::open",this);this._content="";if((arguments.length==1)&&(_3c1.nodeName)){this.domNode=_3c1}if((this.domNode.nodeName)&&(this.domNode.nodeName.toLowerCase()=="textarea")){this.textarea=this.domNode;var html=this._preFilterContent(this.textarea.value);this.domNode=dojo.doc().createElement("div");dojo.html.copyStyle(this.domNode,this.textarea);var _3c4=dojo.lang.hitch(this,function(){with(this.textarea.style){display="block";position="absolute";left=top="-1000px";if(h.ie){this.__overflow=overflow;overflow="hidden"}}});if(h.ie){setTimeout(_3c4,10)}else{_3c4()}if(!h.safari){dojo.html.insertBefore(this.domNode,this.textarea)}if(this.textarea.form){dojo.event.connect("before",this.textarea.form,"onsubmit",dojo.lang.hitch(this,function(){this.textarea.value=this.getEditorContent()}))}var _3c5=this;dojo.event.connect(this,"postCreate",function(){dojo.html.insertAfter(_3c5.textarea,_3c5.domNode)})}else{var html=this._preFilterContent(dojo.string.trim(this.domNode.innerHTML))}if(html==""){html="&nbsp;"}var _3c6=dojo.html.getContentBox(this.domNode);this._oldHeight=_3c6.height;this._oldWidth=_3c6.width;this._firstChildContributingMargin=this._getContributingMargin(this.domNode,"top");this._lastChildContributingMargin=this._getContributingMargin(this.domNode,"bottom");this.savedContent=html;this.domNode.innerHTML="";this.editingArea=dojo.doc().createElement("div");this.domNode.appendChild(this.editingArea);if((this.domNode.nodeName)&&(this.domNode.nodeName=="LI")){this.domNode.innerHTML=" <br>"}if(this.saveName!=""&&(!djConfig.useXDomain||djConfig.allowXdRichTextSave)){var _3c7=dojo.doc().getElementById("dojo.widget.RichText.savedContent");if(_3c7.value!=""){var _3c8=_3c7.value.split(this._SEPARATOR);for(var i=0;i<_3c8.length;i++){var data=_3c8[i].split(":");if(data[0]==this.saveName){html=data[1];_3c8.splice(i,1);break}}}dojo.event.connect("before",window,"onunload",this,"_saveContent")}if(h.ie70&&this.useActiveX){dojo.debug("activeX in ie70 is not currently supported, useActiveX is ignored for now.");this.useActiveX=false}if(this.useActiveX&&h.ie){var self=this;setTimeout(function(){self._drawObject(html)},0)}else{if(h.ie||this._safariIsLeopard()||h.opera){this.iframe=dojo.doc().createElement("iframe");this.iframe.src="javascript:void(0)";this.editorObject=this.iframe;with(this.iframe.style){border="0";width="100%"}this.iframe.frameBorder=0;this.editingArea.appendChild(this.iframe);this.window=this.iframe.contentWindow;this.document=this.window.document;this.document.open();this.document.write("<html><head><style>body{margin:0;padding:0;border:0;overflow:hidden;}</style></head><body><div></div></body></html>");this.document.close();this.editNode=this.document.body.firstChild;this.editNode.contentEditable=true;with(this.iframe.style){if(h.ie70){if(this.height){height=this.height}if(this.minHeight){minHeight=this.minHeight}}else{height=this.height?this.height:this.minHeight}}var _3cc=["p","pre","address","h1","h2","h3","h4","h5","h6","ol","div","ul"];var _3cd="";for(var i in _3cc){if(_3cc[i].charAt(1)!="l"){_3cd+="<"+_3cc[i]+"><span>content</span></"+_3cc[i]+">"}else{_3cd+="<"+_3cc[i]+"><li>content</li></"+_3cc[i]+">"}}with(this.editNode.style){position="absolute";left="-2000px";top="-2000px"}this.editNode.innerHTML=_3cd;var node=this.editNode.firstChild;while(node){dojo.withGlobal(this.window,"selectElement",dojo.html.selection,[node.firstChild]);var _3cf=node.tagName.toLowerCase();this._local2NativeFormatNames[_3cf]=this.queryCommandValue("formatblock");this._native2LocalFormatNames[this._local2NativeFormatNames[_3cf]]=_3cf;node=node.nextSibling}with(this.editNode.style){position="";left="";top=""}this.editNode.innerHTML=html;if(this.height){this.document.body.style.overflowY="scroll"}dojo.lang.forEach(this.events,function(e){dojo.event.connect(this.editNode,e.toLowerCase(),this,e)},this);this.onLoad()}else{this._drawIframe(html);this.editorObject=this.iframe}}if(this.domNode.nodeName=="LI"){this.domNode.lastChild.style.marginTop="-1.2em"}dojo.html.addClass(this.domNode,"RichTextEditable");this.isClosed=false},_hasCollapseableMargin:function(A,B){if(dojo.html.getPixelValue(A,"border-"+B+"-width",false)){return false}else{if(dojo.html.getPixelValue(A,"padding-"+B,false)){return false}else{return true}}},_getContributingMargin:function(L,J){if(J=="top"){var I="previousSibling";var G="nextSibling";var E="firstChild";var C="margin-top";var A="margin-bottom"}else{var I="nextSibling";var G="previousSibling";var E="lastChild";var C="margin-bottom";var A="margin-top"}var K=dojo.html.getPixelValue(L,C,false);function M(N){return !(N.nodeType==3&&dojo.string.isBlank(N.data))&&dojo.html.getStyle(N,"display")!="none"&&!dojo.html.isPositionAbsolute(N)}var H=0;var F=L[E];while(F){while((!M(F))&&F[G]){F=F[G]}H=Math.max(H,dojo.html.getPixelValue(F,C,false));if(!this._hasCollapseableMargin(F,J)){break}F=F[E]}if(!this._hasCollapseableMargin(L,J)){return parseInt(H)}var D=0;var B=L[I];while(B){if(M(B)){D=dojo.html.getPixelValue(B,A,false);break}B=B[I]}if(!B){D=dojo.html.getPixelValue(L.parentNode,C,false)}if(H>K){return parseInt(Math.max((H-K)-D,0))}else{return 0}},_drawIframe:function(html){var _3e1=Boolean(dojo.render.html.moz&&(typeof window.XML=="undefined"));if(!this.iframe){var _3e2=(new dojo.uri.Uri(dojo.doc().location)).host;this.iframe=dojo.doc().createElement("iframe");with(this.iframe){style.border="none";style.lineHeight="0";style.verticalAlign="bottom";scrolling=this.height?"auto":"no"}}if(djConfig.useXDomain&&!djConfig.dojoRichTextFrameUrl){dojo.debug("dojo.widget.RichText: When using cross-domain Dojo builds, please save src/widget/templates/richtextframe.html to your domain and set djConfig.dojoRichTextFrameUrl to the path on your domain to richtextframe.html")}this.iframe.src=(djConfig.dojoRichTextFrameUrl||dojo.uri.moduleUri("dojo.widget","templates/richtextframe.html"))+((dojo.doc().domain!=_3e2)?("#"+dojo.doc().domain):"");this.iframe.width=this.inheritWidth?this._oldWidth:"100%";if(this.height){this.iframe.style.height=this.height}else{var _3e3=this._oldHeight;if(this._hasCollapseableMargin(this.domNode,"top")){_3e3+=this._firstChildContributingMargin}if(this._hasCollapseableMargin(this.domNode,"bottom")){_3e3+=this._lastChildContributingMargin}this.iframe.height=_3e3}var _3e4=dojo.doc().createElement("div");_3e4.innerHTML=html;this.editingArea.appendChild(_3e4);if(this.relativeImageUrls){var imgs=_3e4.getElementsByTagName("img");for(var i=0;i<imgs.length;i++){imgs[i].src=(new dojo.uri.Uri(dojo.global().location,imgs[i].src)).toString()}html=_3e4.innerHTML}var _3e7=dojo.html.firstElement(_3e4);var _3e8=dojo.html.lastElement(_3e4);if(_3e7){_3e7.style.marginTop=this._firstChildContributingMargin+"px"}if(_3e8){_3e8.style.marginBottom=this._lastChildContributingMargin+"px"}this.editingArea.appendChild(this.iframe);if(dojo.render.html.safari){this.iframe.src=this.iframe.src}var _3e9=false;var _3ea=dojo.lang.hitch(this,function(){if(!_3e9){_3e9=true}else{return }if(!this.editNode){if(this.iframe.contentWindow){this.window=this.iframe.contentWindow;this.document=this.iframe.contentWindow.document}else{if(this.iframe.contentDocument){this.window=this.iframe.contentDocument.window;this.document=this.iframe.contentDocument}}var _3eb=(function(_3ec){return function(_3ed){return dojo.html.getStyle(_3ec,_3ed)}})(this.domNode);var font=_3eb("font-weight")+" "+_3eb("font-size")+" "+_3eb("font-family");var _3ef="1.0";var _3f0=dojo.html.getUnitValue(this.domNode,"line-height");if(_3f0.value&&_3f0.units==""){_3ef=_3f0.value}dojo.html.insertCssText("body,html{background:transparent;padding:0;margin:0;}body{top:0;left:0;right:0;"+(((this.height)||(dojo.render.html.opera))?"":"position:fixed;")+"font:"+font+";min-height:"+this.minHeight+";line-height:"+_3ef+"}p{margin: 1em 0 !important;}body > *:first-child{padding-top:0 !important;margin-top:"+this._firstChildContributingMargin+"px !important;}body > *:last-child{padding-bottom:0 !important;margin-bottom:"+this._lastChildContributingMargin+"px !important;}li > ul:-moz-first-node, li > ol:-moz-first-node{padding-top:1.2em;}\nli{min-height:1.2em;}",this.document);dojo.html.removeNode(_3e4);this.document.body.innerHTML=html;if(_3e1||dojo.render.html.safari){this.document.designMode="on"}this.onLoad()}else{dojo.html.removeNode(_3e4);this.editNode.innerHTML=html;this.onDisplayChanged()}});if(this.editNode){_3ea()}else{if(dojo.render.html.moz){this.iframe.onload=function(){setTimeout(_3ea,250)}}else{this.iframe.onload=_3ea}}},_applyEditingAreaStyleSheets:function(){var C=[];if(this.styleSheets){C=this.styleSheets.split(";");this.styleSheets=""}C=C.concat(this.editingAreaStyleSheets);this.editingAreaStyleSheets=[];if(C.length>0){for(var B=0;B<C.length;B++){var A=C[B];if(A){this.addStyleSheet(dojo.uri.dojoUri(A))}}}},addStyleSheet:function(uri){var url=uri.toString();if(dojo.lang.find(this.editingAreaStyleSheets,url)>-1){dojo.debug("dojo.widget.RichText.addStyleSheet: Style sheet "+url+" is already applied to the editing area!");return }if(url.charAt(0)=="."||(url.charAt(0)!="/"&&!uri.host)){url=(new dojo.uri.Uri(dojo.global().location,url)).toString()}this.editingAreaStyleSheets.push(url);if(this.document.createStyleSheet){this.document.createStyleSheet(url)}else{var head=this.document.getElementsByTagName("head")[0];var _3f7=this.document.createElement("link");with(_3f7){rel="stylesheet";type="text/css";href=url}head.appendChild(_3f7)}},removeStyleSheet:function(E){var C=E.toString();if(C.charAt(0)=="."||(C.charAt(0)!="/"&&!E.host)){C=(new dojo.uri.Uri(dojo.global().location,C)).toString()}var B=dojo.lang.find(this.editingAreaStyleSheets,C);if(B==-1){dojo.debug("dojo.widget.RichText.removeStyleSheet: Style sheet "+C+" is not applied to the editing area so it can not be removed!");return }delete this.editingAreaStyleSheets[B];var A=this.document.getElementsByTagName("link");for(var D=0;D<A.length;D++){if(A[D].href==C){if(dojo.render.html.ie){A[D].href=""}dojo.html.removeNode(A[D]);break}}},_drawObject:function(html){this.object=dojo.html.createExternalElement(dojo.doc(),"object");with(this.object){classid="clsid:2D360201-FFF5-11D1-8D03-00A0C959BC0A";width=this.inheritWidth?this._oldWidth:"100%";style.height=this.height?this.height:(this._oldHeight+"px");Scrollbars=this.height?true:false;Appearance=this._activeX.appearance.flat}this.editorObject=this.object;this.editingArea.appendChild(this.object);this.object.attachEvent("DocumentComplete",dojo.lang.hitch(this,"onLoad"));dojo.lang.forEach(this.events,function(e){this.object.attachEvent(e.toLowerCase(),dojo.lang.hitch(this,e))},this);this.object.DocumentHTML='<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><title></title><style type="text/css">    body,html { padding: 0; margin: 0; }'+(this.height?"":"    body,  { overflow: hidden; }")+"</style><body><div>"+html+"<div></body></html>";this._cacheLocalBlockFormatNames()},_local2NativeFormatNames:{},_native2LocalFormatNames:{},_cacheLocalBlockFormatNames:function(){if(!this._native2LocalFormatNames.p){var H=this.object;var F=false;if(!H){try{H=dojo.html.createExternalElement(dojo.doc(),"object");H.classid="clsid:2D360201-FFF5-11D1-8D03-00A0C959BC0A";dojo.body().appendChild(H);H.DocumentHTML="<html><head></head><body></body></html>"}catch(G){F=true}}try{var E=new ActiveXObject("DEGetBlockFmtNamesParam.DEGetBlockFmtNamesParam");H.ExecCommand(this._activeX.command.getblockformatnames,0,E);var C=new VBArray(E.Names);var B=C.toArray();var A=["p","pre","address","h1","h2","h3","h4","h5","h6","ol","ul","","","","","div"];for(var D=0;D<A.length;++D){if(A[D].length>0){this._local2NativeFormatNames[B[D]]=A[D];this._native2LocalFormatNames[A[D]]=B[D]}}}catch(G){F=true}if(H&&!this.object){dojo.body().removeChild(H)}}return !F},_isResized:function(){return false},onLoad:function(E){this.isLoaded=true;if(this.object){this.document=this.object.DOM;this.window=this.document.parentWindow;this.editNode=this.document.body.firstChild;this.editingArea.style.height=this.height?this.height:this.minHeight;if(!this.height){this.connect(this,"onDisplayChanged","_updateHeight")}this.window._frameElement=this.object}else{if(this.iframe&&!dojo.render.html.ie){this.editNode=this.document.body;if(!this.height){this.connect(this,"onDisplayChanged","_updateHeight")}try{this.document.execCommand("useCSS",false,true);this.document.execCommand("styleWithCSS",false,false)}catch(D){}if(dojo.render.html.safari){this.connect(this.editNode,"onblur","onBlur");this.connect(this.editNode,"onfocus","onFocus");this.connect(this.editNode,"onclick","onFocus");this.interval=setInterval(dojo.lang.hitch(this,"onDisplayChanged"),750)}else{if(dojo.render.html.mozilla||dojo.render.html.opera){var C=this.document;var B=dojo.event.browser.addListener;var A=this;dojo.lang.forEach(this.events,function(G){var F=B(A.document,G.substr(2).toLowerCase(),dojo.lang.hitch(A,G));if(G=="onBlur"){var H={unBlur:function(I){dojo.event.browser.removeListener(C,"blur",F)}};dojo.event.connect("before",A,"close",H,"unBlur")}})}}}else{if(dojo.render.html.ie){if(!this.height){this.connect(this,"onDisplayChanged","_updateHeight")}this.editNode.style.zoom=1}}}this._applyEditingAreaStyleSheets();if(this.focusOnLoad){this.focus()}this.onDisplayChanged(E);if(this.onLoadDeferred){this.onLoadDeferred.callback(true)}},onKeyDown:function(A){if((!A)&&(this.object)){A=dojo.event.browser.fixEvent(this.window.event)}if((dojo.render.html.ie)&&(A.keyCode==A.KEY_TAB)){A.preventDefault();A.stopPropagation();this.execCommand((A.shiftKey?"outdent":"indent"))}else{if(dojo.render.html.ie){if((65<=A.keyCode)&&(A.keyCode<=90)){A.charCode=A.keyCode;this.onKeyPress(A)}}}},onKeyUp:function(A){return },KEY_CTRL:1,onKeyPress:function(E){if((!E)&&(this.object)){E=dojo.event.browser.fixEvent(this.window.event)}var D=E.ctrlKey?this.KEY_CTRL:0;if(this._keyHandlers[E.key]){var C=this._keyHandlers[E.key],B=0,A;while(A=C[B++]){if(D==A.modifiers){E.preventDefault();A.handler.call(this);break}}}dojo.lang.setTimeout(this,this.onKeyPressed,1,E)},addKeyHandler:function(C,B,A){if(!(this._keyHandlers[C] instanceof Array)){this._keyHandlers[C]=[]}this._keyHandlers[C].push({modifiers:B||0,handler:A})},onKeyPressed:function(A){this.onDisplayChanged()},onClick:function(A){this.onDisplayChanged(A)},onBlur:function(A){},_initialFocus:true,onFocus:function(A){if((dojo.render.html.mozilla)&&(this._initialFocus)){this._initialFocus=false;if(dojo.string.trim(this.editNode.innerHTML)=="&nbsp;"){this.placeCursorAtStart()}}},blur:function(){if(this.iframe){this.window.blur()}else{if(this.object){this.document.body.blur()}else{if(this.editNode){this.editNode.blur()}}}},focus:function(){if(this.iframe&&!dojo.render.html.ie){this.window.focus()}else{if(this.object){this.document.focus()}else{if(this.editNode&&this.editNode.focus){this.editNode.focus()}else{dojo.debug("Have no idea how to focus into the editor!")}}}},onDisplayChanged:function(A){},_activeX:{command:{bold:5000,italic:5023,underline:5048,justifycenter:5024,justifyleft:5025,justifyright:5026,cut:5003,copy:5002,paste:5032,"delete":5004,undo:5049,redo:5033,removeformat:5034,selectall:5035,unlink:5050,indent:5018,outdent:5031,insertorderedlist:5030,insertunorderedlist:5051,inserttable:5022,insertcell:5019,insertcol:5020,insertrow:5021,deletecells:5005,deletecols:5006,deleterows:5007,mergecells:5029,splitcell:5047,setblockformat:5043,getblockformat:5011,getblockformatnames:5012,setfontname:5044,getfontname:5013,setfontsize:5045,getfontsize:5014,setbackcolor:5042,getbackcolor:5010,setforecolor:5046,getforecolor:5015,findtext:5008,font:5009,hyperlink:5016,image:5017,lockelement:5027,makeabsolute:5028,sendbackward:5036,bringforward:5037,sendbelowtext:5038,bringabovetext:5039,sendtoback:5040,bringtofront:5041,properties:5052},ui:{"default":0,prompt:1,noprompt:2},status:{notsupported:0,disabled:1,enabled:3,latched:7,ninched:11},appearance:{flat:0,inset:1},state:{unchecked:0,checked:1,gray:2}},_normalizeCommand:function(A){var C=dojo.render.html;var B=A.toLowerCase();if(B=="formatblock"){if(C.safari){B="heading"}}else{if(this.object){switch(B){case"createlink":B="hyperlink";break;case"insertimage":B="image";break}}else{if(B=="hilitecolor"&&!C.mozilla){B="backcolor"}}}return B},_safariIsLeopard:function(){var C=false;if(dojo.render.html.safari){var B=dojo.render.html.UA.split("AppleWebKit/")[1];var A=parseFloat(B.split(" ")[0]);if(A>=420){C=true}}return C},queryCommandAvailable:function(I){var A=1;var G=1<<1;var F=1<<2;var E=1<<3;var D=1<<4;var C=this._safariIsLeopard();function B(J){return{ie:Boolean(J&A),mozilla:Boolean(J&G),safari:Boolean(J&F),safari420:Boolean(J&D),opera:Boolean(J&E)}}var H=null;switch(I.toLowerCase()){case"bold":case"italic":case"underline":case"subscript":case"superscript":case"fontname":case"fontsize":case"forecolor":case"hilitecolor":case"justifycenter":case"justifyfull":case"justifyleft":case"justifyright":case"delete":case"selectall":H=B(G|A|F|E);break;case"createlink":case"unlink":case"removeformat":case"inserthorizontalrule":case"insertimage":case"insertorderedlist":case"insertunorderedlist":case"indent":case"outdent":case"formatblock":case"inserthtml":case"undo":case"redo":case"strikethrough":H=B(G|A|E|D);break;case"blockdirltr":case"blockdirrtl":case"dirltr":case"dirrtl":case"inlinedirltr":case"inlinedirrtl":H=B(A);break;case"cut":case"copy":case"paste":H=B(A|G|D);break;case"inserttable":H=B(G|(this.object?A:0));break;case"insertcell":case"insertcol":case"insertrow":case"deletecells":case"deletecols":case"deleterows":case"mergecells":case"splitcell":H=B(this.object?A:0);break;default:return false}return(dojo.render.html.ie&&H.ie)||(dojo.render.html.mozilla&&H.mozilla)||(dojo.render.html.safari&&H.safari)||(C&&H.safari420)||(dojo.render.html.opera&&H.opera)},execCommand:function(M,L){var J;this.focus();M=this._normalizeCommand(M);if(L!=undefined){if(M=="heading"){throw new Error("unimplemented")}else{if(M=="formatblock"){if(this.object){L=this._native2LocalFormatNames[L]}else{if(dojo.render.html.ie){L="<"+L+">"}}}}}if(this.object){switch(M){case"hilitecolor":M="setbackcolor";break;case"forecolor":case"backcolor":case"fontsize":case"fontname":M="set"+M;break;case"formatblock":M="setblockformat"}if(M=="strikethrough"){M="inserthtml";var I=this.document.selection.createRange();if(!I.htmlText){return }L=I.htmlText.strike()}else{if(M=="inserthorizontalrule"){M="inserthtml";L="<hr>"}}if(M=="inserthtml"){var I=this.document.selection.createRange();if(this.document.selection.type.toUpperCase()=="CONTROL"){for(var C=0;C<I.length;C++){I.item(C).outerHTML=L}}else{I.pasteHTML(L);I.select()}J=true}else{if(arguments.length==1){J=this.object.ExecCommand(this._activeX.command[M],this._activeX.ui.noprompt)}else{J=this.object.ExecCommand(this._activeX.command[M],this._activeX.ui.noprompt,L)}}}else{if(M=="inserthtml"){if(dojo.render.html.ie){var H=this.document.selection.createRange();H.pasteHTML(L);H.select();return true}else{return this.document.execCommand(M,false,L)}}else{if((M=="unlink")&&(this.queryCommandEnabled("unlink"))&&(dojo.render.html.mozilla)){var G=this.window.getSelection();var F=G.getRangeAt(0);var E=F.startContainer;var D=F.startOffset;var B=F.endContainer;var A=F.endOffset;var K=dojo.withGlobal(this.window,"getAncestorElement",dojo.html.selection,["a"]);dojo.withGlobal(this.window,"selectElement",dojo.html.selection,[K]);J=this.document.execCommand("unlink",false,null);var F=this.document.createRange();F.setStart(E,D);F.setEnd(B,A);G.removeAllRanges();G.addRange(F);return J}else{if((M=="hilitecolor")&&(dojo.render.html.mozilla)){this.document.execCommand("useCSS",false,false);J=this.document.execCommand(M,false,L);this.document.execCommand("useCSS",false,true)}else{if((dojo.render.html.ie)&&((M=="backcolor")||(M=="forecolor"))){L=arguments.length>1?L:null;J=this.document.execCommand(M,false,L)}else{L=arguments.length>1?L:null;if(L||M!="createlink"){J=this.document.execCommand(M,false,L)}}}}}}this.onDisplayChanged();return J},queryCommandEnabled:function(A){A=this._normalizeCommand(A);if(this.object){switch(A){case"hilitecolor":A="setbackcolor";break;case"forecolor":case"backcolor":case"fontsize":case"fontname":A="set"+A;break;case"formatblock":A="setblockformat";break;case"strikethrough":A="bold";break;case"inserthorizontalrule":return true}if(typeof this._activeX.command[A]=="undefined"){return false}var C=this.object.QueryStatus(this._activeX.command[A]);return((C!=this._activeX.status.notsupported)&&(C!=this._activeX.status.disabled))}else{if(dojo.render.html.mozilla){if(A=="unlink"){return dojo.withGlobal(this.window,"hasAncestorElement",dojo.html.selection,["a"])}else{if(A=="inserttable"){return true}}}var B=(dojo.render.html.ie)?this.document.selection.createRange():this.document;return B.queryCommandEnabled(A)}},queryCommandState:function(B){B=this._normalizeCommand(B);if(this.object){if(B=="forecolor"){B="setforecolor"}else{if(B=="backcolor"){B="setbackcolor"}else{if(B=="strikethrough"){return dojo.withGlobal(this.window,"hasAncestorElement",dojo.html.selection,["strike"])}else{if(B=="inserthorizontalrule"){return false}}}}if(typeof this._activeX.command[B]=="undefined"){return null}var A=this.object.QueryStatus(this._activeX.command[B]);return((A==this._activeX.status.latched)||(A==this._activeX.status.ninched))}else{return this.document.queryCommandState(B)}},queryCommandValue:function(B){B=this._normalizeCommand(B);if(this.object){switch(B){case"forecolor":case"backcolor":case"fontsize":case"fontname":B="get"+B;return this.object.execCommand(this._activeX.command[B],this._activeX.ui.noprompt);case"formatblock":var A=this.object.execCommand(this._activeX.command.getblockformat,this._activeX.ui.noprompt);if(A){return this._local2NativeFormatNames[A]}}}else{if(dojo.render.html.ie&&B=="formatblock"){return this._local2NativeFormatNames[this.document.queryCommandValue(B)]||this.document.queryCommandValue(B)}return this.document.queryCommandValue(B)}},placeCursorAtStart:function(){this.focus();if(dojo.render.html.moz&&this.editNode.firstChild&&this.editNode.firstChild.nodeType!=dojo.dom.TEXT_NODE){dojo.withGlobal(this.window,"selectElementChildren",dojo.html.selection,[this.editNode.firstChild])}else{dojo.withGlobal(this.window,"selectElementChildren",dojo.html.selection,[this.editNode])}dojo.withGlobal(this.window,"collapse",dojo.html.selection,[true])},placeCursorAtEnd:function(){this.focus();if(dojo.render.html.moz&&this.editNode.lastChild&&this.editNode.lastChild.nodeType!=dojo.dom.TEXT_NODE){dojo.withGlobal(this.window,"selectElementChildren",dojo.html.selection,[this.editNode.lastChild])}else{dojo.withGlobal(this.window,"selectElementChildren",dojo.html.selection,[this.editNode])}dojo.withGlobal(this.window,"collapse",dojo.html.selection,[false])},replaceEditorContent:function(A){A=this._preFilterContent(A);if(this.isClosed){this.domNode.innerHTML=A}else{if(this.window&&this.window.getSelection&&!dojo.render.html.moz){this.editNode.innerHTML=A}else{if((this.window&&this.window.getSelection)||(this.document&&this.document.selection)){this.execCommand("selectall");if(dojo.render.html.moz&&!A){A="&nbsp;"}this.execCommand("inserthtml",A)}}}},_preFilterContent:function(B){var A=B;dojo.lang.forEach(this.contentPreFilters,function(D){A=D(A)});if(this.contentDomPreFilters.length>0){var C=dojo.doc().createElement("div");C.style.display="none";dojo.body().appendChild(C);C.innerHTML=A;dojo.lang.forEach(this.contentDomPreFilters,function(D){C=D(C)});A=C.innerHTML;dojo.body().removeChild(C)}return A},_postFilterContent:function(B){var A=B;if(this.contentDomPostFilters.length>0){var C=this.document.createElement("div");C.innerHTML=A;dojo.lang.forEach(this.contentDomPostFilters,function(D){C=D(C)});A=C.innerHTML}dojo.lang.forEach(this.contentPostFilters,function(D){A=D(A)});return A},_lastHeight:0,_updateHeight:function(){if(!this.isLoaded){return }if(this.height){return }var A=dojo.html.getBorderBox(this.editNode).height;if(!A){A=dojo.html.getBorderBox(this.document.body).height}if(A==0){dojo.debug("Can not figure out the height of the editing area!");return }this._lastHeight=A;this.editorObject.style.height=this._lastHeight+"px";this.window.scrollTo(0,0)},_saveContent:function(B){var A=dojo.doc().getElementById("dojo.widget.RichText.savedContent");A.value+=this._SEPARATOR+this.saveName+":"+this.getEditorContent()},getEditorContent:function(){var D="";try{D=(this._content.length>0)?this._content:this.editNode.innerHTML;if(dojo.string.trim(D)=="&nbsp;"){D=""}}catch(G){}if(dojo.render.html.ie&&!this.object){var F=new RegExp("(?:<p>&nbsp;</p>[\n\r]*)+$","i");D=D.replace(F,"")}D=this._postFilterContent(D);if(this.relativeImageUrls){var E=dojo.global().location.protocol+"//"+dojo.global().location.host;var C=dojo.global().location.pathname;if(C.match(/\/$/)){}else{var B=C.split("/");if(B.length){B.pop()}C=B.join("/")+"/"}var A=new RegExp("(<img[^>]* src=[\"'])("+E+"("+C+")?)","ig");D=D.replace(A,"$1")}return D},close:function(save,_455){if(this.isClosed){return false}if(arguments.length==0){save=true}this._content=this._postFilterContent(this.editNode.innerHTML);var _456=(this.savedContent!=this._content);if(this.interval){clearInterval(this.interval)}if(dojo.render.html.ie&&!this.object){dojo.event.browser.clean(this.editNode)}if(this.iframe){delete this.iframe}if(this.textarea){with(this.textarea.style){position="";left=top="";if(dojo.render.html.ie){overflow=this.__overflow;this.__overflow=null}}if(save){this.textarea.value=this._content}else{this.textarea.value=this.savedContent}dojo.html.removeNode(this.domNode);this.domNode=this.textarea}else{if(save){if(dojo.render.html.moz){var nc=dojo.doc().createElement("span");this.domNode.appendChild(nc);nc.innerHTML=this.editNode.innerHTML}else{this.domNode.innerHTML=this._content}}else{this.domNode.innerHTML=this.savedContent}}dojo.html.removeClass(this.domNode,"RichTextEditable");this.isClosed=true;this.isLoaded=false;delete this.editNode;if(this.window._frameElement){this.window._frameElement=null}this.window=null;this.document=null;this.object=null;this.editingArea=null;this.editorObject=null;return _456},destroyRendering:function(){},destroy:function(){this.destroyRendering();if(!this.isClosed){this.close(false)}dojo.widget.RichText.superclass.destroy.call(this)},connect:function(B,A,C){dojo.event.connect(B,A,this,C)},disconnect:function(C,B,A){dojo.event.disconnect(C,B,this,A)},disconnectAllWithRoot:function(A){dojo.deprecated("disconnectAllWithRoot","is deprecated. No need to disconnect manually","0.5")},_fixContentForMoz:function(A){A=A.replace(/<strong([ \>])/gi,"<b$1");A=A.replace(/<\/strong>/gi,"</b>");A=A.replace(/<em([ \>])/gi,"<i$1");A=A.replace(/<\/em>/gi,"</i>");return A}});dojo.require("dojo.widget.*");dojo.require("dojo.widget.HtmlWidget");dojo.provide("dojo.widget.TreeEditor");dojo.widget.defineWidget("dojo.widget.TreeEditor",dojo.widget.HtmlWidget,{singleLineMode:false,saveOnBlur:true,sync:false,selectOnOpen:true,controller:null,node:null,richTextParams:{styleSheets:"src/widget/templates/TreeEditor.css"},getContents:function(){return this.richText.getEditorContent()},open:function(B){if(!this.richText){this.richText=dojo.widget.createWidget("RichText",this.richTextParams,B.labelNode);dojo.event.connect("around",this.richText,"onKeyDown",this,"richText_onKeyDown");dojo.event.connect(this.richText,"onBlur",this,"richText_onBlur");var A=this;dojo.event.connect(this.richText,"onLoad",function(){if(A.selectOnOpen){A.richText.execCommand("selectall")}})}else{this.richText.open(B.labelNode)}this.node=B},close:function(A){this.richText.close(A);this.node=null},isClosed:function(){return !this.richText||this.richText.isClosed},execCommand:function(){this.richText.execCommand.apply(this.richText,arguments)},richText_onKeyDown:function(A){var B=A.args[0];if((!B)&&(this.object)){B=dojo.event.browser.fixEvent(this.editor.window.event)}switch(B.keyCode){case B.KEY_ESCAPE:this.finish(false);dojo.event.browser.stopEvent(B);break;case B.KEY_ENTER:if(B.ctrlKey&&!this.singleLineMode){this.execCommand("inserthtml","<br/>")}else{this.finish(true)}dojo.event.browser.stopEvent(B);break;default:return A.proceed()}},richText_onBlur:function(){this.finish(this.saveOnBlur)},finish:function(A){return this.controller.editLabelFinish(A,this.sync)}});dojo.provide("dojo.widget.TreeExtension");dojo.require("dojo.widget.HtmlWidget");dojo.widget.defineWidget("dojo.widget.TreeExtension",[dojo.widget.HtmlWidget,dojo.widget.TreeCommon],function(){this.listenedTrees={}},{});dojo.provide("dojo.widget.TreeDocIconExtension");dojo.require("dojo.widget.HtmlWidget");dojo.widget.defineWidget("dojo.widget.TreeDocIconExtension",[dojo.widget.TreeExtension],{templateCssPath:dojo.uri.moduleUri("dojo.widget","templates/TreeDocIcon.css"),listenTreeEvents:["afterChangeTree","afterSetFolder","afterUnsetFolder"],listenNodeFilter:function(A){return A instanceof dojo.widget.Widget},getnodeDocType:function(A){var B=A.getnodeDocType();if(!B){B=A.isFolder?"Folder":"Document"}return B},setnodeDocTypeClass:function(C){var B=new RegExp("(^|\\s)"+C.tree.classPrefix+"Icon\\w+","g");var A=dojo.html.getClass(C.iconNode).replace(B,"")+" "+C.tree.classPrefix+"Icon"+this.getnodeDocType(C);dojo.html.setClass(C.iconNode,A)},onAfterSetFolder:function(A){if(A.source.iconNode){this.setnodeDocTypeClass(A.source)}},onAfterUnsetFolder:function(A){this.setnodeDocTypeClass(A.source)},listenNode:function(A){A.contentIconNode=document.createElement("div");var B=A.tree.classPrefix+"IconContent";if(dojo.render.html.ie){B=B+" "+A.tree.classPrefix+"IEIconContent"}dojo.html.setClass(A.contentIconNode,B);A.contentNode.parentNode.replaceChild(A.contentIconNode,A.expandNode);A.iconNode=document.createElement("div");dojo.html.setClass(A.iconNode,A.tree.classPrefix+"Icon "+A.tree.classPrefix+"Icon"+this.getnodeDocType(A));A.contentIconNode.appendChild(A.expandNode);A.contentIconNode.appendChild(A.iconNode);dojo.dom.removeNode(A.contentNode);A.contentIconNode.appendChild(A.contentNode)},onAfterChangeTree:function(B){var A=this;if(!B.oldTree||!this.listenedTrees[B.oldTree.widgetId]){this.processDescendants(B.node,this.listenNodeFilter,this.listenNode)}}});dojo.provide("dojo.widget.TreeContextMenuV3");dojo.require("dojo.event.*");dojo.require("dojo.io.*");dojo.require("dojo.widget.*");dojo.widget.defineWidget("dojo.widget.TreeContextMenuV3",[dojo.widget.PopupMenu2,dojo.widget.TreeCommon],function(){this.listenedTrees={}},{listenTreeEvents:["afterTreeCreate","beforeTreeDestroy"],listenNodeFilter:function(A){return A instanceof dojo.widget.Widget},onAfterTreeCreate:function(B){var A=B.source;this.bindDomNode(A.domNode)},onBeforeTreeDestroy:function(A){this.unBindDomNode(A.source.domNode)},getTreeNode:function(){var B=this.getTopOpenEvent().target;var A=this.domElement2TreeNode(B);return A},open:function(){var A=dojo.widget.PopupMenu2.prototype.open.apply(this,arguments);for(var B=0;B<this.children.length;B++){if(this.children[B].menuOpen){this.children[B].menuOpen(this.getTreeNode())}}return A},close:function(){for(var B=0;B<this.children.length;B++){if(this.children[B].menuClose){this.children[B].menuClose(this.getTreeNode())}}var A=dojo.widget.PopupMenu2.prototype.close.apply(this,arguments);return A}});dojo.widget.defineWidget("dojo.widget.TreeMenuItemV3",[dojo.widget.MenuItem2,dojo.widget.TreeCommon],function(){this.treeActions=[]},{treeActions:"",initialize:function(A,C){for(var B=0;B<this.treeActions.length;B++){this.treeActions[B]=this.treeActions[B].toUpperCase()}},getTreeNode:function(){var A=this;while(!(A instanceof dojo.widget.TreeContextMenuV3)){A=A.parent}var B=A.getTreeNode();return B},menuOpen:function(B){B.viewEmphasize();this.setDisabled(false);var A=this;dojo.lang.forEach(A.treeActions,function(C){A.setDisabled(B.actionIsDisabledNow(C))})},menuClose:function(A){A.viewUnemphasize()},toString:function(){return"["+this.widgetType+" node "+this.getTreeNode()+"]"}});dojo.provide("sn.widget.SnTreeContextMenuV3");dojo.widget.defineWidget("sn.widget.SnTreeContextMenuV3",[dojo.widget.TreeContextMenuV3],function(){},{open:function(){var F=this.getTreeNode();var E=F.objectId.split(".");var C=E[0];for(var D=0;D<this.children.length;D++){var A=false;for(var B=0;B<this.children[D].naviNodeType.length;B++){if(this.children[D].naviNodeType[B]==C){A=true;break}}if(A){this.children[D].show()}else{this.children[D].hide()}}dojo.widget.TreeContextMenuV3.prototype.open.apply(this,arguments)}});dojo.widget.defineWidget("sn.widget.SnTreeMenuItemV3",[dojo.widget.TreeMenuItemV3],function(){},{naviNodeType:[]});dojo.provide("sn.widget.SnTreeDocIconExtension");dojo.widget.defineWidget("sn.widget.SnTreeDocIconExtension",[dojo.widget.TreeDocIconExtension],{getnodeDocType:function(C){var A=C.getnodeDocType();var B;if(!A){A=C.isFolder?"Folder":"Document";B=C.objectId.split(".");switch(B[0]){case"image":A="Image";break;case"seqTray":A="SeqTray";break;case"result":A="Result";break;case"notebook":A="Notebook";break;case"page":A="Page";break;case"group":A="Group";break;case"member":A="Member";break}}return A}});dojo.provide("sn.widget.SnTreeLinkExtension");dojo.require("dojo.widget.HtmlWidget");dojo.widget.defineWidget("sn.widget.SnTreeLinkExtension",dojo.widget.TreeExtension,function(){this.params={}},{listenTreeEvents:["afterChangeTree"],listenTree:function(B){dojo.widget.TreeCommon.prototype.listenTree.call(this,B);var A=B.labelNodeTemplate;var C=this.makeALabel();dojo.html.setClass(C,dojo.html.getClass(A));A.parentNode.appendChild(C)},makeALabel:function(){var A=document.createElement("a");for(var B in this.params){if(B in {}){continue}A.setAttribute(B,this.params[B])}return A},onAfterChangeTree:function(B){var A=this;if(!B.oldTree){this.listenNode(B.node)}},listenNode:function(B){for(var A in B.object){if(A in {}){continue}if(A=="linkTitle"){textNode=document.createTextNode(B.object[A]);B.labelNode.nextSibling.appendChild(textNode);continue}if(A=="onclick"){if(B.labelNode.nextSibling.attachEvent){B.labelNode.nextSibling.attachEvent("onclick",Function(B.object[A]))}}B.labelNode.nextSibling.setAttribute(A,B.object[A])}}});dojo.provide("sn.widget.SnTreeLoadingControllerV3");dojo.widget.defineWidget("sn.widget.SnTreeLoadingControllerV3",dojo.widget.TreeLoadingControllerV3,{doEditLabelFinish:function(F,C){if(!this.editor){dojo.raise(this.widgetType+": no editor specified")}var E=this.editor.node;var H=this.editor.getContents();this.editor.close(F);if(F){var G={title:H};if(C){dojo.lang.mixin(G,C)}if(E.isPhantom){var D=E.parent;var B=E.getParentIndex();E.destroy();E=dojo.widget.TreeBasicControllerV3.prototype.doCreateChild.call(this,D,B,G)}else{var A=C&&C.title?C.title:H;E.setTitle(A)}}else{if(E.isPhantom){E.destroy();E=null}}dojo.event.topic.publish(this.widgetId+"/editLabelFinish",E)}});dojo.provide("dojo.date.common");dojo.date.setDayOfYear=function(A,B){A.setMonth(0);A.setDate(B);return A};dojo.date.getDayOfYear=function(C){var B=C.getFullYear();var A=new Date(B-1,11,31);return Math.floor((C.getTime()-A.getTime())/86400000)};dojo.date.setWeekOfYear=function(A,B,C){if(arguments.length==1){C=0}dojo.unimplemented("dojo.date.setWeekOfYear")};dojo.date.getWeekOfYear=function(D,C){if(arguments.length==1){C=0}var B=new Date(D.getFullYear(),0,1);var A=B.getDay();B.setDate(B.getDate()-A+C-(A>C?7:0));return Math.floor((D.getTime()-B.getTime())/604800000)};dojo.date.setIsoWeekOfYear=function(C,A,B){if(arguments.length==1){B=1}dojo.unimplemented("dojo.date.setIsoWeekOfYear")};dojo.date.getIsoWeekOfYear=function(B,A){if(arguments.length==1){A=1}dojo.unimplemented("dojo.date.getIsoWeekOfYear")};dojo.date.shortTimezones=["IDLW","BET","HST","MART","AKST","PST","MST","CST","EST","AST","NFT","BST","FST","AT","GMT","CET","EET","MSK","IRT","GST","AFT","AGTT","IST","NPT","ALMT","MMT","JT","AWST","JST","ACST","AEST","LHST","VUT","NFT","NZT","CHAST","PHOT","LINT"];dojo.date.timezoneOffsets=[-720,-660,-600,-570,-540,-480,-420,-360,-300,-240,-210,-180,-120,-60,0,60,120,180,210,240,270,300,330,345,360,390,420,480,540,570,600,630,660,690,720,765,780,840];dojo.date.getDaysInMonth=function(B){var A=B.getMonth();var C=[31,28,31,30,31,30,31,31,30,31,30,31];if(A==1&&dojo.date.isLeapYear(B)){return 29}else{return C[A]}};dojo.date.isLeapYear=function(A){var B=A.getFullYear();return(B%400==0)?true:(B%100==0)?false:(B%4==0)?true:false};dojo.date.getTimezoneName=function(A){var D=A.toString();var F="";var C;var E=D.indexOf("(");if(E>-1){E++;F=D.substring(E,D.indexOf(")"))}else{var B=/([A-Z\/]+) \d{4}$/;if((C=D.match(B))){F=C[1]}else{D=A.toLocaleString();B=/ ([A-Z\/]+)$/;if((C=D.match(B))){F=C[1]}}}return F=="AM"||F=="PM"?"":F};dojo.date.getOrdinal=function(A){var B=A.getDate();if(B%100!=11&&B%10==1){return"st"}else{if(B%100!=12&&B%10==2){return"nd"}else{if(B%100!=13&&B%10==3){return"rd"}else{return"th"}}}};dojo.date.compareTypes={DATE:1,TIME:2};dojo.date.compare=function(_4bd,_4be,_4bf){var dA=_4bd;var dB=_4be||new Date();var now=new Date();with(dojo.date.compareTypes){var opt=_4bf||(DATE|TIME);var d1=new Date((opt&DATE)?dA.getFullYear():now.getFullYear(),(opt&DATE)?dA.getMonth():now.getMonth(),(opt&DATE)?dA.getDate():now.getDate(),(opt&TIME)?dA.getHours():0,(opt&TIME)?dA.getMinutes():0,(opt&TIME)?dA.getSeconds():0);var d2=new Date((opt&DATE)?dB.getFullYear():now.getFullYear(),(opt&DATE)?dB.getMonth():now.getMonth(),(opt&DATE)?dB.getDate():now.getDate(),(opt&TIME)?dB.getHours():0,(opt&TIME)?dB.getMinutes():0,(opt&TIME)?dB.getSeconds():0)}if(d1.valueOf()>d2.valueOf()){return 1}if(d1.valueOf()<d2.valueOf()){return -1}return 0};dojo.date.dateParts={YEAR:0,MONTH:1,DAY:2,HOUR:3,MINUTE:4,SECOND:5,MILLISECOND:6,QUARTER:7,WEEK:8,WEEKDAY:9};dojo.date.add=function(dt,_4c7,incr){if(typeof dt=="number"){dt=new Date(dt)}function fixOvershoot(){if(sum.getDate()<dt.getDate()){sum.setDate(0)}}var sum=new Date(dt);with(dojo.date.dateParts){switch(_4c7){case YEAR:sum.setFullYear(dt.getFullYear()+incr);fixOvershoot();break;case QUARTER:incr*=3;case MONTH:sum.setMonth(dt.getMonth()+incr);fixOvershoot();break;case WEEK:incr*=7;case DAY:sum.setDate(dt.getDate()+incr);break;case WEEKDAY:var dat=dt.getDate();var _4cb=0;var days=0;var strt=0;var trgt=0;var adj=0;var mod=incr%5;if(mod==0){days=(incr>0)?5:-5;_4cb=(incr>0)?((incr-5)/5):((incr+5)/5)}else{days=mod;_4cb=parseInt(incr/5)}strt=dt.getDay();if(strt==6&&incr>0){adj=1}else{if(strt==0&&incr<0){adj=-1}}trgt=(strt+days);if(trgt==0||trgt==6){adj=(incr>0)?2:-2}sum.setDate(dat+(7*_4cb)+days+adj);break;case HOUR:sum.setHours(sum.getHours()+incr);break;case MINUTE:sum.setMinutes(sum.getMinutes()+incr);break;case SECOND:sum.setSeconds(sum.getSeconds()+incr);break;case MILLISECOND:sum.setMilliseconds(sum.getMilliseconds()+incr);break;default:break}}return sum};dojo.date.diff=function(dtA,dtB,_4d3){if(typeof dtA=="number"){dtA=new Date(dtA)}if(typeof dtB=="number"){dtB=new Date(dtB)}var _4d4=dtB.getFullYear()-dtA.getFullYear();var _4d5=(dtB.getMonth()-dtA.getMonth())+(_4d4*12);var _4d6=dtB.getTime()-dtA.getTime();var _4d7=_4d6/1000;var _4d8=_4d7/60;var _4d9=_4d8/60;var _4da=_4d9/24;var _4db=_4da/7;var _4dc=0;with(dojo.date.dateParts){switch(_4d3){case YEAR:_4dc=_4d4;break;case QUARTER:var mA=dtA.getMonth();var mB=dtB.getMonth();var qA=Math.floor(mA/3)+1;var qB=Math.floor(mB/3)+1;qB+=(_4d4*4);_4dc=qB-qA;break;case MONTH:_4dc=_4d5;break;case WEEK:_4dc=parseInt(_4db);break;case DAY:_4dc=_4da;break;case WEEKDAY:var days=Math.round(_4da);var _4e2=parseInt(days/7);var mod=days%7;if(mod==0){days=_4e2*5}else{var adj=0;var aDay=dtA.getDay();var bDay=dtB.getDay();_4e2=parseInt(days/7);mod=days%7;var _4e7=new Date(dtA);_4e7.setDate(_4e7.getDate()+(_4e2*7));var _4e8=_4e7.getDay();if(_4da>0){switch(true){case aDay==6:adj=-1;break;case aDay==0:adj=0;break;case bDay==6:adj=-1;break;case bDay==0:adj=-2;break;case (_4e8+mod)>5:adj=-2;break;default:break}}else{if(_4da<0){switch(true){case aDay==6:adj=0;break;case aDay==0:adj=1;break;case bDay==6:adj=2;break;case bDay==0:adj=1;break;case (_4e8+mod)<0:adj=2;break;default:break}}}days+=adj;days-=(_4e2*2)}_4dc=days;break;case HOUR:_4dc=_4d9;break;case MINUTE:_4dc=_4d8;break;case SECOND:_4dc=_4d7;break;case MILLISECOND:_4dc=_4d6;break;default:break}}return Math.round(_4dc)};dojo.provide("dojo.date.supplemental");dojo.date.getFirstDayOfWeek=function(A){var C={mv:5,ae:6,af:6,bh:6,dj:6,dz:6,eg:6,er:6,et:6,iq:6,ir:6,jo:6,ke:6,kw:6,lb:6,ly:6,ma:6,om:6,qa:6,sa:6,sd:6,so:6,tn:6,ye:6,as:0,au:0,az:0,bw:0,ca:0,cn:0,fo:0,ge:0,gl:0,gu:0,hk:0,ie:0,il:0,is:0,jm:0,jp:0,kg:0,kr:0,la:0,mh:0,mo:0,mp:0,mt:0,nz:0,ph:0,pk:0,sg:0,th:0,tt:0,tw:0,um:0,us:0,uz:0,vi:0,za:0,zw:0,et:0,mw:0,ng:0,tj:0,gb:0,sy:4};A=dojo.hostenv.normalizeLocale(A);var B=A.split("-")[1];var D=C[B];return(typeof D=="undefined")?1:D};dojo.date.getWeekend=function(F){var E={eg:5,il:5,sy:5,"in":0,ae:4,bh:4,dz:4,iq:4,jo:4,kw:4,lb:4,ly:4,ma:4,om:4,qa:4,sa:4,sd:4,tn:4,ye:4};var C={ae:5,bh:5,dz:5,iq:5,jo:5,kw:5,lb:5,ly:5,ma:5,om:5,qa:5,sa:5,sd:5,tn:5,ye:5,af:5,ir:5,eg:6,il:6,sy:6};F=dojo.hostenv.normalizeLocale(F);var D=F.split("-")[1];var B=E[D];var A=C[D];if(typeof B=="undefined"){B=6}if(typeof A=="undefined"){A=0}return{start:B,end:A}};dojo.date.isWeekend=function(A,D){var C=dojo.date.getWeekend(D);var B=(A||new Date()).getDay();if(C.end<C.start){C.end+=7;if(B<C.start){B+=7}}return B>=C.start&&B<=C.end};dojo.provide("dojo.i18n.common");dojo.i18n.getLocalization=function(E,D,C){dojo.hostenv.preloadLocalizations();C=dojo.hostenv.normalizeLocale(C);var I=C.split("-");var H=[E,"nls",D].join(".");var G=dojo.hostenv.findModule(H,true);var F;for(var A=I.length;A>0;A--){var B=I.slice(0,A).join("_");if(G[B]){F=G[B];break}}if(!F){F=G.ROOT}if(F){var J=function(){};J.prototype=F;return new J()}dojo.raise("Bundle not found: "+D+" in "+E+" , locale="+C)};dojo.i18n.isLTR=function(A){var C=dojo.hostenv.normalizeLocale(A).split("-")[0];var B={ar:true,fa:true,he:true,ur:true,yi:true};return !B[C]};dojo.provide("dojo.date.format");dojo.require("dojo.lang.array");dojo.require("dojo.lang.common");dojo.require("dojo.lang.func");dojo.require("dojo.string.common");(function(){dojo.date.format=function(L,K){if(typeof K=="string"){dojo.deprecated("dojo.date.format","To format dates with POSIX-style strings, please use dojo.date.strftime instead","0.5");return dojo.date.strftime(L,K)}function M(O,N){return N.replace(/([a-z])\1*/ig,function(Z){var k;var i=Z.charAt(0);var T=Z.length;var R;var j=["abbr","wide","narrow"];switch(i){case"G":if(T>3){dojo.unimplemented("Era format not implemented")}k=C.eras[O.getFullYear()<0?1:0];break;case"y":k=O.getFullYear();switch(T){case 1:break;case 2:k=String(k).substr(-2);break;default:R=true}break;case"Q":case"q":k=Math.ceil((O.getMonth()+1)/3);switch(T){case 1:case 2:R=true;break;case 3:case 4:dojo.unimplemented("Quarter format not implemented")}break;case"M":case"L":var S=O.getMonth();var a;switch(T){case 1:case 2:k=S+1;R=true;break;case 3:case 4:case 5:a=j[T-3];break}if(a){var g=(i=="L")?"standalone":"format";var P=["months",g,a].join("-");k=C[P][S]}break;case"w":var Y=0;k=dojo.date.getWeekOfYear(O,Y);R=true;break;case"d":k=O.getDate();R=true;break;case"D":k=dojo.date.getDayOfYear(O);R=true;break;case"E":case"e":case"c":var f=O.getDay();var a;switch(T){case 1:case 2:if(i=="e"){var W=dojo.date.getFirstDayOfWeek(K.locale);f=(f-W+7)%7}if(i!="c"){k=f+1;R=true;break}case 3:case 4:case 5:a=j[T-3];break}if(a){var g=(i=="c")?"standalone":"format";var P=["days",g,a].join("-");k=C[P][f]}break;case"a":var V=(O.getHours()<12)?"am":"pm";k=C[V];break;case"h":case"H":case"K":case"k":var X=O.getHours();switch(i){case"h":k=(X%12)||12;break;case"H":k=X;break;case"K":k=(X%12);break;case"k":k=X||24;break}R=true;break;case"m":k=O.getMinutes();R=true;break;case"s":k=O.getSeconds();R=true;break;case"S":k=Math.round(O.getMilliseconds()*Math.pow(10,T-3));break;case"v":case"z":k=dojo.date.getTimezoneName(O);if(k){break}T=4;case"Z":var Q=O.getTimezoneOffset();var U=[(Q<=0?"+":"-"),dojo.string.pad(Math.floor(Math.abs(Q)/60),2),dojo.string.pad(Math.abs(Q)%60,2)];if(T==4){U.splice(0,0,"GMT");U.splice(3,0,":")}k=U.join("");break;case"Y":case"u":case"W":case"F":case"g":case"A":dojo.debug(Z+" modifier not yet implemented");k="?";break;default:dojo.raise("dojo.date.format: invalid pattern char: "+N)}if(R){k=dojo.string.pad(k,T)}return k})}K=K||{};var I=dojo.hostenv.normalizeLocale(K.locale);var H=K.formatLength||"full";var C=dojo.date._getGregorianBundle(I);var J=[];var G=dojo.lang.curry(this,M,L);if(K.selector!="timeOnly"){var F=K.datePattern||C["dateFormat-"+H];if(F){J.push(B(F,G))}}if(K.selector!="dateOnly"){var E=K.timePattern||C["timeFormat-"+H];if(E){J.push(B(E,G))}}var D=J.join(" ");return D};dojo.date.parse=function(S,Q){Q=Q||{};var O=dojo.hostenv.normalizeLocale(Q.locale);var k=dojo.date._getGregorianBundle(O);var L=Q.formatLength||"full";if(!Q.selector){Q.selector="dateOnly"}var H=Q.datePattern||k["dateFormat-"+L];var F=Q.timePattern||k["timeFormat-"+L];var E;if(Q.selector=="dateOnly"){E=H}else{if(Q.selector=="timeOnly"){E=F}else{if(Q.selector=="dateTime"){E=H+" "+F}else{var C="dojo.date.parse: Unknown selector param passed: '"+Q.selector+"'.";C+=" Defaulting to date pattern.";dojo.debug(C);E=H}}}var R=[];var P=B(E,dojo.lang.curry(this,A,R,k,Q));var M=new RegExp("^"+P+"$");var K=M.exec(S);if(!K){return null}var I=["abbr","wide","narrow"];var G=new Date(1972,0);var h={};for(var f=1;f<K.length;f++){var N=R[f-1];var a=N.length;var U=K[f];switch(N.charAt(0)){case"y":if(a!=2){G.setFullYear(U);h.year=U}else{if(U<100){U=Number(U);var T=""+new Date().getFullYear();var Y=T.substring(0,2)*100;var X=Number(T.substring(2,4));var V=Math.min(X+20,99);var J=(U<V)?Y+U:Y-100+U;G.setFullYear(J);h.year=J}else{if(Q.strict){return null}G.setFullYear(U);h.year=U}}break;case"M":if(a>2){if(!Q.strict){U=U.replace(/\./g,"");U=U.toLowerCase()}var d=k["months-format-"+I[a-3]].concat();for(var c=0;c<d.length;c++){if(!Q.strict){d[c]=d[c].toLowerCase()}if(U==d[c]){G.setMonth(c);h.month=c;break}}if(c==d.length){dojo.debug("dojo.date.parse: Could not parse month name: '"+U+"'.");return null}}else{G.setMonth(U-1);h.month=U-1}break;case"E":case"e":if(!Q.strict){U=U.toLowerCase()}var D=k["days-format-"+I[a-3]].concat();for(var c=0;c<D.length;c++){if(!Q.strict){D[c]=D[c].toLowerCase()}if(U==D[c]){break}}if(c==D.length){dojo.debug("dojo.date.parse: Could not parse weekday name: '"+U+"'.");return null}break;case"d":G.setDate(U);h.date=U;break;case"a":var Z=Q.am||k.am;var g=Q.pm||k.pm;if(!Q.strict){U=U.replace(/\./g,"").toLowerCase();Z=Z.replace(/\./g,"").toLowerCase();g=g.replace(/\./g,"").toLowerCase()}if(Q.strict&&U!=Z&&U!=g){dojo.debug("dojo.date.parse: Could not parse am/pm part.");return null}var W=G.getHours();if(U==g&&W<12){G.setHours(W+12)}else{if(U==Z&&W==12){G.setHours(0)}}break;case"K":if(U==24){U=0}case"h":case"H":case"k":if(U>23){dojo.debug("dojo.date.parse: Illegal hours value");return null}G.setHours(U);break;case"m":G.setMinutes(U);break;case"s":G.setSeconds(U);break;case"S":G.setMilliseconds(U);break;default:dojo.unimplemented("dojo.date.parse: unsupported pattern char="+N.charAt(0))}}if(h.year&&G.getFullYear()!=h.year){dojo.debug("Parsed year: '"+G.getFullYear()+"' did not match input year: '"+h.year+"'.");return null}if(h.month&&G.getMonth()!=h.month){dojo.debug("Parsed month: '"+G.getMonth()+"' did not match input month: '"+h.month+"'.");return null}if(h.date&&G.getDate()!=h.date){dojo.debug("Parsed day of month: '"+G.getDate()+"' did not match input day of month: '"+h.date+"'.");return null}return G};function B(J,I,H,G){var F=function(K){return K};I=I||F;H=H||F;G=G||F;var D=J.match(/(''|[^'])+/g);var C=false;for(var E=0;E<D.length;E++){if(!D[E]){D[E]=""}else{D[E]=(C?H:I)(D[E]);C=!C}}return G(D.join(""))}function A(C,F,E,D){return D.replace(/([a-z])\1*/ig,function(H){var J;var L=H.charAt(0);var G=H.length;switch(L){case"y":J="\\d"+((G==2)?"{2,4}":"+");break;case"M":J=(G>2)?"\\S+":"\\d{1,2}";break;case"d":J="\\d{1,2}";break;case"E":J="\\S+";break;case"h":case"H":case"K":case"k":J="\\d{1,2}";break;case"m":case"s":J="[0-5]\\d";break;case"S":J="\\d{1,3}";break;case"a":var K=E.am||F.am||"AM";var I=E.pm||F.pm||"PM";if(E.strict){J=K+"|"+I}else{J=K;J+=(K!=K.toLowerCase())?"|"+K.toLowerCase():"";J+="|";J+=(I!=I.toLowerCase())?I+"|"+I.toLowerCase():I}break;default:dojo.unimplemented("parse of date format, pattern="+D)}if(C){C.push(H)}return"\\s*("+J+")\\s*"})}})();dojo.date.strftime=function(C,B,O){var N=null;function L(Q,R){return dojo.string.pad(Q,R||2,N||"0")}var D=dojo.date._getGregorianBundle(O);function G(R){switch(R){case"a":return dojo.date.getDayShortName(C,O);case"A":return dojo.date.getDayName(C,O);case"b":case"h":return dojo.date.getMonthShortName(C,O);case"B":return dojo.date.getMonthName(C,O);case"c":return dojo.date.format(C,{locale:O});case"C":return L(Math.floor(C.getFullYear()/100));case"d":return L(C.getDate());case"D":return G("m")+"/"+G("d")+"/"+G("y");case"e":if(N==null){N=" "}return L(C.getDate());case"f":if(N==null){N=" "}return L(C.getMonth()+1);case"g":break;case"G":dojo.unimplemented("unimplemented modifier 'G'");break;case"F":return G("Y")+"-"+G("m")+"-"+G("d");case"H":return L(C.getHours());case"I":return L(C.getHours()%12||12);case"j":return L(dojo.date.getDayOfYear(C),3);case"k":if(N==null){N=" "}return L(C.getHours());case"l":if(N==null){N=" "}return L(C.getHours()%12||12);case"m":return L(C.getMonth()+1);case"M":return L(C.getMinutes());case"n":return"\n";case"p":return D[C.getHours()<12?"am":"pm"];case"r":return G("I")+":"+G("M")+":"+G("S")+" "+G("p");case"R":return G("H")+":"+G("M");case"S":return L(C.getSeconds());case"t":return"\t";case"T":return G("H")+":"+G("M")+":"+G("S");case"u":return String(C.getDay()||7);case"U":return L(dojo.date.getWeekOfYear(C));case"V":return L(dojo.date.getIsoWeekOfYear(C));case"W":return L(dojo.date.getWeekOfYear(C,1));case"w":return String(C.getDay());case"x":return dojo.date.format(C,{selector:"dateOnly",locale:O});case"X":return dojo.date.format(C,{selector:"timeOnly",locale:O});case"y":return L(C.getFullYear()%100);case"Y":return String(C.getFullYear());case"z":var Q=C.getTimezoneOffset();return(Q>0?"-":"+")+L(Math.floor(Math.abs(Q)/60))+":"+L(Math.abs(Q)%60);case"Z":return dojo.date.getTimezoneName(C);case"%":return"%"}}var P="";var F=0;var M=0;var K=null;while((M=B.indexOf("%",F))!=-1){P+=B.substring(F,M++);switch(B.charAt(M++)){case"_":N=" ";break;case"-":N="";break;case"0":N="0";break;case"^":K="upper";break;case"*":K="lower";break;case"#":K="swap";break;default:N=null;M--;break}var J=G(B.charAt(M++));switch(K){case"upper":J=J.toUpperCase();break;case"lower":J=J.toLowerCase();break;case"swap":var I=J.toLowerCase();var H="";var E=0;var A="";while(E<J.length){A=J.charAt(E);H+=(A==I.charAt(E))?A.toUpperCase():A.toLowerCase();E++}J=H;break;default:break}K=null;P+=J;F=M}P+=B.substring(F);return P};(function(){var A=[];dojo.date.addCustomFormats=function(C,B){A.push({pkg:C,name:B})};dojo.date._getGregorianBundle=function(C){var B={};dojo.lang.forEach(A,function(E){var D=dojo.i18n.getLocalization(E.pkg,E.name,C);B=dojo.lang.mixin(B,D)},this);return B}})();dojo.date.addCustomFormats("dojo.i18n.calendar","gregorian");dojo.date.addCustomFormats("dojo.i18n.calendar","gregorianExtras");dojo.date.getNames=function(G,F,A,D){var E;var C=dojo.date._getGregorianBundle(D);var B=[G,A,F];if(A=="standAlone"){E=C[B.join("-")]}B[1]="format";return(E||C[B.join("-")]).concat()};dojo.date.getDayName=function(B,A){return dojo.date.getNames("days","wide","format",A)[B.getDay()]};dojo.date.getDayShortName=function(B,A){return dojo.date.getNames("days","abbr","format",A)[B.getDay()]};dojo.date.getMonthName=function(B,A){return dojo.date.getNames("months","wide","format",A)[B.getMonth()]};dojo.date.getMonthShortName=function(A,B){return dojo.date.getNames("months","abbr","format",B)[A.getMonth()]};dojo.date.toRelativeString=function(E){var B=new Date();var D=(B-E)/1000;var A=" ago";var C=false;if(D<0){C=true;A=" from now";D=-D}if(D<60){D=Math.round(D);return D+" second"+(D==1?"":"s")+A}if(D<60*60){D=Math.round(D/60);return D+" minute"+(D==1?"":"s")+A}if(D<60*60*24){D=Math.round(D/3600);return D+" hour"+(D==1?"":"s")+A}if(D<60*60*24*7){D=Math.round(D/(3600*24));if(D==1){return C?"Tomorrow":"Yesterday"}else{return D+" days"+A}}return dojo.date.format(E)};dojo.date.toSql=function(B,A){return dojo.date.strftime(B,"%F"+!A?" %T":"")};dojo.date.fromSql=function(B){var A=B.split(/[\- :]/g);while(A.length<6){A.push(0)}return new Date(A[0],(parseInt(A[1],10)-1),A[2],A[3],A[4],A[5])};dojo.provide("dojo.math");dojo.math.degToRad=function(A){return(A*Math.PI)/180};dojo.math.radToDeg=function(A){return(A*180)/Math.PI};dojo.math.factorial=function(C){if(C<1){return 0}var B=1;for(var A=1;A<=C;A++){B*=A}return B};dojo.math.permutations=function(B,A){if(B==0||A==0){return 1}return(dojo.math.factorial(B)/dojo.math.factorial(B-A))};dojo.math.combinations=function(B,A){if(B==0||A==0){return 1}return(dojo.math.factorial(B)/(dojo.math.factorial(B-A)*dojo.math.factorial(A)))};dojo.math.bernstein=function(B,C,A){return(dojo.math.combinations(C,A)*Math.pow(B,A)*Math.pow(1-B,C-A))};dojo.math.gaussianRandom=function(){var A=2;do{var C=2*Math.random()-1;var B=2*Math.random()-1;A=C*C+B*B}while(A>=1);A=Math.sqrt((-2*Math.log(A))/A);return C*A};dojo.math.mean=function(){var C=dojo.lang.isArray(arguments[0])?arguments[0]:arguments;var A=0;for(var B=0;B<C.length;B++){A+=C[B]}return A/C.length};dojo.math.round=function(C,B){if(!B){var A=1}else{var A=Math.pow(10,B)}return Math.round(C*A)/A};dojo.math.sd=dojo.math.standardDeviation=function(){var A=dojo.lang.isArray(arguments[0])?arguments[0]:arguments;return Math.sqrt(dojo.math.variance(A))};dojo.math.variance=function(){var C=dojo.lang.isArray(arguments[0])?arguments[0]:arguments;var B=0,A=0;for(var D=0;D<C.length;D++){B+=C[D];A+=Math.pow(C[D],2)}return(A/C.length)-Math.pow(B/C.length,2)};dojo.math.range=function(B,A,D){if(arguments.length<2){A=B;B=0}if(arguments.length<3){D=1}var E=[];if(D>0){for(var C=B;C<A;C+=D){E.push(C)}}else{if(D<0){for(var C=B;C>A;C+=D){E.push(C)}}else{throw new Error("dojo.math.range: step must be non-zero")}}return E};dojo.provide("dojo.collections.Store");dojo.require("dojo.lang.common");dojo.collections.Store=function(C){var B=[];var A={};this.keyField="Id";this.get=function(){return B};this.getByKey=function(D){return A[D]};this.getByIndex=function(D){return B[D]};this.getIndexOf=function(E){for(var D=0;D<B.length;D++){if(B[D].key==E){return D}}return -1};this.getData=function(){var D=[];for(var E=0;E<B.length;E++){D.push(B[E].src)}return D};this.getDataByKey=function(D){if(A[D]!=null){return A[D].src}return null};this.getIndexOfData=function(E){for(var D=0;D<B.length;D++){if(B[D].src==E){return D}}return -1};this.getDataByIndex=function(D){if(B[D]){return B[D].src}return null};this.update=function(I,K,E,H){var G=K.split("."),J=0,D=I,F;if(G.length>1){F=G.pop();do{if(G[J].indexOf("()")>-1){var L=G[J++].split("()")[0];if(!D[L]){dojo.raise("dojo.collections.Store.getField(obj, '"+F+"'): '"+L+"' is not a property of the passed object.")}else{D=D[L]()}}else{D=D[G[J++]]}}while(J<G.length&&D!=null)}else{F=G[0]}I[F]=E;if(!H){this.onUpdateField(I,K,E)}};this.forEach=function(E){if(Array.forEach){Array.forEach(B,E,this)}else{for(var D=0;D<B.length;D++){E.call(this,B[D])}}};this.forEachData=function(F){if(Array.forEach){Array.forEach(this.getData(),F,this)}else{var D=this.getData();for(var E=0;E<D.length;E++){F.call(this,D[E])}}};this.setData=function(D,E){B=[];for(var F=0;F<D.length;F++){var G={key:D[F][this.keyField],src:D[F]};B.push(G);A[G.key]=G}if(!E){this.onSetData()}};this.clearData=function(D){B=[];A={};if(!D){this.onClearData()}};this.addData=function(F,E,H){var D=E||F[this.keyField];if(A[D]!=null){var G=A[D];G.src=F}else{var G={key:D,src:F};B.push(G);A[G.key]=G}if(!H){this.onAddData(G)}};this.addDataRange=function(D,G){var I=[];for(var F=0;F<D.length;F++){var E=D[F][this.keyField];if(A[E]!=null){var H=A[E];H.src=D[F]}else{var H={key:E,src:D[F]};B.push(H);A[E]=H}I.push(H)}if(!G){this.onAddDataRange(I)}};this.addDataByIndex=function(I,D,G,H){var E=G||I[this.keyField];if(A[E]!=null){var F=this.getIndexOf(E);var J=B.splice(F,1);J.src=I}else{var J={key:E,src:I};A[E]=J}B.splice(D,0,J);if(!H){this.onAddData(J)}};this.addDataRangeByIndex=function(E,D,K){var J=[];for(var H=0;H<E.length;H++){var F=E[H][this.keyField];if(A[F]!=null){var G=this.getIndexOf(F);var I=B.splice(G,1);I.src=E[H]}else{var I={key:F,src:E[H]};A[F]=I}J.push(I)}B.splice(D,0,J);if(!K){this.onAddDataRange(J)}};this.removeData=function(G,F){var D=-1;var H=null;for(var E=0;E<B.length;E++){if(B[E].src==G){D=E;H=B[E];break}}if(!F){this.onRemoveData(H)}if(D>-1){B.splice(D,1);delete A[H.key]}};this.removeDataRange=function(D,H,G){var E=B.splice(D,H);for(var F=0;F<E.length;F++){delete A[E[F].key]}if(!G){this.onRemoveDataRange(E)}return E};this.removeDataByKey=function(E,D){this.removeData(this.getDataByKey(E),D)};this.removeDataByIndex=function(D,E){this.removeData(this.getDataByIndex(D),E)};if(C&&C.length&&C[0]){this.setData(C,true)}};dojo.extend(dojo.collections.Store,{getField:function(E,B){var A=B.split("."),D=0,F=E;do{if(A[D].indexOf("()")>-1){var C=A[D++].split("()")[0];if(!F[C]){dojo.raise("dojo.collections.Store.getField(obj, '"+B+"'): '"+C+"' is not a property of the passed object.")}else{F=F[C]()}}else{F=F[A[D++]]}}while(D<A.length&&F!=null);if(D<A.length){dojo.raise("dojo.collections.Store.getField(obj, '"+B+"'): '"+B+"' is not a property of the passed object.")}return F},getFromHtml:function(G,B,F){var E=B.rows;var D=function(O){var M={};for(var I=0;I<G.length;I++){var N=M;var K=O.cells[I].innerHTML;var L=G[I].getField();if(L.indexOf(".")>-1){L=L.split(".");while(L.length>1){var P=L.shift();N[P]={};N=N[P]}L=L[0]}var J=G[I].getType();if(J==String){N[L]=K}else{if(K){N[L]=new J(K)}else{N[L]=new J()}}}return M};var A=[];for(var C=0;C<E.length;C++){var H=D(E[C]);if(F){F(H,E[C])}A.push(H)}return A},onSetData:function(){},onClearData:function(){},onAddData:function(A){},onAddDataRange:function(A){},onRemoveData:function(A){},onRemoveDataRange:function(A){},onUpdateField:function(B,A,C){}});dojo.provide("dojo.widget.FilteringTable");dojo.require("dojo.html.util");dojo.require("dojo.html.style");dojo.require("dojo.html.selection");dojo.require("dojo.event.*");dojo.require("dojo.widget.*");dojo.require("dojo.widget.HtmlWidget");dojo.widget.defineWidget("dojo.widget.FilteringTable",dojo.widget.HtmlWidget,function(){this.store=new dojo.collections.Store();this.valueField="Id";this.multiple=false;this.maxSelect=0;this.maxSortable=1;this.minRows=0;this.defaultDateFormat="%D";this.isInitialized=false;this.alternateRows=false;this.columns=[];this.sortInformation=[{index:0,direction:0}];this.headClass="";this.tbodyClass="";this.headerClass="";this.headerUpClass="selectedUp";this.headerDownClass="selectedDown";this.rowClass="";this.rowAlternateClass="alt";this.rowSelectedClass="selected";this.columnSelected="sorted-column"},{isContainer:false,templatePath:null,templateCssPath:null,getTypeFromString:function(B){var D=B.split("."),A=0,C=dj_global;do{C=C[D[A++]]}while(A<D.length&&C);return(C!=dj_global)?C:null},getByRow:function(A){return this.store.getByKey(dojo.html.getAttribute(A,"value"))},getDataByRow:function(A){return this.store.getDataByKey(dojo.html.getAttribute(A,"value"))},getRow:function(C){var B=this.domNode.tBodies[0].rows;for(var A=0;A<B.length;A++){if(this.store.getDataByKey(dojo.html.getAttribute(B[A],"value"))==C){return B[A]}}return null},getColumnIndex:function(B){for(var A=0;A<this.columns.length;A++){if(this.columns[A].getField()==B){return A}}return -1},getSelectedData:function(){var C=this.store.get();var A=[];for(var B=0;B<C.length;B++){if(C[B].isSelected){A.push(C[B].src)}}if(this.multiple){return A}else{return A[0]}},isSelected:function(C){var B=this.store.get();for(var A=0;A<B.length;A++){if(B[A].src==C){return true}}return false},isValueSelected:function(B){var A=this.store.getByKey(B);if(A){return A.isSelected}return false},isIndexSelected:function(A){var B=this.store.getByIndex(A);if(B){return B.isSelected}return false},isRowSelected:function(B){var A=this.getByRow(B);if(A){return A.isSelected}return false},reset:function(){this.store.clearData();this.columns=[];this.sortInformation=[{index:0,direction:0}];this.resetSelections();this.isInitialized=false;this.onReset()},resetSelections:function(){this.store.forEach(function(A){A.isSelected=false})},onReset:function(){},select:function(C){var B=this.store.get();for(var A=0;A<B.length;A++){if(B[A].src==C){B[A].isSelected=true;break}}this.onDataSelect(C)},selectByValue:function(A){this.select(this.store.getDataByKey(A))},selectByIndex:function(A){this.select(this.store.getDataByIndex(A))},selectByRow:function(A){this.select(this.getDataByRow(A))},selectAll:function(){this.store.forEach(function(A){A.isSelected=true})},onDataSelect:function(A){},toggleSelection:function(C){var B=this.store.get();for(var A=0;A<B.length;A++){if(B[A].src==C){B[A].isSelected=!B[A].isSelected;break}}this.onDataToggle(C)},toggleSelectionByValue:function(A){this.toggleSelection(this.store.getDataByKey(A))},toggleSelectionByIndex:function(A){this.toggleSelection(this.store.getDataByIndex(A))},toggleSelectionByRow:function(A){this.toggleSelection(this.getDataByRow(A))},toggleAll:function(){this.store.forEach(function(A){A.isSelected=!A.isSelected})},onDataToggle:function(A){},_meta:{field:null,format:null,filterer:null,noSort:false,sortType:"String",dataType:String,sortFunction:null,filterFunction:null,label:null,align:"left",valign:"middle",getField:function(){return this.field||this.label},getType:function(){return this.dataType}},createMetaData:function(B){for(var A in this._meta){if(!B[A]){B[A]=this._meta[A]}}if(!B.label){B.label=B.field}if(!B.filterFunction){B.filterFunction=this._defaultFilter}return B},parseMetadata:function(H){this.columns=[];this.sortInformation=[];var K=H.getElementsByTagName("tr")[0];var J=K.getElementsByTagName("td");if(J.length==0){J=K.getElementsByTagName("th")}for(var D=0;D<J.length;D++){var A=this.createMetaData({});if(dojo.html.hasAttribute(J[D],"align")){A.align=dojo.html.getAttribute(J[D],"align")}if(dojo.html.hasAttribute(J[D],"valign")){A.valign=dojo.html.getAttribute(J[D],"valign")}if(dojo.html.hasAttribute(J[D],"nosort")){A.noSort=(dojo.html.getAttribute(J[D],"nosort")=="true")}if(dojo.html.hasAttribute(J[D],"sortusing")){var I=dojo.html.getAttribute(J[D],"sortusing");var E=this.getTypeFromString(I);if(E!=null&&E!=window&&typeof (E)=="function"){A.sortFunction=E}}A.label=dojo.html.renderedTextContent(J[D]);if(dojo.html.hasAttribute(J[D],"field")){A.field=dojo.html.getAttribute(J[D],"field")}else{if(A.label.length>0){A.field=A.label}else{A.field="field"+D}}if(dojo.html.hasAttribute(J[D],"format")){A.format=dojo.html.getAttribute(J[D],"format")}if(dojo.html.hasAttribute(J[D],"dataType")){var G=dojo.html.getAttribute(J[D],"dataType");if(G.toLowerCase()=="html"||G.toLowerCase()=="markup"){A.sortType="__markup__"}else{var F=this.getTypeFromString(G);if(F){A.sortType=G;A.dataType=F}}}if(dojo.html.hasAttribute(J[D],"filterusing")){var I=dojo.html.getAttribute(J[D],"filterusing");var E=this.getTypeFromString(I);if(E!=null&&E!=window&&typeof (E)=="function"){A.filterFunction=E}}this.columns.push(A);if(dojo.html.hasAttribute(J[D],"sort")){var B={index:D,direction:0};var C=dojo.html.getAttribute(J[D],"sort");if(!isNaN(parseInt(C))){C=parseInt(C);B.direction=(C!=0)?1:0}else{B.direction=(C.toLowerCase()=="desc")?1:0}this.sortInformation.push(B)}}if(this.sortInformation.length==0){this.sortInformation.push({index:0,direction:0})}else{if(this.sortInformation.length>this.maxSortable){this.sortInformation.length=this.maxSortable}}},parseData:function(B){if(B.rows.length==0&&this.columns.length==0){return }var C=this;this["__selected__"]=[];var A=this.store.getFromHtml(this.columns,B,function(E,F){if(typeof (E[C.valueField])=="undefined"||E[C.valueField]==null){E[C.valueField]=dojo.html.getAttribute(F,"value")}if(dojo.html.getAttribute(F,"selected")=="true"){C.__selected__.push(E)}});this.store.setData(A,true);this.render();for(var D=0;D<this["__selected__"].length;D++){this.select(this["__selected__"][D])}this.renderSelections();delete this["__selected__"];this.isInitialized=true},onSelect:function(E){var F=dojo.html.getParentByType(E.target,"tr");if(dojo.html.hasAttribute(F,"emptyRow")){return }var A=dojo.html.getParentByType(F,"tbody");if(this.multiple){if(E.shiftKey){var G;var D=A.rows;for(var B=0;B<D.length;B++){if(D[B]==F){break}if(this.isRowSelected(D[B])){G=D[B]}}if(!G){G=F;for(;B<D.length;B++){if(this.isRowSelected(D[B])){F=D[B];break}}}this.resetSelections();if(G==F){this.toggleSelectionByRow(F)}else{var C=false;for(var B=0;B<D.length;B++){if(D[B]==G){C=true}if(C){this.selectByRow(D[B])}if(D[B]==F){C=false}}}}else{this.toggleSelectionByRow(F)}}else{this.resetSelections();this.toggleSelectionByRow(F)}this.renderSelections()},onSort:function(I){var H=this.sortIndex;var G=this.sortDirection;var F=I.target;var K=dojo.html.getParentByType(F,"tr");var E="td";if(K.getElementsByTagName(E).length==0){E="th"}var D=K.getElementsByTagName(E);var B=dojo.html.getParentByType(F,E);for(var C=0;C<D.length;C++){dojo.html.setClass(D[C],this.headerClass);if(D[C]==B){if(this.sortInformation[0].index!=C){this.sortInformation.unshift({index:C,direction:0})}else{this.sortInformation[0]={index:C,direction:(~this.sortInformation[0].direction)&1}}}}this.sortInformation.length=Math.min(this.sortInformation.length,this.maxSortable);for(var C=0;C<this.sortInformation.length;C++){var J=this.sortInformation[C].index;var A=(~this.sortInformation[C].direction)&1;dojo.html.setClass(D[J],A==0?this.headerDownClass:this.headerUpClass)}this.render()},onFilter:function(){},_defaultFilter:function(A){return true},setFilter:function(A,C){for(var B=0;B<this.columns.length;B++){if(this.columns[B].getField()==A){this.columns[B].filterFunction=C;break}}this.applyFilters()},setFilterByIndex:function(A,B){this.columns[A].filterFunction=B;this.applyFilters()},clearFilter:function(A){for(var B=0;B<this.columns.length;B++){if(this.columns[B].getField()==A){this.columns[B].filterFunction=this._defaultFilter;break}}this.applyFilters()},clearFilterByIndex:function(A){this.columns[A].filterFunction=this._defaultFilter;this.applyFilters()},clearFilters:function(){for(var A=0;A<this.columns.length;A++){this.columns[A].filterFunction=this._defaultFilter}var B=this.domNode.tBodies[0].rows;for(var A=0;A<B.length;A++){B[A].style.display="";if(this.alternateRows){dojo.html[((A%2==1)?"addClass":"removeClass")](B[A],this.rowAlternateClass)}}this.onFilter()},applyFilters:function(){var F=0;var E=this.domNode.tBodies[0].rows;for(var D=0;D<E.length;D++){var A=true;var G=E[D];for(var C=0;C<this.columns.length;C++){var B=this.store.getField(this.getDataByRow(G),this.columns[C].getField());if(this.columns[C].getType()==Date&&B!=null&&!B.getYear){B=new Date(B)}if(!this.columns[C].filterFunction(B)){A=false;break}}G.style.display=(A?"":"none");if(A&&this.alternateRows){dojo.html[((F++%2==1)?"addClass":"removeClass")](G,this.rowAlternateClass)}}this.onFilter()},createSorter:function(G){var D=this;var B=[];function C(J,I){var K=D.columns[J];var H=K.getField();return function(O,N){if(dojo.html.hasAttribute(O,"emptyRow")){return 1}if(dojo.html.hasAttribute(N,"emptyRow")){return -1}var M=D.store.getField(D.getDataByRow(O),H);var L=D.store.getField(D.getDataByRow(N),H);var P=0;if(M>L){P=1}if(M<L){P=-1}return I*P}}var F=0;var A=Math.min(G.length,this.maxSortable,this.columns.length);while(F<A){var E=(G[F].direction==0)?1:-1;B.push(C(G[F].index,E));F++}return function(J,I){var H=0;while(H<B.length){var K=B[H++](J,I);if(K!=0){return K}}return 0}},createRow:function(C){var E=document.createElement("tr");dojo.html.disableSelection(E);if(C.key!=null){E.setAttribute("value",C.key)}for(var B=0;B<this.columns.length;B++){var A=document.createElement("td");A.setAttribute("align",this.columns[B].align);A.setAttribute("valign",this.columns[B].valign);dojo.html.disableSelection(A);var D=this.store.getField(C.src,this.columns[B].getField());if(typeof (D)=="undefined"){D=""}this.fillCell(A,this.columns[B],D);E.appendChild(A)}return E},fillCell:function(B,C,D){if(C.sortType=="__markup__"){B.innerHTML=D}else{if(C.getType()==Date){D=new Date(D);if(!isNaN(D)){var A=this.defaultDateFormat;if(C.format){A=C.format}B.innerHTML=dojo.date.strftime(D,A)}else{B.innerHTML=D}}else{if("Number number int Integer float Float".indexOf(C.getType())>-1){if(D.length==0){D="0"}var E=parseFloat(D,10)+"";if(E.indexOf(".")>-1){E=dojo.math.round(parseFloat(D,10),2)}B.innerHTML=E}else{B.innerHTML=D}}}},prefill:function(){this.isInitialized=false;var B=this.domNode.tBodies[0];while(B.childNodes.length>0){B.removeChild(B.childNodes[0])}if(this.minRows>0){for(var D=0;D<this.minRows;D++){var E=document.createElement("tr");if(this.alternateRows){dojo.html[((D%2==1)?"addClass":"removeClass")](E,this.rowAlternateClass)}E.setAttribute("emptyRow","true");for(var C=0;C<this.columns.length;C++){var A=document.createElement("td");A.innerHTML="&nbsp;";E.appendChild(A)}B.appendChild(E)}}},init:function(){this.isInitialized=false;var F=this.domNode.getElementsByTagName("thead")[0];if(F.getElementsByTagName("tr").length==0){var K=document.createElement("tr");for(var D=0;D<this.columns.length;D++){var H=document.createElement("td");H.setAttribute("align",this.columns[D].align);H.setAttribute("valign",this.columns[D].valign);dojo.html.disableSelection(H);H.innerHTML=this.columns[D].label;K.appendChild(H);if(!this.columns[D].noSort){dojo.event.connect(H,"onclick",this,"onSort")}}dojo.html.prependChild(K,F)}if(this.store.get().length==0){return false}var G=this.domNode.tBodies[0].rows.length;if(!G||G==0||this.domNode.tBodies[0].rows[0].getAttribute("emptyRow")=="true"){G=0;var E=this.domNode.tBodies[0];while(E.childNodes.length>0){E.removeChild(E.childNodes[0])}var C=this.store.get();for(var D=0;D<C.length;D++){var K=this.createRow(C[D]);E.appendChild(K);G++}}if(this.minRows>0&&G<this.minRows){G=this.minRows-G;for(var D=0;D<G;D++){K=document.createElement("tr");K.setAttribute("emptyRow","true");for(var B=0;B<this.columns.length;B++){H=document.createElement("td");H.innerHTML="&nbsp;";K.appendChild(H)}E.appendChild(K)}}var K=this.domNode.getElementsByTagName("thead")[0].rows[0];var J="td";if(K.getElementsByTagName(J).length==0){J="th"}var I=K.getElementsByTagName(J);for(var D=0;D<I.length;D++){dojo.html.setClass(I[D],this.headerClass)}for(var D=0;D<this.sortInformation.length;D++){var G=this.sortInformation[D].index;var A=(~this.sortInformation[D].direction)&1;dojo.html.setClass(I[G],A==0?this.headerDownClass:this.headerUpClass)}this.isInitialized=true;return this.isInitialized},render:function(){if(!this.isInitialized){var B=this.init();if(!B){this.prefill();return }}var E=[];var A=this.domNode.tBodies[0];var F=-1;for(var C=0;C<A.rows.length;C++){E.push(A.rows[C])}var D=this.createSorter(this.sortInformation);if(D){E.sort(D)}for(var C=0;C<E.length;C++){if(this.alternateRows){dojo.html[((C%2==1)?"addClass":"removeClass")](E[C],this.rowAlternateClass)}dojo.html[(this.isRowSelected(A.rows[C])?"addClass":"removeClass")](A.rows[C],this.rowSelectedClass);A.appendChild(E[C])}},renderSelections:function(){var A=this.domNode.tBodies[0];for(var B=0;B<A.rows.length;B++){dojo.html[(this.isRowSelected(A.rows[B])?"addClass":"removeClass")](A.rows[B],this.rowSelectedClass)}},initialize:function(){var A=this;dojo.event.connect(this.store,"onSetData",function(){A.store.forEach(function(C){C.isSelected=false});A.isInitialized=false;var B=A.domNode.tBodies[0];if(B){while(B.childNodes.length>0){B.removeChild(B.childNodes[0])}}A.render()});dojo.event.connect(this.store,"onClearData",function(){A.isInitialized=false;A.render()});dojo.event.connect(this.store,"onAddData",function(B){var C=A.createRow(B);A.domNode.tBodies[0].appendChild(C);A.render()});dojo.event.connect(this.store,"onAddDataRange",function(B){for(var C=0;C<B.length;C++){B[C].isSelected=false;var D=A.createRow(B[C]);A.domNode.tBodies[0].appendChild(D)}A.render()});dojo.event.connect(this.store,"onRemoveData",function(B){var D=A.domNode.tBodies[0].rows;for(var C=0;C<D.length;C++){if(A.getDataByRow(D[C])==B.src){D[C].parentNode.removeChild(D[C]);break}}A.render()});dojo.event.connect(this.store,"onUpdateField",function(C,F,E){var D=A.getRow(C);var B=A.getColumnIndex(F);if(D&&D.cells[B]&&A.columns[B]){A.fillCell(D.cells[B],A.columns[B],E)}})},postCreate:function(){this.store.keyField=this.valueField;if(this.domNode){if(this.domNode.nodeName.toLowerCase()!="table"){}if(this.domNode.getElementsByTagName("thead")[0]){var C=this.domNode.getElementsByTagName("thead")[0];if(this.headClass.length>0){C.className=this.headClass}dojo.html.disableSelection(this.domNode);this.parseMetadata(C);var E="td";if(C.getElementsByTagName(E).length==0){E="th"}var D=C.getElementsByTagName(E);for(var B=0;B<D.length;B++){if(!this.columns[B].noSort){dojo.event.connect(D[B],"onclick",this,"onSort")}}}else{this.domNode.appendChild(document.createElement("thead"))}if(this.domNode.tBodies.length<1){var A=document.createElement("tbody");this.domNode.appendChild(A)}else{var A=this.domNode.tBodies[0]}if(this.tbodyClass.length>0){A.className=this.tbodyClass}dojo.event.connect(A,"onclick",this,"onSelect");this.parseData(A)}}});dojo.provide("sn.collections.SnRemoteStore");dojo.declare("sn.collections.SnRemoteStore",dojo.collections.Store,function(){},{remoteUrl:"",queryString:"",pageVar:"pageno",pageNo:0,request:null,setRemoteUrl:function(A){this.remoteUrl=A},setQuery:function(A){this.queryString=A},setPageVar:function(A){this.pageVar=A},setPageno:function(A){this.pageNo=A},resetIO:function(){if(this.request){this.request.abort()}},getNextPage:function(D,B){var C=this;var A=location.protocol+"//"+location.host+this.remoteUrl+"&"+this.queryString+"&"+this.pageVar+"="+this.pageNo;this.request=dojo.io.bind({url:A,load:function(F,H,E){var G;C.pageNo++;for(G in H){C.addData(H[G],null,true)}D[B].call(D,H)},error:function(F,E){D[B].call(C,null)},mimetype:"text/json"})}});dojo.provide("dojo.lang.timing.Timer");dojo.require("dojo.lang.func");dojo.lang.timing.Timer=function(A){this.timer=null;this.isRunning=false;this.interval=A;this.onStart=null;this.onStop=null};dojo.extend(dojo.lang.timing.Timer,{onTick:function(){},setInterval:function(A){if(this.isRunning){dj_global.clearInterval(this.timer)}this.interval=A;if(this.isRunning){this.timer=dj_global.setInterval(dojo.lang.hitch(this,"onTick"),this.interval)}},start:function(){if(typeof this.onStart=="function"){this.onStart()}this.isRunning=true;this.timer=dj_global.setInterval(dojo.lang.hitch(this,"onTick"),this.interval)},stop:function(){if(typeof this.onStop=="function"){this.onStop()}this.isRunning=false;dj_global.clearInterval(this.timer)}});dojo.provide("sn.widget.SnFilteringTable");dojo.widget.defineWidget("sn.widget.SnFilteringTable",[dojo.widget.FilteringTable],function(){this.store=new sn.collections.SnRemoteStore();sn.widget.SnFilteringTable.prototype.superclass=dojo.widget.FilteringTable},{remoteUrl:"",container:"",timerHandle:null,noMoreData:false,loadAllData:false,onLoadAllComplete:function(){},onDataUnselect:function(A){},resetSelections:function(){var A=this;this.store.forEach(function(B){B.isSelected=false;A.onDataUnselect(B.src)})},onSort:function(B){this.noMoreData=false;if(this.remoteUrl){this.timerHandle.stop();var A=this.domNode.tBodies[0];while(A.childNodes.length>0){A.removeChild(A.childNodes[0])}this.store.clearData();this.superclass.prototype.onSort.call(this,B);this.store.setPageno(0);this.store.resetIO();this.store.setQuery(this.getSortingQuery());this.timerHandle.start();return }else{this.superclass.prototype.onSort.call(this,B)}},postCreate:function(){var A=this;this.superclass.prototype.postCreate.call(this);if(this.remoteUrl){this.store.setRemoteUrl(this.remoteUrl);this.store.setQuery(this.query);this.timerHandle=new dojo.lang.timing.Timer(300);this.timerHandle.onTick=function(){A.loadMoreData(A)};this.timerHandle.start()}},getSortingQuery:function(){var A="";for(sortItem in this.sortInformation){A+=this.columns[this.sortInformation[sortItem].index].field+"="+((this.sortInformation[sortItem].direction)?"desc":"asc")+"&"}return A},loadMoreData:function(E){E.timerHandle.stop();if(E.noMoreData){return }if(!E.pendingRequest){if(!E.domNode){return }var A=dojo.byId(E.container);var D=A.scrollTop;var C=dojo.html.getContentBox(E.domNode).height;var B=dojo.html.getContentBox(A).height;if(((C-(B+D))<(100))||E.loadAllData){E.store.setQuery(E.getSortingQuery());E.store.getNextPage(E,"loadMoreDataResults");E.pendingRequest=true}else{E.timerHandle.start()}}},loadMoreDataResults:function(B){if(!B||B.length==0){this.timerHandle.stop();this.noMoreData=true;this.onLoadAllComplete();this.onLoadAllComplete=function(){}}else{var A;for(A in B){var C=this.createRow({key:B[A][this.valueField],src:B[A]});this.domNode.tBodies[0].appendChild(C)}this.timerHandle.start()}this.pendingRequest=false},stopTimer:function(){this.timerHandle.stop()}});