/*
	Copyright (c) 2004-2007, The TurboAjax Group, All Rights Reserved.
	http://turboajax.com/turbowidgets
*/

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;

