dojo.provide("turbo.plumbing");
dojo.require("dojo.dom");
dojo.require("dojo.html.*");
dojo.require("dojo.html.layout");
dojo.require("dojo.html.selection");
dojo.require("dojo.io.*");
dojo.require("dojo.string.*");
dojo.require("dojo.lang.declare");
dojo.style=dojo.html;
turbo.env=dojo.render.html;
turbo.disableSelection=dojo.html.disableSelection;
turbo.getAbsoluteX=function(){
return dojo.html.abs.apply(dojo.html,arguments).x;
};
turbo.getAbsoluteY=function(){
return dojo.html.abs.apply(dojo.html,arguments).y;
};
turbo.setMarginBoxSize=function(_1,_2,_3){
dojo.html.setMarginBox(_1,{width:(_2>=0?_2:undefined),height:(_3>=0?_3:undefined)});
};
dojo.provide("turbo.lib");
turbo.global=this;
if(dojo.render.html.ie){
try{
document.execCommand("BackgroundImageCache",false,true);
}
catch(e){
}
}
turbo.isGoodIndex=function(_4,_5){
return (_4&&_5>=0&&_5<_4.length);
};
turbo.moveIndex=function(_6,_7,_8){
if(_6==_7){
return _8-(_6<_8);
}
return _6-(_6>_7)+(_6>=_8);
};
turbo.filter=function(_9,_a,_b){
_b=(_b||dj_global);
var _c=[];
for(var i=0,_e;i<_9.length;i++){
_e=_a.call(_b,_9[i]);
if(_e!==undefined){
_c.push(_e);
}
}
return _c;
};
turbo.arrayInsert=function(_f,_10,_11){
if(_f.length<=_10){
_f[_10]=_11;
}else{
_f.splice(_10,0,_11);
}
};
turbo.arrayRemove=function(_12,_13){
_12.splice(_13,1);
};
turbo.arraySwap=function(_14,inI,inJ){
var _17=_14[inI];
_14[inI]=_14[inJ];
_14[inJ]=_17;
};
turbo.arrayMove=function(_18,_19,_1a){
var e=_18[_19];
_18.splice(_19,1);
turbo.arrayInsert(_18,(_1a<_19?_1a:_1a-1),e);
};
turbo.arrayDup=function(_1c){
return _1c.slice(0);
};
turbo.arrayCompare=function(inA,inB){
for(var i=0,l=inA.length;i<l;i++){
if(inA[i]!=inB[i]){
return false;
}
}
return (inA.length==inB.length);
};
turbo.cat=function(){
if(turbo.env.ie){
return turbo.cloneArguments(arguments).join("");
}else{
var s="";
for(var i=0,l=arguments.length;i<l;i++){
s+=arguments[i];
}
return s;
}
};
turbo.stringOf=function(_24,_25){
if(_24<=0){
return "";
}
var _26=new Array(_24);
for(var i=0;i<_24;i++){
_26[i]=_25;
}
return _26.join("");
};
turbo.alphabetizeIndex=function(_28){
var _29=function(c){
return String.fromCharCode("A".charCodeAt(0)+c);
};
var a=Math.floor(_28/26);
return (a>0?_29(a-1):"")+_29(_28%26);
};
turbo.pathpop=function(_2c,_2d){
var _2e=_2c.lastIndexOf((_2d==undefined?"/":_2d));
return (_2e>=0?_2c.substring(0,_2e):"");
};
turbo.escapeText=function(_2f){
return dojo.string.escapeXml(String(_2f)).replace(/\n/g,"<br />");
};
turbo.conjoin=function(_30,_31,_32){
return _31+_30.join(_32+_31)+_32;
};
turbo.supplant=function(s,o){
var i,j;
for(;;){
i=s.lastIndexOf("{");
if(i<0){
break;
}
j=s.indexOf("}",i);
if(i+1>=j){
break;
}
s=s.substring(0,i)+o[s.substring(i+1,j)]+s.substring(j+1);
}
return s;
};
turbo.printf=function(s){
for(var a=1,i=0,r;a<arguments.length;){
i=s.indexOf("%",i);
if(i==-1){
break;
}
if(s.charAt(i+1)=="%"){
r="%";
}else{
r=arguments[a++];
}
s=s.substring(0,i)+r+s.substring(i+2);
if(r=="%"){
i++;
}
}
return (s==undefined?"":s);
};
turbo.stringReplace=function(_3b,_3c,_3d){
if(!turbo.env.safari){
return _3b.replace(_3c,_3d);
}
var str=_3b,_3f=_3d,reg=_3c,_41=[],_42=reg.lastIndex,re;
while((re=reg.exec(str))!=null){
var idx=re.index,_45=re.concat(idx,str);
_41.push(str.slice(_42,idx),_3f.apply(null,_45).toString());
if(!reg.global){
_42+=(RegExp.lastMatch?RegExp.lastMatch.length:0);
break;
}else{
_42=reg.lastIndex;
}
}
_41.push(str.slice(_42));
return _41.join("");
};
turbo.macros=new function(){
this.apply=function(_46,_47){
return turbo.stringReplace(_46,new RegExp("%%([^%]*)%%","ig"),function(w,m){
return (_47[m]?_47[m]:m);
});
};
this.interpolate=function(_4a){
for(var i in _4a){
_4a[i]=this.apply(_4a[i],_4a);
}
return _4a;
};
this.insert=function(_4c,_4d){
if(!_4d){
return _4c;
}
_4d=(dojo.lang.isString(_4d)?eval("("+_4d+")"):_4d);
_4d=this.interpolate(_4d);
return this.apply(_4c,_4d);
};
};
turbo.time=function(){
return new Date().getTime();
};
turbo.clamp=function(_4e,_4f,_50){
return Math.max(_4f,Math.min(_50,_4e));
};
turbo.randi=function(_51){
return Math.floor(Math.random()*(_51+1));
};
turbo.mix=function(){
var obj={};
for(var i=0,l=arguments.length;i<l;i++){
dojo.lang.mixin(obj,arguments[i]);
}
return obj;
};
turbo.mixover=function(_55,_56){
for(var a=1,_58;(_58=arguments[a]);a++){
for(var i in _58){
if(!(i in Object.prototype)&&(i in _55)&&(_58[i])){
_55[i]=_58[i];
}
}
}
return _55;
};
turbo._swiss=function(_5a,_5b){
for(var i in _5a){
_5b[i]=_5a[i];
}
return _5b;
};
turbo.swiss=function(_5d,_5e){
if(!_5d||!_5e){
return;
}
if(!dojo.lang.isArray(_5d)){
turbo._swiss(_5d,_5e);
}else{
for(var i=0,l=_5d.length;i<l;i++){
turbo._swiss(_5d[i],_5e);
}
}
return _5e;
};
turbo.stringToReference=function(_61){
var obj=turbo.global;
var _63=_61.split(".");
var _64=_63.pop();
while(_63.length&&obj){
obj=obj[_63.shift()];
}
return (_64&&(_64 in obj)?obj[_64]:null);
};
turbo.nop=function(){
};
turbo.emptyFunction=turbo.nop;
turbo.cloneArguments=function(_65,_66){
var i=(_66||0);
var l=_65.length;
var _69=new Array(l-i);
for(j=0;i<l;i++,j++){
_69[j]=_65[i];
}
return _69;
};
turbo.bind=function(_6a,_6b){
if(_6b){
return function(){
if(dojo.lang.isString(_6b)){
_6b=_6a[_6b];
}
return _6b.apply(_6a,arguments);
};
}else{
turbo.debug("turbo.bind called with null method");
return turbo.nop;
}
};
turbo.tie=function(_6c,_6d){
for(var i=1,a=arguments[i];a;a=arguments[++i]){
_6c[a]=turbo.bind(_6c,_6c[a]);
}
return _6c[arguments[1]];
};
turbo.bindArgs=function(_70,_71){
if(_71){
var _72=turbo.cloneArguments(arguments,2);
return function(){
if(dojo.lang.isString(_71)){
_71=_70[_71];
}
return _71.apply(_70,_72.concat(turbo.cloneArguments(arguments)));
};
}else{
turbo.debug("turbo.bindArgs called with null method");
return turbo.nop;
}
};
turbo.defer=function(_73,_74){
if(arguments.length>3){
var _75=turbo.cloneArguments(arguments);
var _76=_75.pop();
return window.setTimeout(turbo.bindArgs.apply(turbo,_75),_76);
}
if(arguments.length>2){
return window.setTimeout(turbo.bind(arguments[0],arguments[1]),arguments[2]);
}else{
return window.setTimeout(arguments[0],arguments[1]);
}
};
turbo.deferUntil=function(evt,_78,_79,_7a){
_7a=(_7a||5000);
_79=(_79||100);
var _7b=function(){
if(evt()){
window.clearInterval(job);
_78();
}else{
_7a-=_79;
if(_7a<=0){
window.clearInterval(job);
}
}
};
var job=window.setInterval(_7b,_79);
};
turbo.cancel=function(_7d){
if(_7d){
window.clearTimeout(_7d);
}
};
turbo.jobs=[];
turbo.job=function(_7e,_7f,_80){
turbo.cancelJob(_7e);
var job=function(){
delete turbo.jobs[_7e];
_80();
};
turbo.jobs[_7e]=turbo.defer(job,_7f);
};
turbo.cancelJob=function(_82){
turbo.cancel(turbo.jobs[_82]);
};
turbo.getFunction=turbo.stringToReference;
turbo.debugOut=function(_83){
dojo.debug(_83);
};
turbo.debugArray=function(_84){
for(var i=0,l=_84.length;i<l;i++){
if(_84[i]){
turbo.debug(i+":",_84[i]);
}
}
};
turbo.debugNode=function(_87,_88){
turbo.debugOut(_88+"(node) "+_87.tagName);
};
turbo.debugObjs=[];
turbo.debugObject=function(_89,_8a){
if(!_8a){
_8a="";
}
if(_89.nodeName){
turbo.debugNode(_89,_8a);
}else{
if(_8a.length>6*10){
turbo.debugOut(_8a+"too deep");
}else{
if(dojo.lang.inArray(turbo.debugObjs,_89)){
turbo.debugOut(_8a+"(circular reference)");
}else{
var l=turbo.debugObjs.length;
turbo.debugObjs.push(_89);
try{
for(var _8c in _89){
var obj=_89[_8c];
s=_8a+"| "+_8c;
if(obj!=null&&typeof (obj)=="object"){
turbo.debugOut(s+" = ("+(obj instanceof Array?"array":"object")+")");
turbo.debugObject(obj,_8a+"......");
}else{
turbo.debugOut(s+" = "+obj);
}
}
}
finally{
delete turbo.debugObjs[l];
}
}
}
}
};
turbo.debugTop=function(_8e,_8f){
if(!_8f){
_8f="";
}
for(var _90 in _8e){
var obj=_8e[_90];
s=_8f+_90;
if(obj!=null&&typeof (obj)=="object"){
turbo.debugOut(s+" = ("+(obj instanceof Array?"array":"object")+")");
}else{
turbo.debugOut(s+" = "+obj);
}
}
};
turbo.debugf=function(){
turbo.debug(turbo.printf.apply(turbo,arguments));
};
turbo.debug=function(){
var c=arguments.length;
for(var i=0;i<c;i++){
if(dojo.lang.isArray(arguments[i])){
turbo.debugArray(arguments[i]);
}else{
if(dojo.lang.isObject(arguments[i])){
turbo.debugTop(arguments[i]);
}else{
turbo.debugOut(arguments[i]);
}
}
}
};
turbo.$=function(_94,_95){
return (!_94?null:(!dojo.lang.isString(_94)?_94:(_95?_95:document).getElementById(_94)));
};
turbo.create=function(_96){
return document.createElement(_96);
};
turbo.remove=function(_97){
_97=turbo.$(_97);
if(_97&&_97.parentNode){
_97.parentNode.removeChild(_97);
}
return _97;
};
turbo.append=function(_98,_99){
(_99?_99:document.body).appendChild(_98);
};
turbo.addBodyNode=function(_9a){
document.body.appendChild(_9a);
};
turbo.addHeadNode=function(_9b){
document.getElementsByTagName("head").item(0).appendChild(_9b);
};
turbo.marshall=function(){
var id="";
var _9d=dj_global;
for(var i=0;i<arguments.length;i++){
id=arguments[i];
if((i==0)&&(!dojo.lang.isString(id))){
_9d=id;
}else{
if(!_9d[id]){
_9d[id]=turbo.$(id);
}
}
}
return dj_global[id];
};
turbo.getTagName=function(_9f){
var _a0=turbo.$(_9f);
return (_a0&&_a0.tagName?_a0.tagName.toLowerCase():"");
};
turbo.indexInParent=function(_a1){
var i=0,n,p=_a1.parentNode;
while(n=p.childNodes[i++]){
if(n==_a1){
return i-1;
}
}
return -1;
};
turbo.kids=function(_a5,_a6){
var _a7=[];
var i=0,n;
while(n=_a5.childNodes[i++]){
if(turbo.getTagName(n)==_a6){
_a7.push(n);
}
}
return _a7;
};
turbo.divkids=function(_aa){
return turbo.kids(_aa,"div");
};
turbo.nthkid=function(_ab,inN,_ad){
var _ae=[];
var i=0,n;
while(n=_ab.childNodes[i++]){
if(turbo.getTagName(n)==_ad){
if(inN--==0){
return n;
}
}
}
return null;
};
turbo.nthdiv=function(_b1,inN){
return turbo.nthkid(_b1,inN,"div");
};
turbo.capture=function(_b3){
if(_b3.setCapture){
_b3.setCapture();
}else{
document.addEventListener("mousemove",_b3.onmousemove,true);
document.addEventListener("mouseup",_b3.onmouseup,true);
}
};
turbo.release=function(_b4){
if(_b4.releaseCapture){
_b4.releaseCapture();
}else{
document.removeEventListener("mousemove",_b4.onmousemove,true);
document.removeEventListener("mouseup",_b4.onmouseup,true);
}
};
turbo.getPixelToEmRatio=function(_b5){
var _b6=200;
var _b7=_b5||document.body;
var _b8=12;
try{
var e=document.createElement("div");
with(e.style){
top="0px";
left="0px";
width=_b6+"em";
height="1em";
overflow="hidden";
position="absolute";
visibility="hidden";
}
_b7.appendChild(e);
_b8=e.offsetWidth/_b6;
_b7.removeChild(e);
delete e;
}
catch(ex){
}
return _b8;
};
turbo.EmToPixels=turbo.getPixelToEmRatio;
turbo.getScrollbarWidth=function(){
if(turbo._scrollBarWidth){
return turbo._scrollBarWidth;
}
turbo._scrollBarWidth=18;
try{
var e=document.createElement("div");
with(e.style){
top="0px";
left="0px";
width="100px";
height="100px";
overflow="scroll";
position="absolute";
visibility="hidden";
}
document.body.appendChild(e);
turbo._scrollBarWidth=e.offsetWidth-e.clientWidth;
document.body.removeChild(e);
delete e;
}
catch(ex){
}
return turbo._scrollBarWidth;
};
turbo.hasHorizontalScrollbar=function(_bb){
return (_bb.scrollWidth>_bb.clientWidth);
};
turbo.watchTextSizePoll=function(_bc,_bd,_be){
var f=document.createElement("div");
with(f.style){
top="0px";
left="0px";
position="absolute";
visibility="hidden";
}
f.innerHTML="TheQuickBrownFoxJumpedOverTheLazyDog";
document.body.appendChild(f);
var fw=f.offsetWidth;
var job=function(){
if(f.offsetWidth!=fw){
fw=f.offsetWidth;
turbo.textSizeChanged();
}
};
window.setInterval(job,_be||200);
turbo.connectTextSizePoll(_bc,_bd);
turbo.watchTextSizePoll=turbo.connectTextSizePoll;
};
turbo.unwatchTextSizePoll=function(_c2,_c3){
dojo.event.disconnect(turbo,"textSizeChanged",_c2,_c3);
};
turbo.connectTextSizePoll=function(_c4,_c5){
dojo.event.connect(turbo,"textSizeChanged",_c4,_c5);
};
turbo.textSizeChanged=function(){
};
turbo.preloads=[];
turbo.preloadImage=function(_c6){
var i=new Image();
i.src=_c6;
turbo.preloads.push(i);
};
turbo.setCursor=function(_c8){
document.body.style.cursor=_c8;
};
turbo.setBusyCursor=function(){
turbo.setCursor("wait");
};
turbo.setDefaultCursor=function(){
turbo.setCursor("default");
};
turbo.getStyleText=function(_c9,_ca){
if(dojo.lang.isUndefined(_c9.style.cssText)){
return _c9.getAttribute("style");
}
return _c9.style.cssText;
};
turbo.setStyleText=function(_cb,_cc){
if(dojo.lang.isUndefined(_cb.style.cssText)){
_cb.setAttribute("style",_cc);
}else{
_cb.style.cssText=_cc;
}
};
turbo.cancelSelectStart=function(){
if(window.event){
return (!window.event.ctrlKey&&!window.event.shiftKey);
}
};
turbo.cancelSelection=function(){
if(window.getSelection){
window.getSelection().removeAllRanges();
}
};
turbo.getSelectValue=function(_cd){
var s=turbo.$(_cd);
if(!s){
return "";
}
with(s.options[s.selectedIndex]){
return (value?value:innerHTML);
}
};
turbo.getCellIndex=function(_cf){
if(_cf.cellIndex){
return _cf.cellIndex;
}
var _d0=_cf.parentNode.cells;
for(var i=0,_d2;(_d2=_d0[i]);i++){
if(_cf==_d2){
return i;
}
}
return -1;
};
turbo.getRowIndex=function(_d3){
if(_d3.rowIndex&&_d3.rowIndex>=0){
return _d3.rowIndex;
}
var _d4=_d3.parentNode.childNodes;
for(var i=0,l=_d4.length;i<l;i++){
if(_d3==_d4[i]){
return i;
}
}
return -1;
};
turbo.getTableRow=function(_d7,_d8){
if(!_d7){
return null;
}
if((_d7.rows)&&(_d7.rows.length>0)){
return _d7.rows[_d8];
}else{
if(_d7.childNodes.length>_d8){
return _d7.childNodes[_d8];
}else{
return null;
}
}
};
turbo.getTable=function(_d9){
var n=_d9;
while((n)&&(turbo.getTagName(n)!="table")){
n=n.parentNode;
}
return n;
};
turbo.getWindowSize=function(){
if(window.innerWidth){
return {w:window.innerWidth,h:window.innerHeight};
}else{
return {w:document.documentElement.clientWidth,h:document.documentElement.clientHeight};
}
};
turbo.getContentSize=function(_db){
if((_db)&&(_db!=document.body)){
with(dojo.html.getContentBox(_db)){
return {w:width,h:height};
}
}else{
return turbo.getWindowSize();
}
};
turbo.getInnerSize=function(_dc){
if(_dc&&_dc!=document.body){
var s=dojo.html.getBorderBox(_dc);
return {w:s.width,h:s.height};
}else{
return turbo.getWindowSize();
}
};
turbo.getOuterSize=function(_de){
if(_de&&_de!=document.body){
var s=dojo.html.getMarginBox(_de);
return {w:s.width,h:s.height};
}else{
return turbo.getWindowSize();
}
};
turbo.setContentSize=function(_e0,inW,inH){
var siz=turbo.getContentSize(_e0);
if(inW>0&&inW!=siz.w){
_e0.style.width=inW+"px";
}
if(inH>0&&inH!=siz.h){
_e0.style.height=inH+"px";
}
};
turbo.getBounds=function(_e4){
var _e5=turbo.getContentSize(_e4);
with(dojo.html.getPadding(_e4)){
_e5.l=width;
_e5.t=height;
}
return _e5;
};
turbo.setBounds=function(_e6,inL,inT,inW,inH){
if(!_e6){
return;
}
with(_e6.style){
if(inL>=0){
left=inL+"px";
}
if(inT>=0){
top=inT+"px";
}
}
turbo.setMarginBoxSize(_e6,inW,inH);
};
turbo.fitToParent=function(_eb){
with(turbo.getBounds((_eb.parentNode)||(document.body))){
turbo.setBounds(_eb,l,t,w,h);
}
};
turbo.setStyle=function(_ec,_ed,_ee){
if(_ec&&_ec.style[_ed]!=_ee){
_ec.style[_ed]=_ee;
}
};
turbo.setStyleLeftPx=function(_ef,_f0){
turbo.setStyle(_ef,"left",_f0+"px");
};
turbo.setStyleTopPx=function(_f1,_f2){
turbo.setStyle(_f1,"top",_f2+"px");
};
turbo.setStyleWidthPx=function(_f3,_f4){
if(_f4>=0){
turbo.setStyle(_f3,"width",_f4+"px");
}
};
turbo.setStyleHeightPx=function(_f5,_f6){
if(_f6>=0){
turbo.setStyle(_f5,"height",_f6+"px");
}
};
turbo.setStyleSizePx=function(_f7,_f8,_f9){
turbo.setStyleWidthPx(_f7,_f8);
turbo.setStyleHeightPx(_f7,_f9);
};
turbo.setStyleBoundsPx=function(_fa,_fb,_fc,_fd,_fe){
turbo.setVisibility(_fa,false);
turbo.setStyleLeftPx(_fa,_fb);
turbo.setStyleTopPx(_fa,_fc);
turbo.setStyleWidthPx(_fa,_fd);
turbo.setStyleHeightPx(_fa,_fe);
turbo.setVisibility(_fa,true);
};
turbo.setOuterStyleWidthPx=function(_ff,_100){
if(_ff){
dojo.html.setMarginBoxWidth(_ff,_100);
}
};
turbo.setOuterStyleHeightPx=function(_101,_102){
if(_101){
dojo.html.setMarginBoxHeight(_101,_102);
}
};
turbo.setShowing=function(_103,_104){
_103=turbo.$(_103);
if(_103&&_103.style){
_103.style.display=(_104?"":"none");
}
};
turbo.showHide=function(){
var l=arguments.length-1;
var show=arguments[l];
if(show!==true&&show!==false){
show=true;
l++;
}
for(var i=0;i<l;i++){
turbo.setShowing(arguments[i],show);
}
};
turbo.show=turbo.showHide;
turbo.hide=function(){
var l=arguments.length;
for(var i=0;i<l;i++){
turbo.setShowing(arguments[i],false);
}
};
turbo.isShowing=function(_10a){
_10a=turbo.$(_10a);
if(!_10a||(_10a["style"]&&dojo.html.getComputedStyle(_10a,"display")=="none")){
return false;
}else{
if(_10a["parentNode"]&&_10a.parentNode&&_10a.parentNode!=document.body){
return turbo.isShowing(_10a.parentNode);
}else{
return true;
}
}
};
turbo.showing=turbo.isShowing;
turbo.setVisibility=function(_10b,_10c){
_10b=turbo.$(_10b);
if(_10b&&_10b.style){
_10b.style.visibility=(_10c?"":"hidden");
}
};
turbo.setStyleProperties=function(_10d,_10e){
if(!_10d||!_10d.style){
return;
}
for(var i in _10e){
if(i=="opacity"){
dojo.html.setOpacity(_10d,_10e[i]);
}else{
if(i in _10d.style){
_10d.style[i]=_10e[i];
}
}
}
};
turbo.clean=function(_110){
if(!_110){
return;
}
var _111=function(inW){
return inW.domNode&&dojo.dom.isDescendantOf(inW.domNode,_110,true);
};
var ws=dojo.widget.byFilter(_111);
for(var i=0;i<ws.length;i++){
var w=ws[i];
if(dojo.widget.widgetIds[w.widgetId]==w){
w.destroy();
}
}
delete ws;
dojo.event.browser.clean(_110);
};
turbo.connect=function(_116,_117,_118,_119){
dojo.event.browser.addListener(_116,_117,turbo.bind(_118,_119));
};
turbo.mouseEvents=["mouseover","mouseout","mousedown","mouseup","click","dblclick","contextmenu"];
turbo.keyEvents=["keyup","keydown","keypress"];
turbo.funnelEvents=function(_11a,_11b,_11c,_11d){
var evts=(_11d?_11d:turbo.mouseEvents.concat(turbo.keyEvents));
for(var i=0,l=evts.length;i<l;i++){
turbo.connect(_11a,"on"+evts[i],_11b,_11c);
}
};
turbo.killEvent=function(e){
if(e){
dojo.event.browser.stopEvent(e);
}
};
turbo.parseWidgets=function(_122,_123){
try{
var n,_125=new dojo.xml.Parse(),sids=(_123?_123:djConfig.searchIds);
if(sids&&sids.length>0){
for(var i=0,l=sids.length;i<l;i++){
n=document.getElementById(sids[i]);
if(n){
dojo.widget.getParser().createComponents(_125.parseElement(n,null,true));
}
}
}else{
dojo.widget.getParser().createSubComponents(_125.parseElement(_122,null,true));
}
}
catch(e){
turbo.debug("turbo.parseWidgets: an exception was thrown",e);
}
};
turbo.widgetClick=function(id,_12a){
var w=dojo.widget.byId("id");
var f=turbo.evalObjPath(onClick);
if(w&&f){
f.call(w);
}
};
turbo.scripts=[];
turbo.loadScript=function(_12d){
if(turbo.scripts[_12d]){
return;
}
turbo.scripts[_12d]=true;
dojo.io.bind({url:_12d,mimetype:"text/javascript",sync:true});
};
turbo.loadScriptByTag=function(_12e){
if(turbo.scripts[_12e]){
return;
}
turbo.scripts[_12e]=true;
var _12f=document.createElement("script");
_12f.type="text/javascript";
_12f.language="JavaScript";
turbo.addHeadNode(_12f);
_12f.src=_12e;
};
if(!this.dojo){
throw new Exception("Requires Dojo toolkit");
}
dojo.provide("turbo.turbo");
dojo.require("turbo.plumbing");
dojo.require("turbo.lib");
turbo.fine_css=true;
dojo.provide("turbo.lib.more");
turbo.addRemoveClass=function(_130,_131,_132){
if(_130){
dojo.html[(_132?"addClass":"removeClass")].call(dojo.html,_130,_131);
}
};
dojo.provide("turbo.lib.scrim");
dojo.require("turbo.turbo");
dojo.declare("turbo.pool",null,{pool:[],findUnused:function(){
for(var i=this.pool.length-1;i>=0;i--){
if(!pool[i].__inuse){
return this.pool[i];
}
}
return false;
},create:function(){
},_create:function(){
var _134=this.create();
this.pool.push(_134);
},get:function(){
var _135=this.findUnused()||this._create();
if(_135){
_135.__inuse=true;
}
return _135;
},release:function(_136){
if(_136){
_136.__inuse=false;
}
}});
turbo.scrim={pool:new turbo.pool(),createIFrame:function(){
var node=document.createElement("iframe");
node.setAttribute("frameBorder",0);
node.setAttribute("scrolling","no");
return node;
},createDiv:function(){
return document.createElement("div");
},createScrim:function(){
var node=(dojo.render.html.ie?turbo.scrim.createIFrame():turbo.scrim.createDiv());
node.isScrim=true;
return node;
},get:function(_139,inId,_13b,_13c){
var node=turbo.scrim.pool.get();
node.scrimActive=true;
node.style.border=0;
node.style.position="absolute";
node.id=inId;
node.name=inId;
turbo.setStyleProperties(node,_13b);
_139.appendChild(node);
turbo.scrim.size(node,_13c);
return node;
},release:function(_13e){
if(_13e.isScrim){
turbo.scrim.pool.release(_13e);
dojo.dom.removeNode(_13e);
}
},getBounds:function(_13f){
var box=(_13f.parentNode==document.body?turbo.getWindowSize():dojo.html.getPaddingBox(_13f.parentNode));
return {t:0,l:0,w:box.w||box.width,h:box.h||box.height};
},size:function(_141,_142){
if(!_142){
_142=this.getBounds(_141);
}
turbo.setBounds(_141,_142.l,_142.t,_142.w,_142.h);
}};
turbo.scrim.pool.get=turbo.scrim.createScrim;
dojo.provide("turbo.lib.align");
dojo.require("turbo.turbo");
turbo.aligner=new function(){
this.enabled=false;
this.targets=[];
this.getAlignment=function(_143){
return _143.getAttribute("turboAlign")||_143.getAttribute("turboalign");
};
this.visible=function(_144){
return (dojo.html.getComputedStyle(_144,"display")!="none");
};
this.listChildrenByAlignment=function(_145,_146){
var _147=[];
var node=_145.firstChild;
while(node){
if(node.nodeType==1&&(this.getAlignment(node)==_146)&&this.visible(node)){
_147.push(node);
}
node=node.nextSibling;
}
return _147;
};
this.listAlignedChildren=function(_149){
var _14a={none:[],top:[],left:[],client:[],right:[],bottom:[]};
var node=_149.firstChild;
while(node){
if(node.nodeType==1&&this.visible(node)){
var _14c=this.getAlignment(node);
if(_14c){
if(_14a[_14c]){
_14a[_14c].push(node);
}else{
_14a[_14c]=[node];
}
}
}
node=node.nextSibling;
}
return _14a;
};
this.setStylePosition=function(_14d,_14e){
if(_14d.style.position!=_14e){
_14d.style.position=_14e;
}
};
this.normalizeAlignedElement=function(_14f){
this.setStylePosition(_14f,"absolute");
};
this.alignElement=function(_150,inL,inT,inW,inH){
this.normalizeAlignedElement(_150);
turbo.setBounds(_150,inL,inT,inW,inH);
this.alignChildren(_150);
};
this.alignChildren=function(_155){
var _156=this.listAlignedChildren(_155);
var siz=turbo.getContentSize(_155);
var top=dojo.html.getPixelValue(_155,"padding-top",true);
var left=dojo.html.getPixelValue(_155,"padding-left",true);
var l,r,t,b,w,h,c,_161;
_161=_156.none;
for(var i=0;i<_161.length;i++){
var p=dojo.html.getComputedStyle(_161[i],"position");
}
_161=_156.top;
t=top;
for(var i=0;i<_161.length;i++){
this.alignElement(_161[i],left,t,siz.w);
t+=_161[i].offsetHeight;
}
_161=_156.bottom;
b=siz.h+top;
c=_161.length;
for(var i=c-1;i>=0;i--){
b-=_161[i].offsetHeight;
this.alignElement(_161[i],left,b,siz.w);
}
h=b-t;
_161=_156.left;
l=left;
for(var i=0;i<_161.length;i++){
this.alignElement(_161[i],l,t,-1,h);
l+=_161[i].offsetWidth;
}
_161=_156.right;
r=siz.w+left;
c=_161.length;
for(var i=c-1;i>=0;i--){
r-=_161[i].offsetWidth;
this.alignElement(_161[i],r,t,-1,h);
}
w=r-l;
_161=_156.client;
for(var i=0;i<_161.length;i++){
this.alignElement(_161[i],l,t,w,h);
break;
}
_161=_156.none;
for(var i=0;i<_161.length;i++){
this.alignChildren(_161[i]);
}
};
this.alignTargets=function(){
for(var i=0,l=turbo.aligner.targets.length;i<l;i++){
turbo.aligner.alignChildren(turbo.aligner.targets[i]);
}
};
this.alignFrom=function(_166){
if(turbo.aligner.enabled){
turbo.aligner.alignChildren(_166);
}
};
this.alignNow=function(){
turbo.aligner.alignFrom(document.body);
turbo.aligner.alignTargets();
};
this.lastAlign=0;
this.align=function(){
if(!turbo.aligner.enabled){
return;
}
turbo.aligner.alignNow();
};
this.alignLater=function(_167){
turbo.defer(turbo.aligner.align,(_167?_167:200));
};
this.enable=function(_168){
turbo.aligner.enabled=(_168!==false);
};
this.start=function(){
turbo.aligner.enable();
turbo.aligner.alignLater(500);
};
this.addTarget=function(_169){
var e=(dojo.lang.isString(_169)?turbo.$(_169):_169);
e.style.position="relative";
turbo.aligner.targets.push(e);
};
};
dojo.provide("turbo.lib.theme");
dojo.require("dojo.io.*");
dojo.require("dojo.html");
dojo.require("turbo.turbo");
turbo.stylesheet={cssFiles:[],links:[],rules:0,loadCost:0,processCost:0,dummy:0};
turbo.stylesheet.create=function(_16b){
var l=document.createElement("link");
l.setAttribute("rel","stylesheet");
l.setAttribute("type","text/css");
l.setAttribute("href",_16b+"/base.css");
return l;
};
turbo.stylesheet.getLink=function(_16d){
var l=turbo.stylesheet.links[_16d];
if(!l){
l=turbo.stylesheet.create(_16d);
turbo.addHeadNode(l);
turbo.stylesheet.links[_16d]=l;
}
return l;
};
turbo.stylesheet.getLinkSheet=function(_16f){
var s=null;
if(!_16f.addRule){
turbo.debug("stylesheet has no addRule method");
if(_16f.styleSheet){
s=_16f.styleSheet;
}else{
turbo.debug("turbo.stylesheet.getLinkSheet: link has no .styleSheet property");
}
}
return s;
};
turbo.stylesheet.loaded=function(_171){
if(!_171||turbo.stylesheet.cssFiles[_171]){
return true;
}
turbo.stylesheet.cssFiles[_171]=true;
return false;
};
turbo.stylesheet.append=function(_172){
turbo.stylesheet.importStyleSheet(_172);
};
turbo.stylesheet.importStyleSheet=function(_173){
if(turbo.stylesheet.loaded(_173)){
return;
}
dojo.html.insertCssFile(_173,null,false,true);
};
turbo.stylesheet.importThemeFile=function(_174){
if(turbo.by_hand_css||djConfig["turbo_hand_css"]){
return;
}
if(turbo.fine_css||djConfig["turbo_fine_css"]){
if(dojo.render.html.ie){
turbo.stylesheet.append(_174);
}else{
turbo.stylesheet.importStyleSheet(_174);
}
}else{
turbo.stylesheet.importStyleSheet(turbo.pathpop(_174)+"/theme.css");
}
};
turbo.themes=new function(){
this.theme="";
this.themeable=[];
this.addThemeable=function(_175){
this.themeable.push(_175);
};
this.removeThemeable=function(_176){
for(var i in this.themeable){
if(this.themeable[i]==_176){
this.themeable.splice(i,1);
return;
}
}
};
this.setTheme=function(_178){
this.theme=(_178&&_178.toLowerCase()!="xp"?_178:"default");
for(var i=0,l=this.themeable.length;i<l;i++){
this.themeable[i].setTheme(this.theme);
}
if(turbo["aligner"]){
turbo.defer(turbo.aligner.align,250);
turbo.defer(turbo.aligner.align,1000);
}
};
this.set=this.setTheme;
};
dojo.addOnLoad(function(){
dojo.html.addClass(document.body,(dojo.render.html.moz?"turbo-gecko":(dojo.render.html.ie?"turbo-ie":"")));
});
dojo.provide("turbo.lib.drag");
dojo.require("turbo.turbo");
turbo.drag={};
turbo.drag.dragging=false;
turbo.drag.hysteresis=2;
turbo.drag.capture=function(_17b){
if(_17b.setCapture){
_17b.setCapture();
}else{
document.addEventListener("mousemove",_17b.onmousemove,true);
document.addEventListener("mouseup",_17b.onmouseup,true);
document.addEventListener("click",_17b.onclick,true);
}
};
turbo.drag.release=function(_17c){
if(_17c.releaseCapture){
_17c.releaseCapture();
}else{
document.removeEventListener("click",_17c.onclick,true);
document.removeEventListener("mouseup",_17c.onmouseup,true);
document.removeEventListener("mousemove",_17c.onmousemove,true);
}
};
turbo.drag.start=function(_17d,_17e,_17f,_180,_181){
if(!_17d||turbo.drag.dragging){
turbo.debug("failed to start drag: bad input node or already dragging");
return;
}
turbo.drag.dragging=true;
turbo.drag.elt=_17d;
turbo.drag.events={drag:_17e||turbo.nop,end:_17f||turbo.nop,start:_181||turbo.nop,oldmove:_17d.onmousemove,oldup:_17d.onmouseup,oldclick:_17d.onclick};
turbo.drag.positionX=(_180&&("screenX" in _180)?_180.screenX:false);
turbo.drag.positionY=(_180&&("screenY" in _180)?_180.screenY:false);
turbo.drag.started=(turbo.drag.position===false);
_17d.onmousemove=turbo.drag.mousemove;
_17d.onmouseup=turbo.drag.mouseup;
_17d.onclick=turbo.drag.click;
turbo.drag.capture(turbo.drag.elt);
};
turbo.drag.end=function(){
turbo.drag.release(turbo.drag.elt);
turbo.drag.elt.onmousemove=turbo.drag.events.oldmove;
turbo.drag.elt.onmouseup=turbo.drag.events.oldup;
turbo.drag.elt.onclick=turbo.drag.events.oldclick;
turbo.drag.elt=null;
try{
if(turbo.drag.started){
turbo.drag.events.end();
}
}
finally{
turbo.drag.dragging=false;
}
};
turbo.drag.calcDelta=function(_182){
_182.deltaX=_182.screenX-turbo.drag.positionX;
_182.deltaY=_182.screenY-turbo.drag.positionY;
};
turbo.drag.hasMoved=function(_183){
return Math.abs(_183.deltaX)+Math.abs(_183.deltaY)>turbo.drag.hysteresis;
};
turbo.drag.mousemove=function(_184){
_184=dojo.event.browser.fixEvent(_184);
turbo.killEvent(_184);
turbo.drag.calcDelta(_184);
if((!turbo.drag.started)&&(turbo.drag.hasMoved(_184))){
turbo.drag.events.start(_184);
turbo.drag.started=true;
}
if(turbo.drag.started){
turbo.drag.events.drag(_184);
}
};
turbo.drag.mouseup=function(_185){
turbo.killEvent(dojo.event.browser.fixEvent(_185));
turbo.drag.end();
};
turbo.drag.click=function(_186){
turbo.killEvent(dojo.event.browser.fixEvent(_186));
};
dojo.provide("turbo.lib.app");
dojo.require("turbo.lib.align");
dojo.require("turbo.lib.scrim");
dojo.require("dojo.event.*");
turbo.app={marshall:function(){
var id="";
var _188=dj_global;
for(var i=0;i<arguments.length;i++){
id=arguments[i];
if(!_188[id]){
_188[id]=turbo.$(id);
}
}
return _188[id];
},onresize:function(){
},alignerAlign:function(){
this.onresize();
},resize:function(){
turbo.aligner.align();
},_windowResize:function(){
turbo.app.resize();
turbo.app.resizePending=null;
},windowResize:function(){
(!this.resizePending)&&(this.resizePending=turbo.defer(turbo.app._windowResize,250));
},display:function(){
turbo.aligner.enable();
this._windowResize();
turbo.defer(turbo.app.windowResize,500);
if(turbo.turbo_disable_curtain||djConfig["turbo_disable_curtain"]){
this.showPageBody();
}else{
turbo.scrim.release(this.scrim);
this.scrim=null;
}
},encurtain:function(){
this.scrim=turbo.scrim.get(document.body,"turboCurtain",{zIndex:9999,backgroundColor:"white"});
this.showPageBody();
},showPageBody:function(){
document.body.style.display="block";
},init:function(){
},initialize:function(){
if(!turbo.turbo_disable_curtain&&!djConfig["turbo_disable_curtain"]){
this.encurtain();
}
try{
this.init();
}
catch(e){
dojo.debug("turbo.app.init failed: "+e);
turbo.debug(e);
}
turbo.defer(turbo.bind(this,this.display),100);
dojo.event.connect(turbo.aligner,"align",this,"alignerAlign");
dojo.event.connect(window,"onresize",this,"windowResize");
}};
turbo.app.curtainHtml="";
dojo.addOnLoad(turbo.app,"initialize");
if(false){
dojo.addOnLoad(function(){
showHideGrids=function(_18a){
var _18b=dojo.widget.getWidgetsByType("TurboGridClassic");
for(var i=0;i<_18b.length;i++){
turbo.showHide(_18b[i].domNode,_18a);
}
};
hideGrids=function(){
showHideGrids(false);
};
showGrids=function(){
showHideGrids(true);
};
dojo.event.connect("before",turbo.aligner,"align","hideGrids");
dojo.event.connect("after",turbo.aligner,"align","showGrids");
});
}
dojo.event.topic.registerPublisher("turboresize",turbo.app,"onresize");
dojo.provide("turbo.widgets.TurboWidget");
dojo.require("dojo.widget.*");
dojo.require("turbo.turbo");
dojo.require("turbo.lib.theme");
dojo.require("turbo.lib.align");
turbo.widgetRoot="../turbo/widgets/";
turbo.templateRoot=turbo.widgetRoot+"templates/";
turbo.themeRoot=turbo.widgetRoot+"themes/";
turbo.themePath=dojo.hostenv.getBaseScriptUri()+turbo.themeRoot;
turbo.loadJs=function(_18d){
turbo.loadScript(dojo.hostenv.getBaseScriptUri()+_18d);
};
turbo.loadCss=function(_18e){
turbo.stylesheet.importThemeFile(dojo.hostenv.getBaseScriptUri()+_18e);
};
turbo.setWidgetType=function(_18f,_190){
if(_18f.widgetType=="HtmlWidget"){
_18f.widgetType=_190;
}
};
dojo.widget.defineWidget("dojo.widget.html.TurboWidget",dojo.widget.HtmlWidget,function(){
this.styleRoot=(this.styleRoot||this.widgetType);
this.setClassName=this.setStyledClass;
if(this._inherited){
this.inherited=this._inherited;
}
},{themeRoot:turbo.themeRoot,templateRoot:turbo.templateRoot,isContainer:false,align:"",debuggable:true,flex:"",layout:"",style:"",theme:"",themeable:true,themeJs:false,turboalign:"",turboCreate:function(){
},turboDestroy:function(){
},setTemplatePath:function(){
this.templatePath=dojo.uri.dojoUri(turbo.templateRoot+this.widgetType+".html");
},initialize:function(_191,_192,_193){
if(this.widgetId.substr(-2,1)!="_"&&this.widgetId.substr(-3,1)!="_"){
dj_global[this.widgetId]=this;
}
if(this.extraArgs["turboAlign"]){
this.turboalign=this.extraArgs.turboAlign;
}
if(this.turboalign){
this.domNode.setAttribute("turboalign",this.turboalign);
}
if(this.layout){
this.domNode.setAttribute("layout",this.layout);
}
if(this.flex){
this.domNode.setAttribute("flex",this.flex);
}
this.className=this.extraArgs["class"];
if(this.className){
dojo.html.addClass(this.domNode,this.className);
}
var node=this.getFragNodeRef(_192);
if(node!=this.domNode){
this.domNode.style.cssText+=node.style.cssText;
}
this.domNode.id=this.widgetId;
if(this.themeable){
turbo.themes.addThemeable(this);
if(!this.theme){
this.theme=turbo.themes.theme;
}
this.setTheme(this.theme);
}
this.turboCreate();
},uninitialize:function(){
if(this.themeable){
turbo.themes.removeThemeable(this);
}
this.turboDestroy();
window[this.widgetId]=null;
},"default":function(_195,_196){
this.constructor.prototype[_195].apply(this,_196);
},tie:function(_197){
return turbo.tie.apply(turbo,[this].concat(turbo.cloneArguments(arguments)));
},bindArgEvent:function(_198,_199){
if(_199[_198]){
this[_198]=turbo.getFunction(_199[_198]);
}
},bindArgEvents:function(_19a){
return;
for(var arg in _19a){
if(dojo.lang.isFunction(this[arg])){
var _19c=_19a[arg];
if(_19c.search(/[^\w\.]+/i)==-1){
var func=turbo.getFunction(_19c);
if(func){
this[arg]=func;
}else{
this.debug("bindArgEvents","could not bind \""+arg+"\" to \""+_19c+"\"");
}
}
}
}
},connectEvents:function(_19e){
for(var i=1,l=arguments.length;i<l;i++){
turbo.connect(_19e,"on"+arguments[i].toLowerCase(),this,"do"+arguments[i]);
}
},getWidgetFragment:function(_1a1){
return _1a1["dojo:"+this.widgetType.toLowerCase()];
},createChildWidgets:function(_1a2){
dojo.widget.getParser().createSubComponents(_1a2);
},installChildren:function(_1a3,_1a4){
var _1a5=(_1a4?_1a4:this.domNode);
dojo.dom.moveChildren(this.getFragNodeRef(_1a3),_1a5);
this.createChildWidgets(_1a3);
},getStylePath:function(_1a6){
return this.themeRoot+(_1a6?_1a6:"default")+"/"+this.styleRoot+_1a6;
},loadStyle:function(_1a7){
var p=this.getStylePath(_1a7);
turbo.loadCss(p+".css");
if(this.themeJs){
turbo.loadJs(p+"Theme.js");
}
},setStyle:function(_1a9){
this.style=(_1a9=="default"||_1a9=="XP"?"":_1a9);
this.loadStyle(this.style);
this.styleChanged();
},setTheme:function(_1aa){
this.loadStyle("");
if(!this.themeable){
return;
}
if(_1aa&&(_1aa.charAt(0)=="+")){
this.themeable=false;
_1aa=_1aa.substring(1);
}
this.setStyle(_1aa);
},styleChanged:function(){
},setStyledClass:function(_1ab,_1ac){
if(!_1ac){
_1ac="";
}
_1ab.className=this.classTag+_1ac+(this.style?" "+this.classTag+this.style+_1ac:"");
},debug:function(_1ad,_1ae){
if(this.debuggable){
turbo.debug(this.widgetId+" ["+this.widgetType+"]: "+_1ad+": "+turbo.printf.apply(turbo,turbo.cloneArguments(arguments,1)));
}
},showHide:function(_1af){
if(_1af){
this.show();
}else{
this.hide();
}
}});
dojo.widget.TurboWidget=dojo.widget.html.TurboWidget;

