/*
	Copyright (c) 2004-2007, The TurboAjax Group, All Rights Reserved.
	http://turboajax.com/turbowidgets
*/

dojo.provide("turbo.widgets.TurboTableBox");
dojo.provide("turbo.widgets.HtmlTurboTableBox");
dojo.require("turbo.widgets.TurboWidget");
dojo.widget.defineWidget("dojo.widget.html.TurboTableBox",dojo.widget.html.TurboWidget,{templateString:"<table dojoAttachPoint=\"boxTable\" class=\"turbo_boxTable\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">"+"<tr>"+"\t<td class=\"turbo_boxTop turbo_boxSide\"></td>"+"\t<td dojoAttachPoint=\"boxCaption\" class=\"turbo_boxTop turbo_boxMid\"></td>"+"\t<td class=\"turbo_boxTop turbo_boxRight\"></td>"+"</tr>"+"<tr>"+"\t<td class=\"turbo_boxLeft\"></td>"+"\t<td dojoAttachPoint=\"boxContent\" class=\"turbo_boxMid\"></td>"+"\t<td class=\"turbo_boxRight\"></td>"+"</tr>"+"<tr>"+"\t<td class=\"turbo_boxBottom turbo_boxLeft\"></td>"+"\t<td class=\"turbo_boxBottom turbo_boxMid\"></td>"+"\t<td class=\"turbo_boxBottom turbo_boxRight\"></td>"+"</tr>"+"</table>",boxTable:null,boxCaption:null,boxContent:null,classTag:"turbo_box",width:"",color:"Yellow",fillInTemplate:function(_1,_2){
if(this.width){
this.boxTable.style.width=this.width+"px";
}
this.setColor(this.color);
this.boxTable.rows[0].cells[0].height="33";
this.boxTable.rows[0].cells[1].height="33";
this.boxTable.rows[0].cells[2].height="33";
},postCreate:function(_3,_4){
this.installChildren(_4,this.boxContent);
this.boxCaption.appendChild(this.boxContent.removeChild(this.boxContent.firstChild));
},setBg:function(_5,_6){
_5.style.backgroundImage="url("+this.imageRoot+"box"+this.color+"_0"+_6+".gif)";
},setColor:function(_7){
this.color=_7;
var r=this.boxTable.rows[0];
this.setBg(r.cells[0],1);
this.setBg(r.cells[1],2);
this.setBg(r.cells[2],3);
r=this.boxTable.rows[1];
this.setBg(r.cells[0],4);
this.setBg(r.cells[2],6);
r=this.boxTable.rows[2];
this.setBg(r.cells[0],7);
this.setBg(r.cells[1],8);
this.setBg(r.cells[2],9);
}},"html",function(){
this.imageRoot=dojo.uri.dojoUri(this.themeRoot+"default/tablebox/");
});
dojo.provide("turbo.widgets.TurboButton");
dojo.provide("turbo.widgets.HtmlTurboButton");
dojo.require("turbo.widgets.TurboWidget");
turbo.button={groups:[],states:{normal:0,down:1,disabled:2,over:3,selected:1},add:function(_9,_a){
var g=turbo.button.groups;
if(!g[_9]){
g[_9]=[];
}
g[_9].push(_a);
},remove:function(_c,_d){
if(!_c||!_d){
return;
}
var g=turbo.button.groups[_c];
if(!g){
return;
}
for(var i=0,l=g.length;i<l;i++){
if(g[i]==_d){
delete g[i];
g.splice(i,1);
return;
}
}
},setGroupState:function(_11,_12){
var g=turbo.button.groups[_11];
if(!g){
return;
}
for(i=0,l=g.length;i<l;i++){
if(g[i]){
g[i].setState(_12);
}
}
},resetGroup:function(_14){
var g=turbo.button.groups[_14];
if(!g){
return;
}
for(i=0,l=g.length;i<l;i++){
if(g[i]&&g[i].state!=turbo.button.states.disabled){
g[i].setState(turbo.button.states.normal);
}
}
},getGroupButton:function(_16,_17){
var g=turbo.button.groups[_16];
if(!g){
return;
}
for(i=0,l=g.length;i<l;i++){
if(g[i]&&g[i].state==(_17?_17:turbo.button.states.down)){
return g[i];
}
}
}};
dojo.widget.defineWidget("dojo.widget.html.TurboButtonBase",dojo.widget.html.TurboWidget,{states:turbo.button.states,state:"normal",focusOnClick:true,group:"",toggle:"",value:"",innerWidth:0,repeating:false,event:null,type:"button",mouseDownState:-1,btn:null,btnNode:null,onClick:function(_19){
},onDown:function(_1a){
},onUp:function(_1b){
},initButton:function(_1c){
this.bindArgEvents(_1c);
if(this.btnNode){
var w=this.innerWidth||this.extraArgs["width"];
if(w){
this.btnNode.style.width=w+"px";
}
this.btnNode.setAttribute("autocomplete","off");
}
if(this.state){
if(parseInt(this.state)){
this.state=parseInt(this.state);
}else{
this.state=this.states[this.state];
}
}
this.setState(this.state);
this.setGroup(this.group);
},turboDestroy:function(){
turbo.button.remove(this.group,this);
},styleChanged:function(){
this.updateButton();
},updateButton:function(_1e){
this.debug("updateButton","warning: updateButton is abstract.");
},setGroup:function(_1f){
if(_1f){
this.group=_1f;
this.toggle=true;
turbo.button.add(this.group,this);
}
},setState:function(_20){
if(dojo.lang.isString(_20)){
_20=(_20?this.states[_20]:this.states.normal);
}
if(this.group&&_20==this.states.down){
turbo.button.resetGroup(this.group);
}
this.state=_20;
this.delayedState=this.state;
this.updateButton();
this.domNode.setAttribute("tabindex",(this.isDisabled()?"-1":"0"));
},isDisabled:function(){
return (this.state==this.states.disabled);
},isDown:function(){
return (this.state==this.states.down);
},isUp:function(){
return (this.state==this.states.normal);
},show:function(){
turbo.show(this.domNode);
},hide:function(){
turbo.hide(this.domNode);
},blur:function(){
if(this.btn){
this.btn.blur();
}
},focus:function(){
if(turbo.env.safari){
return;
}
if(this.btn&&this.btn.focus){
this.btn.focus();
}
},delayedSetState:function(){
if(this.state!=this.delayedState){
this.setState(this.delayedState);
}
this.delayedState=this.state;
},doMouseOver:function(){
if(!this.isDisabled()&&(!this.toggle||!this.isDown())){
this.setState(this.states.over);
}
},doMouseOut:function(){
if(!this.isDisabled()&&(!this.toggle||!this.isDown())){
this.delayedState=this.states.normal;
window.setTimeout(turbo.bind(this,this.delayedSetState),1);
}
},preventEventDefault:function(_21){
if(_21&&_21.preventDefault){
_21.preventDefault();
}
},doMouseDown:function(_22){
this.preventEventDefault(_22);
if(this.isDisabled()){
return;
}
if(this.mouseDownState==-1){
this.mouseDownState=this.state;
}
this.setState(this.states.down);
var btn=this.btn;
this.onDown(_22);
},doMouseUp:function(_24){
this.preventEventDefault(_24);
if(this.isDisabled()){
return;
}
if(!this.toggle){
this.setState(this.states.normal);
}
this.onUp(_24);
},_click:function(_25){
if(this.toggle){
var _26=(this.mouseDownState>-1?this.mouseDownState:this.state);
if(!this.group||_26!=this.states.down){
this.setState(_26!=this.states.down?this.states.down:this.states.normal);
}
this.mouseDownState=-1;
}
this.event=_25;
switch(this.type){
case "submit":
case "reset":
var _27=dojo.dom.getFirstAncestorByTag(this.btn,"form");
if(_27){
_27[this.type]();
}
break;
}
this.onClick(_25);
_25.preventDefault();
},doClick:function(_28){
if(this.isDisabled()){
_28.preventDefault();
return;
}
if(this.focusOnClick){
this.focus();
}
this._click(_28);
},doKeyDown:function(_29){
switch(_29.keyCode){
case _29.KEY_ENTER:
case _29.KEY_SPACE:
this.keyDown=_29.keyCode;
this.doMouseDown(null);
if(this.repeating){
turbo.defer(turbo.bindArgs(this,"doMouseUp",null),10);
this._click(_29);
}
}
},doKeyUp:function(_2a){
if(this.repeating||this.keyDown!=_2a.keyCode){
return;
}
this.keyDown=0;
switch(_2a.keyCode){
case _2a.KEY_ENTER:
case _2a.KEY_SPACE:
this.doMouseUp(null);
this._click(_2a);
}
}},"html");
dojo.widget.defineWidget("dojo.widget.html.TurboButton",dojo.widget.html.TurboButtonBase,{templateString:"<span dojoAttachPoint=\"btn\" tabindex=\"0\" hidefocus=\"hidefocus\"></span>",classTag:"turbo-button",focused:false,glyph:"",glyphAfter:false,hideLeft:"",hideRight:"",themeJs:true,btn:null,btnClient:null,btnMid:null,btnLeft:null,btnRight:null,fillInTemplate:function(_2b,_2c){
if(this.extraArgs["gecko"]||(turbo.env.moz&&dojo.dom.getFirstAncestorByTag(this.getFragNodeRef(_2c),"table"))){
dojo.widget.html.TurboGeckoButton.call(this);
}
this.createNodes();
this.btnNode=this.btnMid;
this.initButton(_2b);
if(this.hideLeft){
this.btnLeft.style.display="none";
}
if(this.hideRight){
this.btnRight.style.display="none";
}
if(!this.value){
var _2d=this.getFragNodeRef(_2c);
if(_2d.innerHTML){
this.value=_2d.innerHTML;
}
}
if(this.width){
turbo.setStyleWidthPx(this.btnMid,this.width);
}
this.glyph=this.glyph||this.extraArgs["image"];
this.setContent(this.value,this.glyph);
this.connectEvents(this.btn,"MouseOver","MouseOut","MouseDown","MouseUp","Click","KeyDown","KeyUp","Focus","Blur");
},createNodes:function(){
var _2e="<span class=\"turbo-button-client\"><span class=\"turbo-button-left\"></span><span class=\"turbo-button-mid\"></span><span class=\"turbo-button-right\"></span></span>";
this.btn.innerHTML=_2e;
this.btnClient=this.btn.childNodes[0];
var cn=this.btnClient.childNodes;
this.btnLeft=cn[0];
this.btnMid=cn[1];
this.btnRight=cn[2];
},disableSelectionRecurse:function(_30){
turbo.disableSelection(_30);
},getButtonClass:function(){
return ["","-down","-disabled","-over"][this.state];
},setButtonClasses:function(){
var cn=this.getButtonClass();
var _32=this.classTag+"-client"+(cn?" "+this.classTag+cn:"");
if(this.focused&&!this.isDown()&&!this.isDisabled()){
_32+=" "+this.classTag+"-focus";
}
this.btnClient.className=_32;
this.btnLeft.className=this.classTag+"-left";
this.btnMid.className=this.classTag+"-mid"+(turbo.env.ie?" "+this.classTag+"-mid-ie":"");
this.btnRight.className=this.classTag+"-right";
},doFocus:function(_33){
this.focused=true;
this.setButtonClasses();
},doBlur:function(_34){
this.focused=false;
this.setButtonClasses();
},updateButton:function(){
this.setStyledClass(this.domNode,"");
this.setButtonClasses();
},getContent:function(_35,_36){
var h=_35;
if(!turbo.env.safari){
h="<span>"+h+"</span>";
}
if(_36){
var g="<img src=\""+_36+"\">";
if(this.glyphAfter){
h=h+g;
}else{
h=g+h;
}
}
return h;
},setContent:function(_39,_3a){
this.btnMid.innerHTML=this.getContent(_39,_3a);
this.disableSelectionRecurse(this.btnMid);
}});
dojo.widget.html.TurboGeckoButton=function(){
this.updateButton=function(){
this.setStyledClass(this.domNode,"");
dojo.html.addClass(this.domNode,"turbo-gecko-button");
this.setButtonClasses();
};
this.createNodes=function(){
var _3b="<span><button disabled=\"disabled\">&#160;</button><button tabindex=\"-1\">Caption</button><button disabled=\"disabled\">&#160;</button></span>";
this.btn.innerHTML=_3b;
this.btnClient=this.btn.childNodes[0];
var cn=this.btnClient.childNodes;
this.btnLeft=cn[0];
this.btnMid=cn[1];
this.btnRight=cn[2];
};
};
dojo.widget.defineWidget("dojo.widget.html.TurboTab",dojo.widget.html.TurboButton,{classTag:"turbo-tab",focusOnClick:false,downEvent:null,onGlyphClick:function(_3d){
},getContent:function(_3e,_3f){
return "<span>"+_3e+"</span>";
},setContent:function(_40,_41){
this.btnMid.innerHTML=this.getContent(_40,_41);
if(arguments.length>1){
this.setGlyph(_41);
}
this.disableSelectionRecurse(this.btnMid);
},setGlyph:function(_42){
this.glyph=_42;
var n=this.btnMid.childNodes[0];
if(this.glyph){
n.className=this.classTag+"-bg"+(this.glyphAfter?"-right":"-left");
n.style.backgroundImage="url("+this.glyph+")";
}else{
n.style.backgroundImage="";
}
},isGlyphEvent:function(_44){
if(!_44||_44.keyCode||!this.glyph){
return false;
}
var x=_44.clientX-turbo.getAbsoluteX(this.domNode);
return (this.glyphAfter?x>this.domNode.offsetWidth-16:x<16);
},doMouseDown:function(_46){
_46.preventDefault();
if(this.isDisabled()){
return;
}
this.downEvent=_46;
if(this.isGlyphEvent(this.downEvent)){
return;
}
this.inherited("doMouseDown",arguments);
},doMouseUp:function(_47){
_47.preventDefault();
if(this.isDisabled()){
return;
}
if(this.isGlyphEvent(this.downEvent)){
return;
}
this.inherited("doMouseUp",arguments);
},_click:function(_48){
if(!this.isGlyphEvent(this.downEvent)){
this.inherited("_click",arguments);
}else{
if(this.isGlyphEvent(_48)){
return this.onGlyphClick(_48);
}
}
}},"html");
dojo.widget.defineWidget("dojo.widget.html.TurboToolbtn",dojo.widget.html.TurboButtonBase,{templateString:"<button dojoAttachPoint=\"btn\"><div dojoAttachPoint=\"div\"><img dojoAttachPoint=\"img\"></div></button>",classTag:"turbo_toolbtn",glyph:"",image:"",sprite:"",caption:"",span:null,div:null,img:null,fillInTemplate:function(_49){
this.btnNode=this.btn;
this.initButton(_49);
this.setCaption(this.caption?this.caption:this.value);
if(this.sprite){
this.setSprite(this.sprite);
}else{
this.setGlyph(this.image?this.image:this.glyph);
}
if(!turbo.env.ie&&!turbo.env.moz){
this.btn.style.paddingLeft="2px";
this.btn.style.paddingRight="2px";
}
this.connectEvents(this.btn,"MouseOver","MouseOut","MouseDown","MouseUp","Click","KeyDown","KeyUp");
},updateButton:function(){
this.btn.disabled=(this.state==this.states.disabled?"disabled":"");
this.setStyledClass(this.btn,["","_down","","_over"][this.state]);
},setCaption:function(_4a){
if(!_4a){
return;
}
if(!this.span){
this.span=document.createElement("span");
this.btn.appendChild(this.span);
}
this.span.innerHTML=_4a;
},setSprite:function(_4b,inW,inH){
if(_4b){
if(inW){
this.img.width=inW;
}
if(inH){
this.img.height=inH;
}
this.img.src=turbo.uri(this.themeRoot+"default/images/stent.gif");
this.img.className=_4b;
}
this.img.style.display=(_4b?"":"none");
},setSprite2:function(_4e,inW,inH,_51){
if(_4e){
this.img.width=inW;
this.img.height=inH;
this.img.src=turbo.uri(this.themeRoot+"default/images/stent.gif");
this.img.className="";
this.img.style.backgroundImage="url("+_4e+")";
this.img.style.backgroundRepeat="no-repeat";
this.img.style.backgroundPosition=(-_51*inW)+"px";
}
this.img.style.display=(_4e?"":"none");
},setGlyph:function(_52){
if(_52){
this.img.src=_52;
}
this.img.style.display=(_52?"":"none");
turbo.showHide(this.img.parentNode,Boolean(_52));
},set:function(_53,_54){
this.setCaption(_53);
this.setGlyph(_54);
}},"html");
dojo.widget.defineWidget("dojo.widget.html.TurboSimpleButton",dojo.widget.html.TurboButtonBase,{classTag:"turbo_sbtn",fillInTemplate:function(_55){
this.btnNode=this.btn;
this.initButton(_55);
if(this.value){
this.btn.innerHTML=this.value;
}
},updateButton:function(){
this.btn.disabled=(this.state==this.states.disabled?"disabled":"");
var a=["","Down","","Over"];
this.btn.className=this.classTag+[this.state];
}},"html");
dojo.widget.defineWidget("dojo.widget.html.TurboCheckbox",dojo.widget.html.TurboButtonBase,{templateString:"<span dojoAttachPoint=\"btn\" tabindex=\"0\"></span>",classTag:"turbo-cbox",glyph:null,caption:null,fillInTemplate:function(_57){
this.toggle=true;
this.createButtons();
this.btnNode=this.btn;
this.initButton(_57);
if(this.value){
this.caption.innerHTML=this.value;
}
},doFocus:turbo.nop,doBlur:turbo.nop,createButtons:function(){
var _58="<span type=\""+this.type+"\" class=\"turbo-cbox-button\"></span><span class=\"turbo-cbox-caption\">Checkbox</span>";
this.domNode.innerHTML=_58;
this.setStyledClass(this.domNode,"");
this.glyph=this.domNode.childNodes[0];
this.caption=this.domNode.childNodes[1];
this.connectEvents(this.btn,"MouseOver","MouseOut","MouseDown","MouseUp","Click","KeyDown","KeyUp","Focus","Blur");
},updateButton:function(){
this.setClassName(this.domNode,"");
var a=["Off","Down","Off","Over"];
var _5a=this.classTag+"-glyph";
this.glyph.className=_5a+" "+_5a+"-"+a[this.state];
this.btn.disabled=(this.state==this.states.disabled?"disabled":"");
var _5b=this.classTag+"-caption";
this.caption.className=_5b+" "+_5b+"-"+a[this.state];
}});
dojo.widget.defineWidget("dojo.widget.html.TurboRadio",dojo.widget.html.TurboCheckbox,{classTag:"turbo-radio"});
dojo.provide("turbo.widgets.TurboNotebook");
dojo.provide("turbo.widgets.HtmlTurboNotebook");
dojo.require("turbo.widgets.TurboWidget");
dojo.require("dojo.io.*");
dojo.widget.defineWidget("dojo.widget.html.TurboNotebook",dojo.widget.html.TurboWidget,function(){
this.pages=[];
this.modules=[];
},{themeable:false,src:"",sync:true,delayed:false,classTag:"turbo_notebook",count:0,selected:-1,fillInTemplate:function(_5c,_5d){
if(!this.domNode.getAttribute("turboalign")){
this.domNode.setAttribute("turboalign","client");
}
this.initPages(_5d);
this.parseChildWidgets(_5d);
this._selectPage(0);
},initPages:function(_5e){
var _5f=this.getFragNodeRef(_5e);
for(var i=0;(n=_5f.childNodes[i]);i++){
if(n.nodeType==1){
this.addPage(n);
}
}
},turboDestroy:function(){
turbo.clean(this.domNode);
},goodIndex:function(_61){
return (_61>=0&&_61<this.pages.length);
},getPage:function(_62){
if(this.goodIndex(_62)){
return this.pages[_62];
}else{
return null;
}
},hidePage:function(_63){
if(this.goodIndex(_63)){
var p=this.getPage(_63);
if(turbo.showing(p)){
turbo.hide(p);
}
}
},showPage:function(_65){
if(!this.goodIndex(_65)){
return;
}
this.requestModule(this.modules[_65]);
turbo.show(this.getPage(_65));
},showHidePage:function(_66,_67){
if(_67){
this.showPage(_66);
}else{
this.hidePage(_66);
}
},requestModule:function(_68){
if(_68&&_68.delayed){
_68.request();
}
},parseChildWidgets:function(_69){
this.modules=[];
var _6a=dojo.widget.getParser().createSubComponents(_69);
if(!_6a.length){
return;
}
var _6b=this;
var _6c=function(w){
if(dojo.lang.isArray(w)){
dojo.lang.forEach(w,_6c);
}else{
if(w.widgetType=="TurboModule"){
var idx=(dojo.lang.indexOf(_6b.pages,w.domNode));
if(idx>=0){
_6b.modules[idx]=w;
}
}
}
};
dojo.lang.forEach(_6a,_6c);
},count:function(){
return this.pages.length;
},getAddIndex:function(_6f){
return (turbo.isGoodIndex(this.pages,_6f)?_6f:this.pages.length);
},addPage:function(_70,_71){
turbo.hide(_70);
var _72=this.getAddIndex(_71);
this.pages.splice(_72,0,_70);
if(this.count()>0){
if(this.selected>=_72){
this.selected++;
}
}else{
this.selected=_72;
}
return _72;
},addPageContent:function(_73,_74,_75){
var _76=document.createElement("div");
_76.innerHTML=_73;
_76.setAttribute("turboalign","client");
turbo.hide(_76);
this.domNode.insertBefore(_76,this.getPage(this.getAddIndex(_75)));
if(_74){
turbo.parseWidgets(_76);
}
return this.addPage(_76,_75);
},removePage:function(_77){
if(!this.goodIndex(_77)){
return;
}
var _78=this.pages[_77];
turbo.clean(_78);
_78.parentNode.removeChild(_78);
this.pages.splice(_77,1);
if(this.selected>_77){
this.selected--;
}else{
if(this.selected==_77){
this.selected=-1;
}
}
},_selectPage:function(_79){
this.showPage(_79);
if(this.selected!=_79){
this.hidePage(this.selected);
}
this.selected=_79;
},selectPage:function(_7a){
if(!this.goodIndex(_7a)){
return;
}
var _7b=this.getPage(_7a);
if(!_7b.turboNotebookShown){
turbo.setVisibility(_7b,false);
}
this._selectPage(_7a);
var _7c=function(){
turbo.aligner.align();
turbo.setVisibility(_7b,true);
_7b.turboNotebookShown=true;
};
turbo.defer(_7c,200);
turbo.aligner.alignLater(500);
}});
dojo.provide("turbo.widgets.TurboModule");
dojo.provide("turbo.widgets.HtmlTurboModule");
dojo.require("turbo.widgets.TurboWidget");
dojo.require("dojo.io.*");
turbo.beforeOnLoad=true;
turbo.onloads=[];
turbo.doOnLoad=function(){
try{
for(var i=0,l=turbo.onloads.length;i<l;i++){
turbo.onloads[i]();
}
}
finally{
turbo.onloads=[];
}
};
dojo.addOnLoad(function(){
turbo.beforeOnLoad=false;
turbo.doOnLoad();
});
dojo.widget.defineWidget("dojo.widget.html.TurboModule",dojo.widget.html.TurboWidget,function(){
this.$=this.byId;
},{classTag:"turbo-module",form:"",src:"",method:"",params:null,loaded:false,sync:true,delayed:false,themeable:false,manageIds:false,macros:"",hasWidgets:true,prefix:"",_counter:0,fillInTemplate:function(_7f,_80){
this.bindArgEvents(_7f);
dojo.html.prependClass(this.domNode,this.classTag);
},initialize:function(){
this.inherited("initialize",arguments);
if(!this.delayed){
this.request();
}
},onLoading:function(_81){
},onLoaded:function(){
},setSrc:function(_82){
this.loaded=false;
this.src=_82;
if(!this.delayed){
this.request();
}
},clear:function(){
turbo.clean(this.domNode);
dojo.dom.removeChildren(this.domNode);
},load:function(_83){
if(!_83){
this.request();
}else{
this.delayed=false;
this.setSrc(_83);
}
},request:function(){
if(this.loaded||!this.src){
return;
}
turbo.setBusyCursor();
try{
var _84={url:this.src,formNode:(dojo.lang.isString(this.form)?turbo.$(this.form):this.form),sync:this.sync,load:turbo.bind(this,this.receive),error:turbo.bind(this,this.error)};
if(this.method){
_84.method=this.method;
}
if(this.params){
_84.content=this.params;
}
if(dojo.io.bind(_84)===false){
this.status="unspecified bind error";
turbo.debug(this.status);
}
}
catch(e){
this.status=e;
turbo.debug(e);
}
finally{
turbo.setDefaultCursor();
}
},error:function(_85,_86){
turbo.debug(_86);
},receive:function(_87,_88,evt){
this.loaded=true;
if(this.onLoading(_88)===false){
return;
}
this.setContent(_88);
},setContent:function(_8a){
turbo.clean(this.domNode);
if(this.manageIds){
_8a=this.uniquifyIds(_8a);
_8a=turbo.stringReplace(_8a,/%%module%%/ig,this.widgetId);
}
_8a=turbo.macros.insert(_8a,this.macros);
this.domNode.innerHTML=this.extractScript(_8a);
this.loadScript();
var _8b=djConfig.searchIds;
delete djConfig.searchIds;
this.executeScript();
if(this.hasWidgets){
this.parseWidgets();
}
djConfig.searchIds=_8b;
if(dojo.render.html.ie&&this.turboalign){
turbo.setStyleSizePx(this.domNode,1,1);
}
turbo.aligner.alignFrom(this.domNode.parentNode);
if(!turbo.beforeOnLoad){
turbo.doOnLoad();
}
this.onLoaded();
},getIdPrefix:function(){
return (!this.manageIds?"":(this.prefix?this.prefix:this.widgetId)+"_"+this._counter+".");
},byId:function(_8c){
return turbo.$(this.getIdPrefix()+_8c);
},widgetById:function(_8d){
return dojo.widget.byId(this.getIdPrefix()+_8d);
},uniquifyIds:function(_8e){
this._counter++;
var idp=this.getIdPrefix();
return turbo.stringReplace(_8e,/(<[^>]*id=")([^"]*)/ig,function(w,pre,id){
return pre+idp+id;
});
},extractScript:function(_93){
var _94=[];
var xml=turbo.stringReplace(_93,/<script[^>]*src="([^"]*)"[^>]*>[\s\S]*?<\/script>/ig,function(w,_97){
_94.push(_97);
return "";
});
this.sources=_94;
var _98=[];
var id=this.widgetId;
var xml=turbo.stringReplace(_93,/<script[^>]*>([\s\S]*?)<\/script>/ig,function(w,_9b){
_9b=turbo.stringReplace(_9b,/%%module%%/ig,id);
_98.push(_9b);
return "";
});
this.scripts=_98;
return xml;
},loadScript:function(){
for(var i=0;i<this.sources.length;i++){
turbo.loadScript(this.sources[i]);
}
},hookOnLoad:function(){
this.oldAddOnLoad=dojo.addOnLoad;
dojo.addOnLoad=function(_9d){
turbo.onloads.push(_9d);
};
},unHookOnLoad:function(){
dojo.addOnLoad=this.oldAddOnLoad;
},executeScript:function(){
this.hookOnLoad();
try{
for(var i=0;i<this.scripts.length;i++){
var _9f="with (turbo.global) { "+this.scripts[i]+" }";
try{
eval(_9f);
}
catch(e){
turbo.debug("TurboModule: exception evaluating module script");
turbo.debug("message = "+e.message,"fileName = "+e.fileName,"lineNumber = "+e.lineNumber);
dojo.debug("script = ["+_9f+"]");
}
}
}
finally{
this.unHookOnLoad();
}
},parseWidgets:function(){
turbo.parseWidgets(this.domNode);
}});
dojo.provide("turbo.widgets.TurboTabbar");
dojo.provide("turbo.widgets.HtmlTurboTabbar");
dojo.require("turbo.widgets.TurboWidget");
dojo.require("turbo.widgets.TurboButton");
dojo.widget.defineWidget("dojo.widget.html.TurboTabbar",dojo.widget.html.TurboWidget,{isContainer:true,templatePath:null,templateString:"<div dojoAttachPoint=\"containerNode\"></div>",containerNode:null,classTag:"turbo_tabbar",tabIndex:0,lastIndex:-1,canSelectTab:function(_a0){
},onSelectTab:function(_a1){
},onTabGlyphClick:function(_a2,_a3,_a4){
},fillInTemplate:function(_a5){
this.bindArgEvents(_a5);
},styleChanged:function(){
this.setStyledClass(this.domNode,"");
for(var i=0,l=this.children.length;i<l;i++){
this.children[i].setTheme(this.style);
}
},registerTab:function(_a8,_a9){
_a8.tabIndex=_a9;
_a8.setGroup(this.widgetId);
_a8.setTheme(this.style);
var _aa=this;
_a8.onClick=function(_ab){
_aa.tabClick(this,_ab);
};
_a8._tabGlyphClick=function(_ac){
_aa.tabGlyphClick(this,_ac);
};
},registerChild:function(_ad,_ae){
this.registerTab(_ad,this.children.length);
return dojo.widget.DomWidget.prototype.registerChild.apply(this,arguments);
},count:function(){
return this.children.length;
},goodIndex:function(_af){
return (_af>=0&&_af<this.count());
},getTab:function(_b0){
return this.children[_b0];
},tabGlyphClick:function(_b1,_b2){
this.onTabGlyphClick(_b1.tabIndex,_b1,_b2);
},tabClick:function(_b3,_b4){
if(this.canSelectTab(_b3.inTabIndex)===false){
return this.selectTab(this.tabIndex);
}
this.lastIndex=this.tabIndex;
this.tabIndex=_b3.tabIndex;
this.onSelectTab(this.tabIndex);
},selectTab:function(_b5){
if(!this.goodIndex(_b5)){
_b5=this.count()-1;
}
this.tabIndex=_b5;
if(_b5>=0){
this.getTab(this.tabIndex).setState("down");
}
},insertChild:function(_b6,_b7){
for(var i=_b7,l=this.count();i<l;i++){
this.children[i].tabIndex++;
}
this.children.splice(_b7,0,_b6);
},removeChild:function(_ba){
for(var i=_ba+1,l=this.count();i<l;i++){
this.children[i].tabIndex--;
}
this.children.splice(_ba,1);
},addTab:function(_bd,_be){
var _bf=this.containerNode;
var _c0="last";
var _c1=this.count();
if(arguments.length>1&&this.goodIndex(_be)){
_bf=this.children[_be].domNode;
_c0="before";
_c1=_be;
}
var _c2=dojo.widget.createWidget("TurboTab",_bd,_bf,_c0);
this.insertChild(_c2,_c1);
this.registerTab(_c2,_c1);
if(this.count()==1){
this.selectTab(0);
this.tabClick(_c2);
}
},removeTab:function(_c3){
if(this.goodIndex(_c3)){
var _c4=this.children[_c3];
this.removeChild(_c3);
_c4.destroy();
}
if(this.lastIndex==_c3){
this.lastIndex=-1;
}
if(this.tabIndex>_c3){
this.tabIndex--;
}
if(this.tabIndex==_c3){
var i=Math.min(this.count()-1,this.tabIndex);
this.tabIndex=-1;
if(i>=0){
this.selectTab(i);
this.tabClick(this.getTab(i));
}
}
}},"html");
dojo.provide("turbo.widgets.TurboToolbar");
dojo.provide("turbo.widgets.HtmlTurboToolbar");
dojo.require("turbo.widgets.TurboWidget");
dojo.require("turbo.widgets.TurboButton");
dojo.widget.defineWidget("dojo.widget.html.TurboToolbar",dojo.widget.html.TurboWidget,{list:false,classTag:"turbo-toolbar",fillInTemplate:function(_c6,_c7){
this.createChildWidgets(_c7);
},styleChanged:function(){
this.setStyledClass(this.domNode,(this.list?"-list":""));
}},"html");
dojo.provide("turbo.widgets.TurboPagebar");
dojo.provide("turbo.widgets.HtmlTurboPagebar");
dojo.require("turbo.widgets.TurboWidget");
dojo.require("turbo.widgets.TurboButton");
dojo.require("turbo.widgets.TurboTabbar");
dojo.require("turbo.widgets.TurboNotebook");
dojo.widget.defineWidget("dojo.widget.html.TurboPagebar",dojo.widget.html.TurboTabbar,{templateString:"<div turboalign=\"client\"><div dojoAttachPoint=\"containerNode\" turboalign=\"top\" class=\"turbo-pagebar-tabs\"></div><div dojoAttachPoint=\"pages\" turboAlign=\"client\" class=\"turbo-pagebar-pages\"></div></div>",pages:null,classTag:"turbo-pagebar",contentId:"",fillInTemplate:function(_c8,_c9){
this.inherited("fillInTemplate",arguments);
turbo.defer(this,this.installPages,100);
},installPages:function(){
if(this.contentId){
this.content=turbo.$(this.contentId);
}
if(!this.content){
this.content=this.domNode.nextSibling;
while(this.content&&this.content.nodeType&&this.content.nodeType!=1){
this.content=this.content.nextSibling;
}
}
if(this.content){
this.content.parentNode.removeChild(this.content);
this.pages.appendChild(this.content);
}else{
this.debug("installPages","BAD content - contentId: ("+this.contentId+")");
}
}});
dojo.provide("turbo.widgets.TurboPageButtons");
dojo.provide("turbo.widgets.HtmlTurboPageButtons");
dojo.require("turbo.widgets.TurboWidget");
dojo.widget.defineWidget("dojo.widget.html.TurboPageButtons",dojo.widget.html.TurboWidget,{pagesNode:null,classTag:"turbo-page-buttons",className:"",numPages:1,numButtons:3,buttonWidth:28,buttonHeight:20,buttonMargin:6,_x:0,_i:0,lastValue:1,buttonList:"prevN, prev, innerFirst, pages, innerLast, next, nextN",buttonLabels:{first:"|&lt;",prevN:"&lt;&lt;",prev:"&lt;",next:"&gt;",nextN:"&gt;&gt;",last:"&gt;|",sep:"..."},page:1,onPageChange:function(){
},setButtonClasses:function(){
this.buttonClass=this.classTag+"-button";
this.buttonHighlightClass=this.buttonClass+" "+this.classTag+"-highlight";
this.buttonSelectedClass=this.buttonClass+" "+this.classTag+"-selected";
this.buttonDisabledClass=this.buttonClass+" "+this.classTag+"-disabled";
this.buttonSeparatorClass=this.classTag+"-separator";
},fillInTemplate:function(_ca,_cb){
this.setButtonClasses();
turbo.disableSelection(this.domNode);
dojo.event.connect(this.domNode,"onclick",this,"pageClick");
dojo.event.connect(this.domNode,"onmouseover",this,"pageOver");
dojo.event.connect(this.domNode,"onmouseout",this,"pageOut");
dojo.event.connect(this.domNode,"onmousemove",this,"mouseMove");
dojo.event.topic.subscribe("turboresize",this,"turboresize");
this.setButtonList(this.buttonList);
this.createPagesNode();
this.build();
this.initBuild();
},styleChanged:function(){
this.setStyledClass(this.domNode);
},turboresize:function(){
if(turbo.showing(this.domNode)){
this.build();
}
},build:function(){
this.createPages();
},setNumPages:function(_cc){
if(_cc!=undefined){
this.numPages=Number(_cc);
}
this.numPages=(this.numPages<1)?1:this.numPages;
this.build();
},setButtonList:function(_cd){
this.buttonList={};
var _ce=_cd.replace(/ /g,"").split(",");
for(var i in _ce){
if(!Array.prototype[i]){
this.buttonList[_ce[i]]=true;
}
}
},initBuild:function(_d0,_d1){
turbo.defer(turbo.bindArgs(this,this.setPage,_d0,_d1),10);
},getNumPages:function(){
return this.numPages;
},getPage:function(){
return this.page;
},setPage:function(_d2,_d3){
if(_d3){
this.numPages=Number(_d3);
}
_d2=Number(_d2);
if(!_d2||_d2<1||_d2>this.numPages){
return;
}
this.lastValue=this.page;
this.page=_d2;
this.build();
},doResize:function(){
this.build();
},getPageTarget:function(_d4){
var t=_d4.target;
while(t&&dojo.dom.isDescendantOf(t,this.domNode)&&!t.page){
t=t.parentNode;
}
if(t!=this.domNode){
return t;
}
},pageClick:function(_d6){
var _d7=this.getPageTarget(_d6);
if(!_d7||_d7.disabled||!_d7.page){
return;
}
this.setPage(_d7.page);
this.onPageChange(this.page);
},setPageOut:function(){
this.overNode=null;
if(this.lastOverNode){
this.lastOverNode.className=this.getDefaultButtonClass(this.lastOverNode);
}
this.lastOverNode=null;
},setPageOver:function(_d8){
if(this.lastOverNode&&this.lastOverNode!=_d8){
this.setPageOut();
}
this.overNode=_d8;
if(_d8.page!=this.page){
_d8.className=this.buttonHighlightClass;
}
this.lastOverNode=_d8;
},isBadPageTarget:function(_d9){
return (!_d9||_d9==this.domNode||_d9.disabled||!_d9.page);
},firePageEvent:function(_da,_db){
_da.page=this.page;
_db.call(this,_da);
},mouseOver:function(e){
},mouseMove:function(e){
},pageOver:function(_de){
var t=this.getPageTarget(_de);
if(!t){
return;
}
var _e0=(t.page==this.page);
var _e1=(this.lastOverNode&&this.lastOverNode.page==t.page);
if(this.isBadPageTarget(t)||_e1){
turbo.killEvent(_de);
return;
}
this.setPageOver(t);
_de.pageNode=t;
this.firePageEvent(_de,this.mouseOver);
},mouseOut:function(e){
},pageOut:function(_e3){
if(!this.lastOverNode||dojo.dom.isDescendantOf(_e3.relatedTarget,this.lastOverNode)){
turbo.killEvent(_e3);
return;
}
this.setPageOut();
this.firePageEvent(_e3,this.mouseOut);
},getDefaultButtonClass:function(_e4){
return (_e4.disabled?this.buttonDisabledClass:(_e4.page==this.page&&!isNaN(_e4.firstChild.innerHTML)?this.buttonSelectedClass:(this.overNode&&_e4==this.overNode?this.buttonHighlightClass:this.buttonClass)));
},getPageRange:function(_e5){
var _e5=(_e5!=undefined?_e5:this.numButtons);
if(this.numPages<=_e5){
return {start:1,end:Math.max(1,this.numPages)};
}
var rp=Math.floor(Number(_e5)/2);
var _e7={};
_e7.start=Math.max(1,Number(this.page)-rp);
if(this.numPages-_e7.start<_e5){
_e7.start=this.numPages-(_e5-1);
}
_e7.end=_e7.start+_e5-1;
return _e7;
},inPageRange:function(_e8,_e9){
var _ea=this.getPageRange(_e9);
return (_e8>=_ea.start&&_e8<=_ea.end);
},numFixedButtons:function(_eb){
var w=0;
for(var i in _eb){
if(i!="pages"&&i!="innerFirst"&&i!="innerLast"){
w++;
}
}
return w;
},calcFixedButtonsWidth:function(_ee){
var w=0;
for(var i in _ee){
w+=(i!="pages"&&i!="innerFirst"&&i!="innerLast")?this.buttonWidth+this.buttonMargin:0;
}
return w;
},calcNumButtons:function(_f1){
var s=turbo.getContentSize(this.domNode);
var w=this.calcFixedButtonsWidth(_f1);
var bs=this.buttonWidth+this.buttonMargin;
var _f5=function(){
return Math.floor((s.w-w)/bs);
};
var _f6=_f1["innerFirst"];
var _f7=(_f6==true)&&this.inPageRange(1,_f5());
if(_f6&&!_f7){
w+=bs+bs;
}
if(_f1["innerLast"]&&!this.inPageRange(this.numPages,_f5())){
w+=bs+bs;
}
if(_f7&&!this.inPageRange(1,_f5())){
w+=bs+bs;
}
return _f5(_f1);
},attachButton:function(_f8){
this.pagesNode.appendChild(_f8);
},createPageButton:function(_f9,_fa,_fb,_fc){
var _fd=(this._i<this.oldNumButtons)?this.pagesNode.childNodes[this._i]:document.createElement("div");
_fd.page=_f9;
_fd.id=this.widgetId+"_"+_fd.page;
_fd.disabled=(_fb?true:false);
_fd.innerHTML="<div>"+(_fa?_fa:_f9)+"</div>";
_fd.className=this.getDefaultButtonClass(_fd);
var w=(_fc!=undefined?_fc:this.buttonWidth);
_fd.style.lineHeight=this.buttonHeight+"px";
turbo.setStyleBoundsPx(_fd,this._x,0,w,this.buttonHeight);
this._x+=w+this.buttonMargin;
this._i++;
if(this._i>=this.oldNumButtons){
this.attachButton(_fd);
}
},createSep:function(){
var sep=(this._i<this.oldNumButtons)?this.pagesNode.childNodes[this._i]:document.createElement("div");
sep.page=undefined;
sep.disabled=undefined;
sep.className=this.buttonSeparatorClass;
sep.innerHTML=this.buttonLabels.sep;
turbo.setStyleBoundsPx(sep,this._x,0,this.buttonWidth,this.buttonHeight);
this._x+=this.buttonWidth+this.buttonMargin;
this._i++;
if(this._i>=this.oldNumButtons){
this.attachButton(sep);
}
},create_first:function(){
this.createPageButton(1,this.buttonLabels.first,(this.page==1));
},create_last:function(){
this.createPageButton(this.numPages,this.buttonLabels.last,(this.page==this.numPages));
},create_pages:function(){
var _100=this.getPageRange();
for(var i=_100.start;i<=_100.end;i++){
this.createPageButton(i,i);
}
},create_prev:function(){
var _102=Math.max(1,Number(this.page)-1);
this.createPageButton(_102,this.buttonLabels.prev,(this.page==1));
},create_next:function(){
var _103=Math.min(this.numPages,Number(this.page)+1);
this.createPageButton(_103,this.buttonLabels.next,(this.page==this.numPages));
},create_prevN:function(){
var _104=Math.max(1,Number(this.page)-this.numButtons);
this.createPageButton(_104,this.buttonLabels.prevN,(this.page==1));
},create_nextN:function(){
var _105=Math.min(this.numPages,Number(this.page)+this.numButtons);
this.createPageButton(_105,this.buttonLabels.nextN,(this.page==this.numPages));
},create_innerFirst:function(){
if(!this.inPageRange(1)){
this.createPageButton(1,"1");
this.createSep();
}
},create_innerLast:function(){
if(!this.inPageRange(this.numPages)){
this.createSep();
this.createPageButton(this.numPages,this.numPages);
}
},getButtonList:function(){
var x=0;
for(var i in this.buttonList){
x++;
}
var t=this.calcNumButtons(this.buttonList)+this.numFixedButtons(this.buttonList);
var _109={prev:true,pages:true,next:true};
return (t<x)?_109:this.buttonList;
},createPages:function(){
this._x=0;
this._i=0;
this.oldNumButtons=this.pagesNode.childNodes.length;
var _10a=this.getButtonList();
this.numButtons=this.calcNumButtons(_10a);
for(var i in _10a){
this["create_"+i]();
}
turbo.setStyleSizePx(this.pagesNode,this._x,this.buttonHeight+this.buttonMargin);
this.removeExcessPages();
},removeExcessPages:function(){
for(var i=this._i;i<this.oldNumButtons;i++){
this.pagesNode.removeChild(this.pagesNode.childNodes[this._i]);
}
},createPagesNode:function(){
this.pagesNode=document.createElement("div");
this.pagesNode.style.position="relative";
this.pagesNode.style.top="0";
this.domNode.appendChild(this.pagesNode);
}},"html");
dojo.provide("turbo.widgets.TurboSlider");
dojo.provide("turbo.widgets.HtmlTurboSlider");
dojo.require("turbo.widgets.TurboWidget");
dojo.declare("turbo.rangemap",null,{minimum:0,maximum:100,getRange:function(){
return (this.maximum-this.minimum);
},getExtentOverRange:function(){
return this.getExtent()/this.getRange();
},setMinMax:function(_10d,_10e){
this.minimum=_10d;
this.maximum=_10e;
},changePosition:function(inDx){
var p=this.getPosition();
var n=p+inDx;
return (this.setPosition(p+inDx)-p)-inDx;
},setValue:function(_112){
this.setPosition(Math.round((_112-this.minimum)*this.getExtentOverRange()));
},getValue:function(){
var eor=this.getExtentOverRange();
return (eor?Math.round(this.getPosition()/eor):0)+this.minimum;
}});
dojo.widget.defineWidget("dojo.widget.html.TurboRangeBar",[dojo.widget.html.TurboWidget,turbo.rangemap],{templateString:"<div dojoAttachPoint=\"LeftBar\" tabindex=\"1\"><div dojoAttachPoint=\"RightBar\"></div></div>",LeftBar:null,RightBar:null,classTag:"turbo_rangebar",margin:2,fillInTemplate:function(_114,_115){
if(this.extraArgs["value"]){
window.setTimeout(turbo.bindArgs(this,this.setValue,this.extraArgs["value"]),400);
}
},styleChanged:function(){
this.setClassName(this.LeftBar,"Left");
this.setClassName(this.RightBar,"Right");
},getWindow:function(){
return this.margin;
},getExtent:function(){
return this.LeftBar.offsetWidth-this.getWindow();
},getPosition:function(){
return this.RightBar.offsetLeft;
},setPosition:function(_116){
var _117=this.getWindow();
var _118=this.getExtent();
var p=(_116>_118?_118:(_116<this.margin?this.margin:_116));
this.RightBar.style.marginLeft=(p&&p>0?p+"px":0);
var _11a=this.LeftBar.offsetWidth;
return p;
}},"html");
dojo.widget.defineWidget("dojo.widget.html.TurboSlider",dojo.widget.html.TurboRangeBar,{templateString:"<div dojoAttachPoint=\"LeftBar\" tabindex=\"1\"><div dojoAttachPoint=\"RightBar\"><div dojoAttachPoint=\"Thumb\"><div></div></div></div>",snap:false,Thumb:null,classTag:"turbo_slider",mouseDown:false,mouseX:0,changing:function(_11b){
},change:function(_11c){
},fillInTemplate:function(_11d,_11e){
this.inherited("fillInTemplate",arguments);
dojo.event.connect(this.Thumb,"onmousedown",this,"down");
dojo.event.connect(this.Thumb,"onmouseup",this,"up");
dojo.event.connect(this.Thumb,"onmousemove",this,"move");
dojo.event.connect(this.LeftBar,"onmousewheel",this,"wheel");
},styleChanged:function(){
this.inherited("styleChanged",arguments);
this.setClassName(this.Thumb,"Thumb");
},getWindow:function(){
return this.Thumb.offsetWidth;
},down:function(_11f){
this.lastValue=this.getValue();
if(this.LeftBar.focus){
this.LeftBar.focus();
}
this.mouseDown=true;
this.mouseX=_11f.screenX;
turbo.capture(this.Thumb);
},up:function(_120){
if(this.mouseDown){
this.mouseDown=false;
turbo.release(this.Thumb);
if(this.snap){
this.setValue(this.getValue());
}
this.change(this);
}
},move:function(_121){
if(this.mouseDown){
var dx=_121.screenX-this.mouseX;
this.mouseX=_121.screenX+this.changePosition(dx);
if(dojo.render.html.safari&&window.getSelection){
window.getSelection().collapse();
}
this.changing(this);
}
},wheel:function(_123){
var v=this.getValue()+Math.round(_123.wheelDelta/120);
this.setValue(this.getValue()+Math.round(_123.wheelDelta/120));
this.changing(this);
}},"html");
dojo.provide("turbo.widgets.TurboRollover");
dojo.provide("turbo.widgets.HtmlTurboRollover");
dojo.require("turbo.widgets.TurboWidget");
dojo.widget.defineWidget("dojo.widget.html.TurboRollover",dojo.widget.html.TurboWidget,{classTag:"turbo-rollover",mouseover:function(_125){
dojo.debug("over");
},mouseout:function(_126){
dojo.debug("out");
},click:function(_127){
dojo.debug("click");
},themeable:false,fillInTemplate:function(_128,_129){
dojo.event.connect(this.domNode,"onmouseover",this,"mouseover");
dojo.event.connect(this.domNode,"onmouseout",this,"mouseout");
dojo.event.connect(this.domNode,"onclick",this,"click");
}},"html");
dojo.provide("turbo.widgets.TurboSplitter");
dojo.provide("turbo.widgets.HtmlTurboSplitter");
dojo.require("turbo.turbo");
dojo.require("turbo.lib.align");
dojo.require("turbo.widgets.TurboWidget");
dojo.widget.defineWidget("dojo.widget.html.TurboSplitter",dojo.widget.html.TurboWidget,{classTag:"turbo-splitter",layout:"",mouseDown:false,mouseX:0,minimum:-1,maximum:-1,changing:function(){
},change:function(){
},fillInTemplate:function(_12a,_12b){
this.layout=this.layout||this.turboalign;
switch(this.layout){
case "left":
case "right":
break;
case "top":
case "bottom":
this.vertical=true;
break;
default:
this.layout="left";
this.domNode.setAttribute("turboalign","left");
break;
}
dojo.event.connect(this.domNode,"onmousedown",this,"down");
dojo.event.connect(this.domNode,"onmouseup",this,"up");
dojo.event.connect(this.domNode,"onmousemove",this,"move");
dojo.event.connect(this.domNode,"onmouseover",this,"killCapturedEvent");
dojo.event.connect(this.domNode,"onmouseout",this,"killCapturedEvent");
},styleChanged:function(){
this.domNode.style.cursor=(this.vertical?"n-resize":"e-resize");
this.setStyledClass(this.domNode,(this.vertical?"-v":"-h"));
},getPosition:function(){
return {top:dojo.html.getPixelValue(this.domNode,"top"),left:dojo.html.getPixelValue(this.domNode,"left")};
},getSizeNode:function(inDx){
switch(this.layout){
case "left":
case "top":
var node=this.domNode.previousSibling;
while(node&&node.nodeType!=1){
node=node.previousSibling;
}
break;
case "right":
case "bottom":
var node=this.domNode.nextSibling;
while(node&&node.nodeType!=1){
node=node.nextSibling;
}
break;
}
return node;
},setContainerSize:function(){
var c=this.sizeNode.parentNode;
this.containerSize=(c!=dojo.body()?dojo.html.getContentBox(c):dojo.html.getViewport());
},boundValue:function(_12f){
var x=_12f;
if(this.minimum!=-1){
_12f=Math.max(this.minimum,_12f);
}
if(this.maximum!=-1){
_12f=Math.min(this.maximum,_12f);
}
this.atLimit=(x!=_12f);
return _12f;
},adjustSize:function(inDx,inDy){
var b={width:this.size.w+(this.layout=="right"?-inDx:inDx),height:this.size.h+(this.layout=="bottom"?-inDy:inDy)};
dojo.html.setMarginBox(this.sizeNode,b);
},realign:function(){
turbo.aligner.align();
},killCapturedEvent:function(_134){
if(this.mouseDown&&_134){
dojo.event.browser.stopEvent(_134);
}
},down:function(_135){
this.atLimit=false;
this.sizeNode=this.getSizeNode();
if(!this.sizeNode){
return;
}
this.size=turbo.getOuterSize(this.sizeNode);
this.setContainerSize();
this.initialPosition=this.getPosition();
this.position=this.getPosition();
this.mouseDown=true;
this.mouseX=_135.screenX;
this.mouseY=_135.screenY;
turbo.capture(this.domNode);
document.body.style.cursor=this.domNode.style.cursor;
},up:function(_136){
if(this.mouseDown){
this.mouseDown=false;
turbo.release(this.domNode);
this.adjustSize(this.position.left-this.initialPosition.left,this.position.top-this.initialPosition.top);
this.realign();
this.change();
document.body.style.cursor="";
}
},move:function(_137){
if(this.mouseDown){
this.killCapturedEvent(_137);
if(this.vertical){
this.moveY(_137.screenY-this.mouseY);
}else{
this.moveX(_137.screenX-this.mouseX);
}
if(!this.atLimit){
this.mouseX=_137.screenX;
this.mouseY=_137.screenY;
document.body.style.cursor=this.domNode.style.cursor;
}else{
document.body.style.cursor="not-allowed";
}
this.changing();
}
},moveX:function(inDx){
this.position.left+=inDx;
if(this.layout=="left"){
this.position.left=this.boundValue(this.position.left);
}else{
var w=this.containerSize.width;
this.position.left=w-this.boundValue(w-this.position.left);
}
this.domNode.style.left=this.position.left+"px";
},moveY:function(inDy){
this.position.top+=inDy;
if(this.layout=="top"){
this.position.top=this.boundValue(this.position.top);
}else{
var h=this.containerSize.height;
this.position.top=h-this.boundValue(h-this.position.top);
}
this.domNode.style.top=this.position.top+"px";
},resizeX:function(inDx){
this.adjustSize(inDx,0);
},resizeY:function(inDy){
this.adjustSize(0,inDy);
}});
dojo.provide("turbo.widgets.TurboTreeClassic");
dojo.provide("turbo.widgets.HtmlTurboTreeClassic");
dojo.require("turbo.widgets.TurboWidget");
turbo.objectToArray=function(_13e){
if(dojo.lang.isArray(_13e)){
return _13e;
}
var _13f=[];
for(var i in _13e){
_13f.push(new Array(i,turbo.objectToArray(_13e[i])));
}
return _13f;
};
dojo.widget.defineWidget("dojo.widget.html.TurboTreeClassic",dojo.widget.html.TurboWidget,{templateString:"<div dojoattachpoint=\"mainDiv\"><div dojoattachpoint=\"treeDiv\" class=\"turbo-tree-scroller\"></div></div>",classTag:"turbo-tree",mainDiv:null,treeDiv:null,nodes:null,selected:null,onCanUnselect:function(_141){
},onCanSelect:function(_142){
},onNodeSelected:function(_143){
},fillInTemplate:function(_144){
this.domNode.style.overflow="auto";
if(this.nodes){
this.buildNodes(this.nodes);
}
dojo.event.connect(this.mainDiv,"onclick",this,"divClick");
},styleChanged:function(){
this.mainDiv.className=this.classTag+(this.style?" "+this.classTag+"_"+this.style:"");
},buildLeaf:function(_145,_146,_147,_148){
var img=document.createElement("img");
var leaf=this.imageRoot+(_145?"tree_root.gif":(_147?"tree_last_leaf.gif":"tree_leaf.gif"));
if(_146){
img.src=this.imageRoot+(_148?"tree_closed":"tree_open")+".gif";
img.style.backgroundImage="url("+leaf+")";
}else{
img.src=leaf;
}
return img;
},buildNode:function(_14b,_14c,_14d,_14e){
if(dojo.lang.isObject(_14d)){
var _14f=(_14d.children)&&(_14d.children.length>0);
var _150=(_14d.content?_14d.content:_14d.name);
}else{
var _14f=false;
var _150=_14d;
}
var row=document.createElement("div");
row.name=_14d.name;
row.data=_14d.data;
row.turboTreeNode=true;
if(_14c){
row.appendChild(_14c.cloneNode(true));
}else{
row.appendChild(document.createTextNode(""));
}
row.appendChild(this.buildLeaf((_14c==null),_14f,_14e,_14d.closed));
var node=document.createElement("span");
node.innerHTML=_150;
node.className=this.classTag+"-content";
node.style.cursor="default";
row.appendChild(node);
if(_14f){
var pre=(_14c?_14c:document.createElement("span"));
var img=document.createElement("img");
img.src=this.imageRoot+(_14e?"tree_blank.gif":"tree_bar.gif");
pre.appendChild(img);
var _155=document.createElement("div");
this.buildChildren(_155,pre,_14d.children);
row.appendChild(_155);
pre.removeChild(img);
if(_14d.closed){
_155.style.display="none";
}
}
_14b.appendChild(row);
},buildChildren:function(_156,_157,_158){
var l=_158.length;
for(var i=0;i<l;i++){
this.buildNode(_156,_157,_158[i],(i==l-1));
}
},teardown:function(){
this.treeDiv.innerHTML="";
this.selected=null;
},buildNodes:function(_15b){
this.teardown();
if(dojo.lang.isArray(_15b)){
this.buildChildren(this.treeDiv,null,_15b);
}else{
this.buildNode(this.treeDiv,null,_15b,true);
}
},getToggleElement:function(_15c){
return _15c.childNodes[1];
},getContentElement:function(_15d){
return _15d.childNodes[2];
},getChildrenElement:function(_15e){
return _15e.childNodes[3];
},setSelected:function(_15f,_160){
if(_15f){
with(this.getContentElement(_15f)){
style.backgroundColor=(_160?"blue":"");
style.color=(_160?"white":"");
}
}
},getContent:function(_161){
return this.getContentElement(_161).innerHTML;
},selectNode:function(_162){
if(this.onCanUnselect(this.selected)===false||this.onCanSelect(_162)===false){
return;
}
this.setSelected(this.selected,false);
this.selected=_162;
this.setSelected(this.selected,true);
this.onNodeSelected(this.selected);
},toggleNode:function(_163){
var n=this.getChildrenElement(_163);
if(n){
n.style.display=(n.style.display=="none"?"":"none");
this.getToggleElement(_163).src=this.imageRoot+(n.style.display=="none"?"tree_closed":"tree_open")+".gif";
}
},isTreeNode:function(_165){
return _165&&_165.turboTreeNode;
},divClick:function(_166){
var t=_166.target;
while(t&&!this.isTreeNode(t)){
t=t.parentNode;
}
if(t){
if(_166.target==this.getToggleElement(t)){
this.toggleNode(t);
}else{
this.selectNode(t);
}
}
},_firstTreeNode:function(_168){
if(_168&&!this.isTreeNode(_168)){
_168=_168.nextSibling;
}
return _168;
},nextNode:function(_169){
return (_169?this._firstTreeNode(_169.nextSibling):null);
},childNode:function(_16a){
if(!_16a||!this.isTreeNode(_16a)){
return null;
}
var _16b=this.getChildrenElement(_16a);
if(!_16b){
return null;
}
return this._firstTreeNode(_16b.firstChild);
},rootNode:function(){
return this._firstTreeNode(this.treeDiv.firstChild);
},isLeaf:function(_16c){
return (!this.getChildrenElement(_16c));
}},"html",function(){
this.imageRoot=dojo.uri.dojoUri(this.themeRoot+"default/images/");
});
dojo.provide("turbo.widgets.TurboTree");
dojo.provide("turbo.widgets.HtmlTurboTree");
dojo.require("turbo.widgets.TurboWidget");
dojo.declare("turbo.TreeNode",null,function(_16d){
this.tree=_16d;
this.id=this.tree.makeNodeId();
},{childCount:0,domNode:null,elements:{gutter:0,connector:1,button:1,content:2,children:3},hasChildren:false,childrenInited:false,parent:null,hasConnectors:true,hasButton:true,canClose:true,getNodeElement:function(_16e){
return (this.domNode?this.domNode.childNodes[_16e]:null);
},getImg:function(_16f){
var i=document.createElement("img");
i.setAttribute("src",_16f);
return i;
},getGutterSrc:function(_171){
return turbo.cat(this.tree.imageRoot,(!_171.hasConnectors&&!_171.hasButton?this.tree.treeImages.none:(_171.isLastChildNode()||!_171.hasConnectors?this.tree.treeImages.blank:this.tree.treeImages.gutterBar)));
},buildGutter:function(_172){
if(_172){
var g=_172.getNodeElement(this.elements.gutter).cloneNode(true);
g.appendChild(this.getImg(this.getGutterSrc(_172)));
return g;
}else{
return document.createElement("span");
}
},updateNode:function(){
this.updateOpen();
this.updateConnector();
},updateConnector:function(){
if(this.tree.cacheUpdates){
return;
}
var i=this.getNodeElement(this.elements.connector);
i.style.backgroundImage=i.connector;
},updateOpen:function(){
if(this.tree.cacheUpdates){
return;
}
var c=this.getNodeElement(this.elements.children);
turbo.showHide(c,c.show);
},getAncestor:function(_176){
for(var i=0,n=this;n&&i<_176;i++){
n=n.parent;
}
return n;
},getGutterPartForAncestor:function(_179){
var g=this.getNodeElement(this.elements.gutter);
if(turbo.isGoodIndex(g.childNodes,g.childNodes.length-_179)){
return g.childNodes[g.childNodes.length-_179];
}
},updateGutterPartForAncestor:function(_17b){
var a=this.getAncestor(_17b);
var g=this.getGutterPartForAncestor(_17b);
if(!g){
return;
}
if(g.getAttribute("src")){
g.setAttribute("src",this.getGutterSrc(a));
}
},updateChildGutters:function(_17e){
_17e=(_17e?_17e:1);
for(var i=0,l=this.getChildCount(),c;i<l;i++){
c=this.getChildNode(i);
if(c){
c.updateGutterPartForAncestor(_17e);
c.updateChildGutters(_17e+1);
}
}
},buildContent:function(){
var s=document.createElement("span");
s.innerHTML="Node";
s.className=this.tree.classTag+"-content";
s.style.cursor="default";
return s;
},buildDomNode:function(_183){
var node=document.createElement("div");
node.appendChild(this.buildGutter(_183));
var b=document.createElement("img");
node.appendChild(b);
node.appendChild(this.buildContent());
var c=document.createElement("div");
c.show=true;
node.appendChild(c);
node.setAttribute("turboTreeNode","true");
node.id=this.id;
this.domNode=node;
return node;
},setConnector:function(_187,_188){
var i=this.getNodeElement(this.elements.connector);
var b;
if(!this.hasConnectors){
b=this.tree.treeImages.none;
}else{
if(_187){
b=(_188?this.tree.treeImages.connectorRoot:this.tree.treeImages.connectorRootFirst);
}else{
b=(_188?this.tree.treeImages.connectorLast:this.tree.treeImages.connectorLeaf);
}
}
i.connector="url("+this.tree.imageRoot+b+")";
this.updateConnector();
},isFirstRootNode:function(){
return (this.isRootNode()&&this.domNode==this.domNode.parentNode.firstChild);
},isRootNode:function(){
return (this.domNode.parentNode==this.tree.treeDiv);
},isLastChildNode:function(){
return (this.domNode.parentNode&&this.domNode.parentNode.lastChild==this.domNode);
},selectConnector:function(){
this.setConnector(this.isFirstRootNode(),this.isLastChildNode());
},getButton:function(){
return this.getNodeElement(this.elements.button);
},getButtonSrcFile:function(_18b,_18c){
return (!this.hasButton?this.tree.treeImages.none:(!_18b?this.tree.treeImages.blank:(_18c?this.tree.treeImages.buttonOpen:this.tree.treeImages.buttonClosed)));
},getButtonSrc:function(_18d,_18e){
return turbo.cat(this.tree.imageRoot,this.getButtonSrcFile(_18d,_18e));
},setButton:function(_18f,_190){
var f=this.getButtonSrcFile(_18f,_190);
var s=this.getButton();
var src=s.getAttribute("src");
if(src==null||(src.indexOf&&src.indexOf(f)==-1)){
s.setAttribute("src",this.getButtonSrc(_18f,_190));
}
},selectButton:function(){
this.setButton(this.hasChildren||(this.getChildCount()>0),this.getOpen());
},getOpen:function(){
var n=this.getNodeElement(this.elements.children);
return (n&&(n.show!==null?n.show:(n.style.display=="")));
},canOpen:function(){
return (this.getChildCount()>0);
},setOpen:function(_195){
_195=(this.canClose?_195:true);
var n=this.getNodeElement(this.elements.children);
var _197=(n&&(n.show!==null?n.show:(n.style.display=="")));
if(n&&_197!=_195){
n.show=_195;
this.updateOpen();
}
if(_195&&!this.childrenInited&&this.hasChildren){
this.tree.initChildren(this);
}
if(_195&&!this.canOpen()&&this.canClose){
this.setOpen(false);
}
if(_197!=_195){
this.selectButton();
}
},toggleNode:function(){
this.setOpen(!this.getOpen());
},setContent:function(_198){
this.getNodeElement(this.elements.content).innerHTML=_198;
},appendTo:function(_199,_19a){
this.parent=_199;
var p=(_199?_199.getNodeElement(this.elements.children):this.tree.treeDiv);
this.index=p.childNodes.length;
if(_19a&&_19a.domNode){
p.insertBefore(this.domNode,_19a.domNode);
}else{
p.appendChild(this.domNode);
}
if(this.parent){
this.parent.selectButton();
}
var n=this.tree.nodeFromDomNode(this.domNode.previousSibling);
if(n){
n.selectConnector();
n.updateChildGutters();
}
this.selectConnector();
this.updateNode();
},setSelected:function(_19d){
if(_19d===undefined){
_19d=true;
}
var c=this.tree.classTag+"-content";
var _19f=this.getNodeElement(this.elements.content);
if(_19f){
_19f.className=c+(_19d?" "+c+"-selected":"");
}
},getChildCount:function(){
var c=this.getNodeElement(this.elements.children);
return (c&&c.childNodes.length);
},getChildNode:function(_1a1){
var _1a2=this.getNodeElement(this.elements.children).childNodes;
if(turbo.isGoodIndex(_1a2,_1a1)){
return this.tree.nodeFromDomNode(_1a2[_1a1]);
}
},_deleteChildNodes:function(_1a3){
var _1a4=_1a3.getNodeElement(this.elements.children).childNodes;
for(var i=0,l=_1a4.length;i<l;i++){
var el=_1a4[i];
this._deleteChildNodes(this.tree.nodeFromDomNode(el));
delete this.tree.nodeList[el.id];
}
},removeChildren:function(){
this._deleteChildNodes(this);
this.domNode.replaceChild(document.createElement("div"),this.getNodeElement(this.elements.children));
this.childCount=0;
this.hasChildren=false;
this.setOpen(false);
this.selectButton();
},refreshChildren:function(){
if(this.getChildCount()<=0){
return;
}
this.removeChildren();
this.childrenInited=false;
this.tree.initChildren(this);
this.setOpen(true);
},canSelfInitChild:function(_1a8){
return (this.canSelfInit&&this.children&&this.children[_1a8]);
},childRemoved:function(){
this.childCount=Math.max(0,this.childCount-1);
this.hasChildren=(this.childCount>0);
this.setOpen(this.getOpen());
this.selectButton();
this.selectConnector();
},nextNodeRemoved:function(){
this.selectConnector();
this.selectButton();
this.updateChildGutters();
},prevNodeRemoved:function(){
this.selectConnector();
}});
dojo.widget.defineWidget("dojo.widget.html.TurboTree",dojo.widget.html.TurboWidget,function(){
this.imageRoot=dojo.uri.dojoUri(this.themeRoot+"default/images/");
this.nodeList=[];
},{templateString:"<div><div dojoattachpoint=\"treeDiv\" class=\"turbo-tree-scroller\"></div></div>",styleRoot:"TurboTree",classTag:"turbo-tree",treeDiv:null,treeImages:{none:"tree_none.gif",blank:"tree_blank.gif",gutterBar:"tree_bar.gif",connectorRoot:"tree_root.gif",connectorRootFirst:"tree_root_first.gif",connectorLast:"tree_last_leaf.gif",connectorLeaf:"tree_leaf.gif",buttonOpen:"tree_open.gif",buttonClosed:"tree_closed.gif"},hasRootConnectors:true,nodeId:0,nodes:"",selected:null,onInitNode:function(){
},onInitChildren:function(){
},onCanUnselect:function(_1a9){
},onCanSelect:function(_1aa){
},onSelect:function(_1ab){
},onUnselect:function(_1ac){
},onOpen:function(_1ad){
},onClose:function(_1ae){
},fillInTemplate:function(_1af,_1b0){
this.setTheme("");
dojo.event.connect(this.domNode,"onclick",this,"domClick");
dojo.event.connect(this.domNode,"ondblclick",this,"domDblClick");
if(dojo.render.html.ie){
this.domNode.onselectstart=function(){
return false;
};
}else{
dojo.html.disableSelection(this.domNode);
}
if(this.extraArgs["onnodeselected"]){
this.onNodeSelected=eval(this.extraArgs["onnodeselected"]);
}
if(dojo.lang.isString(_1af["treeImages"])){
this.treeImages=eval(_1af["treeImages"]);
}
if(dojo.lang.isString(_1af["nodes"])){
this.nodes=eval(_1af["nodes"]);
}
if(this.nodes){
this.buildNodes(this.nodes);
}
},styleChanged:function(){
this.setStyledClass(this.domNode,"");
},makeNodeId:function(){
return this.widgetId+":"+this.nodeId++;
},nodeFromDomNode:function(_1b1){
return (_1b1&&_1b1.id?this.nodeList[_1b1.id]:null);
},clear:function(){
this.nodeId=0;
this.nodeList=[];
this.treeDiv.innerHTML="";
},setRootCount:function(_1b2){
this.clear();
for(var i=0;i<_1b2;i++){
this.newNode(null);
}
},setRootNodeConnectors:function(_1b4){
if(!this.hasRootConnectors){
_1b4.hasConnectors=false;
_1b4.hasButton=false;
}
},newTreeNode:function(_1b5){
var n=new turbo.TreeNode(this);
this.nodeList[n.id]=n;
if(_1b5==null){
this.setRootNodeConnectors(n);
}
n.buildDomNode(_1b5);
return n;
},initNodeBySelf:function(_1b7){
_1b7.childCount=(_1b7.children?_1b7.children.length:0);
_1b7.hasChildren=(_1b7.childCount>0||_1b7.onInitChildren);
_1b7.setContent(_1b7.content?_1b7.content:(_1b7.name?_1b7.name:""));
_1b7.setOpen(_1b7.initOpen!==undefined?_1b7.initOpen:true);
},newNode:function(_1b8,_1b9){
if(!dojo.lang.isArray(_1b9)){
return this._newNode(_1b8,_1b9);
}else{
for(var i=0,l=_1b9.length;i<l;i++){
this._newNode(_1b8,_1b9[i]);
}
}
},_newNode:function(_1bc,_1bd){
var n=this.newTreeNode(_1bc);
n.appendTo(_1bc);
return this.initNode(n,_1bd);
},initNode:function(_1bf,_1c0){
if(_1c0){
_1bf.canSelfInit=true;
if(dojo.lang.isObject(_1c0)){
_1bf=turbo.swiss(_1c0,_1bf);
}else{
_1bf.name=_1c0;
}
}
if(!_1bf.canSelfInit){
this.onInitNode(_1bf);
}else{
if(_1bf.onInitNode){
_1bf.onInitNode();
}
}
if(_1bf.canSelfInit){
this.initNodeBySelf(_1bf);
}else{
_1bf.setOpen(_1bf.isRootNode());
}
_1bf.selectConnector();
return _1bf;
},addNodeBefore:function(_1c1,_1c2){
var p=(_1c1&&_1c1.parent?_1c1.parent:null);
var n=this.newTreeNode(p);
n.appendTo(p,_1c1);
this.initNode(n,_1c2);
if(!p){
_1c1.selectConnector();
}
return n;
},addNodeAfter:function(_1c5,_1c6){
var p=(_1c5&&_1c5.parent?_1c5.parent:null);
var n=this.newTreeNode(p);
var s=this.getNextSiblingNode(_1c5);
n.appendTo(p,(s&&s.parent==p?s:null));
this.initNode(n,_1c6);
return n;
},initChildren:function(_1ca){
if(!_1ca.canSelfInit){
this.onInitChildren(_1ca);
}else{
if(_1ca.onInitChildren){
_1ca.onInitChildren(_1ca);
}
}
var c=_1ca.childCount;
for(var i=0;i<c;i++){
this.newNode(_1ca,(_1ca.canSelfInitChild(i)?_1ca.children[i]:null));
}
if(_1ca.children){
_1ca.children=null;
}
_1ca.childrenInited=true;
_1ca.hasChildren=(c>0);
},selectNode:function(_1cd){
if(_1cd&&this.onCanSelect(_1cd)===false){
return false;
}
if(this.selected){
if(this.onCanUnselect(this.selected)===false){
return false;
}
this.onUnselect(this.selected);
this.selected.setSelected(false);
}
this.selected=_1cd;
if(this.selected){
this.selected.setSelected(true);
}
return true;
},eventSelectNode:function(_1ce){
if(!this.selectNode(_1ce)){
return;
}
if(this.onNodeSelected){
this.onNodeSelected(this.selected);
}else{
this.onSelect(this.selected);
}
},forEach:function(_1cf,_1d0){
var _1d1=[],n=null;
while(n=this.getNextNode(n)){
if(!_1cf(n)){
continue;
}
if(!_1d0){
return n;
}
_1d1.push(n);
}
return (_1d0?_1d1:null);
},getNodeByValue:function(_1d3,_1d4){
return this.getNodesByValue(_1d3,_1d4,true);
},getNodesByValue:function(_1d5,_1d6,_1d7){
return this.forEach(function(_1d8){
return (_1d8[_1d6]&&_1d8[_1d6]==_1d5);
},!Boolean(_1d7));
},isTreeNode:function(_1d9){
return _1d9&&_1d9.getAttribute&&_1d9.getAttribute("turboTreeNode");
},toggleNode:function(_1da){
_1da.toggleNode();
if(_1da.getOpen()){
this.onOpen(_1da);
}else{
this.onClose(_1da);
}
},nodeClick:function(_1db,_1dc){
if(!_1db){
return;
}
if(_1db.getButton()==_1dc.target){
this.toggleNode(_1db);
}
this.eventSelectNode(_1db);
},nodeDblClick:function(_1dd,_1de){
if(!_1dd){
return;
}
this.toggleNode(_1dd);
this.eventSelectNode(_1dd);
},domClick:function(_1df){
var n=_1df.target;
while(n&&!this.isTreeNode(n)){
n=n.parentNode;
}
this.nodeClick((n?this.nodeFromDomNode(n):null),_1df);
},domDblClick:function(_1e1){
var n=_1e1.target;
while(n&&!this.isTreeNode(n)){
n=n.parentNode;
}
this.nodeDblClick((n?this.nodeFromDomNode(n):null),_1e1);
},getRootNodeByIndex:function(_1e3){
var _1e4=this.treeDiv.childNodes;
if(turbo.isGoodIndex(_1e4,_1e3)){
return this.nodeFromDomNode(_1e4[_1e3]);
}
},getNodeByIndex:function(){
if(!(arguments.length>0)){
return null;
}
var node=this.getRootNodeByIndex(arguments[0]);
for(var i=1,l=arguments.length;i<l;i++){
node=node.getChildNode(arguments[i]);
}
return node;
},getPrevSiblingNode:function(_1e8){
return (_1e8.domNode.previousSibling?this.nodeFromDomNode(_1e8.domNode.previousSibling):null);
},getNextSiblingNode:function(_1e9){
return (_1e9.domNode.nextSibling?this.nodeFromDomNode(_1e9.domNode.nextSibling):null);
},getNextNode:function(_1ea){
if(!_1ea){
return this.getRootNodeByIndex(0);
}
if(_1ea.getChildCount()>0){
return _1ea.getChildNode(0);
}
if(!_1ea.isLastChildNode()){
return this.getNextSiblingNode(_1ea);
}
while(_1ea.parent&&_1ea.parent.isLastChildNode()){
_1ea=_1ea.parent;
}
return (_1ea.parent?this.getNextSiblingNode(_1ea.parent):null);
},removeNode:function(_1eb){
this.selected.setSelected(false);
this.selected=null;
var _1ec=_1eb.parent;
var _1ed=this.getPrevSiblingNode(_1eb);
var _1ee=this.getNextSiblingNode(_1eb);
_1eb.removeChildren();
delete this.nodeList[_1eb.id];
turbo.remove(_1eb.domNode);
if(_1ec){
_1ec.childRemoved();
}
if(_1ed){
_1ed.nextNodeRemoved();
}
if(_1ee){
_1ee.prevNodeRemoved();
}
},buildNodes:function(_1ef){
this.newNode(null,_1ef);
}});
dojo.provide("turbo.widgets.TurboRepeater");
dojo.provide("turbo.widgets.HtmlTurboRepeater");
dojo.require("turbo.widgets.TurboWidget");
dojo.widget.defineWidget("dojo.widget.html.TurboRepeater",dojo.widget.html.TurboWidget,{containerNode:null,classTag:"turbo_repeater",data:{},openMacro:"{%",closeMacro:"}",count:100,clear:function(){
dojo.event.browser.clean(this.domNode);
this.domNode.innerHTML="";
},fillInTemplate:function(_1f0,_1f1){
this.domNode.style.display="";
this.nodes=this.domNode.cloneNode(true);
this.clear();
},getDatum:function(inId){
try{
return this.data[inId];
}
catch(e){
return "failed to get datum";
}
},interpolate:function(_1f3){
for(var i in this.data){
_1f3=_1f3.replace(RegExp(this.openMacro+i+this.closeMacro,"gi"),this.data[i]);
}
return _1f3;
},iterate:function(_1f5,_1f6){
return false;
},afterBuild:function(){
return false;
},build:function(){
this.clear();
for(var i=0;i<this.count;i++){
this.index=i;
if(this.iterate(this,this.index)===false){
break;
}
var iter=this.nodes.cloneNode(true);
iter.innerHTML=this.interpolate(iter.innerHTML);
turbo.parseWidgets(iter);
this.domNode.appendChild(iter);
}
if(this.afterBuild){
this.afterBuild();
}
},xbuild:function(){
this.clear();
var self=this;
var _1fa=function(){
if(self.index>=self.count||self.iterate(self,self.index)===false){
return;
}
var iter=self.nodes.cloneNode(true);
iter.innerHTML=self.interpolate(iter.innerHTML);
self.domNode.appendChild(iter);
self.index++;
window.setTimeout(_1fa,0);
};
this.index=0;
_1fa();
}},"html");
dojo.provide("turbo.widgets.TurboFloater");
dojo.provide("turbo.widgets.HtmlTurboFloater");
dojo.require("turbo.lib.scrim");
dojo.require("turbo.lib.drag");
dojo.require("turbo.widgets.TurboWidget");
dojo.declare("turbo.stack",null,function(_1fc){
this.items=(_1fc?_1fc:[]);
},{add:function(_1fd){
if(_1fd!=this.getTop()){
this.items.push(_1fd);
}
},remove:function(_1fe){
this.removeIndex(this.getIndex(_1fe));
},removeIndex:function(_1ff){
if(turbo.isGoodIndex(this.items,_1ff)){
this.items.splice(_1ff,1);
}
},get:function(_200){
if(turbo.isGoodIndex(this.items,_200)){
return this.items[_200];
}
},getTop:function(){
return this.items[this.count()-1];
},moveToTop:function(_201){
if(_201==this.getTop()){
return;
}
var i=this.getIndex(_201);
if(i<0){
return;
}
this.removeIndex(i);
this.add(_201);
},count:function(){
return this.items.length;
},getIndex:function(_203){
for(var i=0,l=this.count();i<l;i++){
if(_203==this.get(i)){
return i;
}
}
return -1;
},map:function(_206,_207,_208){
_206=(turbo.isGoodIndex(this.items,_206)?_206:this.count()-1);
_207=(turbo.isGoodIndex(this.items,_207)?_207:0);
var lt=(_206<=_207);
for(var i=_206,o;(lt?i<=_207:i>=_207);(lt?i++:i--)){
o=this.get(i);
if(o&&o[_208]){
o[_208]();
}
}
}});
turbo.floaters=new turbo.stack();
turbo.getNodeRect=function(_20c){
var _20d=!turbo.isShowing(_20c);
if(_20d){
turbo.show(_20c);
}
var nt=turbo.getAbsoluteY(_20c,true);
var nl=turbo.getAbsoluteX(_20c,true);
var box=dojo.html.getBorderBox(_20c);
var _211={t:nt,r:nl+box.width,b:nt+box.height,l:nl};
if(_20d){
turbo.hide(_20c);
}
return _211;
};
turbo.measureNode=function(_212){
var _213=document.createElement("div");
with(_213.style){
top="0px";
left="0px";
position="absolute";
visibility="hidden";
}
turbo.append(turbo.$(_212),_213);
turbo.append(_213);
var _214=dojo.html.getContentBox(_213);
turbo.remove(_213);
turbo.remove(_212);
return _214;
};
turbo.measureHtml=function(_215){
var n=document.createElement("div");
n.innerHTML=_215;
return turbo.measureNode(n);
};
turbo.floater={};
dojo.declare("turbo.floater.drag",null,function(_217,_218,_219,_21a,_21b){
this.domNode=_217;
turbo.tie(this,"_onDrag","_onEndDrag","_onStartDrag");
if(_218){
this.onDrag=_218;
}
if(_219){
this.onStartDrag=_219;
}
if(_21a){
this.onEndDrag=_21a;
}
if(_21b){
this.snap=_21b;
}
this.connectNode();
},{snap:null,onStartDrag:function(_21c){
},onDrag:function(_21d){
},onEndDrag:function(){
},connectNode:function(){
dojo.event.kwConnect({srcObj:this.domNode,srcFunc:"onmousedown",targetObj:this,targetFunc:"_beginDrag",once:true});
},_beginDrag:function(_21e){
turbo.drag.start(this.domNode,this._onDrag,this._onEndDrag,_21e,this._onStartDrag);
},setDragDelta:function(_21f){
var p=dojo.html.getAbsolutePosition(this.domNode,true);
this.dragDelta={left:_21f.pageX-p.x,top:_21f.pageY-p.y};
},_onStartDrag:function(_221){
this.domNode.style.cursor="move";
this.setDragDelta(_221);
this.parentPosition=dojo.html.getAbsolutePosition(this.domNode.parentNode,true);
dojo.html.disableSelection(this.domNode);
this.processEvent(_221);
this.onStartDrag(this.dragEvent);
this.lastDragEvent=this.dragEvent;
},isOkDrag:function(){
return (this.dragEvent&&(!this.lastDragEvent||this.lastDragEvent.domNodeX!=this.dragEvent.domNodeX||this.lastDragEvent.domNodeY!=this.dragEvent.domNodeY));
},setSnappedDrag:function(){
if(!this.lastDragEvent||!this.dragEvent){
return;
}
var x=Math.round(this.dragEvent.domNodeX/this.snap.x)*this.snap.x;
var y=Math.round(this.dragEvent.domNodeY/this.snap.y)*this.snap.y;
this.dragEvent.domNodeX=x;
this.dragEvent.domNodeY=y;
},processEvent:function(_224){
this.dragEvent=_224;
this.dragEvent.dragX=this.dragEvent.pageX-this.parentPosition.x;
this.dragEvent.dragY=this.dragEvent.pageY-this.parentPosition.y;
this.dragEvent.domNodeX=this.dragEvent.dragX-this.dragDelta.left;
this.dragEvent.domNodeY=this.dragEvent.dragY-this.dragDelta.top;
if(this.snap){
this.setSnappedDrag();
}
},_onDrag:function(_225){
this.processEvent(_225);
this.onDrag(this.dragEvent);
this.lastDragEvent=this.dragEvent;
},_onEndDrag:function(){
dojo.html.enableSelection(this.domNode);
this.domNode.style.cursor="default";
this.lastDragEvent=null;
this.dragEvent=null;
this.onEndDrag();
}});
dojo.widget.defineWidget("dojo.widget.html.TurboFloater",dojo.widget.html.TurboWidget,function(){
this.stack=turbo.floaters;
this.windowBounds={w:0,h:0};
this._dimensions={w:0,h:0};
this._minDimensions={w:0,h:0};
this._sizing={};
this.snap=null;
},{templateString:"<div></div>",classTag:"turbo-floater",windowMargin:8,showTimeoutMs:5000,_showing:false,applyScrimToParent:false,bgOpacity:0,bgColor:"",useScrim:true,autoSize:true,sizeable:"",dragable:"",sizingNubWidth:4,sizingDelta:4,baseZ:11,left:0,top:0,height:0,width:0,onShow:turbo.nop,onHide:turbo.nop,onBeforeShow:turbo.nop,onBeforeHide:turbo.nop,onStartDrag:turbo.nop,onDrag:turbo.nop,onEndDrag:turbo.nop,fillInTemplate:function(_226,_227){
this.installChildren(_227);
dojo.event.topic.subscribe("turboresize",this,"resize");
dojo.event.browser.addListener(this.domNode,"onmousedown",turbo.bind(this,this.doMouseDown));
if(this.sizeable){
dojo.event.browser.addListener(this.domNode,"onmousemove",turbo.bind(this,this.doMouseMove));
}
},styleChanged:function(){
this.setStyledClass(this.domNode,"");
this.domNode.className=this.domNode.className+(this.className?" "+this.className:"");
},postCreate:function(){
this.setDimensions(this.width,this.height);
this.setMinDimensions(this.minWidth,this.minHeight);
this.initNodes();
if(this.dragable||this.sizeable){
this.initDragSize();
}
},initDragSize:function(){
turbo.defer(this,this._initDragSize,0);
},_initDragSize:function(){
this.dragger=new turbo.floater.drag(this.domNode,turbo.bind(this,this.doDrag),turbo.bind(this,this.doStartDrag),turbo.bind(this,this.doEndDrag),this.snap);
},processEvent:function(_228){
if(_228.dragX&&_228.dragY){
return;
}
var p=dojo.html.getAbsolutePosition(this.domNode.parentNode,true);
_228.dragX=_228.pageX-p.x;
_228.dragY=_228.pageY-p.y;
},overTopResizeArea:function(_22a){
return Math.abs(this.top-_22a.dragY)<this.sizingNubWidth;
},overBottomResizeArea:function(_22b){
return Math.abs(this.top+this.getHeight()-_22b.dragY)<this.sizingNubWidth;
},overLeftResizeArea:function(_22c){
return Math.abs(this.left-_22c.dragX)<this.sizingNubWidth;
},overRightResizeArea:function(_22d){
return Math.abs(this.left+this.getWidth()-_22d.dragX)<this.sizingNubWidth;
},charInString:function(_22e,_22f){
return (_22e.indexOf(_22f)!=-1);
},canSizeRight:function(){
return this.charInString(this.sizeable,"r");
},canSizeLeft:function(){
return this.charInString(this.sizeable,"l");
},canSizeTop:function(){
return this.charInString(this.sizeable,"t");
},canSizeBottom:function(){
return this.charInString(this.sizeable,"b");
},setSizing:function(_230){
this._sizing.r=this.overRightResizeArea(_230)&&this.canSizeRight();
this._sizing.l=this.overLeftResizeArea(_230)&&this.canSizeLeft();
this._sizing.t=this.overTopResizeArea(_230)&&this.canSizeTop();
this._sizing.b=this.overBottomResizeArea(_230)&&this.canSizeBottom();
},dragSizeRight:function(_231){
var w=_231.dragX-this.left+this.sizingDelta;
w=Math.min(w,this.windowBounds.w-this.left);
this.setDimensions(w,null);
},dragSizeLeft:function(_233){
var l=Math.max(this.snapX(_233.dragX-this.sizingDelta),0);
var w=this.getWidth()+this.left-l;
this.setDimensions(w,null);
this.setPosition(l,null);
},dragSizeTop:function(_236){
var t=Math.max(this.snapY(_236.dragY-this.sizingDelta),0);
var h=this.getHeight()+this.top-t;
this.setDimensions(null,h);
this.setPosition(null,t);
},dragSizeBottom:function(_239){
var h=_239.dragY-this.top+this.sizingDelta;
h=Math.min(h,this.windowBounds.h-this.top);
this.setDimensions(null,h);
},doMouseDown:function(_23b){
this.setZIndexes();
this.stack.moveToTop(this);
},doMouseMove:function(_23c){
this.processEvent(_23c);
if(this.sizeable&&!turbo.drag.dragging){
this.setSizing(_23c);
}
this.setCursor(_23c);
},setCursor:function(_23d){
var c="default";
if(this.isSizing()){
with(this._sizing){
if((t||b)&&!(l||r)){
c="n-resize";
}else{
if((l||r)&&!(t||b)){
c="e-resize";
}else{
if(t&&l){
c="nw-resize";
}else{
if(t&&r){
c="ne-resize";
}else{
if(b&&l){
c="sw-resize";
}else{
if(b&&r){
c="se-resize";
}
}
}
}
}
}
}
}
this.domNode.style.cursor=c;
},doDragSize:function(_23f){
if(!this.sizeable){
return false;
}
if(this._sizing.t){
this.dragSizeTop(_23f);
}
if(this._sizing.b){
this.dragSizeBottom(_23f);
}
if(this._sizing.l){
this.dragSizeLeft(_23f);
}
if(this._sizing.r){
this.dragSizeRight(_23f);
}
if(this.isSizing()){
this.setCursor(_23f);
this.renderBounds();
return true;
}
},isSizing:function(){
for(var i in this._sizing){
if(this._sizing[i]){
return true;
}
}
},doDrag:function(_241){
if(!this.doDragSize(_241)&&this.dragable){
this.setPosition(_241.domNodeX,_241.domNodeY,true);
this.onDrag(_241);
}
},doStartDrag:function(_242){
if(!this.dragable&&!this.isSizing()){
return;
}
if(this.dragable){
this.onStartDrag(_242);
}
},doEndDrag:function(){
if(this.isSizing()){
this._sizing={};
this.align();
}
this.onEndDrag();
},initNodes:function(){
this.domNode.isFloater=true;
this._hide();
this.styleChanged();
},detachNode:function(_243){
turbo.remove(_243);
},attachNode:function(_244){
var p=this.getParentNode();
try{
p.appendChild(_244);
}
catch(e){
turbo.debug(this.widgetId+" failed to append node to ");
turbo.debugObject(p);
}
},setZIndexes:function(){
var z=(this.domNode.style.zIndex&&this.domNode.style.zIndex!="auto"?this.domNode.style.zIndex:this.baseZ);
var _247=this.stack.getTop();
if(_247&&_247!=this){
z=2+(parseInt(dojo.html.getStyle(_247.domNode,"z-index"))||z);
}
this.domNode.style.zIndex=z;
this.setScrimZ();
},setScrimZ:function(){
if(this.scrim){
this.scrim.style.zIndex=(1||parseInt(dojo.html.getStyle(this.domNode,"z-index")))-1;
}
},getParentNode:function(){
return document.body;
},getRect:function(){
if(!this._showing){
this.attachNode(this.domNode);
turbo.show(this.domNode);
}
var box=dojo.html.getBorderBox(this.domNode);
if(!this._showing){
this.hideDomNode();
}
return {t:this.top,r:this.left+box.width,b:this.top+box.height,l:this.left};
},snapX:function(inX){
return (this.snap&&this.snap.x?inX-inX%this.snap.x:inX);
},snapY:function(inY){
return (this.snap&&this.snap.y?inY-inY%this.snap.y:inY);
},setPosition:function(_24b,_24c,_24d){
if(_24b||_24b===0){
this.left=this.snapX(_24b);
}
if(_24c||_24c===0){
this.top=this.snapY(_24c);
}
if(_24d){
this.updatePosition();
}
},getCssDimensions:function(){
var c=dojo.html.getContentBox(this.domNode);
return (!c.height||!c.width?false:{w:c.width,h:c.height});
},setCssDimensions:function(){
var cssD=this.getCssDimensions();
if(!cssD){
return false;
}
var w=this.getWidth();
var h=this.getHeight();
this.setDimensions((w?w:cssD.w),(h?h:cssD.h));
return true;
},hasDimensions:function(){
return (this.getWidth()>0&&this.getHeight()>0);
},getScrim:function(){
if(!this.useScrim){
return null;
}
var _252={backgroundColor:this.bgColor,opacity:this.bgOpacity,zIndex:parseInt(dojo.html.getStyle(this.domNode,"z-index"))-1};
var _253=(this.applyScrimToParent?null:{t:this.top,l:this.left,w:this.getWidth(),h:this.getHeight()});
return turbo.scrim.get(this.getParentNode(),this.widgetId+"_scrim",_252,_253);
},setDimensions:function(_254,_255){
if(_254>0){
this._dimensions.w=this.snapX(Math.max(_254,this._minDimensions.w));
}
if(_255>0){
this._dimensions.h=this.snapY(Math.max(_255,this._minDimensions.h));
}
},setMinDimensions:function(_256,_257){
if(_256>0){
this._minDimensions.w=this.snapX(_256);
}
if(_257>0){
this._minDimensions.h=this.snapY(_257);
}
},getWidth:function(){
return this._dimensions.w;
},getHeight:function(){
return this._dimensions.h;
},applyPrePositioning:function(){
turbo.setStyleLeftPx(this.domNode,0);
turbo.setStyleTopPx(this.domNode,0);
if(this.getWidth()){
this.renderWidth();
}
if(this.getHeight()){
this.renderHeight();
}
},toggleShow:function(){
if(this.isShowing()){
this.hide();
}else{
this.show();
}
},doOnShow:function(){
this.onShow.apply(this,arguments);
},isShowing:function(){
return (turbo.isShowing(this.domNode)||this._showing);
},show:function(inX,inY){
this.ensureWindowBounds();
if(this.isShowing()||this._initShow){
if(inX||inY){
this.setPosition(inX,inY,true);
}
this.doOnShow.apply(this,arguments);
return;
}
this._initShow=true;
this.setPosition(inX,inY);
this.onBeforeShow.apply(this,arguments);
this.attachNode(this.domNode);
this.timeShown=turbo.time();
var cb=turbo.bindArgs(this,this.doOnShow,arguments);
if(this.autoSize){
this.resetExtent();
this.applyPrePositioning();
turbo.defer(this,this.attemptShow,cb,10);
}else{
this.attemptShow(cb);
}
},showTimedOut:function(){
var _25b=(this.timeShown+this.showTimeoutMs<turbo.time());
if(_25b){
turbo.debug("Timed out attempting to show.");
}
return _25b;
},attemptShow:function(_25c){
if(!this._initShow){
this._hide();
return;
}
turbo.setVisibility(this.domNode,false);
if(!turbo.isShowing(this.domNode)){
turbo.show(this.domNode);
}
if(this.autoSize&&!this.setCssDimensions()){
turbo.defer(turbo.bindArgs(this,this.attemptShow,_25c),10);
return;
}
this._showing=true;
if(this.useScrim){
this.scrim=this.getScrim();
}
this.doRenderBounds(_25c);
},doRenderBounds:function(_25d){
if(!this._showing){
return;
}
this.renderBounds();
this.finishShow(_25d);
},putOnStack:function(){
if(this.stack.getIndex(this)<0){
this.stack.add(this);
}else{
this.stack.moveToTop(this);
}
},finishShow:function(_25e){
this.setZIndexes();
this.putOnStack();
var self=this;
var cb=function(){
turbo.setVisibility(self.domNode,true);
if(_25e){
_25e();
}
};
this.align(cb);
},delayedHide:function(){
turbo.defer(this,this.hide,10);
},hide:function(){
this.doHide();
},hideStack:function(){
if(this.stack){
this.stack.map(this.stack.count()-1,0,"doHide");
}
},doHide:function(){
if(this.onBeforeHide){
this.onBeforeHide();
}
this._hide();
this.stack.remove(this);
if(this.onHide){
turbo.defer(this,"onHide",10);
}
},_hide:function(){
this.hideDomNode();
this.hideScrim();
this._initShow=false;
this._showing=false;
},hideDomNode:function(){
turbo.hide(this.domNode);
},hideScrim:function(){
if(!this.scrim){
return;
}
turbo.hide(this.scrim);
turbo.scrim.release(this.scrim);
},hasContent:function(){
return Boolean(this.domNode.innerHTML);
},setContent:function(_261,_262){
turbo.clean(this.domNode);
this.domNode.innerHTML=_261;
if(_262){
turbo.parseWidgets(this.domNode);
}
if(this.autoSize){
this.resetExtent();
}
if(this.isShowing()){
this.applyPrePositioning();
this.attemptShow();
}
},resetHeight:function(){
this._dimensions.h=0;
this.domNode.style.height="";
},resetWidth:function(){
this._dimensions.w=0;
this.domNode.style.width="";
},resetExtent:function(){
this.resetWidth();
this.resetHeight();
},getWindowBounds:function(){
var p=this.getParentNode();
var b=(p==document.body?dojo.html.getViewport():dojo.html.getMarginBox(p));
return {w:b.w||b.width,h:b.h||b.height};
},resize:function(){
if(this.isShowing()){
this.doResize();
}
},doResize:function(){
this.windowBounds=this.getWindowBounds();
},ensureWindowBounds:function(){
if(!this.windowBounds.w||!this.windowBounds.h){
this.windowBounds=this.getWindowBounds();
}
},boundPosition:function(_265,_266){
_265=(_265?_265:this.left);
_266=(_266?_266:this.top);
this.ensureWindowBounds();
_265=Math.max(0,Math.min(_265,this.windowBounds.w-this.getWidth()-this.windowMargin));
_266=Math.max(0,Math.min(_266,this.windowBounds.h-this.getHeight()-this.windowMargin));
this.setPosition(_265,_266);
if(this.top+this.getHeight()>this.windowBounds.h){
this.setDimensions(null,this.windowBounds.h);
}
if(this.left+this.getWidth()>this.windowBounds.w){
this.setDimensions(this.windowBounds.w,null);
}
},renderBounds:function(inX,inY,inW,inH){
this.boundPosition(inX,inY);
if(inW&&inH){
this.setDimensions(inW,inH);
}
if(this.hasDimensions()){
this.renderLeft();
this.renderTop();
this.renderWidth();
this.renderHeight();
this.setScrimBounds();
}else{
this.updatePosition();
}
},renderLeft:function(){
if(this.left>=0){
turbo.setStyleLeftPx(this.domNode,this.left);
}
},renderTop:function(){
if(this.top>=0){
turbo.setStyleTopPx(this.domNode,this.top);
}
},renderWidth:function(){
turbo.setStyleWidthPx(this.domNode,this.getWidth());
},renderHeight:function(){
turbo.setStyleHeightPx(this.domNode,this.getHeight());
},setScrimBounds:function(){
if(!this.scrim){
return;
}
if(this.applyScrimToParent){
turbo.scrim.size(this.scrim);
}else{
turbo.setBounds(this.scrim,this.left,this.top,this.getWidth(),this.getHeight());
}
},updatePosition:function(){
this.boundPosition();
this.renderLeft();
this.renderTop();
this.updateScrimPosition();
},updateScrimPosition:function(){
if(!this.scrim){
return;
}
if(!this.applyScrimToParent){
if(this.left>=0){
turbo.setStyleLeftPx(this.scrim,this.left);
}
if(this.top>=0){
turbo.setStyleTopPx(this.scrim,this.top);
}
}
},align:function(_26b){
turbo.defer(turbo.bindArgs(this,"_align",_26b),10);
},_align:function(_26c){
turbo.aligner.alignFrom(this.domNode);
if(_26c){
turbo.defer(_26c,10);
}
}});
dojo.provide("turbo.widgets.TurboModal");
dojo.provide("turbo.widgets.HtmlTurboModal");
dojo.require("turbo.widgets.TurboFloater");
turbo.modals=new turbo.stack();
dojo.widget.defineWidget("dojo.widget.html.TurboModal",dojo.widget.html.TurboFloater,function(){
this.stack=turbo.modals;
},{templateString:"<div dojoAttachPoint=\"domNode\" hidefocus=\"hidefocus\"><div tabIndex=\"0\" hidefocus=\"hidefocus\" dojoAttachPoint=\"contentNode\" dojoOnFocus=\"interceptTab\" turboalign=\"client\"></div><span dojoAttachPoint=\"tabOut\" dojoOnFocus=\"interceptTab\" tabindex=\"0\"></span></div>",tabIntercepted:false,classTag:"turbo-modal",focusNode:"",allowFocus:true,bgOpacity:0.8,focusDelay:500,applyScrimToParent:true,bgColor:"white",fillInTemplate:function(_26d,_26e){
this.bindArgEvents(_26d);
this.installChildren(_26e,this.contentNode);
dojo.event.topic.subscribe("turboresize",this,"resize");
},styleChanged:function(){
this.setStyledClass(this.domNode,"");
this.setStyledClass(this.contentNode,"-content");
this.domNode.className=this.domNode.className+(this.className?" "+this.className:"");
},initNodes:function(){
this.domNode.isModal=true;
this._hide();
this.styleChanged();
},getParentNode:function(){
var t=this.stack.getTop();
var _270=(t&&t.domNode?t.domNode:document.body);
return _270;
},getScrim:function(){
var _271={backgroundColor:this.bgColor,opacity:this.bgOpacity,zIndex:parseInt(dojo.html.getStyle(this.domNode,"z-index"))-1};
return turbo.scrim.get(this.getParentNode(),this.widgetId+"_scrim",_271);
},getCssDimensions:function(){
var c=dojo.html.getContentBox(this.contentNode);
return (!c.height||!c.width?false:{w:c.width,h:c.height});
},hide:function(){
if(this!=this.stack.getTop()){
this.hideFrom(this.stack.getIndex(this));
}else{
this.doHide();
}
},hideAllModals:function(){
this.hideStack();
},hideFrom:function(_273){
this.stack.map(this.stack.count()-1,this.stack.getIndex(_273),"doHide");
},doResize:function(){
this.inherited("doResize",arguments);
if(this.scrim){
turbo.scrim.size(this.scrim);
}
this.updatePosition();
},boundPosition:function(){
if(this.drag){
this.inherited("boundPosition",arguments);
}else{
var _274=turbo.getInnerSize(this.domNode.parentNode);
var _275=dojo.html.getPadding(this.domNode.parentNode);
var _276=dojo.html.getBorderBox(this.domNode);
this.left=(this.getWidth()?Math.round((_274.w-_275.width-_276.width)/2):0);
this.top=(this.getHeight()?Math.round((_274.h-_275.height-_276.height)/2):0);
}
},renderBounds:function(){
turbo.setStyleWidthPx(this.domNode,this.getWidth());
turbo.setStyleHeightPx(this.domNode,this.getHeight());
turbo.scrim.size(this.scrim);
this.updatePosition();
},hasContent:function(){
return Boolean(this.contentNode.innerHTML);
},show:function(){
this.inherited("show",arguments);
turbo.setVisibility(this.domNode,this.hasContent());
this.doFocus();
},resetHeight:function(){
this._dimensions.h=0;
this.domNode.style.height="";
this.contentNode.style.height="";
},resetWidth:function(){
this._dimensions.w=0;
this.domNode.style.width="";
this.contentNode.style.width="";
},setContent:function(_277,_278){
turbo.clean(this.domNode);
this.contentNode.innerHTML=_277;
if(_278){
turbo.parseWidgets(this.domNode);
}
this.resetExtent();
if(this.isShowing()){
this.applyPrePositioning();
this.attemptShow();
}
},doFocus:function(){
if(!this.allowFocus){
return;
}
var f=turbo.$(this.focusNode);
if(f){
if((f.style.display!="none"&&f.style.visibility!="hidden")){
turbo.defer(function(){
f.focus();
},this.focusDelay);
}
}else{
turbo.defer(turbo.bindArgs(this,"focusFirstLast","first",null),this.focusDelay);
}
},focusFirstLast:function(_27a,_27b){
if(!this.allowFocus){
return;
}
var _27c=(_27a=="first");
var n=(_27c?this.getNextElement(this.contentNode,_27b):this.getPrevElement(this.contentNode,_27b));
if(!n){
return;
}
this.focusOk=false;
dojo.event.kwConnect({srcObj:n,srcFunc:"onfocus",targetObj:this,targetFunc:"focusCheck",once:true});
try{
if((n==this.contentNode&&this.hasContent())||n!=this.contentNode){
n.focus();
}
}
catch(e){
turbo.debug("Failed to focus node.");
}
turbo.defer(turbo.bindArgs(this,this.processFocusCheck,_27a,n),0);
},processFocusCheck:function(_27e,_27f){
var dc={srcObj:_27f,srcFunc:"onfocus",targetObj:this,targetFunc:"focusCheck",once:true};
dojo.event.kwDisconnect(dc);
if(!this.focusOk){
this.focusFirstLast(_27e,_27f);
}
},interceptTab:function(e){
if(!this.allowFocus){
return;
}
if(this.skipIntercept){
this.skipIntercept=false;
return;
}
if(e.target!=this.contentNode&&e.target!=this.tabOut){
return;
}
var f=(e.target==this.tabOut?"first":"last");
this.focusFirstLast(f);
},focusCheck:function(){
this.focusOk=true;
},isOkFocusElement:function(_283){
return (_283&&turbo.isShowing(_283)&&!_283.isModal);
},getNextElement:function(_284,_285){
if(!_285){
var c=dojo.dom.getFirstChildElement(_284);
return (c?c:false);
}
var c=dojo.dom.getFirstChildElement(_285);
var n=(c?c:dojo.dom.nextElement(_285));
if(this.isOkFocusElement(n)){
return n;
}
var n=null;
while(_285.parentNode&&_285.parentNode!=_284){
_285=_285.parentNode;
var n=dojo.dom.nextElement(_285);
if(this.isOkFocusElement(n)){
break;
}
}
return (n?n:false);
},getPrevElement:function(_288,_289){
if(!_289){
var c=dojo.dom.getLastChildElement(_288);
return (c?c:false);
}
var c=dojo.dom.getLastChildElement(_289);
var n=(c?c:dojo.dom.prevElement(_289));
if(this.isOkFocusElement(n)){
return n;
}
var n=null;
while(_289.parentNode&&_289.parentNode!=_288){
_289=_289.parentNode;
var n=dojo.dom.prevElement(_289);
if(this.isOkFocusElement(n)){
break;
}
}
return (n?n:false);
}});
dojo.provide("turbo.widgets.TurboTooltip");
dojo.provide("turbo.widgets.HtmlTurboTooltip");
dojo.require("turbo.widgets.TurboFloater");
dojo.widget.defineWidget("dojo.widget.html.TurboTooltip",dojo.widget.html.TurboFloater,function(){
this.boundedNodes=[];
this.tipPosition={x:0,y:0};
this.tipTarget=null;
},{tipDelay:300,tipOffsetLeft:12,tipOffsetTop:12,boundedNodes:null,parseWidgets:false,fillInTemplate:function(_28c,_28d){
this.inherited("fillInTemplate",arguments);
this.styleRoot="TurboFloater";
dojo.event.connect(this.domNode,"onmouseout",this,"tipOut");
},setTipPosition:function(_28e){
var n=(dojo.lang.inArray(this.boundedNodes,this.tipTarget));
var x=this.tipPosition.x+(n?0:this.tipOffsetLeft);
var y=this.tipPosition.y+(n?0:this.tipOffsetTop);
this.setPosition(x,y);
if(dojo.lang.inArray(this.boundedNodes,_28e.target)){
this.pushOutsideNode(_28e.target);
}
this.boundPosition();
},canShow:function(){
return true;
},show:function(_292){
this.hideTip();
_292.tooltipNode=this.currentTarget;
if(!this.canShow(_292)){
return false;
}
this.setTipPosition(_292);
this.inherited("show",[null,null,_292]);
},onBeforeShow:function(inX,inY,_295){
var c=this.onGetContent(_295);
if(c){
this.setContent(c,this.parseWidgets);
}
},pushOutsideNode:function(_297){
var _298=false;
var _299=turbo.getNodeRect(_297);
var _29a=this.getRect();
var _29b={w:_29a.r-_29a.l,h:_29a.b-_29a.t};
var _29c={l:_299.l-_29b.w-this.tipOffsetLeft,r:_299.r+this.tipOffsetLeft,t:_299.t-_29b.h-this.tipOffsetTop,b:_299.b+this.tipOffsetLeft};
if(this.isBetweenNums(_29a.l,_299.l,_299.r)||this.isBetweenNums(_29a.r,_299.l,_299.r)){
_298=true;
var _29d=this.fitsBetween(_29c.l,_29c.l+_29b.w,0,_299.l);
var _29e=this.fitsBetween(_29c.r,_29c.r+_29b.w,_299.r,this.windowBounds.w);
var _29f=_29a.l<_299.l+((_299.r-_299.l)/2);
if(_29d&&_29f||!_29e){
this.setPosition(_29c.l,this.top+this.tipOffsetTop);
}else{
if(_29e){
this.setPosition(_29c.r,this.top+this.tipOffsetTop);
}else{
_298=false;
}
}
}
if(!_298&&(this.isBetweenNums(_29a.t,_299.t,_299.b)||this.isBetweenNums(_29a.b,_299.t,_299.b))){
_298=true;
var _2a0=this.fitsBetween(_29c.t,_29c.t+_29b.h,0,_299.t);
var _2a1=this.fitsBetween(_29c.b,_29c.b+_29b.h,_299.b,this.windowBounds.h);
var _2a2=_29a.t<_299.t+((_299.b-_299.t)/2);
if(_2a0&&_2a2||!_2a1){
this.setPosition(this.left+this.tipOffsetLeft,_29c.t);
}else{
if(_2a1){
this.setPosition(this.left+this.tipOffsetLeft,_29c.b);
}else{
_298=false;
}
}
}
return _298;
},fitsBetween:function(inSx,inSy,inBx,inBy){
return (inSx>inBx&&inSy<inBy);
},isBetweenNums:function(inA,inX,inY){
return (inA>inX&&inA<inY);
},_toolTipOver:function(_2aa){
this.currentTarget=_2aa.currentTarget;
if(!this.ttPending){
this.updateTipPosition(_2aa);
this.ttPending=turbo.defer(this,"show",_2aa,this.tipDelay);
}
turbo.killEvent(_2aa);
},_toolTipOut:function(_2ab){
if(!dojo.dom.isDescendantOf(_2ab.relatedTarget,this.domNode)){
this.hideTip();
}
},_toolTipMove:function(_2ac){
if(this.ttPending&&!this.isShowing()){
this.updateTipPosition(_2ac);
}
},hideTip:function(){
window.clearTimeout(this.ttPending);
delete this.ttPending;
this.positionEvent=null;
if(this.isShowing()){
this.hide();
}
},connectOnce:function(_2ad,_2ae,_2af,_2b0){
dojo.event[_2b0?"kwDisconnect":"kwConnect"]({srcObj:_2ad,srcFunc:_2ae,targetObj:this,targetFunc:_2af,once:true});
},initToolTip:function(){
if(arguments.length==0){
return;
}
if(arguments.length<2){
this.toolTipNode(arguments[0]);
}else{
var _2b1=arguments[0];
var _2b2=arguments[1];
var _2b3=arguments[2];
var _2b4=arguments[3];
this.connectToolTip(_2b1,_2b2,_2b3,_2b4);
}
},initToolTipNode:function(_2b5,_2b6){
_2b5=turbo.$(_2b5);
if(_2b6&&!dojo.lang.inArray(this.boundedNodes,_2b5)){
this.boundedNodes.push(_2b5);
}
this.connectToolTip(_2b5,"onmouseover","onmousemove","onmouseout");
},connectToolTip:function(_2b7,_2b8,_2b9,_2ba){
if(_2b8){
this.connectOver(_2b7,_2b8);
}
if(_2b9){
this.connectMove(_2b7,_2b9);
}
if(_2ba){
this.connectOut(_2b7,_2ba);
}
},connectOver:function(_2bb,_2bc){
this.connectOnce(_2bb,_2bc,"_toolTipOver");
},connectMove:function(_2bd,_2be){
this.connectOnce(_2bd,_2be,"_toolTipMove");
},connectOut:function(_2bf,_2c0){
this.connectOnce(_2bf,_2c0,"_toolTipOut");
},updateTipPosition:function(_2c1){
this.tipPosition={x:_2c1.pageX,y:_2c1.pageY};
this.tipTarget=_2c1.target;
},tipOut:function(_2c2){
if(!dojo.dom.isDescendantOf(_2c2.relatedTarget,this.domNode)){
this.hideTip();
}
},onGetContent:turbo.nop});
dojo.provide("turbo.widgets.TurboDropButton");
dojo.provide("turbo.widgets.HtmlTurboDropButton");
dojo.require("turbo.widgets.TurboButton");
dojo.require("turbo.widgets.TurboFloater");
turbo.widgets.TurboDropButton={dropdown:"",toggle:"true",dropdownEvent:"onclick",postCreate:function(){
if(this.dropdown){
this.initDropDown(this.dropdown);
}
},initDropDown:function(_2c3){
this.dropdown=_2c3;
dojo.event.connect(this.domNode,this.dropdownEvent,this,"showDropdown");
},getPosition:function(){
var nr=turbo.getNodeRect(this.domNode);
return {l:nr.l,t:nr.b-1};
},showDropdown:function(){
this.dropdown=(dojo.lang.isString(this.dropdown)?dojo.widget.byId(this.dropdown):this.dropdown);
if(!this.dropdown){
return;
}
if(this.dropdown.button==this){
if(this.dropdownEvent=="onclick"){
this.hideDropdown();
}
return;
}else{
if(this.dropdown.button!=null){
this.dropdown.button.hideDropdown();
}
}
var p=this.getPosition();
this.dropdown.setPosition(p.l,p.t);
this.dropdown.button=this;
this.setState(this.states.down);
this.dropdown.show();
dojo.event.connect(document,this.dropdownEvent,this,"hideDropdown");
},isOkHideEvent:function(_2c6){
var t=_2c6.target;
return !(dojo.dom.isDescendantOf(t,this.dropdown.domNode)||dojo.dom.isDescendantOf(t,this.dropdown.scrim)||dojo.dom.isDescendantOf(t,this.domNode));
},hideDropdown:function(_2c8){
if(_2c8&&!this.isOkHideEvent(_2c8)){
return;
}
this.setState(this.states.normal);
dojo.event.disconnect(document,this.dropdownEvent,this,"hideDropdown");
this.dropdown.button=null;
this.dropdown.hide();
}};
dojo.widget.defineWidget("dojo.widget.html.TurboDropButton",dojo.widget.html.TurboButton,dojo.lang.mixin(turbo.widgets.TurboDropButton,{styleRoot:"TurboButton"}));
dojo.widget.defineWidget("dojo.widget.html.TurboDropToolbtn",dojo.widget.html.TurboToolbtn,dojo.lang.mixin(turbo.widgets.TurboDropButton,{styleRoot:"TurboToolbtn"}));
dojo.provide("turbo.widgets.TurboLayout.Layout");
dojo.require("turbo.widgets.TurboWidget");
dojo.declare("turbo.mixin.aligner",null,{descentAttribute:"layoutchildren",getAttribute:function(_2c9,_2ca){
return (_2c9.getAttribute)&&(_2c9.getAttribute(_2ca));
},shouldAlign:function(_2cb){
return (_2cb.nodeType==1)&&(dojo.html.isShowing(_2cb));
},getAlignment:function(_2cc){
return _2cc.getAttribute("layout")||"top";
},aligned:function(_2cd,_2ce){
return this.getAlignment(_2cd)==_2ce;
},listAlignedChildren:function(_2cf){
var _2d0={none:[],top:[],left:[],client:[],right:[],bottom:[]};
for(var node=_2cf.firstChild;node;node=node.nextSibling){
if(this.shouldAlign(node)){
_2d0[this.getAlignment(node)].push(node);
}
}
return _2d0;
},setStylePosition:function(_2d2,_2d3){
with(_2d2.style){
if(position!=_2d3){
position=_2d3;
}
}
},normalizeAlignedElement:function(_2d4){
this.setStylePosition(_2d4,"absolute");
},alignElement:function(_2d5,inL,inT,inW,inH){
this.normalizeAlignedElement(_2d5);
turbo.setBounds(_2d5,inL,inT,inW,inH);
},alignTop:function(_2da,_2db){
for(var i=0,n;n=_2da[i];_2db.t+=n.offsetHeight,i++){
this.alignElement(n,_2db.l,_2db.t,_2db.w);
}
},alignBottom:function(_2de,_2df){
for(var i=_2de.length-1,b=_2df.h,n;n=_2de[i];b-=n.offsetHeight,i--){
this.alignElement(n,_2df.l,b-n.offsetHeight,_2df.w);
}
_2df.h=b-_2df.t;
},alignLeft:function(_2e3,_2e4){
for(var i=0,n;n=_2e3[i];_2e4.l+=n.offsetWidth,i++){
this.alignElement(n,_2e4.l,_2e4.t,-1,_2e4.h);
}
},alignRight:function(_2e7,_2e8){
for(var i=_2e7.length-1,r=_2e8.w,n;n=_2e7[i];r-=n.offsetWidth,i--){
this.alignElement(n,r-n.offsetWidth,_2e8.t,-1,_2e8.h);
}
_2e8.w=r-_2e8.l;
},alignClient:function(_2ec,_2ed){
for(var i=0,n=_2ec[i];n;n=null){
this.alignElement(n,_2ed.l,_2ed.t,_2ed.w,_2ed.h);
}
},getBox:function(_2f0){
var box=turbo.getContentSize(_2f0);
box.t=dojo.html.getPixelValue(_2f0,"padding-top",true);
box.l=dojo.html.getPixelValue(_2f0,"padding-left",true);
return box;
},alignGrandchildren:function(_2f2,_2f3){
if(--_2f3!=-1){
for(var node=_2f2.firstChild;node;node=node.nextSibling){
if(this.getAttribute(node,this.descentAttribute)){
this.alignNode(node,_2f3);
}
}
}
},alignChildren:function(_2f5,_2f6){
var box=this.getBox(_2f5);
var _2f8=this.listAlignedChildren(_2f5);
this.alignTop(_2f8.top,box);
this.alignBottom(_2f8.bottom,box);
this.alignLeft(_2f8.left,box);
this.alignRight(_2f8.right,box);
this.alignClient(_2f8.client,box);
this.alignGrandchildren(_2f5,_2f6);
},alignNode:function(_2f9,_2fa){
if(this.shouldAlign(_2f9)){
this.alignChildren(_2f9,_2fa);
}
}});
dojo.widget.defineWidget("dojo.widget.TurboLayout",[dojo.widget.html.TurboWidget,turbo.mixin.aligner],{classTag:"turbo-layout",themeable:false,fillInTemplate:function(_2fb,_2fc){
dojo.event.topic.subscribe("turboresize",this,"reflow");
this.createChildWidgets(_2fc);
this.domNode.style.cssText+=this.style+"overflow: hidden; position: relative;";
},postCreate:function(){
var node=this.domNode;
turbo.deferUntil(function(){
return Boolean(node.offsetHeight);
},turbo.bind(this,"reflow"));
},isLayoutChild:function(){
var n=this.domNode.parentNode;
return (this.getAttribute(n,"dojotype")=="TurboLayout")||Boolean(this.getAttribute(n,this.descentAttribute));
},fitToParent:function(){
if((!this.isLayoutChild())&&(this.layout=="client")){
this.normalizeAlignedElement(this.domNode);
var box=this.getBox(this.domNode.parentNode);
turbo.setBounds(this.domNode,box.l,box.t,box.w,box.h);
}
},align:function(){
this.alignNode(this.domNode,this.generations);
},reflow:function(){
this.defaultReflow();
},defaultReflow:function(){
this.fitToParent();
this.align();
},dummy:0});

