dojo.provide("dojo.xml.Parse");dojo.require("dojo.dom");dojo.xml.Parse=function(){var isIE=((dojo.render.html.capable)&&(dojo.render.html.ie));function getTagName(node){try{return node.tagName.toLowerCase();}
catch(e){return"";}}
function getDojoTagName(node){var tagName=getTagName(node);if(!tagName){return"";}
if((dojo.widget)&&(dojo.widget.tags[tagName])){return tagName;}
var p=tagName.indexOf(":");if(p>=0){return tagName;}
if(tagName.substr(0,5)=="dojo:"){return tagName;}
if(dojo.render.html.capable&&dojo.render.html.ie&&node.scopeName!="HTML"){return node.scopeName.toLowerCase()+":"+tagName;}
if(tagName.substr(0,4)=="dojo"){return"dojo:"+tagName.substring(4);}
var djt=node.getAttribute("dojoType")||node.getAttribute("dojotype");if(djt){if(djt.indexOf(":")<0){djt="dojo:"+djt;}
return djt.toLowerCase();}
djt=node.getAttributeNS&&node.getAttributeNS(dojo.dom.dojoml,"type");if(djt){return"dojo:"+djt.toLowerCase();}
try{djt=node.getAttribute("dojo:type");}
catch(e){}
if(djt){return"dojo:"+djt.toLowerCase();}
if((dj_global["djConfig"])&&(!djConfig["ignoreClassNames"])){var classes=node.className||node.getAttribute("class");if((classes)&&(classes.indexOf)&&(classes.indexOf("dojo-")!=-1)){var aclasses=classes.split(" ");for(var x=0,c=aclasses.length;x<c;x++){if(aclasses[x].slice(0,5)=="dojo-"){return"dojo:"+aclasses[x].substr(5).toLowerCase();}}}}
return"";}
this.parseElement=function(node,hasParentNodeSet,optimizeForDojoML,thisIdx){var tagName=getTagName(node);if(isIE&&tagName.indexOf("/")==0){return null;}
try{var attr=node.getAttribute("parseWidgets");if(attr&&attr.toLowerCase()=="false"){return{};}}
catch(e){}
var process=true;if(optimizeForDojoML){var dojoTagName=getDojoTagName(node);tagName=dojoTagName||tagName;process=Boolean(dojoTagName);}
var parsedNodeSet={};parsedNodeSet[tagName]=[];var pos=tagName.indexOf(":");if(pos>0){var ns=tagName.substring(0,pos);parsedNodeSet["ns"]=ns;if((dojo.ns)&&(!dojo.ns.allow(ns))){process=false;}}
if(process){var attributeSet=this.parseAttributes(node);for(var attr in attributeSet){if((!parsedNodeSet[tagName][attr])||(typeof parsedNodeSet[tagName][attr]!="array")){parsedNodeSet[tagName][attr]=[];}
parsedNodeSet[tagName][attr].push(attributeSet[attr]);}
parsedNodeSet[tagName].nodeRef=node;parsedNodeSet.tagName=tagName;parsedNodeSet.index=thisIdx||0;}
var count=0;for(var i=0;i<node.childNodes.length;i++){var tcn=node.childNodes.item(i);switch(tcn.nodeType){case dojo.dom.ELEMENT_NODE:var ctn=getDojoTagName(tcn)||getTagName(tcn);if(!parsedNodeSet[ctn]){parsedNodeSet[ctn]=[];}
parsedNodeSet[ctn].push(this.parseElement(tcn,true,optimizeForDojoML,count));if((tcn.childNodes.length==1)&&(tcn.childNodes.item(0).nodeType==dojo.dom.TEXT_NODE)){parsedNodeSet[ctn][parsedNodeSet[ctn].length-1].value=tcn.childNodes.item(0).nodeValue;}
count++;break;case dojo.dom.TEXT_NODE:if(node.childNodes.length==1){parsedNodeSet[tagName].push({value:node.childNodes.item(0).nodeValue});}
break;default:break;}}
return parsedNodeSet;};this.parseAttributes=function(node){var parsedAttributeSet={};var atts=node.attributes;var attnode,i=0;while((attnode=atts[i++])){if(isIE){if(!attnode){continue;}
if((typeof attnode=="object")&&(typeof attnode.nodeValue=="undefined")||(attnode.nodeValue==null)||(attnode.nodeValue=="")){continue;}}
var nn=attnode.nodeName.split(":");nn=(nn.length==2)?nn[1]:attnode.nodeName;parsedAttributeSet[nn]={value:attnode.nodeValue};}
return parsedAttributeSet;};};dojo.kwCompoundRequire({common:[["dojo.uri.Uri",false,false]]});dojo.provide("dojo.uri.*");dojo.provide("dojo.a11y");dojo.require("dojo.uri.*");dojo.require("dojo.html.common");dojo.a11y={imgPath:dojo.uri.moduleUri("dojo.widget","templates/images"),doAccessibleCheck:true,accessible:null,checkAccessible:function(){if(this.accessible===null){this.accessible=false;if(this.doAccessibleCheck==true){this.accessible=this.testAccessible();}}
return this.accessible;},testAccessible:function(){this.accessible=false;if(dojo.render.html.ie||dojo.render.html.mozilla){var div=document.createElement("div");div.style.backgroundImage="url(\""+this.imgPath+"/tab_close.gif\")";dojo.body().appendChild(div);var bkImg=null;if(window.getComputedStyle){var cStyle=getComputedStyle(div,"");bkImg=cStyle.getPropertyValue("background-image");}else{bkImg=div.currentStyle.backgroundImage;}
var bUseImgElem=false;if(bkImg!=null&&(bkImg=="none"||bkImg=="url(invalid-url:)")){this.accessible=true;}
dojo.body().removeChild(div);}
return this.accessible;},setCheckAccessible:function(bTest){this.doAccessibleCheck=bTest;},setAccessibleMode:function(){if(this.accessible===null){if(this.checkAccessible()){dojo.render.html.prefixes.unshift("a11y");}}
return this.accessible;}};dojo.provide("dojo.ns");dojo.ns={namespaces:{},failed:{},loading:{},loaded:{},register:function(name,module,resolver,noOverride){if(!noOverride||!this.namespaces[name]){this.namespaces[name]=new dojo.ns.Ns(name,module,resolver);}},allow:function(name){if(this.failed[name]){return false;}
if((djConfig.excludeNamespace)&&(dojo.lang.inArray(djConfig.excludeNamespace,name))){return false;}
return((name==this.dojo)||(!djConfig.includeNamespace)||(dojo.lang.inArray(djConfig.includeNamespace,name)));},get:function(name){return this.namespaces[name];},require:function(name){var ns=this.namespaces[name];if((ns)&&(this.loaded[name])){return ns;}
if(!this.allow(name)){return false;}
if(this.loading[name]){dojo.debug("dojo.namespace.require: re-entrant request to load namespace \""+name+"\" must fail.");return false;}
var req=dojo.require;this.loading[name]=true;try{if(name=="dojo"){req("dojo.namespaces.dojo");}else{if(!dojo.hostenv.moduleHasPrefix(name)){dojo.registerModulePath(name,"../"+name);}
req([name,"manifest"].join("."),false,true);}
if(!this.namespaces[name]){this.failed[name]=true;}}
finally{this.loading[name]=false;}
return this.namespaces[name];}};dojo.ns.Ns=function(name,module,resolver){this.name=name;this.module=module;this.resolver=resolver;this._loaded=[];this._failed=[];};dojo.ns.Ns.prototype.resolve=function(name,domain,omitModuleCheck){if(!this.resolver||djConfig["skipAutoRequire"]){return false;}
var fullName=this.resolver(name,domain);if((fullName)&&(!this._loaded[fullName])&&(!this._failed[fullName])){var req=dojo.require;req(fullName,false,true);if(dojo.hostenv.findModule(fullName,false)){this._loaded[fullName]=true;}else{if(!omitModuleCheck){dojo.raise("dojo.ns.Ns.resolve: module '"+fullName+"' not found after loading via namespace '"+this.name+"'");}
this._failed[fullName]=true;}}
return Boolean(this._loaded[fullName]);};dojo.registerNamespace=function(name,module,resolver){dojo.ns.register.apply(dojo.ns,arguments);};dojo.registerNamespaceResolver=function(name,resolver){var n=dojo.ns.namespaces[name];if(n){n.resolver=resolver;}};dojo.registerNamespaceManifest=function(module,path,name,widgetModule,resolver){dojo.registerModulePath(name,path);dojo.registerNamespace(name,widgetModule,resolver);};dojo.registerNamespace("dojo","dojo.widget");dojo.provide("dojo.lang.declare");dojo.require("dojo.lang.common");dojo.require("dojo.lang.extras");dojo.lang.declare=function(className,superclass,init,props){if((dojo.lang.isFunction(props))||((!props)&&(!dojo.lang.isFunction(init)))){var temp=props;props=init;init=temp;}
var mixins=[];if(dojo.lang.isArray(superclass)){mixins=superclass;superclass=mixins.shift();}
if(!init){init=dojo.evalObjPath(className,false);if((init)&&(!dojo.lang.isFunction(init))){init=null;}}
var ctor=dojo.lang.declare._makeConstructor();var scp=(superclass?superclass.prototype:null);if(scp){scp.prototyping=true;ctor.prototype=new superclass();scp.prototyping=false;}
ctor.superclass=scp;ctor.mixins=mixins;for(var i=0,l=mixins.length;i<l;i++){dojo.lang.extend(ctor,mixins[i].prototype);}
ctor.prototype.initializer=null;ctor.prototype.declaredClass=className;if(dojo.lang.isArray(props)){dojo.lang.extend.apply(dojo.lang,[ctor].concat(props));}else{dojo.lang.extend(ctor,(props)||{});}
dojo.lang.extend(ctor,dojo.lang.declare._common);ctor.prototype.constructor=ctor;ctor.prototype.initializer=(ctor.prototype.initializer)||(init)||(function(){});var created=dojo.parseObjPath(className,null,true);created.obj[created.prop]=ctor;return ctor;};dojo.lang.declare._makeConstructor=function(){return function(){var self=this._getPropContext();var s=self.constructor.superclass;if((s)&&(s.constructor)){if(s.constructor==arguments.callee){this._inherited("constructor",arguments);}else{this._contextMethod(s,"constructor",arguments);}}
var ms=(self.constructor.mixins)||([]);for(var i=0,m;(m=ms[i]);i++){(((m.prototype)&&(m.prototype.initializer))||(m)).apply(this,arguments);}
if((!this.prototyping)&&(self.initializer)){self.initializer.apply(this,arguments);}};};dojo.lang.declare._common={_getPropContext:function(){return(this.___proto||this);},_contextMethod:function(ptype,method,args){var result,stack=this.___proto;this.___proto=ptype;try{result=ptype[method].apply(this,(args||[]));}
catch(e){throw e;}
finally{this.___proto=stack;}
return result;},_inherited:function(prop,args){var p=this._getPropContext();do{if((!p.constructor)||(!p.constructor.superclass)){return;}
p=p.constructor.superclass;}while(!(prop in p));return(dojo.lang.isFunction(p[prop])?this._contextMethod(p,prop,args):p[prop]);},inherited:function(prop,args){dojo.deprecated("'inherited' method is dangerous, do not up-call! 'inherited' is slated for removal in 0.5; name your super class (or use superclass property) instead.","0.5");this._inherited(prop,args);}};dojo.declare=dojo.lang.declare;dojo.provide("dojo.lfx.toggle");dojo.require("dojo.lfx.*");dojo.lfx.toggle.plain={show:function(node,duration,easing,callback){dojo.html.show(node);if(dojo.lang.isFunction(callback)){callback();}},hide:function(node,duration,easing,callback){dojo.html.hide(node);if(dojo.lang.isFunction(callback)){callback();}}};dojo.lfx.toggle.fade={show:function(node,duration,easing,callback){dojo.lfx.fadeShow(node,duration,easing,callback).play();},hide:function(node,duration,easing,callback){dojo.lfx.fadeHide(node,duration,easing,callback).play();}};dojo.lfx.toggle.wipe={show:function(node,duration,easing,callback){dojo.lfx.wipeIn(node,duration,easing,callback).play();},hide:function(node,duration,easing,callback){dojo.lfx.wipeOut(node,duration,easing,callback).play();}};dojo.lfx.toggle.explode={show:function(node,duration,easing,callback,explodeSrc){dojo.lfx.explode(explodeSrc||{x:0,y:0,width:0,height:0},node,duration,easing,callback).play();},hide:function(node,duration,easing,callback,explodeSrc){dojo.lfx.implode(node,explodeSrc||{x:0,y:0,width:0,height:0},duration,easing,callback).play();}};dojo.kwCompoundRequire({common:["dojo.html.common","dojo.html.style"]});dojo.provide("dojo.html.*");dojo.provide("dojo.html.util");dojo.require("dojo.html.layout");dojo.html.getElementWindow=function(element){return dojo.html.getDocumentWindow(element.ownerDocument);};dojo.html.getDocumentWindow=function(doc){if(dojo.render.html.safari&&!doc._parentWindow){var fix=function(win){win.document._parentWindow=win;for(var i=0;i<win.frames.length;i++){fix(win.frames[i]);}};fix(window.top);}
if(dojo.render.html.ie&&window!==document.parentWindow&&!doc._parentWindow){doc.parentWindow.execScript("document._parentWindow = window;","Javascript");var win=doc._parentWindow;doc._parentWindow=null;return win;}
return doc._parentWindow||doc.parentWindow||doc.defaultView;};dojo.html.gravity=function(node,e){node=dojo.byId(node);var mouse=dojo.html.getCursorPosition(e);with(dojo.html){var absolute=getAbsolutePosition(node,true);var bb=getBorderBox(node);var nodecenterx=absolute.x+(bb.width/2);var nodecentery=absolute.y+(bb.height/2);}
with(dojo.html.gravity){return((mouse.x<nodecenterx?WEST:EAST)|(mouse.y<nodecentery?NORTH:SOUTH));}};dojo.html.gravity.NORTH=1;dojo.html.gravity.SOUTH=1<<1;dojo.html.gravity.EAST=1<<2;dojo.html.gravity.WEST=1<<3;dojo.html.overElement=function(element,e){element=dojo.byId(element);var mouse=dojo.html.getCursorPosition(e);var bb=dojo.html.getBorderBox(element);var absolute=dojo.html.getAbsolutePosition(element,true,dojo.html.boxSizing.BORDER_BOX);var top=absolute.y;var bottom=top+bb.height;var left=absolute.x;var right=left+bb.width;return(mouse.x>=left&&mouse.x<=right&&mouse.y>=top&&mouse.y<=bottom);};dojo.html.renderedTextContent=function(node){node=dojo.byId(node);var result="";if(node==null){return result;}
for(var i=0;i<node.childNodes.length;i++){switch(node.childNodes[i].nodeType){case 1:case 5:var display="unknown";try{display=dojo.html.getStyle(node.childNodes[i],"display");}
catch(E){}
switch(display){case"block":case"list-item":case"run-in":case"table":case"table-row-group":case"table-header-group":case"table-footer-group":case"table-row":case"table-column-group":case"table-column":case"table-cell":case"table-caption":result+="\n";result+=dojo.html.renderedTextContent(node.childNodes[i]);result+="\n";break;case"none":break;default:if(node.childNodes[i].tagName&&node.childNodes[i].tagName.toLowerCase()=="br"){result+="\n";}else{result+=dojo.html.renderedTextContent(node.childNodes[i]);}
break;}
break;case 3:case 2:case 4:var text=node.childNodes[i].nodeValue;var textTransform="unknown";try{textTransform=dojo.html.getStyle(node,"text-transform");}
catch(E){}
switch(textTransform){case"capitalize":var words=text.split(" ");for(var i=0;i<words.length;i++){words[i]=words[i].charAt(0).toUpperCase()+words[i].substring(1);}
text=words.join(" ");break;case"uppercase":text=text.toUpperCase();break;case"lowercase":text=text.toLowerCase();break;default:break;}
switch(textTransform){case"nowrap":break;case"pre-wrap":break;case"pre-line":break;case"pre":break;default:text=text.replace(/\s+/," ");if(/\s$/.test(result)){text.replace(/^\s/,"");}
break;}
result+=text;break;default:break;}}
return result;};dojo.html.createNodesFromText=function(txt,trim){if(trim){txt=txt.replace(/^\s+|\s+$/g,"");}
var tn=dojo.doc().createElement("div");tn.style.visibility="hidden";dojo.body().appendChild(tn);var tableType="none";if((/^<t[dh][\s\r\n>]/i).test(txt.replace(/^\s+/))){txt="<table><tbody><tr>"+txt+"</tr></tbody></table>";tableType="cell";}else{if((/^<tr[\s\r\n>]/i).test(txt.replace(/^\s+/))){txt="<table><tbody>"+txt+"</tbody></table>";tableType="row";}else{if((/^<(thead|tbody|tfoot)[\s\r\n>]/i).test(txt.replace(/^\s+/))){txt="<table>"+txt+"</table>";tableType="section";}}}
tn.innerHTML=txt;if(tn["normalize"]){tn.normalize();}
var parent=null;switch(tableType){case"cell":parent=tn.getElementsByTagName("tr")[0];break;case"row":parent=tn.getElementsByTagName("tbody")[0];break;case"section":parent=tn.getElementsByTagName("table")[0];break;default:parent=tn;break;}
var nodes=[];for(var x=0;x<parent.childNodes.length;x++){nodes.push(parent.childNodes[x].cloneNode(true));}
tn.style.display="none";dojo.html.destroyNode(tn);return nodes;};dojo.html.placeOnScreen=function(node,desiredX,desiredY,padding,hasScroll,corners,tryOnly){if(desiredX instanceof Array||typeof desiredX=="array"){tryOnly=corners;corners=hasScroll;hasScroll=padding;padding=desiredY;desiredY=desiredX[1];desiredX=desiredX[0];}
if(corners instanceof String||typeof corners=="string"){corners=corners.split(",");}
if(!isNaN(padding)){padding=[Number(padding),Number(padding)];}else{if(!(padding instanceof Array||typeof padding=="array")){padding=[0,0];}}
var scroll=dojo.html.getScroll().offset;var view=dojo.html.getViewport();node=dojo.byId(node);var oldDisplay=node.style.display;node.style.display="";var bb=dojo.html.getBorderBox(node);var w=bb.width;var h=bb.height;node.style.display=oldDisplay;if(!(corners instanceof Array||typeof corners=="array")){corners=["TL"];}
var bestx,besty,bestDistance=Infinity,bestCorner;for(var cidex=0;cidex<corners.length;++cidex){var corner=corners[cidex];var match=true;var tryX=desiredX-(corner.charAt(1)=="L"?0:w)+padding[0]*(corner.charAt(1)=="L"?1:-1);var tryY=desiredY-(corner.charAt(0)=="T"?0:h)+padding[1]*(corner.charAt(0)=="T"?1:-1);if(hasScroll){tryX-=scroll.x;tryY-=scroll.y;}
if(tryX<0){tryX=0;match=false;}
if(tryY<0){tryY=0;match=false;}
var x=tryX+w;if(x>view.width){x=view.width-w;match=false;}else{x=tryX;}
x=Math.max(padding[0],x)+scroll.x;var y=tryY+h;if(y>view.height){y=view.height-h;match=false;}else{y=tryY;}
y=Math.max(padding[1],y)+scroll.y;if(match){bestx=x;besty=y;bestDistance=0;bestCorner=corner;break;}else{var dist=Math.pow(x-tryX-scroll.x,2)+Math.pow(y-tryY-scroll.y,2);if(bestDistance>dist){bestDistance=dist;bestx=x;besty=y;bestCorner=corner;}}}
if(!tryOnly){node.style.left=bestx+"px";node.style.top=besty+"px";}
return{left:bestx,top:besty,x:bestx,y:besty,dist:bestDistance,corner:bestCorner};};dojo.html.placeOnScreenPoint=function(node,desiredX,desiredY,padding,hasScroll){dojo.deprecated("dojo.html.placeOnScreenPoint","use dojo.html.placeOnScreen() instead","0.5");return dojo.html.placeOnScreen(node,desiredX,desiredY,padding,hasScroll,["TL","TR","BL","BR"]);};dojo.html.placeOnScreenAroundElement=function(node,aroundNode,padding,aroundType,aroundCorners,tryOnly){var best,bestDistance=Infinity;aroundNode=dojo.byId(aroundNode);var oldDisplay=aroundNode.style.display;aroundNode.style.display="";var mb=dojo.html.getElementBox(aroundNode,aroundType);var aroundNodeW=mb.width;var aroundNodeH=mb.height;var aroundNodePos=dojo.html.getAbsolutePosition(aroundNode,true,aroundType);aroundNode.style.display=oldDisplay;for(var nodeCorner in aroundCorners){var pos,desiredX,desiredY;var corners=aroundCorners[nodeCorner];desiredX=aroundNodePos.x+(nodeCorner.charAt(1)=="L"?0:aroundNodeW);desiredY=aroundNodePos.y+(nodeCorner.charAt(0)=="T"?0:aroundNodeH);pos=dojo.html.placeOnScreen(node,desiredX,desiredY,padding,true,corners,true);if(pos.dist==0){best=pos;break;}else{if(bestDistance>pos.dist){bestDistance=pos.dist;best=pos;}}}
if(!tryOnly){node.style.left=best.left+"px";node.style.top=best.top+"px";}
return best;};dojo.html.scrollIntoView=function(node){if(!node){return;}
if(dojo.render.html.ie){if(dojo.html.getBorderBox(node.parentNode).height<=node.parentNode.scrollHeight){node.scrollIntoView(false);}}else{if(dojo.render.html.mozilla){node.scrollIntoView(false);}else{var parent=node.parentNode;var parentBottom=parent.scrollTop+dojo.html.getBorderBox(parent).height;var nodeBottom=node.offsetTop+dojo.html.getMarginBox(node).height;if(parentBottom<nodeBottom){parent.scrollTop+=(nodeBottom-parentBottom);}else{if(parent.scrollTop>node.offsetTop){parent.scrollTop-=(parent.scrollTop-node.offsetTop);}}}}};dojo.provide("dojo.html.iframe");dojo.require("dojo.html.util");dojo.html.iframeContentWindow=function(iframe_el){var win=dojo.html.getDocumentWindow(dojo.html.iframeContentDocument(iframe_el))||dojo.html.iframeContentDocument(iframe_el).__parent__||(iframe_el.name&&document.frames[iframe_el.name])||null;return win;};dojo.html.iframeContentDocument=function(iframe_el){var doc=iframe_el.contentDocument||((iframe_el.contentWindow)&&(iframe_el.contentWindow.document))||((iframe_el.name)&&(document.frames[iframe_el.name])&&(document.frames[iframe_el.name].document))||null;return doc;};dojo.html.BackgroundIframe=function(node){if(dojo.render.html.ie55||dojo.render.html.ie60){var html="<iframe src='javascript:false'"+" style='position: absolute; left: 0px; top: 0px; width: 100%; height: 100%;"+"z-index: -1; filter:Alpha(Opacity=\"0\");' "+">";this.iframe=dojo.doc().createElement(html);this.iframe.tabIndex=-1;if(node){node.appendChild(this.iframe);this.domNode=node;}else{dojo.body().appendChild(this.iframe);this.iframe.style.display="none";}}};dojo.lang.extend(dojo.html.BackgroundIframe,{iframe:null,onResized:function(){if(this.iframe&&this.domNode&&this.domNode.parentNode){var outer=dojo.html.getMarginBox(this.domNode);if(outer.width==0||outer.height==0){dojo.lang.setTimeout(this,this.onResized,100);return;}
this.iframe.style.width=outer.width+"px";this.iframe.style.height=outer.height+"px";}},size:function(node){if(!this.iframe){return;}
var coords=dojo.html.toCoordinateObject(node,true,dojo.html.boxSizing.BORDER_BOX);with(this.iframe.style){width=coords.width+"px";height=coords.height+"px";left=coords.left+"px";top=coords.top+"px";}},setZIndex:function(node){if(!this.iframe){return;}
if(dojo.dom.isNode(node)){this.iframe.style.zIndex=dojo.html.getStyle(node,"z-index")-1;}else{if(!isNaN(node)){this.iframe.style.zIndex=node;}}},show:function(){if(this.iframe){this.iframe.style.display="block";}},hide:function(){if(this.iframe){this.iframe.style.display="none";}},remove:function(){if(this.iframe){dojo.html.removeNode(this.iframe,true);delete this.iframe;this.iframe=null;}}});dojo.require("dojo.html.common");dojo.provide("dojo.html.selection");dojo.require("dojo.dom");dojo.require("dojo.lang.common");dojo.html.selectionType={NONE:0,TEXT:1,CONTROL:2};dojo.html.clearSelection=function(){var _window=dojo.global();var _document=dojo.doc();try{if(_window["getSelection"]){if(dojo.render.html.safari){_window.getSelection().collapse();}else{_window.getSelection().removeAllRanges();}}else{if(_document.selection){if(_document.selection.empty){_document.selection.empty();}else{if(_document.selection.clear){_document.selection.clear();}}}}
return true;}
catch(e){dojo.debug(e);return false;}};dojo.html.disableSelection=function(element){element=dojo.byId(element)||dojo.body();var h=dojo.render.html;if(h.mozilla){element.style.MozUserSelect="none";}else{if(h.safari){element.style.KhtmlUserSelect="none";}else{if(h.ie){element.unselectable="on";}else{return false;}}}
return true;};dojo.html.enableSelection=function(element){element=dojo.byId(element)||dojo.body();var h=dojo.render.html;if(h.mozilla){element.style.MozUserSelect="";}else{if(h.safari){element.style.KhtmlUserSelect="";}else{if(h.ie){element.unselectable="off";}else{return false;}}}
return true;};dojo.html.selectElement=function(element){dojo.deprecated("dojo.html.selectElement","replaced by dojo.html.selection.selectElementChildren",0.5);};dojo.html.selectInputText=function(element){var _window=dojo.global();var _document=dojo.doc();element=dojo.byId(element);if(_document["selection"]&&dojo.body()["createTextRange"]){var range=element.createTextRange();range.moveStart("character",0);range.moveEnd("character",element.value.length);range.select();}else{if(_window["getSelection"]){var selection=_window.getSelection();element.setSelectionRange(0,element.value.length);}}
element.focus();};dojo.html.isSelectionCollapsed=function(){dojo.deprecated("dojo.html.isSelectionCollapsed","replaced by dojo.html.selection.isCollapsed",0.5);return dojo.html.selection.isCollapsed();};dojo.lang.mixin(dojo.html.selection,{getType:function(){if(dojo.doc()["selection"]){return dojo.html.selectionType[dojo.doc().selection.type.toUpperCase()];}else{var stype=dojo.html.selectionType.TEXT;var oSel;try{oSel=dojo.global().getSelection();}
catch(e){}
if(oSel&&oSel.rangeCount==1){var oRange=oSel.getRangeAt(0);if(oRange.startContainer==oRange.endContainer&&(oRange.endOffset-oRange.startOffset)==1&&oRange.startContainer.nodeType!=dojo.dom.TEXT_NODE){stype=dojo.html.selectionType.CONTROL;}}
return stype;}},isCollapsed:function(){var _window=dojo.global();var _document=dojo.doc();if(_document["selection"]){return _document.selection.createRange().text=="";}else{if(_window["getSelection"]){var selection=_window.getSelection();if(dojo.lang.isString(selection)){return selection=="";}else{return selection.isCollapsed||selection.toString()=="";}}}},getSelectedElement:function(){if(dojo.html.selection.getType()==dojo.html.selectionType.CONTROL){if(dojo.doc()["selection"]){var range=dojo.doc().selection.createRange();if(range&&range.item){return dojo.doc().selection.createRange().item(0);}}else{var selection=dojo.global().getSelection();return selection.anchorNode.childNodes[selection.anchorOffset];}}},getParentElement:function(){if(dojo.html.selection.getType()==dojo.html.selectionType.CONTROL){var p=dojo.html.selection.getSelectedElement();if(p){return p.parentNode;}}else{if(dojo.doc()["selection"]){return dojo.doc().selection.createRange().parentElement();}else{var selection=dojo.global().getSelection();if(selection){var node=selection.anchorNode;while(node&&node.nodeType!=dojo.dom.ELEMENT_NODE){node=node.parentNode;}
return node;}}}},getSelectedText:function(){if(dojo.doc()["selection"]){if(dojo.html.selection.getType()==dojo.html.selectionType.CONTROL){return null;}
return dojo.doc().selection.createRange().text;}else{var selection=dojo.global().getSelection();if(selection){return selection.toString();}}},getSelectedHtml:function(){if(dojo.doc()["selection"]){if(dojo.html.selection.getType()==dojo.html.selectionType.CONTROL){return null;}
return dojo.doc().selection.createRange().htmlText;}else{var selection=dojo.global().getSelection();if(selection&&selection.rangeCount){var frag=selection.getRangeAt(0).cloneContents();var div=document.createElement("div");div.appendChild(frag);return div.innerHTML;}
return null;}},hasAncestorElement:function(tagName){return(dojo.html.selection.getAncestorElement.apply(this,arguments)!=null);},getAncestorElement:function(tagName){var node=dojo.html.selection.getSelectedElement()||dojo.html.selection.getParentElement();while(node){if(dojo.html.selection.isTag(node,arguments).length>0){return node;}
node=node.parentNode;}
return null;},isTag:function(node,tags){if(node&&node.tagName){for(var i=0;i<tags.length;i++){if(node.tagName.toLowerCase()==String(tags[i]).toLowerCase()){return String(tags[i]).toLowerCase();}}}
return"";},selectElement:function(element){var _window=dojo.global();var _document=dojo.doc();element=dojo.byId(element);if(_document.selection&&dojo.body().createTextRange){try{var range=dojo.body().createControlRange();range.addElement(element);range.select();}
catch(e){dojo.html.selection.selectElementChildren(element);}}else{if(_window["getSelection"]){var selection=_window.getSelection();if(selection["removeAllRanges"]){var range=_document.createRange();range.selectNode(element);selection.removeAllRanges();selection.addRange(range);}}}},selectElementChildren:function(element){var _window=dojo.global();var _document=dojo.doc();element=dojo.byId(element);if(_document.selection&&dojo.body().createTextRange){var range=dojo.body().createTextRange();range.moveToElementText(element);range.select();}else{if(_window["getSelection"]){var selection=_window.getSelection();if(selection["setBaseAndExtent"]){selection.setBaseAndExtent(element,0,element,element.innerText.length-1);}else{if(selection["selectAllChildren"]){selection.selectAllChildren(element);}}}}},getBookmark:function(){var bookmark;var _document=dojo.doc();if(_document["selection"]){var range=_document.selection.createRange();bookmark=range.getBookmark();}else{var selection;try{selection=dojo.global().getSelection();}
catch(e){}
if(selection){var range=selection.getRangeAt(0);bookmark=range.cloneRange();}else{dojo.debug("No idea how to store the current selection for this browser!");}}
return bookmark;},moveToBookmark:function(bookmark){var _document=dojo.doc();if(_document["selection"]){var range=_document.selection.createRange();range.moveToBookmark(bookmark);range.select();}else{var selection;try{selection=dojo.global().getSelection();}
catch(e){}
if(selection&&selection["removeAllRanges"]){selection.removeAllRanges();selection.addRange(bookmark);}else{dojo.debug("No idea how to restore selection for this browser!");}}},collapse:function(beginning){if(dojo.global()["getSelection"]){var selection=dojo.global().getSelection();if(selection.removeAllRanges){if(beginning){selection.collapseToStart();}else{selection.collapseToEnd();}}else{dojo.global().getSelection().collapse(beginning);}}else{if(dojo.doc().selection){var range=dojo.doc().selection.createRange();range.collapse(beginning);range.select();}}},remove:function(){if(dojo.doc().selection){var selection=dojo.doc().selection;if(selection.type.toUpperCase()!="NONE"){selection.clear();}
return selection;}else{var selection=dojo.global().getSelection();for(var i=0;i<selection.rangeCount;i++){selection.getRangeAt(i).deleteContents();}
return selection;}}});dojo.provide("dojo.widget.Manager");dojo.require("dojo.lang.array");dojo.require("dojo.lang.func");dojo.require("dojo.event.*");dojo.widget.manager=new function(){this.widgets=[];this.widgetIds=[];this.topWidgets={};var widgetTypeCtr={};var renderPrefixCache=[];this.getUniqueId=function(widgetType){var widgetId;do{widgetId=widgetType+"_"+(widgetTypeCtr[widgetType]!=undefined?++widgetTypeCtr[widgetType]:widgetTypeCtr[widgetType]=0);}while(this.getWidgetById(widgetId));return widgetId;};this.add=function(widget){this.widgets.push(widget);if(!widget.extraArgs["id"]){widget.extraArgs["id"]=widget.extraArgs["ID"];}
if(widget.widgetId==""){if(widget["id"]){widget.widgetId=widget["id"];}else{if(widget.extraArgs["id"]){widget.widgetId=widget.extraArgs["id"];}else{widget.widgetId=this.getUniqueId(widget.ns+"_"+widget.widgetType);}}}
if(this.widgetIds[widget.widgetId]){dojo.debug("widget ID collision on ID: "+widget.widgetId);}
this.widgetIds[widget.widgetId]=widget;};this.destroyAll=function(){for(var x=this.widgets.length-1;x>=0;x--){try{this.widgets[x].destroy(true);delete this.widgets[x];}
catch(e){}}};this.remove=function(widgetIndex){if(dojo.lang.isNumber(widgetIndex)){var tw=this.widgets[widgetIndex].widgetId;delete this.topWidgets[tw];delete this.widgetIds[tw];this.widgets.splice(widgetIndex,1);}else{this.removeById(widgetIndex);}};this.removeById=function(id){if(!dojo.lang.isString(id)){id=id["widgetId"];if(!id){dojo.debug("invalid widget or id passed to removeById");return;}}
for(var i=0;i<this.widgets.length;i++){if(this.widgets[i].widgetId==id){this.remove(i);break;}}};this.getWidgetById=function(id){if(dojo.lang.isString(id)){return this.widgetIds[id];}
return id;};this.getWidgetsByType=function(type){var lt=type.toLowerCase();var getType=(type.indexOf(":")<0?function(x){return x.widgetType.toLowerCase();}:function(x){return x.getNamespacedType();});var ret=[];dojo.lang.forEach(this.widgets,function(x){if(getType(x)==lt){ret.push(x);}});return ret;};this.getWidgetsByFilter=function(unaryFunc,onlyOne){var ret=[];dojo.lang.every(this.widgets,function(x){if(unaryFunc(x)){ret.push(x);if(onlyOne){return false;}}
return true;});return(onlyOne?ret[0]:ret);};this.getAllWidgets=function(){return this.widgets.concat();};this.getWidgetByNode=function(node){var w=this.getAllWidgets();node=dojo.byId(node);for(var i=0;i<w.length;i++){if(w[i].domNode==node){return w[i];}}
return null;};this.byId=this.getWidgetById;this.byType=this.getWidgetsByType;this.byFilter=this.getWidgetsByFilter;this.byNode=this.getWidgetByNode;var knownWidgetImplementations={};var widgetPackages=["dojo.widget"];for(var i=0;i<widgetPackages.length;i++){widgetPackages[widgetPackages[i]]=true;}
this.registerWidgetPackage=function(pname){if(!widgetPackages[pname]){widgetPackages[pname]=true;widgetPackages.push(pname);}};this.getWidgetPackageList=function(){return dojo.lang.map(widgetPackages,function(elt){return(elt!==true?elt:undefined);});};this.getImplementation=function(widgetName,ctorObject,mixins,ns){var impl=this.getImplementationName(widgetName,ns);if(impl){var ret=ctorObject?new impl(ctorObject):new impl();return ret;}};function buildPrefixCache(){for(var renderer in dojo.render){if(dojo.render[renderer]["capable"]===true){var prefixes=dojo.render[renderer].prefixes;for(var i=0;i<prefixes.length;i++){renderPrefixCache.push(prefixes[i].toLowerCase());}}}}
var findImplementationInModule=function(lowerCaseWidgetName,module){if(!module){return null;}
for(var i=0,l=renderPrefixCache.length,widgetModule;i<=l;i++){widgetModule=(i<l?module[renderPrefixCache[i]]:module);if(!widgetModule){continue;}
for(var name in widgetModule){if(name.toLowerCase()==lowerCaseWidgetName){return widgetModule[name];}}}
return null;};var findImplementation=function(lowerCaseWidgetName,moduleName){var module=dojo.evalObjPath(moduleName,false);return(module?findImplementationInModule(lowerCaseWidgetName,module):null);};this.getImplementationName=function(widgetName,ns){var lowerCaseWidgetName=widgetName.toLowerCase();ns=ns||"dojo";var imps=knownWidgetImplementations[ns]||(knownWidgetImplementations[ns]={});var impl=imps[lowerCaseWidgetName];if(impl){return impl;}
if(!renderPrefixCache.length){buildPrefixCache();}
var nsObj=dojo.ns.get(ns);if(!nsObj){dojo.ns.register(ns,ns+".widget");nsObj=dojo.ns.get(ns);}
if(nsObj){nsObj.resolve(widgetName);}
impl=findImplementation(lowerCaseWidgetName,nsObj.module);if(impl){return(imps[lowerCaseWidgetName]=impl);}
nsObj=dojo.ns.require(ns);if((nsObj)&&(nsObj.resolver)){nsObj.resolve(widgetName);impl=findImplementation(lowerCaseWidgetName,nsObj.module);if(impl){return(imps[lowerCaseWidgetName]=impl);}}
dojo.deprecated("dojo.widget.Manager.getImplementationName","Could not locate widget implementation for \""+widgetName+"\" in \""+nsObj.module+"\" registered to namespace \""+nsObj.name+"\". "+"Developers must specify correct namespaces for all non-Dojo widgets","0.5");for(var i=0;i<widgetPackages.length;i++){impl=findImplementation(lowerCaseWidgetName,widgetPackages[i]);if(impl){return(imps[lowerCaseWidgetName]=impl);}}
throw new Error("Could not locate widget implementation for \""+widgetName+"\" in \""+nsObj.module+"\" registered to namespace \""+nsObj.name+"\"");};this.resizing=false;this.onWindowResized=function(){if(this.resizing){return;}
try{this.resizing=true;for(var id in this.topWidgets){var child=this.topWidgets[id];if(child.checkSize){child.checkSize();}}}
catch(e){}
finally{this.resizing=false;}};if(typeof window!="undefined"){dojo.addOnLoad(this,"onWindowResized");dojo.event.connect(window,"onresize",this,"onWindowResized");}};(function(){var dw=dojo.widget;var dwm=dw.manager;var h=dojo.lang.curry(dojo.lang,"hitch",dwm);var g=function(oldName,newName){dw[(newName||oldName)]=h(oldName);};g("add","addWidget");g("destroyAll","destroyAllWidgets");g("remove","removeWidget");g("removeById","removeWidgetById");g("getWidgetById");g("getWidgetById","byId");g("getWidgetsByType");g("getWidgetsByFilter");g("getWidgetsByType","byType");g("getWidgetsByFilter","byFilter");g("getWidgetByNode","byNode");dw.all=function(n){var widgets=dwm.getAllWidgets.apply(dwm,arguments);if(arguments.length>0){return widgets[n];}
return widgets;};g("registerWidgetPackage");g("getImplementation","getWidgetImplementation");g("getImplementationName","getWidgetImplementationName");dw.widgets=dwm.widgets;dw.widgetIds=dwm.widgetIds;dw.root=dwm.root;})();dojo.provide("dojo.widget.Widget");dojo.require("dojo.lang.func");dojo.require("dojo.lang.array");dojo.require("dojo.lang.extras");dojo.require("dojo.lang.declare");dojo.require("dojo.ns");dojo.require("dojo.widget.Manager");dojo.require("dojo.event.*");dojo.require("dojo.a11y");dojo.declare("dojo.widget.Widget",null,function(){this.children=[];this.extraArgs={};},{parent:null,isTopLevel:false,disabled:false,isContainer:false,widgetId:"",widgetType:"Widget",ns:"dojo",getNamespacedType:function(){return(this.ns?this.ns+":"+this.widgetType:this.widgetType).toLowerCase();},toString:function(){return"[Widget "+this.getNamespacedType()+", "+(this.widgetId||"NO ID")+"]";},repr:function(){return this.toString();},enable:function(){this.disabled=false;},disable:function(){this.disabled=true;},onResized:function(){this.notifyChildrenOfResize();},notifyChildrenOfResize:function(){for(var i=0;i<this.children.length;i++){var child=this.children[i];if(child.onResized){child.onResized();}}},create:function(args,fragment,parent,ns){if(ns){this.ns=ns;}
this.satisfyPropertySets(args,fragment,parent);this.mixInProperties(args,fragment,parent);this.postMixInProperties(args,fragment,parent);dojo.widget.manager.add(this);this.buildRendering(args,fragment,parent);this.initialize(args,fragment,parent);this.postInitialize(args,fragment,parent);this.postCreate(args,fragment,parent);return this;},destroy:function(finalize){if(this.parent){this.parent.removeChild(this);}
this.destroyChildren();this.uninitialize();this.destroyRendering(finalize);dojo.widget.manager.removeById(this.widgetId);},destroyChildren:function(){var widget;var i=0;while(this.children.length>i){widget=this.children[i];if(widget instanceof dojo.widget.Widget){this.removeChild(widget);widget.destroy();continue;}
i++;}},getChildrenOfType:function(type,recurse){var ret=[];var isFunc=dojo.lang.isFunction(type);if(!isFunc){type=type.toLowerCase();}
for(var x=0;x<this.children.length;x++){if(isFunc){if(this.children[x]instanceof type){ret.push(this.children[x]);}}else{if(this.children[x].widgetType.toLowerCase()==type){ret.push(this.children[x]);}}
if(recurse){ret=ret.concat(this.children[x].getChildrenOfType(type,recurse));}}
return ret;},getDescendants:function(){var result=[];var stack=[this];var elem;while((elem=stack.pop())){result.push(elem);if(elem.children){dojo.lang.forEach(elem.children,function(elem){stack.push(elem);});}}
return result;},isFirstChild:function(){return this===this.parent.children[0];},isLastChild:function(){return this===this.parent.children[this.parent.children.length-1];},satisfyPropertySets:function(args){return args;},mixInProperties:function(args,frag){if((args["fastMixIn"])||(frag["fastMixIn"])){for(var x in args){this[x]=args[x];}
return;}
var undef;var lcArgs=dojo.widget.lcArgsCache[this.widgetType];if(lcArgs==null){lcArgs={};for(var y in this){lcArgs[((new String(y)).toLowerCase())]=y;}
dojo.widget.lcArgsCache[this.widgetType]=lcArgs;}
var visited={};for(var x in args){if(!this[x]){var y=lcArgs[(new String(x)).toLowerCase()];if(y){args[y]=args[x];x=y;}}
if(visited[x]){continue;}
visited[x]=true;if((typeof this[x])!=(typeof undef)){if(typeof args[x]!="string"){this[x]=args[x];}else{if(dojo.lang.isString(this[x])){this[x]=args[x];}else{if(dojo.lang.isNumber(this[x])){this[x]=new Number(args[x]);}else{if(dojo.lang.isBoolean(this[x])){this[x]=(args[x].toLowerCase()=="false")?false:true;}else{if(dojo.lang.isFunction(this[x])){if(args[x].search(/[^\w\.]+/i)==-1){this[x]=dojo.evalObjPath(args[x],false);}else{var tn=dojo.lang.nameAnonFunc(new Function(args[x]),this);dojo.event.kwConnect({srcObj:this,srcFunc:x,adviceObj:this,adviceFunc:tn});}}else{if(dojo.lang.isArray(this[x])){this[x]=args[x].split(";");}else{if(this[x]instanceof Date){this[x]=new Date(Number(args[x]));}else{if(typeof this[x]=="object"){if(this[x]instanceof dojo.uri.Uri){this[x]=dojo.uri.dojoUri(args[x]);}else{var pairs=args[x].split(";");for(var y=0;y<pairs.length;y++){var si=pairs[y].indexOf(":");if((si!=-1)&&(pairs[y].length>si)){this[x][pairs[y].substr(0,si).replace(/^\s+|\s+$/g,"")]=pairs[y].substr(si+1);}}}}else{this[x]=args[x];}}}}}}}}}else{this.extraArgs[x.toLowerCase()]=args[x];}}},postMixInProperties:function(args,frag,parent){},initialize:function(args,frag,parent){return false;},postInitialize:function(args,frag,parent){return false;},postCreate:function(args,frag,parent){return false;},uninitialize:function(){return false;},buildRendering:function(args,frag,parent){dojo.unimplemented("dojo.widget.Widget.buildRendering, on "+this.toString()+", ");return false;},destroyRendering:function(){dojo.unimplemented("dojo.widget.Widget.destroyRendering");return false;},addedTo:function(parent){},addChild:function(child){dojo.unimplemented("dojo.widget.Widget.addChild");return false;},removeChild:function(widget){for(var x=0;x<this.children.length;x++){if(this.children[x]===widget){this.children.splice(x,1);widget.parent=null;break;}}
return widget;},getPreviousSibling:function(){var idx=this.getParentIndex();if(idx<=0){return null;}
return this.parent.children[idx-1];},getSiblings:function(){return this.parent.children;},getParentIndex:function(){return dojo.lang.indexOf(this.parent.children,this,true);},getNextSibling:function(){var idx=this.getParentIndex();if(idx==this.parent.children.length-1){return null;}
if(idx<0){return null;}
return this.parent.children[idx+1];}});dojo.widget.lcArgsCache={};dojo.widget.tags={};dojo.widget.tags.addParseTreeHandler=function(type){dojo.deprecated("addParseTreeHandler",". ParseTreeHandlers are now reserved for components. Any unfiltered DojoML tag without a ParseTreeHandler is assumed to be a widget","0.5");};dojo.widget.tags["dojo:propertyset"]=function(fragment,widgetParser,parentComp){var properties=widgetParser.parseProperties(fragment["dojo:propertyset"]);};dojo.widget.tags["dojo:connect"]=function(fragment,widgetParser,parentComp){var properties=widgetParser.parseProperties(fragment["dojo:connect"]);};dojo.widget.buildWidgetFromParseTree=function(type,frag,parser,parentComp,insertionIndex,localProps){dojo.a11y.setAccessibleMode();var stype=type.split(":");stype=(stype.length==2)?stype[1]:type;var localProperties=localProps||parser.parseProperties(frag[frag["ns"]+":"+stype]);var twidget=dojo.widget.manager.getImplementation(stype,null,null,frag["ns"]);if(!twidget){throw new Error("cannot find \""+type+"\" widget");}else{if(!twidget.create){throw new Error("\""+type+"\" widget object has no \"create\" method and does not appear to implement *Widget");}}
localProperties["dojoinsertionindex"]=insertionIndex;var ret=twidget.create(localProperties,frag,parentComp,frag["ns"]);return ret;};dojo.widget.defineWidget=function(widgetClass,renderer,superclasses,init,props){if(dojo.lang.isString(arguments[3])){dojo.widget._defineWidget(arguments[0],arguments[3],arguments[1],arguments[4],arguments[2]);}else{var args=[arguments[0]],p=3;if(dojo.lang.isString(arguments[1])){args.push(arguments[1],arguments[2]);}else{args.push("",arguments[1]);p=2;}
if(dojo.lang.isFunction(arguments[p])){args.push(arguments[p],arguments[p+1]);}else{args.push(null,arguments[p]);}
dojo.widget._defineWidget.apply(this,args);}};dojo.widget.defineWidget.renderers="html|svg|vml";dojo.widget._defineWidget=function(widgetClass,renderer,superclasses,init,props){var module=widgetClass.split(".");var type=module.pop();var regx="\\.("+(renderer?renderer+"|":"")+dojo.widget.defineWidget.renderers+")\\.";var r=widgetClass.search(new RegExp(regx));module=(r<0?module.join("."):widgetClass.substr(0,r));dojo.widget.manager.registerWidgetPackage(module);var pos=module.indexOf(".");var nsName=(pos>-1)?module.substring(0,pos):module;props=(props)||{};props.widgetType=type;if((!init)&&(props["classConstructor"])){init=props.classConstructor;delete props.classConstructor;}
dojo.declare(widgetClass,superclasses,init,props);};dojo.provide("dojo.widget.DomWidget");dojo.require("dojo.event.*");dojo.require("dojo.widget.Widget");dojo.require("dojo.dom");dojo.require("dojo.html.style");dojo.require("dojo.xml.Parse");dojo.require("dojo.uri.*");dojo.require("dojo.lang.func");dojo.require("dojo.lang.extras");dojo.widget._cssFiles={};dojo.widget._cssStrings={};dojo.widget._templateCache={};dojo.widget.defaultStrings={dojoRoot:dojo.hostenv.getBaseScriptUri(),dojoWidgetModuleUri:dojo.uri.moduleUri("dojo.widget"),baseScriptUri:dojo.hostenv.getBaseScriptUri()};dojo.widget.fillFromTemplateCache=function(obj,templatePath,templateString,avoidCache){var tpath=templatePath||obj.templatePath;var tmplts=dojo.widget._templateCache;if(!tpath&&!obj["widgetType"]){do{var dummyName="__dummyTemplate__"+dojo.widget._templateCache.dummyCount++;}while(tmplts[dummyName]);obj.widgetType=dummyName;}
var wt=tpath?tpath.toString():obj.widgetType;var ts=tmplts[wt];if(!ts){tmplts[wt]={"string":null,"node":null};if(avoidCache){ts={};}else{ts=tmplts[wt];}}
if((!obj.templateString)&&(!avoidCache)){obj.templateString=templateString||ts["string"];}
if(obj.templateString){obj.templateString=this._sanitizeTemplateString(obj.templateString);}
if((!obj.templateNode)&&(!avoidCache)){obj.templateNode=ts["node"];}
if((!obj.templateNode)&&(!obj.templateString)&&(tpath)){var tstring=this._sanitizeTemplateString(dojo.hostenv.getText(tpath));obj.templateString=tstring;if(!avoidCache){tmplts[wt]["string"]=tstring;}}
if((!ts["string"])&&(!avoidCache)){ts.string=obj.templateString;}};dojo.widget._sanitizeTemplateString=function(tString){if(tString){tString=tString.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,"");var matches=tString.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(matches){tString=matches[1];}}else{tString="";}
return tString;};dojo.widget._templateCache.dummyCount=0;dojo.widget.attachProperties=["dojoAttachPoint","id"];dojo.widget.eventAttachProperty="dojoAttachEvent";dojo.widget.onBuildProperty="dojoOnBuild";dojo.widget.waiNames=["waiRole","waiState"];dojo.widget.wai={waiRole:{name:"waiRole","namespace":"http://www.w3.org/TR/xhtml2",alias:"x2",prefix:"wairole:"},waiState:{name:"waiState","namespace":"http://www.w3.org/2005/07/aaa",alias:"aaa",prefix:""},setAttr:function(node,ns,attr,value){if(dojo.render.html.ie){node.setAttribute(this[ns].alias+":"+attr,this[ns].prefix+value);}else{node.setAttributeNS(this[ns]["namespace"],attr,this[ns].prefix+value);}},getAttr:function(node,ns,attr){if(dojo.render.html.ie){return node.getAttribute(this[ns].alias+":"+attr);}else{return node.getAttributeNS(this[ns]["namespace"],attr);}},removeAttr:function(node,ns,attr){var success=true;if(dojo.render.html.ie){success=node.removeAttribute(this[ns].alias+":"+attr);}else{node.removeAttributeNS(this[ns]["namespace"],attr);}
return success;}};dojo.widget.attachTemplateNodes=function(rootNode,targetObj,events){var elementNodeType=dojo.dom.ELEMENT_NODE;function trim(str){return str.replace(/^\s+|\s+$/g,"");}
if(!rootNode){rootNode=targetObj.domNode;}
if(rootNode.nodeType!=elementNodeType){return;}
var nodes=rootNode.all||rootNode.getElementsByTagName("*");var _this=targetObj;for(var x=-1;x<nodes.length;x++){var baseNode=(x==-1)?rootNode:nodes[x];var attachPoint=[];if(!targetObj.widgetsInTemplate||!baseNode.getAttribute("dojoType")){for(var y=0;y<this.attachProperties.length;y++){var tmpAttachPoint=baseNode.getAttribute(this.attachProperties[y]);if(tmpAttachPoint){attachPoint=tmpAttachPoint.split(";");for(var z=0;z<attachPoint.length;z++){if(dojo.lang.isArray(targetObj[attachPoint[z]])){targetObj[attachPoint[z]].push(baseNode);}else{targetObj[attachPoint[z]]=baseNode;}}
break;}}
var attachEvent=baseNode.getAttribute(this.eventAttachProperty);if(attachEvent){var evts=attachEvent.split(";");for(var y=0;y<evts.length;y++){if((!evts[y])||(!evts[y].length)){continue;}
var thisFunc=null;var tevt=trim(evts[y]);if(evts[y].indexOf(":")>=0){var funcNameArr=tevt.split(":");tevt=trim(funcNameArr[0]);thisFunc=trim(funcNameArr[1]);}
if(!thisFunc){thisFunc=tevt;}
var tf=function(){var ntf=new String(thisFunc);return function(evt){if(_this[ntf]){_this[ntf](dojo.event.browser.fixEvent(evt,this));}};}();dojo.event.browser.addListener(baseNode,tevt,tf,false,true);}}
for(var y=0;y<events.length;y++){var evtVal=baseNode.getAttribute(events[y]);if((evtVal)&&(evtVal.length)){var thisFunc=null;var domEvt=events[y].substr(4);thisFunc=trim(evtVal);var funcs=[thisFunc];if(thisFunc.indexOf(";")>=0){funcs=dojo.lang.map(thisFunc.split(";"),trim);}
for(var z=0;z<funcs.length;z++){if(!funcs[z].length){continue;}
var tf=function(){var ntf=new String(funcs[z]);return function(evt){if(_this[ntf]){_this[ntf](dojo.event.browser.fixEvent(evt,this));}};}();dojo.event.browser.addListener(baseNode,domEvt,tf,false,true);}}}}
var tmpltPoint=baseNode.getAttribute(this.templateProperty);if(tmpltPoint){targetObj[tmpltPoint]=baseNode;}
dojo.lang.forEach(dojo.widget.waiNames,function(name){var wai=dojo.widget.wai[name];var val=baseNode.getAttribute(wai.name);if(val){if(val.indexOf("-")==-1){dojo.widget.wai.setAttr(baseNode,wai.name,"role",val);}else{var statePair=val.split("-");dojo.widget.wai.setAttr(baseNode,wai.name,statePair[0],statePair[1]);}}},this);var onBuild=baseNode.getAttribute(this.onBuildProperty);if(onBuild){eval("var node = baseNode; var widget = targetObj; "+onBuild);}}};dojo.widget.getDojoEventsFromStr=function(str){var re=/(dojoOn([a-z]+)(\s?))=/gi;var evts=str?str.match(re)||[]:[];var ret=[];var lem={};for(var x=0;x<evts.length;x++){if(evts[x].length<1){continue;}
var cm=evts[x].replace(/\s/,"");cm=(cm.slice(0,cm.length-1));if(!lem[cm]){lem[cm]=true;ret.push(cm);}}
return ret;};dojo.declare("dojo.widget.DomWidget",dojo.widget.Widget,function(){if((arguments.length>0)&&(typeof arguments[0]=="object")){this.create(arguments[0]);}},{templateNode:null,templateString:null,templateCssString:null,preventClobber:false,domNode:null,containerNode:null,widgetsInTemplate:false,addChild:function(widget,overrideContainerNode,pos,ref,insertIndex){if(!this.isContainer){dojo.debug("dojo.widget.DomWidget.addChild() attempted on non-container widget");return null;}else{if(insertIndex==undefined){insertIndex=this.children.length;}
this.addWidgetAsDirectChild(widget,overrideContainerNode,pos,ref,insertIndex);this.registerChild(widget,insertIndex);}
return widget;},addWidgetAsDirectChild:function(widget,overrideContainerNode,pos,ref,insertIndex){if((!this.containerNode)&&(!overrideContainerNode)){this.containerNode=this.domNode;}
var cn=(overrideContainerNode)?overrideContainerNode:this.containerNode;if(!pos){pos="after";}
if(!ref){if(!cn){cn=dojo.body();}
ref=cn.lastChild;}
if(!insertIndex){insertIndex=0;}
widget.domNode.setAttribute("dojoinsertionindex",insertIndex);if(!ref){cn.appendChild(widget.domNode);}else{if(pos=="insertAtIndex"){dojo.dom.insertAtIndex(widget.domNode,ref.parentNode,insertIndex);}else{if((pos=="after")&&(ref===cn.lastChild)){cn.appendChild(widget.domNode);}else{dojo.dom.insertAtPosition(widget.domNode,cn,pos);}}}},registerChild:function(widget,insertionIndex){widget.dojoInsertionIndex=insertionIndex;var idx=-1;for(var i=0;i<this.children.length;i++){if(this.children[i].dojoInsertionIndex<=insertionIndex){idx=i;}}
this.children.splice(idx+1,0,widget);widget.parent=this;widget.addedTo(this,idx+1);delete dojo.widget.manager.topWidgets[widget.widgetId];},removeChild:function(widget){dojo.dom.removeNode(widget.domNode);return dojo.widget.DomWidget.superclass.removeChild.call(this,widget);},getFragNodeRef:function(frag){if(!frag){return null;}
if(!frag[this.getNamespacedType()]){dojo.raise("Error: no frag for widget type "+this.getNamespacedType()+", id "+this.widgetId+" (maybe a widget has set it's type incorrectly)");}
return frag[this.getNamespacedType()]["nodeRef"];},postInitialize:function(args,frag,parentComp){var sourceNodeRef=this.getFragNodeRef(frag);if(parentComp&&(parentComp.snarfChildDomOutput||!sourceNodeRef)){parentComp.addWidgetAsDirectChild(this,"","insertAtIndex","",args["dojoinsertionindex"],sourceNodeRef);}else{if(sourceNodeRef){if(this.domNode&&(this.domNode!==sourceNodeRef)){this._sourceNodeRef=dojo.dom.replaceNode(sourceNodeRef,this.domNode);}}}
if(parentComp){parentComp.registerChild(this,args.dojoinsertionindex);}else{dojo.widget.manager.topWidgets[this.widgetId]=this;}
if(this.widgetsInTemplate){var parser=new dojo.xml.Parse();var subContainerNode;var subnodes=this.domNode.getElementsByTagName("*");for(var i=0;i<subnodes.length;i++){if(subnodes[i].getAttribute("dojoAttachPoint")=="subContainerWidget"){subContainerNode=subnodes[i];}
if(subnodes[i].getAttribute("dojoType")){subnodes[i].setAttribute("isSubWidget",true);}}
if(this.isContainer&&!this.containerNode){if(subContainerNode){var src=this.getFragNodeRef(frag);if(src){dojo.dom.moveChildren(src,subContainerNode);frag["dojoDontFollow"]=true;}}else{dojo.debug("No subContainerWidget node can be found in template file for widget "+this);}}
var templatefrag=parser.parseElement(this.domNode,null,true);dojo.widget.getParser().createSubComponents(templatefrag,this);var subwidgets=[];var stack=[this];var w;while((w=stack.pop())){for(var i=0;i<w.children.length;i++){var cwidget=w.children[i];if(cwidget._processedSubWidgets||!cwidget.extraArgs["issubwidget"]){continue;}
subwidgets.push(cwidget);if(cwidget.isContainer){stack.push(cwidget);}}}
for(var i=0;i<subwidgets.length;i++){var widget=subwidgets[i];if(widget._processedSubWidgets){dojo.debug("This should not happen: widget._processedSubWidgets is already true!");return;}
widget._processedSubWidgets=true;if(widget.extraArgs["dojoattachevent"]){var evts=widget.extraArgs["dojoattachevent"].split(";");for(var j=0;j<evts.length;j++){var thisFunc=null;var tevt=dojo.string.trim(evts[j]);if(tevt.indexOf(":")>=0){var funcNameArr=tevt.split(":");tevt=dojo.string.trim(funcNameArr[0]);thisFunc=dojo.string.trim(funcNameArr[1]);}
if(!thisFunc){thisFunc=tevt;}
if(dojo.lang.isFunction(widget[tevt])){dojo.event.kwConnect({srcObj:widget,srcFunc:tevt,targetObj:this,targetFunc:thisFunc});}else{alert(tevt+" is not a function in widget "+widget);}}}
if(widget.extraArgs["dojoattachpoint"]){this[widget.extraArgs["dojoattachpoint"]]=widget;}}}
if(this.isContainer&&!frag["dojoDontFollow"]){dojo.widget.getParser().createSubComponents(frag,this);}},buildRendering:function(args,frag){var ts=dojo.widget._templateCache[this.widgetType];if(args["templatecsspath"]){args["templateCssPath"]=args["templatecsspath"];}
var cpath=args["templateCssPath"]||this.templateCssPath;if(cpath&&!dojo.widget._cssFiles[cpath.toString()]){if((!this.templateCssString)&&(cpath)){this.templateCssString=dojo.hostenv.getText(cpath);this.templateCssPath=null;}
dojo.widget._cssFiles[cpath.toString()]=true;}
if((this["templateCssString"])&&(!dojo.widget._cssStrings[this.templateCssString])){dojo.html.insertCssText(this.templateCssString,null,cpath);dojo.widget._cssStrings[this.templateCssString]=true;}
if((!this.preventClobber)&&((this.templatePath)||(this.templateNode)||((this["templateString"])&&(this.templateString.length))||((typeof ts!="undefined")&&((ts["string"])||(ts["node"]))))){this.buildFromTemplate(args,frag);}else{this.domNode=this.getFragNodeRef(frag);}
this.fillInTemplate(args,frag);},buildFromTemplate:function(args,frag){var avoidCache=false;if(args["templatepath"]){args["templatePath"]=args["templatepath"];}
dojo.widget.fillFromTemplateCache(this,args["templatePath"],null,avoidCache);var ts=dojo.widget._templateCache[this.templatePath?this.templatePath.toString():this.widgetType];if((ts)&&(!avoidCache)){if(!this.templateString.length){this.templateString=ts["string"];}
if(!this.templateNode){this.templateNode=ts["node"];}}
var matches=false;var node=null;var tstr=this.templateString;if((!this.templateNode)&&(this.templateString)){matches=this.templateString.match(/\$\{([^\}]+)\}/g);if(matches){var hash=this.strings||{};for(var key in dojo.widget.defaultStrings){if(dojo.lang.isUndefined(hash[key])){hash[key]=dojo.widget.defaultStrings[key];}}
for(var i=0;i<matches.length;i++){var key=matches[i];key=key.substring(2,key.length-1);var kval=(key.substring(0,5)=="this.")?dojo.lang.getObjPathValue(key.substring(5),this):hash[key];var value;if((kval)||(dojo.lang.isString(kval))){value=new String((dojo.lang.isFunction(kval))?kval.call(this,key,this.templateString):kval);while(value.indexOf("\"")>-1){value=value.replace("\"","&quot;");}
tstr=tstr.replace(matches[i],value);}}}else{this.templateNode=this.createNodesFromText(this.templateString,true)[0];if(!avoidCache){ts.node=this.templateNode;}}}
if((!this.templateNode)&&(!matches)){dojo.debug("DomWidget.buildFromTemplate: could not create template");return false;}else{if(!matches){node=this.templateNode.cloneNode(true);if(!node){return false;}}else{node=this.createNodesFromText(tstr,true)[0];}}
this.domNode=node;this.attachTemplateNodes();if(this.isContainer&&this.containerNode){var src=this.getFragNodeRef(frag);if(src){dojo.dom.moveChildren(src,this.containerNode);}}},attachTemplateNodes:function(baseNode,targetObj){if(!baseNode){baseNode=this.domNode;}
if(!targetObj){targetObj=this;}
return dojo.widget.attachTemplateNodes(baseNode,targetObj,dojo.widget.getDojoEventsFromStr(this.templateString));},fillInTemplate:function(){},destroyRendering:function(){try{dojo.dom.destroyNode(this.domNode);delete this.domNode;}
catch(e){}
if(this._sourceNodeRef){try{dojo.dom.destroyNode(this._sourceNodeRef);}
catch(e){}}},createNodesFromText:function(){dojo.unimplemented("dojo.widget.DomWidget.createNodesFromText");}});dojo.provide("dojo.widget.HtmlWidget");dojo.require("dojo.widget.DomWidget");dojo.require("dojo.html.util");dojo.require("dojo.html.display");dojo.require("dojo.html.layout");dojo.require("dojo.lang.extras");dojo.require("dojo.lang.func");dojo.require("dojo.lfx.toggle");dojo.declare("dojo.widget.HtmlWidget",dojo.widget.DomWidget,{templateCssPath:null,templatePath:null,lang:"",toggle:"plain",toggleDuration:150,initialize:function(args,frag){},postMixInProperties:function(args,frag){if(this.lang===""){this.lang=null;}
this.toggleObj=dojo.lfx.toggle[this.toggle.toLowerCase()]||dojo.lfx.toggle.plain;},createNodesFromText:function(txt,wrap){return dojo.html.createNodesFromText(txt,wrap);},destroyRendering:function(finalize){try{if(this.bgIframe){this.bgIframe.remove();delete this.bgIframe;}
if(!finalize&&this.domNode){dojo.event.browser.clean(this.domNode);}
dojo.widget.HtmlWidget.superclass.destroyRendering.call(this);}
catch(e){}},isShowing:function(){return dojo.html.isShowing(this.domNode);},toggleShowing:function(){if(this.isShowing()){this.hide();}else{this.show();}},show:function(){if(this.isShowing()){return;}
this.animationInProgress=true;this.toggleObj.show(this.domNode,this.toggleDuration,null,dojo.lang.hitch(this,this.onShow),this.explodeSrc);},onShow:function(){this.animationInProgress=false;this.checkSize();},hide:function(){if(!this.isShowing()){return;}
this.animationInProgress=true;this.toggleObj.hide(this.domNode,this.toggleDuration,null,dojo.lang.hitch(this,this.onHide),this.explodeSrc);},onHide:function(){this.animationInProgress=false;},_isResized:function(w,h){if(!this.isShowing()){return false;}
var wh=dojo.html.getMarginBox(this.domNode);var width=w||wh.width;var height=h||wh.height;if(this.width==width&&this.height==height){return false;}
this.width=width;this.height=height;return true;},checkSize:function(){if(!this._isResized()){return;}
this.onResized();},resizeTo:function(w,h){dojo.html.setMarginBox(this.domNode,{width:w,height:h});if(this.isShowing()){this.onResized();}},resizeSoon:function(){if(this.isShowing()){dojo.lang.setTimeout(this,this.onResized,0);}},onResized:function(){dojo.lang.forEach(this.children,function(child){if(child.checkSize){child.checkSize();}});}});dojo.provide("dojo.widget.Parse");dojo.require("dojo.widget.Manager");dojo.require("dojo.dom");dojo.widget.Parse=function(fragment){this.propertySetsList=[];this.fragment=fragment;this.createComponents=function(frag,parentComp){var comps=[];var built=false;try{if(frag&&frag.tagName&&(frag!=frag.nodeRef)){var djTags=dojo.widget.tags;var tna=String(frag.tagName).split(";");for(var x=0;x<tna.length;x++){var ltn=tna[x].replace(/^\s+|\s+$/g,"").toLowerCase();frag.tagName=ltn;var ret;if(djTags[ltn]){built=true;ret=djTags[ltn](frag,this,parentComp,frag.index);comps.push(ret);}else{if(ltn.indexOf(":")==-1){ltn="dojo:"+ltn;}
ret=dojo.widget.buildWidgetFromParseTree(ltn,frag,this,parentComp,frag.index);if(ret){built=true;comps.push(ret);}}}}}
catch(e){dojo.debug("dojo.widget.Parse: error:",e);}
if(!built){comps=comps.concat(this.createSubComponents(frag,parentComp));}
return comps;};this.createSubComponents=function(fragment,parentComp){var frag,comps=[];for(var item in fragment){frag=fragment[item];if(frag&&typeof frag=="object"&&(frag!=fragment.nodeRef)&&(frag!=fragment.tagName)&&(!dojo.dom.isNode(frag))){comps=comps.concat(this.createComponents(frag,parentComp));}}
return comps;};this.parsePropertySets=function(fragment){return[];};this.parseProperties=function(fragment){var properties={};for(var item in fragment){if((fragment[item]==fragment.tagName)||(fragment[item]==fragment.nodeRef)){}else{var frag=fragment[item];if(frag.tagName&&dojo.widget.tags[frag.tagName.toLowerCase()]){}else{if(frag[0]&&frag[0].value!=""&&frag[0].value!=null){try{if(item.toLowerCase()=="dataprovider"){var _this=this;this.getDataProvider(_this,frag[0].value);properties.dataProvider=this.dataProvider;}
properties[item]=frag[0].value;var nestedProperties=this.parseProperties(frag);for(var property in nestedProperties){properties[property]=nestedProperties[property];}}
catch(e){dojo.debug(e);}}}
switch(item.toLowerCase()){case"checked":case"disabled":if(typeof properties[item]!="boolean"){properties[item]=true;}
break;}}}
return properties;};this.getDataProvider=function(objRef,dataUrl){dojo.io.bind({url:dataUrl,load:function(type,evaldObj){if(type=="load"){objRef.dataProvider=evaldObj;}},mimetype:"text/javascript",sync:true});};this.getPropertySetById=function(propertySetId){for(var x=0;x<this.propertySetsList.length;x++){if(propertySetId==this.propertySetsList[x]["id"][0].value){return this.propertySetsList[x];}}
return"";};this.getPropertySetsByType=function(componentType){var propertySets=[];for(var x=0;x<this.propertySetsList.length;x++){var cpl=this.propertySetsList[x];var cpcc=cpl.componentClass||cpl.componentType||null;var propertySetId=this.propertySetsList[x]["id"][0].value;if(cpcc&&(propertySetId==cpcc[0].value)){propertySets.push(cpl);}}
return propertySets;};this.getPropertySets=function(fragment){var ppl="dojo:propertyproviderlist";var propertySets=[];var tagname=fragment.tagName;if(fragment[ppl]){var propertyProviderIds=fragment[ppl].value.split(" ");for(var propertySetId in propertyProviderIds){if((propertySetId.indexOf("..")==-1)&&(propertySetId.indexOf("://")==-1)){var propertySet=this.getPropertySetById(propertySetId);if(propertySet!=""){propertySets.push(propertySet);}}else{}}}
return this.getPropertySetsByType(tagname).concat(propertySets);};this.createComponentFromScript=function(nodeRef,componentName,properties,ns){properties.fastMixIn=true;var ltn=(ns||"dojo")+":"+componentName.toLowerCase();if(dojo.widget.tags[ltn]){return[dojo.widget.tags[ltn](properties,this,null,null,properties)];}
return[dojo.widget.buildWidgetFromParseTree(ltn,properties,this,null,null,properties)];};};dojo.widget._parser_collection={"dojo":new dojo.widget.Parse()};dojo.widget.getParser=function(name){if(!name){name="dojo";}
if(!this._parser_collection[name]){this._parser_collection[name]=new dojo.widget.Parse();}
return this._parser_collection[name];};dojo.widget.createWidget=function(name,props,refNode,position){var isNode=false;var isNameStr=(typeof name=="string");if(isNameStr){var pos=name.indexOf(":");var ns=(pos>-1)?name.substring(0,pos):"dojo";if(pos>-1){name=name.substring(pos+1);}
var lowerCaseName=name.toLowerCase();var namespacedName=ns+":"+lowerCaseName;isNode=(dojo.byId(name)&&!dojo.widget.tags[namespacedName]);}
if((arguments.length==1)&&(isNode||!isNameStr)){var xp=new dojo.xml.Parse();var tn=isNode?dojo.byId(name):name;return dojo.widget.getParser().createComponents(xp.parseElement(tn,null,true))[0];}
function fromScript(placeKeeperNode,name,props,ns){props[namespacedName]={dojotype:[{value:lowerCaseName}],nodeRef:placeKeeperNode,fastMixIn:true};props.ns=ns;return dojo.widget.getParser().createComponentFromScript(placeKeeperNode,name,props,ns);}
props=props||{};var notRef=false;var tn=null;var h=dojo.render.html.capable;if(h){tn=document.createElement("span");}
if(!refNode){notRef=true;refNode=tn;if(h){dojo.body().appendChild(refNode);}}else{if(position){dojo.dom.insertAtPosition(tn,refNode,position);}else{tn=refNode;}}
var widgetArray=fromScript(tn,name.toLowerCase(),props,ns);if((!widgetArray)||(!widgetArray[0])||(typeof widgetArray[0].widgetType=="undefined")){throw new Error("createWidget: Creation of \""+name+"\" widget failed.");}
try{if(notRef&&widgetArray[0].domNode.parentNode){widgetArray[0].domNode.parentNode.removeChild(widgetArray[0].domNode);}}
catch(e){dojo.debug(e);}
return widgetArray[0];};dojo.kwCompoundRequire({common:["dojo.xml.Parse","dojo.widget.Widget","dojo.widget.Parse","dojo.widget.Manager"],browser:["dojo.widget.DomWidget","dojo.widget.HtmlWidget"],dashboard:["dojo.widget.DomWidget","dojo.widget.HtmlWidget"],svg:["dojo.widget.SvgWidget"],rhino:["dojo.widget.SwtWidget"]});dojo.provide("dojo.widget.*");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(id){dojo.widget.html.stabile.setup();return dojo.widget.html.stabile.widgetState[id];};dojo.widget.html.stabile.setState=function(id,state,isCommit){dojo.widget.html.stabile.setup();dojo.widget.html.stabile.widgetState[id]=state;if(isCommit){dojo.widget.html.stabile.commit(dojo.widget.html.stabile.widgetState);}};dojo.widget.html.stabile.setup=function(){if(!dojo.widget.html.stabile.widgetState){var text=dojo.widget.html.stabile._getStorage().value;dojo.widget.html.stabile.widgetState=text?dj_eval("("+text+")"):{};}};dojo.widget.html.stabile.commit=function(state){dojo.widget.html.stabile._getStorage().value=dojo.widget.html.stabile.description(state);};dojo.widget.html.stabile.description=function(v,showAll){var depth=dojo.widget.html.stabile._depth;var describeThis=function(){return this.description(this,true);};try{if(v===void(0)){return"undefined";}
if(v===null){return"null";}
if(typeof(v)=="boolean"||typeof(v)=="number"||v instanceof Boolean||v instanceof Number){return v.toString();}
if(typeof(v)=="string"||v instanceof String){var v1=v.replace(dojo.widget.html.stabile._sqQuotables,"\\$1");v1=v1.replace(/\n/g,"\\n");v1=v1.replace(/\r/g,"\\r");return"'"+v1+"'";}
if(v instanceof Date){return"new Date("+d.getFullYear+","+d.getMonth()+","+d.getDate()+")";}
var d;if(v instanceof Array||v.push){if(depth>=dojo.widget.html.stabile.depthLimit){return"[ ... ]";}
d="[";var first=true;dojo.widget.html.stabile._depth++;for(var i=0;i<v.length;i++){if(first){first=false;}else{d+=",";}
d+=arguments.callee(v[i],showAll);}
return d+"]";}
if(v.constructor==Object||v.toString==describeThis){if(depth>=dojo.widget.html.stabile.depthLimit){return"{ ... }";}
if(typeof(v.hasOwnProperty)!="function"&&v.prototype){throw new Error("description: "+v+" not supported by script engine");}
var first=true;d="{";dojo.widget.html.stabile._depth++;for(var key in v){if(v[key]==void(0)||typeof(v[key])=="function"){continue;}
if(first){first=false;}else{d+=", ";}
var kd=key;if(!kd.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/)){kd=arguments.callee(key,showAll);}
d+=kd+": "+arguments.callee(v[key],showAll);}
return d+"}";}
if(showAll){if(dojo.widget.html.stabile._recur){var objectToString=Object.prototype.toString;return objectToString.apply(v,[]);}else{dojo.widget.html.stabile._recur=true;return v.toString();}}else{throw new Error("Unknown type: "+v);return"'unknown'";}}
finally{dojo.widget.html.stabile._depth=depth;}};dojo.widget.html.stabile._getStorage=function(){if(dojo.widget.html.stabile.dataField){return dojo.widget.html.stabile.dataField;}
var form=document.forms._dojo_form;return dojo.widget.html.stabile.dataField=form?form.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(evt){return false;},applyPopupBasicStyle:function(){with(this.domNode.style){display="none";position="absolute";}},aboutToShow:function(){},open:function(x,y,parent,explodeSrc,orient,padding){if(this.isShowingNow){return;}
if(this.animationInProgress){this.queueOnAnimationFinish.push(this.open,arguments);return;}
this.aboutToShow();var around=false,node,aroundOrient;if(typeof x=="object"){node=x;aroundOrient=explodeSrc;explodeSrc=parent;parent=y;around=true;}
this.parent=parent;dojo.body().appendChild(this.domNode);explodeSrc=explodeSrc||parent["domNode"]||[];var parentPopup=null;this.isTopLevel=true;while(parent){if(parent!==this&&(parent.setOpenedSubpopup!=undefined&&parent.applyPopupBasicStyle!=undefined)){parentPopup=parent;this.isTopLevel=false;parentPopup.setOpenedSubpopup(this);break;}
parent=parent.parent;}
this.parentPopup=parentPopup;this.popupIndex=parentPopup?parentPopup.popupIndex+1:1;if(this.isTopLevel){var button=dojo.html.isNode(explodeSrc)?explodeSrc:null;dojo.widget.PopupManager.opened(this,button);}
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(explodeSrc instanceof Array){explodeSrc={left:explodeSrc[0],top:explodeSrc[1],width:0,height:0};}
with(this.domNode.style){display="";zIndex=this.beginZIndex+this.popupIndex;}
if(around){this.move(node,padding,aroundOrient);}else{this.move(x,y,padding,orient);}
this.domNode.style.display="none";this.explodeSrc=explodeSrc;this.show();this.isShowingNow=true;},move:function(x,y,padding,orient){var around=(typeof x=="object");if(around){var aroundOrient=padding;var node=x;padding=y;if(!aroundOrient){aroundOrient={"BL":"TL","TL":"BL"};}
dojo.html.placeOnScreenAroundElement(this.domNode,node,padding,this.aroundBox,aroundOrient);}else{if(!orient){orient="TL,TR,BL,BR";}
dojo.html.placeOnScreen(this.domNode,x,y,padding,true,orient);}},close:function(force){if(force){this.domNode.style.display="none";}
if(this.animationInProgress){this.queueOnAnimationFinish.push(this.close,[]);return;}
this.closeSubpopup(force);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(e){dojo.debug("No idea how to focus to parent",e);}}),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(e){}}
this._bookmark=null;},closeAll:function(force){if(this.parentPopup){this.parentPopup.closeAll(force);}else{this.close(force);}},setOpenedSubpopup:function(popup){this.currentSubpopup=popup;},closeSubpopup:function(force){if(this.currentSubpopup==null){return;}
this.currentSubpopup.close(force);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 func=this.queueOnAnimationFinish.shift();var args=this.queueOnAnimationFinish.shift();func.apply(this,args);},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(win){if(!win.__PopupManagerRegistered){dojo.event.connect(win.document,"onmousedown",this,"onClick");dojo.event.connect(win,"onscroll",this,"onClick");dojo.event.connect(win.document,"onkey",this,"onKey");win.__PopupManagerRegistered=true;this.registeredWindows.push(win);}};this.registerAllWindows=function(targetWindow){if(!targetWindow){targetWindow=dojo.html.getDocumentWindow(window.top&&window.top.document||window.document);}
this.registerWin(targetWindow);for(var i=0;i<targetWindow.frames.length;i++){try{var win=dojo.html.getDocumentWindow(targetWindow.frames[i].document);if(win){this.registerAllWindows(win);}}
catch(e){}}};this.unRegisterWin=function(win){if(win.__PopupManagerRegistered){dojo.event.disconnect(win.document,"onmousedown",this,"onClick");dojo.event.disconnect(win,"onscroll",this,"onClick");dojo.event.disconnect(win.document,"onkey",this,"onKey");win.__PopupManagerRegistered=false;}};this.unRegisterAllWindows=function(){for(var i=0;i<this.registeredWindows.length;++i){this.unRegisterWin(this.registeredWindows[i]);}
this.registeredWindows=[];};dojo.addOnLoad(this,"registerAllWindows");dojo.addOnUnload(this,"unRegisterAllWindows");this.closed=function(menu){if(this.currentMenu==menu){this.currentMenu=null;this.currentButton=null;this.currentFocusMenu=null;}};this.opened=function(menu,button){if(menu==this.currentMenu){return;}
if(this.currentMenu){this.currentMenu.close();}
this.currentMenu=menu;this.currentFocusMenu=menu;this.currentButton=button;};this.setFocusedMenu=function(menu){this.currentFocusMenu=menu;};this.onKey=function(e){if(!e.key){return;}
if(!this.currentMenu||!this.currentMenu.isShowingNow){return;}
var m=this.currentFocusMenu;while(m){if(m.processKey(e)){e.preventDefault();e.stopPropagation();break;}
m=m.parentPopup||m.parentMenu;}},this.onClick=function(e){if(!this.currentMenu){return;}
var scrolloffset=dojo.html.getScroll().offset;var m=this.currentMenu;while(m){if(dojo.html.overElement(m.domNode,e)||dojo.html.isDescendantOf(e.target,m.domNode)){return;}
m=m.currentSubpopup;}
if(this.currentButton&&dojo.html.overElement(this.currentButton,e)){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.html.*");dojo.require("dojo.string");dojo.require("dojo.widget.html.stabile");dojo.require("dojo.widget.PopupContainer");String.prototype.removeAccents=function()
{var __r={'Ã€':'A','Ã':'A','Ãˆ':'E','Ã‰':'E','ÃŒ':'I','Ã':'I','Ã':'I','Ã’':'O','Ã“':'O','Ã™':'U','Ãš':'U','Ãœ':'U','Ã‘':'N'};return this.replace(/[Ã€ÃÃˆÃ‰ÃŒÃÃÃ’Ã“Ã™ÃšÃœ]/gi,function(m){var ret=__r[m.toUpperCase()];if(m===m.toLowerCase())
ret=ret.toLowerCase();return ret;});};dojo.declare("dojo.widget.incrementalComboBoxDataProvider",null,function(options){this.searchUrl=options.dataUrl;this._cache={};this._inFlight=false;this._lastRequest=null;this.allowCache=false;},{_addToCache:function(keyword,data){if(this.allowCache){this._cache[keyword]=data;}},startSearch:function(searchStr,callback){if(this._inFlight){}
var tss=encodeURIComponent(searchStr);var realUrl=dojo.string.substituteParams(this.searchUrl,{"searchString":tss});var _this=this;var request=this._lastRequest=dojo.io.bind({url:realUrl,method:"get",mimetype:"text/json-comment-filtered",load:function(type,data,evt){_this._inFlight=false;if(!dojo.lang.isArray(data)){var arrData=[];for(var key in data){arrData.push([data[key],key]);}
data=arrData;}
_this._addToCache(searchStr,data);if(request==_this._lastRequest){callback(data);}}});this._inFlight=true;}});dojo.declare("dojo.widget.basicComboBoxDataProvider",null,function(options,node){this._data=[];this.searchLimit=1000;this.searchType="SUBSTRING";this.caseSensitive=false;if(!dj_undef("dataUrl",options)&&!dojo.string.isBlank(options.dataUrl)){this._getData(options.dataUrl);}else{if((node)&&(node.nodeName.toLowerCase()=="select")){var opts=node.getElementsByTagName("option");var ol=opts.length;var data=[];for(var x=0;x<ol;x++){var text=opts[x].textContent||opts[x].innerText||opts[x].innerHTML;var keyValArr=[String(text),String(opts[x].value)];data.push(keyValArr);if(opts[x].selected){options.setAllValues(keyValArr[0],keyValArr[1]);}}
this.setData(data);}}},{_getData:function(url){dojo.io.bind({url:url,load:dojo.lang.hitch(this,function(type,data,evt){if(!dojo.lang.isArray(data)){var arrData=[];for(var key in data){arrData.push([data[key],key]);}
data=arrData;}
this.setData(data);}),mimetype:"text/json-comment-filtered"});},startSearch:function(searchStr,callback){this._performSearch(searchStr,callback);},_performSearch:function(searchStr,callback){var st=this.searchType;var ret=[];if(!this.caseSensitive){searchStr=searchStr.toLowerCase();}
for(var x=0;x<this._data.length;x++){if((this.searchLimit>0)&&(ret.length>=this.searchLimit)){break;}
var dataLabel=new String((!this.caseSensitive)?this._data[x][0].toLowerCase():this._data[x][0]);if(dataLabel.length<searchStr.length){continue;}
if(st=="ALL"){ret.push(this._data[x]);}else if(st=="STARTSTRING"){if(searchStr==dataLabel.substr(0,searchStr.length)){ret.push(this._data[x]);}}else if(st=="SUBSTRING"){if(dataLabel.removeAccents().indexOf(searchStr.removeAccents())>=0){ret.push(this._data[x]);}}else if(st=="STARTWORD"){var idx=dataLabel.indexOf(searchStr);if(idx==0){ret.push(this._data[x]);}
if(idx<=0){continue;}
var matches=false;while(idx!=-1){if(" ,/(".indexOf(dataLabel.charAt(idx-1))!=-1){matches=true;break;}
idx=dataLabel.indexOf(searchStr,idx+1);}
if(!matches){continue;}else{ret.push(this._data[x]);}}}
callback(ret);},showAll:function(callback){var st="ALL";var ret=[];for(var x=0;x<this._data.length;x++){ret.push(this._data[x]);}
callback(ret);},setData:function(pdata){this._data=pdata;}});dojo.widget.defineWidget("dojo.widget.ComboBox",dojo.widget.HtmlWidget,{forceValidOption:false,searchType:"stringstart",dataProvider:null,autoComplete:true,searchDelay:1,dataUrl:"",fadeTime:1,maxListLength:8,mode:"local",selectedResult:null,dataProviderClass:"",buttonSrc:dojo.uri.dojoUri("src/widget/templates/images/combo_box_arrow.png"),dropdownToggle:"fade",templatePath:dojo.uri.dojoUri("src/widget/templates/ComboBox.html"),templateCssPath:dojo.uri.dojoUri("src/widget/templates/ComboBox.css"),setValue:function(value){this.comboBoxValue.value=value;if(this.textInputNode.value!=value){this.textInputNode.value=value;dojo.widget.html.stabile.setState(this.widgetId,this.getState(),true);this.onValueChanged(value);}},onValueChanged:function(value){},getValue:function(){return this.comboBoxValue.value;},getState:function(){return{value:this.getValue()};},setState:function(state){this.setValue(state.value);},enable:function(){this.disabled=false;this.textInputNode.removeAttribute("disabled");},disable:function(){this.disabled=true;this.textInputNode.setAttribute("disabled",true);},_getCaretPos:function(element){if(dojo.lang.isNumber(element.selectionStart)){return element.selectionStart;}else if(dojo.render.html.ie){var tr=document.selection.createRange().duplicate();var ntr=element.createTextRange();tr.move("character",0);ntr.move("character",0);try{ntr.setEndPoint("EndToEnd",tr);return String(ntr.text).replace(/\r/g,"").length;}catch(e){return 0;}}},_setCaretPos:function(element,location){location=parseInt(location);this._setSelectedRange(element,location,location);},_setSelectedRange:function(element,start,end){if(!end){end=element.value.length;}
if(element.setSelectionRange){element.focus();element.setSelectionRange(start,end);}else if(element.createTextRange){var range=element.createTextRange();with(range){collapse(true);moveEnd('character',end);moveStart('character',start);select();}}else{element.value=element.value;element.blur();element.focus();var dist=parseInt(element.value.length)-end;var tchar=String.fromCharCode(37);var tcc=tchar.charCodeAt(0);for(var x=0;x<dist;x++){var te=document.createEvent("KeyEvents");te.initKeyEvent("keypress",true,true,null,false,false,false,false,tcc,tcc);element.dispatchEvent(te);}}},_handleKeyEvents:function(evt){if(evt.ctrlKey||evt.altKey||!evt.key){return;}
this._prev_key_backspace=false;this._prev_key_esc=false;var k=dojo.event.browser.keys;var doSearch=true;switch(evt.key){case k.KEY_DOWN_ARROW:if(!this.popupWidget.isShowingNow){this._startSearchFromInput();}
this._highlightNextOption();dojo.event.browser.stopEvent(evt);return;case k.KEY_UP_ARROW:this._highlightPrevOption();dojo.event.browser.stopEvent(evt);return;case k.KEY_TAB:if(!this.autoComplete&&this.popupWidget.isShowingNow&&this._highlighted_option){dojo.event.browser.stopEvent(evt);this._selectOption({'target':this._highlighted_option,'noHide':false});this._setSelectedRange(this.textInputNode,this.textInputNode.value.length,null);}else{this._selectOption();return;}
break;case k.KEY_ENTER:if(this.popupWidget.isShowingNow){dojo.event.browser.stopEvent(evt);}
if(this.autoComplete){this._selectOption();return;}
case" ":if(this.popupWidget.isShowingNow&&this._highlighted_option){dojo.event.browser.stopEvent(evt);this._selectOption();this._hideResultList();return;}
break;case k.KEY_ESCAPE:this._hideResultList();this._prev_key_esc=true;return;case k.KEY_BACKSPACE:this._prev_key_backspace=true;if(!this.textInputNode.value.length){this.setAllValues("","");this._hideResultList();doSearch=false;}
break;case k.KEY_RIGHT_ARROW:case k.KEY_LEFT_ARROW:doSearch=false;break;default:if(evt.charCode==0){doSearch=false;}}
if(this.searchTimer){clearTimeout(this.searchTimer);}
if(doSearch){this._blurOptionNode();this.searchTimer=setTimeout(dojo.lang.hitch(this,this._startSearchFromInput),this.searchDelay);}},compositionEnd:function(evt){evt.key=evt.keyCode;this._handleKeyEvents(evt);},onKeyUp:function(evt){this.setValue(this.textInputNode.value);},setSelectedValue:function(value){this.comboBoxSelectionValue.value=value;},setAllValues:function(value1,value2){this.setSelectedValue(value2);this.setValue(value1);},_focusOptionNode:function(node){if(this._highlighted_option!=node){this._blurOptionNode();this._highlighted_option=node;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(evt){if(evt.target===this.optionsListNode){return;}
this._focusOptionNode(evt.target);dojo.html.addClass(this._highlighted_option,"dojoComboBoxItemHighlight");},_itemMouseOut:function(evt){if(evt.target===this.optionsListNode){return;}
this._blurOptionNode();},onResize:function(){var inputSize=dojo.html.getContentBox(this.textInputNode);if(inputSize.height<=0){dojo.lang.setTimeout(this,"onResize",100);return;}
var buttonSize={width:inputSize.height,height:inputSize.height};dojo.html.setContentBox(this.downArrowNode,buttonSize);},reloadData:function(url){this.dataProvider._getData(url);},fillInTemplate:function(args,frag){dojo.html.applyBrowserClass(this.domNode);var source=this.getFragNodeRef(frag);if(!this.name&&source.name){this.name=source.name;}
this.comboBoxValue.name=this.name;this.comboBoxSelectionValue.name=this.name+"_selected";dojo.html.copyStyle(this.domNode,source);dojo.html.copyStyle(this.textInputNode,source);dojo.html.copyStyle(this.downArrowNode,source);with(this.downArrowNode.style){width="0px";height="0px";}
var dpClass;if(this.dataProviderClass){if(typeof this.dataProviderClass=="string"){dpClass=dojo.evalObjPath(this.dataProviderClass)}else{dpClass=this.dataProviderClass;}}else{if(this.mode=="remote"){dpClass=dojo.widget.incrementalComboBoxDataProvider;}else{dpClass=dojo.widget.basicComboBoxDataProvider;}}
this.dataProvider=new dpClass(this,this.getFragNodeRef(frag));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(results){if(this.disabled){return;}
this._clearResultList();if(!results.length){this._hideResultList();}
if((this.autoComplete)&&(results.length)&&(!this._prev_key_backspace)&&(this.textInputNode.value.length>0)){var cpos=this._getCaretPos(this.textInputNode);if((cpos+1)>this.textInputNode.value.length){this.textInputNode.value+=results[0][0].substr(cpos);this._setSelectedRange(this.textInputNode,cpos,this.textInputNode.value.length);}}
var even=true;while(results.length){var tr=results.shift();if(tr){var td=document.createElement("div");td.appendChild(document.createTextNode(tr[0]));td.setAttribute("resultName",tr[0]);td.setAttribute("resultValue",tr[1]);td.className="dojoComboBoxItem "+((even)?"dojoComboBoxItemEven":"dojoComboBoxItemOdd");even=(!even);this.optionsListNode.appendChild(td);}}
this._showResultList();},_onFocusInput:function(){this._hasFocus=true;},_onBlurInput:function(){this._hasFocus=false;this._handleBlurTimer(true,500);},_handleBlurTimer:function(clear,millisec){if(this.blurTimer&&(clear||millisec)){clearTimeout(this.blurTimer);}
if(millisec){this.blurTimer=dojo.lang.setTimeout(this,"_checkBlurred",millisec);}},_onMouseOver:function(evt){if(!this._mouseover_list){this._handleBlurTimer(true,0);this._mouseover_list=true;}},_onMouseOut:function(evt){var relTarget=evt.relatedTarget;try{if(!relTarget||relTarget.parentNode!=this.optionsListNode){this._mouseover_list=false;this._handleBlurTimer(true,100);this._tryFocus();}}catch(e){}},_isInputEqualToResult:function(result){var input=this.textInputNode.value;if(!this.dataProvider.caseSensitive){input=input.toLowerCase();result=result.toLowerCase();}
return(input==result);},_isValidOption:function(){var tgt=dojo.html.firstElement(this.optionsListNode);var isValidOption=false;while(!isValidOption&&tgt){if(this._isInputEqualToResult(tgt.getAttribute("resultName"))){isValidOption=true;}else{tgt=dojo.html.nextElement(tgt);}}
return isValidOption;},_checkBlurred:function(){if(!this._hasFocus&&!this._mouseover_list){this._hideResultList();if(!this.textInputNode.value.length){this.setAllValues("","");return;}
var isValidOption=this._isValidOption();if(this.forceValidOption&&!isValidOption){this.setAllValues("","");return;}
if(!isValidOption){this.setSelectedValue("");}}},_selectOption:function(evt){var tgt=null;if(!evt){evt={target:this._highlighted_option};}
if(!dojo.html.isDescendantOf(evt.target,this.optionsListNode)){if(!this.textInputNode.value.length){return;}
tgt=dojo.html.firstElement(this.optionsListNode);if(!tgt||!this._isInputEqualToResult(tgt.getAttribute("resultName"))){return;}}else{tgt=evt.target;}
while((tgt.nodeType!=1)||(!tgt.getAttribute("resultName"))){tgt=tgt.parentNode;if(tgt===dojo.body()){return false;}}
this.selectedResult=[tgt.getAttribute("resultName"),tgt.getAttribute("resultValue")];this.setAllValues(tgt.getAttribute("resultName"),tgt.getAttribute("resultValue"));if(!evt.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 childs=this.optionsListNode.childNodes;if(childs.length){var visibleCount=Math.min(childs.length,this.maxListLength);with(this.optionsListNode.style)
{display="";if(visibleCount==childs.length){height="";}else{height=visibleCount*dojo.html.getMarginBox(childs[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._showAll();}},_tryFocus:function(){try{this.textInputNode.focus();}catch(e){};},_startSearchFromInput:function(){this._startSearch(this.textInputNode.value);},_startSearch:function(key){this.dataProvider.startSearch(key,dojo.lang.hitch(this,"_openResultList"));},_showAll:function(){this.dataProvider.showAll(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 s=dojo.widget.html.stabile.getState(this.widgetId);if(s){this.setState(s);}}});