dojo.getObject=function(_3,_4,_5,_6){
var _7,_8;
if(typeof _3!="string"){
return undefined;
}
_7=_5;
if(!_7){
_7=dojo.global();
}
var _9=_3.split("."),i=0,_b,_c,_d;
do{
_b=_7;
_d=_9[i];
_c=_7[_9[i]];
if((_4)&&(!_c)){
_c=_7[_9[i]]={};
}
_7=_c;
i++;
}while(i<_9.length&&_7);
_8=_7;
_7=_b;
return (_6)?{obj:_7,prop:_d}:_8;
};
/* begin turbo.grid.js */
dojo.provide("turbo.lib.scroller");
dojo.require("dojo.event.*");
dojo.declare("turbo.scroller.base",null,function(){
this.pageHeights=[];
this.stack=[];
},{rowCount:0,defaultRowHeight:10,keepRows:100,contentNode:null,scrollboxNode:null,defaultPageHeight:0,keepPages:10,pageCount:0,windowHeight:0,firstVisibleRow:0,lastVisibleRow:0,page:0,pageTop:0,init:function(_1,_2,_3){
switch(arguments.length){
case 3:
this.rowsPerPage=_3;
case 2:
this.keepRows=_2;
case 1:
this.rowCount=_1;
}
this.defaultPageHeight=this.defaultRowHeight*this.rowsPerPage;
this.pageCount=Math.ceil(this.rowCount/this.rowsPerPage);
this.keepPages=Math.max(Math.ceil(this.keepRows/this.rowsPerPage),2);
this.invalidate();
if(this.scrollboxNode){
this.scrollboxNode.scrollTop=0;
this.scroll(0);
this.scrollboxNode.onscroll=turbo.bind(this,"onscroll");
}
},invalidate:function(){
this.invalidateNodes();
this.pageHeights=[];
this.height=(this.pageCount?(this.pageCount-1)*this.defaultPageHeight+this.calcLastPageHeight():0);
this.resize();
},updateRowCount:function(_4){
this.invalidateNodes();
this.rowCount=_4;
oldPageCount=this.pageCount;
this.pageCount=Math.ceil(this.rowCount/this.rowsPerPage);
if(this.pageCount<oldPageCount){
for(var i=oldPageCount-1;i>=this.pageCount;i--){
this.height-=this.getPageHeight(i);
delete this.pageHeights[i];
}
}else{
if(this.pageCount>oldPageCount){
this.height+=this.defaultPageHeight*(this.pageCount-oldPageCount-1)+this.calcLastPageHeight();
}
}
this.resize();
},pageExists:function(_6){
},measurePage:function(_7){
},positionPage:function(_8,_9){
},repositionPages:function(_a){
},installPage:function(_b){
},preparePage:function(_c,_d,_e){
},renderPage:function(_f){
},removePage:function(_10){
},pacify:function(_11){
},pacifying:false,pacifyTicks:200,setPacifying:function(_12){
if(this.pacifying!=_12){
this.pacifying=_12;
this.pacify(this.pacifying);
}
},startPacify:function(){
this.startPacifyTicks=new Date().getTime();
},doPacify:function(){
var _13=(new Date().getTime()-this.startPacifyTicks)>this.pacifyTicks;
this.setPacifying(true);
this.startPacify();
return _13;
},endPacify:function(){
this.setPacifying(false);
},resize:function(){
if(this.scrollboxNode){
this.windowHeight=this.scrollboxNode.clientHeight;
}
turbo.setStyleHeightPx(this.contentNode,this.height);
},calcLastPageHeight:function(){
if(!this.pageCount){
return 0;
}
var _14=this.pageCount-1;
var _15=((this.rowCount%this.rowsPerPage)||(this.rowsPerPage))*this.defaultRowHeight;
this.pageHeights[_14]=_15;
return _15;
},updateContentHeight:function(_16){
this.height+=_16;
this.resize();
},updatePageHeight:function(_17){
if(this.pageExists(_17)){
var oh=this.getPageHeight(_17);
var h=(this.measurePage(_17))||(oh);
this.pageHeights[_17]=h;
if((h)&&(oh!=h)){
this.updateContentHeight(h-oh);
this.repositionPages(_17);
}
}
},rowHeightChanged:function(_1a){
this.updatePageHeight(Math.floor(_1a/this.rowsPerPage));
},invalidateNodes:function(){
while(this.stack.length){
this.destroyPage(this.popPage());
}
},createPageNode:function(){
var p=document.createElement("div");
p.style.position="absolute";
p.style.left="0";
return p;
},getPageHeight:function(_1c){
var ph=this.pageHeights[_1c];
return (ph!==undefined?ph:this.defaultPageHeight);
},pushPage:function(_1e){
return this.stack.push(_1e);
},popPage:function(){
return this.stack.shift();
},findPage:function(_1f){
var i=0,h=0;
for(var ph=0;i<this.pageCount;i++,h+=ph){
ph=this.getPageHeight(i);
if(h+ph>=_1f){
break;
}
}
this.page=i;
this.pageTop=h;
},buildPage:function(_23,_24,_25){
this.preparePage(_23,_24);
this.positionPage(_23,_25);
this.installPage(_23);
this.renderPage(_23);
this.pushPage(_23);
},needPage:function(_26,_27){
var h=this.getPageHeight(_26),oh=h;
if(!this.pageExists(_26)){
this.buildPage(_26,(this.keepPages)&&(this.stack.length>=this.keepPages),_27);
h=this.measurePage(_26)||h;
this.pageHeights[_26]=h;
if(h&&(oh!=h)){
this.updateContentHeight(h-oh);
}
}else{
this.positionPage(_26,_27);
}
return h;
},onscroll:function(){
this.scroll(this.scrollboxNode.scrollTop);
},scroll:function(_2a){
this.startPacify();
this.findPage(_2a);
var h=this.height;
var b=this.getScrollBottom(_2a);
for(var p=this.page,y=this.pageTop;(p<this.pageCount)&&((b<0)||(y<b));p++){
y+=this.needPage(p,y);
}
this.firstVisibleRow=this.getFirstVisibleRow(this.page,this.pageTop,_2a);
this.lastVisibleRow=this.getLastVisibleRow(p-1,y,b);
if(h!=this.height){
this.repositionPages(p-1);
}
this.endPacify();
},getScrollBottom:function(_2f){
return (this.windowHeight>=0?_2f+this.windowHeight:-1);
},processNodeEvent:function(e,_31){
var t=e.target;
while(t&&(t!=_31)&&t.parentNode&&(t.parentNode.parentNode!=_31)){
t=t.parentNode;
}
if(!t||!t.parentNode||(t.parentNode.parentNode!=_31)){
return false;
}
var _33=t.parentNode;
e.topRowIndex=_33.pageIndex*this.rowsPerPage;
e.rowIndex=e.topRowIndex+turbo.indexInParent(t);
e.rowTarget=t;
return true;
},processEvent:function(e){
return this.processNodeEvent(e,this.contentNode);
},dummy:0});
dojo.declare("turbo.scroller",turbo.scroller.base,function(){
this.pageNodes=[];
},{renderRow:function(_35,_36){
},removeRow:function(_37){
},getDefaultNodes:function(){
return this.pageNodes;
},getDefaultPageNode:function(_38){
return this.getDefaultNodes()[_38];
},positionPageNode:function(_39,_3a){
_39.style.top=_3a+"px";
},getPageNodePosition:function(_3b){
return _3b.offsetTop;
},repositionPageNodes:function(_3c,_3d){
var _3e=0;
for(var i=0;i<this.stack.length;i++){
_3e=Math.max(this.stack[i],_3e);
}
var n=_3d[_3c];
var y=(n?this.getPageNodePosition(n)+this.getPageHeight(_3c):0);
for(var p=_3c+1;p<=_3e;p++){
n=_3d[p];
if(n){
if(this.getPageNodePosition(n)==y){
return;
}
this.positionPage(p,y);
}
y+=this.getPageHeight(p);
}
},invalidatePageNode:function(_43,_44){
var p=_44[_43];
if(p){
delete _44[_43];
this.removePage(_43,p);
turbo.clean(p);
p.innerHTML="";
}
return p;
},preparePageNode:function(_46,_47,_48){
var p=(_47===null?this.createPageNode():this.invalidatePageNode(_47,_48));
p.pageIndex=_46;
p.id="page-"+_46;
_48[_46]=p;
},pageExists:function(_4a){
return Boolean(this.getDefaultPageNode(_4a));
},measurePage:function(_4b){
return this.getDefaultPageNode(_4b).offsetHeight;
},positionPage:function(_4c,_4d){
this.positionPageNode(this.getDefaultPageNode(_4c),_4d);
},repositionPages:function(_4e){
this.repositionPageNodes(_4e,this.getDefaultNodes());
},preparePage:function(_4f,_50){
this.preparePageNode(_4f,(_50?this.popPage():null),this.getDefaultNodes());
},installPage:function(_51){
this.contentNode.appendChild(this.getDefaultPageNode(_51));
},destroyPage:function(_52){
var p=this.invalidatePageNode(_52,this.getDefaultNodes());
turbo.remove(p);
},renderPage:function(_54){
var _55=this.pageNodes[_54];
for(var i=0,j=_54*this.rowsPerPage;(i<this.rowsPerPage)&&(j<this.rowCount);i++,j++){
this.renderRow(j,_55);
}
},removePage:function(_58){
for(var i=0,j=_58*this.rowsPerPage;i<this.rowsPerPage;i++,j++){
this.removeRow(j);
}
},getPageRow:function(_5b){
return _5b*this.rowsPerPage;
},getLastPageRow:function(_5c){
return Math.min(this.rowCount,this.getPageRow(_5c+1))-1;
},getFirstVisibleRowNodes:function(_5d,_5e,_5f,_60){
var row=this.getPageRow(_5d);
var _62=turbo.divkids(_60[_5d]);
for(var i=0,l=_62.length;i<l&&_5e<_5f;i++,row++){
_5e+=_62[i].offsetHeight;
}
return (row?row-1:row);
},getFirstVisibleRow:function(_65,_66,_67){
if(!this.pageExists(_65)){
return 0;
}
return this.getFirstVisibleRowNodes(_65,_66,_67,this.getDefaultNodes());
},getLastVisibleRowNodes:function(_68,_69,_6a,_6b){
var row=this.getLastPageRow(_68);
var _6d=turbo.divkids(_6b[_68]);
for(var i=_6d.length-1;i>=0&&_69>_6a;i--,row--){
_69-=_6d[i].offsetHeight;
}
return row+1;
},getLastVisibleRow:function(_6f,_70,_71){
if(!this.pageExists(_6f)){
return 0;
}
return this.getLastVisibleRowNodes(_6f,_70,_71,this.getDefaultNodes());
},findTopRowForNodes:function(_72,_73){
var _74=turbo.divkids(_73[this.page]);
for(var i=0,l=_74.length,t=this.pageTop,h;i<l;i++){
h=_74[i].offsetHeight;
t+=h;
if(t>=_72){
this.offset=h-(t-_72);
return i+this.page*this.rowsPerPage;
}
}
return -1;
},findScrollTopForNodes:function(_79,_7a){
var _7b=Math.floor(_79/this.rowsPerPage);
var t=0;
for(var i=0;i<_7b;i++){
t+=this.getPageHeight(i);
}
this.pageTop=t;
this.needPage(_7b,this.pageTop);
var _7e=turbo.divkids(_7a[_7b]);
var r=_79-this.rowsPerPage*_7b;
for(var i=0,l=_7e.length;i<l&&i<r;i++){
t+=_7e[i].offsetHeight;
}
return t;
},findTopRow:function(_81){
return this.findTopRowForNodes(_81,this.getDefaultNodes());
},findScrollTop:function(_82){
return this.findScrollTopForNodes(_82,this.getDefaultNodes());
},dummy:0});
dojo.declare("turbo.scroller.columns",turbo.scroller,function(_83){
this.setContentNodes(_83);
},{setContentNodes:function(_84){
this.contentNodes=_84;
this.colCount=(this.contentNodes?this.contentNodes.length:0);
this.pageNodes=[];
for(var i=0;i<this.colCount;i++){
this.pageNodes[i]=[];
}
},getDefaultNodes:function(){
return this.pageNodes[0]||[];
},scroll:function(_86){
if(this.colCount){
turbo.scroller.prototype.scroll.call(this,_86);
}
},resize:function(){
if(this.scrollboxNode){
this.windowHeight=this.scrollboxNode.clientHeight;
}
for(var i=0;i<this.colCount;i++){
turbo.setStyleHeightPx(this.contentNodes[i],this.height);
}
},positionPage:function(_88,_89){
for(var i=0;i<this.colCount;i++){
this.positionPageNode(this.pageNodes[i][_88],_89);
}
},preparePage:function(_8b,_8c){
var p=(_8c?this.popPage():null);
for(var i=0;i<this.colCount;i++){
this.preparePageNode(_8b,p,this.pageNodes[i]);
}
},installPage:function(_8f){
for(var i=0;i<this.colCount;i++){
this.contentNodes[i].appendChild(this.pageNodes[i][_8f]);
}
},destroyPage:function(_91){
for(var i=0;i<this.colCount;i++){
turbo.remove(this.invalidatePageNode(_91,this.pageNodes[i]));
}
},renderPage:function(_93){
var _94=[];
for(var i=0;i<this.colCount;i++){
_94[i]=this.pageNodes[i][_93];
}
for(var i=0,j=_93*this.rowsPerPage;(i<this.rowsPerPage)&&(j<this.rowCount);i++,j++){
this.renderRow(j,_94);
}
}});
dojo.provide("turbo.data.fields");
turbo.data.mixer=function(){
this.defaultValue={};
this.values=[];
this.count=function(){
return this.values.length;
};
this.clear=function(){
this.values=[];
};
this.build=function(_97){
var _98=turbo.swiss(this.defaultValue,{owner:this});
_98.key=_97;
this.values[_97]=_98;
return _98;
};
this.getDefault=function(){
return this.defaultValue;
};
this.setDefault=function(_99){
for(var i=0,l=arguments.length;i<l;i++){
turbo.swiss(arguments[i]||{},this.defaultValue);
}
};
this.get=function(_9c){
return (this.values[_9c]||this.build(_9c));
};
this._set=function(_9d,_9e){
var v=this.get(_9d);
for(var i=1;i<arguments.length;i++){
turbo.swiss(arguments[i],v);
}
this.values[_9d]=v;
};
this.set=function(){
if(arguments.length<1){
return;
}
var a=arguments[0];
if(!dojo.lang.isArray(a)){
this._set.apply(this,arguments);
}else{
if(a.length&&a[0]["default"]){
this.setDefault(a.shift());
}
for(var i=0,l=a.length;i<l;i++){
this._set(i,a[i]);
}
}
};
this.insert=function(_a4,_a5){
if(_a4>=this.values.length){
this.values[_a4]=_a5;
}else{
this.values.splice(_a4,0,_a5);
}
};
this.remove=function(_a6){
this.values.splice(_a6,1);
};
this.swap=function(_a7,_a8){
turbo.arraySwap(this.values,_a7,_a8);
};
this.move=function(_a9,_aa){
turbo.arrayMove(this.values,_a9,_aa);
};
};
turbo.data.field=function(_ab){
this.name=_ab;
this.compare=turbo.data.compare;
this.na="...";
};
turbo.data.fields=function(_ac){
turbo.data.mixer.call(this);
var _ad=(_ac?_ac:turbo.data.field);
this.defaultValue=new _ad();
};
turbo.data.compare=function(a,b){
return (a>b?1:(a==b?0:-1));
};
turbo.data.generateComparator=function(_b0,_b1,_b2){
return function(a,b){
var c=Math.abs(_b1)-1;
var _b6=_b0(a[c],b[c]);
return (_b6?(_b1>0?_b6:-_b6):(_b2&&_b2(a,b)));
};
};
dojo.provide("turbo.data.model");
dojo.require("turbo.data.fields");
dojo.declare("turbo.data.model",null,function(_b7,_b8){
this.fields=new turbo.data.fields();
if(_b7){
this.fields.set(_b7);
}
this.set(_b8);
},{count:0,updating:0,observe:function(_b9,_ba,_bb,_bc){
dojo.event[_bc?"disconnect":"connect"](this,_b9,_ba,_bb);
},unobserve:function(_bd,_be,_bf){
this.observe(_bd,_be,_bf,true);
},clear:function(){
this.fields.clear();
this.clearData();
},beginUpdate:function(){
this.updating++;
},endUpdate:function(){
if(this.updating){
this.updating--;
if(!this.updating){
this.change();
}
}
},isUpdating:function(){
return Boolean(this.updating);
},clearData:function(){
this.set(null);
},change:function(){
},insertion:function(){
},removal:function(){
},_get:function(){
},_set:function(_c0){
},_setData:function(){
},_update:function(_c1,_c2){
return false;
},_insert:function(_c3){
return false;
},_remove:function(){
return false;
},get:function(){
return this._get.apply(this,arguments);
},set:function(_c4){
this._set.apply(this,arguments);
this.change.apply(this,turbo.cloneArguments(arguments,1));
return true;
},compare:function(_c5,_c6){
return turbo.arrayCompare(_c5,_c6);
},modify:function(_c7,_c8){
if(!this.compare(_c7,_c8)){
this.update.apply(this,arguments);
}
},update:function(_c9,_ca,_cb){
return this.defaultUpdate.apply(this,arguments);
},defaultUpdate:function(_cc,_cd){
if(!this._update.apply(this,arguments)){
return false;
}
this.change.apply(this,turbo.cloneArguments(arguments,2));
},insert:function(_ce){
return this.defaultInsert.apply(this,arguments);
},defaultInsert:function(_cf){
if(!this._insert.apply(this,arguments)){
return false;
}
this.insertion.apply(this,turbo.cloneArguments(arguments,1));
return true;
},remove:function(_d0){
return this.defaultRemove.apply(this,arguments);
},defaultRemove:function(){
if(!this._remove.apply(this,arguments)){
return false;
}
this.removal.apply(this,arguments);
return true;
},canSort:function(){
return this.sort!=null;
},sort:null,dummy:0});
dojo.declare("turbo.data.table",turbo.data.model,function(){
this.cache=[];
},{colCount:0,data:null,cache:null,measure:function(){
this.count=this.getRowCount();
this.colCount=this.getColCount();
},getRowCount:function(){
return (this.data?this.data.length:0);
},getColCount:function(){
return (this.data&&this.data.length?this.data[0].length:this.fields.count());
},badIndex:function(_d1,_d2){
turbo.debugf("%s.%s: bad index (%d, %d)",this.className,_d1,_d2[0],(_d2[1]||"n/a"));
},isGoodIndex:function(_d3,_d4){
return (_d3>=0&&_d3<this.count&&(arguments.length<2||(_d4>=0&&_d4<this.colCount)));
},_get:function(_d5,_d6){
var row=this.data[_d5];
return (_d6==undefined?row:row[_d6]);
},_setData:function(_d8){
this.data=(_d8||[]);
},_setRow:function(_d9,_da){
this.data[_da]=_d9;
},_setCell:function(_db,_dc,_dd){
this.data[_dc][_dd]=_db;
},setters:["_setData","_setData","_setRow","_setCell"],_set:function(_de,_df,_e0){
this[this.setters[arguments.length]].apply(this,arguments);
},setRows:function(_e1,_e2){
for(var i=0,l=_e1.length,r=_e2;i<l;i++,r++){
this.set(_e1[i],r);
}
},beginModifyRow:function(_e6){
if(!this.cache[_e6]){
this.cache[_e6]=turbo.arrayDup(this.get(_e6));
}
},endModifyRow:function(_e7){
var _e8=this.cache[_e7];
if(_e8){
var _e9=this.get(_e7);
if(!turbo.arrayCompare(_e8,_e9)){
this.modify(_e8,_e9,_e7);
}
}
},_update:function(_ea,_eb,_ec){
this._set(_eb,_ec);
delete this.cache[_ec];
return true;
},_insert:function(_ed,_ee){
turbo.arrayInsert(this.data,_ee,_ed);
this.count++;
return true;
},_remove:function(_ef){
for(var i=_ef.length-1;i>=0;i--){
turbo.arrayRemove(this.data,_ef[i]);
}
this.count-=_ef.length;
return true;
},makeComparator:function(_f1){
var _f2=null;
for(var i=_f1.length-1,col;i>=0;i--){
col=Math.abs(_f1[i])-1;
if(col>=0){
_f2=turbo.data.generateComparator(this.fields.get(col).compare,_f1[i],_f2);
}
}
return _f2;
},sort:function(){
this.data.sort(this.makeComparator(arguments));
},swap:function(_f5,_f6){
turbo.arraySwap(this.data,_f5,_f6);
this.change(_f5);
this.change(_f6);
},dummy:0});
dojo.declare("turbo.data.dynamic",turbo.data.table,function(){
this.page=[];
this.pages=[];
},{page:null,pages:null,rowsPerPage:100,requests:0,bop:-1,eop:-1,clearData:function(){
this.pages=[];
this.bop=this.eop=-1;
this.set([]);
},getRowCount:function(){
return this.count;
},getColCount:function(){
return this.fields.count();
},setRowCount:function(_f7){
this.count=_f7;
this.change();
},requestsPending:function(_f8){
},rowToPage:function(_f9){
return (this.rowsPerPage?Math.floor(_f9/this.rowsPerPage):_f9);
},pageToRow:function(_fa){
return (this.rowsPerPage?this.rowsPerPage*_fa:_fa);
},requestRows:function(_fb,_fc){
},rowsProvided:function(_fd,_fe){
this.requests--;
if(this.requests==0){
this.requestsPending(false);
}
},requestPage:function(_ff){
var row=this.pageToRow(_ff);
var _101=Math.min(this.rowsPerPage,this.count-row);
if(_101>0){
this.requests++;
this.requestsPending(true);
turbo.defer(this,"requestRows",row,_101,1);
}
},needPage:function(_102){
if(!this.pages[_102]){
this.pages[_102]=true;
this.requestPage(_102);
}
},preparePage:function(_103,_104){
if(_103<this.bop||_103>=this.eop){
var _105=this.rowToPage(_103);
this.needPage(_105);
this.bop=_105*this.rowsPerPage;
this.eop=this.bop+(this.rowsPerPage||this.count);
}
},isRowLoaded:function(_106){
return Boolean(this.data[_106]);
},getRow:function(_107){
var row=this.data[_107];
if(!row){
this.preparePage(_107);
}
return row;
},_get:function(_109,_10a){
var row=this.getRow(_109);
return (_10a==undefined?row:(row?row[_10a]:this.fields.get(_10a).na));
},_setCell:function(_10c,_10d,_10e){
var row=this.getRow(_10d);
if(!row){
turbo.debugf("[%s] turbo.data.dynamic.set: cannot set data on an unloaded row",this.declaredClass);
}
if(row){
row[_10e]=_10c;
}
},canSort:function(){
return false;
}});
dojo.provide("turbo.widgets.TurboGrid.builder");
dojo.declare("turbo.grid.builderBase",null,function(_110){
this.grid=_110;
},{isCellNode:function(_111){
return (_111)&&(_111.getAttribute)&&(Boolean(_111.getAttribute(turbo.grid.CELL_INDEX_TAG)));
},getCellNodeIndex:function(_112){
return (_112?Number(_112.getAttribute(turbo.grid.CELL_INDEX_TAG)):-1);
},getCellNode:function(_113,_114){
for(var i=0,row;row=turbo.getTableRow(_113.firstChild,i);i++){
for(var j=0,cell;cell=row.cells[j];j++){
if(this.getCellNodeIndex(cell)==_114){
return cell;
}
}
}
},findTarget:function(_119,_11a){
var n=_119;
while((n)&&(!this.isCellNode(n))&&(n!=_11a)){
n=n.parentNode;
}
return ((n!=_11a)?n:null);
},decorateEvent:function(e){
e.cellNode=this.findTarget(e.target,e.rowNode);
e.cellIndex=this.getCellNodeIndex(e.cellNode);
return true;
}});
dojo.declare("turbo.grid.builder",turbo.grid.builderBase,{});
turbo.grid.CELL_INDEX_TAG="idx";
dojo.provide("turbo.widgets.TurboGrid.header");
dojo.require("turbo.widgets.TurboGrid.builder");
dojo.require("turbo.lib.drag");
ascendDom=function(_11d,_11e){
var n=_11d;
while(n&&_11e(n)){
n=n.parentNode;
}
return n;
};
mkNotNode=function(_120){
return function(n){
return n!=isNode;
};
};
mkNotTagName=function(_122){
return function(n){
return turbo.getTagName(n)!=_122;
};
};
getProp=function(_124,_125){
return (_124)&&(_124[_125])||null;
};
dojo.declare("turbo.grid.header",turbo.grid.builderBase,function(){
},{bogusClickTime:0,overResizeWidth:4,getCellNode:function(_126,_127){
turbo.grid.header.superclass.getCellNode.apply(this,[_126.headerContentNode,_127]);
},getCellX:function(e){
var x=e.layerX;
if((dojo.render.html.moz)){
x-=getProp(ascendDom(e.target,mkNotTagName("td")),"offsetLeft")||0;
}
var n=ascendDom(e.target,function(){
if(!n||n==e.cellNode){
return false;
}
x+=(n.offsetLeft<0?0:n.offsetLeft);
return true;
});
return x;
},decorateEvent:function(e){
if(turbo.drag.dragging){
return true;
}
if((e.type=="click")&&(turbo.time()<this.bogusClickTime)){
return true;
}
if(!turbo.grid.header.superclass.decorateEvent.apply(this,arguments)){
return false;
}
e.cellX=this.getCellX(e);
e.cell=e.sourceView.layout.getCell(e.cellIndex);
return true;
},dispatchEvent:function(e){
if(e.dispatch in this){
return this[e.dispatch](e);
}
},prepareLeftResize:function(e){
var i=turbo.getCellIndex(e.cellNode);
e.cellNode=(i?e.cellNode.parentNode.cells[i-1]:null);
e.cellIndex=(e.cellNode?this.getCellNodeIndex(e.cellNode):-1);
return Boolean(e.cellNode);
},canResize:function(e){
if((!e.cellNode)||(e.cellNode.colSpan>1)){
return false;
}
var _130=e.sourceView.layout.getCell(e.cellIndex);
return (!_130.noresize)&&(!turbo.grid.layout.isFlexColumn(_130));
},overLeftResizeArea:function(e){
return (e.cellIndex>0)&&(e.cellX<this.overResizeWidth)&&(this.prepareLeftResize(e));
},overRightResizeArea:function(e){
return (e.cellNode)&&(e.cellX>=e.cellNode.offsetWidth-this.overResizeWidth);
},domousemove:function(e){
var c=(this.overRightResizeArea(e)?"e-resize":(this.overLeftResizeArea(e)?"w-resize":""));
if((c)&&(!this.canResize(e))){
c="not-allowed";
}
e.sourceView.headerNode.style.cursor=c||"";
},domousedown:function(e){
if(!turbo.drag.dragging){
if((this.overRightResizeArea(e)||this.overLeftResizeArea(e))&&this.canResize(e)){
this.beginColumnResize(e);
}
}
},beginColumnResize:function(e){
turbo.killEvent(e);
var _137=[],_138=e.sourceView.layout.tableMap.findOverlappingNodes(e.cellNode);
for(var i=0,cell;cell=_138[i];i++){
_137.push({node:cell,index:this.getCellNodeIndex(cell),width:cell.offsetWidth});
}
var drag={view:e.sourceView,node:e.cellNode,index:e.cellIndex,w:e.cellNode.clientWidth,spanners:_137};
turbo.drag.start(e.cellNode,turbo.bindArgs(this,"doResizeColumn",drag),turbo.bindArgs(this,"endResizeColumn",drag),e);
},minColWidth:1,doResizeColumn:function(_13c,_13d){
var w=_13c.w+_13d.deltaX;
if(w>=this.minColWidth){
for(var i=0,s,sw;(s=_13c.spanners[i]);i++){
sw=s.width+_13d.deltaX;
s.node.style.width=sw+"px";
_13c.view.setColWidth(s.index,sw);
}
_13c.node.style.width=w+"px";
_13c.view.setColWidth(_13c.index,w);
}
if(_13c.view.layout.flexColumns){
if(_13c.view.layout.testFlexColumns()==false){
var t=turbo.getTable(_13c.node);
(t)&&(t.style.width="");
}
}
},endResizeColumn:function(_143){
this.bogusClickTime=turbo.time()+30;
turbo.defer(_143.view,"update",50);
}});
dojo.provide("turbo.widgets.TurboGrid.layout");
dojo.declare("turbo.grid.layout",null,function(_144){
this.view=_144;
this.dataRow={index:-1};
},{defaultWidth:"6em",view:null,viewDef:null,cells:[],rows:null,tableMap:null,dataRow:null,flexColumns:false,setViewDef:function(_145,_146){
this.viewDef=_145;
this.contextNode=_146;
if((_145)&&(_145.cells)){
this._loadDef();
}
},_loadDef:function(){
this.prepareRows();
this.tableMap=new turbo.grid.tableMap(this.rows);
this.update();
},getCell:function(_147){
return this.cells[_147];
},update:function(){
if(!this.rows){
return;
}
this.testFlexColumns();
this.prepareHtml();
},prepareRows:function(){
this.cells=[];
this.rows=[];
var _148={view:this.view,grid:this.view.grid,getCellNode:this.cellGetCellNode,getContentNode:this.cellGetContentNode};
dojo.lang.mixin(_148,this.viewDef.defaultCell||{});
var _149=this.viewDef.subrows;
for(var j=0,k=0,row,_14d;(_14d=_149[j]);j++){
row=[];
row.def=_14d;
row.viewDef=this.viewDef;
row.index=j;
for(var i=0,cell,w,c;(cell=_14d[i]);i++,k++){
if(cell.colSpan>1){
w=0;
}else{
if(!isNaN(cell.width)){
w=cell.width+"em";
}else{
w=(cell.width)||(this.defaultWidth);
}
}
c=dojo.lang.mixin({},_148,cell,{subrow:row,layoutIndex:k,def:cell,unitWidth:w,styles:cell.styles||""});
this.cells.push(c);
row.push(c);
}
this.rows.push(row);
}
this.cellCount=this.cells.length;
},testFlexColumns:function(){
this.flexColumns=false;
for(var j=0,row;(row=this.rows[j]);j++){
for(var i=0,cell;(cell=row[i]);i++){
if(turbo.grid.layout.isFlexColumn(cell)){
this.flexColumns=true;
break;
}
}
}
return this.flexColumns;
},cellGetCellNode:function(_156){
return this.view.getCellNode(_156,this.layoutIndex);
},cellGetContentNode:function(_157){
return this.getCellNode(_157);
},generateCellMarkup:function(_158,_159,_15a){
var _15b=[];
var html=["<td"];
(_158.colSpan)&&(html.push(" colspan=\"",_158.colSpan,"\""));
(_158.rowSpan)&&(html.push(" rowspan=\"",_158.rowSpan,"\""));
html.push(" class=\"");
(_158.classes)&&(html.push(_158.classes," "));
(_15a)&&(html.push(_15a," "));
_15b.push(html.join(""));
_15b.push("");
html=["turbogrid-cell\" idx=\"",_158.layoutIndex,"\" style=\""];
html.push(_158.styles,_159||"");
(_158.unitWidth)&&(html.push("width:",_158.unitWidth,";"));
_15b.push(html.join(""));
_15b.push("");
html=["\""];
(_158.attrs)&&(html.push(" ",_158.attrs));
html.push(">");
_15b.push(html.join(""));
_15b.push("");
_15b.push("</td>");
return _15b;
},generateHeaderTable:function(_15d,_15e){
this.dataRow.index=-1;
(this.viewDef.onBeforeRow)&&(this.viewDef.onBeforeRow(-1,this.rows));
var html=["<table class=\"turbogrid-row-table\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"];
for(var j=0,row;(row=this.rows[j]);j++){
if(row.hidden){
continue;
}
html.push("<tr>");
for(var i=0,cell,_164;(cell=row[i]);i++){
cell.customClasses="";
cell.customStyles="";
_164=this.generateCellMarkup(cell,cell.headerStyles,cell.headerClasses);
_164[5]=(_15e!=undefined?_15e:_15d(this.dataRow,cell));
_164[3]=(cell.customStyles)||("");
_164[1]=(cell.customClasses?" "+cell.customClasses:"");
html.push(_164.join(""));
}
html.push("</tr>");
}
html.push("</table>");
return html.join("");
},prepareHtml:function(){
var _165=this.view.grid.get;
for(var j=0,row;(row=this.rows[j]);j++){
for(var i=0,cell;(cell=row[i]);i++){
cell.get=cell.get||_165;
cell.markup=this.generateCellMarkup(cell,cell.cellStyles,cell.cellClasses);
cell.customClasses=cell.customStyles="";
}
}
},generateDataTable:function(_16a,_16b){
this.dataRow.index=_16a;
(this.view.onBeforeRow)&&(this.view.onBeforeRow(_16a,this.rows));
var html=["<table class=\"turbogrid-row-table\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"];
for(var j=0,row;(row=this.rows[j]);j++){
if(row.hidden){
continue;
}
html.push("<tr>");
for(var i=0,cell;(cell=row[i]);i++){
with(cell){
customClasses="";
customStyles="";
markup[5]=(cell.get)&&(get(this.dataRow,cell))||(cell.value);
markup[1]=(customClasses?" "+customClasses:"");
markup[3]=customStyles;
html.push.apply(html,markup);
}
}
html.push("</tr>");
}
html.push("</table>");
return html.join("");
}});
turbo.grid.layout.isFlexColumn=function(_171){
return ((_171.unitWidth)&&((_171.unitWidth=="auto")||(_171.unitWidth.slice(-1)=="%")));
};
dojo.declare("turbo.grid.tableMap",null,function(_172){
this.mapRows(_172);
},{map:null,mapRows:function(_173){
var _174=_173.length;
var _175=0,row=_173[0];
for(var i=0,cell;(cell=row[i]);i++){
_175+=(cell.def.colSpan)||(1);
}
this.map=[];
for(var j=0,row;(row=_173[j]);j++){
this.map[j]=[];
}
for(var j=0,row;(row=_173[j]);j++){
for(var i=0,x=0,cell,_17b,_17c;(cell=row[i]);i++){
while(this.map[j][x]){
x++;
}
this.map[j][x]={c:i,r:j};
_17c=(cell.def.rowSpan)||(1);
_17b=(cell.def.colSpan)||(1);
for(var y=0;y<_17c;y++){
for(var s=0;s<_17b;s++){
this.map[j+y][x+s]=this.map[j][x];
}
}
x+=_17b;
}
}
if(0){
for(var j=0,row;(row=this.map[j]);j++){
var h="";
for(var i=0,cell;(cell=row[i]);i++){
h+=cell.r+","+cell.c+"   ";
}
console.log(h);
}
}
},getMapCoords:function(_180,_181){
for(var j=0,row;(row=this.map[j]);j++){
for(var i=0,cell;(cell=row[i]);i++){
if((cell.c==_181)&&(cell.r==_180)){
return {j:j,i:i};
}
}
}
return {j:-1,i:-1};
},getNode:function(_186,_187,_188){
var row=(_186)&&(_186.rows[_187]);
return (row)&&(row.cells[_188]);
},_findOverlappingNodes:function(_18a,_18b,_18c){
var _18d=[];
var m=this.getMapCoords(_18b,_18c);
var row=this.map[m.j];
for(var j=0,row;(row=this.map[j]);j++){
if(j==m.j){
continue;
}
with(row[m.i]){
var n=this.getNode(_18a,r,c);
if(n){
_18d.push(n);
}
}
}
return _18d;
},findOverlappingNodes:function(_192){
var r=turbo.getRowIndex(_192.parentNode);
var c=turbo.getCellIndex(_192);
return this._findOverlappingNodes(turbo.getTable(_192),r,c);
}});
dojo.provide("turbo.widgets.TurboGrid.view");
dojo.require("turbo.widgets.TurboGrid.builder");
dojo.require("turbo.widgets.TurboGrid.header");
dojo.require("turbo.widgets.TurboGrid.layout");
turbo.grid.rowIndexTag="gridRowIndex";
dojo.widget.defineWidget("dojo.widget.TurboGridView",dojo.widget.html.TurboWidget,function(){
this.rowNodes=[];
},{defaultWidth:"18em",viewWidth:"",templateString:"<div class=\"turbogrid-view\"><div class=\"turbogrid-header\" dojoAttachPoint=\"headerNode\"><div style=\"width: 9000em\"><div dojoAttachPoint=\"headerContentNode\"></div></div></div><div class=\"turbogrid-scrollbox\" dojoAttachPoint=\"scrollboxNode\"><div class=\"turbogrid-content\" dojoAttachPoint=\"contentNode\" hidefocus=\"hidefocus\"></div></div></div>",themeable:false,classTag:"turbogrid",colCount:0,cells:null,marginBottom:0,rowPad:2,viewDef:null,fillInTemplate:function(){
dojo.event.browser.addListener(this.scrollboxNode,"onscroll",turbo.bind(this,"doscroll"));
turbo.funnelEvents(this.contentNode,this,"doContentEvent",["mouseover","mouseout","click","dblclick","contextmenu"]);
turbo.funnelEvents(this.headerNode,this,"doHeaderEvent",["dblclick","mouseover","mouseout","mousemove","mousedown","click","contextmenu"]);
this.layout=new turbo.grid.layout(this);
dojo.html.disableSelection(this.contentNode);
},destroy:function(){
turbo.remove(this.headerNode);
this.inherited("destroy");
},setViewDef:function(_195){
_195.cells=_195.subrows=_195.subrows||_195.cells;
this.viewDef=_195;
if((_195.width)&&(dojo.lang.isNumber(_195.width))){
this.viewWidth=_195.width+"em";
}else{
this.viewWidth=_195.width||this.viewWidth;
}
this.colCount=0;
this.cells=_195.cells||_195.subrows;
if(this.cells){
for(var i=0,r;(r=this.cells[i]);i++){
for(var j=0,c;(c=r[j]);j++,this.colCount++){
}
}
}
this.onBeforeRow=_195.onBeforeRow;
this.layout.setViewDef(_195,this.contentNode);
this.noscroll=_195.noscroll;
if(this.noscroll){
this.scrollboxNode.style.overflow="hidden";
}
},getScrollbarWidth:function(){
return (this.noscroll?0:turbo.getScrollbarWidth());
},getColumnsWidth:function(){
return this.headerContentNode.firstChild.offsetWidth;
},getWidth:function(){
return (this.viewWidth)||((this.getColumnsWidth()+this.getScrollbarWidth())+"px");
},getContentWidth:function(){
return Math.max(0,dojo.html.getContentBox(this.domNode).width-this.getScrollbarWidth())+"px";
},render:function(){
this.scrollboxNode.style.height="";
this.renderHeader();
},renderHeader:function(){
this.headerContentNode.innerHTML=this.layout.generateHeaderTable(this._getHeaderContent);
},_getHeaderContent:function(_19a,_19b){
var h=_19b.name;
if(_19b.index!=_19b.grid.getSortIndex()){
return h;
}
h=["<div class=\"","","\">",h,"</div>"];
if(_19b.grid.sortInfo>0){
h[1]="turbogrid-sort-down";
}else{
h[1]="turbogrid-sort-up";
}
return h.join("");
},resize:function(){
this.resizeHeight();
this.resizeWidth();
},hasScrollbar:function(){
return (this.scrollboxNode.clientHeight!=this.scrollboxNode.offsetHeight);
},resizeHeight:function(){
if(!this.grid.autoHeight){
var h=this.domNode.clientHeight;
if(!this.hasScrollbar()){
h-=turbo.getScrollbarWidth();
}
turbo.setStyleHeightPx(this.scrollboxNode,h);
}
},resizeWidth:function(){
if(this.layout.flexColumns){
this.contentWidth=this.getContentWidth();
this.headerContentNode.firstChild.style.width=this.contentWidth;
}
var w=this.scrollboxNode.offsetWidth-this.getScrollbarWidth();
w=Math.max(w,this.getColumnsWidth())+"px";
with(this.contentNode){
style.width="";
offsetWidth;
style.width=w;
}
},setSize:function(w,h){
with(this.domNode.style){
width=w;
height=(h>=0?h+"px":"");
}
with(this.headerNode.style){
width=w;
}
},renderRow:function(_1a1,_1a2){
var _1a3=this.createRowNode(_1a1);
this.buildRow(_1a1,_1a3,_1a2);
return _1a3;
},createRowNode:function(_1a4){
var node=document.createElement("div");
node.className=this.classTag+"-row";
node[turbo.grid.rowIndexTag]=_1a4;
this.rowNodes[_1a4]=node;
return node;
},buildRow:function(_1a6,_1a7){
this.buildRowContent(_1a6,_1a7);
this.styleRow(_1a6,_1a7);
},buildRowContent:function(_1a8,_1a9){
_1a9.innerHTML=this.layout.generateDataTable(_1a8);
if(this.layout.flexColumns){
_1a9.firstChild.style.width=this.contentWidth;
}
},rowRemoved:function(_1aa){
delete this.rowNodes[_1aa];
},getRowNode:function(_1ab){
return this.rowNodes[_1ab];
},getCellNode:function(_1ac,_1ad){
var row=this.getRowNode(_1ac);
return (row?this.grid.builder.getCellNode(row,_1ad):null);
},styleRow:function(_1af,_1b0){
_1b0._style=turbo.getStyleText(_1b0);
this.styleRowNode(_1af,_1b0);
},styleRowNode:function(_1b1,_1b2){
(_1b2)&&(this.doStyleRowNode(_1b1,_1b2));
},doStyleRowNode:function(_1b3,_1b4){
this.grid.styleRowNode(_1b3,_1b4,this.cells);
},updateRow:function(_1b5,_1b6,_1b7){
var _1b8=this.getRowNode(_1b5);
if(_1b8){
_1b8.style.height="";
this.buildRow(_1b5,_1b8);
}
return _1b8;
},updateRowStyles:function(_1b9){
this.styleRowNode(_1b9,this.getRowNode(_1b9));
},lastTop:0,doscroll:function(_1ba){
this.headerNode.scrollLeft=this.scrollboxNode.scrollLeft;
var top=this.scrollboxNode.scrollTop;
if(top!=this.lastTop){
this.grid.scrollTo(top);
}
},setScrollTop:function(_1bc){
this.lastTop=_1bc;
this.scrollboxNode.scrollTop=_1bc;
return this.scrollboxNode.scrollTop;
},findTarget:function(_1bd,_1be){
var n=_1bd;
while((n)&&!(_1be in n)&&(n!=this.domNode)){
n=n.parentNode;
}
return (n!=this.domNode?n:null);
},findRowTarget:function(_1c0){
return this.findTarget(_1c0,turbo.grid.rowIndexTag);
},isIntraNodeEvent:function(e){
try{
return (e.cellNode&&e.relatedTarget&&dojo.dom.isDescendantOf(e.relatedTarget,e.cellNode));
}
catch(x){
return false;
}
},isIntraRowEvent:function(e){
try{
var row=(e.relatedTarget)&&(this.findRowTarget(e.relatedTarget));
return (!row)&&(e.rowIndex==-1)||(row)&&(e.rowIndex==row.gridRowIndex);
}
catch(x){
return false;
}
},doContentEvent:function(e){
if(this.decorateContentEvent(e)){
this.grid.onContentEvent(e);
}
},doHeaderEvent:function(e){
if(this.decorateHeaderEvent(e)){
this.grid.onHeaderEvent(e);
}
},decorateEvent:function(e){
e.sourceView=this;
e.dispatch="do"+e.type;
},decorateContentEvent:function(e){
this.decorateEvent(e);
e.rowNode=this.findRowTarget(e.target);
if(!e.rowNode){
return false;
}
e.rowIndex=e.rowNode[turbo.grid.rowIndexTag];
this.grid.builder.decorateEvent(e);
e.cell=this.layout.getCell(e.cellIndex);
return true;
},decorateHeaderEvent:function(e){
this.decorateEvent(e);
e.rowIndex=-1;
return this.grid.header.decorateEvent(e);
},dispatchEvent:function(m,e){
if(m in this){
return this[m](e);
}
},dispatchContentEvent:function(e){
this.dispatchEvent(e.dispatch,e);
},dispatchHeaderEvent:function(e){
this.dispatchEvent(e.dispatch,e);
},domouseover:function(e){
if((e.cellNode)&&(e.cellNode!=this.lastOverCellNode)){
this.lastOverCellNode=e.cellNode;
this.grid.onMouseOver(e);
}
this.grid.onMouseOverRow(e);
},domouseout:function(e){
if((e.cellNode)&&(e.cellNode==this.lastOverCellNode)&&(!this.isIntraNodeEvent(e,this.lastOverCellNode))){
this.lastOverCellNode=null;
this.grid.onMouseOut(e);
if(!this.isIntraRowEvent(e)){
this.grid.onMouseOutRow(e);
}
}
},setColWidth:function(_1cf,_1d0){
var cell=this.layout.getCell(_1cf);
cell.unitWidth=_1d0+"px";
},update:function(){
var left=this.scrollboxNode.scrollLeft;
this.layout.update();
this.grid.update();
this.scrollboxNode.scrollLeft=left;
},focusClass:"turbogrid-cell-focus",borkNode:function(_1d3,_1d4,_1d5){
turbo.addRemoveClass(this.getCellNode(_1d3,_1d4),this.focusClass,_1d5);
},blurCell:function(_1d6,_1d7){
this.borkNode(_1d6,_1d7,false);
},focusCell:function(_1d8,_1d9){
this.borkNode(_1d8,_1d9,true);
}});
dojo.provide("turbo.widgets.TurboGrid.views");
dojo.declare("turbo.grid.views",null,function(_1da){
this.grid=_1da;
},{defaultWidth:200,views:[],resize:function(){
this.onEach("resize");
},render:function(){
this.onEach("render");
this.normalizeHeaderNodeHeight();
},addView:function(_1db){
_1db.idx=this.views.length;
this.views.push(_1db);
},destroyViews:function(){
for(var i=0,v;v=this.views[i];i++){
v.destroy();
}
this.views=[];
},getContentNodes:function(){
var _1de=[];
for(var i=0,v;v=this.views[i];i++){
_1de.push(v.contentNode);
}
return _1de;
},forEach:function(_1e1){
for(var i=0,v;v=this.views[i];i++){
_1e1(v,i);
}
},onEach:function(_1e4,_1e5){
_1e5=_1e5||[];
for(var i=0,v;v=this.views[i];i++){
if(_1e4 in v){
v[_1e4].apply(v,_1e5);
}
}
},normalizeHeaderNodeHeight:function(){
var _1e8=[];
for(var i=0,v;(v=this.views[i]);i++){
(v.headerContentNode.firstChild)&&(_1e8.push(v.headerContentNode));
}
this.normalizeRowNodeHeights(_1e8);
},normalizeRowNodeHeights:function(_1eb){
var h=0;
for(var i=0,n,o;(n=_1eb[i]);i++){
h=Math.max(h,(n.firstChild.clientHeight)||(n.firstChild.offsetHeight));
}
h=(h>=0?h:0)+"px";
for(var i=0,n;(n=_1eb[i]);i++){
n.firstChild.style.height=h;
}
(_1eb[0])&&(_1eb[0].parentNode.offsetHeight);
},renormalizeRow:function(_1f0){
var _1f1=[];
for(var i=0,v,n;(v=this.views[i])&&(n=v.getRowNode(_1f0));i++){
n.firstChild.style.height="";
_1f1.push(n);
}
this.normalizeRowNodeHeights(_1f1);
},getViewWidth:function(_1f5){
return this.views[_1f5].getWidth()||this.defaultWidth;
},measureHeader:function(){
this.forEach(function(_1f6){
_1f6.headerContentNode.style.height="";
});
var h=0;
this.forEach(function(_1f8){
h=Math.max(_1f8.headerNode.offsetHeight,h);
});
return h;
},measureContent:function(){
var h=0;
this.forEach(function(_1fa){
h=Math.max(_1fa.domNode.offsetHeight,h);
});
return h;
},findClient:function(_1fb){
var c=this.grid.elasticView||-1;
if(c<0){
for(var i=1,v;(v=this.views[i]);i++){
if(v.viewWidth){
for(i=1;(v=this.views[i]);i++){
if(!v.viewWidth){
c=i;
break;
}
}
break;
}
}
}
if(c<0){
c=Math.floor(this.views.length/2);
}
return c;
},_arrange:function(l,t,w,h){
var i,v,vw,len=this.views.length;
var c=(w<=0?len:this.findClient());
var _208=function(v,l,t){
with(v.domNode.style){
left=l+"px";
top=t+"px";
}
with(v.headerNode.style){
left=l+"px";
top=0;
}
};
for(i=0;(v=this.views[i])&&(i<c);i++){
vw=this.getViewWidth(i);
v.setSize(vw,h);
_208(v,l,t);
vw=v.domNode.offsetWidth;
l+=vw;
}
i++;
var r=w;
for(var j=len-1;(v=this.views[j])&&(i<=j);j--){
vw=this.getViewWidth(j);
v.setSize(vw,h);
vw=v.domNode.offsetWidth;
r-=vw;
_208(v,r,t);
}
if(c<len){
v=this.views[c];
vw=Math.max(1,r-l);
v.setSize(vw+"px",h);
_208(v,l,t);
}
return l;
},arrange:function(l,t,w,h){
var w=this._arrange(l,t,w,h);
this.resize();
return w;
},renderRow:function(_212,_213){
var _214=[];
for(var i=0,v,n,_218;(v=this.views[i])&&(n=_213[i]);i++){
_218=v.renderRow(_212);
turbo.append(_218,n);
_214.push(_218);
}
this.normalizeRowNodeHeights(_214);
},rowRemoved:function(_219){
this.onEach("rowRemoved",[_219]);
},updateRow:function(_21a,_21b){
for(var i=0,v;v=this.views[i];i++){
v.updateRow(_21a,_21b);
}
this.renormalizeRow(_21a);
},updateRowStyles:function(_21e){
this.onEach("updateRowStyles",[_21e]);
},setScrollTop:function(_21f){
var top=_21f;
for(var i=0,v;v=this.views[i];i++){
top=v.setScrollTop(_21f);
}
return top;
},cellToColIndex:function(_223,_224){
var _225=_223;
for(var i=0,v;(v=this.views[i])&&(v!=_224);i++){
_225+=((v.cells)&&(v.colCount))||0;
}
return _225;
},colToCellIndex:function(_228){
for(var i=0,ci=_228,v;(v=this.views[i]);i++){
if(v.cells){
if(ci<v.colCount){
return {view:v,index:ci};
}
ci-=v.colCount;
}
}
return {};
},getFirstScrollingView:function(){
for(var i=0,v;(v=this.views[i]);i++){
if(v.hasScrollbar()){
return v;
}
}
}});
dojo.provide("turbo.widgets.TurboGrid.rows");
dojo.declare("turbo.grid.rows",null,function(_22e){
this.grid=_22e;
},{linesToEms:2,defaultRowHeight:1,overRow:-2,getHeight:function(_22f){
return "";
},getDefaultHeightPx:function(){
return 32;
},prepareStylingRow:function(_230,_231){
return {index:_230,node:_231,odd:Boolean(_230&1),selected:this.grid.selection.isSelected(_230),over:this.isOver(_230),customStyles:"",customClasses:"turbogrid-row"};
},styleRowNode:function(_232,_233){
var row=this.prepareStylingRow(_232,_233);
this.grid.onStyleRow(row);
this.applyStyles(row);
},applyStyles:function(_235){
with(_235){
node.className=customClasses;
var h=node.style.height;
turbo.setStyleText(node,customStyles+";"+(node._style||""));
node.style.height=h;
}
},updateStyles:function(_237){
this.grid.updateRowStyles(_237);
},setOverRow:function(_238){
var last=this.overRow;
this.overRow=_238;
if((last!=this.overRow)&&(last>=0)){
this.updateStyles(last);
}
this.updateStyles(this.overRow);
},isOver:function(_23a){
return (this.overRow==_23a);
}});
dojo.provide("turbo.widgets.TurboGrid.focus");
dojo.declare("turbo.grid.focus",null,function(_23b){
this.grid=_23b;
this.info={};
this.cell={row:0,col:-1};
this.canBlur={previous:false,next:false};
},{isLastFocusCell:function(){
return (this.cell.row==this.grid.rowCount-1&&this.cell.col==grid.colCount-1);
},isFirstFocusCell:function(){
return (this.cell.row==0&&this.cell.col==0);
},isNoFocusCell:function(){
return (this.cell.row<0||this.cell.col<0);
},resetBlur:function(){
this.canBlur.next=false;
this.canBlur.previous=false;
},doSetFocus:function(_23c){
if(this.info.view){
with(this.info){
view[_23c].call(view,this.cell.row,index);
}
}
},setFocusCell:function(_23d,_23e){
this.doSetFocus("blurCell");
this.cell={row:_23d,col:_23e};
this.info=this.grid.views.colToCellIndex(_23e);
this.doSetFocus("focusCell");
this.resetBlur();
this.grid.onCellFocus(_23d,_23e);
},next:function(){
var row=this.cell.row;
var col=this.cell.col+1;
if(col>=this.grid.colCount){
col=0;
row++;
}
if(row>this.grid.rowCount-1){
col=this.grid.colCount-1;
row=this.grid.rowCount-1;
}
this.setFocusCell(row,col);
},previous:function(){
var row=(this.cell.row||0);
var col=(this.cell.col||0)-1;
if(col<0){
col=this.grid.colCount-1;
row--;
}
if(row<0){
row=0;
col=0;
}
this.setFocusCell(row,col);
}});
dojo.provide("turbo.widgets.TurboGrid.selection");
dojo.declare("turbo.grid.selection",null,function(_243){
this.grid=_243;
this.selected=[];
},{multiSelect:true,selected:null,selectedIndex:-1,onCanSelect:function(_244){
return this.grid.canSelect(_244);
},onCanDeselect:function(_245){
return this.grid.canDeselect(_245);
},onSelected:function(_246){
return this.grid.selected(_246);
},onDeselected:function(_247){
return this.grid.deselected(_247);
},onChanged:function(){
},isSelected:function(_248){
return this.selected[_248];
},getFirstSelected:function(){
for(var i=0,l=this.selected.length;i<l;i++){
if(this.selected[i]){
return i;
}
}
return -1;
},getNextSelected:function(_24b){
for(var i=_24b+1,l=this.selected.length;i<l;i++){
if(this.selected[i]){
return i;
}
}
return -1;
},getSelected:function(){
var _24e=[];
for(var i=0,l=this.selected.length;i<l;i++){
if(this.selected[i]){
_24e.push(i);
}
}
return _24e;
},getSelectedCount:function(){
var c=0;
for(var i=0;i<this.selected.length;i++){
if(this.selected[i]){
c++;
}
}
return c;
},beginUpdate:function(){
if(this.updating==0){
this.onChanging();
}
this.updating++;
},endUpdate:function(){
this.updating--;
if(this.updating==0){
this.onChanged();
}
},select:function(_253){
this.unselectAll(_253);
this.addToSelection(_253);
},addToSelection:function(_254){
_254=Number(_254);
if(this.selected[_254]){
this.selectedIndex=_254;
}else{
if(this.onCanSelect(_254)!==false){
this.selectedIndex=_254;
this.beginUpdate();
this.selected[_254]=true;
this.grid.selected(_254);
this.endUpdate();
}
}
},deselect:function(_255){
_255=Number(_255);
if(this.selectedIndex==_255){
this.selectedIndex=-1;
}
if(this.selected[_255]){
if(this.onCanDeselect(_255)===false){
return;
}
this.beginUpdate();
delete this.selected[_255];
this.grid.deselected(_255);
this.endUpdate();
}
},setSelected:function(_256,_257){
this[(_257?"addToSelection":"deselect")](_256);
},toggleSelect:function(_258){
this.setSelected(_258,!this.selected[_258]);
},insert:function(_259){
this.selected.splice(_259,0,false);
if(this.selectedIndex>=_259){
this.selectedIndex++;
}
},remove:function(_25a){
this.selected.splice(_25a,1);
if(this.selectedIndex>=_25a){
this.selectedIndex--;
}
},unselectAll:function(_25b){
for(var i in this.selected){
if((i!=_25b)&&(this.selected[i]===true)){
this.deselect(i);
}
}
},shiftSelect:function(_25d,inTo){
var s=(_25d>=0?_25d:inTo);
var e=inTo;
if(s>e){
e=s;
s=inTo;
}
for(var i=s;i<=e;i++){
this.addToSelection(i);
}
},clickSelect:function(_262,_263,_264){
this.beginUpdate();
if(!this.multiSelect){
this.select(_262);
}else{
var _265=this.selectedIndex;
if(!_263){
this.unselectAll(_262);
}
if(_264){
this.shiftSelect(_265,_262);
}else{
this.toggleSelect(_262);
}
}
this.endUpdate();
},clickSelectEvent:function(e){
this.clickSelect(e.rowIndex,e.ctrlKey,e.shiftKey);
},clear:function(){
this.beginUpdate();
this.unselectAll();
this.endUpdate();
}});
dojo.provide("turbo.widgets.TurboGrid.edit");
dojo.declare("turbo.grid.edit",null,function(_267){
this.grid=_267;
},{shouldEdit:function(e){
return ((!e.ctrlKey)&&(!e.shiftKey));
},doclick:function(e){
if(!this.shouldEdit(e)){
return;
}
this.editCellNode(e.rowIndex,e.colIndex);
},editCellNode:function(_26a,_26b){
this.applyEdit();
this.editCell=this.grid.views.colToCellIndex(_26b);
this.editCell.col=_26b;
this.editCell.row=_26a;
this.editNode=(this.editCell.view)&&(this.editCell.view.getCellNode(this.editCell.row,this.editCell.index));
if(!this.editNode){
this.cancelEdit();
return;
}
this.editBak=this.editNode.innerHTML;
this.editNode.innerHTML="[EDITOR GOES HERE]";
},saveState:function(_26c){
if((this.editNode)&&(this.editCell.row==_26c)&&(this.edtiHtml)){
this.editHtml=this.editNode.innerHTML;
}
},restoreState:function(_26d){
if((this.editNode)&&(this.editCell.row==_26d)){
this.editNode.innerHTML=this.editHtml;
this.editHtml="";
}
},editDone:function(){
if(this.editNode){
this.editNode.innerHTML=this.editBak;
}
this.editNode=null;
},applyEdit:function(){
this.editDone();
},cancelEdit:function(){
this.editDone();
}});
dojo.provide("turbo.widgets.TurboGrid.rowbar");
dojo.require("turbo.widgets.TurboGrid.view");
dojo.widget.defineWidget("dojo.widget.TurboGridRowView",dojo.widget.TurboGridView,{defaultWidth:"3em",noscroll:true,padBorderWidth:2,fillInTemplate:function(){
this.inherited("fillInTemplate");
this.scrollboxNode.style.overflow="hidden";
dojo.html.setVisibility(this.headerNode,false);
},getWidth:function(){
return (this.viewWidth)||(this.defaultWidth);
},buildRowContent:function(_26e,_26f){
var w=this.contentNode.offsetWidth-this.padBorderWidth;
_26f.innerHTML="<div style=\"width:"+w+"px; height: 8px;\"><div class=\"turbogrid-rowbar-inner\"></div></div>";
},renderHeader:function(){
},resize:function(){
this.resizeHeight();
},doStyleRowNode:function(_271,_272){
var n=["turbogrid-rowbar"];
if(this.grid.rows.isOver(_271)){
n.push("turbogrid-rowbar-over");
}
if(this.grid.selection.isSelected(_271)){
n.push("turbogrid-rowbar-selected");
}
_272.className=n.join(" ");
},domouseover:function(e){
this.grid.onMouseOverRow(e);
},domouseout:function(e){
if(!this.isIntraRowEvent(e)){
this.grid.onMouseOutRow(e);
}
}});
dojo.require("turbo.lib.more");
dojo.require("turbo.lib.scroller");
dojo.require("turbo.widgets.TurboWidget");
dojo.require("turbo.widgets.TurboGrid.view");
dojo.require("turbo.widgets.TurboGrid.views");
dojo.require("turbo.widgets.TurboGrid.rows");
dojo.require("turbo.widgets.TurboGrid.focus");
dojo.require("turbo.widgets.TurboGrid.selection");
dojo.require("turbo.widgets.TurboGrid.edit");
dojo.require("turbo.widgets.TurboGrid.rowbar");
dojo.provide("turbo.widgets.TurboGrid.Grid");
dojo.widget.defineWidget("dojo.widget.TurboGrid",dojo.widget.html.TurboWidget,{templateString:"<div class=\"turbogrid\" hidefocus=\"hidefocus\"><div class=\"turbogrid-master-header\" dojoAttachPoint=\"headerNode\"></div><div class=\"turbogrid-master-view\" dojoAttachPoint=\"viewsNode\"></div><span dojoAttachPoint=\"lastFocusNode\" tabindex=\"0\"></span></div>",classTag:"turbogrid",styleRoot:"TurboGrid",get:turbo.nop,rowCount:5,keepRows:75,rowsPerPage:25,autoWidth:false,autoHeight:false,autoRender:true,defaultHeight:"15em",structure:"",elasticView:-1,focusView:null,sortInfo:0,themeable:true,fillInTemplate:function(){
if(!this.domNode.getAttribute("tabIndex")){
this.domNode.tabIndex="0";
}
this.domNode.onReveal=turbo.bind(this,"revealed");
this.createScroller();
this.createBuilder();
this.createHeader();
this.createViews();
this.createRowManager();
this.createFocusManager();
this.createSelectionManager();
this.createEditManager();
turbo.watchTextSizePoll(this,"textSizeChanged");
turbo.funnelEvents(this.domNode,this,"doKeyEvent",turbo.keyEvents);
turbo.connect(this.domNode,"onFocus",this,this.doFocus);
},postCreate:function(){
this.buildViews();
(this.autoRender)&&(this.render());
this.styleChanged=this.defaultStyleChanged;
},defaultStyleChanged:function(){
this.setStyledClass(this.domNode,"");
this.update();
},destroy:function(){
this.domNode.onReveal=null;
turbo.unwatchTextSizePoll(this,"textSizeChanged");
this.views.destroyViews();
this.inherited("destroy");
},revealed:function(){
this.render();
},textSizeChanged:function(){
var self=this;
turbo.defer(function(){
if(!self.domNode){
return;
}
var t=new Date().getTime();
self.views.forEach(function(v){
v.layout.update();
});
self.render();
},1);
},createRowManager:function(){
this.rows=new turbo.grid.rows(this);
},createFocusManager:function(){
this.focus=new turbo.grid.focus(this);
},createSelectionManager:function(){
this.selection=new turbo.grid.selection(this);
},createEditManager:function(){
this.edit=new turbo.grid.edit(this);
},createBuilder:function(){
this.builder=new turbo.grid.builder(this);
},createHeader:function(){
this.header=new turbo.grid.header(this);
},createScroller:function(){
this.scroller=new turbo.scroller.columns();
this.scroller.renderRow=turbo.bind(this,"renderRow");
this.scroller.removeRow=turbo.bind(this,"rowRemoved");
},createViews:function(){
this.views=new turbo.grid.views(this);
this.views.createView=turbo.bind(this,"createView");
},createView:function(_279){
var view=dojo.widget.createWidget(_279,{grid:this});
this.viewsNode.appendChild(view.domNode);
this.headerNode.appendChild(view.headerNode);
this.views.addView(view);
return view;
},buildViews:function(){
if(this.cells){
this.structure=this.cells;
this.cells=null;
}
if((this.structure)&&(dojo.lang.isString(this.structure))){
this.structure=window[this.structure];
}
if(!this.structure){
this.structure=window["layout"];
}
if(!this.structure){
return;
}
this.indexColumns();
this.views.destroyViews();
for(var i=0,v;(v=this.structure[i]);i++){
this.createView(v.type||"TurboGridView").setViewDef(v);
}
this.scroller.setContentNodes(this.views.getContentNodes());
},indexColumns:function(){
var idx=0;
for(var i=0,view;(view=this.structure[i]);i++){
for(var j=0,row;(view.cells)&&(row=view.cells[j]);j++){
for(var k=0,cell;(cell=row[k]);k++){
cell.index=idx++;
}
}
}
this.colCount=idx;
},setStructure:function(_284){
this.structure=_284;
this.buildViews();
this.render();
},resize:function(){
var _285=dojo.html.getPadBorder(this.domNode);
if(this.autoHeight){
this.domNode.style.height="auto";
this.viewsNode.style.height="";
}else{
if(this.domNode.clientHeight<=_285.height){
if(this.domNode.parentNode==document.body){
this.domNode.style.height=this.defaultHeight;
}else{
this.fitTo="parent";
}
}
}
if(this.fitTo=="parent"){
var h=dojo.html.getContentBox(this.domNode.parentNode).height;
dojo.html.setMarginBox(this.domNode,{height:Math.max(0,h)});
}
var t=this.views.measureHeader();
this.headerNode.style.height=t+"px";
var l=1,h=(this.autoHeight?-1:Math.max(this.domNode.clientHeight-t,0)||0);
if(this.autoWidth){
this.domNode.style.width=this.views.arrange(l,0,0,h)+"px";
}else{
var w=this.domNode.clientWidth||(this.domNode.offsetWidth-_285.width);
this.views.arrange(l,0,w,h);
}
this.scroller.windowHeight=h;
this.scroller.defaultRowHeight=this.rows.getDefaultHeightPx()+1;
},render:function(){
if(!this.domNode){
console.log("Grid.render: domNode is null",this);
return;
}
this.update=this.defaultUpdate;
this.scroller.init(this.rowCount,this.keepRows,this.rowsPerPage);
this.prerender();
this.setScrollTop(0);
this.postrender();
},prerender:function(){
this.views.render();
this.resize();
},postrender:function(){
if(this.autoHeight){
this.viewsNode.style.height=this.views.measureContent()+"px";
}
this.setFocusView();
},renderRow:function(_28a,_28b){
this.views.renderRow(_28a,_28b);
},rowRemoved:function(_28c){
this.views.rowRemoved(_28c);
},defaultUpdate:function(){
this.prerender();
this.scroller.invalidateNodes();
this.setScrollTop(this.scrollTop);
this.postrender();
},update:function(){
this.render();
},updateRow:function(_28d){
this.edit.saveState(_28d);
this.views.updateRow(_28d,this.rows.getHeight(_28d));
this.scroller.rowHeightChanged(_28d);
this.edit.restoreState(_28d);
},rowHeightChanged:function(_28e){
this.views.renormalizeRow(_28e);
this.scroller.rowHeightChanged(_28e);
},updateRowCount:function(_28f){
this.rowCount=_28f;
this.scroller.updateRowCount(_28f);
this.setScrollTop(this.scrollTop);
},updateRowStyles:function(_290){
this.views.updateRowStyles(_290);
},onStyleRow:function(_291){
with(_291){
customClasses+=(odd?" turbogrid-row-odd":"")+(selected?" turbogrid-row-selected":"")+(over?" turbogrid-row-over":"");
}
},fastScroll:true,delayScroll:false,scrollRedrawThreshold:(dojo.render.html.ie?100:50),scrollTo:function(_292){
if(!this.fastScroll){
this.setScrollTop(_292);
return;
}
var _293=Math.abs(this.lastScrollTop-_292);
this.lastScrollTop=_292;
if(_293>this.scrollRedrawThreshold||this.delayScroll){
this.delayScroll=true;
this.scrollTop=_292;
this.views.setScrollTop(_292);
turbo.job("turbogrid-scroll",200,turbo.bind(this,"finishScrollJob"));
}else{
this.setScrollTop(_292);
}
},finishScrollJob:function(){
this.delayScroll=false;
this.setScrollTop(this.scrollTop);
},setScrollTop:function(_294){
this.scrollTop=this.views.setScrollTop(_294);
this.scroller.scroll(this.scrollTop);
},scrollToRow:function(_295){
this.setScrollTop(this.scroller.findScrollTop(_295)+1);
},styleRowNode:function(_296,_297){
if(_297){
this.rows.styleRowNode(_296,_297);
}
},canSelect:function(_298){
return true;
},canDeselect:function(_299){
return true;
},selected:function(_29a){
this.updateRowStyles(_29a);
},deselected:function(_29b){
this.updateRowStyles(_29b);
},selectionChanged:function(){
},setSortInfo:function(_29c){
this.sortInfo=_29c;
this.update();
},getSortIndex:function(_29d){
return Math.abs(this.sortInfo)-1;
},setSortIndex:function(_29e){
if(this.getSortIndex()==_29e){
this.setSortInfo(-this.sortInfo);
}else{
this.setSortInfo(_29e+1);
}
},doKeyEvent:function(e){
e.dispatch="do"+e.type;
this.onKeyEvent(e);
},onKeyEvent:function(e){
this.dispatchKeyEvent(e);
},onContentEvent:function(e){
this.dispatchContentEvent(e);
},onHeaderEvent:function(e){
this.dispatchHeaderEvent(e);
},_dispatch:function(m,e){
if(m in this){
return this[m](e);
}
},dispatchContentEvent:function(e){
e.sourceView.dispatchContentEvent(e)||this._dispatch(e.dispatch,e);
},dispatchKeyEvent:function(e){
this._dispatch(e.dispatch,e);
},dispatchHeaderEvent:function(e){
e.sourceView.dispatchHeaderEvent(e)||this.header.dispatchEvent(e)||this._dispatch("doheader"+e.type,e);
},dokeydown:function(e){
this.onKeyDown(e);
},doclick:function(e){
if(e.cellNode){
this.onCellClick(e);
}else{
this.onRowClick(e);
}
},dodblclick:function(e){
if(e.cellNode){
this.onCellDblClick(e);
}else{
this.onRowDblClick(e);
}
},docontextmenu:function(e){
if(e.cellNode){
this.onCellContextMenu(e);
}else{
this.onRowContextMenu(e);
}
},doheaderclick:function(e){
if(e.cellNode){
this.onHeaderCellClick(e);
}else{
this.onHeaderClick(e);
}
},doheaderdblclick:function(e){
if(e.cellNode){
this.onHeaderCellDblClick(e);
}else{
this.onHeaderDblClick(e);
}
},doheadercontextmenu:function(e){
if(e.cellNode){
this.onHeaderCellContextMenu(e);
}else{
this.onHeaderContextMenu(e);
}
},onKeyDown:function(e){
if(e.altKey||e.ctrlKey||e.metaKey){
return;
}
switch(e.keyCode){
case e.KEY_ESCAPE:
break;
case e.KEY_ENTER:
break;
case e.KEY_TAB:
if(e.shiftKey){
if(!this.focus.isFirstFocusCell()){
this.focus.previous();
turbo.killEvent(e);
}else{
this.focus.canBlur.previous=true;
this.domNode.focus();
}
}else{
if(!this.focus.isLastFocusCell()){
this.focus.next();
turbo.killEvent(e);
}else{
this.focus.canBlur.next=true;
this.lastFocusNode.focus();
}
}
break;
}
},onMouseOver:function(e){
(e.rowIndex==-1?this.onHeaderCellMouseOver(e):this.onCellMouseOver(e));
},onMouseOut:function(e){
(e.rowIndex==-1?this.onHeaderCellMouseOut(e):this.onCellMouseOut(e));
},onMouseOverRow:function(e){
if(!this.rows.isOver(e.rowIndex)){
this.rows.setOverRow(e.rowIndex);
(e.rowIndex==-1?this.onHeaderMouseOver(e):this.onRowMouseOver(e));
}
},onMouseOutRow:function(e){
if(this.rows.isOver(-1)){
this.onHeaderMouseOut(e);
}else{
if(!this.rows.isOver(-2)){
this.rows.setOverRow(-2);
this.onRowMouseOut(e);
}
}
},onCellMouseOver:function(e){
dojo.html.addClass(e.cellNode,"turbogrid-cell-over");
},onCellMouseOut:function(e){
dojo.html.removeClass(e.cellNode,"turbogrid-cell-over");
},onRowMouseOver:function(e){
},onRowMouseOut:function(e){
},onCellClick:function(e){
turbo.killEvent(e);
this.focus.setFocusCell(e.rowIndex,e.cell.index);
this.onRowClick(e);
},onRowClick:function(e){
this.selection.clickSelectEvent(e);
},onCellDblClick:function(e){
this.onRowDblClick(e);
},onRowDblClick:function(e){
},onCellContextMenu:function(e){
this.onRowContextMenu(e);
},onRowContextMenu:function(e){
turbo.killEvent(e);
},onHeaderMouseOver:function(e){
},onHeaderMouseOut:function(e){
},onHeaderCellMouseOver:function(e){
dojo.html.addClass(e.cellNode,"turbogrid-cell-over");
},onHeaderCellMouseOut:function(e){
dojo.html.removeClass(e.cellNode,"turbogrid-cell-over");
},onHeaderClick:function(e){
},onHeaderCellClick:function(e){
this.setSortIndex(e.cell.index);
this.onHeaderClick(e);
},onHeaderDblClick:function(e){
},onHeaderCellDblClick:function(e){
this.onHeaderDblClick(e);
},onHeaderCellContextMenu:function(e){
this.onHeaderContextMenu(e);
},onHeaderContextMenu:function(e){
turbo.killEvent(e);
},onCellFocus:function(_2c8,_2c9){
var info=this.focus.info;
var n=info.view.getCellNode(_2c8,info.index);
if(n.firstChild&&n.firstChild.focus){
n.firstChild.focus();
}else{
if (this.focusView)
this.focusView.scrollboxNode.focus();
}
},setFocusView:function(){
this.focusView=this.views.getFirstScrollingView();
},doFocus:function(e){
if(e&&e.target!=e.currentTarget){
return;
}
if(this.focus.canBlur.next||this.focus.canBlur.previous){
this.focus.resetBlur();
return;
}
if(this.focusView)
this.focusView.scrollboxNode.focus();
if(this.focus.isNoFocusCell()){
this.focus.setFocusCell(0,0);
}
}});
dojo.provide("turbo.widgets.TurboGrid.DataGrid");
dojo.require("turbo.widgets.TurboGrid.Grid");
dojo.require("turbo.data.model");
dojo.widget.defineWidget("dojo.widget.TurboDGrid",dojo.widget.TurboGrid,{});
dojo.widget.defineWidget("dojo.widget.TurboDataGrid",dojo.widget.TurboGrid,{model:"turbo.data.table",postCreate:function(){
if(this.model){
if(typeof this.model=="string"){
var m=dojo.getObject(this.model);
this.model=(typeof m=="function"?new m():m);
}
this._setModel(this.model);
}
this.inherited("postCreate",arguments);
},_setModel:function(_2ce){
this.model=_2ce;
if(this.model){
this.model.observe("change",this,"modelChange");
this.model.observe("insertion",this,"modelInsertion");
this.model.observe("removal",this,"modelRemoval");
}
this.measureModel();
},setModel:function(_2cf){
if(this.model){
this.model.unobserve("change",this,"modelChange");
this.model.unobserve("insertion",this,"modelInsertion");
this.model.unobserve("removal",this,"modelRemoval");
}
this._setModel(_2cf);
this.modelChanged();
},measureModel:function(){
if(this.model){
this.model.measure();
}
this.rowCount=(this.model?this.model.count:0);
},getDataRowIndex:function(_2d0,_2d1){
return _2d0.index;
},defaultGet:function(_2d2,_2d3){
var _2d4=this.getDataRowIndex(_2d2,_2d3);
if(_2d3.def.keys){
for(var i=0,d=[],k;(k=_2d3.def.keys[i])||(k!==undefined);i++){
d.push(_2d3.grid.model.get(_2d4,k));
}
}else{
var d=_2d3.grid.model.get(_2d4,(_2d3.def.key!=undefined?_2d3.def.key:_2d3.index));
}
return (_2d3.def.formatter?_2d3.def.formatter.call(_2d3.grid,d,_2d2,_2d3):(dojo.lang.isArray(d)?d.join():d));
},get:function(_2d8,_2d9){
return _2d9.grid.defaultGet.apply(_2d9.grid,arguments);
},render:function(){
this.measureModel();
dojo.widget.TurboGrid.prototype.render.apply(this,arguments);
},modelChanged:function(){
this.measureModel();
this.updateRowCount(this.rowCount);
},modelRowChanged:function(_2da){
this.updateRow(_2da);
},modelColChanged:function(_2db,_2dc){
this.updateRow(_2db);
},modelUpdates:["modelChanged","modelRowChanged","modelColChanged"],defaultModelChange:function(_2dd,_2de){
this[this.modelUpdates[arguments.length]].apply(this,arguments);
},modelChange:function(_2df,_2e0){
this.defaultModelChange.apply(this,arguments);
},modelInsertion:function(_2e1){
this.updateRowCount(this.model.getRowCount());
},modelRemoval:function(_2e2){
this.updateRowCount(this.model.getRowCount());
},getCellDef:function(_2e3){
var i=this.views.colToCellIndex(_2e3);
return i.view.layout.cells[i.index].def;
},canSort:function(){
var d=this.getCellDef(this.getSortIndex());
return (d&&!d.get&&this.model.canSort());
},sortData:function(){
var k=this.getCellDef(this.getSortIndex()).key||this.getSortIndex();
var s=(k+1)*(this.sortInfo>0?1:-1);
this.model.sort(s);
},setSortInfo:function(_2e8){
this.sortInfo=_2e8;
if(this.canSort()){
this.sortData();
this.update();
}
},junk:0});

