﻿var inlines=new Array();
inlines[0]="framework";
for(var templates in inlines){
document.write("<iframe id='ifrm_"+inlines[templates]+"' class='daxinline' name='"+inlines[templates]+"' src='/dax/js/templates/"+inlines[templates]+".html?random="+Math.random()+"' width='0' height='0' frameborder='0'></iframe>");
}

function $(id){
var _2=document.getElementById(id);
return _2;
}
function assert(id,_4){
var el=document.getElementById(id);
if(!isDefined(el)||el.nodeType!=1){
document.write(_4);
}else{
el.innerHTML=_4;
}
}
function isDefined(_6){
return _6!=null&&_6!=undefined;
}
function Browser(){
var ua=navigator.userAgent;
this.ie=false;
this.ie6=false;
this.ie7=false;
this.gecko=false;
this.safari=false;
this.safari2=false;
this.safari3=false;
if(ua.indexOf("MSIE")>=0){
this.ie=true;
if(ua.indexOf("MSIE 7")>=0){
this.ie7=true;
}
if(ua.indexOf("MSIE 6")>=0){
this.ie6=true;
}
}else{
if(ua.indexOf("iPhone")>=0){
this.iphone=true;
this.safari=true;
}else{
if(ua.indexOf("WebKit")>=0){
this.safari=true;
if(ua.indexOf("Version/3")>=0){
this.safari3=true;
}else{
this.safari2=true;
}
}else{
if(ua.indexOf("Gecko")>=0){
this.gecko=true;
}
}
}
}
this.theme="basic";
this.themePath="themes/"+this.theme+"/";
}
var browser=new Browser();
function OS(){
var os=navigator.appVersion;
this.mac=false;
this.win=false;
this.linux=false;
this.unix=false;
if(os.indexOf("Win")>=0){
this.win=true;
}else{
if(os.indexOf("Mac")>=0){
this.mac=true;
}else{
if(os.indexOf("X11")>=0){
this.unix=true;
}else{
if(os.indexOf("Linux")>=0){
this.linux=true;
}
}
}
}
}
var os=new OS();
function getParentByClassName(_9,_a,_b){
var _c=null;
while(_9&&!_c){
if(!_b){
var _d=(_9.className==_a)?true:false;
}else{
var _d=(_9.className.indexOf(_a)!=-1)?true:false;
}
if(_d){
_c=_9;
}else{
_9=_9.parentNode;
}
}
return _c;
}
function getElementsByClassName(_e,_f,_10){
var _11=new Array(0);
if(_e.nodeType==1){
if(_10!=null&&_10!=undefined&&_10){
var _12=_e.className!=undefined?_e.className:"";
if(_12.indexOf(_f)>=0){
_11.push(_e);
}
}else{
if(_e.className==_f){
_11.push(_e);
}
}
if(_e.hasChildNodes()){
var _13=_e.childNodes;
for(var i=0;i<_13.length;i++){
_11=_11.concat(getElementsByClassName(_13[i],_f,_10));
}
}
}
return _11;
}
function getElementByClassName(_15,_16,_17){
if(!_15||_16==""){
return null;
}
if(_17!=null&&_17!=undefined&&_17){
var _18=_15.className!=undefined?_15.className:"";
if(_18.indexOf(_16)>=0){
return _15;
}
}else{
if(_15.className==_16){
return _15;
}
}
var _19=_15.childNodes;
var _1a=null;
var i=0;
while(!_1a&&i<_19.length){
_1a=getElementByClassName(_19.item(i),_16,_17);
i++;
}
return _1a;
}
function getCSSPropertyValue(_1c,_1d){
var _1c="."+_1c;
if(browser.ie){
rules=document.styleSheets.item(0).rules;
}else{
rules=document.styleSheets.item(0).cssRules;
}
var _1e="";
var st="";
for(var i=0;i<rules.length;i++){
st=rules.item(i).selectorText;
if(st){
var _21=st.split(",");
for(var k=0;k<_21.length;k++){
if(strip(_21[k]," ")==_1c){
if(browser.ie){
_1e=rules.item(i).style.getAttribute(_1d);
}else{
_1e=rules.item(i).style.getPropertyValue(_1d);
}
k=_21.length;
i=rules.length;
}
}
}
}
return _1e;
}
function dax_setNodeWidth(_23,_24){
var _25=parseInt(getStyle(_23,"padding-left","paddingLeft"),10)+parseInt(getStyle(_23,"padding-right","paddingRight"),10);
var _26=parseInt(getStyle(_23,"margin-left","marginLeft"),10)+parseInt(getStyle(_23,"margin-right","marginLeft"),10);
var _27=parseInt(getStyle(_23,"border-left-width","borderLeftWidth"),10)+parseInt(getStyle(_23,"border-right-width","borderRightWidth"),10);
if(!_25){
_25=0;
}
if(!_26){
_26=0;
}
if(!_27){
_27=0;
}
_24=_24-_25-_26-_27;
_23.style.width=_24+"px";
}
function dax_setNodeHeight(_28,_29){
var _2a=parseInt(getStyle(_28,"padding-top","paddingTop"),10)+parseInt(getStyle(_28,"padding-bottom","paddingBottom"),10);
var _2b=parseInt(getStyle(_28,"margin-top","marginTop"),10)+parseInt(getStyle(_28,"margin-bottom","marginBottom"),10);
var _2c=parseInt(getStyle(_28,"border-top-width","borderTopWidth"),10)+parseInt(getStyle(_28,"border-bottom-width","borderBottomWidth"),10);
if(!_2a){
_2a=0;
}
if(!_2b){
_2b=0;
}
if(!_2c){
_2c=0;
}
_29=_29-_2a-_2b-_2c;
_28.style.height=_29+"px";
}
function strip(_2d,_2e){
var _2f="";
for(var i=0;i<_2d.length;i++){
if(_2d.charAt(i)!=_2e){
_2f+=_2d.charAt(i);
}
}
return _2f;
}
function getTextNode(_31){
if(!isDefined(_31)||!_31.hasChildNodes()){
return null;
}
for(var _32=_31.firstChild;_32;_32=_32.nextSibling){
if(_32.nodeType==3){
return _32;
}
}
return null;
}
function getTextValue(_33){
if(!isDefined(_33)||!_33.hasChildNodes()){
return null;
}
for(var _34=_33.firstChild;_34;_34=_34.nextSibling){
if(_34.nodeType==3){
return _34.nodeValue;
}
}
return null;
}
function shrink(){
var ws=window.shrinking;
var _36=10;
var _37=10;
if(!ws){
window.shrinking=this;
ws=this;
var _38=ws.object.childNodes;
for(var i=0;i<_38.length;i++){
if(_38[i].style){
_38[i].style.visibility="hidden";
}
}
}
switch(ws.direction){
case "left":
var _3a=ws.object.currentWidth;
if(_3a){
if(_3a>_36){
_3a-=_36;
}else{
_3a=0;
}
ws.object.style.width=_3a+"px";
ws.object.currentWidth=_3a;
setTimeout("shrink()",_37);
}else{
ws.object.currentWidth=0;
ws.object.style.display="none";
delete window.shrinking;
}
break;
case "up":
var _3b=ws.object.currentHeight;
if(_3b){
if(_3b>_36){
_3b-=_36;
}else{
_3b=0;
}
ws.object.style.height=_3b+"px";
ws.object.currentHeight=_3b;
setTimeout("shrink()",_37);
}else{
ws.object.currentHeight=0;
ws.object.style.display="none";
delete window.shrinking;
}
break;
}
return ws.object;
}
function grow(){
var ws=window.growing;
var _3d=10;
var _3e=10;
if(!ws){
window.growing=this;
ws=this;
var _3f=ws.object.childNodes;
for(var i=0;i<_3f.length;i++){
if(_3f[i].style){
_3f[i].style.visibility="visible";
}
}
}
switch(ws.direction){
case "right":
var _41=ws.object.currentWidth;
if(_41<ws.object.startWidth){
if((ws.object.startWidth-_41)>_3d){
_41+=_3d;
}else{
_41=ws.object.startWidth;
}
ws.object.style.width=_41+"px";
ws.object.currentWidth=_41;
setTimeout("grow()",_3e);
}else{
ws.object.startWidth=0;
delete window.growing;
}
break;
case "down":
var _42=ws.object.currentHeight;
if(_42<ws.object.startHeight){
if((ws.object.startHeight-_42)>_3d){
_42+=_3d;
}else{
_42=ws.object.startHeight;
}
ws.object.style.height=_42+"px";
ws.object.currentHeight=_42;
setTimeout("grow()",_3e);
}else{
ws.object.startHeight=0;
delete window.growing;
}
break;
}
return ws.object;
}
function Dashboard(_43){
this.parent=_43;
this.widgets=new Array(0);
this.add=dashboardAdd;
this.remove=dashboardRemove;
return this;
}
function dashboardAdd(_44){
if(!this.widgets){
return;
}
var _45=null;
for(var i in this.widgets){
if(this.widgets[i]==_44){
_45=this.widgets[i];
break;
}
}
if(!_45){
_45=this.widgets[this.widgets.push(_44)];
}
return _45;
}
function dashboardRemove(_47){
if(!this.widgets){
return;
}
var _48=null;
for(var i in this.widgets){
if(this.widgets[i]==_47){
_48=this.widgets[i];
break;
}
}
if(_48){
this.widgets.splice(i,1);
}
return true;
}
var DAX_Global_disableDragging=false;
function startDragObject(_4a){
if(DAX_Global_disableDragging){
DAX_Global_disableDragging=false;
return false;
}
var _4a=xpEvent(_4a,true);
Controller.dragObject=this;
var x=0;
var y=0;
if(_4a.pageX||_4a.pageY){
x=_4a.pageX;
y=_4a.pageY;
}else{
if(_4a.screenX||_4a.screenY){
x=_4a.screenX;
y=_4a.screenY;
}
}
if(this.style.zIndex<9000){
setStyle(this,"zIndex",++WindowManager.maxZIndex);
}else{
setStyle(this,"zIndex",++WindowManager.maxZDashIndex);
}
this.offsetX=this.offsetLeft-x;
this.offsetY=this.offsetTop-y;
if(document.addEventListener){
document.addEventListener("mousemove",draggingObject,true);
document.addEventListener("mouseup",stopDragObject,true);
}else{
document.onmousemove=draggingObject;
document.onmouseup=stopDragObject;
}
if(this.ondragstart){
this.ondragstart(_4a);
}
}
function startDragOtherObject(_4d,_4e){
var _4d=xpEvent(_4d,true);
Controller.dragObject=_4e;
var x=0;
var y=0;
if(_4d.pageX||_4d.pageY){
x=_4d.pageX;
y=_4d.pageY;
}else{
if(_4d.screenX||_4d.screenY){
x=_4d.screenX;
y=_4d.screenY;
}
}
if(_4e.style.zIndex<9000){
setStyle(_4e,"zIndex",++WindowManager.maxZIndex);
}else{
setStyle(_4e,"zIndex",++WindowManager.maxZDashIndex);
}
_4e.offsetX=_4e.offsetLeft-x;
_4e.offsetY=_4e.offsetTop-y;
if(document.addEventListener){
document.addEventListener("mousemove",draggingObject,true);
document.addEventListener("mouseup",stopDragObject,true);
}else{
document.onmousemove=draggingObject;
document.onmouseup=stopDragObject;
}
if(_4e.ondragstart){
_4e.ondragstart(_4d);
}
}
function draggingObject(_51){
var _51=xpEvent(_51,true,true);
var _52=Controller.dragObject;
if(!_52){
return;
}
_52.dragging=true;
var x=0;
var y=0;
if(_51.pageX||_51.pageY){
x=_51.pageX;
y=_51.pageY;
}else{
if(_51.screenX||_51.screenY){
x=_51.screenX;
y=_51.screenY;
}
}
_52.style.left=(x+_52.offsetX)+"px";
_52.style.top=(y+_52.offsetY)+"px";
if(_52.ondragging){
_52.ondragging(_51);
}
return false;
}
function stopDragObject(_55){
if(!Controller.dragObject){
return;
}
if(document.removeEventListener){
document.removeEventListener("mousemove",draggingObject,true);
document.removeEventListener("mouseup",stopDragObject,true);
}else{
document.onmousemove=null;
document.onmouseup=null;
}
if(Controller.dragObject.dragging&&Controller.dragObject.ondragstop){
Controller.dragObject.ondragstop(_55);
}
Controller.dragObject.dragging=false;
Controller.dragObject=null;
}
function n2String(_56){
var tn=getTextNode(_56);
return isDefined(tn)?new String(tn.nodeValue):new String("");
}
function removeChildren(_58){
while(_58.firstChild){
_58.removeChild(_58.firstChild);
}
}
function getElementById(_59,_5a){
if(_59.nodeType!=1){
return null;
}
if(_59.id==_5a){
return _59;
}
var _5b=null;
for(var _5c=_59.firstChild;_5c;_5c=_5c.nextSibling){
_5b=getElementById(_5c,_5a);
}
return _5b;
}
function getTemplate(id,_5e){
var obj=document.getElementById(id);
if(obj){
return obj;
}
var _5e="framework";
var _60=this.frames[_5e]?this.frames[_5e].document:null;
obj=_60?_60.getElementById(id):null;
if(obj){
obj=document.importNode(obj,true);
document.body.insertBefore(obj,null);
}
return obj;
}
function getAdmin(){
var obj=document.getElementById("adminSettings");
if(obj){
return obj;
}
var _62="admin";
var _63=frames[_62]?frames[_62].document:null;
obj=_63?_63.getElementById("adminSettings"):null;
if(obj){
obj=document.importNode(obj,true);
document.body.insertBefore(obj,null);
}
return obj;
}
function probe(_64){
if(_64.hasChildNodes()){
for(var _65=_64.firstChild;_65;_65=_65.nextSibling){
if(_65.nodeType==1){
if(_65.className!=""){
var _66=new String();
for(var i=0;i<_65.className.length;i++){
if(_65.className.charAt(i)!="_"){
_66+=_65.className.charAt(i);
}else{
if(i+1<_65.className.length){
_66+=_65.className.charAt(i+1).toUpperCase();
i++;
}
}
}
_64[_66]=_65;
}
probe(_65);
}
}
}else{
return;
}
}
function getStyle(_68,_69,_6a){
var _6b=_68.style[_69];
if(!_6b){
if(document.defaultView&&document.defaultView.getComputedStyle){
css=document.defaultView.getComputedStyle(_68,null);
_6b=css?css.getPropertyValue(_69):null;
}else{
if(_68.currentStyle){
_6b=_68.currentStyle[_6a];
}
}
}
return _6b;
}
function setStyle(_6c,_6d,_6e){
try{
if(_6d.toLowerCase()=="width"&&browser.ie&&false){
if((_6e.indexOf("px")!=-1)||(!(isNaN(_6e)))){
_6e=parseFloat(_6e);
paddingOffset=parseFloat(_6c.currentStyle.paddingLeft)+parseFloat(_6c.currentStyle.paddingRight);
if(!(isNaN(paddingOffset))){
_6e=_6e+paddingOffset;
}
borderOffset=parseFloat(_6c.currentStyle.borderLeftWidth)+parseFloat(_6c.currentStyle.borderRightWidth);
if(!(isNaN(borderOffset))){
_6e=_6e+borderOffset;
}
}
}else{
if(_6d.toLowerCase()=="height"&&browser.ie&&false){
if((_6e.indexOf("px")!=-1)||(!(isNaN(_6e)))){
}
}
}
_6c.style[_6d]=_6e;
}
catch(e){
}
}
function getMousePosition(_6f){
var x=0;
var y=0;
if(!_6f){
var _6f=window.event;
}
if(_6f.pageX||_6f.pageY){
x=_6f.pageX;
y=_6f.pageY;
}else{
if(_6f.clientX||_6f.clientY){
x=_6f.clientX;
y=_6f.clientY;
}
}
return {x:x,y:y};
}
function getObjectPosition(_72){
var px=0;
var py=0;
if(_72.offsetParent){
for(var px=0,py=0;_72.offsetParent;_72=_72.offsetParent){
px+=_72.offsetLeft;
py+=_72.offsetTop;
}
}else{
px=_72.offsetLeft;
py=_72.offsetTop;
}
return {x:px,y:py};
}
function xpEvent(_75,_76,_77){
var _76=isDefined(_76)?_76:false;
var _75=!_75?window.event:_75;
var _77=isDefined(_77)?_77:false;
if(_76){
_75.cancelBubble=_76;
if(_75.stopPropagation){
_75.stopPropagation();
}
}
if(_77){
if(_75.preventDefault){
_75.preventDefault();
}
}
_75._target=isDefined(_75.target)?_75.target:_75.srcElement;
if(_75._target){
if(_75._target.nodeType==3){
_75._target=_75._target.parentNode;
}
}
return _75;
}
function xpGetSize(_78){
if(getStyle(_78,"display")!="none"){
return (browser.ie)?{width:_78.clientWidth,height:_78.clientHeight}:{width:_78.offsetWidth,height:_78.offsetHeight};
}
var els=_78.style;
var _7a=els.visibility;
var _7b=els.position;
els.visibility="hidden";
els.position="absolute";
els.display="";
var _7c=_78.clientWidth;
var _7d=_78.clientHeight;
els.display="none";
els.position=_7b;
els.visibility=_7a;
return {width:_7c,height:_7d};
}
function validateDate(_7e){
if(isDefined(_7e)){
brokenDate=_7e.split("-");
if(brokenDate.length==3){
year=brokenDate[0];
month=brokenDate[1];
_7e=brokenDate[2];
testDate=new Date(year,month-1,_7e);
if((testDate.getFullYear()==year)&&(testDate.getMonth()==month-1)&&(testDate.getDate()==_7e)){
return true;
}else{
return false;
}
}else{
return false;
}
}
}
function setActiveStyleSheet(_7f){
var i,a,_82;
for(i=0;(a=document.getElementsByTagName("link")[i]);i++){
curTitle=a.getAttribute("title");
if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("title")){
a.disabled=true;
if(curTitle==_7f){
a.disabled=false;
}
}
}
}
function getActiveStyleSheet(){
var i,a;
for(i=0;(a=document.getElementsByTagName("link")[i]);i++){
if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("title")&&!a.disabled){
return a.getAttribute("title");
}
}
return null;
}
function getPreferredStyleSheet(){
var i,a;
for(i=0;(a=document.getElementsByTagName("link")[i]);i++){
if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("rel").indexOf("alt")==-1&&a.getAttribute("title")){
return a.getAttribute("title");
}
}
return null;
}
function GetPopupTemplate(_87,_88,_89,_8a,_8b){
var _8b=(_8b==null)?"block":_8b;
var _8c=cachedselectdiv.cloneNode(true);
var _8d=cachedselect.cloneNode(true);
if(_8c){
_8c.style.display=_8b;
_8c.id=_87+"_div";
if(_8d){
if(_8a!=null){
_8d.style.width=_8a+"px";
}
_8d.id=_87;
var _8e=_8d.options[0];
for(var k in _89){
if(k>0){
_8e=_8e.cloneNode(true);
}
_8e.innerHTML=_89[k];
_8e.value=_88[k];
_8d.appendChild(_8e);
}
}
}
return _8d;
}
function getWindowHeight(){
var _90=0;
if(typeof (window.innerHeight)=="number"){
_90=window.innerHeight;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
_90=document.documentElement.clientHeight;
}else{
if(document.body&&document.body.clientHeight){
_90=document.body.clientHeight;
}
}
}
return _90;
}
function getPosition(obj){
var _92=curtop=0;
if(obj.offsetParent){
_92=obj.offsetLeft;
curtop=obj.offsetTop;
while(obj=obj.offsetParent){
_92+=obj.offsetLeft;
curtop+=obj.offsetTop;
}
}
return [_92,curtop];
}
function isArray(obj){
if(obj.constructor.toString().indexOf("Array")==-1){
return false;
}else{
return true;
}
}
function findInArray(obj,_95,_96,_97,_98){
if(!_97){
_97=false;
}
if(_96==null){
_96=0;
}else{
if(_96<0){
_96=Math.max(0,obj.length+_96);
}
}
for(var i=_96;i<obj.length;i++){
if(_97){
if(obj[i].toLowerCase()===_95.toLowerCase()){
return i;
}
}else{
if(_98){
if(obj[i].indexOf(_95)!=-1){
return i;
}
}else{
if(obj[i]===_95){
return i;
}
}
}
}
return -1;
}
function initTooltop(){
if($("dax_tooltip0")){
return $("dax_tooltip0");
}
var _9a=getTemplate("dax_tooltip").cloneNode(true);
var _9b=document.body.appendChild(_9a);
_9b.id="dax_tooltip0";
if(_9b){
return _9b;
}else{
return null;
}
}
function showTooltip(_9c,x,y){
var _9f=initTooltop();
if(!_9f){
return;
}
setStyle(_9f,"display","block");
_9f.innerHTML=_9c;
setStyle(_9f,"top",y-22+"px");
setStyle(_9f,"left",x+8+"px");
}
function hideTooltip(){
var _a0=$("dax_tooltip0");
if(!_a0){
return;
}
setStyle(_a0,"display","none");
}
function ReplaceString(_a1,_a2,_a3){
if(_a2!=""&&_a2!=_a3){
var _a4=0;
var _a5=0;
var _a6="";
var _a7="";
while(_a4<_a1.length){
_a5=_a1.indexOf(_a2,_a4);
if(_a5==-1){
break;
}else{
_a6=_a1.substr(0,_a5);
_a7=_a1.substr(_a5+_a2.length,_a1.length);
_a1=_a6+_a3+_a7;
_a4=_a6.length+_a3.length;
}
}
}
return _a1;
}
function EncodeString(_a8){
var _a9="%";
var _aa="&#x";
var _ab=dax_bridge.encode(_a8);
if(_a9!=""&&_a9!=_aa){
var _ac=0;
var _ad=0;
var _ae="";
var _af="";
while(_ac<_ab.length){
_ad=_ab.indexOf(_a9,_ac);
if(_ad==-1){
break;
}else{
_ae=_ab.substr(0,_ad);
_af=_ab.substr(_ad+_a9.length+2,_ab.length);
_ab=_ae+_aa+_ab.substr(_ad+_a9.length,2)+";"+_af;
_ac=_ae.length+_aa.length+3;
}
}
}
return dax_bridge.encode(_ab);
}
function test(){
try{
var _b0=new Toolbar();
_b0.addButton("Create");
document.body.insertBefore(_b0.prv.mDOM,null);
}
catch(e){
alert(e);
}
}
function do_AR(_b1,_b2,_b3,_b4){
var _b5=new GridObject(_b1);
_b5.owner=_b4;
_b1.grid=_b5;
if(_b1.parent){
_b1.parent.grid=_b5;
}
if(_b4.currentTab){
if(_b4.currentTab.queryName){
_b5.populate({tableId:_b2,comparison:_b3,queryName:_b4.currentTab.queryName});
}else{
_b5.populate({tableId:_b2,comparison:_b3});
}
}else{
_b5.populate({tableId:_b2,comparison:_b3});
}
return _b5;
}
function DAX(_b6,_b7){
var _b7=isDefined(_b7)?_b7:"";
switch(_b6){
case "window":
schedule(function(){
return getTemplate(objectId);
},"do_drawWindow("+_b7+")");
break;
case "datawindow":
schedule(function(){
return getTemplate("window")&&structure.isUpdated();
},"do_allRecords("+_b7+")");
break;
case "query":
schedule(function(){
return getTemplate("recordsArea")&&structure.isUpdated();
},"do_queryInto("+_b7+")");
break;
case "queryrelated":
schedule(function(){
return getTemplate("recordsArea")&&structure.isUpdated();
},"do_queryRelated("+_b7+")");
break;
case "login":
schedule(function(){
return true;
},"do_login("+_b7+")");
break;
case "grid":
schedule(function(){
return getTemplate("grid");
},"do_grid("+_b7+")");
break;
case "hl":
schedule(function(){
return getTemplate("hl");
},"do_hl("+_b7+")");
break;
case "AllRecords":
schedule(function(){
return getTemplate("newgrid");
},"do_AR("+_b7+")");
break;
case "test":
schedule(function(){
return getTemplate("editor");
},"test("+_b7+")");
break;
case "NavBar":
schedule(function(){
return getTemplate("newgrid");
},"NavBar("+_b7+")");
default:
return;
}
}
function schedule(_b8,_b9){
if(_b8()){
eval(_b9);
}else{
setTimeout("schedule("+_b8+", '"+_b9+"')",1);
}
return true;
}
function do_getPreferences(){
}
function do_hl(_ba,_bb){
if(_bb==null||_bb==undefined){
return;
}
var hl=new HList();
hl.build(_bb);
if(_ba==null||_ba==undefined){
_ba=document.body;
}
hl.refresh();
_ba.insertBefore(hl.dom,null);
document.body.removeChild(_bb);
}
function do_grid(_bd){
if(arguments.length>0){
var _be=new Grid();
for(var i=1;i<arguments.length;i++){
var col=new GridColumn(arguments[i]);
_be.insert(col);
}
_bd.insertBefore(_be.dom,null);
_be.refresh();
return _be;
}
return null;
}
function do_allRecords(_c1){
var dw=new DataWindow(_c1,null,null,null,null,true);
dw.open();
}
function do_query(_c3,_c4,_c5){
var _c6=connection.sessionId;
if(_c6==""||_c3==""){
return;
}
var url=connection.address.query+"?sessionId="+_c6+"&queryid="+_c3+"&start="+_c4+"&length="+_c5;
makeRequest(url,query,null);
}
function do_queryInto(_c8,_c9,_ca,_cb,_cc,_cd){
var _ce=connection.sessionId;
if(_ce==""||(_c8==""&&_c9=="")||!_cc){
return;
}
if(_ca==null||_ca==undefined){
_ca=0;
}
if(_cb==null||_cb==undefined){
_cb=25;
}
if(_c9){
var url=connection.address.query+"?sessionId="+_ce+"&queryid="+_c9+"&start="+_ca+"&length="+_cb;
}else{
if(_cd){
var url=connection.address.query+"?sessionId="+_ce+"&tableid="+_c8+"&queryid=&start="+_ca+"&length="+_cb;
}else{
var url=connection.address.allrecords+"?sessionId="+_ce+"&tableid="+_c8+"&start="+_ca+"&length="+_cb;
}
}
if(_cd&&_cd!=""){
url+=_cd;
}
var _d0=getXMLHttpRequest();
if(_d0){
_d0.onreadystatechange=function(){
query(_d0,_cc);
};
try{
if(_cc.onbeforeload){
_cc.onbeforeload();
}
_d0.open("GET",url,true);
_d0.send(null);
}
catch(e){
if(browser.ie6){
_d0.onreadystatechange=function(){
};
}else{
_d0.onreadystatechange=null;
}
delete _d0;
}
}
}
function do_queryRelated(_d1,_d2,_d3,_d4,_d5){
var _d6=connection.sessionId;
if(_d6==""||!_d5){
return;
}
var url="QueryRelatedRecords"+"?sessionId="+_d6+"&relatedtableid="+_d1+"&relatedrecordid="+_d2+"&linktableid="+_d3+"&targettableid="+_d4;
var _d8=getXMLHttpRequest();
if(_d8){
_d8.onreadystatechange=function(){
query(_d8,_d5);
};
try{
_d8.open("GET",url,true);
_d8.send(null);
}
catch(e){
if(browser.ie6){
_d8.onreadystatechange=function(){
};
}else{
_d8.onreadystatechange=null;
}
delete _d8;
}
}
}
function do_drawWindow(_d9,_da,_db,_dc){
dax.init();
var _dd=WindowManager.createNewWindow();
if(_db){
_dd.contentArea.appendChild(_db);
}
if(_d9){
_dd.titleBar.innerHTML=_d9;
}
if(_da){
_dd.addToolbar(_da);
}
if(_dc){
var _de=_dd.status.appendChild(_dc);
_de.parent=_dd;
}
_dd.open();
_dd.size(_dd.dom.offsetWidth,_dd.dom.offsetHeight);
_dd.activate();
return _dd.dom;
}
function do_shrink(_df,_e0){
if(window.shrinking||_df.style.display=="none"){
return null;
}
var _e1=new Object();
_df.startWidth=_df.offsetWidth;
_df.startHeight=_df.offsetHeight;
_df.startDisplay=_df.style.display;
_df.currentWidth=_df.offsetWidth;
_df.currentHeight=_df.offsetHeight;
_e1.object=_df;
_e1.direction=_e0;
_e1.shrink=shrink;
return _e1.shrink();
}
function do_grow(_e2,_e3){
if(window.growing){
return null;
}
if(!_e2.startHeight&&!_e2.startWidth){
return null;
}
var _e4=new Object();
_e2.style.display=_e2.startDisplay;
_e4.object=_e2;
_e4.direction=_e3;
_e4.grow=grow;
return _e4.grow();
}
function do_roundCorners(_e5,_e6){
var rc=getElementByClassName(document,"roundedCornerObject");
if(!rc){
return;
}
rc=rc.cloneNode(true);
var _e8=document.getElementsByTagName("body").item(0);
_e8.insertBefore(rc,_e5);
var _e9=getElementByClassName(rc,"roundedCornerObjectBody");
_e9.appendChild(_e5);
rc.style.display="";
var bg=_e5.style.backgroundColor;
if(bg.length==0){
bg=getCSSPropertyValue(_e5.className,"background-color");
}
rc.style.backgroundColor=bg;
}
function do_accordion(_eb,_ec){
var _ed="";
if(_ec=="up"){
_ed="down";
}else{
if(_ec=="left"){
_ed="right";
}else{
return;
}
}
var rv=null;
if(!(rv=do_shrink(_eb,_ec))){
rv=do_grow(_eb,_ed);
}
return rv;
}
function do_showDashboard(_ef,_f0){
var _f1=$("blackout");
if(!_f1){
return;
}
if(!_f1.dashboard){
_f1.dashboard=new Dashboard(_f1);
}
if(_ef){
_ef.style.position="absolute";
_f1.dashboard.add(_ef);
if(_f0==undefined){
do_enableDragging(_ef);
}else{
switch(_f0){
case "Full":
do_enableDragging(_ef);
break;
case "None":
break;
default:
var _f2=$("top_dash"+_f0);
setStyle(_f2,"cursor","move");
_f2.onmousedown=function(_f3){
startDragOtherObject(_f3,_ef);
};
var _f2=$("left_dash"+_f0);
setStyle(_f2,"cursor","move");
_f2.onmousedown=function(_f4){
startDragOtherObject(_f4,_ef);
};
var _f2=$("right_dash"+_f0);
setStyle(_f2,"cursor","move");
_f2.onmousedown=function(_f5){
startDragOtherObject(_f5,_ef);
};
var _f2=$("bottom_dash"+_f0);
setStyle(_f2,"cursor","move");
_f2.onmousedown=function(_f6){
startDragOtherObject(_f6,_ef);
};
break;
}
}
}
var _f7=9100;
for(var i in _f1.dashboard.widgets){
_f1.dashboard.widgets[i].style.display="";
_f1.dashboard.widgets[i].style.zIndex=_f7+1;
}
_f1.style.display="block";
_f1.style.left="0px";
_f1.style.zIndex=_f7;
}
function do_hideDashboard(_f9){
if((isAdminAccessedFromMainPage)&&(isAdminLoaded)){
window.onbeforeunload=null;
window.location.reload(false);
}
var _fa=$("blackout");
if(!_fa){
return;
}
if(_fa.dashboard){
for(var i in _fa.dashboard.widgets){
_fa.dashboard.widgets[i].style.display="none";
_fa.dashboard.widgets[i].style.zIndex="";
}
}
if(_f9){
if(_fa.dashboard){
_fa.dashboard.remove(_f9);
}
}
if(aSidebar){
do_redrawSidebar();
}
_fa.style.display="none";
_fa.style.zIndex="";
}
function do_removeDashboardObject(_fc){
var _fd=$("blackout");
if(!_fd){
return;
}
if(_fc){
if(_fd.dashboard){
_fd.dashboard.remove(_fc);
_fc.style.display="none";
}
}
}
function do_enableDragging(_fe){
setStyle(_fe,"cursor","move");
_fe.onmousedown=startDragObject;
}
function do_disableDragging(_ff){
_ff.style.cursor="auto";
_ff.onmousedown=null;
}
function do_createTabHolder(text,_101){
if(text==""){
return;
}
var _102=$("tabObject");
if(!_102){
return null;
}
_102=_102.cloneNode(true);
_102.tabs=new Array(0);
do_addTab(_102,text);
if(_101){
var _103=_101.childNodes;
if(_103){
_101.insertBefore(_102,_103[0]);
}else{
_101.appendChild(_102);
}
_102.parent=_101;
}
_102.style.display="block";
return _102;
}
function do_addTab(_104,text){
if(!_104||text==""){
return;
}
var _106=getElementByClassName(_104,"tabContainer");
var _107=null;
if(_104.first){
_107=_104.first.cloneNode(true);
}else{
_107=getElementByClassName(_106,"tabItem");
_104.first=_107;
}
if(_107){
var _108=getElementByClassName(_107,"tabItemBody");
_108.innerHTML=text;
_104.last=_107;
_106.appendChild(_107);
_107.onclick=function(_109){
activateTab(_109,this);
};
_107.parent=_104;
_107.value=text;
var _10a=getElementByClassName(_107,"tabItemActive");
_107.actor=_10a?_10a:getElementByClassName(_107,"tabItemInactive");
var _10b=_104.tabs.push(_107);
var _10c=getElementByClassName(_104,"tabCloser");
if(_10c){
_10c.onclick=function(){
do_removeTab(_104);
};
}
activateTab(null,_107);
}
return _107;
}
function do_removeTab(_10d,_10e){
if(!_10d.tabs){
return;
}
if(_10e>=0){
var tab=_10d.tabs[_10e];
}else{
var tab=_10d.current;
for(var i in _10d.tabs){
if(_10d.tabs[i]==tab){
_10e=i;
}
}
}
if(tab){
var _111=getElementByClassName(_10d,"tabContainer");
_111.removeChild(tab);
_10d.tabs.splice(_10e,1);
if(_10d.tabs.length>0){
_10d.current=_10d.tabs[_10d.tabs.length-1];
_10d.last=_10d.current;
_10d.current.onclick();
}else{
if(_10d.parent){
_10d.parent.tabholder=null;
_10d.parent.removeChild(_10d);
}
}
}
}
function do_populateElementsByIds(ids,_113,_114,_115){
var _116=connection.sessionId;
if(!ids||_116==""){
return;
}
var _117=getXMLHttpRequest();
if(_117){
var url=connection.address.getrecord+"?sessionId="+_116+"&tableid="+_113+"&recordid="+_114;
_117.onreadystatechange=function(){
populateElementsByIds(_117,ids,_115);
};
try{
_117.open("GET",url,true);
_117.send(null);
}
catch(e){
if(browser.ie6){
_117.onreadystatechange=function(){
};
}else{
_117.onreadystatechange=null;
}
delete _117;
}
}
}
function purgeparents(d){
for(var _11a in d){
if(d[_11a]){
if(d[_11a].parent){
d[_11a].parent=null;
}
}
}
}
function purge(d){
var a=d.attributes,i,l,n;
if(a){
l=a.length;
for(i=0;i<l;i+=1){
n=a[i].name;
if(typeof d[n]==="function"){
d[n]=null;
}
if(n=="parent"){
d[n]=null;
}
}
}
a=d.childNodes;
if(a){
l=a.length;
for(i=0;i<l;i+=1){
purge(d.childNodes[i]);
}
}
}
function dax_setDraggable(_120){
dax_bridge.dax_nodrag=false;
_120.onmousedown=dax_startHoverDragging;
}
function dax_setNoDrag(){
dax_bridge.dax_nodrag=true;
}
function dax_setDrag(){
dax_bridge.dax_nodrag=false;
}
function dax_startHoverDragging(_121,_122){
if(dax_bridge.hoverDragging){
return false;
}
if(dax_bridge.dax_nodrag){
return true;
}
if(!_122){
var _122=this;
}
dax_bridge.hoverDragging={dragObjectSource:_122,dragObjectHover:_122.cloneNode(true)};
generateUniqueId(dax_bridge.hoverDragging.dragObjectHover);
var _123=dax_bridge.hoverDragging.dragObjectHover;
var _124=dax_bridge.hoverDragging.dragObjectSource;
document.body.appendChild(_123);
dax_bridge.hoverDragging.dragObjectHover.style.zIndex=9999;
dax_bridge.hoverDragging.dragObjectHover.style.position="absolute";
var _121=xpEvent(_121,true);
var _125=getMousePosition(_121);
_123.style.left=_125.x+10+"px";
_123.style.top=_125.y+10+"px";
if(document.addEventListener){
document.addEventListener("mousemove",dax_hoverDragging,true);
document.addEventListener("mouseup",dax_hoverDraggingStop,true);
}else{
document.onmousemove=dax_hoverDragging;
document.onmouseup=dax_hoverDraggingStop;
}
if(_124.ondragstart){
_124.ondragstart(_121);
}
return false;
}
function dax_hoverDragging(_126){
if(!dax_bridge.hoverDragging){
return;
}
var _126=xpEvent(_126,true,true);
var _127=dax_bridge.hoverDragging.dragObjectSource;
var _128=dax_bridge.hoverDragging.dragObjectHover;
var _129=getMousePosition(_126);
_128.style.left=_129.x+10+"px";
_128.style.top=_129.y+10+"px";
if(_127.ondragging){
_127.ondragging(_126);
}
return false;
}
function dax_hoverDraggingStop(_12a){
if(!dax_bridge.hoverDragging){
return;
}
var _12b=dax_bridge.hoverDragging.dragObjectSource;
var _12c=dax_bridge.hoverDragging.dragObjectHover;
if(document.removeEventListener){
document.removeEventListener("mousemove",dax_hoverDragging,true);
document.removeEventListener("mouseup",dax_hoverDraggingStop,true);
}else{
document.onmousemove=null;
document.onmouseup=null;
}
if(dax_bridge.hoverDragging.target){
dax_bridge.hoverDragging.target.ondragrelease(_12a);
}
document.body.removeChild(_12c);
dax_bridge.hoverDragging=null;
}
function makeCSS(_12d,_12e){
if(!dax_bridge.styleNode){
var _12f=document.createElement("style");
_12f.setAttribute("type","text/css");
_12f.setAttribute("media","screen");
document.getElementsByTagName("head")[0].appendChild(_12f);
dax_bridge.styleNode=_12f;
}else{
var _12f=dax_bridge.styleNode;
}
if(!browser.ie){
_12f.appendChild(document.createTextNode(_12d+" {"+_12e+"}"));
}
if(browser.ie&&document.styleSheets&&document.styleSheets.length>0){
var _130=document.styleSheets[document.styleSheets.length-1];
if(typeof (_130.addRule)=="object"){
_130.addRule(_12d,_12e);
}
}
}

function WindowManager_createNewWindow(){
var _1=null;
try{
_1=new Window();
}
catch(e){
alert(e.description+e.message+e.number+e.name);
}
return _1;
}
function WindowManager_insertWindow(_2){
for(var i=0;i<this.windows.length;i++){
if(this.windows[i]==_2){
return this.windows[i];
}
}
if(!this.windowTarget){
this.windowTarget=new WindowTarget();
}
var _4=this.windowTarget.area;
_4.insertBefore(_2.dom,null);
return this.windows.push(_2);
}
function WindowManager_destroyWindow(_5,_6){
if(this.active==_5){
WindowManager.active=null;
}
var _7=-1;
for(var i=0;i<WindowManager.windows.length;i++){
if(WindowManager.windows[i]==_5){
_7=i;
}
}
if(!_6){
_5.close();
}
if(_5.tbitem&&_5.tbitem.remove){
_5.tbitem.remove();
}
_5.dom.parentNode.removeChild(_5.dom);
if(_7>-1){
WindowManager.windows[_7]=null;
WindowManager.windows.splice(_7,1);
}
}
function WindowManager_hideWindow(_9){
if(this.active==_9){
WindowManager.active=null;
}
do_accordion(_9.dom,"top");
setStyle(_9.dom,"display","none");
}
function WindowManager_redraw(){
var _a;
for(var i=0;i<this.windows.length;i++){
_a=this.windows[i];
_a.size(_a.dom.offsetWidth,_a.dom.offsetHeight);
}
}
function WindowManager(){
this.active=null;
this.maxZIndex=0;
this.maxZDashIndex=9110;
this.windowTarget=null;
this.windows=new Array();
this.scroll=null;
this.createNewWindow=WindowManager_createNewWindow;
this.insertWindow=WindowManager_insertWindow;
this.destroyWindow=WindowManager_destroyWindow;
this.hideWindow=WindowManager_hideWindow;
this.redraw=WindowManager_redraw;
return this;
}
var WindowManager=new WindowManager();
function findWindowByTableId(_c){
for(ta=0;ta<WindowManager.windows.length;ta++){
if(WindowManager.windows[ta].tableId==_c){
return WindowManager.windows[ta];
}
}
return null;
}
function WindowTarget(){
this.area=document.body;
return this;
}
function windowDragStart(_d){
this.parent.activate();
this.parent.ondragstart();
var x=0;
var y=0;
if(browser.ie){
x=window.event.screenX;
y=window.event.screenY;
document.onmousemove=windowDragging;
document.onmouseup=windowDragStop;
}else{
x=_d.pageX;
y=_d.pageY;
document.addEventListener("mousemove",windowDragging,true);
document.addEventListener("mouseup",windowDragStop,true);
_d.preventDefault();
}
WindowManager.active.offsetX=WindowManager.active.dom.offsetLeft-x;
WindowManager.active.offsetY=WindowManager.active.dom.offsetTop-y;
WindowManager.active.dragging=true;
}
function windowDragging(_10){
var x=0;
var y=0;
if(!WindowManager.active.dragging){
return;
}
if(browser.ie){
x=window.event.screenX;
y=window.event.screenY;
window.event.cancelBubble=true;
window.event.returnValue=false;
}else{
x=_10.pageX;
y=_10.pageY;
_10.preventDefault();
}
x=(x+WindowManager.active.offsetX);
y=(y+WindowManager.active.offsetY);
if(x>=0){
WindowManager.active.dom.style.left=x+"px";
}
if(y>=0){
WindowManager.active.dom.style.top=y+"px";
}
}
function windowDragStop(_13){
WindowManager.active.dragging=false;
if(browser.ie){
document.onmousemove=null;
document.onmouseup=null;
}else{
document.removeEventListener("mousemove",windowDragging,true);
document.removeEventListener("mouseup",windowDragStop,true);
}
WindowManager.active.ondragstop();
}
function Window_destroy(){
purgeparents(this);
if(this.grid){
this.contentArea.grid=null;
if(this.currentTab){
this.currentTab.owner=null;
this.currentTab=null;
delete this.currentTab;
}
this.grid.owner=null;
this.grid.destroy();
delete this.grid;
this.search.owner=null;
this.tabsbar.destroy();
delete this.tabsbar;
this.table=null;
}
if(this.mainToolbar){
for(var i in this.mainToolbar.prv.mContent){
this.mainToolbar.prv.mContent[i].parent=null;
}
this.mainToolbar.prv.mDOM.parent=null;
this.mainToolbar.prv.mDOM.contents=null;
}
for(var i in this.toolbars){
this.toolbars[i].parent=null;
}
this.winObj=null;
}
function Window_toString(){
return "[object Window]";
}
function Window_activate(){
var win=this;
if(win==WindowManager.active){
return;
}
if(WindowManager.active){
WindowManager.active.deactivate();
}
with(this){
dom.className="window";
dom.t.className="window_t_a";
dom.tl.className="window_tl_a";
dom.tr.className="window_tr_a";
dom.l.className="window_l_a";
dom.r.className="window_r_a";
dom.b.className="window_b_a";
dom.bl.className="window_bl_a";
dom.br.className="window_br_a";
closeBox.className="window_closebox";
minimizeBox.className="window_minimizebox";
refreshBox.className="window_refreshbox";
savePrefsBox.className="window_saveprefsbox";
win.dom.style.zIndex=++WindowManager.maxZIndex;
}
WindowManager.active=win;
setStyle(this.dom,"display","block");
if(this.tbitem){
this.tbitem.setSelected(true,true);
}
}
function Window_deactivate(){
this.dom.className="window window_inactive";
this.dom.t.className="window_t";
this.dom.tl.className="window_tl";
this.dom.tr.className="window_tr";
this.dom.l.className="window_l";
this.dom.r.className="window_r";
this.dom.b.className="window_b";
this.dom.bl.className="window_bl";
this.dom.br.className="window_br";
this.closeBox.className="window_closebox_o";
this.minimizeBox.className="window_minimizebox_o";
this.refreshBox.className="window_refreshbox_o";
this.savePrefsBox.className="window_saveprefsbox_o";
WindowManager.active=null;
}
function Window_size(_16,_17,_18){
var win=this;
var _1a=win.dom;
var _1b=win.closeBox;
var _1c=win.minimizeBox;
var _1d=win.refreshBox;
var _1e=win.titleBar;
var _1f=win.contentArea;
var _20=win.logo;
var _21=win.savePrefsBox;
if(isDefined(_16)&&_16>0){
if((!_18)&&(this.minimumWidth)&&(_16<=this.minimumWidth)){
_16=this.minimumWidth;
}
var dx=(_1a.tr.offsetWidth?_1a.tr.offsetWidth:0)+(_1a.tl.offsetWidth?_1a.tl.offsetWidth:0);
if(!_16){
return;
}
_1a.t.style.width=_16-dx+"px";
if(_21.style.display!="none"){
_1e.style.width=_16-(dx+_21.offsetWidth+_1d.offsetWidth+_1c.offsetWidth+_1b.offsetWidth+_20.offsetWidth)+"px";
}else{
_1e.style.width=_16-(dx+_1d.offsetWidth+_1c.offsetWidth+_1b.offsetWidth+_20.offsetWidth)+"px";
}
dx=(_1a.bl.offsetWidth?_1a.bl.offsetWidth:0)+(_1a.br.offsetWidth?_1a.br.offsetWidth:0);
_1a.b.style.width=_16-dx+"px";
if(this.sidebar.enabled){
this.sidebar.dom.style.width=this.sidebar.width+"px";
}
if(this.sidebar.enabled){
sidebarWidth=this.sidebar.dom.offsetWidth;
}else{
sidebarWidth=0;
}
dx=(_1a.r.offsetWidth?_1a.r.offsetWidth:0)+(_1a.l.offsetWidth?_1a.l.offsetWidth:0);
var _23=_16-dx-sidebarWidth;
_1f.style.width=_23+"px";
for(var i in this.toolbars){
var _25=this.toolbars[i];
var _26=((_23+sidebarWidth)>1000)?(_23+sidebarWidth):1000;
if((this.doResizeToolbar)&&(_25.className!="dax_tabs_container")){
_25.style.width=_26+"px";
}else{
_25.style.width=_23+sidebarWidth+"px";
}
if((_25.className=="tabs_tb")||(_25.className=="tabs")){
_25.style.width=_23+"px";
}
}
win.status.style.width=_23+sidebarWidth+"px";
_1a.m.style.width=_23+sidebarWidth+"px";
_1a.style.width=_16+"px";
}
if(isDefined(_17)&&_17>0){
if((!_18)&&(this.minimumHeight)&&(_17<=this.minimumHeight)){
_17=this.minimumHeight;
}
var dy=(_1a.b.offsetHeight?_1a.b.offsetHeight:0)+(_1a.t.offsetHeight?_1a.t.offsetHeight:0);
var _28=0;
for(var i in this.toolbars){
_28+=(this.toolbars[i].offsetHeight?this.toolbars[i].offsetHeight:0);
}
if(!_17){
return;
}
if(_17-dy-_28-(win.status.offsetHeight?win.status.offsetHeight:0)>0){
_1f.style.height=_17-dy-_28-(win.status.offsetHeight?win.status.offsetHeight:0)+"px";
}
_1a.l.style.height=_17-dy+"px";
_1a.r.style.height=_17-dy+"px";
_1a.style.height=_17+"px";
if(this.sidebar.enabled){
this.sidebar.dom.style.height=_1f.style.height;
}
}
this.onsize();
}
function Window_resize(dx,dy,_2b){
var _2c=0;
var _2d=0;
if(dx==undefined||dx==null){
dx=0;
}
if(dy==undefined||dy==null){
dy=0;
}
_2c=this.dom.offsetWidth+dx;
_2d=this.dom.offsetHeight+dy;
this.size(_2c,_2d,_2b);
}
function Window_resizeToolbar(_2e){
if(_2e==false){
this.doResizeToolbar=false;
}else{
this.doResizeToolbar=true;
}
}
function Window_setTitle(_2f){
if(_2f){
this.titleBar.innerHTML=_2f;
}
}
function Window_addToolbar(_30,obj){
if(this.toolbars.length>0){
var tb=this.toolbar.cloneNode(false);
if(obj){
this.dom.m.insertBefore(tb,obj);
}else{
this.dom.m.insertBefore(tb,getElementByClassName(this.dom,"window_sidebarleft"));
}
}else{
var tb=this.toolbar;
}
tb.appendChild(_30);
this.toolbars.push(_30);
}
function Window_removeToolbar(_33){
for(var i=0;i<this.toolbars.length;i++){
if(_33==this.toolbars[i]){
this.toolbars.splice(i,1);
return this.dom.m.removeChild(_33.parentNode);
}
}
}
function Window_close(){
this.onclose();
}
function Window_open(){
WindowManager.insertWindow(this);
this.size(this.dom.offsetWidth,this.dom.offsetHeight);
this.activate();
this.onopen();
}
function Window_empty(){
}
function Window_addSidebar(_35,_36){
this.sidebar={enabled:true,direction:(_35=="left")?"left":"right",width:_36?_36:160,dom:(_35=="left")?getElementByClassName(this.dom,"window_sidebarleft"):getElementByClassName(this.dom,"window_sidebarright")};
this.sidebar.dom.style.display="block";
}
function Window_hideSidebar(){
this.sidebar.enabled=false;
this.sidebar.width=0;
this.sidebar.dom.style.display="none";
}
function Window(){
this.onclose=function(){
};
node=getTemplate("window");
if(!node){
return null;
}
this.toString=Window_toString;
this.destroy=Window_destroy;
this.activate=Window_activate;
this.deactivate=Window_deactivate;
this.size=Window_size;
this.resize=Window_resize;
this.addSidebar=Window_addSidebar;
this.hideSidebar=Window_hideSidebar;
this.resizeToolbar=Window_resizeToolbar;
this.setTitle=Window_setTitle;
var _37=WindowManager.windows.length;
this.sidebar={enabled:false,direction:null};
this.dom=node.cloneNode(true);
this.dom.tl=getElementByClassName(this.dom,"window_tl");
this.dom.l=getElementByClassName(this.dom,"window_l");
this.dom.bl=getElementByClassName(this.dom,"window_bl");
this.dom.t=getElementByClassName(this.dom,"window_t");
this.dom.m=getElementByClassName(this.dom,"window_m");
this.dom.b=getElementByClassName(this.dom,"window_b");
this.dom.tr=getElementByClassName(this.dom,"window_tr");
this.dom.r=getElementByClassName(this.dom,"window_r");
this.dom.br=getElementByClassName(this.dom,"window_br");
this.dom.top=getElementByClassName(this.dom,"window_top");
this.dom.btm=getElementByClassName(this.dom,"window_bottom");
this.logo=getElementByClassName(this.dom,"window_logo");
this.titleBar=getElementByClassName(this.dom,"window_title");
this.toolbar=getElementByClassName(this.dom,"window_toolbar");
this.contentArea=getElementByClassName(this.dom,"window_content");
this.closeBox=getElementByClassName(this.dom,"window_closebox");
this.minimizeBox=getElementByClassName(this.dom,"window_minimizebox");
this.refreshBox=getElementByClassName(this.dom,"window_refreshbox");
this.savePrefsBox=getElementByClassName(this.dom,"window_saveprefsbox");
this.status=getElementByClassName(this.dom,"window_status");
this.message=getElementByClassName(this.dom,"window_status_message");
this.toolbars=new Array();
this.doResizeToolbar=true;
this.dom.id=this.dom.className+_37;
this.dom.parent=this;
this.dom.style.display="block";
if(WindowManager.active){
this.dom.style.top=WindowManager.active.dom.offsetTop+25+"px";
this.dom.style.left=WindowManager.active.dom.offsetLeft+25+"px";
this.dom.style.width=WindowManager.active.dom.offsetWidth+"px";
this.dom.style.height=WindowManager.active.dom.offsetHeight+"px";
}else{
this.dom.style.top="40px";
this.dom.style.left="200px";
}
this.dom.style.zIndex=++WindowManager.maxZIndex;
this.dom.tl.onmousedown=resizeDragStart;
this.dom.t.onmousedown=resizeDragStart;
this.dom.tr.onmousedown=resizeDragStart;
this.dom.l.onmousedown=resizeDragStart;
this.dom.r.onmousedown=resizeDragStart;
this.dom.bl.onmousedown=resizeDragStart;
this.dom.b.onmousedown=resizeDragStart;
this.dom.br.onmousedown=resizeDragStart;
if(this.titleBar){
this.titleBar.id=this.titleBar.className+_37;
this.titleBar.parent=this;
this.titleBar.onmousedown=windowDragStart;
}
if(this.contentArea){
this.contentArea.id=this.contentArea.className+_37;
this.contentArea.parent=this;
this.contentArea.onmousedown=function(){
this.parent.activate();
};
}
if(this.toolbar){
this.toolbar.parent=this;
generateUniqueId(this.toolbar);
this.toolbar.onmousedown=function(){
this.parent.activate();
};
}
if(this.status){
this.status.parent=this;
this.status.onmousedown=function(){
this.parent.activate();
};
}
if(this.closeBox){
this.closeBox.parent=this;
this.closeBox.id=this.closeBox.className+_37;
function Window_closeBox_onmousedown(_38){
var _38=xpEvent(_38,true);
this.className="window_closebox_d";
this.parent.activate();
}
function Window_closeBox_onmouseup(_39){
if(_39){
var _39=xpEvent(_39,true);
}
var _3a=this.parent;
_3a.onclose();
WindowManager.destroyWindow(this.parent);
setTimeout(function(){
_3a=null;
},1);
return false;
}
function Window_closeBox_onmouseover(){
this.className="window_closebox_a";
}
function Window_closeBox_onmouseout(){
if(WindowManager.active==this.parent){
this.className="window_closebox";
}else{
this.className="window_closebox_o";
}
}
this.closeBox.onmousedown=Window_closeBox_onmousedown;
this.closeBox.onmouseup=Window_closeBox_onmouseup;
this.closeBox.onmouseover=Window_closeBox_onmouseover;
this.closeBox.onmouseout=Window_closeBox_onmouseout;
}
if(this.minimizeBox){
this.minimizeBox.parent=this;
this.minimizeBox.id=this.minimizeBox.className+_37;
function Window_minimizeBox_onmouseover(){
this.className="window_minimizebox_a";
}
function Window_minimizeBox_onmouseout(){
if(WindowManager.active==this.parent){
this.className="window_minimizebox";
}else{
this.className="window_minimizebox_o";
}
}
function Window_minimizeBox_onmousedown(_3b){
var _3b=xpEvent(_3b,true);
this.className="window_minimizebox_d";
this.parent.activate();
}
function Window_minimizeBox_onmouseup(_3c){
var _3c=xpEvent(_3c,true);
WindowManager.hideWindow(this.parent);
return false;
}
this.minimizeBox.onmouseover=Window_minimizeBox_onmouseover;
this.minimizeBox.onmouseout=Window_minimizeBox_onmouseout;
this.minimizeBox.onmousedown=Window_minimizeBox_onmousedown;
this.minimizeBox.onmouseup=Window_minimizeBox_onmouseup;
}
if(this.savePrefsBox){
this.savePrefsBox.parent=this;
this.savePrefsBox.id=this.savePrefsBox.className+_37;
function Window_savePrefsBox_onmouseover(_3d){
this.className="window_saveprefsbox_a";
mousePos=getMousePosition(_3d);
showTooltip(STR["save_column_width"],mousePos.x,mousePos.y);
}
function Window_savePrefsBox_onmouseout(){
hideTooltip();
if(WindowManager.active==this.parent){
this.className="window_saveprefsbox";
}else{
this.className="window_saveprefsbox_o";
}
}
function Window_savePrefsBox_onmousedown(_3e){
var _3e=xpEvent(_3e,true);
this.className="window_saveprefsbox_d";
this.parent.activate();
}
function Window_savePrefsBox_onmouseup(_3f){
var _3f=xpEvent(_3f,true);
this.className="window_saveprefsbox";
var _40=this.parent.contentArea.grid;
var url=dax_bridge.url+"AdminSetPreferences?sessionId="+dax_bridge.sessionId+"&dax_colwidth_"+this.parent.tableId+"=";
for(var _42=0;_42<_40.grid.prv.mColumns.length;_42++){
url+=_40.grid.prv.mColumns[_42].fieldId+":"+_40.grid.prv.mColumns[_42].prv.mWidth+"_";
}
makeCall(url,null,null,null);
return false;
}
this.savePrefsBox.onmouseover=Window_savePrefsBox_onmouseover;
this.savePrefsBox.onmouseout=Window_savePrefsBox_onmouseout;
this.savePrefsBox.onmousedown=Window_savePrefsBox_onmousedown;
this.savePrefsBox.onmouseup=Window_savePrefsBox_onmouseup;
}
if(this.refreshBox){
this.refreshBox.parent=this;
this.refreshBox.id=this.refreshBox.className+_37;
function Window_refreshBox_onmouseover(){
this.className="window_refreshbox_a";
}
function Window_refreshBox_onmouseout(){
if(WindowManager.active==this.parent){
this.className="window_refreshbox";
}else{
this.className="window_refreshbox_o";
}
}
function Window_refreshBox_onmousedown(_43){
var _43=xpEvent(_43,true);
this.className="window_refreshbox_d";
this.parent.activate();
}
function Window_refreshBox_onmouseup(_44){
var _44=xpEvent(_44,true);
this.className="window_refreshbox";
var _45=(this.parent.contentArea.grid);
if(_45){
_45.reload();
}
return false;
}
this.refreshBox.onmouseover=Window_refreshBox_onmouseover;
this.refreshBox.onmouseout=Window_refreshBox_onmouseout;
this.refreshBox.onmousedown=Window_refreshBox_onmousedown;
this.refreshBox.onmouseup=Window_refreshBox_onmouseup;
}
this.status.parent=this;
this.addToolbar=Window_addToolbar;
this.removeToolbar=Window_removeToolbar;
this.close=Window_close;
this.open=Window_open;
this.onsize=Window_empty;
this.onsizestart=Window_empty;
this.onsizestop=Window_empty;
this.onclose=Window_empty;
this.onopen=Window_empty;
this.ondragstart=Window_empty;
this.ondragstop=Window_empty;
this.minimumWidth=150;
this.minimumHeight=125;
this.useMinimumToolbarWidth=false;
return this;
}
function resizeDragStart(_46){
if(!WindowManager.active||WindowManager.active.dragging){
return;
}
WindowManager.active.resizing=true;
var _47=getParentByClassName(this,"window");
if(!_47){
var _47=getParentByClassName(this,"window_inactive",true);
}
if(_47.parent.activate){
_47.parent.activate();
}
var x=0;
var y=0;
if(browser.ie){
document.onmousemove=resizeDragging;
document.onmouseup=resizeDragStop;
if(document.documentElement&&document.documentElement.scrollTop){
addx=document.documentElement.scrollLeft;
addy=document.documentElement.scrollTop;
}else{
if(document.body){
addx=document.body.scrollLeft;
addy=document.body.scrollTop;
}
}
x=window.event.clientX+addx;
y=window.event.clientY+addy;
}else{
document.addEventListener("mousemove",resizeDragging,true);
document.addEventListener("mouseup",resizeDragStop,true);
x=_46.pageX;
y=_46.pageY;
}
var _4a=this.className;
var _4b=_4a.substring(_4a.indexOf("_")+1,_4a.lastIndexOf("_"));
WindowManager.active.north=_4b.indexOf("t")!=-1?true:false;
WindowManager.active.south=_4b.indexOf("b")!=-1?true:false;
WindowManager.active.east=_4b.indexOf("r")!=-1?true:false;
WindowManager.active.west=_4b.indexOf("l")!=-1?true:false;
WindowManager.active.oldY=y;
WindowManager.active.oldCY=WindowManager.active.dom.offsetHeight;
WindowManager.active.oldX=x;
WindowManager.active.oldCX=WindowManager.active.dom.offsetWidth;
WindowManager.active.onsizestart();
}
function resizeDragging(_4c){
if(!WindowManager.active||!WindowManager.active.resizing){
return;
}
var x=0;
var y=0;
if(browser.ie){
if(document.documentElement&&document.documentElement.scrollTop){
addx=document.documentElement.scrollLeft;
addy=document.documentElement.scrollTop;
}else{
if(document.body){
addx=document.body.scrollLeft;
addy=document.body.scrollTop;
}
}
x=window.event.clientX+addx;
y=window.event.clientY+addy;
window.event.cancelBubble=true;
window.event.returnValue=false;
}else{
x=_4c.pageX;
y=_4c.pageY;
_4c.preventDefault();
}
var h=0;
var w=0;
if(WindowManager.active.north){
WindowManager.active.dom.style.top=y+"px";
h=WindowManager.active.oldCY+WindowManager.active.oldY-y;
}else{
if(WindowManager.active.south){
h=y-WindowManager.active.dom.offsetTop;
}
}
if(WindowManager.active.east){
w=x-WindowManager.active.dom.offsetLeft;
}else{
if(WindowManager.active.west){
WindowManager.active.dom.style.left=x+"px";
w=WindowManager.active.oldCX+WindowManager.active.oldX-x;
}
}
WindowManager.active.size(w,h);
}
function resizeDragStop(_51){
if(!WindowManager.active||!WindowManager.active.resizing){
return;
}
WindowManager.active.onsizestop();
WindowManager.active.resizing=false;
if(browser.ie){
document.onmousemove=null;
document.onmouseup=null;
}else{
document.removeEventListener("mousemove",resizeDragging,true);
document.removeEventListener("mouseup",resizeDragStop,true);
}
}
function Shapable(_52){
this.dom=_52;
this.height=0;
this.width=0;
this.contract=function(_53,_54,_55){
if(browser.ie){
setStyle(this.dom,"display","none");
return;
}
if(!this.height){
this.height=xpGetSize(this.dom).height;
}
setStyle(this.dom,"overflow","hidden");
var ref=this;
var _54=Math.min(_54,this.dom.clientHeight);
var _55=isDefined(_55)?_55:0;
if(this.dom.clientHeight>0){
setStyle(this.dom,"height",(this.dom.clientHeight)-_54+"px");
setTimeout(function(){
ref.contract(_53,_54);
},_53);
}else{
setStyle(this.dom,"display","none");
}
};
this.expand=function(_57,_58){
if(!isDefined(this.height)){
return;
}
if(browser.ie){
setStyle(this.dom,"display","block");
setStyle(this.dom,"top","29px");
return;
}
setStyle(this.dom,"display","");
setStyle(this.dom,"overflow","hidden");
var _57=isDefined(_57)?_57:1;
var _58=isDefined(_58)?_58:Math.floor(this.height/4);
var ref=this;
var _58=Math.min(_58,this.height-this.dom.clientHeight);
if(this.dom.clientHeight<this.height){
setStyle(this.dom,"height",(this.dom.clientHeight)+_58+"px");
setTimeout(function(){
ref.expand(_57,_58);
},_57);
}else{
this.prv.mDOM.owner.redraw();
setStyle(this.dom,"overflow","hidden");
}
};
}
function TearAway(){
this.prv={mDOM:getTemplate("tearaway").cloneNode(true)};
Function.decl.apply(this);
this.prv.mDOM.parent=this;
probe(this.prv.mDOM);
Shapable.apply(this,[this.prv.mDOM]);
this.getDOM().style.zIndex=++WindowManager.maxZIndex;
i=1;
while($("tearaway"+i)!=null){
i++;
}
this.prv.mDOM.id="tearaway"+i;
this.setContent=function(_5a){
this.prv.mDOM.middle.m.innerHTML="";
this.prv.mDOM.middle.m.insertBefore(_5a,null);
};
this.size=function(_5b,_5c){
var dom=this.prv.mDOM;
var _5e=dom.style;
if(_5b){
_5e.width=_5b+"px";
dom.middle.m.style.width=(_5b-(xpGetSize(dom.middle.ml).width+xpGetSize(dom.middle.mr).width))+"px";
dom.bottom.b.style.width=dom.middle.m.style.width;
dom.top.t.style.width=dom.middle.m.style.width;
}
if(_5c){
_5e.height=_5c+"px";
dom.middle.ml.style.height=(_5c-(xpGetSize(dom.top.tl).height+xpGetSize(dom.bottom.bl).height))+"px";
dom.middle.mr.style.height=(_5c-(xpGetSize(dom.top.tr).height+xpGetSize(dom.bottom.br).height))+"px";
}
};
this.prv.mDOM.onmousedown=startDragObject;
this.prv.mDOM.ondragstart=function(_5f){
};
this.prv.mDOM.ondragging=function(_60){
this.className="tearaway_drag";
};
this.prv.mDOM.ondragstop=function(_61){
this.className="tearaway_torn";
};
setStyle(this.prv.mDOM,"display","block");
return this;
}
TearAway.prototype=new Shapable();
function modalWindow(){
if(!($("modalwindowblackout0"))){
this.blackout=getTemplate("modalwindowblackout").cloneNode(true);
this.blackout.id="modalwindowblackout0";
document.body.appendChild(this.blackout);
}else{
this.blackout=$("modalwindowblackout0");
}
this.tearAway=new TearAway();
this.tearAway.prv.mDOM.onmousedown=null;
this.dom=this.tearAway.dom;
this.dom.className="tearaway_torn";
this.contents=getTemplate("modalwindowcontents").cloneNode(true);
i=1;
while($("modalwindowcontents"+i)!=null){
i++;
}
this.contents.id="modalwindowcontents"+i;
this.contents.style.display="block";
this.dom.middle.m.appendChild(this.contents);
this.setContents=function(_62){
this.tearAway.size(_62.offsetWidth,_62.offsetHeight);
this.contents.appendChild(_62);
};
this.setSize=function(_63,_64){
this.contents.style.width=_63+"px";
this.contents.style.height=_64+"px";
this.tearAway.size(this.contents.offsetWidth+this.tearAway.dom.middle.ml.offsetWidth+this.tearAway.dom.middle.mr.offsetWidth,this.contents.offsetHeight+this.tearAway.dom.top.t.offsetHeight+this.tearAway.dom.bottom.b.offsetHeight);
};
this.position=function(_65,_66){
this.tearAway.dom.style.left=_65+"px";
this.tearAway.dom.style.top=_66+"px";
};
this.show=function(){
if(aSidebar){
aSidebar.dom.style.display="none";
}
if(taskbar){
taskbar.dom.style.display="none";
}
this.blackout.style.display="block";
this.dom.style.display="block";
this.blackout.style.zIndex=++WindowManager.maxZIndex+23;
this.dom.style.zIndex=++WindowManager.maxZIndex+24;
};
this.hide=function(){
if(aSidebar){
aSidebar.dom.style.display="block";
}
if(taskbar){
taskbar.dom.style.display="block";
}
this.blackout.style.display="none";
this.dom.style.display="none";
};
document.body.appendChild(this.dom);
this.dom.style.position="absolute";
return this;
}
function Toolbar(_67){
this.prv={mContent:new Array(),mDOM:getTemplate("toolbar").cloneNode(true)};
Function.decl.apply(this);
if(!this.prv.mDOM){
delete this.prv;
return null;
}
this.prv.mDOM.parent=this;
probe(this.prv.mDOM);
generateUniqueId(this.prv.mDOM);
this.addButton=function(_68){
var _69=new ToolbarButton(_68);
this.addContent(_69.prv.mDOM);
return _69;
};
this.addContent=function(_6a){
this.prv.mContent.push(_6a);
this.prv.mDOM.contents.insertBefore(_6a,null);
};
this.removeContent=function(_6b){
for(var i=0;i<this.prv.mContent.length;i++){
if(_6b==this.prv.mContent[i]){
this.prv.mContent.splice(i,1);
return this.prv.mDOM.contents.removeChild(_6b);
}
}
};
this.prv.mDOM.style.display="block";
if(_67){
_67.appendChild(this.prv.mDOM);
}
return this;
}
function ToolbarButton(_6d){
this.prv={mLabel:null,mDOM:getTemplate("toolbarbutton").cloneNode(true),mDisabled:false};
Function.decl.apply(this);
if(!this.prv.mDOM){
delete this.prv;
return null;
}
this.prv.mDOM.parent=this;
probe(this.prv.mDOM);
generateUniqueId(this.prv.mDOM);
this.enable=function(){
this.prv.mDisabled=false;
this.prv.mDOM.className="toolbarbutton";
};
this.disable=function(){
this.prv.mDisabled=true;
this.prv.mDOM.className="toolbarbutton toolbarbuttondisabled";
this.prv.mDOM.l.className="l";
this.prv.mDOM.m.className="m";
this.prv.mDOM.r.className="r";
};
this.setLabel=function(_6e){
this.prv.mLabel=_6e;
this.prv.mDOM.m.label.innerHTML=_6e;
};
this.prv.mDOM.onmouseover=function(_6f){
if(this.parent.prv.mDisabled){
return false;
}
var _70=this.parent;
this.l.className="l_over";
this.m.className="m_over";
this.r.className="r_over";
};
this.prv.mDOM.onmouseout=function(_71){
this.l.className="l";
this.m.className="m";
this.r.className="r";
};
this.prv.mDOM.onmousedown=function(_72){
if(this.parent.prv.mDisabled){
return false;
}
this.l.className="l_down";
this.m.className="m_down";
this.r.className="r_down";
return false;
};
this.prv.mDOM.onmouseup=function(_73){
if(this.parent.prv.mDisabled){
return false;
}
this.l.className="l_over";
this.m.className="m_over";
this.r.className="r_over";
};
this.prv.mDOM.onclick=function(_74){
if(this.parent.prv.mDisabled){
return false;
}
var _75=this.parent;
_75.onclick(_74);
};
this.onclick=function(){
};
this.setLabel(_6d);
this.prv.mDOM.style.display="block";
return this;
}
function Viewport_destroy(){
this.parent=null;
this.owner=null;
if(this.content){
this.content.parent=null;
}
this.content=null;
this.hscrollbar.destroy();
this.vscrollbar.destroy();
}
function ViewPort(){
var _76=getTemplate("viewport");
if(!_76){
return null;
}
this.dom=_76.cloneNode(true);
generateUniqueId(this.dom);
this.vscrollbar=new VerticalScrollBar(this.dom);
this.dom.insertBefore(this.vscrollbar.dom,null);
this.vscrollbar.viewport=this;
this.hscrollbar=new HorizontalScrollBar(this.dom);
this.dom.insertBefore(this.hscrollbar.dom,null);
this.hscrollbar.viewport=this;
var _77=getTemplate("viewport_bottomrightcorner");
this.bottomrightcorner=_77.cloneNode(true);
this.dom.insertBefore(this.bottomrightcorner,null);
_77=null;
i=1;
while($("viewport_bottomrightcorner"+i)!=null){
i++;
}
this.bottomrightcorner.id="viewport_bottomrightcorner"+i;
this.parent=null;
this.content=null;
this.overflow=0;
this.hOverflow=0;
this.resizeOnRefresh=true;
this.destroy=Viewport_destroy;
this.setContent=function(_78,_79){
this.dom.insertBefore(_78,this.hscrollbar.dom);
this.content=_78;
if(isDefined(_79)){
this.setOverflow(_79);
}else{
this.setOverflow(this.content.offsetHeight-this.dom.offsetHeight,this.content.offsetWidth-this.dom.offsetWidth);
}
setStyle(this.content,"position","relative");
setStyle(this.content,"overflow","hidden");
};
this.refresh=function(){
if(!this.content){
this.vscrollbar.hide();
this.hscrollbar.hide();
return;
}else{
if(this.overflow>0){
this.vscrollbar.show();
}
if(this.hOverflow>0){
this.hscrollbar.show();
}
}
if((this.parent)&&(this.resizeOnRefresh)){
setStyle(this.dom,"width",this.parent.style.width);
setStyle(this.dom,"height",this.parent.style.height);
}
this.vscrollbar.refresh();
this.hscrollbar.refresh();
if(!browser.safari){
setStyle(this.bottomrightcorner,"zIndex",++WindowManager.maxZIndex);
setStyle(this.vscrollbar.dom,"zIndex",++WindowManager.maxZIndex);
setStyle(this.hscrollbar.dom,"zIndex",WindowManager.maxZIndex);
}else{
var _7a=true;
if(this.owner){
if(this.owner.toString()=="[object GridObject]"){
if(typeof (this.owner.owner)!="undefined"){
if(this.owner.owner.toString()=="[object DataGrid]"){
if(typeof (this.owner.owner.editor)!="undefined"){
if(this.owner.owner.editor.prv.mTearAway.prv.mDOM.style.display!="none"){
_7a=false;
}
}
}
}
}
}
if(_7a){
setStyle(this.bottomrightcorner,"zIndex",++WindowManager.maxZIndex);
setStyle(this.vscrollbar.dom,"zIndex",++WindowManager.maxZIndex);
setStyle(this.hscrollbar.dom,"zIndex",WindowManager.maxZIndex);
}
}
this.onrefresh();
if((this.vscrollbar.dom.style.display!="none")&(this.hscrollbar.dom.style.display!="none")){
if(browser.ie){
var _7b=this.hscrollbar.dom.offsetWidth+"px";
}else{
var _7b=this.hscrollbar.dom.offsetWidth+this.bottomrightcorner.offsetWidth-4+"px";
}
this.bottomrightcorner.style.left=_7b;
this.bottomrightcorner.style.top=parseInt(this.vscrollbar.dom.style.top)+this.vscrollbar.dom.offsetHeight+"px";
this.bottomrightcorner.style.display="block";
}else{
this.bottomrightcorner.style.display="none";
}
};
this.setOverflow=function(_7c,_7d){
this.overflow=_7c;
if(isDefined(_7d)){
this.hOverflow=_7d;
}
if(this.overflow<=0){
this.vscrollbar.hide();
}else{
this.vscrollbar.show();
}
if(this.hOverflow<=0){
this.hscrollbar.hide();
}else{
this.hscrollbar.show();
}
};
this.onrefresh=function(){
};
this.onvscrollstop=function(_7e){
};
this.onvscrollstart=function(_7f){
};
this.onvscroll=function(_80,_81){
setStyle(this.content,"style",(_80*(-1)*this.vscrollbar.ratio)+"px");
};
this.onhscroll=function(_82,_83){
if(!(isNaN(_82*(-1)*this.hscrollbar.ratio))){
setStyle(this.content,"left",(_82*(-1)*this.hscrollbar.ratio)+"px");
}
};
}
function HorizontalScrollBar_destroy(){
purgeparents(this);
this.lArrow=null;
this.rArrow=null;
this.slideArea=null;
this.slider=null;
this.parent=null;
this.viewport=null;
this.prv.mParent=null;
}
function HorizontalScrollBar(_84){
var _85=getTemplate("hscrollbar");
if(!_85){
return null;
}
this.dom=_85.cloneNode(true);
probe(this.dom);
generateUniqueId(this.dom);
this.lArrow=this.dom.track.arrowLeft;
this.rArrow=this.dom.track.arrowRight;
this.slideArea=this.dom.track.slideArea;
this.slider=this.dom.track.slideArea.slider;
for(var _86 in this){
this[_86].parent=this;
}
this.viewport=null;
this.ratio=1;
this.last=0;
this.pageIncrement=50;
this.increment=10;
this.destroy=HorizontalScrollBar_destroy;
this.prv={mParent:isDefined(_84)?_84:null,mVisibility:true};
Function.decl.apply(this);
this.show=function(){
if(this.prv.mVisibility){
return;
}
setStyle(this.dom,"display","block");
this.prv.mVisibility=true;
};
this.hide=function(){
if(!this.prv.mVisibility){
return;
}
setStyle(this.dom,"display","none");
this.prv.mVisibility=false;
};
this.position=function(aX,aY){
var _89=xpGetSize(this.prv.mParent).height;
var _8a=xpGetSize(this.dom).height;
if(isDefined(aX)){
this.dom.style.left=aX+"px";
}
if(!isDefined(aY)){
var aY=browser.ie?_89-_8a+1:_89-_8a+this.prv.mParent.offsetTop;
}
setStyle(this.dom,"top",aY+"px");
};
this.refresh=function(){
if(!this.prv.mParent||!this.prv.mVisibility||!this.viewport){
return;
}
this.position();
var _8b=0;
var _8c=xpGetSize(this.prv.mParent).width;
var _8d=this.viewport.vscrollbar.visible?(_8c-xpGetSize(this.viewport.vscrollbar.dom).width):_8c;
setStyle(this.dom,"width",_8d+"px");
var _8e=xpGetSize(this.slider.sliderLeft).width+xpGetSize(this.slider.sliderRight).width;
var _8f=_8d-xpGetSize(this.lArrow).width-xpGetSize(this.rArrow).width;
if(_8f>this.viewport.hOverflow){
_8b=_8f-this.viewport.hOverflow;
}else{
this.ratio=(this.viewport.hOverflow>0)&&(_8f>0)?this.viewport.hOverflow/_8f:1;
}
_8b=_8b>_8e?_8b:_8e;
setStyle(this.slider,"width",_8b+"px");
setStyle(this.slider.sliderMid,"width",_8b-(xpGetSize(this.slider.sliderLeft).width+xpGetSize(this.slider.sliderRight).width)+"px");
this.trackSpace=_8f;
this.sliderWidth=this.slider.sliderLeft.offsetWidth+this.slider.sliderRight.offsetWidth+this.slider.sliderMid.offsetWidth;
this.pageIncrement=this.pageIncrement>this.trackSpace?this.trackSpace:this.pageIncrement;
this.increment=this.increment>this.trackSpace?this.trackSpace:this.increment;
var sw=xpGetSize(this.dom.track).width-(xpGetSize(this.lArrow).width+xpGetSize(this.rArrow).width);
setStyle(this.slideArea,"width",sw+"px");
var _91=this.slider.offsetLeft+_8b;
if(_91>this.rArrow.offsetLeft){
this.scroll(this.last-(_91-this.rArrow.offsetLeft));
}else{
this.scroll(this.last);
}
};
this.scroll=function(_92){
var sh=this.slider.sliderLeft.offsetWidth+this.slider.sliderRight.offsetWidth+this.slider.sliderMid.offsetWidth;
if(_92<0||(_92+sh)>this.slideArea.offsetWidth){
return;
}
setStyle(this.slider,"left",_92+"px");
var _94=(this.last<_92);
this.onscroll(_92,_94);
this.last=_92;
};
this.slider.onmousedown=function(_95){
var _96=xpEvent(_95,true,true);
var _97=getMousePosition(_96);
WindowManager.scroll=this.parent;
WindowManager.scroll.point=getObjectPosition(this.parent.slideArea);
var _98=getObjectPosition(this);
WindowManager.scroll.offset=_97.x-_98.x;
WindowManager.scroll.last=_97.x-WindowManager.scroll.point.x-WindowManager.scroll.offset;
if(document.addEventListener){
document.addEventListener("mousemove",horizontalScrollDragging,true);
document.addEventListener("mouseup",horizontalScrollStop,true);
}else{
document.onmousemove=horizontalScrollDragging;
document.onmouseup=horizontalScrollStop;
}
this.parent.onscrollstart(WindowManager.scroll.last);
return false;
};
this.lArrow.onmousedown=function(_99){
this.className="arrow_left_down";
var _9a=this.parent;
var pos=((_9a.last-_9a.increment)<0)?0:(_9a.last-_9a.increment);
_9a.scroll(pos);
};
this.lArrow.onmouseup=function(_9c){
this.className="arrow_left";
};
this.rArrow.onmousedown=function(_9d){
this.className="arrow_right_down";
var _9e=this.parent;
var sh=_9e.slider.sliderLeft.offsetWidth+_9e.slider.sliderRight.offsetWidth+_9e.slider.sliderMid.offsetWidth;
var pos=_9e.last+_9e.increment;
pos=(pos+sh)>_9e.slideArea.offsetWidth?_9e.slideArea.offsetWidth-sh:pos;
_9e.scroll(pos);
};
this.rArrow.onmouseup=function(_a1){
this.className="arrow_right";
};
this.slideArea.onmousedown=function(_a2){
var _a3=xpEvent(_a2);
var _a4=this.parent;
var sh=_a4.slider.sliderLeft.offsetWidth+_a4.slider.sliderRight.offsetWidth+_a4.slider.sliderMid.offsetWidth;
var pt=getMousePosition(_a3);
var p=getObjectPosition(this);
var x=pt.x-p.x;
if(x<_a4.last){
_a4.scroll((_a4.last-_a4.pageIncrement)<0?0:_a4.last-_a4.pageIncrement);
}else{
if(x>_a4.last+sh){
_a4.scroll((_a4.last+_a4.pageIncrement+sh)>_a4.slideArea.offsetWidth?_a4.slideArea.offsetWidth-sh:_a4.last+_a4.pageIncrement);
}
}
return false;
};
this.onscrollstart=function(_a9){
if(this.viewport&&this.viewport.onhscrollstart){
this.viewport.onhscrollstart(_a9);
}
};
this.onscroll=function(_aa,_ab){
if(this.viewport&&this.viewport.onhscroll){
this.viewport.onhscroll(_aa,_ab);
}
};
this.onscrollstop=function(_ac){
if(this.viewport&&this.viewport.onhscrollstop){
this.viewport.onhscrollstop(_ac);
}
};
setStyle(this.dom,"display","block");
setStyle(this.dom,"position","absolute");
return this;
}
function horizontalScrollDragging(_ad){
var _ae=xpEvent(_ad,true);
var _af=getMousePosition(_ae);
var _b0=WindowManager.scroll;
var _b1=_af.x-_b0.point.x-_b0.offset;
_b0.scroll(_b1);
return false;
}
function horizontalScrollStop(_b2){
var _b3=xpEvent(_b2,true);
var _b4=getMousePosition(_b3);
var _b5=WindowManager.scroll;
var _b6=_b4.x-_b5.point.x-_b5.offset;
var _b5=WindowManager.scroll;
_b5.onscrollstop(_b6);
WindowManager.scroll=null;
if(document.removeEventListener){
document.removeEventListener("mousemove",horizontalScrollDragging,true);
document.removeEventListener("mouseup",horizontalScrollStop,true);
}else{
document.onmousemove=null;
document.onmouseup=null;
}
return false;
}
function VerticalScrollBar_destroy(){
purgeparents(this);
this.arrowTop=null;
this.arrowBottom=null;
this.slideArea=null;
this.slider=null;
this.parent=null;
this.viewport=null;
}
function VerticalScrollBar(_b7){
var _b8=getTemplate("scrollbar");
if(!_b8){
return null;
}
this.dom=_b8.cloneNode(true);
probe(this.dom);
this.arrowTop=this.dom.track.arrowTop;
this.arrowBottom=this.dom.track.arrowBottom;
this.slideArea=this.dom.track.slideArea;
this.slider=this.slideArea.slider;
this.slider.top=this.slider.sliderTop;
this.slider.mid=this.slider.sliderMid;
this.slider.bottom=this.slider.sliderBottom;
generateUniqueId(this.dom);
for(var _b9 in this){
this[_b9].parent=this;
}
this.parent=isDefined(_b7)?_b7:null;
this.visible=true;
this.viewport=null;
this.ratio=1;
this.last=0;
this.increment=10;
this.pageIncrement=50;
this.destroy=VerticalScrollBar_destroy;
this.position=function(aX,aY){
var _bc=xpGetSize(this.parent).width;
var _bd=xpGetSize(this.dom).width;
if(!isDefined(aX)){
var aX=(browser.ie)?_bc-_bd:_bc-_bd+this.parent.offsetLeft;
}
if(!isDefined(aY)){
var aY=(browser.ie)?0:this.parent.offsetTop;
}
setStyle(this.dom,"left",aX+"px");
setStyle(this.dom,"top",aY+"px");
};
this.beforeRefresh=function(){
};
this.refresh=function(){
if(!this.parent||!this.visible||!this.viewport){
return;
}
this.beforeRefresh();
var sh=0;
this.position();
var _bf=(browser.ie)?xpGetSize(this.parent).height+3:xpGetSize(this.parent).height;
var _c0=xpGetSize(this.slider.top).height+xpGetSize(this.slider.bottom).height;
var _c1=this.viewport.hscrollbar.getVisibility()?(_bf-xpGetSize(this.viewport.hscrollbar.dom).height):_bf;
setStyle(this.dom,"height",parseInt(_c1)+"px");
var _c2=_c1-xpGetSize(this.arrowTop).height-xpGetSize(this.arrowBottom).height;
if(!this.isStatic){
sh=(this.viewport.dom.offsetHeight-2*this.viewport.owner.grid.header.offsetHeight)*_c2/(this.viewport.dom.offsetHeight+this.viewport.overflow-2*this.viewport.owner.grid.header.offsetHeight);
this.pageIncrement=sh;
sh=sh>_c0?sh:_c0;
this.ratio=(this.viewport.overflow>0)&&((_c2-sh)>0)?this.viewport.overflow/(_c2-sh):1;
}else{
sh=(this.areaHeight-this.viewport.overflow)*_c2/this.areaHeight;
this.pageIncrement=sh;
sh=sh>_c0?sh:_c0;
this.ratio=(this.viewport.overflow>0)&&((_c2-sh)>0)?this.viewport.overflow/(_c2-sh):1;
}
setStyle(this.slider,"height",sh+"px");
setStyle(this.slider.mid,"height",sh-(xpGetSize(this.slider.top).height+xpGetSize(this.slider.bottom).height)+"px");
this.trackSpace=_c2;
this.sliderHeight=this.slider.top.offsetHeight+this.slider.bottom.offsetHeight+this.slider.mid.offsetHeight;
this.pageIncrement=this.pageIncrement>this.trackSpace?this.trackSpace:this.pageIncrement;
this.increment=this.increment>this.trackSpace?this.trackSpace:this.increment;
var _c3=this.dom.track.offsetHeight-(xpGetSize(this.arrowTop).height+xpGetSize(this.arrowBottom).height);
if(_c3<0){
return;
}
this.slideArea.style.height=parseInt(_c3)+"px";
if(_c3<this.slider.offsetTop){
setStyle(this.slider,"top",parseInt(_c3-this.arrowBottom.offsetHeight)+"px");
}
};
this.show=function(){
setStyle(this.dom,"display","block");
this.visible=true;
};
this.hide=function(){
setStyle(this.dom,"display","none");
this.visible=false;
};
this.scroll=function(_c4,_c5){
var sh=this.slider.top.offsetHeight+this.slider.bottom.offsetHeight+this.slider.mid.offsetHeight;
if(_c4<0||(_c4+sh)>this.slideArea.offsetHeight){
return;
}
setStyle(this.slider,"top",_c4+"px");
var _c7=(this.last<_c4);
if(!_c5){
this.onscroll(_c4,_c7);
}
this.last=_c4;
};
this.slider.onmousedown=function(_c8){
var _c9=xpEvent(_c8,true);
var pt=getMousePosition(_c9);
WindowManager.scroll=this.parent;
WindowManager.scroll.point=getObjectPosition(this.parent.slideArea);
var _cb=getObjectPosition(this);
WindowManager.scroll.offset=pt.y-_cb.y;
WindowManager.scroll.last=pt.y-WindowManager.scroll.point.y-WindowManager.scroll.offset;
if(document.addEventListener){
document.addEventListener("mousemove",verticalScrollDragging,true);
document.addEventListener("mouseup",verticalScrollStop,true);
}else{
document.onmousemove=verticalScrollDragging;
document.onmouseup=verticalScrollStop;
}
this.parent.onscrollstart(WindowManager.scroll.last);
return false;
};
this.arrowTop.onmousedown=function(_cc){
var _cd=this.parent;
var pos=_cd.last-_cd.increment<0?0:_cd.last-_cd.increment;
_cd.scroll(pos);
this.className="arrow_top_down";
};
this.arrowTop.onmouseup=function(_cf){
this.className="arrow_top";
this.parent.onscrollstop(this.parent.last);
};
this.arrowBottom.onmousedown=function(_d0){
var _d1=this.parent;
var sh=_d1.slider.top.offsetHeight+_d1.slider.bottom.offsetHeight+_d1.slider.mid.offsetHeight;
var pos=_d1.last+_d1.increment;
pos=(pos+sh)>_d1.slideArea.offsetHeight?_d1.slideArea.offsetHeight-sh:pos;
_d1.scroll(pos);
this.className="arrow_bottom_down";
};
this.arrowBottom.onmouseup=function(){
this.className="arrow_bottom";
this.parent.onscrollstop(this.parent.last);
};
this.slideArea.onmousedown=function(_d4){
var _d4=xpEvent(_d4);
var _d5=this.parent;
var sh=_d5.slider.top.offsetHeight+_d5.slider.bottom.offsetHeight+_d5.slider.mid.offsetHeight;
var pt=getMousePosition(_d4);
var p=getObjectPosition(this);
var y=pt.y-p.y;
if(y<_d5.last){
_d5.scroll((_d5.last-_d5.pageIncrement)<0?0:_d5.last-_d5.pageIncrement);
}else{
if(y>_d5.last+sh){
_d5.scroll((_d5.last+_d5.pageIncrement+sh)>_d5.slideArea.offsetHeight?_d5.slideArea.offsetHeight-sh:_d5.last+_d5.pageIncrement);
}
}
return false;
};
this.slideArea.onmouseup=function(_da){
var _db=this.parent;
_db.arrowTop.onmouseup();
_db.arrowBottom.onmouseup();
};
this.onscrollstart=function(_dc){
this.isScrolling=true;
if(this.viewport){
this.viewport.onvscrollstart(_dc);
}
};
this.onscroll=function(_dd,_de){
if(this.viewport){
this.viewport.onvscroll(_dd,_de);
}
};
this.onscrollstop=function(_df){
var sh=this.slider.top.offsetHeight+this.slider.bottom.offsetHeight+this.slider.mid.offsetHeight;
if((_df+sh)>this.slideArea.offsetHeight){
var _df=this.slideArea.offsetHeight-sh;
}
if(this.viewport){
this.viewport.onvscrollstop(_df);
}
this.isScrolling=false;
};
setStyle(this.dom,"display","block");
setStyle(this.dom,"position","absolute");
return this;
}
function verticalScrollDragging(_e1){
var _e1=xpEvent(_e1,true);
var _e2=getMousePosition(_e1);
var _e3=WindowManager.scroll;
var top=_e2.y-_e3.point.y-_e3.offset;
_e3.scroll(top);
return false;
}
function verticalScrollStop(_e5){
var _e5=xpEvent(_e5,true);
var _e6=getMousePosition(_e5);
var _e7=WindowManager.scroll;
var top=_e6.y-_e7.point.y-_e7.offset;
_e7.onscrollstop(top);
WindowManager.scroll=null;
if(document.removeEventListener){
document.removeEventListener("mousemove",verticalScrollDragging,true);
document.removeEventListener("mouseup",verticalScrollStop,true);
}else{
document.onmousemove=null;
document.onmouseup=null;
}
}
daxViewportController={activeViewport:null};
function dax_mouseWheel(_e9){
var _ea=0;
if(!_e9){
_e9=window.event;
}
if(_e9.wheelDelta){
_ea=_e9.wheelDelta/120;
if(window.opera){
_ea=-_ea;
}
}else{
if(_e9.detail){
_ea=-_e9.detail/3;
}
}
var _eb=false;
if(daxViewportController){
if(daxViewportController.activeViewport){
if(daxViewportController.activeViewport.boundTo.mouseWheelHandler){
_eb=true;
}
}
}
if((_ea)&&(_eb)){
daxViewportController.activeViewport.boundTo.mouseWheelHandler(_ea);
if(_e9.preventDefault){
_e9.preventDefault();
}
_e9.returnValue=false;
}
}
if(window.addEventListener){
window.addEventListener("DOMMouseScroll",dax_mouseWheel,false);
}
window.onmousewheel=document.onmousewheel=dax_mouseWheel;
function dax_viewport(_ec){
this.nodes={main:getTemplate("dax_viewport").cloneNode(true),vscrollbar:getTemplate("dax_vscrollbar").cloneNode(true),hscrollbar:getTemplate("dax_hscrollbar").cloneNode(true)};
generateUniqueId(this.nodes.main);
generateUniqueId(this.nodes.vscrollbar);
generateUniqueId(this.nodes.hscrollbar);
this.nodes.main.style.display="block";
this.nodes.vscrollbar.style.display="block";
this.nodes.hscrollbar.style.display="block";
_ec.appendChild(this.nodes.main);
this.nodes.main.appendChild(this.nodes.vscrollbar);
this.nodes.main.appendChild(this.nodes.hscrollbar);
this.dom={main:this.nodes.main,parent:_ec,container:getElementByClassName(this.nodes.main,"dax_viewport_container"),contents:getElementByClassName(this.nodes.main,"dax_viewport_contents"),vscrollbar:{main:this.nodes.vscrollbar,width:17,arrowup:getElementByClassName(this.nodes.vscrollbar,"dax_vscrollbar_arrowup"),arrowdown:getElementByClassName(this.nodes.vscrollbar,"dax_vscrollbar_arrowdown"),trackspace:getElementByClassName(this.nodes.vscrollbar,"dax_vscrollbar_trackspace"),slider:{main:getElementByClassName(this.nodes.vscrollbar,"dax_vscrollbar_slider"),top:getElementByClassName(this.nodes.vscrollbar,"dax_vscrollbar_slidertop"),middle:getElementByClassName(this.nodes.vscrollbar,"dax_vscrollbar_slidermiddle"),bottom:getElementByClassName(this.nodes.vscrollbar,"dax_vscrollbar_sliderbottom")}},hscrollbar:{main:this.nodes.hscrollbar,arrowleft:getElementByClassName(this.nodes.hscrollbar,"dax_hscrollbar_arrowleft"),height:17,arrowright:getElementByClassName(this.nodes.hscrollbar,"dax_hscrollbar_arrowright"),trackspace:getElementByClassName(this.nodes.hscrollbar,"dax_hscrollbar_trackspace"),slider:{main:getElementByClassName(this.nodes.hscrollbar,"dax_hscrollbar_slider"),right:getElementByClassName(this.nodes.hscrollbar,"dax_hscrollbar_sliderright"),middle:getElementByClassName(this.nodes.hscrollbar,"dax_hscrollbar_slidermiddle"),left:getElementByClassName(this.nodes.hscrollbar,"dax_hscrollbar_sliderleft")}}};
this.dom.main.boundTo=this;
this.scrollbars={ver:{show:false,showUser:true,tracking:0,scale:0,position:0,height:0,visibleHeight:0,autoHeight:true,autoContent:true,arrowStep:20,trackStep:100,overflow:0,scrollableHeight:0,useContentPxSizeWhenScrolling:false,customValues:false,scrollInterval:50},hor:{show:false,showUser:true,tracking:0,scale:0,position:0,width:0,visibleWidth:0,autoWidth:true,autoContent:true,arrowStep:20,trackStep:100,overflow:0,scrollableWidth:0,useContentPxSizeWhenScrolling:false,customValues:false,scrollInterval:50}};
this.isSuperGridChild=false;
this.properties={autoSizeLastColumn:true};
function dax_viewport_blank(){
}
this.onvscroll=dax_viewport_blank;
this.onhscroll=dax_viewport_blank;
function dax_viewport_setContents(_ed){
this.dom.contents=_ed;
this.dom.container.appendChild(_ed);
this.dom.contents.style.position="relative";
this.dom.contents.style.top="0px";
this.dom.contents.style.left="0px";
}
this.setContents=dax_viewport_setContents;
function dax_viewport_redraw(){
if(this.dom.parent){
this.dom.main.style.width=this.dom.parent.clientWidth+"px";
this.dom.main.style.height=this.dom.parent.clientHeight+"px";
}
var _ee=(this.dom.contents)?this.dom.contents.offsetWidth:0;
var _ef=(this.dom.contents)?this.dom.contents.offsetHeight:0;
if(!this.scrollbars.hor.customValues){
if((_ee>this.dom.main.offsetWidth)&&(this.scrollbars.hor.showUser)){
this.scrollbars.hor.show=true;
}else{
this.scrollbars.hor.show=false;
}
}else{
if((this.scrollbars.hor.visibleWidth<this.scrollbars.hor.width)&&(this.scrollbars.hor.showUser)){
this.scrollbars.hor.show=true;
}else{
this.scrollbars.hor.show=false;
}
}
if(!this.scrollbars.ver.customValues){
if((_ef>this.dom.main.offsetHeight)&&(this.scrollbars.ver.showUser)){
this.scrollbars.ver.show=true;
}else{
this.scrollbars.ver.show=false;
}
}else{
if((this.scrollbars.ver.visibleHeight<this.scrollbars.ver.height)&&(this.scrollbars.ver.showUser)){
this.scrollbars.ver.show=true;
}else{
this.scrollbars.ver.show=false;
}
}
if(!this.isSuperGridChild){
var _f0=(this.scrollbars.hor.show?this.dom.hscrollbar.height:0);
var _f1=(this.scrollbars.ver.show?this.dom.vscrollbar.width:0);
}else{
var _f0=0;
var _f1=0;
}
this.dom.container.style.height=this.dom.main.offsetHeight-_f0+"px";
this.dom.container.style.width=this.dom.main.offsetWidth-_f1+"px";
if(this.scrollbars.hor.show){
var _f2=true;
}else{
var _f2=false;
}
if(this.scrollbars.ver.show){
var _f3=true;
}else{
var _f3=false;
}
if(this.scrollbars.ver.autoHeight){
this.scrollbars.ver.height=_ef;
this.scrollbars.ver.visibleHeight=this.dom.container.offsetHeight;
}
if(this.scrollbars.hor.autoWidth){
this.scrollbars.hor.width=_ee;
this.scrollbars.hor.visibleWidth=this.dom.container.offsetWidth;
}
if(_f3){
this.dom.vscrollbar.main.style.display="block";
this.dom.vscrollbar.main.style.height=this.dom.main.offsetHeight-_f0+"px";
this.dom.vscrollbar.trackspace.style.height=this.dom.main.offsetHeight-_f0-this.dom.vscrollbar.arrowup.offsetHeight-this.dom.vscrollbar.arrowdown.offsetHeight+"px";
this.scrollbars.ver.tracking=this.dom.vscrollbar.trackspace.offsetHeight;
this.scrollbars.ver.scale=this.scrollbars.ver.height/this.scrollbars.ver.tracking;
var _f4=Math.round(this.scrollbars.ver.visibleHeight/this.scrollbars.ver.scale);
if(isNaN(_f4)){
_f4=0;
}
this.dom.vscrollbar.slider.main.style.height=_f4+"px";
var _f5=_f4-this.dom.vscrollbar.slider.top.offsetHeight-this.dom.vscrollbar.slider.bottom.offsetHeight;
if(_f5<0){
_f5=0;
}
this.dom.vscrollbar.slider.middle.style.height=_f5+"px";
this.scrollbars.ver.scrollableHeight=this.scrollbars.ver.tracking-_f4;
var _f6=Math.round(this.scrollbars.ver.position/this.scrollbars.ver.scale);
if(isNaN(_f6)){
_f6=0;
}
this.dom.vscrollbar.slider.main.style.top=_f6+"px";
}else{
this.dom.vscrollbar.main.style.display="none";
}
if(_f2){
this.dom.hscrollbar.main.style.display="block";
this.dom.hscrollbar.main.style.width=this.dom.main.offsetWidth-_f1+"px";
this.dom.hscrollbar.trackspace.style.width=this.dom.main.offsetWidth-_f1-this.dom.hscrollbar.arrowleft.offsetWidth-this.dom.hscrollbar.arrowright.offsetWidth+"px";
this.scrollbars.hor.tracking=this.dom.hscrollbar.trackspace.offsetWidth;
this.scrollbars.hor.scale=this.scrollbars.hor.width/this.scrollbars.hor.tracking;
var _f4=Math.round(this.scrollbars.hor.visibleWidth/this.scrollbars.hor.scale);
if(isNaN(_f4)){
_f4=0;
}
this.dom.hscrollbar.slider.main.style.width=_f4+"px";
var _f7=_f4-this.dom.hscrollbar.slider.left.offsetWidth-this.dom.hscrollbar.slider.right.offsetWidth;
if(_f7<0){
_f7=0;
}
this.dom.hscrollbar.slider.middle.style.width=_f7+"px";
this.scrollbars.hor.scrollableWidth=this.scrollbars.hor.tracking-_f4;
var _f8=Math.round(this.scrollbars.hor.position/this.scrollbars.hor.scale);
if(isNaN(_f8)){
_f8=0;
}
this.dom.hscrollbar.slider.main.style.left=_f8+"px";
this.dom.hscrollbar.slider.main.style.width=this.dom.hscrollbar.slider.left.offsetWidth+this.dom.hscrollbar.slider.middle.offsetWidth+this.dom.hscrollbar.slider.right.offsetWidth+"px";
}else{
this.dom.hscrollbar.main.style.display="none";
}
if(this.scrollbars.ver.autoHeight){
if((this.scrollbars.ver.position>(_ef-this.dom.main.offsetHeight-_f0))&&(this.scrollbars.ver.position!=0)){
this.vscroll(_ef-this.dom.main.offsetHeight-_f0);
}
}
if(this.scrollbars.hor.autoWidth){
if((this.scrollbars.hor.position>(_ee-this.dom.main.offsetWidth-_f1))&&(this.scrollbars.hor.position!=0)){
this.hscroll(_ee-this.dom.main.offsetWidth-_f1);
}
}
if((this.scrollbars.ver.autoHeight)&&(this.scrollbars.ver.position!=0)&&(!_f3)){
this.vscroll(0);
}
if((this.scrollbars.hor.autoWidth)&&(this.scrollbars.hor.position!=0)&&(!_f2)){
this.hscroll(0);
}
}
this.redraw=dax_viewport_redraw;
function dax_viewport_vscroll(_f9,_fa){
if(!_fa){
if(this.scrollbars.ver.autoHeight){
if(_f9>(this.scrollbars.ver.height-this.dom.container.offsetHeight)){
_f9=this.scrollbars.ver.height-this.dom.container.offsetHeight;
}
}else{
if(_f9>(this.scrollbars.ver.height-this.scrollbars.ver.visibleHeight)){
_f9=this.scrollbars.ver.height-this.scrollbars.ver.visibleHeight;
}
}
this.scrollbars.ver.position=_f9;
if(this.scrollbars.ver.scale!=0){
this.dom.vscrollbar.slider.main.style.top=Math.round(this.scrollbars.ver.position/this.scrollbars.ver.scale)+"px";
}
if(this.scrollbars.ver.autoContent){
this.dom.contents.style.top=0-this.scrollbars.ver.position+"px";
}
}else{
this.dom.vscrollbar.slider.main.style.top=_f9+"px";
var _f9=Math.round(this.scrollbars.ver.scale*_f9);
this.scrollbars.ver.position=_f9;
if(this.scrollbars.ver.autoContent){
this.dom.contents.style.top=0-_f9+"px";
}
}
this.onvscroll();
}
this.vscroll=dax_viewport_vscroll;
function dax_viewport_setVheight(_fb,_fc){
if(_fc){
this.scrollbars.ver.autoHeight=_fc;
}else{
this.scrollbars.ver.height=_fb;
this.scrollbars.ver.autoHeight=false;
}
}
function dax_viewport_hscroll(_fd,_fe){
if(!_fe){
if(this.scrollbars.hor.autoWidth){
if(_fd>this.scrollbars.hor.width-this.dom.container.offsetWidth){
_fd=this.scrollbars.hor.width-this.dom.container.offsetWidth;
}
}else{
if(_fd>this.scrollbars.hor.width-this.scrollbars.hor.visibleWidth){
_fd=this.scrollbars.hor.width-this.scrollbars.hor.visibleWidth;
}
}
this.scrollbars.hor.position=_fd;
if(this.scrollbars.hor.scale!=0){
this.dom.hscrollbar.slider.main.style.left=Math.round(this.scrollbars.hor.position/this.scrollbars.hor.scale)+"px";
}
if(this.scrollbars.hor.autoContent){
this.dom.contents.style.left=0-this.scrollbars.hor.position+"px";
}
}else{
this.dom.hscrollbar.slider.main.style.left=_fd+"px";
var _fd=Math.round(this.scrollbars.hor.scale*_fd);
this.scrollbars.hor.position=_fd;
if(this.scrollbars.hor.autoContent){
this.dom.contents.style.left=0-_fd+"px";
}
}
this.onhscroll();
}
this.hscroll=dax_viewport_hscroll;
function dax_viewport_setHheight(_ff,_100){
if(_100){
this.scrollbars.hor.autoWidth=_100;
}else{
this.scrollbars.hor.height=_ff;
this.scrollbars.hor.autoWidth=false;
}
}
function dax_viewport_verSlider_onMouseDown(_101){
var _102=xpEvent(_101,true);
var pt=getMousePosition(_102);
WindowManager.scroll=this.boundTo;
WindowManager.scroll.mouseposition=pt.y;
WindowManager.scroll.sliderposition=parseInt(this.boundTo.dom.vscrollbar.slider.main.style.top,10);
if(document.addEventListener){
document.addEventListener("mousemove",dax_newViewport_verticalScrollDragging,true);
document.addEventListener("mouseup",dax_newViewport_verticalScrollStop,true);
}else{
document.onmousemove=dax_newViewport_verticalScrollDragging;
document.onmouseup=dax_newViewport_verticalScrollStop;
}
return false;
}
this.dom.vscrollbar.slider.main.onmousedown=dax_viewport_verSlider_onMouseDown;
this.dom.vscrollbar.slider.main.boundTo=this;
function dax_viewport_horSlider_onMouseDown(_104){
var _105=xpEvent(_104,true);
var pt=getMousePosition(_105);
WindowManager.scroll=this.boundTo;
WindowManager.scroll.mouseposition=pt.x;
WindowManager.scroll.sliderposition=parseInt(this.boundTo.dom.hscrollbar.slider.main.style.left,10);
if(document.addEventListener){
document.addEventListener("mousemove",dax_newViewport_horizontalScrollDragging,true);
document.addEventListener("mouseup",dax_newViewport_horizontalScrollStop,true);
}else{
document.onmousemove=dax_newViewport_horizontalScrollDragging;
document.onmouseup=dax_newViewport_horizontalScrollStop;
}
return false;
}
this.dom.hscrollbar.slider.main.onmousedown=dax_viewport_horSlider_onMouseDown;
this.dom.hscrollbar.slider.main.boundTo=this;
function dax_viewport_stopArrowScrolling(){
clearInterval(this.boundTo.scrollInterval);
}
function dax_viewport_startVerArrowUp(){
var _107=this.boundTo;
var _108=_107.scrollbars.ver.arrowStep;
var _109=this.boundTo.scrollbars.hor.scrollInterval;
dax_newViewport_verticalArrowScroll(_107,"up",_108);
_107.scrollInterval=window.setInterval(function(){
dax_newViewport_verticalArrowScroll(_107,"up",_108);
},_109);
}
this.dom.vscrollbar.arrowup.onmousedown=dax_viewport_startVerArrowUp;
this.dom.vscrollbar.arrowup.onmouseout=dax_viewport_stopArrowScrolling;
this.dom.vscrollbar.arrowup.onmouseup=dax_viewport_stopArrowScrolling;
this.dom.vscrollbar.arrowup.boundTo=this;
function dax_viewport_startVerArrowDown(){
var _10a=this.boundTo;
var _10b=_10a.scrollbars.ver.arrowStep;
var _10c=this.boundTo.scrollbars.hor.scrollInterval;
dax_newViewport_verticalArrowScroll(_10a,"down",_10b);
_10a.scrollInterval=window.setInterval(function(){
dax_newViewport_verticalArrowScroll(_10a,"down",_10b);
},_10c);
}
this.dom.vscrollbar.arrowdown.onmousedown=dax_viewport_startVerArrowDown;
this.dom.vscrollbar.arrowdown.onmouseout=dax_viewport_stopArrowScrolling;
this.dom.vscrollbar.arrowdown.onmouseup=dax_viewport_stopArrowScrolling;
this.dom.vscrollbar.arrowdown.boundTo=this;
function dax_viewport_startHorArrowLeft(){
var _10d=this.boundTo;
var _10e=_10d.scrollbars.hor.arrowStep;
var _10f=this.boundTo.scrollbars.hor.scrollInterval;
dax_newViewport_horizontalArrowScroll(_10d,"left",_10e);
_10d.scrollInterval=window.setInterval(function(){
dax_newViewport_horizontalArrowScroll(_10d,"left",_10e);
},_10f);
}
this.dom.hscrollbar.arrowleft.onmousedown=dax_viewport_startHorArrowLeft;
this.dom.hscrollbar.arrowleft.onmouseout=dax_viewport_stopArrowScrolling;
this.dom.hscrollbar.arrowleft.onmouseup=dax_viewport_stopArrowScrolling;
this.dom.hscrollbar.arrowleft.boundTo=this;
function dax_viewport_startHorArrowRight(){
var _110=this.boundTo;
var _111=this.boundTo.scrollbars.hor.scrollInterval;
var _112=_110.scrollbars.hor.arrowStep;
dax_newViewport_horizontalArrowScroll(_110,"right",_112);
_110.scrollInterval=window.setInterval(function(){
dax_newViewport_horizontalArrowScroll(_110,"right",_112);
},_111);
}
this.dom.hscrollbar.arrowright.onmousedown=dax_viewport_startHorArrowRight;
this.dom.hscrollbar.arrowright.onmouseout=dax_viewport_stopArrowScrolling;
this.dom.hscrollbar.arrowright.onmouseup=dax_viewport_stopArrowScrolling;
this.dom.hscrollbar.arrowright.boundTo=this;
function dax_viewport_verTrackspace_onMouseDown(_113){
var _113=xpEvent(_113,true);
var _114=getMousePosition(_113);
var _115=getObjectPosition(this.boundTo.dom.vscrollbar.slider.main);
var _116=this.boundTo.scrollbars.ver.trackStep;
if(_114.y<_115.y){
dax_newViewport_verticalArrowScroll(this.boundTo,"up",_116);
}else{
dax_newViewport_verticalArrowScroll(this.boundTo,"down",_116);
}
}
this.dom.vscrollbar.trackspace.onmousedown=dax_viewport_verTrackspace_onMouseDown;
this.dom.vscrollbar.trackspace.boundTo=this;
function dax_viewport_horTrackspace_onMouseDown(_117){
var _117=xpEvent(_117,true);
var _118=getMousePosition(_117);
var _119=getObjectPosition(this.boundTo.dom.hscrollbar.slider.main);
var _11a=this.boundTo.scrollbars.hor.trackStep;
if(_118.x<_119.x){
dax_newViewport_horizontalArrowScroll(this.boundTo,"left",_11a);
}else{
dax_newViewport_horizontalArrowScroll(this.boundTo,"right",_11a);
}
}
this.dom.hscrollbar.trackspace.onmousedown=dax_viewport_horTrackspace_onMouseDown;
this.dom.hscrollbar.trackspace.boundTo=this;
function dax_viewport_mouseWheelHandler(_11b){
if(!this.scrollbars.ver.show){
return false;
}
if(_11b>0){
var _11c=this.scrollbars.ver.arrowStep;
dax_newViewport_verticalArrowScroll(this,"up",_11c);
}else{
var _11c=this.scrollbars.ver.arrowStep;
dax_newViewport_verticalArrowScroll(this,"down",_11c);
}
}
this.mouseWheelHandler=dax_viewport_mouseWheelHandler;
function dax_viewport_mainDOMonMouseOver(){
if(daxViewportController){
daxViewportController.activeViewport=this;
}
}
function dax_viewport_mainDOMonMouseOut(){
if(daxViewportController){
daxViewportController.activeViewport=null;
}
}
this.dom.main.onmouseover=dax_viewport_mainDOMonMouseOver;
this.dom.main.onmouseout=dax_viewport_mainDOMonMouseOut;
function dax_viewport_showVerScrollbar(_11d){
this.scrollbars.ver.showUser=_11d;
this.redraw();
}
this.showVerScrollbar=dax_viewport_showVerScrollbar;
function dax_viewport_showHorScrollbar(_11e){
this.scrollbars.hor.showUser=_11e;
this.redraw();
}
this.showHorScrollbar=dax_viewport_showHorScrollbar;
function dax_viewport_destroy(){
this.dom.vscrollbar.slider.main.boundTo=null;
this.dom.hscrollbar.slider.main.boundTo=null;
this.dom.vscrollbar.arrowup.boundTo=null;
this.dom.vscrollbar.arrowdown.boundTo=null;
this.dom.hscrollbar.arrowleft.boundTo=null;
this.dom.hscrollbar.arrowright.boundTo=null;
this.dom.vscrollbar.trackspace.boundTo=null;
this.dom.hscrollbar.trackspace.boundTo=null;
this.dom.vscrollbar.main.parentNode.removeChild(this.dom.vscrollbar.main);
this.dom.hscrollbar.main.parentNode.removeChild(this.dom.hscrollbar.main);
this.dom.main.parentNode.removeChild(this.dom.main);
}
this.destroy=dax_viewport_destroy;
}
function dax_newViewport_verticalScrollDragging(_11f){
var _11f=xpEvent(_11f,true);
var _120=getMousePosition(_11f);
var _121=_120.y;
var _122=WindowManager.scroll;
var _123=WindowManager.scroll.sliderposition-WindowManager.scroll.mouseposition+_121;
if(_123<0){
_123=0;
}
if(_123>WindowManager.scroll.scrollbars.ver.scrollableHeight){
_123=WindowManager.scroll.scrollbars.ver.scrollableHeight;
}
debugAlert("sliderPos "+_123);
_122.vscroll(_123,true);
return false;
}
function dax_newViewport_verticalScrollStop(_124){
if(document.removeEventListener){
document.removeEventListener("mousemove",dax_newViewport_verticalScrollDragging,true);
document.removeEventListener("mouseup",dax_newViewport_verticalScrollStop,true);
}else{
document.onmousemove=null;
document.onmouseup=null;
}
}
function dax_newViewport_horizontalScrollDragging(_125){
var _125=xpEvent(_125,true);
var _126=getMousePosition(_125);
var _127=_126.x;
var _128=WindowManager.scroll;
var _129=WindowManager.scroll.sliderposition-WindowManager.scroll.mouseposition+_127;
if(_129<0){
_129=0;
}
if(_129>WindowManager.scroll.scrollbars.hor.scrollableWidth){
_129=WindowManager.scroll.scrollbars.hor.scrollableWidth;
}
_128.hscroll(_129,true);
return false;
}
function dax_newViewport_horizontalScrollStop(_12a){
if(document.removeEventListener){
document.removeEventListener("mousemove",dax_newViewport_horizontalScrollDragging,true);
document.removeEventListener("mouseup",dax_newViewport_horizontalScrollStop,true);
}else{
document.onmousemove=null;
document.onmouseup=null;
}
}
function dax_newViewport_verticalArrowScroll(_12b,_12c,_12d){
if(_12c=="up"){
var _12e=_12b.scrollbars.ver.position-_12d;
if(_12e<0){
_12e=0;
}
_12b.vscroll(_12e);
}else{
var _12e=_12b.scrollbars.ver.position+_12d;
if(_12e>_12b.scrollbars.ver.height){
_12e=_12b.scrollbars.ver.height;
}
_12b.vscroll(_12e);
}
}
function dax_newViewport_horizontalArrowScroll(_12f,_130,_131){
if(_130=="left"){
var _132=_12f.scrollbars.hor.position-_131;
if(_132<0){
_132=0;
}
debugAlert("left:"+_132);
_12f.hscroll(_132);
}else{
var _132=_12f.scrollbars.hor.position+_131;
if(_132>_12f.scrollbars.hor.width){
_132=_12f.scrollbars.hor.width;
}
debugAlert("right:"+_132);
_12f.hscroll(_132);
}
}
function dax_tabs(){
this.onTabClick=function(){
};
function dax_tabs_addTab(_133,_134,_135){
var _136={dom:getTemplate("dax_tabs_tab").cloneNode(true),label:_133};
generateUniqueId(_136.dom);
_136.dom.style.display="block";
_136.dom.l=getElementByClassName(_136.dom,"dax_tabs_tab_l");
_136.dom.m=getElementByClassName(_136.dom,"dax_tabs_tab_m");
_136.dom.r=getElementByClassName(_136.dom,"dax_tabs_tab_r");
_136.dom.properties=_136;
_136.dom.boundTo=this;
_136.dom.onclick=this.tabOnClick;
getElementByClassName(_136.dom,"dax_tabs_tab_label").innerHTML=_133;
this.tabs.elements.push(_136);
this.dom.holder.appendChild(_136.dom);
if(!_134){
this.redraw();
}
function dax_tabs_tab_onmouseover(_137){
if(this.boundTo.tabs.current==this.properties){
return false;
}
this.className="dax_tabs_tab dax_tabs_tab_hover";
}
_136.dom.onmouseover=dax_tabs_tab_onmouseover;
function dax_tabs_tab_onmouseout(_138){
if(this.boundTo.tabs.current==this.properties){
return false;
}
this.className="dax_tabs_tab";
}
_136.dom.onmouseout=dax_tabs_tab_onmouseout;
function dax_tabs_tab_onclose(_139){
xpEvent(_139,true);
this.tabsObject.tabOnClose(this.boundTo);
return false;
}
var _13a=getElementByClassName(_136.dom,"dax_tabs_tab_close");
_13a.onclick=dax_tabs_tab_onclose;
_13a.boundTo=_136;
_13a.tabsObject=this;
_136.closeButton=_13a;
if(_135){
_13a.style.display="block";
}
return _136;
}
this.addTab=dax_tabs_addTab;
function dax_tabs_deleteTab(_13b,_13c,_13d){
if(_13b){
var _13e=this.tabs.elements[_13b];
}else{
var _13e=_13d;
}
this.dom.boundTo=null;
this.dom.properties=null;
if(this.closeButton){
this.closeButton.boundTo=null;
}
this.dom.holder.removeChild(_13e.dom);
if(!_13b){
for(var _13f=0;_13f<this.tabs.elements.length;_13f++){
if(this.tabs.elements[_13f]==_13d){
_13b=_13f;
}
}
}
this.tabs.elements.splice(_13b,1);
if(!_13c){
this.redraw();
}
}
this.deleteTab=dax_tabs_deleteTab;
function dax_tabs_redraw(){
var _140=0;
for(var _141=0;_141<this.tabs.elements.length;_141++){
var _142=getElementByClassName(this.tabs.elements[_141].dom,"dax_tabs_tab_label");
_142.style.whiteSpace="nowrap";
if(_142.offsetTop>30){
_142.style.width=_142.offsetWidth+"px";
}
_140+=(+this.tabs.elements[_141].dom.l.clientWidth)+(+this.tabs.elements[_141].dom.m.clientWidth)+(+this.tabs.elements[_141].dom.r.clientWidth);
}
if(_140<this.dom.container.clientWidth){
this.dom.rightarrow.style.display="none";
this.dom.leftarrow.style.display="none";
var _143=0;
}else{
this.dom.rightarrow.style.display="block";
this.dom.leftarrow.style.display="block";
var _143=(+this.dom.rightarrow.clientWidth)+(+this.dom.leftarrow.clientWidth);
}
this.dom.contents.style.width=this.dom.container.clientWidth-_143+"px";
this.dom.holder.style.width=_140+"px";
this.viewport.redraw();
this.updateArrowState();
}
this.redraw=dax_tabs_redraw;
this.dom={container:getTemplate("dax_tabs_container").cloneNode(true),holder:getTemplate("dax_tabs_holder").cloneNode(true),contents:null};
this.dom.contents=getElementByClassName(this.dom.container,"dax_tabs_contents");
this.tabs={elements:[],current:null};
function dax_tabs_tab_onClick(_144){
xpEvent(_144,true);
this.boundTo.selectTabByNode(this.properties);
this.boundTo.onTabClick(this.properties);
return false;
}
this.tabOnClick=dax_tabs_tab_onClick;
function dax_tabs_selectTabByNode(_145){
if(this.tabs.current){
this.tabs.current.dom.className="dax_tabs_tab";
this.tabs.current=null;
}
_145.dom.className="dax_tabs_tab dax_tabs_tab_selected";
this.tabs.current=_145;
}
this.selectTabByNode=dax_tabs_selectTabByNode;
function dax_tabs_selectTabByIndex(_146){
var _147=this.tabs.elements[_146];
if(_147){
this.selectTabByNode(_147);
}
}
this.selectTabByIndex=dax_tabs_selectTabByIndex;
function dax_tabs_tabOnClose(_148){
}
this.tabOnClose=dax_tabs_tabOnClose;
generateUniqueId(this.dom.container);
this.dom.container.style.display="block";
generateUniqueId(this.dom.holder);
this.dom.holder.style.display="block";
this.viewport=new dax_viewport(this.dom.contents);
this.viewport.boundTo=this;
this.dom.leftarrow=getElementByClassName(this.dom.container,"dax_tabs_arrowleft");
this.dom.rightarrow=getElementByClassName(this.dom.container,"dax_tabs_arrowright");
var _149=this.dom.rightarrow;
_149.boundTo=this.viewport;
_149.disabledState=true;
_149.onmouseover=function(_14a){
this.className="dax_tabs_arrowright dax_tabs_arrowright_hover";
};
_149.onmousedown=function(_14b){
this.boundTo.dom.hscrollbar.arrowright.onmousedown(_14b);
};
_149.ondblclick=function(_14c){
this.boundTo.hscroll(this.boundTo.scrollbars.hor.width);
this.boundTo.boundTo.updateArrowState();
};
_149.onmouseout=function(_14d){
this.className=this.disabledState?"dax_tabs_arrowright dax_tabs_arrowright_disabled":"dax_tabs_arrowright";
this.boundTo.dom.hscrollbar.arrowright.onmouseout(_14d);
};
_149.onmouseup=function(_14e){
this.boundTo.dom.hscrollbar.arrowright.onmouseup(_14e);
this.boundTo.boundTo.updateArrowState();
};
var _14f=this.dom.leftarrow;
_14f.boundTo=this.viewport;
_14f.disabledState=false;
_14f.className="dax_tabs_arrowleft dax_tabs_arrowleft_disabled";
_14f.onmouseover=function(_150){
this.className="dax_tabs_arrowleft dax_tabs_arrowleft_hover";
};
_14f.ondblclick=function(_151){
this.boundTo.hscroll(0);
this.boundTo.boundTo.updateArrowState();
};
_14f.onmousedown=function(_152){
this.boundTo.dom.hscrollbar.arrowleft.onmousedown(_152);
};
_14f.onmouseout=function(_153){
this.className=this.disabledState?"dax_tabs_arrowleft dax_tabs_arrowleft_disabled":"dax_tabs_arrowleft";
this.boundTo.dom.hscrollbar.arrowleft.onmouseout(_153);
};
_14f.onmouseup=function(_154){
this.boundTo.dom.hscrollbar.arrowleft.onmouseup(_154);
this.boundTo.boundTo.updateArrowState();
};
this.viewport.scrollbars.hor.arrowStep=22.5;
this.viewport.scrollbars.hor.scrollInterval=50;
function dax_tabs_updateArrowState(){
var _155=this.viewport.scrollbars.hor;
if(_155.width==_155.position+_155.visibleWidth){
this.dom.rightarrow.className="dax_tabs_arrowright dax_tabs_arrowright_disabled";
this.dom.leftarrow.className="dax_tabs_arrowright";
this.dom.rightarrow.disabledState=true;
this.dom.leftarrow.disabledState=false;
}else{
if(_155.position==0){
this.dom.leftarrow.className="dax_tabs_arrowleft dax_tabs_arrowleft_disabled";
this.dom.rightarrow.className="dax_tabs_arrowright";
this.dom.leftarrow.disabledState=true;
this.dom.rightarrow.disabledState=false;
}else{
this.dom.leftarrow.className="dax_tabs_arrowleft";
this.dom.rightarrow.className="dax_tabs_arrowright";
this.dom.leftarrow.disabledState=false;
this.dom.rightarrow.disabledState=false;
}
}
}
function dax_tabs_destroy(){
while(this.tabs[0]){
this.deleteTab(0,true);
}
this.dom.rightarrow.boundTo=null;
this.dom.leftarrow.boundTo=null;
this.viewport.destroy();
this.dom.container.parentNode.removeChild(this.dom.container);
}
this.destroy=dax_tabs_destroy;
this.updateArrowState=dax_tabs_updateArrowState;
this.updateArrowState();
this.viewport.showHorScrollbar(false);
this.viewport.setContents(this.dom.holder);
this.viewport.redraw();
}

function GridObject_toString(){
return "[object GridObject]";
}
function GridObject_setParent(_1){
this.viewport.parent=_1;
this.viewport.refresh();
}
function GridObject_clear(){
this.grid.clear();
}
function GridObject_setFocusAll(_2){
this.grid.setFocusAll(_2);
}
function GridObject_populate(_3){
this.owner.search.saveButton.disable();
this.owner.populating=true;
if(this.owner){
if(this.owner.initializing){
this.owner.initializing=false;
if(this.owner.table.showallrecordstab.toLowerCase()=="true"){
}else{
if(this.owner.table.preselectQueries.length>0){
if(this.owner.tabsbar.tabs[0]){
this.owner.tabsbar.tabs[0].dom.onclick();
}
return true;
}else{
if(this.owner.table.preselectedDynamicQueries.length>0){
this.owner.initializing=false;
this.owner.refreshDynamicTabs();
return true;
}else{
}
}
}
}
}
var vp=this.viewport;
try{
var _5=isDefined(_3.comparison)?_3.comparison:null;
var _6=isDefined(_3.startIndex)&&_3.startIndex>0?_3.startIndex:0;
var _7=isDefined(_3.length)&&_3.length>0?_3.length:Math.ceil(vp.dom.offsetHeight/this.prv.mRowHeight);
var _8=isDefined(_3.queryName)?_3.queryName:null;
var _9=isDefined(_3.keepOldQueryId)?_3.keepOldQueryId:false;
var _a=connection.sessionId;
var _b=isDefined(_3.queryId)?_3.queryId:null;
if(_b){
var _c=connection.address.query+"?sessionId="+_a+"&queryid="+_b+"&start="+_6+"&length="+_7;
}else{
if(_8){
var _c=connection.address.query+"?sessionId="+_a+"&tableid="+_3.tableId+"&start="+_6+"&length="+_7+"&queryname="+dax_bridge.encode(_8);
}else{
if(isDefined(_5)){
var _c=connection.address.query+"?sessionId="+_a+"&tableid="+_3.tableId+"&start="+_6+"&length="+_7;
}else{
var _c=connection.address.allrecords+"?sessionId="+_a+"&tableid="+_3.tableId+"&start="+_6+"&length="+_7;
}
}
}
if(!_3.rowRef){
_3.rowRef=new Object();
_3.rowRef.eraseAfter=true;
}else{
_3.rowRef.eraseAfter=false;
}
_3.rowRef.keepOldQueryId=_9;
if(isDefined(_5)&&_5!=""){
_c+=_5;
}
var _d=getXMLHttpRequest();
if(_d){
if(!isDefined(_3.onReadyStateFunc)){
var _e=this;
_3.onReadyStateFunc=function(){
_e.onpopulate(_d,_3.rowRef);
};
}
debugAlert("<b>Grid:</b>"+"<a href=\""+_c+"\" target=\"_blank\">"+_c+"</a>");
_d.onreadystatechange=_3.onReadyStateFunc;
_d.open("GET",_c,true);
_d.send(null);
this.onbeforeload();
}
}
catch(e){
}
}
function GridObject_reload(){
if(!this.selection){
return;
}
if(this.prv.mTimeoutId){
clearTimeout(this.prv.mTimeoutId);
}
var _f=this;
var pop={queryId:_f.selection.queryId,tableId:_f.selection.tableId,startIndex:_f.selection.range.start,comparison:_f.selection.comparison,keepOldQueryId:true};
_f.populate(pop);
var _11=_f.prv.mAutoReload;
if(_11>0){
this.prv.mTimeoutId=setTimeout(function(){
_f.reload();
},_11*3000);
}
}
function GridObject_null(){
}
function GridObject_onpopulate(_12,_13){
if(_12.readyState!=4){
return;
}
if(checkResponse(_12)){
return;
}
var ref=this;
var _15=_12.responseXML.getElementsByTagName("queryResult").item(0).getAttribute(STR["tablename"]);
if(callback_onViewQuery){
http_response=callback_onViewQuery(_15,_12,"grid");
}
var _16=_12.responseXML.getElementsByTagName("queryResult").item(0);
if(!isDefined(_16)){
return this.onerror(_12);
}
var _17=_16.getAttribute("sortfield");
var _18=_13.keepOldQueryId;
if(_13.eraseAfter){
_13=null;
}
if(!isDefined(this.firstLoad)&&!this.firstLoad){
this.selection={tableId:_16.getAttribute(STR["tableid"]),queryId:_16.getAttribute(STR["queryid"]),tableName:_16.getAttribute(STR["tablename"]),map:new Array(),formatMap:new Array(),fieldTypeMap:new Array(),range:{start:0,length:_16.getAttribute("size")},toString:function(){
return this.tableId+" "+this.queryId+" "+this.tableName+" "+this.total;
}};
var _19=structure.getTable(this.selection.tableId);
if(!_19.cached){
buildFieldList(this.selection.tableId);
}
if(!this.hGridFields){
var _1a=[];
for(var _1b=0;_1b<_19.fields.length;_1b++){
var _1c=getField(_19.tableid,_19.fields[_1b].fieldid);
if(_1c.fieldinlist.toLowerCase()=="true"){
_1a.push(_1c);
}
}
gFields=_1a;
}else{
var _1a=[];
for(var _1b=0;_1b<this.hGridFields.length;_1b++){
var _1c=getField(_19.tableid,this.hGridFields[_1b].fieldid);
if(_1c.fieldinlist.toLowerCase()=="true"){
_1a.push(_1c);
}
}
gFields=_1a;
}
if(gFields.length>0&&gFields.length<this.grid.prv.mColCount){
this.grid.setColumnWidth(Math.floor(this.viewport.dom.offsetWidth/gFields.length));
}
if(gFields.length>0){
this.grid.size(gFields.length);
}
for(var i=0;i<gFields.length;i++){
this.selection.map[gFields[i].fieldid]=i;
this.grid.column(i).setHeader(gFields[i].fieldalias);
var _1e=getField(this.selection.tableId,gFields[i].fieldid).fieldcolumnwidth;
if(_1e){
this.grid.column(i).setWidth(_1e);
}
this.grid.column(i).fieldId=gFields[i].fieldid;
this.selection.formatMap[gFields[i].fieldid]=gFields[i].fieldformat;
this.selection.fieldTypeMap[gFields[i].fieldid]=gFields[i].fieldtype;
}
this.grid.refresh();
}
if(this.recreateSelection){
this.selection.range.start=0;
this.selection.range.length=_16.getAttribute("size");
this.selection.queryId=_16.getAttribute(STR["queryid"]);
this.recreateSelection=false;
}
if(!_18){
this.currentQueryId=_16.getAttribute(STR["queryid"]);
this.selection.queryId=this.currentQueryId;
}
this.receivedQueryId=_16.getAttribute(STR["queryid"]);
this.selection.total=parseInt(_16.getAttribute("recordsinselection"));
this.beforeOnPopulate();
var _1f=_16.getElementsByTagName(STR["rowtag"]);
for(var i=0;i<_1f.length;i++){
var _20=_1f.item(i);
var _21=_20.getElementsByTagName(STR["fieldtag"]);
var row=(i==0&&isDefined(_13))?_13:this.grid.row(i);
if(row){
row.recordId=_20.getAttribute(STR["recordid"]);
if(isDefined(this.selection.selected)&&isDefined(this.selection.selected[row.recordId])){
row.setFocus(this.selection.selected[row.recordId]);
}else{
row.setFocus(false);
}
for(var j=0;j<_21.length;j++){
var id=_21[j].getAttribute(STR["fieldid"]);
var _25=_21[j].getAttribute("width");
var _26=_21[j].getAttribute("height");
var _27=_21[j].getAttribute("ddw");
var _28=_21[j].getAttribute("ddwtype");
var _29=this.selection.map[id];
var _2a=_21[j].getAttribute("fieldrecordid");
var _2b=row.element(_29);
if(isDefined(_25)&&isDefined(_26)){
_2b.picWidth=_25;
_2b.picHeight=_26;
}
if(isDefined(_2b)){
elValue=n2String(_21[j]);
if(_27){
_2b.ddw=_27;
if(_28.indexOf("Static")!=-1){
elValue="<a class='ddw_link' href='#' onclick='new DDW(\""+_27+"\", \"static_url\", this.firstChild.nodeValue, \"&recordid="+id+"["+_2a+"]"+"&tableid="+this.selection.tableId+"\"); return false;'>"+elValue+"</a>";
}else{
if(_28.indexOf("Dynamic")!=-1){
elValue="<a class='ddw_link' href='#' onclick='new DDW(\""+_27+"\", \"dynamic_url\", this.firstChild.nodeValue, \"&recordid="+id+"["+_2a+"]"+"&tableid="+this.selection.tableId+"\"); return false;'>"+elValue+"</a>";
}else{
if(_28.indexOf("Message")!=-1){
elValue="<a class='ddw_link' href='#' onclick='new DDW(\""+_27+"\", \"message_window\", this.parentNode.parent.prv.mParent.prv.mParent.owner.owner, \"&recordid="+id+"["+_2a+"]"+"&tableid="+this.selection.tableId+"\"); return false;'>"+elValue+"</a>";
}
}
}
}else{
var _2c=this.selection.fieldTypeMap[id];
var _2d=this.selection.formatMap[id];
if((_2c=="boolean")||(_2c=="date")){
elValue=doFormat(elValue,"4daf_default",_2d,_2c,"grid_cell");
}else{
if(_2d){
elValue=format(_2d,elValue);
}
}
}
_2b.setContent(elValue);
}
}
}
}
var _2e=this.grid.prv.mRowCount;
if(_1f.length<_2e){
for(var i=_1f.length;i<=_2e;i++){
var row=this.grid.row(i);
if(row){
row.clear();
row.setFocus(false);
}
}
}
if(!isDefined(this.firstLoad)&&!this.firstLoad){
this.firstLoad=true;
if(this.owner.target){
this.nowPopulating=false;
this.reload();
return;
}
}
if(browser.ie6){
_12.onreadystatechange=function(){
};
}else{
_12.onreadystatechange=null;
}
delete _12;
this.onafterload();
var _2f=this.grid.prv.mColCount;
if(this.showColumnsArray.length>0){
for(var _30=0;_30<this.showColumnsArray.length;_30++){
if(!isNaN(this.showColumnsArray[_30])){
if(this.showColumnsArray[_30]<_2f){
this.grid.column(this.showColumnsArray[_30]).show();
}
}
}
this.showColumnsArray=new Array();
}
if(this.hideColumnsArray.length>0){
for(var _30=0;_30<this.hideColumnsArray.length;_30++){
if(!isNaN(this.hideColumnsArray[_30])){
if(this.hideColumnsArray[_30]<_2f){
this.grid.column(this.hideColumnsArray[_30]).hide();
}
}
}
this.hideColumnsArray=new Array();
}
this.nowPopulating=false;
var _31=this.owner;
for(var _2f=0;_2f<this.grid.prv.mColumns.length;_2f++){
if(this.grid.prv.mColumns[_2f].fieldId==_17){
this.grid.prv.mColumns[_2f].prv.mHeader.prv.mDOM.className="cellAsc";
this.grid.prv.mColumns[_2f].prv.mHeader.prv.mSorted=true;
}else{
this.grid.prv.mColumns[_2f].prv.mHeader.prv.mDOM.className="cell";
this.grid.prv.mColumns[_2f].prv.mHeader.prv.mSorted=false;
}
}
if(!this.startedDynamicTabUpdate){
setTimeout(function(){
_31.refreshDynamicTabs();
},2500);
this.startedDynamicTabUpdate=true;
}
this.owner.search.saveButton.enable();
this.owner.populating=false;
if(this.sortLock){
if(browser.ie){
var _32=this;
this.sortLockTimer=setTimeout(function(){
_32.sortLock=false;
},2000);
}else{
this.sortLock=false;
}
}
}
function GridObject_onheaderfocus(_33){
if(this.owner.sortLock){
return false;
}
if(!this.currentQueryId){
return false;
}
if(this.owner.populating){
return false;
}else{
this.owner.populating=true;
}
var _34=_33.prv.mColumn;
var _35=_33.prv.mParent;
if(this.selection){
_33.prv.mOrderAsc=!_33.prv.mOrderAsc;
this.sort(_34.fieldId,_33.prv.mOrderAsc);
}else{
_33.prv.mDOM.onblur();
}
}
function GridObject_goToPage(_36){
if(this.selection){
var riv=this.selection.range.length;
var _38=(riv*(_36-1))+1;
var pop={queryId:this.selection.queryId,tableId:this.selection.tableId,startIndex:_38,comparison:this.selection.comparison};
this.clear();
this.populate(pop);
this.prv.mCurrentPage=_36;
var sh=this.viewport.vscrollbar.slider.top.clientHeight+this.viewport.vscrollbar.slider.mid.clientHeight+this.viewport.vscrollbar.slider.bottom.clientHeight;
var pos=Math.floor(((this.viewport.vscrollbar.slideArea.clientHeight-sh)/this.prv.mPageCount)*(_36-1)+1);
setStyle(this.viewport.vscrollbar.slider,"top",pos+"px");
}
}
function GridObject_previousPage(){
if(this.prv.mCurrentPage>1){
this.goToPage(--this.prv.mCurrentPage);
}
}
function GridObject_nextPage(){
if(this.prv.mCurrentPage<this.prv.mPageCount){
this.goToPage(++this.prv.mCurrentPage);
}
}
function GridObject_onsort(_3c){
if(_3c.readyState!=4){
return;
}
var _3d=_3c.responseXML.getElementsByTagName("querySort").item(0);
checkResponse(_3c);
if(!isDefined(_3d)){
return this.onerror(_3c);
}
var _3e=_3d.getAttribute(STR["queryid"]);
this.grid.clear();
var pop={queryId:_3e,tableId:this.selection.tableId,length:this.grid.prv.mRowCount,startIndex:this.selection.range.start,comparison:this.selection.comparison};
this.populate(pop);
if(browser.ie6){
_3c.onreadystatechange=function(){
};
}else{
_3c.onreadystatechange=null;
}
delete _3c;
}
function GridObject_sort(_40,_41){
this.sortLock=true;
var _42=_41?"asc":"desc";
var url=connection.command(DB.SORT)+"&tableid="+this.selection.tableId+"&fieldid="+_40+"&direction="+_42+"&queryid="+this.currentQueryId;
var _44=getXMLHttpRequest();
if(_44){
var _45=this;
debugAlert("<b>Grid:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_44.onreadystatechange=function(){
_45.onsort(_44);
};
_44.open("GET",url,true);
_44.send(null);
this.onbeforeload();
}
}
function GridObject_insertRecord(_46,_47){
if(!isDefined(this.selection)){
return;
}
var obj=this;
this.populate({queryId:this.selection.queryId,startIndex:_46,tableId:this.selection.tableId,length:1,rowRef:_47});
}
function GridObject_viewport_onvscrollstart(_49){
}
function GridObject_viewport_onvscroll(_4a,_4b,aGo,_4d){
if(aGo){
var go=aGo;
}else{
var go=this.owner;
var _4d=this;
}
if(go.nowPopulatingTimer){
window.clearTimeout(go.nowPopulatingTimer);
go.nowPopulatingTimer=null;
}
if(go.nowPopulating){
go.nowPopulatingTimer=window.setTimeout(function(){
GridObject_viewport_onvscroll(_4a,_4b,go,_4d);
},500);
return;
}else{
go.nowPopulating=true;
}
if(go.selection){
var _4f=go.prv.mRowHeight/_4d.vscrollbar.ratio;
var riv=Math.ceil(_4d.dom.offsetHeight/go.prv.mRowHeight);
var n=Math.round(_4a/_4f);
go.selection.range.start=n;
go.selection.range.length=riv;
var pop={comparison:go.selection.comparison,queryId:go.selection.queryId,tableId:go.selection.tableId,startIndex:n};
go.populate(pop);
if(!aGo){
go.nowPopulatingTimer=window.setTimeout(function(){
GridObject_viewport_onvscroll(_4a,_4b,go,_4d);
},500);
}
}
}
function GridObject_viewport_onvscrollstop(_53){
var go=this.owner;
if(go.selection){
var _55=go.prv.mRowHeight/this.vscrollbar.ratio;
var riv=Math.ceil(this.dom.offsetHeight/go.prv.mRowHeight);
var n=Math.round(_53/_55);
go.selection.range.start=n;
go.selection.range.length=riv;
var pop={comparison:go.selection.comparison,queryId:go.selection.queryId,tableId:go.selection.tableId,startIndex:n};
go.populate(pop);
}
}
function GridObject_load(_59){
this.grid.size(_59[0].length,_59.length);
for(var i=0;i<_59.length;i++){
this.grid.setRow(i,_59[i]);
}
}
function GridObject_refresh(){
var _5b=this.grid;
var vp=this.viewport;
var _5d=Math.ceil(xpGetSize(vp.parent).height/this.prv.mRowHeight);
var _5e=Math.ceil(xpGetSize(vp.parent).width/this.prv.mColWidth);
var _5f=null;
if(this.selection&&this.firstLoad){
_5e=null;
_5f=((this.selection.total+1)*(this.prv.mRowHeight))-vp.dom.offsetHeight+this.grid.header.offsetHeight;
}
if((_5e&&_5b.prv.mColCount<_5e)||_5b.prv.mRowCount<_5d){
_5b.size(_5e,_5d);
}
var _60=_5b.column(_5b.prv.mColCount-1);
var _61=Math.floor(_5b.getWidth()-_5b.prv.mPadding-xpGetSize(vp.parent).width);
if(_5f>0){
_61+=vp.vscrollbar.dom.offsetWidth;
}
if(_61<=0){
var _62=xpGetSize(vp.dom).width-(_5b.getWidth()-_5b.prv.mPadding);
_60.setWidth(_60.getWidth()+_62);
_5b.refresh();
_61=0;
}else{
if((_60.getWidth()>_60.prv.mMinimumWidth)&&(_61<_60.getWidth()-_60.prv.mMinimumWidth)){
vp.hscrollbar.scroll(0,true);
_60.setWidth(_60.getWidth()-_61);
_5b.refresh();
_61=0;
}
}
vp.setOverflow(_5f,_61);
vp.refresh();
if((this.selection)&&(!vp.vscrollbar.isScrolling)){
var _63=(this.selection.range.start==1)?0:this.selection.range.start;
vp.vscrollbar.scroll(((_63)*(this.prv.mRowHeight)/vp.vscrollbar.ratio),true);
}
this.onAfterRefresh();
}
function GridObject_destroy(){
if(this.prv.mTimeoutId){
clearTimeout(this.prv.mTimeoutId);
}
this.grid.destroy();
this.viewport.destroy();
}
function GridObject_onkeypress(_64){
var _65=xpEvent(_64);
var _66=_65.which?_65.which:_65.keyCode;
}
function GridObject_grid_onrowselect(_67){
var go=this.owner;
if(go&&go.selection){
if(!isDefined(go.selection.selected)){
go.selection.selected=new Array();
}
go.selection.selected[_67.recordId]=_67.prv.mFocus;
}
}
function GridObject_onerror(_69){
return false;
}
function GridObject(_6a){
this.grid=new NGrid();
this.viewport=new ViewPort();
this.grid.owner=this;
this.viewport.owner=this;
this.firstLaunch=true;
this.nowPopulating=false;
this.sortLock=false;
this.prv={mRowHeight:0,mColWidth:0,mCurrentPage:1,mPageCount:0,mAutoReload:60,mTimeoutId:null};
this.hGridFields=null;
this.toString=GridObject_toString;
this.setParent=GridObject_setParent;
this.clear=GridObject_clear;
this.reload=GridObject_reload;
this.populate=GridObject_populate;
this.beforeOnPopulate=GridObject_null;
this.onpopulate=GridObject_onpopulate;
this.onheaderfocus=GridObject_onheaderfocus;
this.onbeforeload=GridObject_null;
this.onafterload=GridObject_null;
this.goToPage=GridObject_goToPage;
this.previousPage=GridObject_previousPage;
this.nextPage=GridObject_nextPage;
this.sort=GridObject_sort;
this.onsort=GridObject_onsort;
this.insertRecord=GridObject_insertRecord;
this.viewport.onvscrollstart=GridObject_viewport_onvscrollstart;
this.viewport.onvscroll=GridObject_viewport_onvscroll;
this.viewport.onvscrollstop=GridObject_viewport_onvscrollstop;
this.load=GridObject_load;
this.refresh=GridObject_refresh;
this.onAfterRefresh=GridObject_null;
this.destroy=GridObject_destroy;
this.onkeypress=GridObject_onkeypress;
this.grid.onrowselect=GridObject_grid_onrowselect;
this.onerror=GridObject_onerror;
this.setFocusAll=GridObject_setFocusAll;
this.recreateSelection=false;
this.startedDynamicTabUpdate=false;
this.showColumnsArray=new Array();
this.hideColumnsArray=new Array();
var vp=this.viewport;
vp.setContent(this.grid.dom);
_6a.insertBefore(vp.dom,null);
this.setParent(_6a);
try{
var _6c=this.grid;
_6c.size(1,1);
this.prv.mRowHeight=_6c.row(0).getHeight();
this.prv.mColWidth=_6c.column(0).getWidth();
this.refresh();
}
catch(e){
}
return this;
}
function NGrid_getHeaderFrame(){
var _6d=getElementByClassName(this.header,"cell");
if(this.prv.mColumns.length<=0){
return _6d;
}else{
return _6d.cloneNode(true);
}
}
function NGrid_getRowDOM(){
var row=getElementByClassName(this.body,"row");
if(this.prv.mRowCount<=0){
return row;
}else{
var _6f=row.cloneNode(false);
_6f.appendChild(getElementByClassName(row,"cell").cloneNode(true));
return _6f;
}
}
function NGrid_insertRow(_70){
var row=new NGridRow(this);
var _72=null;
if(isDefined(_70)&&_70>=0&&_70<this.prv.mRowCount){
_72=this.prv.mRows[_70].prv.mDOM;
this.prv.mRows.splice(_70,0,row);
row.setIndex(_70);
for(var i=_70+1;i<this.prv.mRows.length;i++){
this.prv.mRows[i].setIndex[i];
}
}else{
this.prv.mRows.push(row);
}
this.body.insertBefore(row.prv.mDOM,_72);
this.prv.mRowCount++;
return row;
}
function NGrid_setRow(_74,_75){
var row=this.prv.mRows[_74];
if(!isDefined(row)){
return;
}
row.setRow(_75);
}
function NGrid_moveRow(_77,_78){
if(_77<0||_77>this.prv.mRows.length){
return;
}
var row=this.prv.mRows[_77];
if(_78+1>=this.prv.mRows.length){
this.body.insertBefore(row.prv.mDOM,null);
}else{
var _7a=this.prv.mRows[_78];
this.body.insertBefore(row.prv.mDOM,_7a.prv.mDOM);
}
this.prv.mRows.splice(_77,1);
this.prv.mRows.splice(_78,0,row);
}
function NGrid_insertColumn(_7b){
var _7c=new NGridColumn(this);
this.prv.mColCount++;
if(this.prv.mRows.length<=0){
this.insertRow();
}else{
for(var i=0;i<this.prv.mRows.length;i++){
var row=this.prv.mRows[i];
row.insertElement();
}
}
}
function NGrid_setColumn(_7f,_80){
if(_7f<0||_7f>=this.prv.mColCount){
return;
}
this.prv.mColumns[_7f].prv.mColumn=_80;
}
function NGrid_moveColumn(_81,_82){
if(_81<0||_81>=this.prv.mColCount||_82<0||_82>=this.prv.mColCount){
return;
}
var col=this.prv.mColumns[_81];
var _84=col.prv.mElements;
var _85=null;
var _86=null;
if(isDefined(this.prv.mColumns[_82+1])){
_85=this.prv.mColumns[_82+1];
_86=_85.prv.mElements;
}
var _87=col.prv.mHeader;
if(_85){
for(var i=0;i<_84.length;i++){
var _89=_84[i].prv.mParent.prv.mDOM;
_89.insertBefore(_84[i].prv.mDOM,_86[i].prv.mDOM);
}
this.header.insertBefore(_87.prv.mDOM,_85.prv.mHeader.prv.mDOM);
}else{
for(var i=0;i<_84.length;i++){
var _89=_84[i].prv.mParent.prv.mDOM;
_89.insertBefore(_84[i].prv.mDOM,null);
}
this.header.insertBefore(_87.prv.mDOM,null);
}
this.prv.mColumns.splice(_81,1);
this.prv.mColumns.splice(_82,0,col);
for(var i=0;i<this.prv.mColCount;i++){
this.prv.mColumns[i].setIndex(i);
}
}
function NGrid_removeColumn(_8a){
if(_8a<0||_8a>=this.prv.mColCount){
return;
}
_8a=isDefined(_8a)?_8a:this.prv.mColCount-1;
var _8b=this.prv.mColumns[_8a];
this.prv.mColumns.splice(_8a,1);
this.prv.mColCount--;
var _8c=_8b.prv.mElements;
for(var i=0;i<_8c.length;i++){
if(_8c[i].prv.mParent){
var _8e=_8c[i].prv.mParent.prv.mDOM;
_8e.removeChild(_8c[i].prv.mDOM);
_8c[i].destroy();
}
}
var _8f=_8b.prv.mHeader;
this.header.removeChild(_8f.prv.mDOM);
_8f.destroy();
_8b.destroy();
delete _8b;
for(var i=0;i<this.prv.mColCount;i++){
this.prv.mColumns[i].setIndex(i);
}
}
function NGrid_removeRow(_90){
if(_90<0||_90>=this.prv.mRowCount){
return;
}
var _90=isDefined(_90)?_90:this.prv.mRowCount-1;
var row=this.prv.mRows[_90];
if(row){
this.prv.mRows.splice(_90,1);
this.prv.mRowCount--;
this.body.removeChild(row.prv.mDOM);
delete row;
for(var i=0;i<this.prv.mColumns.length;i++){
var col=this.prv.mColumns[i];
col.prv.mElements.splice(_90,1);
}
for(var i=0;i<this.prv.mRowCount;i++){
this.prv.mRows[i].setIndex(i);
}
}
}
function NGrid_row(_94){
return (_94>=0&&_94<this.prv.mRows.length)?this.prv.mRows[_94]:null;
}
function NGrid_column(_95){
return (_95>=0&&_95<this.prv.mColumns.length)?this.prv.mColumns[_95]:null;
}
function NGrid_clear(){
for(var i=0;i<this.prv.mRowCount;i++){
this.prv.mRows[i].clear();
}
}
function NGrid_setFocusAll(_97){
for(var i=0;i<this.prv.mRowCount;i++){
this.prv.mRows[i].setFocus(_97);
}
}
function NGrid_size(_99,_9a){
var _9b=isDefined(_9a)?_9a-this.prv.mRowCount:0;
if(_9b<0){
for(var i=0;i<Math.abs(_9b);i++){
this.removeRow();
}
}
var _9d=isDefined(_99)?_99-this.prv.mColCount:0;
if(_9d<0){
for(var i=0;i<Math.abs(_9d);i++){
this.removeColumn();
}
}
this.prv.mColCount=_9d>0?this.prv.mColCount+_9d:this.prv.mColCount;
for(var i=0;i<this.prv.mRowCount;i++){
this.prv.mRows[i].size(this.prv.mColCount);
}
for(var i=0;i<_9b;i++){
this.insertRow();
}
for(var i=0;i<this.prv.mColCount;i++){
if(i<this.prv.mColumns.length){
var _9e=this.prv.mColumns[i];
}else{
var _9e=new NGridColumn(this);
this.prv.mColumns.push(_9e);
}
var _9f=_9e.prv.mElements;
for(var j=0;j<this.prv.mRowCount;j++){
var row=this.prv.mRows[j];
if(j<_9f.length){
_9f[j]=row.element(i);
}else{
_9f.push(row.element(i));
}
}
var h=_9e.prv.mHeader;
if(h.prv.mContent==null){
_9e.setHeader("");
}
}
for(var i=0;i<this.prv.mRows.length;i++){
this.prv.mRows[i].setIndex(i);
}
for(var i=0;i<this.prv.mColumns.length;i++){
this.prv.mColumns[i].setIndex(i);
}
this.refresh();
}
function NGrid_setColumnWidth(_a3){
for(var i=0;i<this.prv.mColCount;i++){
this.prv.mColumns[i].setWidth(_a3);
}
}
function NGrid_getWidth(){
var _a5=this.prv.mPadding;
for(var i=0;i<this.prv.mColCount;i++){
_a5+=this.column(i).getWidth();
}
return _a5;
}
function NGrid_onheaderfocus(_a7){
for(var i=0;i<this.prv.mColumns.length;i++){
var col=this.prv.mColumns[i];
var _aa=col.prv.mHeader;
if(_aa!=_a7){
_aa.prv.mDOM.onblur();
}
}
if(this.owner&&this.owner.onheaderfocus){
this.owner.onheaderfocus(_a7);
}
}
function NGrid_refresh(){
try{
var _ab=this.getWidth();
this.body.style.width=_ab+"px";
this.header.style.width=_ab+"px";
}
catch(e){
}
}
function NGrid_null(){
}
function NGrid_asyncLoad(_ac,_ad){
if(!_ad){
_ad=new Query(_ac);
_ad.batchSize=10;
}
aHandler=this.asyncLoad_handler;
aGrid=this;
var _ae=getTable(_ac);
dax_bridge.cacheFields(_ae);
var _af=_ae.fields.length;
for(i=0;i<_ae.fields.length;i++){
if(_ae.fields[i].fieldbreaklevel!=0){
_af--;
}
}
this.firstRowRemoved=false;
if(_af==0){
return;
}
this.size(_af,1);
this.refresh();
this.row(0).element(0).setContent(STR["loading"]);
aGrid.currentQuery=_ad;
_ad.callRef=this;
_ad.nextBatch(aHandler,aGrid);
}
function NGrid_asyncLoad_handler(_b0,_b1){
if(_b0.readyState!=4){
return;
}
aQuery=_b1.currentQuery;
aQuery.parseResult(_b0);
if(aQuery.size>0){
for(g=0;g<aQuery.result.length;g++){
aRow=_b1.insertRow();
aData=new Array();
for(h=0;h<aQuery.result[g].fields.length;h++){
var _b2=getField(aQuery.result[g].fields[h].id,"");
if(_b2.fieldbreaklevel==0){
aData.push(aQuery.result[g].fields[h].value);
}
}
aRow.setRow(aData);
}
}
if(!(_b1.firstRowRemoved)){
_b1.removeRow(0);
_b1.firstRowRemoved=true;
}
_b1.asyncLoad_refresh();
if(!(aQuery.lastRecord)){
aQuery.nextBatch(aHandler);
}
}
function NGrid_destroy(){
purgeparents(this);
for(var i in this.prv.mColumns){
this.prv.mColumns[i].destroy();
}
for(var i in this.prv.mRows){
this.prv.mRows[i].destroy();
}
if(this.owner){
this.owner=null;
}
}
function NGrid(_b4,_b5){
var _b6=getTemplate("newgrid");
if(!_b6){
return null;
}
this.dom=_b6.cloneNode(true);
generateUniqueId(this.dom);
this.header=getElementByClassName(this.dom,"header");
this.body=getElementByClassName(this.dom,"body");
for(var _b7 in this){
if(this[_b7]){
this[_b7].parent=this;
}
}
this.prv={mColCount:0,mRowCount:0,mRows:new Array(),mColumns:new Array(),mPadding:10};
this.destroy=NGrid_destroy;
this.getHeaderFrame=NGrid_getHeaderFrame;
this.getRowDOM=NGrid_getRowDOM;
this.insertRow=NGrid_insertRow;
this.setRow=NGrid_setRow;
this.moveRow=NGrid_moveRow;
this.insertColumn=NGrid_insertColumn;
this.setColumn=NGrid_setColumn;
this.moveColumn=NGrid_moveColumn;
this.removeColumn=NGrid_removeColumn;
this.removeRow=NGrid_removeRow;
this.row=NGrid_row;
this.column=NGrid_column;
this.clear=NGrid_clear;
this.size=NGrid_size;
this.setFocusAll=NGrid_setFocusAll;
this.setColumnWidth=NGrid_setColumnWidth;
this.getWidth=NGrid_getWidth;
this.onheaderfocus=NGrid_onheaderfocus;
this.refresh=NGrid_refresh;
this.onrowselect=NGrid_null;
this.onrowdblclick=NGrid_null;
this.asyncLoad=NGrid_asyncLoad;
this.asyncLoad_handler=NGrid_asyncLoad_handler;
this.asyncLoad_refresh=NGrid_null;
this.size(_b4,_b5);
setStyle(this.header,"zIndex",++WindowManager.maxZIndex);
setStyle(this.dom,"display","block");
}
function NGridHeader_setContent(_b8){
var _b9=typeof _b8;
switch(_b9){
case "number":
case "string":
this.prv.mDOM.innerHTML=_b8;
default:
this.prv.mContent=_b8;
break;
}
}
function NGridHeader_setWidth(_ba){
this.prv.mWidth=_ba;
setStyle(this.prv.mDOM,"width",_ba+"px");
}
function NGridHeader_prv_mDOM_onmousedown(_bb){
Controller.dragHeader=this;
if(!Controller.isInHeaderResizeArea){
if(!this.parent.prv.mParent.owner.currentQueryId){
return false;
}
if(this.parent.prv.mParent.owner.sortLock){
return false;
}
var _bc=this.parent;
if(_bc.prv.mOrderAsc){
this.className="cellAsc";
}else{
this.className="cellDesc";
}
_bc.prv.mSorted=true;
_bc.prv.mParent.onheaderfocus(_bc);
}else{
if(document.addEventListener){
document.addEventListener("mousemove",headerResizing,true);
document.addEventListener("mouseup",headerResizeStop,true);
}else{
document.onmousemove=headerResizing;
document.onmouseup=headerResizeStop;
}
}
return false;
}
function NGridHeader_prv_mDOM_onmouseup(_bd){
if(!Controller.isInHeaderResizeArea){
this.onfocus();
}
}
function NGridHeader_prv_mDOM_onmousemove(_be){
if((!_be)&&(!browser.ie7)){
return;
}
var _bf=xpEvent(_be);
var _c0=getMousePosition(_bf);
var _c1=getObjectPosition(this);
var _c2=this.parent.prv.mColumn;
var _c3=_c2.prv.mParent;
var x=_c0.x-_c1.x;
var _c5=5;
var _c6=this.style;
if(!isDefined(this._originalCursor)){
this._originalCursor=_c6.cursor;
}
this._resize=true;
Controller.isInHeaderResizeArea=true;
this._right=false;
if(x<this.offsetWidth&&x>=(this.offsetWidth-_c5)&&(_c2.prv.mIndex<_c3.prv.mColCount-1)){
_c6.cursor="e-resize";
this._right=true;
}else{
_c6.cursor=this._originalCursor;
this._resize=false;
Controller.isInHeaderResizeArea=false;
}
}
function NGridHeader_prv_mDOM_onmouseover(_c7){
this.className="cellOver";
}
function NGridHeader_prv_mDOM_onmouseout(_c8){
var _c9=this.parent;
if(_c9.prv.mSorted){
if(_c9.prv.mOrderAsc){
this.className="cellAsc";
}else{
this.className="cellDesc";
}
}else{
this.className="cell";
}
}
function NGridHeader_prv_mDOM_onfocus(_ca){
return false;
var _cb=this.parent;
if(_cb.prv.mOrderAsc){
this.className="cellAsc";
}else{
this.className="cellDesc";
}
_cb.prv.mSorted=true;
_cb.prv.mParent.onheaderfocus(_cb);
}
function NGridHeader_prv_mDOM_onblur(_cc){
return false;
this.parent.prv.mSorted=false;
this.className="cell";
}
function NGridHeader_destroy(){
this.prv.mDOM.parent=null;
this.prv.mParent=null;
this.prv.mColumn=null;
}
function NGridHeader(_cd){
this.prv={mParent:_cd,mDOM:_cd.getHeaderFrame(),mContent:null,mColumn:null,mWidth:50,mOrderAsc:false,mSorted:false};
this.destroy=NGridHeader_destroy;
this.prv.mDOM.parent=this;
this.setContent=NGridHeader_setContent;
this.setWidth=NGridHeader_setWidth;
this.prv.mDOM.onmousedown=NGridHeader_prv_mDOM_onmousedown;
this.prv.mDOM.onmouseup=NGridHeader_prv_mDOM_onmouseup;
this.prv.mDOM.onmousemove=NGridHeader_prv_mDOM_onmousemove;
this.prv.mDOM.onmouseover=NGridHeader_prv_mDOM_onmouseover;
this.prv.mDOM.onmouseout=NGridHeader_prv_mDOM_onmouseout;
this.prv.mDOM.onfocus=NGridHeader_prv_mDOM_onfocus;
this.prv.mDOM.onblur=NGridHeader_prv_mDOM_onblur;
this.setWidth(this.prv.mWidth);
}
function headerResizing(_ce){
if(!Controller.dragHeader){
return false;
}
Controller.isInHeaderResizeArea=true;
var _cf=xpEvent(_ce,true);
var dom=Controller.dragHeader;
var _d1=dom.parent;
var _d2=getMousePosition(_cf);
var pos=getObjectPosition(dom);
var dx=_d2.x-pos.x;
var _d5=_d1.prv.mColumn;
var _d6=_d5.prv.mParent;
_d5.setWidth(dx);
_d6.refresh();
if(_d6.owner){
_d6.owner.refresh();
}
dom._resize=true;
return false;
}
function headerResizeStop(_d7){
Controller.dragHeader=null;
var _d8=xpEvent(_d7,true);
var dom=_d8._target;
if(document.removeEventListener){
document.removeEventListener("mousemove",headerResizing,true);
document.removeEventListener("mouseup",headerResizeStop,true);
}else{
document.onmousemove=null;
document.onmouseup=null;
}
dom._resize=false;
return false;
}
function NGridRow_toString(){
return "[object GridRow]";
}
function NGridRow_getElementDOM(){
var _da=getElementByClassName(this.prv.mDOM,"cell");
if(this.prv.mElements.length<=0){
return _da;
}else{
return _da.cloneNode(true);
}
}
function NGridRow_setRow(_db){
for(var i=0;i<this.prv.mElements.length;i++){
if(isDefined(_db[i])){
this.prv.mElements[i].setContent(_db[i]);
}
}
}
function NGridRow_insertElement(_dd){
var _de=null;
if(isDefined(_dd)){
var _dd=(_dd>=0&&_dd<this.prv.mElements.length)?_dd:this.prv.mElements.length;
}else{
var _dd=this.prv.mElements.length;
}
var _df=new NGridElement(this);
this.prv.mElements.splice(_dd,0,_df);
_df.setPos(_dd,this.prv.mIndex);
this.prv.mDOM.insertBefore(_df.prv.mDOM,_de);
_df.clear();
}
function NGridRow_element(_e0){
return (_e0>=0&&_e0<this.prv.mElements.length)?this.prv.mElements[_e0]:null;
}
function NGridRow_prv_mDOM_onmouseover(_e1){
if(this.parent.prv.mFocus){
this.className="rowfocushover";
}else{
this.className="rowhover";
}
}
function NGridRow_prv_mDOM_onmouseout(_e2){
if(this.parent.prv.mFocus){
this.className="rowfocused";
}else{
this.className="row";
}
}
function NGridRow_prv_mDOM_onclick(_e3){
var _e4=xpEvent(_e3,true);
var row=this.parent;
if(row.prv.mParent.owner.owner!=undefined){
if(!row.prv.mParent.owner.owner.selectOneRow){
if(browser.safari||browser.ie7){
if(_e4._target.innerHTML!=""){
row.setFocus(!row.prv.mFocus);
}
}else{
if(_e4._target.textContent!=""){
row.setFocus(!row.prv.mFocus);
}
}
}else{
row.prv.mParent.setFocusAll(false);
row.setFocus(true);
}
}
this.onmouseover();
row.prv.mParent.onrowselect(row,_e3);
}
function NGridRow_prv_mDOM_ondblclick(_e6){
if(this.firstChild.innerHTML!=""){
var row=this.parent;
row.prv.mParent.onrowdblclick(row);
}
}
function NGridRow_setFocus(_e8){
if(!isDefined(_e8)){
var _e8=false;
}
if(_e8){
this.prv.mDOM.className="rowfocused";
}else{
this.prv.mDOM.className="row";
}
this.prv.mFocus=_e8;
}
function NGridRow_getCellValue(_e9){
if(this.element(_e9)){
return this.element(_e9).prv.mContent;
}else{
return null;
}
}
function NGridRow_getHeight(){
if(this.prv.mElements.length>0){
return this.prv.mElements[0].getHeight();
}else{
return 0;
}
}
function NGridRow_removeElement(_ea){
}
function NGridRow_size(_eb){
var _ec=_eb-this.prv.mElements.length;
if(_ec<0){
for(var i=0;i<Math.abs(_ec);i++){
this.removeElement();
}
}else{
for(var i=0;i<_ec;i++){
this.insertElement();
if(this.prv.mParent.column(i)){
this.element(i).setWidth(this.prv.mParent.column(i).prv.mHeader.prv.mWidth);
}
}
}
}
function NGridRow_setIndex(_ee){
if(_ee>=this.prv.mElements.length){
return;
}
for(var i=0;i<this.prv.mElements.length;i++){
this.prv.mElements[i].setPos(null,_ee);
}
this.prv.mIndex=_ee;
}
function NGridRow_clear(){
for(var i=0;i<this.prv.mElements.length;i++){
this.prv.mElements[i].clear();
}
}
function NGridRow_destroy(){
this.prv.mDOM.parent=null;
this.prv.mParent=null;
for(var i in this.prv.mElements){
this.prv.mElements[i].destroy();
}
}
function NGridRow(_f2){
this.prv={mParent:_f2,mDOM:_f2.getRowDOM(),mElements:new Array(),mIndex:_f2.prv.mRowCount,mFocus:false};
this.prv.mDOM.parent=this;
this.toString=NGridRow_toString;
this.getElementDOM=NGridRow_getElementDOM;
this.setRow=NGridRow_setRow;
this.insertElement=NGridRow_insertElement;
this.element=NGridRow_element;
this.prv.mDOM.onmouseover=NGridRow_prv_mDOM_onmouseover;
this.prv.mDOM.onmouseout=NGridRow_prv_mDOM_onmouseout;
this.prv.mDOM.onclick=NGridRow_prv_mDOM_onclick;
this.prv.mDOM.ondblclick=NGridRow_prv_mDOM_ondblclick;
this.setFocus=NGridRow_setFocus;
this.getCellValue=NGridRow_getCellValue;
this.getHeight=NGridRow_getHeight;
this.removeElement=NGridRow_removeElement;
this.size=NGridRow_size;
this.setIndex=NGridRow_setIndex;
this.clear=NGridRow_clear;
this.destroy=NGridRow_destroy;
this.size(_f2.prv.mColCount);
return this;
}
function NGridColumn_element(_f3){
return (_f3>=0&&_f3<this.prv.mElements.length)?this.prv.mElements[_f3]:null;
}
function NGridColumn_header(){
return this.prv.mHeader;
}
function NGridColumn_setHeader(_f4){
var _f5=this.prv.mHeader;
_f5.setContent(_f4);
_f5.prv.mColumn=this;
}
function NGridColumn_setColumn(_f6){
for(var i=0;i<this.prv.mElements.length;i++){
if(isDefined(_f6[i])){
this.prv.mElements[i].setContent(_f6[i]);
}
}
}
function NGridColumn_getWidth(){
if(this.prv.mElements.length>0){
return this.prv.mElements[0].getWidth();
}else{
return this.prv.mWidth;
}
}
function NGridColumn_setWidth(_f8,_f9){
var _f8=((_f8>this.prv.mMinimumWidth)||(_f9))?_f8:this.prv.mMinimumWidth;
for(var i=0;i<this.prv.mElements.length;i++){
this.prv.mElements[i].setWidth(_f8);
}
this.prv.mWidth=_f8;
this.prv.mHeader.setWidth(_f8);
}
function NGridColumn_setIndex(_fb){
if(_fb>=this.prv.mElements.length){
return;
}
for(var i=0;i<this.prv.mElements.length;i++){
this.prv.mElements[i].setPos(_fb,null);
}
this.prv.mIndex=_fb;
}
function NGridColumn_destroy(){
this.prv.mParent=null;
this.prv.mHeader.destroy();
for(var i in this.prv.mElements){
this.prv.mElements[i].destroy();
}
}
function NGridColumn_hide(){
var _fe=0;
for(var i=0;i<this.prv.mElements.length;i++){
this.prv.mElements[i].setWidth(_fe);
this.prv.mElements[i].prv.mDOM.className="cell cell_hidden";
}
this.prv.mWidth=_fe;
this.prv.mHeader.setWidth(_fe);
this.prv.mHeader.prv.mDOM.style.display="none";
this.prv.mVisible=false;
if(this.prv.mParent.refresh){
this.prv.mParent.refresh();
}
if(this.prv.mParent.owner){
if(this.prv.mParent.owner.refresh){
this.prv.mParent.owner.refresh();
}
}
}
function NGridColumn_show(){
var _100=this.prv.mMinimumWidth;
for(var i=0;i<this.prv.mElements.length;i++){
this.prv.mElements[i].setWidth(_100);
this.prv.mElements[i].prv.mDOM.className="cell";
}
this.prv.mWidth=_100;
this.prv.mHeader.setWidth(_100);
this.prv.mHeader.prv.mDOM.style.display="";
this.prv.mVisible=true;
if(this.prv.mParent.refresh){
this.prv.mParent.refresh();
}
if(this.prv.mParent.owner){
if(this.prv.mParent.owner.refresh){
this.prv.mParent.owner.refresh();
}
}
}
function NGridColumn(_102){
this.prv={mParent:_102,mElements:new Array(),mHeader:new NGridHeader(_102),mIndex:0,mWidth:50,mMinimumWidth:50,mVisible:true};
this.prv.mHeader.prv.mColumn=this;
this.element=NGridColumn_element;
this.header=NGridColumn_header;
this.setHeader=NGridColumn_setHeader;
this.setColumn=NGridColumn_setColumn;
this.getWidth=NGridColumn_getWidth;
this.setWidth=NGridColumn_setWidth;
this.setIndex=NGridColumn_setIndex;
this.destroy=NGridColumn_destroy;
this.hide=NGridColumn_hide;
this.show=NGridColumn_show;
var _103=this.prv.mHeader;
this.prv.mParent.header.insertBefore(_103.prv.mDOM,null);
return this;
}
function NGridElement_getWidth(){
if(this.prv.mWidth>0&&this.prv.mWidth>this.prv.mDOM.offsetWidth){
return this.prv.mWidth;
}else{
return this.prv.mDOM.offsetWidth;
}
}
function NGridElement_getHeight(){
if(this.prv.mDOM.offsetHeight){
if(this.prv.mHeight>0&&this.prv.mHeight>this.prv.mDOM.offsetHeight){
return this.prv.mHeight;
}else{
return this.prv.mDOM.offsetHeight;
}
}else{
return this.prv.mHeight;
}
}
function NGridElement_setWidth(_104){
this.prv.mWidth=_104;
setStyle(this.prv.mDOM,"width",_104+"px");
}
function NGridElement_setHeight(_105){
this.prv.mHeight=_105;
setStyle(this.prv.mDOM,"height",_105+"px");
}
function NGridElement_setPos(aX,aY){
if(isDefined(aX)){
this.prv.mPosX=aX;
}
if(isDefined(aY)){
this.prv.mPosY=aY;
}
}
function NGridElement_prv_mDOM_onmousedown(){
return false;
}
function NGridElement_prv_mDOM_onmouseup(){
return true;
}
function NGridElement_setType(_108){
this.prv.mType=_108;
}
function NGridElement_link_ti_dom_onclick(){
this.parent.setSelected(true,true);
this.winRef.activate();
}
function NGridElement_link_newWindow_onsize(){
var _109=getElementByClassName(this.image,"image_preview");
_109.widht=this.contentArea.offsetWidth;
_109.height=this.contentArea.offsetHeight;
}
function NGridElement_link_newWindow_onclose(){
if(this.tbitem){
this.tbitem.remove();
this.tbitem=null;
}
if(this.contentArea.grid){
this.contentArea.grid.destroy();
}
if(this.editor){
this.editor.destroy();
}
}
function NGridElement_link_onclick(_10a){
var _10b=this.parent.picWidth;
var _10c=this.parent.picHeight;
if(_10a){
xpEvent(_10a,false);
}
imageNode=getTemplate("image_preview_container");
var _10d=WindowManager.createNewWindow();
_10d.titleBar.innerHTML=STR["image_viewer"];
if(_10b<300){
_10b=300;
}
if(_10c<200){
_10c=200;
}
_10d.size(_10b,_10c);
_10d.contentArea.appendChild(imageNode);
_10d.activate();
_10d.open();
i=1;
while($("image_preview_container"+i)!=null){
i++;
}
imageNode.id="image_preview_container"+i;
if(taskbar){
var ti=new taskbarItem(taskbar);
i=1;
while($("dax_taskbar_button_image"+i)!=null){
i++;
}
ti.dom.id="dax_taskbar_button_image"+i;
ti.setLabel("Image"+i);
ti.setIcon("editor");
var ref=this;
ti.dom.winRef=_10d;
ti.dom.onclick=NGridElement_link_ti_dom_onclick;
setStyle(ti.dom,"display","block");
ti.setSelected(true,true);
ti.parent.refresh();
_10d.tbitem=ti;
}
_10d.image=imageNode;
_10d.onsize=NGridElement_link_newWindow_onsize;
this.image=getElementByClassName(imageNode,"image_preview");
this.image.src=this.aContent;
_10d.onclose=NGridElement_link_newWindow_onclose;
return false;
}
function NGridElement_setContent(_110){
var type=typeof _110;
switch(type){
case "string":
case "number":
var dom=this.prv.mDOM;
if((_110.indexOf)&&(_110.indexOf("ddw_link")!=-1)&&(_110.indexOf("http:")!=-1)){
dom.innerHTML=_110;
}else{
var _113=/^\/DAX\/GetImage\/|http:\/\//;
if(_113.test(_110)){
var _114=/^\/DAX\/GetImage\//;
var dom=this.prv.mDOM;
link=document.createElement("a");
dom.innerHTML="";
dom.appendChild(link);
dom.link=link;
link.className="dax_grid_imagelink";
link.href="#";
link.parent=this;
link.aContent=_110;
link.onclick=NGridElement_link_onclick;
if(_114.test(_110)){
link.innerHTML=STR["view_image"];
}else{
link.innerHTML=_110;
}
}else{
this.prv.mDOM.innerHTML=_110;
}
}
break;
case "object":
if(_110 instanceof String){
this.setContent(_110.valueOf());
}else{
if(_110.nodeType==1){
this.clear();
this.prv.mDOM.appendChild(_110);
}
}
break;
default:
break;
}
this.prv.mContent=_110;
}
function NGridElement_prv_mDOM_nullevent(_115){
}
function NGridElement_clear(){
this.setContent("");
}
function NGridElement_destroy(){
this.prv.mDOM.parent=null;
this.prv.mParent=null;
}
function NGridElement(_116){
this.prv={mParent:_116,mDOM:_116.getElementDOM(),mPosX:0,mPosY:0,mType:1,mWidth:50,mHeight:20,mContent:null};
this.prv.mDOM.parent=this;
this.getWidth=NGridElement_getWidth;
this.getHeight=NGridElement_getHeight;
this.setWidth=NGridElement_setWidth;
this.setHeight=NGridElement_setHeight;
this.setPos=NGridElement_setPos;
this.prv.mDOM.onmousedown=NGridElement_prv_mDOM_onmousedown;
this.prv.mDOM.onmouseup=NGridElement_prv_mDOM_onmouseup;
this.setType=NGridElement_setType;
this.setContent=NGridElement_setContent;
this.prv.mDOM.onmouseover=NGridElement_prv_mDOM_nullevent;
this.prv.mDOM.onmouseout=NGridElement_prv_mDOM_nullevent;
this.prv.mDOM.onclick=NGridElement_prv_mDOM_nullevent;
this.clear=NGridElement_clear;
this.destroy=NGridElement_destroy;
this.setWidth(this.prv.mWidth);
this.setHeight(this.prv.mHeight);
this.setContent("");
return this;
}
function inline_query_delay(obj,_118,_119,_11a,_11b,_11c,_11d,_11e){
if(!obj.delaySearchObj){
obj.delaySearchObj={fieldid:_119,value:_11a,queryId:_11b,queryName:_11c,dataWindowRef:_11d,keepOldQueryId:_11e,isDelayed:false};
}
if(_118){
obj.delaySearchObj.value=_11a;
}
if(obj){
if(obj.boundTo){
obj.boundTo.search.saveButton.disable();
}else{
if(obj.saveButton){
obj.saveButton.disable();
}else{
var _11f=getParentByClassName(obj,"searchwidget");
if(_11f){
_11f.owner.search.saveButton.disable();
}
}
}
}
var _120=obj.delaySearchObj;
debugAlert(_120.value+"-- isDelayed:"+_120.isDelayed+" delayInt:"+_120.delayInt);
if(_118){
window.clearTimeout(_120.delayInt);
_120.delayInt=window.setTimeout(function(){
inline_query_delay(obj,false);
},1000);
}else{
window.clearTimeout(_120.delayInt);
obj.delaySearchObj=null;
inline_query(obj,_120.fieldid,_120.value,_120.queryId,_120.queryName,_120.dataWindowRef,_120.keepOldQueryId);
}
}
function inline_query(obj,_122,_123,_124,_125,_126,_127){
if(obj){
if(obj.boundTo){
obj.boundTo.search.saveButton.disable();
}else{
if(obj.saveButton){
obj.saveButton.disable();
}else{
var _128=getParentByClassName(obj,"searchwidget");
if(_128){
_128.owner.search.saveButton.disable();
}
}
}
}
if(!_126){
var _129=null;
if(!(_129=getParentByClassName(obj,"window_toolbar"))){
return;
}
var _12a=_129.parent.contentArea;
}else{
var _12a=_126.contentArea;
}
var _12b=null;
if(_123!="*"){
_12b="&fieldid="+_122+"&comp=equal&value="+dax_bridge.encode(_123)+"@";
}
var grid=_12a.grid;
if(!grid.selection){
grid.selection={tableId:grid.owner.table.tableid,queryId:null,tableName:grid.owner.table.tablename,map:new Array(),formatMap:new Array(),fieldTypeMap:new Array(),range:{start:0,length:0},toString:function(){
return this.tableId+" "+this.queryId+" "+this.tableName+" "+this.total;
}};
}
grid.selection.comparison=_12b;
if(_125){
grid.recreateSelection=true;
var pop={queryName:_125,tableId:grid.selection.tableId,startIndex:0,comparison:grid.selection.comparison};
}else{
if(!_124){
var pop={queryId:grid.selection.queryId,tableId:grid.selection.tableId,startIndex:grid.selection.range.start,comparison:grid.selection.comparison,keepOldQueryId:_127};
}else{
var pop={queryId:_124,tableId:grid.selection.tableId,startIndex:grid.selection.range.start,comparison:grid.selection.comparison,keepOldQueryId:_127};
}
}
grid.clear();
grid.populate(pop);
}
function addAsyncGrid(_12e,node){
nGrid=new NGrid();
node.appendChild(nGrid.dom);
nGrid.asyncLoad(_12e);
return grid;
}
function ListBox_insertRow(_130){
aRow=this.grid.insertRow();
aRow.setRow(_130);
}
function ListBox_redraw(){
this.dom.style.width=this.width+"px";
this.dom.style.height=this.height+"px";
this.grid.setColumnWidth(this.dom.offsetWidth/this.grid.prv.mColCount);
this.grid.refresh();
}
function ListBox(_131,_132,_133,_134){
if(!_131){
return;
}
var _135=document.createElement("div");
this.target=_131;
this.dom=_135;
this.grid=new NGrid(_132.length,0);
this.target.appendChild(this.dom);
if(!_133){
this.width=this.target.offsetWidth;
}else{
this.width=_133;
}
if(!_133){
this.height=this.target.offsetHeight;
}else{
this.height=_134;
}
this.dom.appendChild(this.grid.dom);
this.dom.style.overflow="auto";
for(i=0;i<_132.length;i++){
this.grid.column(i).setHeader(_132[i]);
var _136=this.grid.column(i).prv.mHeader;
_136.prv.mDOM.onmouseover="";
_136.prv.mDOM.onmouseout="";
_136.prv.mDOM.onclick="";
_136.prv.mDOM.onmouseup="";
_136.prv.mDOM.onmousedown="";
}
this.insertRow=ListBox_insertRow;
this.redraw=ListBox_redraw;
this.redraw();
return this;
}

var rudiDebug=false;
function CustomEditor(){
var _1=getTemplate("customeditor");
if(!_1){
return;
}
this.content=_1.cloneNode(true);
this.tearaway=new TearAway();
this.dom=this.tearaway.getDOM();
this.content.parent=this;
this.content.id="customeditor"+getElementsByClassName(document.body,"customeditor").length;
this.getDOM=function(){
return this.dom;
};
this.formMargin=10;
this.redraw=function(){
var ta=this.tearaway;
ta.size(this.content.offsetWidth+20,this.content.offsetHeight+29);
var _3=this.dom;
_3.middle.ml.style.height=_3.middle.m.offsetHeight+"px";
_3.middle.mr.style.height=_3.middle.m.offsetHeight+"px";
_3.style.height=_3.top.offsetHeight+_3.middle.offsetHeight+_3.bottom.offsetHeight+"px";
};
this.construct=function(){
makeCall("/osxdbcustomform.xml?formname=[People]WidgetForm",this.construct_handler,this,null);
};
this.construct_handler=function(_4,_5){
if(_4.readyState!=4){
return;
}
var _6=_4.responseXML.getElementsByTagName("formsize").item(0);
var _7=_6.getAttribute("height");
var _8=_6.getAttribute("width");
_5.content.style.width=+_8+(+_5.formMargin*2)+"px";
_5.content.style.height=+_7+(+_5.formMargin*2)+"px";
_5.redraw();
var _9=_4.responseXML.getElementsByTagName("page").item(1);
var _a=_9.childNodes;
var _b=getTemplate("customeditor_text");
var _c=getTemplate("customeditor_input");
var _d=getTemplate("customeditor_image");
var _e=getTemplate("customeditor_radio");
var _f=getTemplate("customeditor_check");
for(fel=0;fel<_a.length;fel++){
var _10=_a.item(fel);
switch(_10.nodeName){
case "text":
var _11=_b.cloneNode(true);
_5.content.appendChild(_11);
var _12=_10.getElementsByTagName("coord").item(0);
_11.style.top=(+_12.getAttribute("top"))+(+_5.formMargin)+"px";
_11.style.left=(+_12.getAttribute("left"))+(+_5.formMargin)+"px";
var _13=_10.getElementsByTagName("format").item(0);
_11.style.fontFamily=_13.getAttribute("font");
_11.style.fontSize=_13.getAttribute("size")+"px";
_11.style.fontWeight=_13.getAttribute("weight");
_11.style.fontStyle=_13.getAttribute("style");
_11.style.color=_13.getAttribute("color");
_11.innerHTML=_10.lastChild.nodeValue;
_11.style.display="block";
break;
case "variable":
var _14=_10.getAttribute("type");
switch(_14){
case "Field":
case "Variable":
var _15=_c.cloneNode(true);
_5.content.appendChild(_15);
var _12=_10.getElementsByTagName("coord").item(0);
_15.style.top=(+_12.getAttribute("top"))+(+_5.formMargin)+"px";
_15.style.left=(+_12.getAttribute("left"))+(+_5.formMargin)+"px";
_15.style.width=(+_12.getAttribute("width"))+"px";
_15.style.height=(+_12.getAttribute("height"))+"px";
_15.value=_10.lastChild.nodeValue;
_15.style.display="block";
break;
case "PictureLibrary":
var _16=_d.cloneNode(true);
_5.content.appendChild(_16);
var _12=_10.getElementsByTagName("coord").item(0);
_16.style.top=(+_12.getAttribute("top"))+(+_5.formMargin)+"px";
_16.style.left=(+_12.getAttribute("left"))+(+_5.formMargin)+"px";
_16.style.width=(+_12.getAttribute("width"))+"px";
_16.style.height=(+_12.getAttribute("height"))+"px";
_16.src="/osxdbcustomform.xml?librarypicture="+_10.lastChild.nodeValue+"&formname=[People]WidgetForm"+"&key="+1;
_16.style.display="block";
break;
}
break;
case "radiobutton":
var _17=_e.cloneNode(true);
_5.content.appendChild(_17);
var _18=getElementByClassName(_17,"customeditor_radio_radio");
var _19=getElementByClassName(_17,"customeditor_radio_text");
var _12=_10.getElementsByTagName("coord").item(0);
_17.style.top=(+_12.getAttribute("top"))+(+_5.formMargin)+"px";
_17.style.left=(+_12.getAttribute("left"))+(+_5.formMargin)+"px";
_19.innerHTML=_10.lastChild.nodeValue;
_17.style.display="block";
break;
case "checkbox":
var _1a=_f.cloneNode(true);
_5.content.appendChild(_1a);
var _1b=getElementByClassName(_1a,"customeditor_check_check");
var _1c=getElementByClassName(_1a,"customeditor_check_text");
var _12=_10.getElementsByTagName("coord").item(0);
_1a.style.top=(+_12.getAttribute("top"))+(+_5.formMargin)+"px";
_1a.style.left=(+_12.getAttribute("left"))+(+_5.formMargin)+"px";
_1c.innerHTML=_10.lastChild.nodeValue;
_1a.style.display="block";
break;
case "checkbox":
var _1a=_f.cloneNode(true);
_5.content.appendChild(_1a);
var _1b=getElementByClassName(_1a,"customeditor_check_check");
var _1c=getElementByClassName(_1a,"customeditor_check_text");
var _12=_10.getElementsByTagName("coord").item(0);
_1a.style.top=(+_12.getAttribute("top"))+(+_5.formMargin)+"px";
_1a.style.left=(+_12.getAttribute("left"))+(+_5.formMargin)+"px";
_1c.innerHTML=_10.lastChild.nodeValue;
_1a.style.display="block";
break;
}
}
};
setStyle(this.content,"display","block");
this.tearaway.setContent(this.content);
this.tearaway.getDOM().owner=this;
return this;
}

function HList(){
var _1=getTemplate("hl");
if(!_1){
return null;
}
this.items=new Array();
this.dom=_1.cloneNode(true);
this.expanded=true;
this.isChild=false;
this.length=0;
this.draganddrop=false;
this.draging=false;
var i=1;
while($("hl"+i)!=null){
i++;
}
this.idNumber=i;
this.dom.id="hl"+this.idNumber;
this.build=function(_3){
var _4=_3.childNodes;
for(var i=0;i<_4.length;i++){
var _6=_4[i];
if(_6.nodeName.toLowerCase()=="li"){
var tn=getTextNode(_6);
var li=this.insert(tn.nodeValue);
var _9=_6.childNodes;
for(var j=0;j<_9.length;j++){
var _b=_9[j].nodeName.toLowerCase();
if(_b=="ul"||_b=="ol"){
var hl=new HList();
li.attach(hl.build(_9[j]));
}
}
}
}
return this;
};
this.load=function(_d){
this.items=new Array();
for(var i=0;i<_d.length;i++){
this.insert(_d[i]);
}
};
this.insert=function(_f,_10,_11){
var li=new HListItem(_f,_10);
if(_11!=null&&_11!=undefined){
this.items.splice(_11,0,li);
}else{
_11=this.items.push(li)-1;
}
this.dom.insertBefore(li.dom,(this.items[_11+1]?this.items[_11+1].dom:null));
li.parent=this;
if(_10!=null&&_10!=undefined&&_10!=""){
li.setIcon(_10);
}
this.length++;
return li;
};
this.rename=function(_13,_14){
if(_14>0&&_14<this.items.length()&&_14!=undefined){
this.items[_14].label=_13;
return 1;
}else{
return 0;
}
};
this.remove=function(_15){
if(_15>0&&(_15-1)<this.items.length&&_15!=undefined){
this.items.splice(_15,1);
return 1;
}else{
return 0;
}
};
this.move=function(_16,_17){
if((_16>=0&&_16<this.items.length&&_16!=undefined)&&(_17>=0&&_17<=this.items.length&&_17!=undefined)){
var li=this.items[_16];
this.items.splice(_16,1);
this.dom.removeChild(li.dom);
if(_17==this.items.length){
this.dom.appendChild(li.dom);
this.items.splice(_17,0,li);
}else{
this.dom.insertBefore(li.dom,this.items[_17].dom);
this.items.splice(_17,0,li);
}
return 1;
}else{
return 0;
}
};
this.refresh=function(){
for(var i in this.items){
this.items[i].setExpander();
}
};
setStyle(this.dom,"display","block");
return this;
}
function HListItem(_1a,_1b){
var _1c=getTemplate("hl_item");
if(!_1c){
return null;
}
if(browser.ie){
_1c.style.styleFloat="none";
}
this.dom=_1c.cloneNode(true);
this.expander=getElementByClassName(this.dom,"hl_item_expander");
this.icon=getElementByClassName(this.dom,"hl_item_icon");
this.label=getElementByClassName(this.dom,"hl_item_label");
this.sublist=getElementByClassName(this.dom,"hl_item_sublist");
var i=1;
while($("hl_item"+i)!=null){
i++;
}
this.idNumber=i;
this.dom.id="hl_item"+this.idNumber;
this.expander.parent=this;
this.sublist.parent=this;
this.label.parent=this;
this.icon.parent=this;
this.dom.parent=this;
this.list=null;
this.parent=null;
this.setIcon=function(url){
this.icon.style.backgroundImage="url("+url+")";
this.icon.style.cursor="pointer";
};
this.setExpander=function(){
var _1f=this.parent.items[0]==this;
var _20=this.parent.items[this.parent.items.length-1]==this;
if(this.list&&this.list.length>0){
if(this.list.expanded){
this.expander.className="hl_item_expander_a";
}else{
this.expander.className="hl_item_expander";
}
}else{
if(_1f&&!_20){
if(this.parent.isChild){
this.expander.className="hl_item_expander_t";
}else{
this.expander.className="hl_item_expander_h";
}
}else{
if(_20&&!_1f){
this.expander.className="hl_item_expander_l";
}else{
if(!_1f&&!_20){
this.expander.className="hl_item_expander_t";
}else{
if(_1f&&_20){
this.expander.className="hl_item_expander_l";
}
}
}
}
}
if(_20){
this.sublist.className="hl_item_sublist_a";
}else{
this.sublist.className="hl_item_sublist";
}
};
this.expand=function(){
if(this.list){
if(this.list.expanded){
this.sublist.style.display="none";
this.list.expanded=false;
}else{
this.sublist.style.display="block";
this.list.expanded=true;
}
this.list.refresh();
this.setExpander();
}
};
this.attach=function(hl){
this.list=hl;
this.list.isChild=true;
this.list.parent=this;
this.sublist.insertBefore(hl.dom,null);
this.expand();
};
this.expander.onclick=function(){
var li=this.parent;
li.expand();
this.parent.parent.draganddrop=false;
};
this.icon.onmousedown=function(){
return false;
};
this.icon.onmouseup=function(){
if(this.parent.parent.draganddrop){
for(var i in this.parent.parent.items){
if(this.parent==this.parent.parent.items[i]){
itemto=i;
}
}
if(itemto>itemfrom){
this.parent.parent.items[itemto].label.innerHTML=this.parent.parent.items[itemto].label.textContent;
}
if(itemto<itemfrom){
this.parent.parent.items[itemto].label.innerHTML=this.parent.parent.items[itemto].label.textContent;
}
if(itemfrom!=itemto){
this.parent.parent.move(itemfrom,itemto);
}
}
this.parent.parent.draganddrop=false;
if(itemto!=itemfrom){
this.parent.parent.draging=false;
}
return true;
};
this.icon.onmouseover=function(){
if(this.parent.parent.draganddrop){
for(var i in this.parent.parent.items){
if(this.parent==this.parent.parent.items[i]){
itemto=i;
}
}
if(itemto!=itemfrom){
this.parent.parent.draging=true;
}
if(itemto>itemfrom){
if(this.parent.parent.items[itemto].list){
if(this.parent.parent.items[itemto].list.expanded){
this.parent.parent.items[itemto].expand();
}
}
this.parent.parent.items[itemto].label.innerHTML=this.parent.parent.items[itemto].label.innerHTML+"<br><img src='images/insert.png>";
}
if(itemto<itemfrom){
this.parent.parent.items[itemto].label.innerHTML="<img src='images/insert.png><br>"+this.parent.parent.items[itemto].label.innerHTML;
}
}
return true;
};
this.icon.onmouseout=function(){
if(this.parent.parent.draganddrop){
for(var i in this.parent.parent.items){
if(this.parent==this.parent.parent.items[i]){
itemto=i;
}
}
if(itemto>itemfrom){
this.parent.parent.items[itemto].label.innerHTML=this.parent.parent.items[itemto].label.textContent;
}
if(itemto<itemfrom){
this.parent.parent.items[itemto].label.innerHTML=this.parent.parent.items[itemto].label.textContent;
}
}
return true;
};
this.label.onmouseup=function(){
if(this.parent.parent.draganddrop){
for(var i in this.parent.parent.items){
if(this.parent==this.parent.parent.items[i]){
itemto=i;
}
}
if(itemto>itemfrom){
this.parent.parent.items[itemto].label.innerHTML=this.parent.parent.items[itemto].label.textContent;
}
if(itemto<itemfrom){
this.parent.parent.items[itemto].label.innerHTML=this.parent.parent.items[itemto].label.textContent;
}
if(itemfrom!=itemto){
this.parent.parent.move(itemfrom,itemto);
}
}
this.parent.parent.draganddrop=false;
this.parent.parent.draging=false;
return true;
};
this.label.onmousedown=function(){
if(labeledit){
return true;
}else{
return false;
}
};
setStyle(this.dom,"display","block");
this.label.innerHTML=_1a;
}
function HGrid(_27,_28,_29){
this.loaded=false;
var _2a=getTemplate("hgrid");
var _2b=getTemplate("hgrid_body");
var _2c=getTemplate("hgrid_spacer");
this.table=getTable(_28);
if((!_2a)||(!this.table)||(!_2b)||(!_2c)){
return null;
}
this.table.cacheFields();
if(this.table.showallrecordstab=="false"){
return false;
}
this.dom=_2a.cloneNode(true);
this.body=_2b.cloneNode(true);
this.header=getElementByClassName(this.dom,"hgrid_header");
this.container=getElementByClassName(this.dom,"hgrid_container");
this.spacer=_2c.cloneNode(true);
this.viewport=new ViewPort();
this.window=null;
this.horOffset=32;
this.maxLevel=0;
this.firstColWidth=32;
this.levelField=new Array();
this.hlists=new Array();
this.hitems=new Array();
this.lastLists=new Array();
this.ignoreFields=new Array();
this.columns=0;
this.width=0;
this.height=0;
this.maxGridRows=4;
this.cellHeight=25;
this.vScrollPos=0;
this.gridRows=1;
this.populateFunc=null;
this.selectedItem=null;
this.selectedRec=new Array();
this.selectedQue=new Array();
this.queryIds=new Array();
this.isWindow=true;
this.isWindowMode=true;
this.predefinedQuery=null;
this.breakCount=false;
this.quickScroll=false;
this.customActions={gridClick:false,gridDblClick:false,headerClick:false};
this.onBreakLevelHeaderClick=function(){
};
i=1;
while($("hgrid"+i)!=null){
i++;
}
this.idNumber=i;
this.dom.id="hgrid"+this.idNumber;
this.body.id="hgrid_body"+this.idNumber;
this.spacer.id="hgrid_spacer"+this.idNumber;
for(i=0;i<this.table.fieldsList.length;i++){
var _2d=this.table.fieldsList[i].fieldbreaklevel;
if(_2d>0){
this.ignoreFields.push(this.table.fieldsList[i]);
this.levelField[_2d]=this.table.fieldsList[i];
if(_2d>this.maxLevel){
this.maxLevel=_2d;
this.firstColWidth=this.maxLevel*this.horOffset;
}
}
}
if(this.maxLevel==0){
return false;
}
this.selectOneRow=false;
if(_29){
if(_29==true){
this.selectOneRow=true;
}
}
this.showBreakCount=function(_2e){
if(_2e){
this.breakCount==true;
}else{
this.breakCount==false;
}
};
this.setQuickScroll=function(_2f){
if(_2f){
this.quickScroll=true;
}else{
this.quickScroll=false;
}
};
if((this.table.showallrecordstab.toLowerCase()=="true")||(this.table.preselectQueries.length==0)){
this.predefinedQuery=null;
}else{
this.predefinedQuery=this.table.preselectQueries[0].name;
}
var _30=WindowManager.createNewWindow();
_30.titleBar.innerHTML=this.table.tablealias;
_30.contentArea.appendChild(this.dom);
_30.minimumWidth=250;
_30.minimumHeight=175;
_30.activate();
_30.open();
_30.status.style.height="19px";
_30.tableId=this.table.tableid;
_30.closeBox.onmouseup=function(_31){
WindowManager.hideWindow(this.parent);
window.clearTimeout(this.parent.boundTo.refreshTimeout);
this.parent.tbitem.dom.style.display="none";
return false;
};
this.parent=_30.contentArea;
this.window=_30;
if(browser.ie){
setStyle(_30.contentArea,"position","relative");
}
_30.boundTo=this;
_30.onsize=function(){
this.boundTo.redraw();
};
_30.onsizestop=function(){
this.boundTo.getRecords();
};
if(taskbar){
var ti=new taskbarItem(taskbar);
ti.setLabel(_30.titleBar.innerHTML);
ti.setIcon("datawindow");
setStyle(ti.dom,"display","block");
var _33=_30;
ti.dom.onclick=function(){
this.parent.setSelected(true,true);
_33.activate();
};
ti.setSelected(true,true);
ti.parent.refresh();
_30.tbitem=ti;
}
_30.refreshBox.boundTo=this;
_30.refreshBox.onmouseup=function(_34){
var _34=xpEvent(_34,true);
this.className="window_refreshbox";
this.boundTo.redraw();
this.boundTo.updateLists();
return false;
};
_30.onclose=function(){
if(this.tbitem){
this.tbitem.remove();
}
if(this.editor){
this.editor.destroy();
}
if(this.boundTo){
this.boundTo.destroy();
}
};
_30.getEditor=function(){
if(this.editor){
return this.editor;
}
this.editor=new Editor();
var dom=this.editor.getDOM();
this.dom.style.zIndex=++WindowManager.maxZIndex;
this.dom.m.appendChild(dom);
var _36=(this.dom.offsetWidth/2)-(dom.offsetWidth/2);
setStyle(dom,"position","absolute");
setStyle(dom,"left",_36+"px");
if(browser.ie){
setStyle(dom,"top","30px");
}
this.editor.owner=this;
this.editor.onaftersave=function(){
this.owner.boundTo.updateLists();
this.owner.boundTo.redraw();
};
this.editor.onafterdelete=function(){
this.owner.boundTo.updateLists();
this.owner.boundTo.redraw();
};
dom.ondragstop=function(_37){
this.className="tearaway_torn";
var _38=this.owner;
if(_38.owner){
var _39=_38.owner;
if(!_39.editor){
return;
}
var dom=_39.editor.getDOM();
var pos=getObjectPosition(this);
if(taskbar){
var ti=new taskbarItem(taskbar);
i=1;
while($("dax_taskbar_button"+_39.titleBar.innerHTML+i)!=null){
i++;
}
ti.dom.id="dax_taskbar_button"+_39.titleBar.innerHTML+i;
ti.setLabel(STR["taskbar_edit"]+" "+_39.titleBar.innerHTML+" "+i);
ti.setIcon("editor");
var ref=this;
ti.dom.onclick=function(){
this.parent.setSelected(true,true);
ref.onclick();
};
setStyle(ti.dom,"display","block");
ti.setSelected(true,true);
ti.parent.refresh();
}
_38.prv.mDOM.cancelBtn.onclick=function(_3e){
if(taskbar){
ti.remove();
}
document.body.removeChild(this.parent.prv.mTearAway.dom);
this.parent.destroy();
};
this.onclick=function(_3f){
if(WindowManager.active){
WindowManager.active.deactivate();
}
setStyle(this,"zIndex",++WindowManager.maxZIndex);
if(ti){
ti.setSelected(true,true);
}
};
_39.deactivate();
_39.editor=null;
this.parent.owner=null;
document.body.insertBefore(this,null);
setStyle(this,"left",pos.x+"px");
setStyle(this,"top",pos.y+"px");
}
};
return this.editor;
};
this.toolbar=new Toolbar();
if(this.toolbar){
if(_30){
_30.addToolbar(this.toolbar.prv.mDOM);
_30.resizeToolbar(false);
var _40=getElementByClassName(_30.dom,"window_toolbar");
_40.className="window_toolbar hgrid_view_toolbar";
}else{
var _40=getElementByClassName(this.container,"calendar_view_toolbar");
if(_40){
_40.appendChild(this.toolbar.prv.mDOM);
setStyle(this.parent,"height",this.container.offsetHeight-this.toolbar.prv.mDOM.offsetHeight+"px");
setStyle(_40,"width",this.container.offsetWidth+"px");
}else{
setStyle(this.parent,"height",this.container.offsetHeight+"px");
}
}
var _41=this.toolbar.addButton("<div class=\"datacore_deleterecord\"></div>");
_41.boundTo=this;
_41.onclick=function(){
if(!this.boundTo.selectedRec){
return;
}
var _42=this.boundTo.selectedRec.length;
if(_42==0){
alert(STR["delete_records"]);
}else{
if(_42>0){
var _43=confirm(STR["delete_records1"]+" "+_42+" "+STR["delete_records2"]);
if(_43){
deleteRecords(this.boundTo.table.tableid,this.boundTo.selectedRec);
var _44=new Array();
for(r=0;r<this.boundTo.selectedQue.length;r++){
if(_44.length>0){
if(_44.indexOf(this.boundTo.selectedQue[r])==-1){
_44.push(this.boundTo.selectedQue[r]);
}
}
}
this.boundTo.selectedRec=new Array();
this.boundTo.selectedQue=new Array();
this.boundTo.updateLists(_44);
}
}
}
};
this.deleteButton=_41;
var _45=this.table;
if((_45)&&(_45.ddwOptions)&&(_45.ddwOptions.length>0)){
var _46=_45.ddwOptions[0];
var _47=this.toolbar.addButton(_46.title);
_47.url=_46.url;
_47.title=_46.title;
_47.owner=this;
if(_46.type.indexOf("Static")!=-1){
_47.onclick=function(){
var _48=this.owner.table.tableid;
new DDW(this.url,"static_url",this.window,"&tableid="+_48,this.owner.selectedRec);
};
}else{
if(_46.type.indexOf("Dynamic")!=-1){
_47.onclick=function(){
var _49=this.owner.table.tableid;
new DDW(this.url,"dynamic_url",this.window,"&tableid="+_49,this.owner.selectedRec);
};
}else{
if(_46.type.indexOf("Message")!=-1){
_47.onclick=function(){
var _4a=this.owner.table.tableid;
new DDW(this.url,"message_window",this.owner.window,"&tableid="+_4a,this.owner.selectedRec);
};
}
}
}
}
}
this.grid=new NGrid();
this.grid.owner=this;
var _4b=[];
for(var _4c=0;_4c<this.table.fieldsList.length;_4c++){
var _4d=getField(this.table.tableid,this.table.fieldsList[_4c].fieldid);
if(_4d.fieldinlist.toLowerCase()=="true"){
_4b.push(_4d);
}
}
this.grid.size((_4b.length-this.maxLevel)+1,30);
this.container.appendChild(this.grid.dom);
this.grid.refresh();
if(browser.ie){
for(i=0;i<this.grid.prv.mRowCount;i++){
for(j=0;j<this.grid.row(i).prv.mElements.length;j++){
if(this.isWindow){
this.grid.row(i).element(j).prv.mDOM.style.height="21px";
}else{
this.grid.row(i).element(j).prv.mDOM.style.height=this.cellHeight+"px";
}
}
}
}
this.container.appendChild(this.viewport.dom);
this.viewport.parent=this.container;
this.viewport.setContent(this.body);
this.viewport.setOverflow(0,0);
this.viewport.boundTo=this.body;
this.viewport.resizeOnRefresh=false;
this.viewport.owner=this;
this.viewport.onvscrollstart=function(_4e){
if(this.owner.quickScroll){
for(i=0;i<this.owner.grid.prv.mRowCount;i++){
var _4f=this.owner.grid.row(i);
_4f.clear();
if(_4f.prv.mFocus){
_4f.setFocus(false);
}
}
}
};
this.viewport.cellHeight=this.cellHeight;
this.viewport.onvscroll=function(_50,_51){
var _52=(_50*(-1)*this.vscrollbar.ratio);
var _53=this.cellHeight;
if((browser.ie)&&(this.owner.isWindow)){
_53=26;
}
var _54=_52%_53;
var _55=(_54>(_53/2))?(_52+_54):(_52-_54);
setStyle(this.boundTo,"top",_55+"px");
if(!this.owner.quickScroll){
if(this.owner.vScrollPos!=_55){
var _56=(_55-this.owner.vScrollPos)/_53;
if(_56>0){
for(b=0;b<_56;b++){
this.owner.grid.insertRow(0);
for(j=0;j<this.owner.grid.row(0).prv.mElements.length;j++){
if((this.owner.isWindow)&&(browser.ie)){
this.owner.grid.row(0).element(j).prv.mDOM.style.height="21px";
}
}
}
}else{
for(b=0;b>_56;b--){
this.owner.grid.removeRow(0);
this.owner.grid.insertRow();
for(j=0;j<this.owner.grid.row(this.owner.grid.prv.mRowCount-1).prv.mElements.length;j++){
if((this.owner.isWindow)&&(browser.ie)){
this.owner.grid.row(this.owner.grid.prv.mRowCount-1).element(j).prv.mDOM.style.height="21px";
}
}
}
}
this.owner.vScrollPos=_55;
}
}
};
this.viewport.onvscrollstop=function(){
this.owner.getRecords();
};
this.viewport.vscrollbar.increment=this.cellHeight;
this.columns=(_4b.length-this.maxLevel);
var _57=1;
for(i=0;i<=_4b.length;i++){
if(i==0){
this.grid.column(i).setHeader(STR["hgrid_first_column"]);
this.grid.column(i).prv.mHeader.prv.mDOM.onmouseover="";
this.grid.column(i).prv.mHeader.prv.mDOM.onmouseout="";
this.grid.column(i).prv.mHeader.prv.mDOM.onmouseup="";
this.grid.column(i).prv.mHeader.prv.mDOM.owner=this;
}else{
if(_4b[i-1].fieldbreaklevel==0){
this.grid.column(_57).setHeader(_4b[i-1].fieldalias);
this.grid.column(_57).prv.mHeader.prv.mDOM.onmouseover="";
this.grid.column(_57).prv.mHeader.prv.mDOM.onmouseout="";
this.grid.column(_57).prv.mHeader.prv.mDOM.onmouseup="";
this.grid.column(_57).prv.mHeader.prv.mDOM.owner=this;
_57++;
}
}
}
this.destroy=function(){
if((this.queryIds)&&(this.queryIds.length>0)){
clearQuery(this.queryIds,true);
}
};
this.redraw=function(){
var _58=this.parent.offsetHeight-24+"px";
var _59=this.parent.offsetWidth-4+"px";
setStyle(this.viewport.dom,"width",_59);
setStyle(this.viewport.dom,"height",_58);
var _5a=this.body.offsetHeight+25-this.viewport.dom.offsetHeight;
this.viewport.vscrollbar.isStatic=true;
this.viewport.vscrollbar.areaHeight=this.body.offsetHeight+25;
this.viewport.setOverflow(_5a,0);
this.viewport.refresh();
if(this.body.offsetHeight>2000){
this.quickScroll=true;
}else{
this.quickScroll=false;
}
if(browser.gecko){
if(this.isWindow){
this.viewport.dom.style.top="79px";
this.viewport.vscrollbar.dom.style.height=this.viewport.dom.offsetHeight+"px";
}else{
this.viewport.dom.style.left="0px";
this.viewport.dom.style.top="49px";
this.viewport.vscrollbar.dom.style.height=this.viewport.dom.offsetHeight+"px";
}
}
if(browser.ie6){
this.viewport.dom.style.top="20px";
this.viewport.vscrollbar.dom.style.height=this.viewport.dom.offsetHeight+"px";
}
if(browser.ie7){
if(this.isWindow){
this.viewport.dom.style.top="24px";
}else{
this.viewport.dom.style.top="19px";
}
}
if((browser.safari)&&(!this.isWindow)){
this.viewport.dom.style.top="49px";
}
for(f=0;f<this.grid.prv.mRowCount;f++){
if(this.grid.row(f).recordId){
if((this.selectedRec.length>0)&&(findInArray(this.selectedRec,this.grid.row(f).recordId)!=-1)){
this.grid.row(f).setFocus(true);
}else{
this.grid.row(f).setFocus(false);
}
}
}
if(!browser.gecko){
var _5b=this.parent.offsetWidth;
for(g=0;g<this.hitems.length;g++){
var _5c=this.hitems[g];
var _5d=0;
var _5e=_5c.label;
if(browser.ie){
while(_5e.className!="hgrid_body"){
_5d+=_5e.offsetLeft;
_5e=_5e.parentNode;
}
}
var _5f=this.viewport.dom.offsetWidth-_5d;
setStyle(_5c.label,"width",_5f+"px");
if((_5f+100)>_5b){
_5b=_5f+100;
}
}
setStyle(this.viewport.content,"width",_5b);
}
this.viewport.vscrollbar.dom.style.top="0px";
var _60=this.viewport.vscrollbar.dom.style.left;
if(this.isWindow){
if((browser.ie)&&(!this.isWindowMode)){
this.viewport.vscrollbar.dom.style.left=+_60.substr(0,_60.length-2)-10+"px";
}else{
this.viewport.vscrollbar.dom.style.left=+_60.substr(0,_60.length-2)-14+"px";
}
}else{
if(browser.ie){
if(this.isWindowMode){
this.viewport.vscrollbar.dom.style.left=+_60.substr(0,_60.length-2)-10+"px";
}else{
this.viewport.vscrollbar.dom.style.left=+_60.substr(0,_60.length-2)-6+"px";
}
}else{
if(browser.safari){
this.viewport.vscrollbar.dom.style.left=+_60.substr(0,_60.length-2)-26+"px";
}else{
this.viewport.vscrollbar.dom.style.left=+_60.substr(0,_60.length-2)+"px";
}
}
}
};
this.refreshHeader=function(){
};
this.getRecords=function(){
var _61=Math.abs(this.body.offsetTop);
var _62=_61+this.viewport.dom.offsetHeight;
if(this.populateFunc){
this.populateFunc.abort=true;
this.populateFunc=null;
}
var _63=new Object();
_63.hGrid=this;
_63.abort=false;
_63.handler=this.getRecords_handler;
this.populateFunc=_63;
var _64=new Array();
this.gridRows=1;
for(i=0;i<this.grid.prv.mRowCount;i++){
var _65=this.grid.row(i);
_65.queryId=null;
_65.recordPosition=null;
_65.recordId=null;
_65.toString=function(){
return "[object DataTreeGridRow]";
};
}
for(i=0;i<this.lastLists.length;i++){
var _66=this.lastLists[i];
if((!_66.recordCount)||(_66.recordCount>0)){
if(browser.ie){
var _67=0;
var _68=_66.dom;
if(_68){
while(_68.className!="hgrid_body"){
_67+=_68.offsetTop;
_68=_68.parentNode;
}
}
}else{
_67=_66.dom.offsetTop;
}
debugAlert("lOffTop:"+_66.dom.offsetTop+" topBound:"+_61+" lOffHeight:"+_66.dom.offsetHeight+" btmBound:"+_62);
if((_67<=_62)&&((_67+_66.dom.offsetHeight)>=_61)){
if(_63.abort){
return;
}
var _69=this.cellHeight;
if(this.lastLists[i].spacer){
var _6a=this.lastLists[i].spacer;
if(!browser.ie){
var _6b=_6a.offsetTop;
}else{
var _6b=0;
var _68=_6a;
if(_68){
while(_68.className!="hgrid_body"){
_6b+=_68.offsetTop;
_68=_68.parentNode;
}
}
}
var _6c=_6b+_6a.offsetHeight;
if((_6b<=_62)&&(_6c>=_61)){
_66.query.currentPos=null;
_66.query.batchSize=null;
_64.push(_66.query);
var _6d=(_61<=_6b)?_6b:_61;
var _6e=(_62>=_6c)?_6c:_62;
var _6f=(_6e-_6d)/_69;
var _70=Math.floor(((_6d-_61)/_69));
var _71=(_61<=_6b)?1:((_61-_6b)/_69);
for(j=0;j<_6f;j++){
var _72=_70+j;
this.grid.row(_72).queryId=_66.query.queryId;
this.grid.row(_72).recordPosition=_71+j;
if((_72+1)>this.gridRows){
this.gridRows=_72+1;
}
}
_66.query.currentPos=_71;
_66.query.batchSize=_6f;
_66.query.callRef=_63;
}
}
}
}
}
for(q=(this.gridRows-1);q<this.grid.prv.mRowCount;q++){
this.grid.row(q).clear();
}
_63.queries=_64;
this.getRecords_handler(null,_63);
};
this.getRecords_handler=function(_73,_74){
if(_74.abort){
return;
}
if(_73){
if(_73.readyState!=4){
return;
}
if(checkResponse(_73)){
return;
}
if(callback_onViewQuery){
_73=callback_onViewQuery(_74.hGrid.table.tablename,_73,"datatree");
}
_74.currentQuery.parseResult(_73);
var _75=_74.currentQuery.result;
if(_75){
if(_75.length>0){
for(t=0;t<_75.length;t++){
var _76=_74.currentQuery.queryId;
if(_74.hGrid.queryIds.length>0){
if(findInArray(_74.hGrid.queryIds,_76)==-1){
_74.hGrid.queryIds.push(_76);
}
}else{
_74.hGrid.queryIds.push(_77.queryId);
}
var _78=_75[t].selectionid;
for(u=0;u<_74.hGrid.grid.prv.mRowCount;u++){
var _79=_74.hGrid.grid.row(u);
if(_79.queryId){
if((_79.queryId==_76)&&(_79.recordPosition==_78)){
var _7a=new Array();
_7a.push("");
var _7b=new Array();
var _7c=0;
for(v=0;v<_75[t].fields.length;v++){
if(getField(_74.hGrid.table.tableid,_75[t].fields[v].id).fieldbreaklevel==0){
value=_75[t].fields[v].value;
var ddw=_75[t].fields[v].ddw?_75[t].fields[v].ddw:null;
var _7e=_75[t].fields[v].ddwtype?_75[t].fields[v].ddwtype:null;
if((ddw)&&(_7e)){
var _7f=_75[t].fields[v].id+"["+_75[t].fields[v].fieldrecordid+"]";
if(_7e.indexOf("Static")!=-1){
value="<a class='ddw_link' href='#' onclick='new DDW(\""+ddw+"\", \"static_url\",this.textContent, \"&recordid="+_7f+"&tableid="+_74.hGrid.table.tableid+"\"); return false;'>"+value+"</a>";
}else{
if(_7e.indexOf("Dynamic")!=-1){
value="<a class='ddw_link' href='#' onclick='new DDW(\""+ddw+"\", \"dynamic_url\",this.textContent, \"&recordid="+_7f+"&tableid="+_74.hGrid.table.tableid+"\"); return false;'>"+value+"</a>";
}else{
if(_7e.indexOf("Message")!=-1){
value="<a class='ddw_link' href='#' onclick='new DDW(\""+ddw+"\", \"message_window\", this.parentNode.parent.prv.mParent.prv.mParent.owner.window , \"&recordid="+_7f+"&tableid="+_74.hGrid.table.tableid+"\"); return false;'>"+value+"</a>";
}
}
}
_7b.push(_7c);
}
_7a.push(value);
_7c++;
}
}
_79.setRow(_7a);
_79.ddwLinks=new Array();
if(_7b.length>0){
for(y=0;y<_7b.length;y++){
_79.ddwLinks.push(getElementByClassName(_79.prv.mDOM,"ddw_link"));
}
}
_79.imageLinks=new Array();
var _80=getElementsByClassName(_79.prv.mDOM,"dax_grid_imagelink");
_79.imageLinks=new Array();
if(_80.length>0){
for(y=0;y<_80.length;y++){
_79.imageLinks.push(_80[y]);
}
}
_79.recordId=_75[t].recordid;
_79.toString=function(){
return "[object DataTreeGridRow]";
};
break;
}
}
}
}
}
}
}
if(_74.queries.length>0){
var _77=_74.queries.pop();
_74.currentQuery=_77;
_77.nextBatch(_74.handler);
}else{
_74.hGrid.redraw();
var _81=_74.hGrid;
if(_81.refreshTimeout){
clearTimeout(_81.refreshTimeout);
}
_81.refreshTimeout=setTimeout(function(){
_81.redraw();
_81.updateLists();
},3000*60);
}
};
this.customize=function(_82,_83,_84,_85){
if(_82==true){
this.customActions.gridClick=true;
}else{
this.customActions.gridClick=false;
}
if(_83==true){
this.customActions.gridDblClick=true;
}else{
this.customActions.gridDblClick=false;
}
if(_84==true){
this.customActions.headerClick=true;
}else{
this.customActions.headerClick=false;
}
if(_85==true){
this.deleteButton.prv.mDOM.style.display="block";
}else{
this.deleteButton.prv.mDOM.style.display="none";
}
};
this.refresh=function(){
};
this.initialize=function(){
aList=new HList();
this.body.appendChild(aList.dom);
setStyle(aList.dom.style,"float","none");
aList.level=1;
aList.parent=this;
aList.selected=null;
aList.queryId=null;
aList.owner=this;
this.hlists.push(aList);
this.populate(aList);
if(this.grid){
var _86=this.grid.dom.offsetWidth;
var _87=((_86-this.firstColWidth)/this.columns);
this.grid.setColumnWidth(_87);
this.grid.column(0).setWidth(this.firstColWidth);
this.grid.column(0).prv.mMinimumWidth=this.firstColWidth;
this.grid.refresh();
}
};
this.primeQuery=function(_88){
li=_88.parent;
aQuery=new Query(li.parent.owner.table.tableid);
li.query=aQuery;
aQuery.batchSize=0;
aQuery.callRef=_88;
aQuery.breakSelected=dax_bridge.encode(li.selected);
aQuery.breakQueryId=li.queryId;
aQuery.breakGetLevel=li.parent.level;
aQuery.queryName=li.parent.owner.predefinedQuery;
aHandler=this.primeQuery_handler;
aQuery.nextBatch(aHandler);
};
this.primeQuery_handler=function(_89,_8a){
if(_89.readyState!=4){
return;
}
if(!_8a){
return;
}
aList=_8a;
var _8b=checkResponse(_89);
aQuery.parseBreak(_89);
var _8c=aList.parent.parent.owner;
var _8d=aQuery.recordsInSelection;
aList.parent.spacing.innerHTML="";
if(_8c.queryIds.length>0){
if(findInArray(_8c.queryIds,aQuery.queryId)==-1){
_8c.queryIds.push(aQuery.queryId);
}
}else{
_8c.queryIds.push(aQuery.queryId);
}
if(_8d>0){
var _8e=_8c.spacer.cloneNode(true);
_8e.boundTo=_8c;
_8e.parent=aList;
aList.parent.spacing.appendChild(_8e);
setStyle(_8e,"width",_8c.viewport.dom.offsetWidth+"px");
var _8f=((browser.ie)&&(_8c.isWindow))?(((_8c.cellHeight+1)*_8d)+"px"):(_8c.cellHeight*_8d+"px");
_8e.style.height=_8f;
if(browser.ie){
aList.parent.spacing.style.height=_8f;
}
aList.parent.spacer=_8e;
_8e.ondblclick=function(_90){
var _90=xpEvent(_90);
var _91=getMousePosition(_90);
var _92=getObjectPosition(_8c.grid.body);
var _93=parseInt((_91.y-_92.y)/_8c.cellHeight);
var _94=_8c.grid.row(_93);
if(_94){
if(_8c.customActions.gridDblClick){
_8c.grid.onrowdblclick(_94);
}else{
if(_8c.table.fieldsDetail.length==0){
return false;
}
if(isDefined(_8c.window.editor)&&isDefined(_8c.window.editor.record)){
_8c.window.editor.edit();
}else{
_8c.window.getEditor();
setStyle(_8c.window.editor.getDOM(),"display","block");
var _95=_8c.window.editor;
}
_8c.window.editor.onAfterPull=function(){
for(fieldId in this.record.map){
var _96=getField(this.record.tableId,fieldId);
if(_96.fieldbreaklevel!=0){
if(_96.fieldtype=="date"){
this.prv.mInputs[this.record.map[fieldId]].picker.value.disable=true;
}else{
this.prv.mInputs[this.record.map[fieldId]].prv.mDOM.value.disabled=true;
}
this.prv.mInputs[this.record.map[fieldId]].prv.mModified=true;
}
}
};
_8c.window.editor.pull(_8c.table.tableid,_94.recordId);
var _97=this.boundTo.selectedItem;
while(_97){
var _98=_97.data.value;
var _99=_97.data.fieldid;
var _9a=this.boundTo.table.tableid;
if(getField(_9a,_99).fieldtype=="date"){
_8c.window.editor.prv.mInputs[_95.record.map[_99]].picker.value.disable=true;
}else{
_8c.window.editor.prv.mInputs[_95.record.map[_99]].prv.mDOM.value.disabled=true;
}
_8c.window.editor.prv.mInputs[_95.record.map[_99]].prv.mModified=true;
if(_97.parent.parent.data){
_97=_97.parent.parent;
}else{
_97=null;
}
}
}
}
};
_8e.onclick=function(_9b){
var _9c=browser.ie?(_8c.cellHeight+1):_8c.cellHeight;
var _9b=xpEvent(_9b);
var _9d=getMousePosition(_9b);
var _9e=getObjectPosition(_8c.grid.body);
var _9f=parseInt((_9d.y-_9e.y)/_9c);
var _a0=_8c.grid.row(_9f);
var _a1=_a0.recordId;
if(!_a1){
return false;
}
if(_8c.selectedRec.length>0){
_a2=findInArray(_8c.selectedRec,_a1);
}else{
var _a2=-1;
}
var _a3=null;
var _a4=null;
if(_a0.ddwLinks.length>0){
for(y=0;y<_a0.ddwLinks.length;y++){
var _a5=getObjectPosition(_a0.ddwLinks[y]);
if((_9d.x>_a5.x)&&(_9d.x<_a5.x+_a0.ddwLinks[y].offsetWidth)){
if((_9d.y>_a5.y)&&(_9d.y<_a5.y+_a0.ddwLinks[y].offsetHeight)){
_a3=_a0.ddwLinks[y];
break;
}
}
}
}
if(_a0.imageLinks.length>0){
for(y=0;y<_a0.imageLinks.length;y++){
var _a5=getObjectPosition(_a0.imageLinks[y]);
if((_9d.x>_a5.x)&&(_9d.x<_a5.x+_a0.imageLinks[y].offsetWidth)){
if((_9d.y>_a5.y)&&(_9d.y<_a5.y+_a0.imageLinks[y].offsetHeight)){
_a4=_a0.imageLinks[y];
break;
}
}
}
}
if(_a3){
_a3.onclick();
}else{
if(_a4){
_a4.onclick();
}else{
if(!(_8c.customActions.gridClick)){
if(_a2==-1){
_a0.setFocus(true);
_8c.selectedRec.push(_a1);
_8c.selectedQue.push(_a0.queryId);
}else{
_a0.setFocus(false);
_8c.selectedRec.splice(_a2,1);
_8c.selectedQue.splice(_a2,1);
}
}else{
if(_8c.selectOneRow){
_8c.grid.setFocusAll(false);
_a0.setFocus(true);
}
_8c.grid.onrowselect(_a0);
}
}
}
};
}else{
var _a6=aList.parent;
_a6.sublist.innerHTML="";
_a6.list=null;
_a6.parent.refresh();
}
aList=aList.parent;
if((aList.data.ddw)&&(aList.data.ddwtype)){
if(aList.data.ddwtype.indexOf("Static")!=-1){
aList.label.innerHTML="<a class='ddw_link' href='#' onclick='new DDW(\""+aList.data.ddw+"\", \"static_url\",this.textContent, \"&data="+encodeURIComponent(aList.data.value)+"&queryid="+aList.queryId+"\"); return false;'>"+aList.data.value+"</a> ("+_8d+")";
}else{
if(aList.data.ddwtype.indexOf("Dynamic")!=-1){
aList.label.innerHTML="<a class='ddw_link' href='#' onclick='new DDW(\""+aList.data.ddw+"\", \"dynamic_url\",this.textContent, \"&data="+encodeURIComponent(aList.data.value)+"&queryid="+aList.queryId+"\"); return false;'>"+aList.data.value+"</a> ("+_8d+")";
}else{
if(aList.data.ddwtype.indexOf("Message")!=-1){
aList.label.innerHTML="<a class='ddw_link' href='#' onclick='new DDW(\""+aList.data.ddw+"\", \"message_window\",this.parentNode.parent.parent.owner.window, \"&data="+encodeURIComponent(aList.data.value)+"&queryid="+aList.queryId+"\"); return false;'>"+aList.data.value+"</a> ("+_8d+")";
}
}
}
}else{
aList.label.innerHTML=aList.formattedValue+" ("+_8d+")";
}
_8c.getRecords();
};
this.populate=function(_a7){
aQuery=new Query(this.table.tableid);
aQuery.batchSize=20;
aQuery.callRef=_a7;
aQuery.breakLevel=_a7.level;
aQuery.breakSelected=dax_bridge.encode(_a7.selected);
aQuery.breakQueryId=_a7.queryId;
aQuery.queryName=this.predefinedQuery;
aHandler=this.populate_handler;
aQuery.nextBatch(aHandler);
};
this.populate_handler=function(_a8,_a9){
if(_a8.readyState!=4){
return;
}
if(!_a9){
return;
}
var _aa=checkResponse(_a8);
var _ab=_a9;
var _ac=_ab.owner;
aQuery.parseBreak(_a8);
if(_ac.queryIds.length>0){
if(findInArray(_ac.queryIds,aQuery.queryId)==-1){
_ac.queryIds.push(aQuery.queryId);
}
}else{
_ac.queryIds.push(aQuery.queryId);
}
if(aQuery.size>0){
for(b=0;b<aQuery.result.length;b++){
var _ad=aQuery.queryId;
var _ae=_ab.owner.table.tableid;
var _af=aQuery.result[b].value;
var _b0=aQuery.result[b].ddw;
var _b1=aQuery.result[b].ddwtype;
var _b2=aQuery.result[b].ddwtitle;
if(_af){
var _b3=getField(_ae,aQuery.fieldid).fieldformat;
if(_b3){
var _b4=format(_b3,_af);
}else{
var _b4=_af;
}
var _b5=_ab.insert(_b4);
_ab.owner.hitems.push(_b5);
_b5.icon.onmousedown=null;
_b5.icon.onmouseup=null;
_b5.icon.onmouseover=null;
_b5.icon.onmouseout=null;
_b5.label.onmouseup=null;
_b5.label.onmousedown=null;
_b5.label.disableUnderline=true;
_b5.label.className=_b5.label.className+" level"+_ab.level;
if(browser.ie){
setStyle(_b5.label,"height","25px");
}
var _b6=new HList();
_b5.attach(_b6);
_b5.data=new Object();
_b5.data.tableid=_ab.owner.table.tableid;
_b5.data.fieldid=aQuery.fieldid;
_b5.data.value=_b4;
_b5.cached=false;
var _b7=_b6.insert(STR["loading"]);
_ab.dummy=_b7;
_b6.refresh();
setStyle(_b7.dom,"display","none");
_b5.queryId=_ad;
_b5.selected=_af;
_b5.formattedValue=_b4;
_b5.data.ddw=_b0;
_b5.data.ddwtype=_b1;
_b5.data.ddwtitle=_b2;
if((_b5.data.ddw)&&(_b5.data.ddwtype)){
if(_b5.data.ddwtype.indexOf("Static")!=-1){
_b5.label.innerHTML="<a class='ddw_link' href='#' onclick='new DDW(\""+_b5.data.ddw+"\", \"static_url\",this.textContent, \"&data="+encodeURIComponent(_b5.data.value)+"&queryid="+_b5.queryId+"\"); return false;'>"+_b5.data.value+"</a>";
}else{
if(_b5.data.ddwtype.indexOf("Dynamic")!=-1){
_b5.label.innerHTML="<a class='ddw_link' href='#' onclick='new DDW(\""+_b5.data.ddw+"\", \"dynamic_url\",this.textContent, \"&data="+encodeURIComponent(_b5.data.value)+"&queryid="+_b5.queryId+"\"); return false;'>"+_b5.data.value+"</a>";
}else{
if(_b5.data.ddwtype.indexOf("Message")!=-1){
_b5.label.innerHTML="<a class='ddw_link' href='#' onclick='new DDW(\""+_b5.data.ddw+"\", \"message_window\",this.parentNode.parent.parent.owner.window, \"&data="+encodeURIComponent(_b5.data.value)+"&queryid="+_b5.queryId+"\"); return false;'>"+_b5.data.value+"</a>";
}
}
}
}
if(_ab.level==_ab.owner.maxLevel){
_b5.expander.onclick=function(){
var li=this.parent;
_ac=li.parent.owner;
li.expand();
li.labelText=li.label.innerHTML;
if(li.cached==false){
while(li.list.dom.firstChild){
li.list.dom.removeChild(li.list.dom.firstChild);
}
aGridNode=getTemplate("hgrid_object");
aGridParent=aGridNode.cloneNode(true);
li.list.dom.appendChild(aGridParent);
li.spacing=aGridParent;
var i=1;
while($("hgrid_object"+i)!=null){
i++;
}
li.spacing.idNumber=i;
li.spacing.id="hgrid_object"+li.spacing.idNumber;
setStyle(li.spacing,"height","25px");
var _ba=getTemplate("spinner_left").cloneNode(true);
i=1;
while($("spinner_left"+i)!=null){
i++;
}
_ba.id="spinner_left"+i;
li.spacing.appendChild(_ba);
setStyle(_ba,"display","block");
setStyle(_ba,"visibility","visible");
_ac.lastLists.push(li);
_ac.primeQuery(this);
li.cached=true;
}else{
_ac.getRecords();
}
_ac.redraw();
};
_b5.icon.onclick=_b5.expander.onclick;
_b5.label.onclick=function(){
var _bb=this.parent.parent.owner;
if(_bb.selectedItem){
_bb.selectedItem.label.className="hl_item_label level"+_bb.selectedItem.parent.level;
}
_bb.selectedItem=this.parent;
_bb.selectedItem.label.className="hl_item_label level_sel";
if(_bb.customActions.headerClick){
_bb.onBreakLevelHeaderClick(_bb.selectedItem.selected,_bb.selectedItem.parent.level);
}
};
}else{
_b5.expander.onclick=function(){
var li=this.parent;
_ac=li.parent.owner;
if(li.cached==false){
nList=new HList();
li.attach(nList);
nList.level=(parseFloat(li.parent.level)+1);
nList.owner=_ac;
li.cached=true;
nList.queryId=li.queryId;
nList.selected=li.selected;
_ac.populate(nList);
}else{
li.expand();
_ac.getRecords();
}
_ac.redraw();
};
_b5.icon.onclick=_b5.expander.onclick;
_b5.label.onclick=function(){
var _bd=this.parent.parent.owner;
if(_bd.selectedItem){
_bd.selectedItem.label.className="hl_item_label level"+_bd.selectedItem.parent.level;
}
_bd.selectedItem=this.parent;
_bd.selectedItem.label.className="hl_item_label level_sel";
if(_bd.customActions.headerClick){
_bd.onBreakLevelHeaderClick(_bd.selectedItem.selected,_bd.selectedItem.parent.level);
}
};
_b5.label.onmouseover=null;
_b5.label.onmouseout=null;
}
}
}
if(_ab.level!=1){
_ab.parent.expand();
}
}
_ab.refresh();
_ac.redraw();
};
this.updateLists=function(_be){
if(this.populateFunc){
this.populateFunc.abort=true;
this.populateFunc=null;
}
if((!_be)||(_be.length==0)){
var _bf=this.lastLists.slice();
}else{
var _bf=new Array();
for(u=0;u<this.lastLists.length;u++){
var _c0=_be.indexOf(this.lastLists[u].query.queryId);
if(_c0!=-1){
if(_bf.indexOf(this.lastLists[u].query.queryId)==-1){
_bf.push(this.lastLists[u]);
}
}
}
}
var _c1=_bf;
_c1.owner=this;
_c1.handler=this.updateLists_handler;
this.populateFunc=_c1;
this.updateLists_handler(null,_c1);
};
this.updateLists_handler=function(_c2,_c3){
if(_c2){
if(_c2.readyState!=4){
return;
}
}
if(!_c3){
return;
}
if(_c3.abort){
return;
}
if(_c2){
if(checkResponse(_c2)){
debugAlert("error in .updateLists_handler");
}
var _c4=_c3.currentList;
var _c5=_c3.currentQuery;
_c5.parseBreak(_c2);
var _c6=_c4.parent.owner;
var _c7=_c5.recordsInSelection;
_c4.recordCount=_c7;
if(_c7>0){
if(!_c4.list){
_c4.owner.primeQuery(_c4);
}else{
_c4.spacer.style.width=_c6.viewport.dom.offsetWidth+"px";
_c4.spacer.style.height=(_c6.cellHeight*_c7)+"px";
}
}else{
setStyle(_c4.spacing,"width","0px");
setStyle(_c4.spacing,"height","0px");
setStyle(_c4.sublist,"width","0px");
setStyle(_c4.sublist,"height","0px");
_c4.list=null;
_c4.parent.refresh();
if(_c4.spacer){
setStyle(_c4.spacer,"width","0px");
setStyle(_c4.spacer,"height","0px");
}
}
if((_c4.data)&&(_c4.data.ddw)&&(_c4.data.ddwtype)){
if(_c4.data.ddwtype.indexOf("Static")!=-1){
_c4.label.innerHTML="<a class='ddw_link' href='#' onclick='new DDW(\""+_c4.data.ddw+"\", \"static_url\",this.textContent, \"&data="+encodeURIComponent(_c4.data.value)+"&queryid="+_c4.queryId+"\"); return false;'>"+_c4.data.value+"</a> ("+_c7+")";
}else{
if(_c4.data.ddwtype.indexOf("Dynamic")!=-1){
_c4.label.innerHTML="<a class='ddw_link' href='#' onclick='new DDW(\""+_c4.data.ddw+"\", \"dynamic_url\",this.textContent, \"&data="+encodeURIComponent(_c4.data.value)+"&queryid="+_c4.queryId+"\"); return false;'>"+_c4.data.value+"</a> ("+_c7+")";
}else{
if(_c4.data.ddwtype.indexOf("Message")!=-1){
_c4.label.innerHTML="<a class='ddw_link' href='#' onclick='new DDW(\""+_c4.data.ddw+"\", \"message_window\",this.parentNode.parent.parent.owner.window, \"&data="+encodeURIComponent(_c4.data.value)+"&queryid="+_c4.queryId+"\"); return false;'>"+_c4.data.value+"</a> ("+_c7+")";
}
}
}
}else{
_c4.label.innerHTML=_c4.formattedValue+" ("+_c7+")";
}
}
if(_c3.length>0){
var li=_c3.pop();
_c5=new Query(li.parent.owner.table.tableid);
li.query=_c5;
_c5.batchSize=1;
_c5.callRef=_c3;
_c5.breakSelected=dax_bridge.encode(li.selected);
_c5.breakQueryId=li.queryId;
_c5.breakGetLevel=li.parent.level;
_c5.queryName=li.parent.owner.predefinedQuery;
aHandler=this.primeQuery_handler;
_c3.currentQuery=_c5;
_c3.currentList=li;
_c5.nextBatch(_c3.handler);
}else{
_c3.owner.redraw();
_c3.owner.getRecords();
}
};
this.initialize();
if(_27){
if((browser.gecko)||(browser.safari)){
this.isWindow=false;
}else{
this.isWindow=true;
}
this.isWindowMode=false;
var _c9=getObjectPosition(_27);
_30.dom.style.top=_c9.y+"px";
_30.dom.style.left=_c9.x+"px";
_30.size(_27.offsetWidth,_27.offsetHeight,true);
_30.dom.top.style.display="none";
_30.dom.btm.style.display="none";
_30.dom.l.style.display="none";
_30.dom.r.style.display="none";
if(browser.safari){
_30.dom.style.position="absolute";
_30.dom.style.overflow="hidden";
_30.dom.m.style.width=_30.dom.offsetWidth+"px";
_30.dom.m.style.overflow="hidden";
this.dom.style.width=_30.dom.offsetWidth-12+"px";
}
}
if(_30){
_30.resize(1,1);
}
this.loaded=true;
}

function Tabs_destroy(){
purgeparents(this);
this.current=null;
this.first=null;
this.last=null;
for(var i in this.tabs){
this.tabs[i].destroy();
}
delete this.tabs;
}
function Tabs(){
var _2=getTemplate("tabs");
if(!_2){
return null;
}
this.dom=_2.cloneNode(true);
generateUniqueId(this.dom);
this.tabarea=getElementByClassName(this.dom,"tab_area");
this.contents=getElementByClassName(this.dom,"contents");
this.pagearea=getElementByClassName(this.contents,"tab_page_area");
this.tabs=new Array();
this.pages=new Array();
this.closeButton=getElementByClassName(this.dom,"tab_close",true);
this.firstDisplayTabIndex=0;
this.newDisplayTabIndex=0;
this.lastDisplayTabIndex=0;
this.isRefreshing=false;
this.dom.parent=this;
this.dom.style.display="block";
this.onswitch=function(_3){
};
this.destroy=Tabs_destroy;
this.tab=function(_4){
if(_4>=0&&_4<this.tabs.length){
return this.tabs[_4];
}else{
return null;
}
};
this.insert=function(_5,_6,_7,_8){
var _9=new Tab(_5,_6);
if(!_8){
if(_6==null||_6==undefined){
_6=this.tabs.push(_9)-1;
this.last=this.tabs[_6];
this.pages.push(null);
}else{
this.tabs.splice(_6,0,_9);
this.pages.splice(_6,0,null);
}
this.current=this.tabs[_6];
this.current.parent=this;
this.tabs[_6].index=_6;
this.tabarea.insertBefore(this.current.dom,(this.tabs[_6+1]?this.tabs[_6+1].dom:null));
}else{
this.tabarea.insertBefore(_9.dom,(this.tabs[this.tabs.length]?this.tabs[this.tabs.length].dom:null));
}
if(_7){
this.current.page=_7;
this.pagearea.insertBefore(_7,(this.pages[_6+1]?this.pages[_6+1]:null));
this.contents.style.display="block";
}
if(!_8){
this.activate(this.current);
return this.current;
}else{
return _9;
}
};
this.remove=function(_a,_b){
if(_b){
_a=_b.index;
this.tabarea.removeChild(_b.dom);
delete _b;
this.tabs.splice(_a,1);
}else{
if(_a==null||_a==undefined){
this.tabarea.removeChild(this.last.dom);
var _b=this.tabs.pop();
delete _b;
}else{
var _b=this.tabs[_a];
this.tabarea.removeChild(_b.dom);
delete _b;
this.tabs.splice(_a,1);
}
}
this.updateIndex();
};
this.activateById=function(_c){
if(_c==undefined||_c<0||_c>=this.tabs.length){
return;
}
for(var i in this.tabs){
if(i==_c){
this.current=this.tabs[i];
this.current.focus();
}else{
this.tabs[i].blur();
}
}
};
this.activate=function(_e){
if(!_e||_e==undefined){
return;
}
for(var i in this.tabs){
if(this.tabs[i]==_e){
this.current=this.tabs[i];
this.current.focus();
}else{
this.tabs[i].blur();
}
}
};
this.closeButton.parent=this;
this.closeButton.onmouseout=function(){
this.className="tab_close tab_close_off";
};
this.closeButton.onmouseover=function(){
this.className="tab_close tab_close_on";
};
this.showCloseButton=function(_10){
if(_10){
getElementByClassName(this.dom,"tab_close",true).style.display="block";
}else{
getElementByClassName(this.dom,"tab_close",true).style.display="none";
}
};
this.closeButton.onclick=function(){
id=this.parent.current.dom.id;
for(var i in this.parent.tabs){
if(this.parent.tabs[i].dom.id==id){
index=i;
}
}
if(index!=0){
this.parent.remove(index);
this.parent.activate(this.parent.tab(index-1));
this.parent.tab(index-1).dom.onclick();
}
};
this.scrollRightTab=null;
this.scrollLeftTab=this.insert("",null,null,true);
this.scrollLeftTab.dom.style.display="none";
this.scrollLeftTab.dom.owner=this;
this.scrollLeftTab.dom.className="tab tab_scroll_left";
this.scrollLeftTab.dom.onclick=function(){
if(this.owner.firstDisplayTabIndex>0){
this.owner.newDisplayTabIndex--;
this.owner.refresh();
}
};
this.updateIndex=function(){
for(var _12=0;_12<this.tabs.length;_12++){
this.tabs[_12].index=_12;
}
};
this.refresh=function(){
if(this.firstDisplayTabIndex<0){
this.firstDisplayTabIndex=0;
}
if(this.newDisplayTabIndex<0){
this.newDisplayTabIndex=0;
}
if(this.firstDisplayTabIndex>(this.tabs.length-1)){
this.firstDisplayTabIndex=(this.tabs.length-1);
this.newDisplayTabIndex=(this.tabs.length-1);
}
if(this.scrollRightTab){
this.tabarea.removeChild(this.scrollRightTab.dom);
delete this.scrollRightTab;
}
this.scrollLeftTab.dom.style.display="block";
var _13=this.scrollLeftTab.dom.offsetTop;
if(this.newDisplayTabIndex==0){
this.scrollLeftTab.dom.style.display="none";
}
if(this.tabs.length==0){
return false;
}
var _14=false;
var _15=this;
this.lastDisplayTabIndex=0;
this.firstDisplayTabIndex=this.newDisplayTabIndex;
for(var _16=0;_16<this.tabs.length;_16++){
if((_16<this.firstDisplayTabIndex)||(_14)){
this.tabs[_16].dom.style.display="none";
}else{
this.tabs[_16].dom.style.display="block";
if((this.tabs[_16].dom.offsetTop!=_13)&&(this.tabs.length>1)){
_14=true;
this.tabs[_16].dom.style.display="none";
this.lastDisplayTabIndex=_16-1;
}
}
}
if(this.lastDisplayTabIndex==0){
this.lastDisplayTabIndex=this.tabs.length-1;
}
if(_14){
this.scrollRightTab=this.insert("",null,null,true);
this.scrollRightTab.dom.owner=this;
this.scrollRightTab.dom.className="tab tab_scroll_right";
setStyle(this.scrollRightTab.dom,"float","right");
this.scrollRightTab.dom.onclick=function(){
this.owner.newDisplayTabIndex++;
this.owner.refresh();
};
while(this.scrollRightTab.dom.offsetTop!=_13){
this.tabs[this.lastDisplayTabIndex].dom.style.display="none";
this.lastDisplayTabIndex--;
}
}
if(this.current.index>this.lastDisplayTabIndex){
this.tabs[this.lastDisplayTabIndex].dom.onclick();
}else{
if(this.current.index<this.firstDisplayTabIndex){
this.tabs[this.firstDisplayTabIndex].dom.onclick();
}
}
};
this.first=null;
this.last=null;
this.current=null;
setStyle(this.dom,"display","block");
return this;
}
function Tab_destroy(){
purgeparents(this);
}
function Tab(_17,_18){
var _19=getTemplate("tab");
if(!_19){
return null;
}
this.dom=_19.cloneNode(true);
generateUniqueId(this.dom);
this.dom.parent=this;
this.parent=null;
this.label="";
this.focused=false;
this.onclick=function(){
};
this.page=null;
this.index=_18;
this.l=getElementByClassName(this.dom,"tab_l");
this.m=getElementByClassName(this.dom,"tab_m");
this.r=getElementByClassName(this.dom,"tab_r");
this.destroy=Tab_destroy;
this.focus=function(){
this.l.className="tab_l_a";
this.m.className="tab_m_a";
this.r.className="tab_r_a";
this.focused=true;
if(this.page){
this.page.style.display="block";
}
};
this.blur=function(){
this.l.className="tab_l";
this.m.className="tab_m";
this.r.className="tab_r";
this.focused=false;
if(this.page){
this.page.style.display="none";
}
};
this.hover=function(){
if(!this.focused){
this.l.className="tab_l_h";
this.m.className="tab_m_h";
this.r.className="tab_r_h";
}
};
this.setLabel=function(_1a){
if(_1a!=null&&_1a!=undefined){
this.m.innerHTML=_1a;
this.label=_1a;
}
};
this.getLabel=function(_1b){
return this.label;
};
this.setLabel(_17);
this.dom.onmouseover=function(){
this.parent.hover();
this.parent.userMouseOver();
};
this.userMouseOver=function(){
};
this.userMouseOut=function(){
};
this.dom.onmouseout=function(){
if(this.parent.focused){
this.parent.focus();
}else{
this.parent.blur();
}
this.parent.userMouseOut();
};
this.dom.onclick=function(){
var tab=this.parent;
tab.onclick();
tab.parent.activate(tab);
tab.onswitch();
tab.parent.onswitch(tab.index);
};
this.onswitch=function(){
};
setStyle(this.dom,"display","block");
return this;
}

function dax_fieldEditor(_1,_2){
this.data={selection:getTable(_1),recordId:null,isNew:true,recordNodes:[]};
this.properties={area:_2};
function dax_fieldEditor_blankDevFunction(){
return true;
}
this.onBeforeSave=dax_fieldEditor_blankDevFunction;
this.onAfterSave=dax_fieldEditor_blankDevFunction;
this.onSaveHandler=dax_fieldEditor_blankDevFunction;
function dax_fieldEditor_parseArea(){
var _3=getElementsByClassName(this.properties.area,"4daf_",true);
this.data.recordNodes=[];
for(var _4=0;_4<_3.length;_4++){
var _5=_3[_4].className;
var _6=_5.split(" ");
var _7=findInArray(_6,"4daf_",0,false,true);
var _8=ReplaceString(_6[_7],"."," ");
var _9=getField(_8.slice(5));
if(_9){
var _9={node:_3[_4],field:_9};
if((_9.field.fieldchoicelist)&&(_9.node.nodeName.toLowerCase()=="select")){
dax_bridge.getChoiceList(_9.field.fieldchoicelist,this.choiceListHandler,_9.node);
}
if((_9.node.nodeName.toLowerCase()=="input")&&(_9.node.type.toLowerCase()=="radio")){
_9.node.name=_8.slice(5);
}
this.data.recordNodes.push(_9);
}
}
}
this.parseArea=dax_fieldEditor_parseArea;
function dax_fieldEditor_choiceListHandler(_a,_b){
if(_a.readyState!=4){
return;
}
var _c=checkResponse(_a);
if(_c){
return false;
}
var _d=_a.responseXML.getElementsByTagName("list").item(0);
var _e=_d?_d.getElementsByTagName("listitem"):null;
_b.options.length=0;
for(var _f=0;_f<_e.length;_f++){
var _10=(_e.item(_f).firstChild)?(_e.item(_f).firstChild.nodeValue):null;
if(_10){
_b.options[_f]=new Option(_10,_10);
}
}
}
this.choiceListHandler=dax_fieldEditor_choiceListHandler;
function dax_fieldEditor_getRecordById(_11){
var url=dax_bridge.url+"GetRecord?sessionid="+dax_bridge.sessionId+"&tableid="+this.data.selection.tableid+"&recordid="+_11;
makeCall(url,this.getRecordHandler,this);
}
this.getRecordById=dax_fieldEditor_getRecordById;
function dax_fieldEditor_getRecordHandler(_13,_14){
if(_13.readyState!=4){
return;
}
var _15=_13.responseXML.getElementsByTagName("queryResult").item(0);
if(!_15){
return;
}
var _16=_15.getElementsByTagName("row");
for(i=0;i<_16.length;i++){
var _17=[];
var _18=_16[i].getElementsByTagName("field");
for(j=0;j<_18.length;j++){
var _19=(_18[j].childNodes.length>0)?(_18[j].firstChild.nodeValue):("");
var _1a={id:_18[j].getAttribute("id"),value:_19,originalValue:(_18[j].childNodes.length>0)?(_18[j].firstChild.nodeValue):(""),fieldrecordid:_18[j].getAttribute("fieldrecordid"),height:_18[j].getAttribute("height"),width:_18[j].getAttribute("width")};
_17.push(_1a);
}
}
_14.data.recordId=_16[0].getAttribute("recordid");
_14.data.isNew=false;
if(_17){
if(_17.length>0){
for(var _1b=0;_1b<_17.length;_1b++){
if(_14.data.recordNodes[_17[_1b].id]){
var _1c=_14.data.recordNodes[_17[_1b].id].node;
if(_1c.nodeName.toLowerCase()=="img"){
_1c.src=_17[_1b].value;
}else{
if((_1c.nodeName.toLowerCase()=="input")&&(_1c.type=="checkbox")){
_1c.checked=(_17[_1b].value=="true")?true:false;
}else{
if(_1c.nodeName.toLowerCase()=="input"){
_1c.value=_17[_1b].value;
}else{
if(_1c.nodeName.toLowerCase()=="div"){
_1c.innerHTML=_17[_1b].value;
}else{
if(_1c.nodeName.toLowerCase()=="span"){
_1c.innerHTML=_17[_1b].value;
}else{
if(_1c.nodeName.toLowerCase()=="textarea"){
_1c.innerHTML=_17[_1b].value;
}
}
}
}
}
}
}
}
}
}
}
this.getRecordHandler=dax_fieldEditor_getRecordHandler;
this.parseArea();
function dax_fieldEditor_saveRecord(){
if(this.data.isNew){
var url=dax_bridge.url+"addRecord?sessionid="+connection.sessionId+"&tableid="+this.data.selection.tableid;
}else{
var url=dax_bridge.url+"modifyRecord?sessionid="+connection.sessionId+"&tableid="+this.data.selection.tableid+"&recordid="+this.data.recordId;
}
for(var _1e=0;_1e<this.data.recordNodes.length;_1e++){
var _1f=this.data.recordNodes[_1e].field.fieldid;
var _20=this.data.recordNodes[_1e].node;
var _21=false;
if((_20.nodeName.toLowerCase()=="input")&&(_20.type=="checkbox")){
objectValue=_20.checked;
}else{
if((_20.nodeName.toLowerCase()=="input")&&(_20.type=="radio")&&(_20.checked==true)){
objectValue=_20.value;
}else{
if((_20.nodeName.toLowerCase()=="input")&&(_20.type=="radio")&&(_20.checked==false)){
_21=true;
}else{
if(_20.nodeName.toLowerCase()=="input"){
objectValue=_20.value;
}else{
if(_20.nodeName.toLowerCase()=="textarea"){
objectValue=_20.value;
}else{
if(_20.nodeName.toLowerCase()=="select"){
objectValue=_20.options[_20.selectedIndex].value;
}else{
_21=true;
}
}
}
}
}
}
if(!_21){
url+="&field"+_1f+"="+objectValue;
}
}
makeCall(url);
}
this.saveRecord=dax_fieldEditor_saveRecord;
function dax_fieldEditor_newRecord(){
this.data.recordId=null;
this.data.isNew=true;
}
this.newRecord=dax_fieldEditor_newRecord;
}

var dax_event_onload=1;
var dax_event_ondatachange=20;
function Editor(){
var _1=getTemplate("editor");
if(!_1){
return;
}
this.prv={mDOM:_1.cloneNode(true),mTearAway:new TearAway(),mColumns:new Array(),mInputs:new Array(),mModified:false,mAutoReload:60,mTimeoutId:null};
Function.decl.apply(this);
probe(this.prv.mDOM);
this.prv.mDOM.parent=this;
generateUniqueId(this.prv.mDOM);
this.toString=function(){
return "[object Editor]";
};
this.abortSave=false;
this.clickFlag=false;
this.hasImages=false;
this.getDOM=function(){
return this.prv.mTearAway.getDOM();
};
this.getColumnDOM=function(){
if(this.prv.mColumns.length<=0){
return this.prv.mDOM.column;
}else{
return this.prv.mDOM.column.cloneNode(true);
}
};
this.refresh=function(){
var _2=this.prv.mDOM.style;
var _3=_2.visibility;
_2.visibility="hidden";
_2.overflow="hidden";
var _4=Math.floor(this.prv.mDOM.clientWidth/this.prv.mColumns.length)-10;
for(var j=0;j<this.prv.mInputs.length;j++){
var _6=this.prv.mInputs[j].prv.mDOM;
if(browser.safari){
setStyle(_6,"width","100%");
}else{
setStyle(_6,"width",_4+"px");
}
}
for(var i=0;i<this.prv.mColumns.length;i++){
var _6=this.prv.mColumns[i].prv.mDOM;
if(browser.safari){
setStyle(_6,"width","100%");
}else{
setStyle(_6,"width",_4+"px");
}
}
_2.overflow="hidden";
_2.visibility=_3;
this.onafterrefresh();
};
this.onafterrefresh=function(){
};
this.size=function(_8,_9){
var _9=isDefined(_9)?_9:2;
var _a=_9-this.prv.mColumns.length;
if(_a<0){
for(var i=0;i<Math.abs(_a);i++){
var _c=this.prv.mColumns.pop();
this.prv.mDOM.removeChild(_c.prv.mDOM);
delete _c;
}
}else{
for(var i=0;i<_a;i++){
var _c=new EditorColumn(this);
this.prv.mColumns.push(_c);
this.prv.mDOM.insertBefore(_c.prv.mDOM,null);
}
}
var _d=0;
var _e=_9;
var _f=0;
if(_8==_9){
_d=1;
}else{
if(_9<_8){
_d=Math.floor(_8/_9);
_f=_8%_9;
}else{
if(_9>_8){
_d=1;
_e=_8;
}
}
}
for(var j=0;j<_e;j++){
this.prv.mColumns[j].size(_f>0?_d+1:_d);
_f--;
}
this.prv.mInputs=new Array();
for(var k=0;k<this.prv.mColumns.length;k++){
var _12=this.prv.mColumns[k].getInputs();
for(var l=0;l<_12.length;l++){
this.prv.mInputs.push(_12[l]);
}
}
this.refresh();
};
this.assign=function(_14){
var _15=this.prv.mInputs.length<_14?this.prv.mInputs.length:_14.length;
for(var i=0;i<_15;i++){
if(!_14[i].skipfield){
this.prv.mInputs[i].prv.mFieldID=_14[i].fieldid;
this.prv.mInputs[i].setLabel(_14[i].label);
this.prv.mInputs[i].setValue(_14[i].value,_14[i].type,_14[i].picWidth,_14[i].picHeight,_14[i].format,_14[i].ddw,_14[i].ddwtype,_14[i].ddwtitle,_14[i].fieldtype);
if((_14[i].nonmodifiable!=undefined)||(this.recordLocked)){
if((_14[i].nonmodifiable=="True")||(this.recordLocked)){
if(this.prv.mInputs[i].choicelist){
this.prv.mInputs[i].prv.mDOM.value.disabled=true;
this.prv.mInputs[i].prv.mDOM.value.disableChoiceList=true;
}else{
if(_14[i].type==4){
this.prv.mInputs[i].picker.value.disabled=true;
this.prv.mInputs[i].picker.isDisabled=true;
}else{
if(this.prv.mInputs[i].field.fieldtype=="boolean"){
this.prv.mInputs[i].isDisabled=true;
}else{
this.prv.mInputs[i].prv.mDOM.value.disabled=true;
}
}
}
}else{
if(this.prv.mInputs[i].choicelist){
this.prv.mInputs[i].prv.mDOM.value.disabled=false;
this.prv.mInputs[i].prv.mDOM.value.disableChoiceList=false;
}else{
if(_14[i].type==4){
this.prv.mInputs[i].picker.value.disabled=false;
this.prv.mInputs[i].picker.isDisabled=false;
}else{
if(this.prv.mInputs[i].field.fieldtype=="boolean"){
this.prv.mInputs[i].isDisabled=false;
}else{
this.prv.mInputs[i].prv.mDOM.value.disabled=false;
}
}
}
}
}else{
if(this.prv.mInputs[i].choicelist){
this.prv.mInputs[i].prv.mDOM.value.disabled=false;
this.prv.mInputs[i].prv.mDOM.value.disableChoiceList=false;
}else{
if(_14[i].type==4){
this.prv.mInputs[i].picker.value.disabled=false;
this.prv.mInputs[i].picker.isDisabled=false;
}else{
if(this.prv.mInputs[i].field.fieldtype=="boolean"){
this.prv.mInputs[i].isDisabled=false;
}else{
this.prv.mInputs[i].prv.mDOM.value.disabled=false;
}
}
}
}
this.prv.mInputs[i].prv.mFieldRecordID=_14[i].fieldrecordid;
}
}
};
this.redraw=function(){
this.addSelectionHeader();
setStyle(this.prv.mDOM.bottom.buttons,"display","block");
var ta=this.getTearAway();
ta.size(ta.prv.mDOM.offsetWidth,ta.prv.mDOM.offsetHeight);
var _18=getElementByClassName(this.prv.mDOM,"deletebtn");
_18.innerHTML=STR["button_delete"];
var _19=ta.getDOM();
_19.top.style.width="600px";
_19.middle.style.width="600px";
_19.bottom.style.width="600px";
_19.middle.ml.style.height=_19.middle.m.offsetHeight+"px";
_19.middle.mr.style.height=_19.middle.m.offsetHeight+"px";
_19.style.height=_19.top.offsetHeight+_19.middle.offsetHeight+_19.bottom.offsetHeight+"px";
if(browser.safari3){
if(_19.style.zIndex<9000){
setStyle(_19,"zIndex",++WindowManager.maxZIndex);
}else{
setStyle(_19,"zIndex",++WindowManager.maxZDashIndex);
}
}
};
this.callSelectionHeaderData=function(_1a){
var _1b=this.record.tableId;
var _1c=getXMLHttpRequest();
if(_1c){
var ref=this;
_1c.onreadystatechange=function(){
ref.onparentpull(_1c);
};
try{
var url=dax_bridge.url+"getParentRecord?tableid="+_1b+"&recordid="+_1a+"&sessionId="+dax_bridge.sessionId;
debugAlert("<b>Editor (.parentPull):</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_1c.open("GET",url,true);
_1c.send(null);
}
catch(e){
if(browser.ie6){
_1c.onreadystatechange=function(){
};
}else{
_1c.onreadystatechange=null;
}
delete _1c;
}
}
};
this.addSelectionHeader=function(){
var _1f=getTable(this.record.tableId);
if((this.record.recordId!=-1)||(_1f.selectionviewid==0)||((this.owner.boundTo)&&(this.owner.boundTo.spacer))){
if(this.topContents){
this.topContents.style.display="none";
}
return;
}else{
if(this.topContents){
this.topContents.style.display="block";
return;
}
}
var _20=getTable(_1f.selectionviewid);
var _21=getTemplate("selectionvieweditor");
if(!_21){
return;
}
this.topContents=_21.cloneNode(true);
this.topContents.parent=this;
this.prv.mDOM.top.appendChild(this.topContents);
this.topContents.style.display="block";
probe(this.topContents);
this.topContents.selButton.owner=this;
this.topContents.selButton.value=STR["button_choose"]+" "+_20.tablealias;
this.topContents.selHelp.onmousemove=function(_22){
_22=xpEvent(_22);
mousePos=getMousePosition(_22);
showTooltip(STR["editor_selectionview"],mousePos.x,mousePos.y);
};
this.topContents.selHelp.onmouseout=function(){
hideTooltip();
};
this.topContents.selHelp.style.display="none";
this.topContents.selButton.onclick=function(){
if(!WindowManager.modalWindow){
WindowManager.modalWindow=new modalWindow();
var _23=true;
}
this.owner.prv.mDOM.saveBtn.disabled=false;
objectPos=getObjectPosition(this);
WindowManager.modalWindow.show();
WindowManager.modalWindow.setSize(400,300);
WindowManager.modalWindow.position(objectPos.x-200,objectPos.y);
this.owner.dataWindow=new DataWindow(_20.tablename,WindowManager.modalWindow.contents,null,null,null);
this.owner.dataWindow.customize(false,false,false,false);
this.owner.dataWindow.contentArea.style.overflow="hidden";
if(browser.safari){
this.owner.dataWindow.contentArea.style.width="400px";
this.owner.dataWindow.contentArea.style.height="300px";
this.owner.dataWindow.contentArea.grid.refresh();
this.owner.dataWindow.activate=function(){
return false;
};
}
this.owner.dataWindow.grid.grid.boundToEditor=this.owner;
this.owner.dataWindow.grid.grid.onrowselect=function(_24){
if(_24.prv.mElements[0].prv.mDOM.innerHTML!=""){
this.boundToEditor.parentRecordId=_24.recordId;
WindowManager.modalWindow.hide();
WindowManager.destroyWindow(this.boundToEditor.dataWindow);
this.boundToEditor.callSelectionHeaderData(_24.recordId);
}
};
WindowManager.modalWindow.blackout.boundToEditor=this.owner;
WindowManager.modalWindow.blackout.onclick=function(){
WindowManager.modalWindow.hide();
WindowManager.destroyWindow(this.boundToEditor.dataWindow);
};
this.owner.dataWindow.grid.grid.onrowdblclick=function(_25){
};
this.owner.dataWindow.dom.style.zIndex=++WindowManager.maxZIndex+25;
};
return false;
};
this.pull=function(_26,_27){
var _28=getXMLHttpRequest();
if(_28){
var ref=this;
_28.onreadystatechange=function(){
ref.onpull(_28);
};
try{
var url=connection.command(DB.GET_RECORD)+"&tableid="+_26+"&recordid="+_27;
debugAlert("<b>Editor (.pull):</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_28.open("GET",url,true);
_28.send(null);
}
catch(e){
delete _28;
}
}
};
this.onparentpull=function(_2b){
this.onpull(_2b,true);
};
this.onpull=function(_2c,_2d){
if(_2c.readyState!=4){
return;
}
var _2e=_2c.responseXML.getElementsByTagName("queryResult").item(0);
var _2f=checkResponse(_2c);
if((_2f)||(!_2e)){
return;
}
if(!_2d){
_2d=false;
}
var _30=_2e.getAttribute(STR["tableid"]);
var _31=structure.getTable(_30);
if(callback_onEditorPull){
_2c=callback_onEditorPull(_31.tablename,_2c);
}
var row=_2e.getElementsByTagName(STR["rowtag"]).item(0);
if(!row){
return;
}
this.isBackendLocked=row.getAttribute("locked");
var _33=row.getElementsByTagName(STR["fieldtag"]);
if(!_33){
return;
}
if(!_2d){
if((this.record)&&(this.isBackendLocked!="True")){
if(!Controller.isLocked(this.record.tableId,this.record.recordId)){
Controller.unlockRecord(this.record.tableId,this.record.recordId);
}
}
this.record={recordId:row.getAttribute(STR["recordid"]),tableId:_30,map:new Array()};
}
if(!_31.fields){
buildFieldList(_30);
}
var _34=[];
for(var _35=0;_35<_31.fields.length;_35++){
var _36=getField(_31.tableid,_31.fields[_35].fieldid);
if(_36.fieldindetail.toLowerCase()=="true"){
_34.push(_36);
}
}
this.size(_34.length,1);
var _37=new Array();
var _38=new Array();
if(_2d){
for(i=0;i<_33.length;i++){
_38.push(_33[i].getAttribute("id"));
}
}
for(var i=0;i<_34.length;i++){
if((_38.length==0)||(findInArray(_38,_34[i].fieldid)!=-1)){
this.record.map[_34[i].fieldid]=i;
_37[i]={label:_34[i].fieldalias,value:"",type:this.convertType(_34[i].fieldtype),fieldrecordid:_33[i]?_33[i].getAttribute("fieldrecordid"):null,fieldid:_34[i].fieldid,ddw:_33[i]?_33[i].getAttribute("ddw"):null,ddwtype:_33[i]?_33[i].getAttribute("ddwtype"):null,ddwtitle:_33[i]?_33[i].getAttribute("ddwtitle"):null,skipfield:false,fieldtype:_34[i].fieldtype};
}else{
_37[i]={skipfield:true};
}
}
var _3a=getTable(_30);
dax_bridge.cacheFields(_3a);
for(var i=0;i<_33.length;i++){
var _3b=this.record.map[_33[i].getAttribute(STR["fieldid"])];
if((_37[_3b])&&(!_37[_3b].skipfield)){
var _3c=getField(_30,_33[i].getAttribute("id"));
if(_3c.fieldtype=="picture"){
var _3d=_33[i].getAttribute("width");
var _3e=_33[i].getAttribute("height");
}else{
var _3d=null;
var _3e=null;
}
elValue=n2String(_33[i]);
if(_3c.fieldformat){
var _3f=_3c.fieldformat;
}else{
if(_3c.fieldtype=="date"){
var _3f="d1";
}else{
var _3f=_3c.fieldformat;
}
}
var _40=_3f.split(",");
switch(_3f.substr(0,1)){
case "x":
case "a":
break;
case "r":
if(_40[2]=="cm"){
if(elValue.lastIndexOf(".")!=-1){
elValue=elValue.replace(elValue.substr(elValue.lastIndexOf("."),1),",");
}
}
break;
case "d":
}
if((_3f)&&(_37[_3b].type!=4)){
elValue=format(_3f,elValue);
}
_37[_3b].format=_3f;
_37[_3b].value=elValue;
_37[_3b].picWidth=_3d;
_37[_3b].picHeight=_3e;
_37[_3b].nonmodifiable="False";
if(_3c.fieldnonModifiable!=undefined){
if(_3c.fieldnonModifiable=="True"){
_37[_3b].nonmodifiable="True";
}
}
if(_3c.fieldnonEnterable!=undefined){
if(_3c.fieldnonEnterable=="True"){
_37[_3b].nonmodifiable="True";
}
}
if(_3c.fieldcallbackonload!=undefined){
if(_3c.fieldcallbackonload){
var _41=_33[_3b].getAttribute("fieldrecordid");
if(_41=="-1"){
_41="-3";
}
ExecuteCallBack(this,dax_event_onload,_30,_3c.fieldid+"["+_41+"]",elValue,_3b,_37[_3b]);
}
}
}
}
if(!_2d){
if((this.isBackendLocked=="True")||(Controller.isLocked(this.record.tableId,this.record.recordId))){
this.lock();
}else{
Controller.lockRecord(this.record.tableId,this.record.recordId);
}
}
this.assign(_37);
this.redraw();
if(!_2d){
this.onAfterPull();
var _42=this;
var _43=_42.prv.mAutoReload;
if(_43>0){
this.prv.mTimeoutId=setTimeout(function(){
_42.reload();
},_43*3000);
}
}
};
this.onAfterPull=function(){
};
this.buildEditorByTable=function(_44){
if(!isDefined(this.record)){
this.record={map:new Array()};
}else{
if(!isDefined(this.record.map)){
this.record.map=new Array();
}
}
var _45=structure.getTable(_44);
if(!_45.fields){
buildFieldList(_45.tableid);
}
var _46=[];
for(var _47=0;_47<_45.fields.length;_47++){
var _48=getField(_45.tableid,_45.fields[_47].fieldid);
if(_48.fieldindetail.toLowerCase()=="true"){
_46.push(_48);
}
}
this.size(_46.length,1);
dax_bridge.cacheFields(_44);
this.parentRecordId=null;
this.parentRecordIdBuffer=null;
var _49=new Array();
for(var i=0;i<_46.length;i++){
var _4b=this.convertType(_46[i].fieldtype);
var _4c=_46[i].fieldtype;
this.record.map[_46[i].fieldid]=i;
_49[i]={label:_46[i].fieldalias,value:"",type:_4b,fieldid:_46[i].fieldid,fieldrecordid:"-1",format:_46[i].fieldformat,nonmodifiable:_46[i].fieldnonEnterable,fieldtype:_4c};
var _4d=getField(_44,_46[i].fieldid);
if(_4d.fieldcallbackonload!=undefined){
if(_4d.fieldcallbackonload){
ExecuteCallBack(this,dax_event_onload,_44,_46[i].fieldid+"[-3]","",i,_49[i]);
}
}
}
this.assign(_49);
this.redraw();
this.onAfterBuild();
};
this.onAfterBuild=function(){
};
this.convertType=function(_4e){
switch(_4e){
case STR["type_alpha"]:
return 0;
case STR["type_date"]:
return 4;
case STR["type_text"]:
return 3;
case STR["type_picture"]:
return 2;
case STR["type_real"]:
case STR["type_integer"]:
case STR["type_longint"]:
return 1;
default:
return 0;
}
};
this.prv.mDOM.onclick=function(_4f){
};
this.onkeydown=function(_50){
};
this.validateError=function(_51){
var _52=_51.getType();
var _53=this.prv.mDOM.status;
switch(_52){
case 1:
_53.innerHTML=STR["status_err_number"];
_51.prv.mDOM.value.focus();
_51.prv.mDOM.value.select();
break;
default:
_53.innerHTML=STR["status_err_default"];
_51.prv.mDOM.value.focus();
_51.prv.mDOM.value.select();
break;
}
};
this.deleteR=function(){
var _54=getXMLHttpRequest();
if(_54){
var ref=this;
_54.onreadystatechange=function(){
ref.ondelete(_54);
};
if(isDefined(this.record)){
if(this.record.recordId==-1){
alert(STR["record_not_in_database"]);
return false;
}else{
var rv=confirm(STR["confirm_delete_records"]);
if(!rv){
return;
}
}
}
var _57=this.record.tableId;
var _58=this.record.recordId;
try{
var _59=_58!=-1?connection.command(DB.DELETE_RECORD):connection.command(DB.DELETE_RECORD);
var url=_59+"&tableid="+_57+"&recordid="+_58;
_54.open("GET",url,true);
_54.send(null);
}
catch(e){
if(browser.ie6){
_54.onreadystatechange=function(){
};
}else{
_54.onreadystatechange=null;
}
delete _54;
}
}
};
this.ondelete=function(_5b){
if(_5b.readyState!=4){
return;
}
var _5c=_5b.responseXML.getElementsByTagName("recordErased").item(0);
var _5d=checkResponse(_5b);
if(!isDefined(_5c)){
this.prv.mDOM.status.innerHTML=_5b.responseText;
if(browser.ie6){
_5b.onreadystatechange=function(){
};
}else{
_5b.onreadystatechange=null;
}
delete _5b;
var _5e=getElementByClassName(this.getDOM(),"cancelbtn");
return;
}
var _5f=_5c.getAttribute(STR["modify_success"])==STR["success_true"];
var dom=this.prv.mDOM;
var _5e=getElementByClassName(this.getDOM(),"cancelbtn");
if(_5c){
if(this.owner){
if(this.owner.contentArea){
if(this.owner.contentArea.grid){
this.owner.contentArea.grid.reload();
}
}
}
this.onafterdelete();
}else{
dom.status.innerHTML=STR["status_err_delete"];
}
this.setModified(false);
if(browser.ie6){
_5b.onreadystatechange=function(){
};
}else{
_5b.onreadystatechange=null;
}
delete _5b;
};
this.onafterdelete=function(){
this.getTearAway().contract(1,50);
this.destroy();
};
this.save=function(){
if(this.abortSave){
this.prv.mDOM.saveBtn.disabled=true;
this.abortSave=false;
return;
}
if(isDefined(this.record)){
var _61=getXMLHttpRequest();
if(_61){
var ref=this;
_61.onreadystatechange=function(){
ref.onsave(_61);
};
var dom=this.prv.mDOM;
var _64=this.record.tableId;
var _65=this.record.recordId;
try{
var url=_65!=-1?connection.address.modifyrecord:connection.address.addrecord;
var _67="sessionid="+connection.sessionId+"&tableid="+_64+"&recordid="+_65;
this.record.uploads=new Array();
var a="Field(s) required(s)\n";
var _69="";
var _6a=0;
var _6b=new Object();
_6b.fieldId=new Array();
_6b.fieldName=new Array();
_6b.value=new Array();
for(var i in this.record.map){
var _6d=this.record.map[i];
var _6e=this.prv.mInputs[_6d];
var _6f=this.prv.mInputs[_6d].prv.mDOM.value;
var _70=getField(this.record.tableId,i);
if(_70.fieldmandatory=="True"){
if(_6e.getValue().length<1){
setStyle(_6f,"border","solid 1px red");
_6a=1;
}
}
if(_6e.getModified()){
if(_6e.getType()==2){
this.record.uploads.push(i);
}else{
var _71="";
var _72=_70.fieldformat.split(",");
switch(_70.fieldformat.substr(0,1)){
case "t":
if(_70.fieldformat=="tMM:SS"){
_71="00:"+_6e.getValue();
}else{
_71=_6e.getValue();
}
break;
case "i":
case "l":
case "r":
if(_72[2]=="cm"&&_6e.getValue().lastIndexOf(",")!=-1){
if(_72[1]=="per"){
_71=_6e.getValue();
while(_71.indexOf(".")!=-1){
_71=_71.replace(".","");
}
}
_71=_71.replace(_71.substr(_71.lastIndexOf(","),1),".");
}else{
if(_72[2]=="per"&&_6e.getValue().lastIndexOf(".")!=-1){
_71=_6e.getValue();
if(_71.indexOf(" %")!=-1){
_71=_71.substr(0,_71.indexOf(" %"));
}
while(_71.indexOf(",")!=-1){
_71=_71.replace(",","");
}
}else{
_71=_6e.getValue();
}
}
break;
case "b":
_71=_6e.getValue();
break;
case "d":
_71=_6e.getOriginalValue();
break;
default:
_71=dax_bridge.encode(_6e.getValue());
}
}
_6b.value.push(_71);
_6b.fieldName.push(getField(_64,i).fieldname);
if(!_6e.prv.mFieldRecordID){
_6b.fieldId.push(i);
}else{
_6b.fieldId.push(i+"["+_6e.prv.mFieldRecordID+"]");
}
}
}
_6b=callback_beforeRecordSave(getTable(_64).tablename,_65,_6b);
for(m=0;m<_6b.fieldId.length;m++){
_67+="&field"+_6b.fieldId[m]+"="+_6b.value[m];
}
delete _6b;
if(this.parentRecordId){
_67+="&parent="+this.parentRecordId;
}
if(_6a==1){
dom.status.innerHTML=STR["status_err_required"];
}else{
debugAlert("<b>Editor (.save)</b>:"+url+_67);
_61.open("POST",url,true);
_61.send(_67);
}
}
catch(e){
alert(e);
if(browser.ie6){
_61.onreadystatechange=function(){
};
}else{
_61.onreadystatechange=null;
}
delete _61;
}
}
}
};
this.checkupload=function(_73,_74,_75){
if(!browser.ie){
var _76=_73.contentDocument;
}else{
if(document.frames["upload_"+_74]){
var _76=document.frames["upload_"+_74].document;
}
}
if(_76){
if(_76.forms){
var _77=_76.forms[0];
}
}
if(_77){
if((_77.id=="binaryupload")&(_77.sessionid.value=="")){
this.uploading=false;
if(_75){
var _78=this;
setTimeout(function(){
_78.pull(_78.record.tableId,_78.record.recordId);
},500);
setTimeout(function(){
_78.reload();
},500);
this.onaftersave();
}
}else{
var _79=this;
setTimeout(function(){
_79.checkupload(_73,_74,_75);
},500);
}
}else{
var _79=this;
setTimeout(function(){
_79.checkupload(_73,_74,_75);
},500);
}
};
this.uploadPic=function(_7a,_7b,_7c,_7d){
if(!this.uploading){
this.uploading=true;
_7a.submit();
var _7e=this;
setTimeout(function(){
_7e.checkupload(_7b,_7c,_7d);
},500);
}else{
var _7e=this;
setTimeout(function(){
_7e.uploadPic(_7a,_7b,_7c,_7d);
},500);
}
};
this.onsave=function(_7f){
var dom=this.prv.mDOM;
var _81=getElementByClassName(this.getDOM(),"cancelbtn");
if(_7f.readyState!=4){
return;
}
var _82=checkResponse(_7f);
var _83="";
var _84=_7f.responseXML.getElementsByTagName("errordetail");
var _85=false;
if(_84){
if(_84.length>0){
for(i=0;i<_84.length;i++){
for(var j in this.record.map){
var _87=this.record.map[j];
var _88=_84[i].getAttribute("value");
if(j==_88){
var _89=this.prv.mInputs[_87].prv.mDOM.value;
setStyle(_89,"border","solid 1px red");
dom.status.innerHTML=STR["status_err_dup"];
return false;
}
}
}
}
}
var _8a=getElementByClassName(this.getDOM(),"savebtn");
var _8b=_7f.responseXML.getElementsByTagName("addedRecord").item(0);
if((!_89)&&(!_8b)){
_8b=_7f.responseText;
dom.status.innerHTML=_8b;
return false;
}
var _8c=_8b.getAttribute(STR["modify_success"])==STR["success_true"];
if(_8c){
dom.status.innerHTML=STR["status_save_success"];
if((this.record)&&(this.isBackendLocked!="True")){
Controller.unlockRecord(this.record.tableId,this.record.recordId);
}
_81.innerHTML=STR["button_close"];
_8a.disabled=true;
var _8d=n2String(_8b.getElementsByTagName(STR["recordidtag"]).item(0));
if(this.record){
if(this.record.recordId==-1){
this.record.recordId=_8d;
}
}
if(!this.hasImages){
this.pull(this.record.tableId,this.record.recordId);
}
if(callback_afterRecordSaveSuccess){
callback_afterRecordSaveSuccess(getTable(this.record.tableId).tablename,_8d);
}
var _8e=_8b.getElementsByTagName("binaryfield");
for(var j=1;j<=_8e.length;j++){
var _87=this.record.map[_8e.item(j-1).getAttribute("fieldid")];
if(_87){
var _8f=this.prv.mInputs[_87];
_8f.prv.mFieldRecordID=_8e.item(j-1).lastChild.nodeValue;
}
}
if(this.record.uploads){
if(this.record.uploads.length==0){
this.onaftersave();
}else{
while(this.record.uploads.length>0){
var _90=this.record.uploads.pop();
var _87=this.record.map[_90];
var _8f=this.prv.mInputs[_87];
var _91=_8f.getType();
if(_91==2){
if(!browser.ie){
var _92=_8f.an_iframe;
var _93=_8f.an_iframe.contentDocument.forms[0];
var _94=_8f.an_iframe.contentDocument.getElementById("spinner");
}else{
var _92=document.frames["upload_"+_90];
var _93=document.frames["upload_"+_90].document.forms[0];
var _94=document.frames["upload_"+_90].document.getElementById("spinner");
}
if(_93){
_93.sessionid.value=connection.sessionId;
_93.tableid.value=this.record.tableId;
_93.fieldid.value=_90+"["+_8f.prv.mFieldRecordID+"]";
_93.recordid.value=this.record.recordId;
_94.style.display="block";
this.uploadPic(_93,_92,_90,this.record.uploads.length==0);
}else{
alert("Sorry error: upload_"+_90);
}
}
}
}
}else{
this.onaftersave();
}
}else{
dom.status.innerHTML=STR["status_save_fail"];
_81.innerHTML=STR["button_cancel"];
}
this.setModified(false);
if(browser.ie6){
_7f.onreadystatechange=function(){
};
}else{
_7f.onreadystatechange=null;
}
delete _7f;
};
this.onaftersave=function(){
};
this.upload=function(){
debugAlert("Upload function");
if(!this.record||!this.record.uploads||this.record.uploads.length<=0){
return;
}
var _95=this.record.uploads.pop();
var _96=this.record.map[_95];
var _97=this.prv.mInputs[_96];
var _98=_97.getType();
if(_98==2){
var _99=_97.prv.mDOM.value.browse.value;
var _9a=frames["upload"].document;
var _9b=_9a.getElementById("binaryupload");
var _9c=_9a.getElementById("state");
_9c.className="inuse";
_9c.innerHTML="inuse";
var _9d=_97.prv.mDOM.value.browse.cloneNode(true);
_9d.name="DAX_BinaryFile";
var _9e=_9a.createElement("input");
_9e=_9d;
alert(_9a.importNode);
_9b.sessionid.value=connection.sessionId;
_9b.tableid.value=this.record.tableId;
_9b.fieldid.value=_95+"["+_97.prv.mFieldRecordID+"]";
_9b.recordid.value=this.record.recordId;
alert(_9e.ownerDocument);
_9b.appendChild(_9e);
debugAlert("before submit");
_9b.submit();
debugAlert("waiting for the file to be uploaded...");
}
debugAlert("after and before inqueue");
Controller.uploading=false;
if(this.record.uploads.length>0){
Controller.enqueue(this);
}else{
var _9f=this;
debugAlert("reload 962");
setTimeout(function(){
_9f.pull(_9f.record.tableId,_9b.recordid.value);
},500);
setTimeout(function(){
_9f.onaftersave();
},500);
setTimeout(function(){
_9f.reload();
},500);
}
};
this.clear=function(){
for(var i=0;i<this.prv.mInputs.length;i++){
this.prv.mInputs[i].clear();
}
this.prv.mDOM.status.innerHTML="";
};
this.edit=function(){
this.clear();
this.recordLocked=false;
this.getTearAway().expand();
this.setModified(false);
this.prv.mDOM.status.innerHTML="";
var _a1=getElementByClassName(this.getDOM(),"cancelbtn");
_a1.innerHTML=STR["button_cancel"];
this.prv.mDOM.deleteBtn.disabled=false;
this.onAfterEditCall();
};
this.onAfterEditCall=function(){
};
this.lock=function(){
this.recordLocked=true;
this.prv.mDOM.status.innerHTML=STR["status_locked"];
this.prv.mDOM.deleteBtn.disabled=true;
};
this.setModified=function(_a2){
if(_a2==this.prv.mModified){
return;
}
this.prv.mModified=_a2;
if(_a2){
if((this.topContents)&&(this.record.tableId<0)&&(this.record.recordId.toString()=="-1")&&(!this.parentRecordId)){
this.prv.mDOM.saveBtn.disabled=true;
}else{
this.prv.mDOM.saveBtn.disabled=false;
}
}else{
this.prv.mDOM.saveBtn.disabled=true;
for(var i=0;i<this.prv.mInputs.length;i++){
this.prv.mInputs[i].setModified(false);
}
}
};
this.reload=function(){
if(this.prv.mTimeoutId){
clearTimeout(this.prv.mTimeoutId);
}
if(!this.prv.mModified&&this.record&&this.record.recordId>=0&&this.record.tableId>=0){
this.pull(this.record.tableId,this.record.recordId);
}
var _a4=this;
var _a5=_a4.prv.mAutoReload;
if(_a5>0){
this.prv.mTimeoutId=setTimeout(function(){
_a4.reload();
},_a5*3000);
}
};
this.destroy=function(){
if(this.prv.mTimeoutId){
clearTimeout(this.prv.mTimeoutId);
}
if((this.tbitem)&&(this.tbitem.remove)){
this.tbitem.remove();
}
if(this.record){
if((this.isBackendLocked!="True")&&(!this.recordLocked)){
Controller.unlockRecord(this.record.tableId,this.record.recordId);
if((this.record.tableId)&&(this.record.recordId)&&(dax_bridge.sessionId)){
var url=dax_bridge.url+"UnlockRecord?sessionId="+dax_bridge.sessionId+"&tableId="+this.record.tableId+"&recordId="+this.record.recordId;
makeCall(url,null,null,null);
}
}
}
};
this.prv.mColumns.push(new EditorColumn(this));
this.prv.mInputs.push(this.prv.mColumns[0].input(0));
setStyle(this.prv.mDOM,"display","block");
var b=getTemplate("recordinputbottom","dax");
generateUniqueId(b);
probe(b);
for(property in b){
if(isDefined(b[property])&&b[property].nodeType==1){
b[property].parent=this;
}
}
b.deletebtn.innerHTML=STR["button_delete"];
b.cancelbtn.innerHTML=STR["button_cancel"];
b.savebtn.innerHTML=STR["button_save"];
this.ddwButton1=b.ddwbtn1;
this.ddwButton1.owner=this;
this.ddwButton1.onclick=function(){
var _a8=this.owner.record.recordId;
var _a9=this.owner.record.tableId;
if(_a8==-1){
_a8=-3;
}
if(this.ddwType.indexOf("Static")!=-1){
new DDW(this.url,"static_url",this.title,"&recordid="+_a8+"&tableid="+_a9);
}else{
if(this.ddwType.indexOf("Dynamic")!=-1){
new DDW(this.url,"dynamic_url",this.title,"&recordid="+_a8+"&tableid="+_a9);
}else{
if(this.ddwType.indexOf("Message")!=-1){
new DDW(this.url,"message_editor",this.owner,"&recordid="+_a8+"&tableid="+_a9);
}
}
}
};
var ref=this;
b.cancelbtn.onclick=function(_ab){
b.savebtn.disabled=true;
if((ref.record)&&((ref.isBackendLocked!="True"))&&(!ref.recordLocked)){
Controller.unlockRecord(ref.record.tableId,ref.record.recordId);
}
ref.getDOM().style.display="none";
ref.destroy();
};
b.savebtn.onclick=function(_ac){
ref.save();
};
b.deletebtn.onclick=function(_ad){
ref.deleteR();
};
this.prv.mDOM.saveBtn=b.savebtn;
this.prv.mDOM.cancelBtn=b.cancelbtn;
this.prv.mDOM.deleteBtn=b.deletebtn;
this.prv.mDOM.status=b.status;
this.prv.mDOM.bottom.buttons=b;
this.prv.mDOM.bottom.appendChild(b);
this.prv.mTearAway.setContent(this.prv.mDOM);
this.prv.mTearAway.getDOM().owner=this;
if(browser.safari){
var _ae=getElementByClassName(this.prv.mDOM,"recordinputbottom");
if(_ae){
_ae.style.display="block";
}
}
this.saveImageUploadState=function(){
if(!this.hasImages){
return false;
}
for(var _af=0;_af<this.prv.mInputs.length;_af++){
if(this.prv.mInputs[_af].an_iframe){
if(!browser.ie){
this.prv.mInputs[_af].iFrameImageUrl=getElementByClassName(this.prv.mInputs[_af].an_iframe.contentDocument.forms[0],"browse").value;
}else{
this.prv.mInputs[_af].iFrameImageUrl=getElementByClassName(this.prv.mInputs[_af].an_iframe.contentWindow.document.forms[0],"browse").value;
}
}
}
};
this.restoreImageUploadState=function(){
for(var _b0=0;_b0<this.prv.mInputs.length;_b0++){
if(this.prv.mInputs[_b0].an_iframe){
this.prv.mInputs[_b0].set_iframe(this.prv.mInputs[_b0].an_iframe,this.prv.mInputs[_b0].prv.mFieldID);
}
}
};
return this;
}
function EditorColumn(_b1){
this.prv={mParent:_b1,mDOM:_b1.getColumnDOM(),mInputs:new Array()};
Function.decl.apply(this);
probe(this.prv.mDOM);
this.getInputDOM=function(){
if(this.prv.mInputs.length<=0){
return this.prv.mDOM.input;
}else{
return this.prv.mDOM.input.cloneNode(true);
}
};
this.insertInput=function(){
var _b2=new EditorInput(this);
this.prv.mInputs.push(_b2);
this.prv.mDOM.insertBefore(_b2.prv.mDOM,null);
return _b2;
};
this.removeInput=function(){
var ip=this.prv.mInputs.pop();
this.prv.mDOM.removeChild(ip.prv.mDOM);
delete ip;
};
this.input=function(_b4){
};
this.size=function(_b5){
if(this.prv.mInputs.length==_b5){
return;
}
var _b6=_b5-this.prv.mInputs.length;
if(_b6<0){
for(var i=0;i<Math.abs(_b6);i++){
this.removeInput();
}
}else{
for(var i=0;i<_b6;i++){
this.insertInput();
}
}
};
this.prv.mInputs.push(new EditorInput(this));
return this;
}
function EditorInput(_b8,_b9){
this.prv={mParent:_b8,mDOM:_b8.getInputDOM(),mLabel:null,mType:-1,mValue:null,mModified:false};
Function.decl.apply(this);
this.validate=function(_ba){
var _ba=isDefined(_ba)?_ba:this.prv.mValue;
var _bb;
switch(this.prv.mType){
case 0:
break;
case 1:
_bb=/^\d*\.?\d*$/;
if(!_bb.test(_ba)){
return false;
}
break;
case 4:
var _bc=validateDate(_ba);
return _bc;
break;
default:
break;
}
return true;
};
this.setLabel=function(_bd){
var _be=typeof _bd;
switch(_be){
case "string":
case "number":
this.prv.mDOM.label.innerHTML=_bd;
break;
case "object":
if(_bd.nodeType==1){
this.prv.mDOM.label.insertBefore(_bd,null);
}
break;
default:
}
};
this.setType=function(_bf){
if(this.prv.mDOM.value&&this.prv.mDOM.value.nodeType==1){
this.prv.mDOM.removeChild(this.prv.mDOM.value);
}
var _c0;
var _c1=this;
if(!this.field){
this.field=getField(this.prv.mParent.prv.mParent.record.tableId,this.prv.mFieldID);
}
if(this.field.fieldchoicelist){
this.choicelist=this.field.fieldchoicelist;
var _bf=6;
}else{
this.choicelist=null;
}
switch(_bf){
case 6:
_c0=getTemplate("choicelistvalue").cloneNode(true);
_c0.onchange=function(_c2){
var dom=this.parentNode.parentNode.parentNode.parent.prv.mDOM;
_c1.prv.mValue=this.value;
_c1.setModified(true);
var _c4=this.parentNode.parentNode.parentNode.parent;
if(_c2!=true){
for(i=0;i<_c4.prv.mInputs.length;i++){
if(_c4.prv.mInputs[i].prv.mDOM==this.parentNode){
for(j in _c4.record.map){
if(i==_c4.record.map[j]){
break;
}
}
var _c5=getField(_c4.record.tableId,j);
if(_c5.fieldcallbackonchange!=undefined){
if(_c5.fieldcallbackonchange){
var _c6=_c4.prv.mInputs[i].prv.mFieldRecordID;
if(_c6=="-1"){
_c6="-3";
}
ExecuteCallBack(_c4,dax_event_ondatachange,_c4.record.tableId,j+"["+_c6+"]",this.value,i,{value:this.value,type:_c4.prv.mInputs[i].prv.mType,format:this.format});
}
}
}
}
}
};
if(!browser.safari){
_c0.onmousedown=function(){
DAX_Global_disableDragging=true;
return false;
};
_c0.onmouseup=function(){
return false;
};
_c0.onclick=function(){
return false;
};
_c0.value.onmousedown=function(){
DAX_Global_disableDragging=true;
return false;
};
_c0.value.onmouseup=function(){
return false;
};
_c0.value.onclick=function(){
return false;
};
}else{
_c0.onmousedown=function(_c7){
xpEvent(_c7,true);
};
_c0.value.onmousedown=function(_c8){
xpEvent(_c8,true);
};
}
_c0.choicelistloaded=false;
DAX_Bridge_GetChoiceList(this.choicelist,_c0);
break;
case 4:
if(typeof (this.picker)=="undefined"){
this.node=getTemplate("datevalue").cloneNode(true);
this.picker=new PickerObject(30);
this.node.appendChild(this.picker.dom);
this.node.input=getElementByClassName(this.node,"dax_picker_value");
this.node.table=getElementByClassName(this.node,"dax_picker_table");
this.node.popup=$("dax_picker_popup0");
this.node.header=getElementByClassName(this.node.popup,"dax_calendar_header");
this.node.grid=this.picker.calendar.calGridObj.grid;
if(isDefined(this.node.popup)){
this.picker.calendar.drawCalendar();
var _c9=0;
}
}
_c0=this.node;
this.node.input.className="stringvalue dax_picker_value";
this.node.input.onclick=function(){
if(!this.readOnly){
this.className="stringvalue_edit dax_picker_value";
status=this.parent.parentNode.parentNode.parentNode.status.innerHTML="";
this.style.border="1px solid black";
}
};
this.node.input.onmouseover=function(){
if(!this.readOnly){
if(this.className!="stringvalue_edit dax_picker_value"){
this.className="stringvalue_over dax_picker_value";
}
}
};
this.node.input.onmouseout=function(){
if(!this.readOnly){
if(this.className!="stringvalue_edit dax_picker_value"){
this.className="stringvalue dax_picker_value";
}
}
};
this.node.input.onkeypress=function(e){
this.parent.parentNode.parentNode.parentNode.parent.clickFlag=true;
var e=xpEvent(e,false);
var _cb=e.charCode?e.charCode:e.keyCode;
status=this.parent.parentNode.parentNode.parentNode.status;
if(_cb!=8&&_cb!=9&&_cb!=44&&_cb!=46&&_cb!=47&&_cb!=45&&_cb!=37&&_cb!=39){
if(_cb<48||_cb>57&&_cb!=47&&_cb!=45){
this.style.border="1px solid red";
status.innerHTML=STR["status_err_date"];
return false;
}else{
if(!this.readOnly){
_c1.setModified(true);
}
this.style.borderColor="#999999";
status.innerHTML="";
return e;
}
}
};
this.node.input.onchange=function(_cc){
_c1.setModified(true);
if(_cc==true){
if(this.value.length){
while(this.value.indexOf("/")!=-1){
this.value=this.value.replace("/","-");
}
var _cd=this.value;
var _ce=this.value.split("-");
if(_ce.length<3){
this.style.border="1px solid red";
status.innerHTML=STR["status_err_date"];
this.parent.parentNode.parentNode.parentNode.parent.abortSave=true;
return false;
}
if(this.value.length<10){
this.value=fixValueSize(this.value);
if(this.format){
if(this.format=="dDD-MMM-YYYY"){
this.value=keepDetailDate(this.value);
}else{
if(this.format=="d1"){
this.format="dMM-DD-YYYY";
}else{
this.value=checkDateFormat(this.value,this.format.substr(1,this.format.length));
}
}
}else{
this.format="dMM-DD-YYYY";
this.value=checkDateFormat(this.value,this.format.substr(1,this.format.length));
}
}else{
if(this.format){
if(this.format=="dDD-MMM-YYYY"){
this.value=keepDetailDate(this.value);
}else{
if(this.format=="d1"){
this.format="dMM-DD-YYYY";
}else{
this.format=this.format;
}
}
}else{
this.format="dMM-DD-YYYY";
}
}
this.value=checkDateFormat(this.value,this.format.substr(1,this.format.length));
this.parent.parentNode.parentNode.parentNode.parent.abortSave=false;
_c1.prv.mValue=this.value;
_c1.validate(this.value);
_c1.realDate=this.value;
var _cf=this.value.split("-");
status=this.parent.parentNode.parentNode.parentNode.status;
if(this.value.length<11){
var _d0=dateValidation(this.value,this.format.substr(1,this.format.length));
if(_cf.length==3&&_d0=="True"){
status.innerHTML="";
this.style.border="1px solid black";
this.originalValue=this.value;
if(this.value&&this.format){
if(this.value.length>0){
this.value=format(this.format,this.value);
}else{
this.value=this.value;
}
var _d1=this.parent.parentNode.parentNode.parentNode.parent;
for(i=0;i<_d1.prv.mInputs.length;i++){
if(_d1.prv.mInputs[i].prv.mDOM==this.parent.parentNode){
for(j in _d1.record.map){
if(i==_d1.record.map[j]){
break;
}
}
var _d2=getField(_d1.record.tableId,j);
if(_d2.fieldcallbackonchange!=undefined){
if(_d2.fieldcallbackonchange){
var _d3=_d1.prv.mInputs[i].prv.mFieldRecordID;
if(_d3=="-1"){
_d3="-3";
}
ExecuteCallBack(_d1,dax_event_ondatachange,_d1.record.tableId,j+"["+_d3+"]",this.realDate,i,{value:this.realDate,type:_d1.prv.mInputs[i].prv.mType,format:this.format});
}
}
}
}
return;
}
}else{
this.style.border="1px solid red";
status.innerHTML=STR["status_err_date"];
this.parent.parentNode.parentNode.parentNode.parent.abortSave=true;
this.value=_cd;
return false;
}
}else{
if(this.value.length>10||this.value.length==0){
this.value="00-00-00";
}else{
this.style.border="1px solid red";
status.innerHTML=STR["status_err_date"];
this.parent.parentNode.parentNode.parentNode.parent.abortSave=true;
this.value=_cd;
return false;
}
}
var _cf=this.value.split("-");
status=this.parent.parentNode.parentNode.parentNode.status;
if(_cf.length==3){
this.value=checkDateFormat(this.value,this.format.substr(1,this.format.length));
var _d0=dateValidation(this.value);
if(_d0!=0){
this.style.border="1px solid red";
status.innerHTML=STR["status_err_date"];
this.value=_cd;
}else{
this.style.border="1px solid black";
if(this.parent.calendar.value&&this.format){
this.value=format(this.format,this.parent.calendar.value);
}
}
}
}else{
this.value="00-00-00";
_c1.prv.mValue=this.value;
_c1.validate(this.value);
_c1.realDate=this.value;
}
}else{
var _d4=doFormat(this.value,this.format,"4daf_default");
if(!_d4){
this.style.border="1px solid red";
status.innerHTML=STR["status_err_date"];
this.parent.parentNode.parentNode.parentNode.parent.abortSave=true;
return false;
}
_c1.realDate=_d4;
_c1.picker.value.originalValue=_d4;
this.value=doFormat(_d4,"4daf_default",this.format,"date");
this.parent.parentNode.parentNode.parentNode.parent.abortSave=false;
_c1.prv.mValue=this.value;
}
var _d1=this.parent.parentNode.parentNode.parentNode.parent;
for(i=0;i<_d1.prv.mInputs.length;i++){
if(_d1.prv.mInputs[i].prv.mDOM==this.parent.parentNode){
for(j in _d1.record.map){
if(i==_d1.record.map[j]){
break;
}
}
var _d2=getField(_d1.record.tableId,j);
if(_d2.fieldcallbackonchange!=undefined){
if(_d2.fieldcallbackonchange){
var _d3=_d1.prv.mInputs[i].prv.mFieldRecordID;
if(_d3=="-1"){
_d3="-3";
}
ExecuteCallBack(_d1,dax_event_ondatachange,_d1.record.tableId,j+"["+_d3+"]",this.originalValue,i,{value:this.originalValue,type:_d1.prv.mInputs[i].prv.mType,format:this.format});
}
}
}
}
this.parent.parentNode.parentNode.parentNode.parent.clickFlag=false;
};
this.node.input.parent=_c0;
this.node.input.owner=this;
this.node.input.onblur=function(){
};
break;
case 2:
_c0=getTemplate("imagevalue").cloneNode(true);
probe(_c0);
_c0.pic.link.onmousedown=function(_d5){
xpEvent(_d5,true);
};
this.prv.mParent.prv.mParent.hasImages=true;
break;
case 3:
_c0=getTemplate("textvalue").cloneNode(true);
_c0.onkeypress=function(){
var dom=this.parentNode.parentNode.parentNode.parent.prv.mDOM;
_c1.prv.mValue=this.value;
_c1.setModified(true);
};
_c0.onchange=function(){
var _d7=this.parentNode.parentNode.parentNode.parent;
for(i=0;i<_d7.prv.mInputs.length;i++){
if(_d7.prv.mInputs[i].prv.mDOM==this.parentNode){
for(j in _d7.record.map){
if(i==_d7.record.map[j]){
break;
}
}
var _d8=getField(_d7.record.tableId,j);
if(_d8.fieldcallbackonchange!=undefined){
if(_d8.fieldcallbackonchange){
var _d9=_d7.prv.mInputs[i].prv.mFieldRecordID;
if(_d9=="-1"){
_d9="-3";
}
ExecuteCallBack(_d7,dax_event_ondatachange,_d7.record.tableId,j+"["+_d9+"]",this.value,i,{value:this.value,type:_d7.prv.mInputs[i].prv.mType,format:this.format});
}
}
}
}
};
_c0.onmousedown=function(_da){
xpEvent(_da,true);
};
_c0.onmouseup=_c0.onmousedown;
case 1:
if(!isDefined(_c0)){
_c0=getTemplate("stringvalue").cloneNode(true);
_c0.onblur=function(){
this.style.borderColor="#999999";
var dom=this.parentNode.parentNode.parentNode.parent.prv.mDOM;
var _dc=this.parentNode.parentNode.parentNode.parent.prv.mDOM.status;
this.className="stringvalue";
};
_c0.onkeypress=function(e){
var e=xpEvent(e,false);
var _de=e.charCode?e.charCode:e.keyCode;
var dom=this.parentNode.parentNode.parentNode.parent.prv.mDOM;
var _e0=this.parentNode.parentNode.parentNode.parent.prv.mDOM.status;
_c1.setModified(true);
if(_de!=8&&_de!=9&&_de!=44&&_de!=46&&_de!=45&&_de!=37&&_de!=39&&_de!=99&&_de!=118&&_de!=120){
if(_de<48||_de>57&&_de!=44&&_de!=46&&_de!=45&&_de!=99&&_de!=118&&_de!=120){
this.style.border="1px solid red";
dom.status.innerHTML=_e0.innerHTML=STR["status_err_number"];
return false;
}else{
if(!this.readOnly){
_c1.setModified(true);
}
this.style.borderColor="#999999";
this.className="stringvalue";
dom.status.innerHTML="";
return e;
}
}
};
_c0.onchange=function(){
var _e1=this.parentNode.parentNode.parentNode.parent;
for(i=0;i<_e1.prv.mInputs.length;i++){
if(_e1.prv.mInputs[i].prv.mDOM==this.parentNode){
for(j in _e1.record.map){
if(i==_e1.record.map[j]){
break;
}
}
var _e2=getField(_e1.record.tableId,j);
if(_e2.fieldcallbackonchange!=undefined){
if(_e2.fieldcallbackonchange){
var _e3=_e1.prv.mInputs[i].prv.mFieldRecordID;
if(_e3=="-1"){
_e3="-3";
}
ExecuteCallBack(_e1,dax_event_ondatachange,_e1.record.tableId,j+"["+_e3+"]",this.value,i,{value:this.value,type:_e1.prv.mInputs[i].prv.mType,format:this.format});
}
}
}
}
};
_c0.onmousedown=function(_e4){
xpEvent(_e4,true);
};
_c0.onmouseup=_c0.onmousedown;
}
break;
case 5:
if(!isDefined(_c0)){
_c0=getTemplate("booleancheckboxvalue").cloneNode(true);
}
_c0.onclick=function(){
if(_c1.isDisabled){
return false;
}
if(this.value.toLowerCase()=="true"){
getElementByClassName(this,"fourdaf_checkbox",true).className="fourdaf_checkbox_uncheck";
this.value="False";
}else{
getElementByClassName(this,"fourdaf_checkbox",true).className="fourdaf_checkbox_check";
this.value="True";
}
_c1.setModified(true);
var _e5=this.parentNode.parentNode.parentNode.parent;
for(i=0;i<_e5.prv.mInputs.length;i++){
if(_e5.prv.mInputs[i].prv.mDOM==this.parentNode){
for(j in _e5.record.map){
if(i==_e5.record.map[j]){
break;
}
}
var _e6=getField(_e5.record.tableId,j);
if(_e6.fieldcallbackonchange!=undefined){
if(_e6.fieldcallbackonchange){
var _e7=_e5.prv.mInputs[i].prv.mFieldRecordID;
if(_e7=="-1"){
_e7="-3";
}
ExecuteCallBack(_e5,dax_event_ondatachange,_e5.record.tableId,j+"["+_e7+"]",this.value,i,{value:this.value,type:_e5.prv.mInputs[i].prv.mType,format:this.format});
}
}
}
}
};
_c0.onmousedown=function(_e8){
xpEvent(_e8,true);
};
_c0.onmouseup=_c0.onmousedown;
break;
case 0:
default:
if(!isDefined(_c0)){
_c0=getTemplate("stringvalue").cloneNode(true);
}
_c0.onclick=function(){
if(!this.readOnly){
this.className="stringvalue_edit";
}
};
_c0.onmouseover=function(){
if(!this.readOnly){
if(this.className!="stringvalue_edit"){
this.className="stringvalue_over";
}
}
};
_c0.onmouseout=function(){
if(!this.readOnly){
if(this.className!="stringvalue_edit"){
this.className="stringvalue";
}
}
};
if(!isDefined(_c0.onkeypress)){
_c0.onkeypress=function(e){
var dom=this.parentNode.parentNode.parentNode.parent.prv.mDOM;
_c1.setModified(true);
dom.status.innerHTML="";
if(isDefined(this.format)){
if(this.format.substr(0,1)=="t"){
var e=xpEvent(e,false);
var _eb=e.charCode?e.charCode:e.keyCode;
var _ec=this.parentNode.parentNode.parentNode.parent.prv.mDOM.status;
if(_eb!=8&&_eb!=9&&_eb!=37&&_eb!=39){
if(_eb<48||_eb>57&&_eb!=44&&_eb!=46&&_eb!=45&&_eb!=58){
this.style.border="1px solid red";
dom.status.innerHTML=_ec.innerHTML=STR["status_err_time"];
return false;
}else{
if(!this.readOnly){
_c1.setModified(true);
}
this.style.borderColor="#999999";
this.className="stringvalue";
dom.status.innerHTML="";
return e;
}
}
}
}
};
}
_c0.onchange=function(){
var dom=this.parentNode.parentNode.parentNode.parent.prv.mDOM;
_c1.prv.mValue=this.value;
_c1.setModified(true);
var _ee=this.parentNode.parentNode.parentNode.parent;
for(i=0;i<_ee.prv.mInputs.length;i++){
if(_ee.prv.mInputs[i].prv.mDOM==this.parentNode){
for(j in _ee.record.map){
if(i==_ee.record.map[j]){
break;
}
}
var _ef=getField(_ee.record.tableId,j);
if(_ef.fieldcallbackonchange!=undefined){
if(_ef.fieldcallbackonchange){
var _f0=_ee.prv.mInputs[i].prv.mFieldRecordID;
if(_f0=="-1"){
_f0="-3";
}
ExecuteCallBack(_ee,dax_event_ondatachange,_ee.record.tableId,j+"["+_f0+"]",this.value,i,{value:this.value,type:_ee.prv.mInputs[i].prv.mType,format:this.format});
}
}
}
}
};
_c0.onblur=function(){
var dom=this.parentNode.parentNode.parentNode.parent.prv.mDOM;
_c1.prv.mValue=this.value;
_c1.setModified(true);
this.className="stringvalue";
if(this.format){
if(this.format.substr(0,1)!="x"&&this.format.substr(0,1)!="a"){
if(this.format.substr(0,1)=="i"){
var dom=this.parentNode.parentNode.parentNode.parent.prv.mDOM;
if(parseInt(this.value)>parseInt(32767)||parseInt(this.value)<"-32768"){
this.style.border="1px solid red";
dom.status.innerHTML=STR["editor_error_int"];
this.parentNode.parentNode.parentNode.parent.abortSave=true;
}else{
if(this.value.substr(0,1)==","||this.value.substr(0,1)=="."){
this.value="";
}
}
}else{
if(this.format.substr(0,1)=="l"){
var dom=this.parentNode.parentNode.parentNode.parent.prv.mDOM;
if(parseInt(this.value)>parseInt(2147483648)||parseInt(this.value)<"-2147483648"){
this.style.border="1px solid red";
dom.status.innerHTML=STR["editor_error_longint"];
this.parentNode.parentNode.parentNode.parent.abortSave=true;
return false;
}
}else{
if(this.format.substr(0,1)=="r"){
if(this.value.substr(0,1)==","){
this.value="0"+this.value;
}
}else{
this.value=this.value;
}
}
}
}
if(this.value.length){
if(this.format.substr(0,1)!="a"&&this.format.substr(0,1)!="x"){
var _f2=cleanUp(this.value,this.format);
debugAlert("clean value "+_f2);
}else{
var _f2=this.value;
}
this.value=format(this.format,_f2);
}else{
this.value=this.value;
}
}else{
this.value=this.value;
}
};
_c0.onmousedown=function(_f3){
xpEvent(_f3,true);
};
_c0.onmouseup=_c0.onmousedown;
break;
}
_c0.id=_c0.className+this.prv.mParent.getInputs().length+this.prv.mParent.prv.mParent.getDOM().id;
setStyle(_c0,"display","block");
this.prv.mDOM.insertBefore(_c0,null);
this.prv.mDOM.value=_c0;
this.prv.mType=_bf;
};
this.set_iframe=function(_f4,_f5){
if(!browser.ie){
var _f6=_f4.contentDocument;
}else{
if(document.frames["upload_"+_f5]){
var _f6=document.frames["upload_"+_f5].document;
}
}
if(_f6){
if(_f6.forms){
var _f7=_f6.forms[0];
}
}
if(_f7){
if((_f7.id=="binaryupload")&(_f7.sessionid.value=="")){
_f6.i_ref=this;
if((this.an_iframe)&&(this.iFrameImageUrl)){
getElementByClassName(_f7,"browse").setAttribute("value",this.iFrameImageUrl);
}
}else{
var _f8=this;
setTimeout(function(){
_f8.set_iframe(_f4,_f5);
},500);
}
}else{
var _f8=this;
setTimeout(function(){
_f8.set_iframe(_f4,_f5);
},500);
}
};
this.setValue=function(_f9,_fa,_fb,_fc,_fd,_fe,_ff,_100,_101,_102,_103){
if(_101=="boolean"){
_fa=5;
}
if(!_102){
if(isDefined(_fa)){
this.setType(_fa);
}else{
var _fa=this.prv.mType;
}
}
if(_fa<0){
var type=typeof _f9;
switch(type){
case "string":
var re=/^\/DAX\/GetImage\//;
if(re.test(_f9)){
this.setType(2);
}else{
this.setType(0);
}
break;
case "number":
this.setType(1);
break;
case "object":
if(_f9 instanceof String){
var _f9=_f9.valueOf();
}else{
var _f9="";
}
break;
default:
var _f9="";
break;
}
this.setValue(_f9);
}else{
if(this.choicelist){
var _106=this.prv.mDOM.value.length;
var _107=false;
for(var _108=0;_108<this.prv.mDOM.value.length;_108++){
if(this.prv.mDOM.value.options[_108].value==_f9){
_107=true;
this.prv.mDOM.value.selectedIndex=_108;
break;
}
}
if((!_107)&&(!_102)){
this.prv.mDOM.value.options[_106]=new Option(_f9,_f9);
}
_fa=6;
}
switch(_fa){
case 6:
this.prv.mDOM.value.value=_f9;
this.prv.mValue=_f9;
this.prv.mDOM.value.format=_fd;
if(_fd){
this.prv.mDOM.format=_fd;
}
break;
case 5:
if(_f9.toLowerCase()=="true"){
getElementByClassName(this.prv.mDOM,"fourdaf_checkbox",true).className="fourdaf_checkbox_check";
this.prv.mDOM.value.value="True";
}else{
getElementByClassName(this.prv.mDOM,"fourdaf_checkbox",true).className="fourdaf_checkbox_uncheck";
this.prv.mDOM.value.value="False";
}
break;
case 4:
if(_f9){
if(_f9.length>0){
if(_fd){
this.prv.mDOM.value.input.value=format(_fd,_f9.substring(0,11));
}else{
this.prv.mDOM.value.input.value=_f9.substring(0,11);
}
this.realDate=_f9.substring(0,11);
this.prv.mDOM.value.input.realDate=_f9.substring(0,11);
}else{
this.realDate="";
this.prv.mDOM.value.input.value="";
}
if(_fd){
this.prv.mDOM.value.format=_fd;
this.prv.mDOM.value.input.format=_fd;
}else{
this.prv.mDOM.value.format="d1";
this.prv.mDOM.value.input.format="d1";
}
}
break;
case 2:
this.prv.mDOM.value.pic.link.href="#";
var dom=this.prv.mDOM;
this.prv.mDOM.value.pic.link.image.src=_f9;
if(+this.prv.mParent.prv.mParent.record.tableId<32000){
var _10a=window.parent.document;
var _10b=_10a.createElement("iframe");
_10b.src="/dax/js/templates/upload.html?random="+Math.random();
_10b.height="40px";
_10b.scrolling="no";
_10b.id="upload_"+this.prv.mFieldID;
_10b.frameBorder="0";
this.prv.mDOM.value.appendChild(_10b);
this.set_iframe(_10b,this.prv.mFieldID);
this.an_iframe=_10b;
}
this.prv.mDOM.value.pic.link.onclick=function(_10c){
xpEvent(_10c,true);
whatever=getTemplate("image_preview_container");
imageNode=whatever.cloneNode(true);
var _10d=WindowManager.createNewWindow();
_10d.titleBar.innerHTML=STR["editor_imageviewer"];
if(_fb<300){
_fb=300;
}
if(_fc<200){
_fc=200;
}
_10d.size(_fb,_fc);
_10d.image=imageNode;
_10d.contentArea.appendChild(imageNode);
_10d.activate();
_10d.open();
_10d.onsize=function(){
var _10e=getElementByClassName(this.image,"image_preview");
_10e.widht=this.contentArea.offsetWidth;
_10e.height=this.contentArea.offsetHeight;
};
i=1;
while($("image_preview_container"+i)!=null){
i++;
}
imageNode.id="image_preview_container"+i;
var ti=new taskbarItem(taskbar);
i=1;
while($("dax_taskbar_button_image"+i)!=null){
i++;
}
ti.dom.id="dax_taskbar_button_image"+i;
ti.setLabel(STR["image"]+i);
ti.setIcon("editor");
var ref=this;
ti.dom.winRef=_10d;
ti.dom.onclick=function(){
this.parent.setSelected(true,true);
this.winRef.activate();
};
setStyle(ti.dom,"display","block");
ti.setSelected(true,true);
ti.parent.refresh();
_10d.tbitem=ti;
var _111=getElementByClassName(imageNode,"image_preview");
_111.src=_f9;
_10d.onclose=function(){
if(this.tbitem){
this.tbitem.remove();
}
if(this.contentArea.grid){
this.contentArea.grid.destroy();
}
if(this.editor){
this.editor.destroy();
}
};
};
return false;
break;
case 3:
this.prv.mDOM.value.value=_f9;
if(_fd){
this.prv.mDOM.value.format=_fd;
}
case 0:
case 1:
this.prv.mDOM.value.value=_f9;
if(_fd){
this.prv.mDOM.value.format=_fd;
}
break;
default:
this.prv.mDOM.value.value=_f9;
this.prv.mValue=_f9;
this.prv.mDOM.value.format=_fd;
if(_fd){
this.prv.mDOM.format=_fd;
}
if(!isDefined(_f9)||_f9==""){
this.prv.mDOM.value.className="stringvalue_edit";
}else{
this.prv.mDOM.value.className="stringvalue";
}
break;
}
if((_fe)&&(_ff)){
if(!_100){
_100="DDW";
}
switch(_fa){
case 4:
var _112=getElementByClassName(this.prv.mDOM,"dax_picker_aux");
if(this.prv.ddwButton){
_112.removeChild(this.prv.ddwButton);
this.prv.ddwButton=null;
}
var _113=getTemplate("editorddwinline");
var _114=_113.cloneNode(true);
v=1;
while($("editorddwinline"+v)!=null){
v++;
}
_112.appendChild(_114);
_114.id="editorddwinline"+v;
_114.innerHTML=_100;
this.prv.ddwButton=_114;
_114.parent=this.prv.mDOM;
_114.owner=this;
_114.url=_fe;
_114.title=_100;
_114.style.display="inline";
var _115=this.prv.mDOM.value.offsetWidth-_114.offsetWidth-10+"px";
this.prv.mDOM.value.style.width=_115;
_114.tableId=this.prv.mParent.prv.mParent.record.tableId;
_114.recordId=this.prv.mParent.prv.mParent.record.recordId;
break;
case 2:
break;
case 3:
if(this.prv.ddwButton){
this.prv.ddwButton.parent.removeChild(this.prv.ddwButton);
this.prv.ddwButton=null;
}
var _113=getTemplate("editorddwinline");
var _114=_113.cloneNode(true);
v=1;
while($("editorddwinline"+v)!=null){
v++;
}
this.prv.mDOM.appendChild(_114);
_114.id="editorddwinline"+v;
_114.innerHTML=_100;
this.prv.ddwButton=_114;
_114.parent=this.prv.mDOM;
_114.owner=this;
_114.url=_fe;
_114.title=_100;
_114.style.display="inline";
var _115=this.prv.mDOM.value.offsetWidth-_114.offsetWidth-10+"px";
this.prv.mDOM.value.style.width=_115;
_114.tableId=this.prv.mParent.prv.mParent.record.tableId;
_114.recordId=this.prv.mParent.prv.mParent.record.recordId;
break;
case 6:
case 0:
case 1:
if(this.prv.ddwButton){
this.prv.ddwButton.parent.removeChild(this.prv.ddwButton);
this.prv.ddwButton=null;
}
var _113=getTemplate("editorddwinline");
var _114=_113.cloneNode(true);
v=1;
while($("editorddwinline"+v)!=null){
v++;
}
this.prv.mDOM.appendChild(_114);
_114.id="editorddwinline"+v;
_114.innerHTML=_100;
this.prv.ddwButton=_114;
_114.parent=this.prv.mDOM;
_114.owner=this;
_114.url=_fe;
_114.title=_100;
_114.style.display="inline";
var _115=this.prv.mDOM.value.offsetWidth-_114.offsetWidth-10+"px";
this.prv.mDOM.value.style.width=_115;
_114.tableId=this.prv.mParent.prv.mParent.record.tableId;
_114.recordId=this.prv.mParent.prv.mParent.record.recordId;
break;
default:
break;
}
if(_114){
if(_114.recordId==-1){
_114.recordId=-3;
}
if(_ff.indexOf("Static")!=-1){
_114.onclick=function(){
var _116=this.recordId;
_116=ReplaceString(_116,"["+this.tableId+"]",this.owner.field.fieldid);
var _117=new DDW(this.url,"static_url",this.title,"&recordid="+_116+"&tableid="+this.tableId+"&data="+this.owner.getValue());
setTimeout(function(){
WindowManager.active=null;
if(_117.window){
_117.window.activate();
}
},100);
};
}else{
if(_ff.indexOf("Dynamic")!=-1){
_114.onclick=function(){
var _118=this.recordId;
_118=ReplaceString(_118,"["+this.tableId+"]",this.owner.field.fieldid);
var _119=new DDW(this.url,"dynamic_url",this.title,"&recordid="+_118+"&tableid="+this.tableId+"&data="+this.owner.getValue());
setTimeout(function(){
WindowManager.active=null;
if(_119.window){
_119.window.activate();
}
},100);
};
}else{
if(_ff.indexOf("Message")!=-1){
_114.onclick=function(){
var _11a=this.recordId;
_11a=ReplaceString(_11a,"["+this.tableId+"]",this.owner.field.fieldid);
var _11b=new DDW(this.url,"message_editor",this.owner.prv.mParent.prv.mParent,"&recordid="+_11a+"&tableid="+this.tableId+"&data="+this.owner.getValue());
setTimeout(function(){
WindowManager.active=null;
if(_11b.window){
_11b.window.activate();
}
},100);
};
}
}
}
}
}else{
if(!_103){
switch(_fa){
case 6:
if(this.prv.ddwButton){
this.prv.ddwButton.parent.removeChild(this.prv.ddwButton);
this.prv.ddwButton=null;
}
break;
case 4:
var _112=getElementByClassName(this.prv.mDOM,"dax_picker_aux");
if(this.prv.ddwButton){
_112.removeChild(this.prv.ddwButton);
this.prv.ddwButton=null;
}
break;
case 2:
break;
case 3:
if(this.prv.ddwButton){
this.prv.ddwButton.parent.removeChild(this.prv.ddwButton);
this.prv.ddwButton=null;
}
break;
case 0:
case 1:
if(this.prv.ddwButton){
this.prv.ddwButton.parent.removeChild(this.prv.ddwButton);
this.prv.ddwButton=null;
}
break;
default:
break;
}
}
}
}
};
this.getValue=function(){
if(this.choicelist){
if(this.prv.mType!=4){
return this.prv.mDOM.value.options[this.prv.mDOM.value.selectedIndex].value;
}else{
return doFormat(this.prv.mDOM.value.options[this.prv.mDOM.value.selectedIndex].value,this.field.fieldformat,"4daf_default","date");
}
}
switch(this.prv.mType){
case 5:
case 0:
case 1:
case 3:
return this.prv.mDOM.value.value;
case 4:
return (this.realDate);
}
};
this.getOriginalValue=function(){
if(this.choicelist){
return doFormat(this.prv.mDOM.value.options[this.prv.mDOM.value.selectedIndex].value,this.field.fieldformat,"4daf_default","date");
}
if(isDefined(this.picker)){
if(isDefined(this.picker.value.originalValue)){
return this.picker.value.originalValue;
}else{
if(this.realDate){
return this.realDate;
}else{
return this.prv.mValue;
}
}
}else{
return this.realDate;
}
};
this.setModified=function(_11c){
if(_11c==this.prv.mModified){
return;
}
this.prv.mModified=_11c;
if(_11c){
var _11d=this.prv.mParent.getParent();
_11d.setModified(_11c);
}
};
this.lock=function(){
switch(this.prv.mType){
case 3:
case 0:
case 1:
case 4:
default:
this.prv.mDOM.value.readOnly=true;
break;
}
};
this.clear=function(){
switch(this.prv.mType){
case 3:
this.setValue(null);
case 0:
case 1:
this.setValue("");
break;
case 2:
this.prv.mDOM.value.pic.link.href="";
this.prv.mDOM.value.pic.link.image.src="";
break;
case 4:
this.realDate="";
this.prv.mDOM.value.input.value="";
default:
break;
}
};
var _b9=isDefined(_b9)?_b9:this.prv.mType;
probe(this.prv.mDOM);
return this;
}
function setIframe(){
if(this.document.i_ref!=undefined){
if(!browser.safari2){
this.document.i_ref.prv.mDOM.value.pic.link.image.src="";
}else{
this.document.i_ref.prv.mDOM.value.pic.link.image.src="file://"+this.document.forms[0].DAX_BinaryFile.value;
}
this.document.i_ref.setModified(true);
}
}
function ExecuteCallBack(_11e,_11f,_120,_121,_122,_123,_124){
var _125=connection.sessionId;
if(_125==""){
return;
}
var _126=getXMLHttpRequest();
if(_126){
var url;
if(_122!=""){
url=connection.address.executecallback+"?sessionId="+_125+"&eventid="+_11f+"&tableid="+_120+"&fieldid="+_121+"&value="+dax_bridge.encode(_122);
}else{
url=connection.address.executecallback+"?sessionId="+_125+"&eventid="+_11f+"&tableid="+_120+"&fieldid="+_121;
}
_126.onreadystatechange=function(){
OnReceiveCallBackResult(_126,_11e,_123,_124);
};
try{
debugAlert("<b>Callback:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_126.open("GET",url,true);
_126.send(null);
}
catch(e){
if(browser.ie6){
_126.onreadystatechange=function(){
};
}else{
_126.onreadystatechange=null;
}
delete _126;
}
}
return true;
}
function OnReceiveCallBackResult(_128,_129,id,_12b){
if(_128.readyState!=4){
return;
}
var _12c=true;
for(var _12d=0;_12d<_129.prv.mInputs.length;_12d++){
if(_129.prv.mInputs[_12d].choicelist){
debugAlert(_129.prv.mInputs[_12d].choicelist+" loaded state:"+_129.prv.mInputs[_12d].prv.mDOM.value.choicelistloaded);
if(!_129.prv.mInputs[_12d].prv.mDOM.value.choicelistloaded){
_12c=false;
}
}
}
debugAlert("Lists loaded: "+_12c);
if(!_12c){
_129.callbackTimer=window.setTimeout(function(){
OnReceiveCallBackResult(_128,_129,id,_12b);
},500);
return false;
}
if(checkResponse(_128)){
return false;
}
var _12e=_128.responseXML.getElementsByTagName("Callback").item(0);
if(!_12e){
return false;
}
var _12f=_12e.getElementsByTagName("Result");
var _130=_12e.getAttribute("executionstatus");
var _131=_12e.getElementsByTagName("fieldvalue");
var _132=_12e.getElementsByTagName("list");
var _133=true;
for(var _134=0;_134<_131.length;_134++){
_133=false;
var _135=_131[_134].getAttribute("fieldid");
var _136=_131[_134].getAttribute("value");
if(_129.prv.mInputs[_129.record.map[_135]].field.fieldtype!="date"){
_129.prv.mInputs[_129.record.map[_135]].setValue(_136,null,null,null,null,null,null,null,null,null,null,true);
}else{
_129.prv.mInputs[_129.record.map[_135]].setValue(doFormat(_136,"dYYYY-MM-DD",_129.prv.mInputs[_129.record.map[_135]].fieldformat),null,null,null,null,null,null,null,null,null,null,true);
_129.prv.mInputs[_129.record.map[_135]].realDate=_136;
}
_129.prv.mInputs[_129.record.map[_135]].setModified(true);
}
for(var _137=0;_137<_132.length;_137++){
_133=false;
var _138=_132[_137].getAttribute("choicelist");
var _139=[];
var _13a=_132[_137].getElementsByTagName("listitem");
for(var _13b=0;_13b<_129.prv.mInputs.length;_13b++){
if((_129.prv.mInputs[_13b].choicelist==_138)&&(_13a.length>0)){
var _13c=_129.prv.mInputs[_13b].prv.mDOM.value;
if(_13c.options.length>0){
var _13d=_13c.options[_13c.selectedIndex].value;
}else{
var _13d=null;
}
_13c.options.length=0;
var _13e=0;
for(listValueCount=0;listValueCount<_13a.length;listValueCount++){
var _136=(_13a[listValueCount].firstChild)?(_13a[listValueCount].firstChild.nodeValue):"";
if(_13d==_136){
_13e=listValueCount;
}
_13c.options[listValueCount]=new Option(_136,_136);
}
_13c.selectedIndex=_13e;
_129.prv.mInputs[_13b].setModified(true);
}
}
}
_129.prv.mDOM.status.innerHTML="";
for(var _13b=0;_13b<_129.prv.mInputs.length;_13b++){
if(_129.prv.mInputs[_13b].prv.mDOM.value.className.indexOf("stringvalue_alert")!=-1){
_129.prv.mInputs[_13b].prv.mDOM.value.className=_129.prv.mInputs[_13b].prv.mDOM.value.oldClassName;
}
}
if(_133){
for(var i=0;i<_12f.length;i++){
var _140=_12f.item(i);
if(_140){
var _141=_140.getAttribute("value");
_129.prv.mInputs[id].setValue(_141,_12b.type,_12b.picWidth,_12b.picHeight,_12b.format,null,null,null,null,true,true);
var _142=_140.getAttribute("message");
if(_142!=""){
_129.prv.mDOM.status.innerHTML=_142;
}
if(_130!="1"){
if(_129.prv.mInputs[id].prv.mType!=5){
_129.prv.mInputs[id].prv.mDOM.value.focus();
}
_129.prv.mInputs[id].prv.mDOM.value.oldClassName=_129.prv.mInputs[id].prv.mDOM.value.className;
_129.prv.mInputs[id].prv.mDOM.value.className+=" stringvalue_alert";
}
}
}
}
if(browser.ie6){
_128.onreadystatechange=function(){
};
}else{
_128.onreadystatechange=null;
}
delete _128;
}

function CalendarObject(_1,_2,_3,_4){
var _5=getTemplate("dax_calendar");
if(!_5){
return null;
}
this.dom=_5.cloneNode(true);
this.header=getElementByClassName(this.dom,"dax_calendar_header");
this.header_text=getElementByClassName(this.dom,"dax_calendar_header_text");
this.HeaderLeft=getElementByClassName(this.dom,"dax_calendar_header_left");
this.HeaderRight=getElementByClassName(this.dom,"dax_calendar_header_right");
this.HeaderLeftYear=getElementByClassName(this.dom,"dax_calendar_header_left_year");
this.HeaderRightYear=getElementByClassName(this.dom,"dax_calendar_header_right_year");
this.parentWindow=null;
setStyle(this.dom,"display","block");
this.toString=function(){
return "calendar";
};
if(_1!=null){
if(_1>0){
this.columnWidth=_1;
}else{
this.columnWidth=50;
}
}
this.weekStart="Sun";
this.setWeekStart=function(_6){
if(_6=="Mon"){
this.weekStart="Mon";
}else{
this.weekStart="Sun";
}
};
if(_2=="picker"){
this.kind=_2;
this.actionTarget=_3;
}else{
this.kind="";
this.actionTarget="";
}
if(_4!=null){
this.parent=_4;
}
var _7=new Date();
if(this.date==null){
var _7=new Date();
this.date=_7.getDate();
this.month=(_7.getMonth()+1);
this.year=_7.getFullYear();
}
this.getToday=function(){
var _8=new Date();
var _9=_8.getDate();
var _a=(_8.getMonth()+1);
var _b=_8.getFullYear();
return this.getDate(null,_b,_a,_9);
};
i=1;
while($("dax_calendar"+i)!=null){
i++;
}
this.idNumber=i;
this.dom.id="dax_calendar"+this.idNumber;
var _c=this.dom;
this.dom.onclick=function(_d){
var _d=xpEvent(_d,true);
Controller.setFocused(_c);
return false;
};
this.onkeyup=function(_e){
var _e=xpEvent(_e,true);
if(_e.keyCode==39){
this.nextMonth();
this.drawCalendar();
}else{
if(_e.keyCode==37){
this.prevMonth();
this.drawCalendar();
}
}
};
this.setLanguage=function(_f){
if((_f=="en")||(_f="fr")||(_f=="es")||(_f="de")||(_f="ja")){
this.language=_f;
}
};
this.getLanguage=function(){
return this.language;
};
this.setDate=function(_10){
brokenDate=_10.split("-");
if(brokenDate.length==3){
year=brokenDate[0];
month=brokenDate[1];
_10=brokenDate[2];
testDate=new Date(year,month-1,_10);
if((testDate.getFullYear()==year)&&(testDate.getMonth()==month-1)){
this.year=year-0;
this.month=month-0;
this.date=_10-0;
this.drawCalendar();
}
}
};
this.getDate=function(_11,_12,_13,_14){
if(!_12){
var _12=this.year;
}
if(!_13){
var _13=this.month;
}
if(!_14){
var _14=this.date;
}
if(_14<10){
_14="0"+""+parseFloat(_14);
}
if(_13<10){
_13="0"+""+parseFloat(_13);
}
if(!_11){
var _14=_12+"-"+_13+"-"+_14;
}else{
if(_11=="mm/dd/yyyy"){
var _14=_13+"/"+_14+"/"+_12;
}
}
return _14;
};
this.value=this.getDate();
this.prevYear=function(){
this.year=parseFloat(this.year)-1;
this.date=0;
this.drawCalendar();
};
this.nextYear=function(){
this.year=parseFloat(this.year)+1;
this.date=0;
this.drawCalendar();
};
this.prevMonth=function(){
if(this.month==1){
this.month=12;
this.year=parseFloat(this.year)-1;
}else{
this.month=parseFloat(this.month)-1;
}
this.date=0;
this.drawCalendar();
};
this.nextMonth=function(){
if(this.month==12){
this.month=1;
this.year=parseFloat(this.year)+1;
}else{
this.month=parseFloat(this.month)+1;
}
this.date=0;
this.drawCalendar();
};
this.language="en";
this.refresh=function(){
if(!this.parentWindow){
return false;
}
var _15=this.parentWindow.style.width;
var _16=this.parentWindow.style.height;
var _17=(parseFloat(_15)/7);
var _16=(parseFloat(_16)-parseFloat(this.header.offsetHeight)-parseFloat(this.calGridObj.grid.column(0).prv.mHeader.prv.mDOM.offsetHeight));
var _18=(parseFloat(_16)/6);
this.columnWidth=(_17-1);
this.cellHeight=(_18-1);
for(i=0;i<this.calGridObj.grid.prv.mRows.length;i++){
this.calGridObj.grid.setColumnWidth(parseInt(this.columnWidth));
for(j=0;j<this.calGridObj.grid.prv.mRows[i].prv.mElements.length;j++){
cell=this.calGridObj.grid.prv.mRows[i].prv.mElements[j].prv.mDOM;
setStyle(cell,"height",parseInt(this.cellHeight)+"px");
}
}
this.calGridObj.grid.refresh();
};
this.afterRefresh=function(){
};
this.drawCalendar=function(){
if(this.calGridObj==null){
this.calGridObj=new GridObject(this.dom);
}
var _19=document.createTextNode(STR["calendar_month"][this.month-1]+" "+this.year);
while(this.header_text.hasChildNodes()){
this.header_text.removeChild(this.header_text.firstChild);
}
this.header_text.appendChild(_19);
this.HeaderLeft.parent=this;
this.HeaderRight.parent=this;
this.HeaderLeftYear.parent=this;
this.HeaderRightYear.parent=this;
this.HeaderLeft.className="dax_calendar_header_left dax_calendar_header_left_normal";
this.HeaderRight.className="dax_calendar_header_right dax_calendar_header_right_normal";
this.HeaderLeftYear.className="dax_calendar_header_left dax_calendar_header_left_year_normal";
this.HeaderRightYear.className="dax_calendar_header_right dax_calendar_header_right_year_normal";
this.HeaderLeft.onclick=function(_1a){
xpEvent(_1a,true);
this.parent.prevMonth();
return false;
};
this.HeaderLeft.onmouseover=function(){
this.className="dax_calendar_header_left dax_calendar_header_left_over";
};
this.HeaderLeft.onmouseout=function(){
this.className="dax_calendar_header_left dax_calendar_header_left_normal";
};
this.HeaderLeft.onmousedown=function(){
this.className="dax_calendar_header_left dax_calendar_header_left_down";
};
this.HeaderLeft.onmouseup=function(){
this.className="dax_calendar_header_left dax_calendar_header_left_over";
};
this.HeaderRight.onclick=function(_1b){
xpEvent(_1b,true);
this.parent.nextMonth();
return false;
};
this.HeaderRight.onmouseover=function(){
this.className="dax_calendar_header_right dax_calendar_header_right_over";
};
this.HeaderRight.onmouseout=function(){
this.className="dax_calendar_header_right dax_calendar_header_right_normal";
};
this.HeaderRight.onmousedown=function(){
this.className="dax_calendar_header_right dax_calendar_header_right_down";
};
this.HeaderRight.onmouseup=function(){
this.className="dax_calendar_header_right dax_calendar_header_right_over";
};
this.HeaderLeftYear.onclick=function(_1c){
xpEvent(_1c,true);
this.parent.prevYear();
return false;
};
this.HeaderLeftYear.onmouseover=function(){
this.className="dax_calendar_header_left dax_calendar_header_left_year_over";
};
this.HeaderLeftYear.onmouseout=function(){
this.className="dax_calendar_header_left dax_calendar_header_left_year_normal";
};
this.HeaderLeftYear.onmousedown=function(){
this.className="dax_calendar_header_left dax_calendar_header_left_year_down";
};
this.HeaderLeftYear.onmouseup=function(){
this.className="dax_calendar_header_left dax_calendar_header_left_year_over";
};
this.HeaderRightYear.onclick=function(_1d){
xpEvent(_1d,true);
this.parent.nextYear();
return false;
};
this.HeaderRightYear.onmouseover=function(){
this.className="dax_calendar_header_right dax_calendar_header_right_year_over";
};
this.HeaderRightYear.onmouseout=function(){
this.className="dax_calendar_header_right dax_calendar_header_right_year_normal";
};
this.HeaderRightYear.onmousedown=function(){
this.className="dax_calendar_header_right dax_calendar_header_right_year_down";
};
this.HeaderRightYear.onmouseup=function(){
this.className="dax_calendar_header_right dax_calendar_header_right_year_over";
};
var _1e=this.calGridObj.grid;
for(i=0;i<7;i++){
_1e.column(i).prv.mMinimumWidth=25;
}
_1e.setColumnWidth(this.columnWidth);
var _1f=this.calGridObj.viewport;
this.viewport=_1f;
setStyle(this.viewport.dom,"width","100%");
_1f.vscrollbar.hide();
_1f.hscrollbar.hide();
_1f.setOverflow(0,0);
var _20=new Array;
_20=buildCalendarArray(this.month,this.year);
if(this.weekStart=="Mon"){
var _21=_20.shift();
if(parseInt(_21)==1){
var _22=_20.unshift(" "," "," "," "," "," ","01");
_20.length=6*7;
}
}
var _23=new Array(6);
for(i=0;i<6;i++){
_23[i]=new Array(7);
}
var _24=0;
for(i=0;i<_20.length;i++){
_23[_24][(i%7)]=_20[i];
if(((i%7)==6)&&(i<_20.length)){
_23[_24][(i%7)]=_20[i];
_24++;
}
}
this.calGridObj.load(_23);
_1e.size(7,6);
_1e.setColumnWidth(this.columnWidth);
_1e.refresh();
for(i=0;i<7;i++){
var _25=_1e.column(i).prv.mHeader;
if(this.weekStart=="Sun"){
_25.setContent(STR["calendar_weekday"][i]);
}else{
if(this.weekStart=="Mon"){
if(i==6){
_25.setContent(STR["calendar_weekday"][0]);
}else{
_25.setContent(STR["calendar_weekday"][i+1]);
}
}
}
_25.prv.mDOM.onmouseover="";
_25.prv.mDOM.onmouseout="";
_25.prv.mDOM.onclick="";
_25.prv.mDOM.onmouseup="";
_25.prv.mDOM.onmousedown="";
}
for(i=0;i<_1e.prv.mRows.length;i++){
row=_1e.prv.mRows[i].prv.mDOM;
row.onmouseover="";
row.onmouseout="";
row.onclick="";
for(j=0;j<_1e.prv.mRows[i].prv.mElements.length;j++){
cell=_1e.prv.mRows[i].prv.mElements[j].prv.mDOM;
setStyle(cell,"height",this.cellHeight+"px");
cell.style.backgroundColor="#FFFFFF";
if((cell.innerHTML!="")&&(cell.innerHTML!=" ")){
cell.parent=this;
cell.date=cell.innerHTML;
if(cell.innerHTML==this.date){
cell.style.backgroundColor="#FFCC66";
cell.id="dax_calendar"+this.idNumber+"_selected";
}else{
cell.style.backgroundColor="#FFFFFF";
cell.id="";
}
cell.onmouseout=function(){
if(this.id=="dax_calendar"+this.parent.idNumber+"_selected"){
this.style.backgroundColor="#FFCC66";
}else{
this.style.backgroundColor="#FFFFFF";
}
};
cell.onmouseover=function(){
this.style.backgroundColor="#DDDDDD";
};
if(this.kind=="picker"){
cell.onclick=function(){
selected=$("dax_calendar"+this.parent.idNumber+"_selected");
if(selected!=null){
selected.style.backgroundColor="#FFFFFF";
selected.id="";
}
this.id="dax_calendar"+this.parent.idNumber+"_selected";
this.style.backgroundColor="#FFCC66";
this.parent.date=this.innerHTML;
this.parent.actionTarget.value=this.parent.getDate();
this.parent.actionTarget.realDate=this.parent.getDate();
this.parent.parent.style.display="none";
this.parent.parent.style.top="-1000px";
this.parent.parent.style.left="-1000px";
var _26=this.parent.parent.owner.value;
if((_26)&&(_26.onchange)){
_26.onchange(true);
}
Controller.setFocused(this.parent);
this.parent.parent.owner.onUserClick();
};
}else{
cell.onclick=function(){
selected=$("dax_calendar"+this.parent.idNumber+"_selected");
if(selected!=null){
selected.style.backgroundColor="#FFFFFF";
selected.id="";
}
this.id="dax_calendar"+this.parent.idNumber+"_selected";
this.style.backgroundColor="#FFCC66";
this.parent.date=this.innerHTML;
Controller.setFocused(this.parent);
};
}
}else{
cell.date="";
cell.onmouseout="";
cell.onmouseover="";
cell.onclick="";
}
cell.style.textAlign="center";
cell.style.fontSize="12px";
}
}
this.afterRefresh();
function initDaysOfWeek(_27){
if(_27=="fr"){
var _28=new Array("Dim","Lun","Mar","Mer","Jeu","Ven","Sam");
}else{
if(_27=="de"){
var _28=new Array("So","Mo","Di","Mi","Do","Fr","Sa");
}else{
if(_27=="es"){
var _28=new Array("Dom","Lun","Mar","Mi?r","Jue","Vi?r","S?b");
}else{
var _28=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
}
}
}
return _28;
}
function initMonths(_29){
if(_29=="fr"){
var _2a=new Array("Janvier","F?vrier","Mars","Avril","Mai","Juin","Juillet","Ao?t","Septembre","Octobre","Novembre","D?cembre");
}else{
if(_29=="de"){
var _2a=new Array("Januar","Februar","M?rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember");
}else{
if(_29=="es"){
var _2a=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
}else{
var _2a=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
}
}
}
return _2a;
}
function buildCalendarArray(m,y){
var _2d=new Array;
var _2e=[31,0,31,30,31,30,31,31,30,31,30,31];
var oD=new Date(y,m-1,1);
oD.od=oD.getDay()+1;
var _30=new Date();
var _31=(y==_30.getFullYear()&&m==_30.getMonth()+1)?_30.getDate():0;
_2e[1]=(((oD.getFullYear()%100!=0)&&(oD.getFullYear()%4==0))||(oD.getFullYear()%400==0))?29:28;
for(i=1;i<=42;i++){
var x=((i-oD.od>=0)&&(i-oD.od<_2e[m-1]))?i-oD.od+1:" ";
_2d.push(x);
}
return _2d;
}
};
function selectDate(_33){
for(i=0;i<calGrid.prv.mRows.length;i++){
for(j=0;j<calGrid.prv.mRows[i].prv.mElements.length;j++){
cell=calGrid.prv.mRows[i].prv.mElements[j].prv.mDOM;
if(cell.innerHTML==_33){
selected=$("calendar_selected");
if(selected!=null){
setStyle(selected,"background-color","#FFFFFF");
selected.id="";
}
cell.id="calendar_selected";
cell.style.backgroundColor="#FFCC66";
}
}
}
}
}
function PickerObject(_34){
var _35=getTemplate("dax_picker");
var _36=getTemplate("dax_picker_popup");
if(!_35){
return null;
}
this.dom=_35.cloneNode(true);
this.value=getElementByClassName(this.dom,"dax_picker_value");
this.button=getElementByClassName(this.dom,"dax_picker_button");
this.pickerimage=getElementByClassName(this.dom,"dax_picker_button_image");
if(!_34){
var _34=30;
}
this.value.onmousedown=function(_37){
xpEvent(_37,true);
};
this.value.onmouseup=function(_38){
xpEvent(_38,true);
};
this.onUserClick=function(){
};
if(!($("dax_picker_popup0"))){
this.calendarDiv=_36.cloneNode(true);
document.body.appendChild(this.calendarDiv);
this.calendarDiv.id="dax_picker_popup0";
this.calendarDiv.owner=this;
this.calendar=new CalendarObject(_34,"picker",this.value,this.calendarDiv);
this.calendarDiv.appendChild(this.calendar.dom);
this.calendar.parentWindow=this.calendarDiv;
this.calendar.drawCalendar();
this.calendarDiv.calendar=this.calendar;
this.calendarDiv.style.display="none";
this.calendar.value=this.calendar.getDate();
}else{
this.calendarDiv=$("dax_picker_popup0");
this.calendarDiv.owner=this;
this.calendar=this.calendarDiv.calendar;
}
setStyle(this.dom,"display","block");
i=1;
while($("dax_picker"+i)!=null){
i++;
}
this.idNumber=i;
this.dom.id="dax_picker"+this.idNumber;
this.value.id="dax_picker_value"+this.idNumber;
this.isDisabled=false;
this.button.parent=this;
this.button.onclick=function(_39){
if(this.parent.isDisabled){
return false;
}
this.parent.calendarDiv.owner=this.parent;
this.parent.calendar.actionTarget=this.parent.value;
if(this.parent.value.realDate!=undefined){
this.parent.setValue(this.parent.value.realDate);
}else{
this.parent.setValue(this.parent.calendar.getToday());
}
var _3a=xpEvent(_39,true);
var _3b=getMousePosition(_3a);
this.parent.calendarDiv.style.position="absolute";
setStyle(this.parent.calendarDiv,"left",_3b.x+"px");
setStyle(this.parent.calendarDiv,"top",_3b.y+"px");
this.parent.calendarDiv.style.display="block";
if(browser.ie){
this.parent.calendar.calGridObj.grid.setColumnWidth(this.parent.calendar.columnWidth);
this.parent.calendar.calGridObj.grid.refresh();
this.parent.calendar.calGridObj.viewport.dom.style.width="100%";
this.parent.calendarDiv.style.width="246px";
}
if(browser.gecko){
this.parent.calendar.calGridObj.viewport.dom.style.height="200px";
this.parent.calendar.calGridObj.viewport.dom.style.width="246px";
this.parent.calendar.calGridObj.grid.size(7,6);
this.parent.calendar.calGridObj.grid.header.style.backgroundColor="#FFFFFF";
this.parent.calendar.header.style.width="231px";
}
if(browser.safari){
setStyle(this.parent.calendarDiv,"width",250+"px");
this.parent.calendar.calGridObj.grid.setColumnWidth(this.parent.calendar.columnWidth);
this.parent.calendar.calGridObj.grid.refresh();
this.parent.calendar.calGridObj.viewport.dom.style.width="100%";
this.parent.calendar.calGridObj.viewport.dom.style.height="200px";
this.parent.calendar.calGridObj.viewport.dom.style.width="246px";
this.parent.calendar.calGridObj.grid.size(7,6);
this.parent.calendar.calGridObj.grid.header.style.backgroundColor="#FFFFFF";
this.parent.calendar.header.style.width="238px";
}
this.parent.calendarDiv.blur=function(){
this.style.top="-1000px";
this.style.left="-1000px";
this.style.position="absolute";
this.style.display="none";
};
Controller.setFocused(this.parent.calendarDiv);
return false;
};
this.getValue=function(_3c){
return this.value.realDate;
};
this.setValue=function(_3d){
this.calendar.setDate(_3d);
};
}
function calendarView(_3e,_3f,_40,_41,_42,_43,_44,_45){
this.loaded=false;
this.headerNode=getTemplate("calendar_view_cell_header");
this.bodyNode=getTemplate("calendar_view_cell_body");
this.cellNode=getTemplate("calendar_view_cell_record");
this.searchNode=getTemplate("calendar_view_search");
this.extendNode=getTemplate("calendar_view_extend");
this.calendarViewNode=null;
if((!this.headerNode)||(!this.cellNode)||(!this.bodyNode)||(!this.searchNode)||(!this.extendNode)){
return false;
}
this.preloaded=false;
this.table=null;
this.table=getTable(_3f);
if(!this.table){
return false;
}
dax_bridge.cacheFields(this.table);
this.searchTimeout=null;
if(!_40){
for(i=0;i<this.table.fields.length;i++){
if(this.table.fields[i].fieldtype=="date"){
var _40=this.table.fields[i].fieldid;
break;
}
}
}
this.dateField=null;
this.dateField=getField(_3f,_40);
if(!this.dateField){
return false;
}
if(this.dateField.fieldtype!="date"){
return false;
}
this.dateEndField=null;
if(_41){
this.dateEndField=getField(_3f,_41);
}
if(this.dateEndField){
if(this.dateEndField.fieldtype!="date"){
return false;
}
if(this.dateField.fieldid==this.dateEndField.fieldid){
this.dateEndField=null;
}
}
if(!_42){
for(var i=0;i<this.table.fields.length;i++){
if((this.table.fields[i].fieldtype!="picture")&&(this.table.fields[i].fieldinlist.toLowerCase()=="true")){
var _42=this.table.fields[i].fieldid;
break;
}
}
}
this.updating=false;
this.displayField=null;
this.displayField=getField(_3f,_42);
if(!this.displayField){
return false;
}
this.searchField=getField(_3f,_42);
this.updatingTabsFieldId=null;
this.displayAux1Field=null;
this.displayAux1Field=getField(_3f,_43);
if((_44)&&(_45)){
this.customQueryField=getField(_3f,_44);
if(this.customQueryField){
this.customQueryValue=_45;
}
}
this.queryName=null;
this.initializing=true;
this.onRecordClick=function(){
};
this.onRecordDblClick=function(){
};
this.blankValue="---";
this.setBlankValue=function(_47){
if(_47){
this.blankValue=_47;
}
};
this.setTitle=function(_48){
if(_48){
if(this.container.titleBar){
this.container.titleBar.innerHTML=_48;
}
}
};
this.setWeekStart=function(_49){
this.calendar.setWeekStart(_49);
this.calendar.drawCalendar();
this.calendar.refresh();
this.refresh();
};
this.displayBullets=true;
this.showBullets=function(_4a){
if((_4a)&&(_4a==false)){
this.displayBullets=true;
}else{
this.displayBullets=false;
}
};
this.fetchData=function(_4b,_4c,_4d,_4e){
if(_4d==true){
this.eraseOnQueryDone=true;
}else{
this.eraseOnQueryDone=false;
}
queryField=getField(this.table.tableid,_4b);
if(!((queryField)&&(_4c))){
return false;
}
this.customQueryField=queryField;
this.customQueryValue=_4c;
if(_4e){
if(_4e==true){
var _4f=getElementByClassName(this.search,"fieldSearchSelect");
var _50=null;
var _4b=getField(this.table.tableid,_4b).fieldid;
for(var ind=0;ind<_4f.options.length;ind++){
if(_4f.options[ind].fieldid==_4b){
_50=ind;
break;
}
}
if((_50)||(_50==0)){
_4f.selectedIndex=_50;
_4f.onchange();
}
this.searchBox.value=_4c;
}
}
this.refresh();
};
this.eraseOnQueryDone=false;
this.currentQuery=null;
this.selectMultipleRecords=false;
this.selectMultiple=function(sel){
if((sel)&&(sel==true)){
this.selectMultipleRecords=true;
}else{
this.selectMultipleRecords=false;
}
};
this.calendar=new CalendarObject(50,null,null,null);
this.calendar.dom.className=this.calendar.dom.className+" calendar_view";
if(_3e){
var _53=getTemplate("calendar_view_cont");
if(!_53){
return false;
}
this.calendarViewNode=_53.cloneNode(true);
i=1;
while($("calendar_view_cont"+i)!=null){
i++;
}
this.calendarViewNode.id="calendar_view_cont"+i;
this.container=_3e;
this.container.appendChild(this.calendarViewNode);
this.parent=getElementByClassName(this.calendarViewNode,"calendar_view_contents");
this.parent.appendChild(this.calendar.dom);
if((!(browser.ie))||(!(this.container.style.width))){
setStyle(this.parent,"width",this.container.offsetWidth+"px");
}else{
setStyle(this.parent,"width",this.container.style.width);
}
this.displayType="container";
}else{
var _54=WindowManager.createNewWindow();
_54.titleBar.innerHTML=this.table.tablealias;
var _55=new Tabs();
if((this.table.showallrecordstab.toLowerCase()=="true")||((this.table.preselectQueries.length==0)&&(this.table.preselectedDynamicQueries.length==0))){
var tab=_55.insert(STR["all"]+" "+_54.titleBar.innerHTML);
tab.owner=this;
_55.dom.className="tabs_tb";
tab.firstTab=true;
tab.queryId=null;
tab.queryName=null;
tab.onswitch=function(){
this.owner.queryName=null;
this.owner.refresh();
};
tab.tooltip="";
this.currentTab=tab;
}
for(var _57=0;_57<this.table.preselectQueries.length;_57++){
var tab=_55.insert(this.table.preselectQueries[_57].name);
tab.owner=this;
_55.dom.className="tabs_tb";
tab.firstTab=false;
tab.queryId=null;
tab.queryName=this.table.preselectQueries[_57].name;
tab.onswitch=function(){
this.owner.queryName=this.queryName;
this.owner.refresh();
};
tab.tooltip="";
if(!this.currentTab){
this.currentTab=tab;
}
}
_55.activateById(0);
this.tabsbar=_55;
_54.contentArea.appendChild(this.calendar.dom);
_54.activate();
_54.open();
_54.closeBox.onmouseup=function(_58){
WindowManager.hideWindow(this.parent);
window.clearTimeout(this.parent.boundTo.refreshTimeout);
window.clearTimeout(this.parent.boundTo.dynamicTabId);
this.parent.tbitem.dom.style.display="none";
return false;
};
_54.tableId=this.table.tableid;
_54.status.style.height="19px";
_54.size(726,500);
_54.minimumWidth=726;
_54.minimumHeight=500;
_54.logo.className="window_logo_calendar";
this.displayType="window";
this.parent=_54.contentArea;
this.container=_54;
_54.boundTo=this;
_54.onsize=function(){
this.boundTo.calendar.refresh();
this.boundTo.resizing=true;
};
_54.onsizestop=function(){
this.boundTo.calendar.afterRefresh();
this.boundTo.resizing=false;
this.boundTo.tabsbar.refresh();
};
if(taskbar){
var ti=new taskbarItem(taskbar);
ti.setLabel(_54.titleBar.innerHTML);
ti.setIcon("calendar");
setStyle(ti.dom,"display","block");
var _5a=_54;
ti.dom.onclick=function(){
this.parent.setSelected(true,true);
_5a.activate();
};
ti.setSelected(true,true);
ti.parent.refresh();
_54.tbitem=ti;
}
_54.refreshBox.boundTo=this;
_54.refreshBox.onmouseup=function(_5b){
var _5b=xpEvent(_5b,true);
this.className="window_refreshbox";
this.boundTo.refresh();
return false;
};
_54.onclose=function(){
if(this.tbitem){
this.tbitem.remove();
}
if(this.editor){
this.editor.destroy();
}
};
}
this.updateDynamicQueryTabs=function(){
if(this.table){
if(this.table.preselectedDynamicQueries){
if(this.table.preselectedDynamicQueries.length>0){
for(var _5c=0;_5c<this.table.preselectedDynamicQueries.length;_5c++){
if(this.table.preselectedDynamicQueries[_5c].fieldId.indexOf("][")!=-1){
var url=dax_bridge.url+"GetUniqueQueries?sessionId="+dax_bridge.sessionId+"&tableid="+this.table.tableid+"&fieldid="+this.table.preselectedDynamicQueries[_5c].fieldId;
makeCall(url,this.updateDynamicQueryTabs_handler,this);
}
}
}
}
}
};
this.updateDynamicQueryTabs_handler=function(_5e,_5f){
if(_5e.readyState!=4){
return;
}
var _60=checkResponse(_5e);
if(_60){
return;
}
var _61=_5e.responseXML.getElementsByTagName("queries").item(0);
var _62=_61?_61.getElementsByTagName("query"):null;
var _63=_61.getAttribute("fieldid");
if(!_62){
return;
}
if(_62.length==0){
return;
}
if(_5f.updatingTabsFieldId){
if(_5f.updatingTabsFieldId==_63){
return;
}else{
setTimeout(function(){
DataWindowPartThree_updateDynamicQueryTabs_handler(_5e,_5f);
},1000);
return;
}
}else{
_5f.updatingTabsFieldId=_63;
}
for(var _64=0;_64<_5f.tabsbar.tabs.length;_64++){
_5f.tabsbar.tabs[_64].keepTab=false;
}
for(qnCount=0;qnCount<_62.length;qnCount++){
var _65=_62.item(qnCount).getAttribute("name");
if(_65){
if(_65!="4daf_unique_"){
var _66=false;
for(var _64=0;_64<_5f.tabsbar.tabs.length;_64++){
if(_5f.tabsbar.tabs[_64].queryName==_65){
var _66=true;
_5f.tabsbar.tabs[_64].keepTab=true;
}
}
if(!_66){
var _67=_5f.tabsbar;
var tab=_67.insert(_65.substr(12));
tab.owner=_5f;
_67.dom.className="tabs_tb";
tab.firstTab=false;
tab.queryId=null;
tab.queryName=_65;
tab.keepTab=true;
tab.onswitch=function(){
this.owner.queryName=this.queryName;
this.owner.refresh();
};
tab.tooltip="";
}
}
}
}
var _69=new Array();
for(var _64=0;_64<_5f.tabsbar.tabs.length;_64++){
if(!_5f.tabsbar.tabs[_64].firstTab){
if((!_5f.tabsbar.tabs[_64].keepTab)&&(_5f.tabsbar.tabs[_64].queryName)){
if((_5f.tabsbar.tabs[_64].queryName.indexOf("4daf_unique_")!=-1)&&(_5f.tabsbar.tabs[_64].fieldId==_63)){
_69.push(_5f.tabsbar.tabs[_64]);
}
}
}
}
if(_69){
if(_69.length>0){
for(var _64=0;_64<_69.length;_64++){
var _6a=false;
if(_5f.currentTab=_69[_64]){
_6a=true;
}
_5f.tabsbar.remove(_69[_64].index);
if(_6a){
_5f.currentTab=null;
}
}
}
}
if(_5f.currentTab){
_5f.tabsbar.activate(_5f.currentTab);
}else{
_5f.currentTab=_5f.tabsbar.tabs[0];
_5f.currentTab.dom.onclick();
}
if(_5f.initialize==true){
_5f.initialize=false;
if(_5f.tabsbar.tab[0]){
_5f.tabsbar.tab[0].dom.onclick();
}
}
_5f.updatingTabsFieldId=null;
};
this.refreshDynamicTabs=function(){
if(this.dynamicTabId){
clearTimeout(this.dynamicTabId);
}
this.updateDynamicQueryTabs();
var _6b=this;
this.dynamicTabId=setTimeout(function(){
_6b.refreshDynamicTabs();
},60*3*1000);
};
this.getEditor=function(){
if(this.editor){
return this.editor;
}
this.editor=new Editor();
var dom=this.editor.getDOM();
dom.style.zIndex=++WindowManager.maxZIndex;
if(this.displayType=="window"){
this.container.dom.m.insertBefore(dom,this.container.toolbar);
var _6d=(this.container.dom.offsetWidth/2)-(this.container.dom.offsetWidth/2);
}else{
this.container.insertBefore(dom,this.calendarViewNode);
var _6d=(this.container.offsetWidth/2)-(this.container.offsetWidth/2);
}
setStyle(dom,"position","absolute");
setStyle(dom,"left",_6d+"px");
this.editor.owner=this;
var _6e=this;
this.editor.onaftersave=function(){
this.owner.refresh();
};
this.editor.onafterdelete=function(){
this.owner.refresh();
this.getTearAway().contract(1,50);
this.destroy();
};
dom.ondragstop=function(_6f){
this.className="tearaway_torn";
var _70=this.owner;
if(browser.ie){
this.top.t.style.fontSize="1pt";
this.top.tl.style.fontSize="1pt";
this.top.tr.style.fontSize="1pt";
this.top.style.fontSize="1pt";
}
if(_70.owner){
var _71=_70.owner.container;
if(!_71.editor){
return false;
}
var dom=_70.getDOM();
var pos=getObjectPosition(this);
if(taskbar){
var ti=new taskbarItem(taskbar);
i=1;
while($("dax_taskbar_button"+_71.titleBar.innerHTML+i)!=null){
i++;
}
ti.dom.id="dax_taskbar_button"+_71.titleBar.innerHTML+i;
ti.setLabel("Edit "+_71.titleBar.innerHTML+" "+i);
ti.setIcon("editor");
var ref=this;
ti.dom.onclick=function(){
this.parent.setSelected(true,true);
ref.onclick();
};
setStyle(ti.dom,"display","block");
ti.setSelected(true,true);
ti.parent.refresh();
}
dom.cancelBtn.onclick=function(_76){
if(ti){
ti.remove();
}
document.body.removeChild(this.parent.prv.mDOM);
this.parent.destroy();
delete this.parent;
};
this.onclick=function(_77){
if(WindowManager.active){
WindowManager.active.deactivate();
}
setStyle(this,"zIndex",++WindowManager.maxZIndex);
if(ti){
ti.setSelected(true,true);
}
};
if(this.owner.owner.displayType=="window"){
_71.deactivate();
}
this.owner.owner.editor=null;
document.body.insertBefore(this,null);
setStyle(this,"left",pos.x+"px");
setStyle(this,"top",pos.y+"px");
}
};
return this.editor;
};
this.toolbar=new Toolbar();
if(this.toolbar){
this.toolbar.prv.mDOM.className="toolbar calendar_view_toolbar";
var _78=this.toolbar.addButton("<div class=\"datacore_addrecord\"></div>");
_78.boundTo=this;
this.createButton=_78;
_78.onclick=function(){
if(this.boundTo.table.fieldsDetail.length==0){
return false;
}
if(this.boundTo.editor){
this.boundTo.editor.destroy();
}
var _79=this.boundTo.getEditor();
_79.record={recordId:-1,tableId:this.boundTo.table.tableid};
_79.buildEditorByTable(this.boundTo.table.tableid);
_79.clear();
var _7a=this.boundTo.calendar.getToday();
_79.edit();
};
var _7b=this.toolbar.addButton("<div class=\"datacore_deleterecord\"></div>");
_7b.boundTo=this;
this.deleteButton=_7b;
_7b.onclick=function(){
var _7c="";
for(var k in this.boundTo.recordsMap){
if(this.boundTo.recordsMap[k].selected==true){
if(_7c){
_7c+=","+k;
}else{
_7c=k;
}
}
}
if(_7c){
var _7e=confirm(STR["confirm_delete_records"]);
if(!_7e){
return;
}
url=dax_bridge.url+"deleteRecord?sessionId="+dax_bridge.sessionId+"&recordId="+_7c+"&tableId="+this.boundTo.table.tableid;
makeCall(url,this.boundTo.onDelete,this.boundTo);
}
};
this.onDelete=function(_7f,_80){
if(_7f.readyState!=4){
return;
}
var _81=checkResponse(_7f);
_80.refresh();
};
if(_54){
_54.addToolbar(this.toolbar.prv.mDOM);
_54.resizeToolbar(false);
_54.addToolbar(_55.dom);
}else{
var _82=getElementByClassName(this.container,"calendar_view_toolbar");
if(_82){
_82.appendChild(this.toolbar.prv.mDOM);
setStyle(this.parent,"height",this.container.offsetHeight-this.toolbar.prv.mDOM.offsetHeight+"px");
setStyle(_82,"width",this.container.offsetWidth+"px");
}else{
setStyle(this.parent,"height",this.container.offsetHeight+"px");
}
}
var _83=getTemplate("spinner").cloneNode(true);
setStyle(_83,"display","block");
this.toolbar.addContent(_83);
this.toolbar.spinner=_83;
i=1;
while($("spinner"+i)!=null){
i++;
}
_83.id="spinner"+i;
this.search=this.searchNode.cloneNode(true);
this.calendar.header.insertBefore(this.search,getElementByClassName(this.calendar.header,"dax_calendar_header_text"));
this.searchBox=getElementByClassName(this.search,"calendar_view_search_box");
setStyle(this.search,"display","block");
i=1;
while($("calendar_view_search"+i)!=null){
i++;
}
this.search.id="calendar_view_search"+i;
this.searchBox.owner=this;
this.searchBox.onkeyup=function(_84){
var _85=this.owner;
if(_85.searchTimeout){
window.clearTimeout(_85.searchTimeout);
}
_85.searchTimeout=window.setTimeout(function(){
_85.refresh(_85);
},1000);
};
this.displayFieldNode=getTemplate("calendar_view_display_field").cloneNode(true);
if(this.displayFieldNode){
setStyle(this.displayFieldNode,"display","block");
this.toolbar.addContent(this.displayFieldNode);
i=1;
while($("calendar_view_display_field"+i)!=null){
i++;
}
this.displayFieldNode.id="calendar_view_display_field"+i;
getElementByClassName(this.displayFieldNode,"label_range",true).innerHTML=STR["calendar_toolbar_range"];
getElementByClassName(this.displayFieldNode,"label_to",true).innerHTML=STR["calendar_toolbar_to"];
getElementByClassName(this.displayFieldNode,"label_display",true).innerHTML=STR["calendar_toolbar_display"];
var _86=getElementsByClassName(this.displayFieldNode,"searchOptGroup");
for(k=0;k<_86.length;k++){
_86[k].label=STR["fields"];
}
this.displayFieldNodeRefresh=function(){
var _87=getElementByClassName(this.displayFieldNode,"fieldDisplayOption");
var _88=_87.parentNode;
var _89=getElementByClassName(this.displayFieldNode,"fieldDisplaySelect");
var _8a=0;
var _8b=0;
var _8c=getElementByClassName(this.displayFieldNode,"fieldAux1DisplayOption");
var _8d=_8c.parentNode;
var _8e=getElementByClassName(this.displayFieldNode,"fieldAux1DisplaySelect");
var _8f=getElementByClassName(this.displayFieldNode,"fieldRangeStartOption");
var _90=_8f.parentNode;
var _91=getElementByClassName(this.displayFieldNode,"fieldRangeStartSelect");
var _92=0;
var _93=getElementByClassName(this.displayFieldNode,"fieldRangeEndOption");
var _94=_93.parentNode;
var _95=getElementByClassName(this.displayFieldNode,"fieldRangeEndSelect");
var _96=0;
var _97=getElementByClassName(this.search,"fieldSearchOption");
var _98=_97.parentNode;
var _99=getElementByClassName(this.search,"fieldSearchSelect");
var _9a=false;
var _9b=false;
for(var k in this.table.fields){
if((this.table.fields[k].fieldtype==STR["type_date"])&&(this.table.fields[k].fieldinlist.toLowerCase()=="true")){
if(_92>0){
_8f=_8f.cloneNode(true);
}else{
_91.fieldid=this.table.fields[k].fieldid;
}
_8f.parent=_91;
_8f.innerHTML=this.table.fields[k].fieldalias;
_8f.fieldid=this.table.fields[k].fieldid;
_91.boundTo=this;
_91.endSelect=_95;
_91.onchange=function(){
this.boundTo.dateField=getField(this.boundTo.table.tableid,this.options[this.selectedIndex].fieldid);
if(this.boundTo.dateEndField){
if(this.boundTo.dateField.fieldid==this.boundTo.dateEndField.fieldid){
this.endSelect.selectedIndex=0;
this.boundTo.dateEndField=null;
}
}
var _9d=this.options[this.selectedIndex].fieldid;
for(i=0;i<this.endSelect.options.length;i++){
if(this.endSelect.options[i].fieldid==_9d){
setStyle(this.endSelect.options[i],"display","none");
}else{
setStyle(this.endSelect.options[i],"display","block");
}
}
this.boundTo.refresh();
};
_90.appendChild(_8f);
if(this.table.fields[k].fieldid==this.dateField.fieldid){
_8f.selected=true;
}
_92++;
if(true){
if(_96>0){
_93=_93.cloneNode(true);
}else{
_95.fieldid=this.table.fields[k].fieldid;
_93.parent=_95;
_93.innerHTML=STR["calendar_toolbar_none"];
_93.fieldid=null;
_95.boundTo=this;
_95.onchange=function(){
this.boundTo.dateEndField=getField(this.boundTo.table.tableid,this.options[this.selectedIndex].fieldid);
this.boundTo.refresh();
};
_94.appendChild(_93);
_96++;
_93=_93.cloneNode(true);
}
_93.parent=_95;
_93.innerHTML=this.table.fields[k].fieldalias;
_93.fieldid=this.table.fields[k].fieldid;
_93.onclick=function(){
_95.fieldid=this.fieldid;
};
_94.appendChild(_93);
if(this.dateEndField){
if(this.table.fields[k].fieldid==this.dateEndField.fieldid){
_93.selected=true;
}
}
if(this.table.fields[k].fieldid==this.dateField.fieldid){
setStyle(_93,"display","none");
}else{
setStyle(_93,"display","block");
}
}
}
if(((this.table.fields[k].fieldtype==STR["type_alpha"])||(this.table.fields[k].fieldtype==STR["type_text"])||(this.table.fields[k].fieldtype==STR["type_real"])||(this.table.fields[k].fieldtype==STR["type_longint"])||(this.table.fields[k].fieldtype==STR["type_integer"])||(this.table.fields[k].fieldtype==STR["type_boolean"])||(this.table.fields[k].fieldtype==STR["type_date"])||(this.table.fields[k].fieldtype==STR["type_time"]))&&(this.table.fields[k].fieldinlist.toLowerCase()=="true")){
if(_8a>0){
_87=_87.cloneNode(true);
_8c=_87.cloneNode(true);
}else{
_89.fieldid=this.table.fields[k].fieldid;
_8e.fieldid=null;
_8c.parent=_8e;
_8c.innerHTML=STR["calendar_toolbar_none"];
_8c.fieldid=null;
_8e.boundTo=this;
_8e.onchange=function(){
this.boundTo.displayAux1Field=null;
this.boundTo.refresh();
};
_8d.appendChild(_8c);
_8c=_87.cloneNode(true);
}
_87.innerHTML=this.table.fields[k].fieldalias;
_87.parent=_89;
_87.fieldid=this.table.fields[k].fieldid;
_89.boundTo=this;
_89.onchange=function(){
this.boundTo.displayField=getField(this.boundTo.table.tableid,this.options[this.selectedIndex].fieldid);
this.boundTo.refresh();
};
_88.appendChild(_87);
if(this.table.fields[k].fieldid==this.displayField.fieldid){
_87.selected=true;
}
_8c.parent=_8e;
_8c.innerHTML=this.table.fields[k].fieldalias;
_8c.fieldid=this.table.fields[k].fieldid;
_8e.boundTo=this;
_8e.onchange=function(){
this.boundTo.displayAux1Field=getField(this.boundTo.table.tableid,this.options[this.selectedIndex].fieldid);
this.boundTo.refresh();
};
_8d.appendChild(_8c);
if(this.table.fields[k].fieldsearchable.toLowerCase()=="true"){
if(_8b>0){
_97=_97.cloneNode(true);
}else{
_99.fieldid=this.table.fields[k].fieldid;
}
_97.innerHTML=this.table.fields[k].fieldalias;
_97.parent=_99;
_97.fieldid=this.table.fields[k].fieldid;
_99.boundTo=this;
_99.onchange=function(){
this.boundTo.searchField=getField(this.boundTo.table.tableid,this.options[this.selectedIndex].fieldid);
};
_98.appendChild(_97);
_9a=true;
_8b++;
}
_8a++;
}
}
if(!_9a){
this.search.style.display="none";
}
};
}
this.displayFieldNodeRefresh();
var _9e=this.table;
if((_9e)&&(_9e.ddwOptions)&&(_9e.ddwOptions.length>0)){
var _9f=_9e.ddwOptions[0];
var _a0=this.toolbar.addButton(_9f.title);
_a0.url=_9f.url;
_a0.title=_9f.title;
_a0.owner=this;
if(_9f.type.indexOf("Static")!=-1){
_a0.onclick=function(){
var _a1=new Array();
var _a2=new Array();
if(this.owner.recordsMap){
for(z in this.owner.recordsMap){
if(this.owner.recordsMap[z][0].style.display!="none"){
_a1.push(z);
if(this.owner.recordsMap[z].selected){
_a2.push(z);
}
}
}
}
var _a3=this.owner.table.tableid;
if(_a2.length>0){
new DDW(this.url,"static_url",this.window,"&tableid="+_a3,_a2);
}else{
new DDW(this.url,"static_url",this.window,"&tableid="+_a3,_a1);
}
delete _a2;
delete _a1;
};
}else{
if(_9f.type.indexOf("Dynamic")!=-1){
_a0.onclick=function(){
var _a4=new Array();
var _a5=new Array();
if(this.owner.recordsMap){
for(z in this.owner.recordsMap){
if(this.owner.recordsMap[z][0].style.display!="none"){
_a4.push(z);
if(this.owner.recordsMap[z].selected){
_a5.push(z);
}
}
}
}
var _a6=this.owner.table.tableid;
if(_a5.length>0){
new DDW(this.url,"dynamic_url",this.window,"&tableid="+_a6,_a5);
}else{
new DDW(this.url,"dynamic_url",this.window,"&tableid="+_a6,_a4);
}
delete _a5;
delete _a4;
};
}else{
if(_9f.type.indexOf("Message")!=-1){
_a0.onclick=function(){
var _a7=new Array();
var _a8=new Array();
if(this.owner.recordsMap){
for(z in this.owner.recordsMap){
if(this.owner.recordsMap[z][0].style.display!="none"){
_a7.push(z);
if(this.owner.recordsMap[z].selected){
_a8.push(z);
}
}
}
}
var _a9=this.owner.table.tableid;
if(_a8.length>0){
new DDW(this.url,"message_window",this.owner.container,"&tableid="+_a9,_a8);
}else{
new DDW(this.url,"message_window",this.owner.container,"&tableid="+_a9,_a7);
}
delete _a8;
delete _a7;
};
}
}
}
}
}
if(this.toolbar){
if(this.parent.offsetWidth<800){
setStyle(this.toolbar.prv.mDOM,"width","800px");
}else{
setStyle(this.toolbar.prv.mDOM,"width",this.parent.offsetWidth+"px");
}
}
this.resizing=false;
this.calendar.parentWindow=this.parent;
this.calendar.date=0;
this.calendar.drawCalendar();
this.calendar.refresh();
this.refresh=function(_aa){
if(!_aa){
_aa=this;
}
if(!_aa.initializeCells){
_aa=this.WindowManager.active.boundTo;
}
if(_aa.updating==true){
if(_aa.delayInt){
clearInterval(_aa.delayInt);
}
_aa.delayInt=setInterval(_aa.refresh,1000,_aa);
}else{
if(_aa.delayInt){
clearInterval(_aa.delayInt);
}
_aa.updating=true;
_aa.initializeCells();
if(_aa.initializing){
_aa.initializing=false;
_aa.updating=false;
if(_aa.table.showallrecordstab.toLowerCase()=="true"){
}else{
if(_aa.table.preselectQueries.length>0){
if(_aa.tabsbar.tabs[0]){
_aa.tabsbar.tabs[0].dom.onclick();
}
return true;
}else{
if(_aa.table.preselectedDynamicQueries.length>0){
_aa.initializing=false;
_aa.refreshDynamicTabs();
return true;
}else{
}
}
}
}
_aa.populate(_aa);
}
};
this.grid=this.calendar.calGridObj.grid;
this.extendDiv=this.extendNode.cloneNode(true);
this.grid.body.appendChild(this.extendDiv);
i=1;
while($("calendar_view_extend"+i)!=null){
i++;
}
this.extendDiv.id="calendar_view_extend"+i;
this.extendDiv.cellOrigin=null;
this.extendDiv.cellChild=null;
this.extendDiv.hide=function(){
if(!this.extended){
return;
}
setStyle(this,"display","none");
this.cellOrigin.appendChild(this.cellChild);
this.cellOrigin.extended=false;
for(i=0;i<this.cellOrigin.records.length;i++){
if(this.cellOrigin.records[i].showValue){
this.cellOrigin.records[i].m.value.innerHTML=this.cellOrigin.records[i].value;
}else{
this.cellOrigin.records[i].m.value.innerHTML="";
}
}
this.cellOrigin=null;
this.cellChild=null;
this.extended=false;
};
this.datePrefix=this.calendar.getDate().substring(0,8);
this.records=new Array();
this.recordsMap=new Array();
this.customize=function(_ab,_ac,_ad){
if(!_ab){
_ab=false;
}
if(!_ac){
_ac=false;
}
if(!_ad){
_ad=false;
}
if((_ab==false)&&(_ac==false)){
this.toolbar.prv.mDOM.style.display="none";
}else{
this.toolbar.prv.mDOM.style.display="block";
if(_ac==true){
this.displayFieldNode.style.display="block";
}else{
this.displayFieldNode.style.display="none";
}
if(_ab==true){
this.createButton.prv.mDOM.style.display="block";
this.deleteButton.prv.mDOM.style.display="block";
}else{
this.createButton.prv.mDOM.style.display="none";
this.deleteButton.prv.mDOM.style.display="none";
}
}
if(_ad==true){
this.search.style.display="block";
}else{
this.search.style.display="none";
}
};
this.calendar.owner=this;
this.calendar.afterRefresh=function(){
if(this.owner.toolbar){
if(this.owner.parent.offsetWidth<800){
setStyle(this.owner.toolbar.prv.mDOM,"width","800px");
}else{
setStyle(this.owner.toolbar.prv.mDOM,"width",this.owner.parent.offsetWidth+"px");
}
}
if(!this.owner.resizing){
if(this.owner.currentQuery){
this.owner.currentQuery.die=true;
this.owner.currentQuery=null;
}
this.owner.dateCell=new Array();
this.owner.records=new Array();
this.owner.recordsMap=new Array();
this.owner.datePrefix=this.owner.calendar.getDate().substring(0,8);
this.owner.initializeCells();
this.owner.populate(this.owner);
}
for(i=0;i<this.owner.grid.prv.mRows.length;i++){
for(j=0;j<this.owner.grid.prv.mRows[i].prv.mElements.length;j++){
var _ae=this.owner.grid.prv.mRows[i].prv.mElements[j].prv.mDOM;
if(_ae.header){
var _af=_ae.offsetHeight-_ae.header.offsetHeight;
setStyle(_ae.body,"height",_af+"px");
setStyle(_ae.header.extend,"display","none");
if((_ae.records)&&(_ae.records.length>0)){
for(k=0;k<_ae.records.length;k++){
var _b0=_ae.records[k].offsetWidth-_ae.records[k].l.offsetWidth-_ae.records[k].r.offsetWidth;
setStyle(_ae.records[k].m,"width",_b0+"px");
if(browser.ie){
_ae.records[k].m.value.style.width=_b0+"px";
}
}
if((_ae.records[0].offsetHeight*(_ae.countElements+1))>_ae.offsetHeight){
setStyle(_ae.header.extend,"display","block");
}
}
}
}
}
};
this.initializeCells=function(){
if(this.toolbar){
setStyle(_83,"visibility","visible");
}
this.dateCell=new Array();
this.records=new Array();
this.recordsMap=new Array();
for(i=0;i<this.grid.prv.mRows.length;i++){
var row=this.grid.prv.mRows[i].prv.mDOM;
for(j=0;j<this.grid.prv.mRows[i].prv.mElements.length;j++){
var _b2=this.grid.prv.mRows[i].prv.mElements[j].prv.mDOM;
if(_b2.date){
if(_b2.date.length==1){
_b2.date="0"+_b2.date;
}
var _b3=this.datePrefix+_b2.date;
this.dateCell[_b3]=_b2;
}
while(_b2.firstChild){
_b2.removeChild(_b2.firstChild);
}
if(_b2.date){
var _b4=this.headerNode.cloneNode(true);
var _b5=this.bodyNode.cloneNode(true);
p=1;
while($("calendar_view_cell_header"+p)!=null){
p++;
}
_b4.id="calendar_view_cell_header"+p;
_b5.id="calendar_view_cell_body"+p;
_b2.appendChild(_b4);
_b2.header=_b4;
_b2.appendChild(_b5);
_b2.body=_b5;
setStyle(_b4,"display","block");
setStyle(_b5,"display","block");
_b2.owner=this;
_b2.header.owner=this;
_b2.header.parent=_b2;
probe(_b4);
_b4.value.innerHTML=_b2.date;
_b2.onmouseout=function(){
this.header.className="calendar_view_cell_header";
this.body.className="calendar_view_cell_body";
if((this.owner.extendDiv.extended)&&(this!=this.owner.extendDiv.cellOrigin)){
this.owner.extendDiv.hide();
}
};
_b2.onmouseover=function(){
this.header.className="calendar_view_cell_header calendar_view_cell_header_selected";
};
_b2.header.ondblclick=function(){
if(this.mouseHover){
return;
}
if(this.owner.table.fieldsDetail.length==0){
return false;
}
var _b6=this.owner.getEditor();
if(isDefined(_b6.record)){
_b6.record.recordId=-1;
}else{
_b6.record={recordId:-1,tableId:this.owner.table.tableid};
_b6.buildEditorByTable(this.owner.table.tableid);
}
_b6.clear();
var _b7=this.owner.datePrefix+this.parent.date;
var _b8=(this.owner.dateField.fieldformat?this.owner.dateField.fieldformat:"d1");
_b6.prv.mInputs[_b6.record.map[this.owner.dateField.fieldid]].prv.mValue=_b7;
_b6.prv.mInputs[_b6.record.map[this.owner.dateField.fieldid]].picker.value.value=doFormat(_b7,null,_b8);
_b6.edit();
};
_b2.onclick="";
_b2.records=new Array();
_b2.showOverflow=false;
_b2.contentsHeight=0;
_b2.countElements=0;
_b2.rowPosition=j;
var _b9=_b2.offsetHeight-_b2.header.offsetHeight;
setStyle(_b2.body,"height",_b9+"px");
setStyle(_b2.header.extend,"display","none");
_b2.header.extend.parent=_b2.header;
_b2.header.extend.onmouseout=function(){
this.className="extend";
this.parent.mouseHover=false;
};
_b2.header.extend.onmouseover=function(){
this.className="extend_over";
this.parent.mouseHover=true;
};
_b2.header.extend.onclick=function(){
aCalendar=this.parent.owner;
aExtend=aCalendar.extendDiv;
aCell=this.parent.parent;
if(aCell.extended){
return;
}
for(i=0;i<aCell.records.length;i++){
if(aCell.records[i].value){
aCell.records[i].m.value.innerHTML=aCell.records[i].value;
}
}
setStyle(aExtend,"top",aCell.offsetTop+aCell.header.offsetHeight-2+"px");
setStyle(aExtend,"left",aCell.offsetLeft-2+"px");
setStyle(aExtend,"display","block");
setStyle(aExtend,"height",(aCell.records[0].offsetHeight*aCell.countElements)+"px");
setStyle(aExtend,"width",aCell.offsetWidth+"px");
aExtend.appendChild(aCell.body);
aExtend.cellChild=aCell.body;
aExtend.cellOrigin=aCell;
aExtend.extended=true;
setStyle(aCell.body,"height",aExtend.offsetHeight+"px");
aCell.extended=true;
};
}
}
}
};
this.populate=function(_ba){
if(_ba.currentQuery){
_ba.currentQuery.die=true;
_ba.currentQuery=null;
}
aQuery=new Query(_ba.table.tableid);
aQuery.formatObject="calendar";
aQuery.batchSize=50;
if(_ba.customQueryValue){
aQuery.queryEngine.field.push(_ba.customQueryField.fieldid);
aQuery.queryEngine.argument.push("equal");
aQuery.queryEngine.value.push(_ba.customQueryValue);
aQuery.queryEngine.andor.push("and");
}
if(_ba.dateEndField){
aQuery.queryEngine.field.push(_ba.dateField.fieldid);
aQuery.queryEngine.argument.push("less");
aQuery.queryEngine.value.push(_ba.datePrefix.substring(0,7)+"-31");
aQuery.queryEngine.andor.push("and");
aQuery.displayFields.push(_ba.dateField.fieldid);
aQuery.queryEngine.field.push(_ba.dateEndField.fieldid);
aQuery.queryEngine.argument.push("greater");
aQuery.queryEngine.value.push(_ba.datePrefix.substring(0,7)+"-01");
aQuery.queryEngine.andor.push("and");
aQuery.displayFields.push(_ba.dateEndField.fieldid);
}else{
aQuery.queryEngine.field.push(_ba.dateField.fieldid);
aQuery.queryEngine.argument.push("equal");
aQuery.queryEngine.value.push(_ba.datePrefix.substring(0,7));
aQuery.queryEngine.andor.push("and");
aQuery.displayFields.push(_ba.dateField.fieldid);
}
if(_ba.searchBox.value){
var _bb=true;
var _bc=_ba.searchBox.value;
if(_ba.searchField.fieldtype=="date"){
var _bc=doFormat(_ba.searchBox.value,_ba.searchField.fieldformat,"YYYY-MM-DD");
if(!_bc){
_bb=false;
}
}
if(_bb){
aQuery.queryEngine.field.push(_ba.searchField.fieldid);
aQuery.queryEngine.argument.push("starts with");
aQuery.queryEngine.value.push(_bc);
aQuery.queryEngine.andor.push("and");
}
}
if(_ba.eraseOnQueryDone){
_ba.customQueryValue=null;
_ba.eraseOnQueryDone=false;
}
aQuery.displayFields.push(_ba.displayField.fieldid);
if(_ba.displayAux1Field){
aQuery.displayFields.push(_ba.displayAux1Field.fieldid);
}
aQuery.queryName=_ba.queryName;
aHandler=_ba.populate_handler;
aCellNode=_ba.cellNode;
aCalendar=_ba;
aCalendar.currentQuery=aQuery;
aQuery.nextBatch(aHandler);
};
this.populate_handler=function(_bd){
if(_bd.readyState!=4){
return;
}
if(!aCalendar.currentQuery){
return;
}
if(checkResponse(_bd)){
return;
}
if(callback_onViewQuery){
_bd=callback_onViewQuery(aQuery.table.tablename,_bd,"calendar");
}
aQuery.parseResult(_bd);
if(aQuery.size>0){
for(i=0;i<aQuery.result.length;i++){
var _be=null;
var _bf=null;
var _c0=null;
var _c1=null;
var ddw=null;
var _c3=null;
for(j=0;j<aQuery.result[i].fields.length;j++){
if(aQuery.result[i].fields[j].id==aCalendar.displayField.fieldid){
var _be=aQuery.result[i].fields[j].value;
var ddw=aQuery.result[i].fields[j].ddw?aQuery.result[i].fields[j].ddw:null;
var _c3=aQuery.result[i].fields[j].ddwtype?aQuery.result[i].fields[j].ddwtype:null;
}
if(aCalendar.displayAux1Field){
if(aQuery.result[i].fields[j].id==aCalendar.displayAux1Field.fieldid){
var _bf=aQuery.result[i].fields[j].value;
}
}
if(aQuery.result[i].fields[j].id==aCalendar.dateField.fieldid){
var _c0=aQuery.result[i].fields[j].originalValue;
}
if(aCalendar.dateEndField){
if(aQuery.result[i].fields[j].id==aCalendar.dateEndField.fieldid){
var _c1=aQuery.result[i].fields[j].originalValue;
}
}
}
if(!_be){
var _be=aCalendar.blankValue;
}
if((_c0)&&(_be)){
var _c4=new Array();
if(!_c1){
_c4.push(_c0);
}else{
var _c5=_c0.split("-");
var _c6=_c1.split("-");
if(_c5[2].length==1){
_c5[2]="0"+_c5[2];
}
var _c7=new Date(_c5[0],(_c5[1]-1),_c5[2]);
if(_c6[2].length==1){
_c6[2]="0"+_c6[2];
}
var _c8=new Date(_c6[0],(_c6[1]-1),_c6[2]);
var _c9=aCalendar.datePrefix.split("-")[1];
var _ca=aCalendar.datePrefix.split("-")[0];
if(_c7>=_c8){
_c4.push(_c0);
}else{
if((_c7.getMonth())!=parseInt(_c9-1)){
_c7.setMonth(parseInt(_c9-1));
_c7.setDate(1);
}
if((_c8.getMonth())!=parseInt(_c9-1)){
_c8.setMonth(parseInt(_c9-1));
_c8.setDate(new Date(_ca,_c9,0).getDate());
}
var _cb=_c8.getDate()-_c7.getDate();
var _cc=_c7.getDate();
if(_cb>0){
for(d=0;d<=_cb;d++){
var _cd=d+_cc;
if(_cd.toString().length==1){
_cd="0"+_cd.toString();
}
var _ce=_ca+"-"+_c9+"-"+_cd;
_c4.push(_ce);
}
}
}
}
if((_c4)&&(_c4.length>0)){
var _cf=0;
if(_c4.length>1){
for(d=0;d<_c4.length;d++){
var _d0=_c4[d];
var _d1=aCalendar.dateCell[_d0.substring(0,10)];
if((_d1.countElements>0)&&(_cf<_d1.countElements)){
_cf=_d1.countElements;
}
}
}
for(d=0;d<_c4.length;d++){
var _d0=_c4[d];
var _d1=aCalendar.dateCell[_d0.substring(0,10)];
if((_d1)&&(_d1.countElements<10)&&(_d0.substring(0,8)==aCalendar.datePrefix)){
if((_c4.length>1)&&(_cf>0)){
var _d2=(_cf-_d1.countElements);
for(f=0;f<_d2;f++){
dummyCell=aCellNode.cloneNode(true);
probe(dummyCell);
_d1.body.appendChild(dummyCell);
var h=0;
while($("calendar_view_cell_record"+h)!=null){
h++;
}
dummyCell.id="calendar_view_cell_record"+h;
setStyle(dummyCell,"display","block");
_d1.countElements++;
}
}
recordCell=aCellNode.cloneNode(true);
probe(recordCell);
_d1.body.appendChild(recordCell);
var h=0;
while($("calendar_view_cell_record"+h)!=null){
h++;
}
recordCell.id="calendar_view_cell_record"+h;
setStyle(recordCell,"display","block");
recordCell.owner=aCalendar;
_d1.records.push(recordCell);
aCalendar.records.push(recordCell);
_d1.countElements++;
var _d4=recordCell.m.value;
if((_c4.length==1)||(d==0)||(_d1.rowPosition==0)){
if(ddw){
aIcon=getTemplate("opens_window_icon").cloneNode(true);
aIcon.style.display="inline";
aId=1;
while($("opens_window_icon"+aId)!=null){
aId++;
}
aIcon.id="opens_window_icon"+aId;
recordCell.m.value.appendChild(aIcon);
}
if(_bf){
_d4.innerHTML+=_be+" "+_bf;
}else{
_d4.innerHTML+=_be;
}
recordCell.showValue=true;
}else{
recordCell.showValue=false;
}
recordCell.boundTo=aCalendar;
recordCell.value=_be+" "+_bf;
if(_bf){
recordCell.value=_be+" "+_bf;
}else{
recordCell.value=_be;
}
recordCell.parent=_d1;
recordCell.ddw=ddw;
recordCell.ddwType=_c3;
recordCell.recordId=aQuery.result[i].recordid;
if(browser.ie){
}
if(!aCalendar.recordsMap[recordCell.recordId]){
aCalendar.recordsMap[recordCell.recordId]=new Array();
aCalendar.recordsMap[recordCell.recordId].selected=false;
}
aCalendar.recordsMap[recordCell.recordId].push(recordCell);
if(!aCalendar.displayBullets){
var _d5=recordCell.m.bullet;
setStyle(_d5,"display","none");
}
if(_c4.length==1){
recordCell.rangeType="single";
}else{
if(d==0){
recordCell.rangeType="start";
}else{
if((d+1)==_c4.length){
recordCell.rangeType="end";
}else{
recordCell.rangeType="middle";
}
}
}
recordCell.toString=function(){
return "[object CalendarCell]";
};
recordCell.l.className="l calendar_view_l_close";
recordCell.r.className="r calendar_view_r_close";
recordCell.m.className="m";
switch(recordCell.rangeType){
case "start":
recordCell.r.className="r calendar_view_r_normal";
break;
case "end":
recordCell.l.className="l calendar_view_l_normal";
break;
case "middle":
recordCell.r.className="r calendar_view_r_normal";
recordCell.l.className="l calendar_view_l_normal";
break;
}
var _d6=recordCell.offsetWidth-recordCell.l.offsetWidth-recordCell.r.offsetWidth;
setStyle(recordCell.m,"width",_d6+"px");
if((recordCell.offsetHeight*_d1.countElements)>_d1.body.offsetHeight){
setStyle(_d1.header.extend,"display","block");
}else{
setStyle(_d1.header.extend,"display","none");
}
recordCell.onmouseout=function(){
hideTooltip();
};
recordCell.onmouseover=function(){
var _d7=getObjectPosition(this);
showTooltip(this.value,_d7.x,_d7.y);
};
recordCell.onclick=function(_d8){
xEvent=xpEvent(_d8,true);
this.owner.onRecordClick(this);
if(!this.owner.selectMultipleRecords){
for(var k in this.boundTo.recordsMap){
if(this.boundTo.recordsMap[k].selected==true){
this.boundTo.recordsMap[k].selected=false;
}
for(l=0;l<this.boundTo.recordsMap[k].length;l++){
this.boundTo.recordsMap[k][l].l.className="l calendar_view_l_close";
this.boundTo.recordsMap[k][l].r.className="r calendar_view_r_close";
this.boundTo.recordsMap[k][l].m.className="m";
switch(this.boundTo.recordsMap[k][l].rangeType){
case "start":
this.boundTo.recordsMap[k][l].r.className="r calendar_view_r_normal";
break;
case "end":
this.boundTo.recordsMap[k][l].l.className="l calendar_view_l_normal";
break;
case "middle":
this.boundTo.recordsMap[k][l].r.className="r calendar_view_r_normal";
this.boundTo.recordsMap[k][l].l.className="l calendar_view_l_normal";
break;
}
}
}
}
var _da=this.owner.recordsMap[this.recordId];
if(_da.selected==true){
_da.selected=false;
for(i=0;i<_da.length;i++){
}
}else{
_da.selected=true;
for(i=0;i<_da.length;i++){
_da[i].l.className="l calendar_view_l_close_selected";
_da[i].r.className="r calendar_view_r_close_selected";
_da[i].m.className="calendar_view_m_selected";
switch(_da[i].rangeType){
case "start":
_da[i].r.className="r calendar_view_r_normal_selected";
break;
case "end":
_da[i].l.className="l calendar_view_l_normal_selected";
break;
case "middle":
_da[i].r.className="r calendar_view_r_normal_selected";
_da[i].l.className="l calendar_view_l_normal_selected";
break;
}
}
}
if(_d8){
if((_d8.ctrlKey)||(_d8.metaKey)){
if(this.ddwType.indexOf("Static")!=-1){
new DDW(this.ddw,"static_url",this.value,"&recordId="+this.recordId);
}else{
if(this.ddwType.indexOf("Dynamic")!=-1){
new DDW(this.ddw,"dynamic_url",this.value,"&recordId="+this.recordId);
}else{
if(this.ddwType.indexOf("Message")!=-1){
new DDW(this.ddw,"message_window",this.boundTo.container,"&recordId="+this.recordId);
}
}
}
return;
}
}
};
recordCell.ondblclick=function(){
this.owner.onRecordDblClick(this);
if(this.boundTo.table.fieldsDetail.length==0){
return false;
}
if(isDefined(this.owner.editor)&&isDefined(this.owner.editor.record)){
this.owner.editor.edit();
}else{
this.owner.getEditor();
setStyle(this.owner.editor.getDOM(),"display","block");
var _db=this.owner.editor;
var _dc=_db.prv.mAutoReload;
if(_dc>0){
setTimeout(function(){
_db.reload();
},500);
}
}
this.owner.editor.pull(this.owner.table.tableid,this.recordId);
};
}
}
}
}
}
}
if(!(aQuery.lastRecord)){
aQuery.nextBatch(aCalendar.populate_handler);
}else{
clearQuery(aQuery.queryId,false);
if(aCalendar.toolbar){
setStyle(_83,"visibility","hidden");
}
aCalendar.resizing=true;
aCalendar.calendar.afterRefresh();
aCalendar.resizing=false;
if(aCalendar.refreshTimeout){
window.clearTimeout(aCalendar.refreshTimeout);
}
aCalendar.refreshTimeout=setTimeout(function(){
aCalendar.refresh();
},5000*60);
aCalendar.clearupdateTimeout=setTimeout(function(){
aCalendar.updating=false;
},1000);
}
};
this.refresh();
if(this.tabsbar){
this.tabsbar.refresh();
}
aThisObject=this;
if(!this.initializing){
setTimeout(function(){
aThisObject.refreshDynamicTabs();
},5000);
}
if(_54){
_54.resize(1,1);
}
this.loaded=true;
}

function taskbarObject(){
var _1=getTemplate("dax_taskbar");
var _2=getTemplate("dax_taskbar_expand_window");
if(!_1){
return null;
}
this.dom=_1;
this.expandWindow=_2;
this.taskbarItems=new Array();
this.taskbarexpand=getElementByClassName(this.dom,"dax_taskbar_expand",true);
this.isExpanded=false;
this.currentPosition="top";
document.body.appendChild(this.expandWindow);
i=1;
while($("dax_taskbar"+i)!=null){
i++;
}
this.idNumber=i;
this.dom.id="dax_taskbar"+this.idNumber;
this.taskbarexpand.id="dax_taskbar_expand"+this.idNumber;
var _3=document.body;
_3.insertBefore(this.dom,_3.firstChild);
setStyle(this.dom,"display","block");
if(browser.ie6){
this.dom.style.position="absolute";
this.expandWindow.style.position="absolute";
}
this.dom.style.display="block";
this.dom.className="dax_taskbar_top";
this.position=function(_4){
switch(_4){
case "top":
this.dom.className="dax_taskbar_top";
this.expandWindow.className="dax_taskbar_expand_window";
this.currentPosition="top";
this.setHorButtons();
break;
case "bottom":
this.dom.className="dax_taskbar_bottom";
this.expandWindow.className="dax_taskbar_expand_window_bottom";
this.currentPosition="bottom";
this.setHorButtons();
break;
default:
this.dom.className="dax_taskbar_top";
this.setHorButtons();
}
};
this.setHorButtons=function(){
buttons=getElementsByClassName(this.dom,"dax_taskbar_button",true);
for(i=0;i<buttons.length;i++){
buttons[i].className="dax_taskbar_button dax_taskbar_button_hor";
}
};
this.refresh=function(){
var _5=false;
expButtons=getElementsByClassName(this.expandWindow,"dax_taskbar_button",true);
if(expButtons.length>0){
for(i=0;i<expButtons.length;i++){
this.dom.appendChild(expButtons[i]);
expButtons[i].isExtended=false;
setStyle(expButtons[i],"clear","none");
}
}
var _6=new Array(0);
_6=getElementsByClassName(this.dom,"dax_taskbar_button",true);
if(_6.length>0){
for(i=0;i<_6.length;i++){
try{
if((_6[i].offsetTop>10)||(_6[i].offsetHeight>30)){
setStyle(_6[i],"clear","both");
this.expandWindow.appendChild(_6[i]);
_6[i].isExtended=true;
_5=true;
}
}
catch(er){
}
}
}
if(_5==true){
setStyle(this.taskbarexpand,"display","block");
if(this.isExpanded==true){
setStyle(this.expandWindow,"display","block");
}
}else{
setStyle(this.taskbarexpand,"display","none");
setStyle(this.expandWindow,"display","none");
}
if(browser.ie6){
var _7=getWindowHeight();
var _8=document.body.scrollTop;
var _9=this.dom.offsetHeight;
if(this.currentPosition=="top"){
this.dom.style.top=_8+"px";
this.expandWindow.style.top=_8+_9+"px";
}else{
this.dom.style.top=_8+_7-this.dom.offsetHeight+"px";
this.expandWindow.style.top=_8+_7-_9-this.expandWindow.offsetHeight+"px";
}
}
};
this.taskbarexpand.parent=this;
this.taskbarexpand.onmouseover=function(){
this.className="dax_taskbar_expand dax_taskbar_expand_over";
};
this.taskbarexpand.onmouseout=function(){
if(this.parent.isExpanded==false){
this.className="dax_taskbar_expand dax_taskbar_expand_normal";
}else{
this.className="dax_taskbar_expand dax_taskbar_expand_selected";
}
};
this.taskbarexpand.onclick=function(){
if(this.parent.isExpanded==false){
this.className="dax_taskbar_expand dax_taskbar_expand_selected";
setStyle(this.parent.expandWindow,"display","block");
this.parent.isExpanded=true;
}else{
this.className="dax_taskbar_expand dax_taskbar_expand_normal";
setStyle(this.parent.expandWindow,"display","none");
this.parent.isExpanded=false;
}
};
this.findItemObject=function(_a){
for(i;i<this.taskbarItems.length;i++){
if(_a==this.taskbarItems[i].dom){
return this.taskbarItems[i];
}
}
return null;
};
setStyle(this.dom,"display","none");
}
function taskbarItem(_b){
if(!_b){
return false;
}
var _c=getTemplate("dax_taskbar_button");
this.parent=_b;
this.parent.dom.appendChild(_c);
this.parent.taskbarItems.push(this);
this.dom=_c;
this.dom.parent=this;
this.button_l=getElementByClassName(this.dom,"button_l",true);
this.button_m=getElementByClassName(this.dom,"button_m",true);
this.button_r=getElementByClassName(this.dom,"button_r",true);
this.icon=getElementByClassName(this.dom,"icon",true);
this.selected=false;
this.dom.isExtended=false;
i=1;
while($("dax_taskbar_button"+i)!=null){
i++;
}
this.dom.id="dax_taskbar_button"+i;
this.button_l.id="button_l"+i;
this.button_m.id="button_m"+i;
this.button_r.id="button_r"+i;
this.dom.onmouseover=function(){
this.parent.button_l.className="button_l button_over_l";
this.parent.button_m.className="button_m button_over_m";
this.parent.button_r.className="button_r button_over_r";
};
this.dom.onmouseout=function(){
if(this.parent.selected==true){
this.parent.button_l.className="button_l button_down_l";
this.parent.button_m.className="button_m button_down_m";
this.parent.button_r.className="button_r button_down_r";
}else{
this.parent.button_l.className="button_l button_normal_l";
this.parent.button_m.className="button_m button_normal_m";
this.parent.button_r.className="button_r button_normal_r";
}
};
this.dom.onmousedown=function(){
this.parent.button_l.className="button_l button_down_l";
this.parent.button_m.className="button_m button_down_m";
this.parent.button_r.className="button_r button_down_r";
};
this.dom.onmouseup=function(){
this.parent.button_l.className="button_l button_over_l";
this.parent.button_m.className="button_m button_over_m";
this.parent.button_r.className="button_r button_over_r";
};
this.setLabel=function(_d){
labelParent=getElementByClassName(this.dom,"button_text");
label=getTextNode(labelParent);
label.nodeValue=_d;
};
this.getLabel=function(){
labelParent=getElementByClassName(this.dom,"button_text");
label=getTextNode(labelParent);
return (label.nodeValue);
};
this.setSelected=function(_e,_f){
if(_f==true){
for(i=0;i<this.parent.taskbarItems.length;i++){
if(this.parent.taskbarItems[i].selected==true){
this.parent.taskbarItems[i].button_l.className="button_l button_normal_l";
this.parent.taskbarItems[i].button_m.className="button_m button_normal_m";
this.parent.taskbarItems[i].button_r.className="button_r button_normal_r";
this.parent.taskbarItems[i].selected=false;
}
}
}
if(_e==true){
this.button_l.className="button_l button_down_l";
this.button_m.className="button_m button_down_m";
this.button_r.className="button_r button_down_r";
this.selected=true;
}else{
this.button_l.className="button_l button_normal_l";
this.button_m.className="button_m button_normal_m";
this.button_r.className="button_r button_normal_r";
this.selected=false;
}
};
this.setIcon=function(_10){
this.icon.className=_10;
};
this.remove=function(){
for(i;i<this.parent.taskbarItems.length;i++){
if(this.dom==this.parent.taskbarItems[i].dom){
removed=this.parent.taskbarItems.splice(i,1);
}
}
if(this.dom){
if(this.dom.isExtended==true){
this.parent.expandWindow.removeChild(this.dom);
}else{
if(this.dom.parentNode){
this.dom.parentNode.removeChild(this.dom);
}
}
}
this.parent.refresh();
};
setStyle(this.dom,"display","none");
}

var itemfrom=0;
var itemto=0;
var labeledit=false;
var editedobject=0;
var userlanguage="";
var dax_uniqueId=0;
var taskbar;
var aSidebar;
function dax_loginSuccess(){
}
function dax_loginFail(){
}
function getkey(e){
if(window.event){
return window.event.keyCode;
}else{
if(e){
return e.which;
}else{
return null;
}
}
}
var Controller={focusedObject:null,setFocused:function(_2){
if(_2!=this.focusedObject){
Controller.blur(this.focusedObject);
}
this.focusedObject=_2;
},focus:function(_3){
this.setFocused(_3);
},blur:function(_4,_5){
if(this.focusedObject&&this.focusedObject.blur){
try{
var _6=this.focusedObject.blur(_4,_5);
}
catch(e){
}
}
if(!_6){
this.focusedObject=null;
}
},lockedRecords:new Array(),recordHash:function(_7,_8){
return "r_"+_8;
},isLocked:function(_9,_a){
var _b=this.recordHash(_9,_a);
return isDefined(this.lockedRecords[_b])?this.lockedRecords[_b]:false;
},lockRecord:function(_c,_d){
this.lockedRecords[this.recordHash(_c,_d)]=true;
},unlockRecord:function(_e,_f){
this.lockedRecords[this.recordHash(_e,_f)]=false;
},uploading:false,uploads:new Array(),enqueue:function(_10){
this.uploads.push(_10);
debugAlert("this.uploading = "+this.uploading);
debugAlert("!this.uploading");
this.upload();
debugAlert("uploaded");
debugAlert("else");
},dequeue:function(){
return this.uploads.shift();
},upload:function(){
if(this.uploads.length<=0){
debugAlert("this.uploads.length <=0");
return;
}
if(!this.uploading&&this.isUploadReady()){
this.uploading=true;
var _11=this.dequeue();
_11.upload();
}else{
var _12=this;
setTimeout(function(){
_12.upload();
},15);
}
},isUploadReady:function(){
var _13=frames["upload"].document;
debugAlert(".isUploadReady, upload= "+_13);
var _14=_13.getElementById("state");
debugAlert(".isUploadReady, state= "+_14);
var _15=_14?_14.className=="ready":false;
if(((!_14)&(!this.reloading)&(_13.location.pathname!="/dax/js/templates/upload.html"))|((_13.getElementById("error"))&(_13.location.pathname!="/DAX/UploadBinary"))){
_13.location.href="/dax/js/templates/upload.html?random="+Math.random();
this.reloading=true;
}else{
if(_14){
this.reloading=false;
}
}
debugAlert(".isUploadReady, reply="+_15);
return _15;
}};
document.onkeydown=function(_16){
if(Controller.focusedObject&&Controller.focusedObject.onkeydown){
Controller.focusedObject.onkeydown(_16);
}
};
document.onkeypress=function(_17){
if(Controller.focusedObject&&Controller.focusedObject.onkeypress){
Controller.focusedObject.onkeypress(_17);
}
};
document.onkeyup=function(_18){
if(Controller.focusedObject&&Controller.focusedObject.onkeyup){
Controller.focusedObject.onkeyup(_18);
}
};
document.onclick=function(_19){
if(browser.ie7){
var _19=xpEvent(_19);
}
Controller.blur(null,_19);
};
if(!document.importNode){
document.importNode=function(_1a,_1b){
var _1c=null;
if(_1a.nodeType==1){
_1c=document.createElement(_1a.nodeName);
for(var i=0;i<_1a.attributes.length;i++){
var _1e=_1a.attributes[i];
if(_1e.nodeValue!=null&&_1e.nodeValue!=""){
_1c.setAttribute(_1e.name,_1e.value);
}
}
_1c.className=_1a.className;
_1c.style.cssText=_1a.style.cssText;
}else{
if(_1a.nodeType==3){
_1c=document.createTextNode(_1a.nodeValue);
}
}
if(_1b&&_1a.hasChildNodes()){
for(var _1f=_1a.firstChild;_1f;_1f=_1f.nextSibling){
var _20=document.importNode(_1f,true);
if(_20){
_1c.appendChild(_20);
}
}
}
return _1c;
};
}
Object.inherit=function(_21){
for(var _22 in _21){
this[_22]=_21[_22];
}
};
Function.prototype.decl=function(_23){
if(this.prv){
for(var _24 in this.prv){
var _25=_24.charAt(0)=="m"?_24.substring(1):_24;
this["get"+_25]=new Function("return this.prv['"+_24+"'];");
this["set"+_25]=new Function("value","this.prv['"+_24+"'] = value;");
}
}
};
function showDebugger(){
if(dax_bridge){
dax_bridge.showDebugger();
}
}
function debugAlert(_26){
if(dax_bridge.debugWindow){
if(_26){
if(dax_bridge.debugWindow.alernateRow){
dax_bridge.debugWindow.debugText.innerHTML="<div class = 'normal_row'>"+_26+"</div>"+dax_bridge.debugWindow.debugText.innerHTML;
dax_bridge.debugWindow.alernateRow=false;
}else{
dax_bridge.debugWindow.debugText.innerHTML="<div class = 'alt_row'>"+_26+"</div>"+dax_bridge.debugWindow.debugText.innerHTML;
dax_bridge.debugWindow.alernateRow=true;
}
}
}
}
function onAfterInit(){
}
function onLogoutSuccess(){
}
function Login(_27,_28){
if((dax_bridge)&&(_27)){
dax_bridge.login(_27,_28);
}
}
function dax_login(_29,_2a){
if((dax_bridge)&&(_29)){
dax_bridge.login(_29,_2a);
}
}
function bridge(){
this.isClient=false;
this.serverSet="UTF-8";
this.encode=function(_2b){
if(this.serverSet=="UTF-8"){
return encodeURIComponent(_2b);
}else{
return encodeURIComponent(_2b);
}
};
this.updating=false;
this.showDebugger=function(){
if(!this.debugWindow){
this.debugWindow=WindowManager.createNewWindow();
if(this.debugWindow){
this.debugWindow.bridgeLink=this;
this.debugWindow.titleBar.innerHTML="Console";
setStyle(this.debugWindow.contentArea,"overflow","scroll");
debugText=document.createElement("div");
this.debugWindow.contentArea.appendChild(debugText);
debugText.className="dax_console";
this.debugWindow.debugText=debugText;
this.debugWindow.activate();
this.debugWindow.open();
this.debugWindow.logo.className="window_logo_debug";
debugAlert("<b>User Agent:</b>"+navigator.userAgent);
this.debugWindow.refreshBox.boundTo=this.debugWindow;
this.debugWindow.refreshBox.onmouseup=function(_2c){
var _2c=xpEvent(_2c,true);
this.className="window_refreshbox";
this.parent.debugText.innerHTML="";
debugAlert("<b>User Agent:</b>"+navigator.userAgent);
return false;
};
this.debugWindow.closeBox.onmouseup=function(_2d){
var _2d=xpEvent(_2d,true);
WindowManager.destroyWindow(this.parent);
dax_bridge.debugWindow=null;
return false;
};
}
}else{
this.debugWindow.activate();
}
};
this.sessionId="";
this.url="/DAX/";
this.username="";
this.admin=false;
this.language=null;
this.shuttingDown=false;
this.tables=new Array();
this.reports=new Array();
this.styleNode=null;
this.login=function(_2e,_2f){
makeCall(dax_bridge.url+"login?username="+dax_bridge.encode(_2e)+"&password="+dax_bridge.encode(_2f),dax_bridge.login_handler,null);
};
this.logout=function(){
makeCall(dax_bridge.url+"logout?sessionid="+dax_bridge.sessionId,dax_bridge.logout_handler,null);
};
this.logout_handler=function(_30){
if(_30.readyState!=4){
return;
}
var _31=_30.responseXML;
_31=_31.getElementsByTagName("result").item(0);
if(!_31){
return;
}
var _32=_31.getElementsByTagName("logoutSuccess").item(0).firstChild.nodeValue=="true";
if(_32){
if(typeof (onLogoutSuccess)!="undefined"){
if(onLogoutSuccess){
onLogoutSuccess();
}
}
}else{
}
};
this.localize=function(_33){
if((!_33)&&(!this.language)){
var _33="en";
}
if((!_33)&&(this.language)){
var _33=this.language;
}
if(eval("STR_"+_33.toUpperCase())){
var _34="STR = STR_"+_33.toUpperCase()+";";
}else{
alert("Language on the backend is set to "+_33.toUpperCase()+" but the resources for this language has not been found");
}
try{
debugAlert("<b>Bridge</b> (.localize):Setting language to "+_33);
eval(_34);
}
catch(e){
}
};
this.login_handler=function(_35){
if(_35.readyState!=4){
return;
}
if(checkResponse(_35)){
dax_loginFail();
return;
}
var _36=_35.responseXML;
_36=_36.getElementsByTagName("loginresult").item(0);
if(!_36){
return;
}
var _37=_36.getAttribute("success")=="true";
if(_37){
dax_bridge.language=_36.getAttribute("language");
dax_bridge.localize();
var _38=_36.getElementsByTagName("sessionId").item(0);
if(_38){
dax_bridge.sessionId=_38.firstChild.nodeValue;
dax_bridge.admin=_38.getAttribute("AdminFlag")!="no";
dax_bridge.updateTables();
if((structure)&&(connection)){
if(!structure.cached){
if(!connection.sessionId){
connection.sessionId=dax_bridge.sessionId;
}
}
}
}else{
}
}else{
dax_loginFail();
}
};
this.updateTables=function(_39){
if(dax_bridge.sessionId){
this.updating=true;
if(!_39){
_39=false;
}else{
_39=true;
}
url=dax_bridge.url+"getTableList?sessionId="+dax_bridge.sessionId;
makeCall(url,dax_bridge.updateTables_handler,false,_39);
}
};
this.getSingleTable=function(_3a){
if(dax_bridge.sessionId){
url=dax_bridge.url+"getSingleTable?tableid="+_3a+"&sessionId="+dax_bridge.sessionId;
makeCall(url,dax_bridge.updateTables_handler,true,true);
}
};
this.updateTables_handler=function(_3b,_3c){
if(_3b.readyState!=4){
return;
}
var _3d=checkResponse(_3b);
if(_3d){
debugAlert("getTable request error.");
return false;
}
var _3e=_3b.responseXML.getElementsByTagName("tables").item(0);
var _3f=_3e?_3e.getElementsByTagName("table"):null;
if(!_3f){
_3f=[];
}
for(ij=0;ij<_3f.length;ij++){
var _40=_3f.item(ij).getAttribute("alias");
var _41=_3f.item(ij).getAttribute("calendarview");
var _42=_3f.item(ij).getAttribute("datatreeview");
var _43=_3f.item(ij).getAttribute("datamatrixview");
var _44=_3f.item(ij).getAttribute("imagematrixview");
var _45=_3f.item(ij).getAttribute("name");
var _46=_3f.item(ij).getAttribute("id");
var _47=_3f.item(ij).getAttribute("visible");
var _48=_3f.item(ij).getAttribute("ddw");
var _49=_3f.item(ij).getAttribute("ddwtype");
var _4a=_3f.item(ij).getAttribute("selectionviewid");
var _4b=(_3f.item(ij).getAttribute("allrecords")=="")?"True":(_3f.item(ij).getAttribute("allrecords"));
var _4c={tableid:_46,tablename:_45,tablealias:_40,tablecalendarview:_41,tabledatatreeview:_42,tabledatamatrixview:_43,tableimagematrixview:_44,tablevisible:_47,cached:false,ddw:_48,ddwtype:_49,selectionviewid:_4a,showallrecordstab:_4b,fields:[],fieldsList:[],fieldsDetail:[],fieldsSearch:[]};
_4c.ddwOptions=new Array();
_4c.preselectQueries=new Array();
_4c.preselectedDynamicQueries=new Array();
var _4d=_3f.item(ij).getElementsByTagName("query");
if(_4d.length>0){
for(var _4e=0;_4e<_4d.length;_4e++){
var _4f=_4d.item(_4e).getAttribute("name");
if(_4f.indexOf("4daf_unique_")==-1){
var _50={name:_4f};
_4c.preselectQueries.push(_50);
}else{
var _51=_4f.substr(12);
var _50={fieldId:_51,names:[],updating:false};
_4c.preselectedDynamicQueries.push(_50);
}
}
}
_4c.parent=this;
_4c.cacheFields=function(){
dax_bridge.cacheFields(this);
};
dax_bridge.tables.push(_4c);
}
if(!_3c){
if(structure){
buildTableList(_3b);
}
}
dax_bridge.updating=false;
dax_reports_getReportList();
};
this.cacheFields=function(_52){
if(!_52){
return false;
}
if(_52.cached==false){
this.updateFields(_52.tableid,true);
}
};
this.updateFields=function(_53,_54){
if(dax_bridge.sessionId){
if(!_54){
_54=false;
}
url=dax_bridge.url+"getFieldList?sessionId="+dax_bridge.sessionId+"&tableId="+_53;
makeCall(url,dax_bridge.updateFields_handler,null,_54);
debugAlert("<b>Bridge (.updateFields):</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
ddwUrl=dax_bridge.url+"getDDWOption?sessionId="+dax_bridge.sessionId+"&objectid="+_53;
makeCall(ddwUrl,dax_bridge.updateFieldsDDW_handler,null,_54);
debugAlert("<b>Bridge (.updateDDWs):</b>"+"<a href=\""+ddwUrl+"\" target=\"_blank\">"+ddwUrl+"</a>");
callbackUrl=dax_bridge.url+"GetCallBack?sessionId="+dax_bridge.sessionId+"&tableid="+_53+"&fieldid=0";
makeCall(callbackUrl,dax_bridge.updateFieldsCallBack_handler,null,false);
debugAlert("<b>Bridge (.updateCallBacks):</b>"+"<a href=\""+callbackUrl+"\" target=\"_blank\">"+callbackUrl+"</a>");
}
};
this.updateFieldsAsync=function(_55,_56,_57){
if(dax_bridge.sessionId){
var _58={originObject:_56,fieldHandler:_57};
url=dax_bridge.url+"getFieldList?sessionId="+dax_bridge.sessionId+"&tableId="+_55;
makeCall(url,dax_bridge.updateFields_handler,_58,false);
debugAlert("<b>Bridge (.updateFields):</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
ddwUrl=dax_bridge.url+"getDDWOption?sessionId="+dax_bridge.sessionId+"&objectid="+_55;
debugAlert("<b>Bridge (.updateDDWs):</b>"+"<a href=\""+ddwUrl+"\" target=\"_blank\">"+ddwUrl+"</a>");
callbackUrl=dax_bridge.url+"GetCallBack?sessionId="+dax_bridge.sessionId+"&tableid="+_55+"&fieldid=0";
debugAlert("<b>Bridge (.updateCallBacks):</b>"+"<a href=\""+callbackUrl+"\" target=\"_blank\">"+callbackUrl+"</a>");
}
};
this.updateFieldsCallBack_handler=function(_59,_5a){
if(!_5a){
if(_59.readyState!=4){
return;
}
}
var _5b=checkResponse(_59);
if(_5b){
debugAlert("updateFieldsCallBack_handler request error.");
return false;
}
var _5c=_59.responseXML.getElementsByTagName("GetCallBack").item(0);
var _5d=_5c?_5c.getElementsByTagName("CallBack"):null;
if((!_5d)||(_5d.length==0)){
return false;
}
for(h=0;h<_5d.length;h++){
var _5e=_5d[h].getAttribute("tableid");
var _5f=_5d[h].getAttribute("fieldid");
var _60=getField(_5e,_5f);
if(_60){
switch(_5d[h].getAttribute("eventid")){
case "1":
_60.fieldcallbackonload=true;
break;
case "20":
_60.fieldcallbackonchange=true;
break;
}
}
}
};
this.updateFieldsDDW_handler=function(_61,_62){
if(!_62){
if(_61.readyState!=4){
return;
}
}
var _63=checkResponse(_61);
if(_63){
debugAlert("updateFieldsDDW_handler request error.");
return false;
}
var _64=_61.responseXML.getElementsByTagName("GetDDWOption").item(0);
var _65=_64?_64.getElementsByTagName("DDW"):null;
if((!_65)||(_65.length==0)){
return false;
}
var _66=_64.getAttribute("objectid");
var _67=getTable(_66);
_67.ddwOptions=new Array();
for(h=0;h<_65.length;h++){
var _68=_65[h].getAttribute("title");
var _69=_65[h].getAttribute("type");
var url=_65[h].getAttribute("url");
var _64=new Object();
_64.title=_68;
_64.type=_69;
_64.url=url.replace(/#38;/g,"");
_67.ddwOptions.push(_64);
}
};
this.updateFields_handler=function(_6b,_6c,_6d){
if(!_6d){
if(_6b.readyState!=4){
return;
}
}
var _6e=checkResponse(_6b);
if(_6e){
debugAlert("getField request error.");
return false;
}
var _6f=_6b.responseXML.getElementsByTagName("fields").item(0);
var _70=_6f?_6f.getElementsByTagName("field"):null;
var _71=_6f.getAttribute("tableid");
if(!_70){
debugAlert("No visible fields found for table "+getTable(_71).tablename+". Check Admin preferences for field visibility.");
return false;
}
table=getTable(_71);
if(table.columnWidths){
var _72=table.columnWidths.split("_");
}
table.fields=[];
for(var i=0;i<_70.length;i++){
var _74=_70.item(i).getAttribute("alias");
var _75=_70.item(i).getAttribute("id");
var _76=_70.item(i).getAttribute("indetail");
var _77=_70.item(i).getAttribute("inlist");
var _78=_70.item(i).getAttribute("name");
var _79=_70.item(i).getAttribute("type");
var _7a=_70.item(i).getAttribute("indexed");
var _7b=_70.item(i).getAttribute("invisible");
var _7c=_70.item(i).getAttribute("mandatory");
var _7d=_70.item(i).getAttribute("nonEnterable");
var _7e=_70.item(i).getAttribute("nonModifiable");
var _7f=_70.item(i).getAttribute("unique");
var _80=_70.item(i).getAttribute("breaklevel");
var _81=_70.item(i).getAttribute("format");
var _82=_70.item(i).getAttribute("choicelist");
var _83=_70.item(i).getAttribute("searchable");
if((_79.toLowerCase()=="date")&&(!_81)){
_81="d1";
}
if(_72){
var _84=findInArray(_72,_75,null,null,true);
if(_84!=-1){
var _85=_72[_84].split(":")[1];
}else{
var _85=null;
}
}else{
var _85=null;
}
var _6f={fieldalias:_74,fieldid:_75,fieldindetail:_76,fieldinlist:_77,fieldname:_78,fieldtype:_79,fieldindexed:_7a,fieldinvisible:_7b,fieldmandatory:_7c,fieldsearchable:_83,fieldnonEnterable:_7d,fieldnonModifiable:_7e,fieldunique:_7f,fieldbreaklevel:_80,fieldformat:_81,fieldchoicelist:_82,fieldcolumnwidth:_85,table:table};
if(!table.fields){
table.fields=new Array();
}
table.fields.push(_6f);
if(_77.toLowerCase()=="true"){
table.fieldsList.push(_6f);
}
if(_76.toLowerCase()=="true"){
table.fieldsDetail.push(_6f);
}
if(_83.toLowerCase()=="true"){
table.fieldsSearch.push(_6f);
}
}
table.cached=true;
drawFields(_6b,_71);
if(_6c){
_6c.fieldHandler(_6c.originObject);
}
};
this.deleteRecords=function(_86,_87,_88,_89){
this.cacheFields(_86);
if((getTable(_86))&&(_87)&&(this.sessionId)){
var url=dax_bridge.url+"deleteRecord?sessionId="+dax_bridge.sessionId+"&tableId="+getTable(_86).tableid+"&recordId=";
if(isArray(_87)){
for(b=0;b<_87.length;b++){
url+=_87[b];
if((b+1)!=_87.length){
url+=",";
}
}
}else{
url+=_87;
}
makeCall(url,_88,_89);
}
};
this.addRecord=function(_8b,_8c,_8d,_8e,_8f){
this.cacheFields(_8b);
var url=this.url+"addRecord?sessionid="+this.sessionId+"&tableid="+getTable(_8b).tableid;
for(var _91=0;_91<_8c.length;_91++){
url+="&field"+getField(_8b,_8c[_91]).fieldid+"="+_8d[_91];
}
makeCall(url,_8e,_8f);
};
this.modifyRecord=function(_92,_93,_94,_95,_96,_97){
this.cacheFields(_92);
var url=this.url+"modifyRecord?sessionid="+this.sessionId+"&tableid="+getTable(_92).tableid;
for(var _99=0;_99<_93.length;_99++){
url+="&field"+getField(_92,_93[_99]).fieldid+"="+_94[_99];
}
url+="&recordid="+_95;
makeCall(url,_96,_97);
};
this.query=function(_9a){
this.objectRef=null;
this.handler=function(){
};
this.updateQueryId=true;
this.queryId=null;
this.queryName=null;
this.currentQueryId=null;
this.start=1;
this.length=0;
this.size=0;
this.recordsInSelection=0;
this.lastRecord=false;
this.sortOrder=null;
this.sortField=null;
this.refreshOnSort=false;
this.sortHandler=function(){
};
this.customValuesFrom4D={name:[],value:[]};
this.queryEngine={field:[],operator:[],value:[],andorflag:[]};
this.queryEngineSearch={field:[],operator:[],value:[],andorflag:[]};
this.customValues={name:[],value:[]};
this.maxChar=null;
if(_9a){
this.table=getTable(_9a);
}
this.setNamedQuery=function(_9b){
this.queryId=null;
this.queryName=_9b;
};
this.sort=function(_9c,_9d,_9e){
var _9f=getField(this.table.tableid,_9c);
if(_9f){
this.sortField=_9f;
}
this.refreshOnSort=_9e;
this.sortOrder=((_9d=="desc")?"desc":"asc");
var url=dax_bridge.url+"Sort?sessionId="+dax_bridge.sessionId+"&tableid="+this.table.tableid+"&queryid="+this.queryId+"&fieldid="+this.sortField.fieldid+"&direction="+this.sortOrder;
makeCall(url,this.sortHandlerInternal,this);
};
this.sortHandlerInternal=function(_a1,_a2){
if(_a1.readyState!=4){
return;
}
if(checkResponse(_a1)){
return;
}
if(_a2.refreshOnSort){
_a2.getRecords();
}
_a2.sortHandler();
};
this.getRecords=function(_a3,_a4){
if(_a3){
this.start=_a3;
}
if(_a4){
this.length=_a4;
}
if(this.queryEngine.field.length>0){
var _a5=dax_bridge.url+"QueryEngine";
var url="sessionId="+dax_bridge.sessionId+"&dax_qe_table="+this.table.tableid+"&dax_qe_start="+this.start+"&dax_qe_length="+this.length;
for(s=0;s<this.queryEngine.field.length;s++){
if((this.queryEngine.field[s])&&(this.queryEngine.operator[s])&&(this.queryEngine.value[s])&&(this.queryEngine.andorflag[s])){
url+="&dax_qe_field"+(s+1)+"="+this.queryEngine.field[s]+"&dax_qe_argument"+(s+1)+"="+this.queryEngine.operator[s]+"&dax_qe_searchvalue"+(s+1)+"="+dax_bridge.encode(this.queryEngine.value[s])+"&dax_qe_andor"+(s+1)+"="+this.queryEngine.andorflag[s];
}
}
if(this.queryId){
url+="&queryid="+this.queryId;
}
}else{
if(this.queryId){
var _a5=dax_bridge.url+"Query";
var url="sessionId="+dax_bridge.sessionId+"&queryid="+this.queryId+"&start="+this.start+"&length="+this.length;
}else{
if(this.queryName){
var _a5=dax_bridge.url+"Query";
var url="sessionId="+dax_bridge.sessionId+"&tableid="+this.table.tableid+"&queryname="+this.queryName+"&start="+this.start+"&length="+this.length;
}else{
var _a5=dax_bridge.url+"AllRecords";
var url="sessionId="+dax_bridge.sessionId+"&tableid="+this.table.tableid+"&start="+this.start+"&length="+this.length;
}
}
}
if(this.queryEngineSearch.field.length>0){
var _a5=dax_bridge.url+"QueryEngine";
var url="sessionId="+dax_bridge.sessionId+"&dax_qe_table="+this.table.tableid+"&dax_qe_start="+this.start+"&dax_qe_length="+this.length;
for(s=0;s<this.queryEngineSearch.field.length;s++){
if((this.queryEngineSearch.field[s])&&(this.queryEngineSearch.operator[s])&&(this.queryEngineSearch.value[s])&&(this.queryEngineSearch.andorflag[s])){
url+="&dax_qe_field"+(s+1)+"="+this.queryEngineSearch.field[s]+"&dax_qe_argument"+(s+1)+"="+this.queryEngineSearch.operator[s]+"&dax_qe_searchvalue"+(s+1)+"="+dax_bridge.encode(this.queryEngineSearch.value[s])+"&dax_qe_andor"+(s+1)+"="+this.queryEngineSearch.andorflag[s];
}
}
}
if(this.maxChar){
url+="&maxchar="+this.maxChar;
}
if(this.customValues.name.length>0){
for(var _a7=0;_a7<this.customValues.name.length;_a7++){
url+="&"+dax_bridge.encode(this.customValues.name[_a7])+"="+dax_bridge.encode(this.customValues.value[_a7]);
}
}
makePostCall(_a5,this.handler,this.objectRef,true,url);
};
};
this.parseQuery=function(_a8,_a9){
var _aa=_a8.responseXML.getElementsByTagName("queryResult").item(0);
if(!_aa){
return;
}
if(_a9){
if(_a9.updateQueryId){
_a9.queryId=_aa.getAttribute("queryid");
}
_a9.currentQueryId=_aa.getAttribute("queryid");
_a9.recordsInSelection=_aa.getAttribute("recordsinselection");
_a9.size=_aa.getAttribute("size");
_a9.customValuesFrom4D={name:[],value:[]};
var _ab=_aa.getElementsByTagName("variable");
if(_ab.length>0){
for(var _ac=0;_ac<_ab.length;_ac++){
_a9.customValuesFrom4D.name.push(_ab[_ac].getAttribute("name"));
_a9.customValuesFrom4D.value.push(_ab[_ac].getAttribute("value"));
}
}
if((parseFloat(_a9.start)+parseFloat(_a9.size))<=_a9.recordsInSelection){
_a9.currentPos+=parseFloat(_a9.size);
}else{
_a9.lastRecord=true;
_a9.currentPos=_a9.size;
}
}
var _ad=[];
var _ae=_aa.getElementsByTagName("row");
var _af=_aa.getAttribute("tableid");
for(i=0;i<_ae.length;i++){
var _b0=new Array();
var _b1=_ae[i].getElementsByTagName("field");
for(j=0;j<_b1.length;j++){
var _b2=(_b1[j].childNodes.length>0)?(_b1[j].firstChild.nodeValue):("");
if(_b2){
var _b3=getField(_af,_b1[j].getAttribute("id"));
var _b4=_b3.fieldtype;
var _b5=_b3.fieldformat;
if((_b4=="boolean")||(_b4=="date")){
_b2=doFormat(_b2,"4daf_default",_b5,_b4);
}else{
if(_b5){
_b2=format(_b5,_b2);
}
}
}
var _b6={id:_b1[j].getAttribute("id"),value:_b2,originalValue:(_b1[j].childNodes.length>0)?(_b1[j].firstChild.nodeValue):(""),ddw:_b1[j].getAttribute("ddw"),ddwtype:_b1[j].getAttribute("ddwtype"),fieldrecordid:_b1[j].getAttribute("fieldrecordid"),height:_b1[j].getAttribute("height"),width:_b1[j].getAttribute("width")};
_b0.push(_b6);
}
var row={recordid:_ae[i].getAttribute("recordid"),selectionid:_ae[i].getAttribute("selectionid"),fields:_b0,locked:(_ae[i].getAttribute("locked").toLowerCase()=="true")?true:false};
_ad.push(row);
}
if(_a9){
_a9.parsedData=_ad;
}
return _ad;
};
this.getRecord=function(_b8,_b9,_ba,_bb){
var _bc=getTable(_b8);
if(!_bc){
return false;
}
var _bd={handler:_ba,objectRef:_bb};
var url=dax_bridge.url+"GetRecord?sessionid="+dax_bridge.sessionId+"&tableid="+_bc.tableid+"&recordid="+_b9;
makeCall(url,this.getRecord_handler,_bd);
};
this.getRecord_handler=function(_bf,_c0){
if(_bf.readyState!=4){
return;
}
var _c1=checkResponse(_bf);
if(_c1){
debugAlert("get init values request error.");
return false;
}
var _c2=dax_bridge.parseQuery(_bf);
_c0.handler(_c2,_c0.objectRef);
};
this.getChoiceList=function(_c3,_c4,_c5){
var url=dax_bridge.url+"GetChoiceList?sessionid="+dax_bridge.sessionId+"&choicelist="+_c3;
makeCall(url,_c4,_c5);
};
this.getInitInfo=function(){
var url=this.url+"getInitInfo";
makeCall(url,this.getInitInfo_handler);
};
this.getInitInfo_handler=function(_c8){
if(_c8.readyState!=4){
return;
}
var _c9=checkResponse(_c8);
if(_c9){
debugAlert("get init values request error.");
return false;
}
var _ca=_c8.responseXML.getElementsByTagName("charset").item(0);
var _cb=_c8.responseXML.getElementsByTagName("version").item(0);
if(_ca.firstChild.nodeValue.toLowerCase()=="iso-8859-1"){
dax_bridge.serverSet="Windows-1251";
}else{
dax_bridge.serverSet="UTF-8";
}
if(_cb){
dax_bridge.version=_cb.firstChild.nodeValue.toLowerCase();
}
};
this.updateUniqueQueries=function(_cc,_cd,_ce){
var _cf=getTable(_cc);
if(!_cf){
return false;
}
if(_cf.preselectedDynamicQueries.length>0){
for(var _d0=0;_d0<_cf.preselectedDynamicQueries.length;_d0++){
if(_cf.preselectedDynamicQueries[_d0].fieldId.indexOf("][")!=-1){
_cf.preselectedDynamicQueries[_d0].updating=true;
var url=dax_bridge.url+"GetUniqueQueries?sessionId="+dax_bridge.sessionId+"&tableid="+_cf.tableid+"&fieldid="+_cf.preselectedDynamicQueries[_d0].fieldId;
var _d2={externalHandler:_cd,objectRef:_ce};
makeCall(url,this.updateUniqueQueries_handler,_d2);
}
}
}
};
this.updateUniqueQueries_handler=function(_d3,_d4){
if(_d3.readyState!=4){
return;
}
var _d5=checkResponse(_d3);
if(_d5){
return;
}
var _d6=_d3.responseXML.getElementsByTagName("queries").item(0);
var _d7=_d6?_d6.getElementsByTagName("query"):null;
var _d8=_d6.getAttribute("fieldid");
var _d9=_d6.getAttribute("tableid");
var _da=getTable(_d9);
var _db=true;
if(_da.preselectedDynamicQueries.length>0){
for(var _dc=0;_dc<_da.preselectedDynamicQueries.length;_dc++){
if(_da.preselectedDynamicQueries[_dc].fieldId==_d8){
_da.preselectedDynamicQueries[_dc].names=[];
for(var _dd=0;_dd<_d7.length;_dd++){
var _de=_d7.item(_dd).getAttribute("name");
if(_de!="4daf_unique_"){
_da.preselectedDynamicQueries[_dc].names.push(_de.substr(12));
}
_da.preselectedDynamicQueries[_dc].updating=false;
}
}else{
if(_da.preselectedDynamicQueries[_dc].updating){
_db=false;
}
}
}
}
if(_db){
_d4.externalHandler(_d4.objectRef);
}
};
this.executeCallback=function(_df,_e0,_e1,_e2,_e3,_e4){
if(_e2=="onload"){
eventId=1;
}else{
eventId=20;
}
var url=dax_bridge.url+"ExecuteCallBack?sessionId="+dax_bridge.sessionId+"&eventid="+eventId+"&tableid="+_df+"&fieldid="+_e0;
if(_e2!="onload"){
url+="&value="+_e1;
}
var _e6={externalHandler:_e3,objectRef:_e4};
makeCall(url,this.executeCallback_handler,_e6);
};
this.executeCallback_handler=function(_e7,_e8){
if(_e7.readyState!=4){
return;
}
var _e9=checkResponse(_e7);
if(_e9){
return;
}
var _ea=_e7.responseXML.getElementsByTagName("fieldvalue");
var _eb={values:[]};
for(var _ec=0;_ec<_ea.length;_ec++){
var _ed={fieldId:_ea[_ec].getAttribute("fieldid"),value:_ea[_ec].getAttribute("value")};
_eb.values.push(_ed);
}
_e8.externalHandler(_eb,_e8.objectRef);
};
this.unlockRecord=function(_ee,_ef){
var url=dax_bridge.url+"UnlockRecord?sessionId="+dax_bridge.sessionId+"&tableid="+_ee+"&recordid="+_ef;
makeCall(url);
};
this.getInitInfo();
}
if(typeof (dax_bridge)=="undefined"){
dax_bridge=new bridge();
}
function dax_reports_getReportList(_f1){
var _f2=null;
if(_f1){
var _f2=getTable(_f1);
}
if(!_f2){
_f2="0";
}
var url=dax_bridge.url+"ReportsList?sessionid="+dax_bridge.sessionId+"&tableid="+_f2;
makeCall(url,dax_reports_getReportListHandler);
}
function dax_reports_getReportListHandler(_f4){
if(_f4.readyState!=4){
return;
}
var _f5=_f4.responseXML.getElementsByTagName("report");
dax_bridge.reports=[];
for(var _f6=0;_f6<dax_bridge.tables.length;_f6++){
dax_bridge.tables[_f6].reports=[];
}
for(var _f7=0;_f7<_f5.length;_f7++){
var _f8=getTable(_f5[_f7].getAttribute("tableid"));
if(_f8){
var _f9={description:_f5[_f7].getAttribute("description"),table:_f8,id:ReplaceString(_f5[_f7].getAttribute("id"),".xml",""),name:_f5[_f7].getAttribute("name"),type:_f5[_f7].getAttribute("type")};
if(_f8.reports==undefined){
_f8.reports=[];
}
_f8.reports.push(_f9);
}
dax_bridge.reports.push(_f9);
}
if(onAfterInit){
onAfterInit();
}
dax_loginSuccess();
if(aSidebar){
appendReportsToSidebar();
}
}
function initSessionId(_fa){
if(dax_bridge){
dax_bridge.sessionId=_fa;
dax_bridge.updateTables();
}
}
function getTable(_fb){
return dax_getTable(_fb);
}
function getField(_fc,_fd){
return dax_getField(_fc,_fd);
}
function dax_getTable(_fe){
if((!_fe)&&(!dax_bridge)){
return null;
}
if(isNaN(_fe)){
for(iTab=0;iTab<dax_bridge.tables.length;iTab++){
if(dax_bridge.tables[iTab].tablename==_fe){
return dax_bridge.tables[iTab];
}
}
}else{
for(iTab=0;iTab<dax_bridge.tables.length;iTab++){
if(dax_bridge.tables[iTab].tableid==_fe){
return dax_bridge.tables[iTab];
}
}
dax_bridge.getSingleTable(_fe);
for(iTab=0;iTab<dax_bridge.tables.length;iTab++){
if(dax_bridge.tables[iTab].tableid==_fe){
return dax_bridge.tables[iTab];
}
}
}
return null;
}
function dax_getField(_ff,_100){
if((!_ff)&&(!dax_bridge)){
return null;
}
if(_ff.toString().indexOf("]")!=-1){
_100=_ff;
if(_ff.toString().indexOf("][")!=-1){
tableNameArray=_ff.split("][");
}else{
tableNameArray=_ff.split("]");
}
if(tableNameArray[0]){
_ff=tableNameArray[0].substring(1);
if(!_ff){
return;
}
}
}
table=getTable(_ff);
if(!table){
return;
}
if(!(isNaN(_100))){
_100="["+table.tableid+"]["+_100+"]";
}
dax_bridge.cacheFields(table);
if(_100){
if(_100.indexOf("][")==-1){
if(_100.indexOf("]")!=-1){
newFieldNameArray=_100.split("]");
_100=newFieldNameArray[1];
}
for(var iFil=0;iFil<table.fields.length;iFil++){
if(table.fields[iFil].fieldname==_100){
return table.fields[iFil];
}
}
}else{
for(var iFil=0;iFil<table.fields.length;iFil++){
if(table.fields[iFil].fieldid==_100){
return table.fields[iFil];
}
}
}
}
return null;
}
function Query(_102){
if(_102){
this.table=getTable(_102);
}
this.batchMode=true;
this.lastRecord=false;
this.callRef=null;
this.die=false;
this.batchSize=10;
this.maxBatchSize=50;
this.currentPos=1;
this.queryFieldId=null;
this.queryComp=null;
this.queryValue=null;
this.queryEndRangeId=null;
this.breakLevel=0;
this.breakSelected=null;
this.breakGetLevel=null;
this.breakQueryId=null;
this.optionName=new Array();
this.optionValue=new Array();
this.maxChar=null;
this.formatObject=null;
this.queryName=null;
this.displayFields=new Array();
this.queryId=null;
this.recordsInSelection=0;
this.size=0;
this.updateQueryId=true;
this.autoPopulate=null;
this.clearQueryEngine=function(){
this.queryEngine={field:[],argument:[],value:[],andor:[]};
};
this.clearQueryEngine();
this.nextBatch=function(_103){
if(!this.batchMode){
return;
}
if(this.die){
this.lastRecord=true;
return;
}
if((!this.queryId)||(!this.currentPos)){
this.currentPos=1;
}
if(!this.queryId){
this.call(_103,this.currentPos,this.batchSize);
}else{
if(!this.currentPos){
return;
}
this.call(_103,this.currentPos,this.batchSize);
}
};
this.call=function(_104,_105,_106){
if(dax_bridge.sessionId){
if(this.queryId){
if(this.queryEngine.field.length>0){
var url=dax_bridge.url+"QueryEngine?sessionId="+dax_bridge.sessionId+"&queryid="+this.queryId+"&dax_qe_table="+this.table.tableid+"&dax_qe_start="+_105+"&dax_qe_length="+_106;
for(s=0;s<this.queryEngine.field.length;s++){
if((this.queryEngine.field[s])&&(this.queryEngine.argument[s])&&(this.queryEngine.value[s])&&(this.queryEngine.andor[s])){
url+="&dax_qe_field"+(s+1)+"="+this.queryEngine.field[s]+"&dax_qe_argument"+(s+1)+"="+this.queryEngine.argument[s]+"&dax_qe_searchvalue"+(s+1)+"="+dax_bridge.encode(this.queryEngine.value[s])+"&dax_qe_andor"+(s+1)+"="+this.queryEngine.andor[s];
}
}
}else{
if(this.breakLevel==0){
var url=dax_bridge.url+"query?sessionId="+dax_bridge.sessionId+"&queryid="+this.queryId+"&start="+_105+"&length="+_106+"&tableid="+this.table.tableid;
}
}
}else{
if(this.queryName){
if(this.queryEngine.field.length>0){
var url=dax_bridge.url+"QueryEngine?sessionId="+dax_bridge.sessionId+"&queryname="+dax_bridge.encode(this.queryName)+"&dax_qe_table="+this.table.tableid+"&dax_qe_start="+_105+"&dax_qe_length="+_106;
for(s=0;s<this.queryEngine.field.length;s++){
if((this.queryEngine.field[s])&&(this.queryEngine.argument[s])&&(this.queryEngine.value[s])&&(this.queryEngine.andor[s])){
url+="&dax_qe_field"+(s+1)+"="+this.queryEngine.field[s]+"&dax_qe_argument"+(s+1)+"="+this.queryEngine.argument[s]+"&dax_qe_searchvalue"+(s+1)+"="+dax_bridge.encode(this.queryEngine.value[s])+"&dax_qe_andor"+(s+1)+"="+this.queryEngine.andor[s];
}
}
}else{
if(this.breakLevel==0){
var url=dax_bridge.url+"query?sessionId="+dax_bridge.sessionId+"&queryname="+dax_bridge.encode(this.queryName)+"&start="+_105+"&length="+_106+"&tableid="+this.table.tableid;
}
}
}else{
if(this.queryEngine.field.length>0){
var url=dax_bridge.url+"QueryEngine?sessionId="+dax_bridge.sessionId+"&dax_qe_table="+this.table.tableid+"&dax_qe_start="+_105+"&dax_qe_length="+_106;
for(s=0;s<this.queryEngine.field.length;s++){
if((this.queryEngine.field[s])&&(this.queryEngine.argument[s])&&(this.queryEngine.value[s])&&(this.queryEngine.andor[s])){
url+="&dax_qe_field"+(s+1)+"="+this.queryEngine.field[s]+"&dax_qe_argument"+(s+1)+"="+this.queryEngine.argument[s]+"&dax_qe_searchvalue"+(s+1)+"="+dax_bridge.encode(this.queryEngine.value[s])+"&dax_qe_andor"+(s+1)+"="+this.queryEngine.andor[s];
}
}
}else{
if((this.breakLevel==0)&&(!this.breakGetLevel)){
var url=dax_bridge.url+"query?sessionId="+dax_bridge.sessionId+"&start="+_105+"&length="+_106+"&tableid="+this.table.tableid;
if((this.queryFieldId)&&(this.queryComp)&&(this.queryValue)){
url=url+"&fieldid="+this.queryFieldId+"&comp="+this.queryComp+"&value="+dax_bridge.encode(this.queryValue);
if(this.queryEndRangeId){
url=url+"&endrangeid="+this.queryEndRangeId;
}
}
}else{
if(this.breakGetLevel){
var url=dax_bridge.url+"query?sessionId="+dax_bridge.sessionId+"&start="+_105+"&length="+_106+"&tableid="+this.table.tableid+"&getbreak="+this.breakGetLevel+"&queryid="+this.breakQueryId+"&selected="+this.breakSelected;
}else{
if((this.breakSelected)&&(this.breakQueryId)){
var url=dax_bridge.url+"query?sessionId="+dax_bridge.sessionId+"&start="+_105+"&length="+_106+"&tableid="+this.table.tableid+"&breaklevel="+this.breakLevel+"&queryid="+this.breakQueryId+"&selected="+this.breakSelected;
}else{
var url=dax_bridge.url+"query?sessionId="+dax_bridge.sessionId+"&start="+_105+"&length="+_106+"&tableid="+this.table.tableid+"&breaklevel="+this.breakLevel;
}
}
}
}
}
}
if(this.displayFields.length>0){
url+="&display=";
for(s=0;s<this.displayFields.length;s++){
url+=this.displayFields[s]+",";
}
}
if(this.optionName.length>0){
for(s=0;s<this.optionName.length;s++){
url+="&"+this.optionName[s]+"="+this.optionValue[s];
}
}
if(this.maxChar){
url+="&maxchar="+this.maxChar;
}
debugAlert("<b>Query:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
makeCall(url,_104,this.callRef,false);
}else{
}
};
this.parseResult=function(_108){
var _109=_108.responseXML.getElementsByTagName("queryResult").item(0);
if(!_109){
return;
}
if(this.updateQueryId){
this.queryId=_109.getAttribute("queryid");
}
this.recordsInSelection=_109.getAttribute("recordsinselection");
this.size=_109.getAttribute("size");
if((parseFloat(this.currentPos)+parseFloat(this.size))<=this.recordsInSelection){
this.currentPos+=parseFloat(this.size);
}else{
this.lastRecord=true;
this.currentPos=this.size;
}
this.result=new Array();
var _10a=_109.getElementsByTagName("row");
for(i=0;i<_10a.length;i++){
var _10b=new Array();
var _10c=_10a[i].getElementsByTagName("field");
for(j=0;j<_10c.length;j++){
var _10d=(_10c[j].childNodes.length>0)?(_10c[j].firstChild.nodeValue):("");
if(_10d){
var _10e=getField(this.table.tableid,_10c[j].getAttribute("id"));
var _10f=_10e.fieldtype;
var _110=_10e.fieldformat;
if((_10f=="boolean")||(_10f=="date")){
_10d=doFormat(_10d,"4daf_default",_110,_10f,this.formatObject);
}else{
if(_110){
_10d=format(_110,_10d);
}
}
}
var _111={id:_10c[j].getAttribute("id"),value:_10d,originalValue:(_10c[j].childNodes.length>0)?(_10c[j].firstChild.nodeValue):(""),ddw:_10c[j].getAttribute("ddw"),ddwtype:_10c[j].getAttribute("ddwtype"),fieldrecordid:_10c[j].getAttribute("fieldrecordid"),height:_10c[j].getAttribute("height"),width:_10c[j].getAttribute("width")};
_10b.push(_111);
}
var row={recordid:_10a[i].getAttribute("recordid"),selectionid:_10a[i].getAttribute("selectionid"),fields:_10b};
this.result.push(row);
}
};
this.parseBreak=function(_113){
var _114=_113.responseXML.getElementsByTagName("queryResult").item(0);
if(!_114){
return;
}
this.queryId=_114.getAttribute("queryid");
this.recordsInSelection=_114.getAttribute("recordsinselection");
this.size=_114.getAttribute("size");
if((parseFloat(this.currentPos)+parseFloat(this.size))<=this.recordsInSelection){
this.currentPos+=parseFloat(this.size);
}else{
this.lastRecord=true;
this.currentPos=this.size;
}
this.fieldid=_114.getAttribute("fieldid");
this.result=new Array();
var _115=_114.getElementsByTagName("row");
for(i=0;i<_115.length;i++){
var _116=new Array();
var _117=_115[i].getElementsByTagName("field");
var row={value:(_115[i].firstChild)?_115[i].firstChild.nodeValue:"",ddw:_115[i].getAttribute("ddw"),ddwtype:_115[i].getAttribute("ddwtype"),ddwtitle:_115[i].getAttribute("ddwtitle")};
this.result.push(row);
}
};
}
function clearQuery(_119,_11a){
if(!_11a){
if(_119){
var url=dax_bridge.url+"clearQuery?sessionid="+dax_bridge.sessionId+"&queryid="+_119;
makeCall(url,null,null,null);
}
}else{
if((_119)&&(_119.length>0)){
var url=dax_bridge.url+"clearQuery?sessionid="+dax_bridge.sessionId+"&queryid=";
for(c=0;c<_119.length;c++){
url+=_119[c];
if(c!=(_119.length-1)){
url+=",";
}
}
makeCall(url,null,null,null);
}
}
}
function makeCall(url,_11d,_11e,_11f){
if(!_11f){
_11f=false;
}
if(!_11d){
_11d=function(_120,_121){
};
}
var _122=getXMLHttpRequest();
if(!_122){
return;
}
if(_11f==false){
_122.onreadystatechange=function(){
_11d(_122,_11e);
};
_122.open("GET",url,true);
_122.send(null);
}else{
_122.open("GET",url,false);
_122.send(null);
_11d(_122,_11e);
}
}
function makePostCall(url,_124,_125,_126,_127){
if(!_126){
_126=false;
}
if(!_124){
_124=function(_128,_129){
};
}
var _12a=getXMLHttpRequest();
if(!_12a){
return;
}
if(_126==false){
_12a.onreadystatechange=function(){
_124(_12a,_125);
};
_12a.open("POST",url,true);
_12a.send(_127);
}else{
_12a.open("POST",url,false);
_12a.send(_127);
_124(_12a,_125);
}
}
function deleteRecords(_12b,_12c){
if((_12b)&&(_12c)&&(dax_bridge.sessionId)){
var url=dax_bridge.url+"deleteRecord?sessionId="+dax_bridge.sessionId+"&tableId="+_12b+"&recordId=";
if(isArray(_12c)){
for(b=0;b<_12c.length;b++){
url+=_12c[b];
if((b+1)!=_12c.length){
url+=",";
}
}
}else{
url+=_12c;
}
makeCall(url,null,null,null);
}
}
function doFormat(_12e,_12f,_130,_131,_132){
if(_131){
var _133=_131.substring(0,1);
}else{
if(_12f){
var _133=_12f.substring(0,1);
}else{
var _133=_130.substring(0,1);
}
}
if(!_133){
return null;
}
switch(_133){
case "b":
var _134=STR["admin_values_boolean"];
break;
case "d":
var _134=STR["admin_values_date"];
break;
}
if(_12f){
_12f=_12f.substring(1);
if(_12f=="1"){
_12f=_134[1].substring(1);
}
}else{
_12f=_134[1].substring(1);
}
if(_130){
_130=_130.substring(1);
if(_130=="1"){
_130=_134[1].substring(1);
}
}else{
_130=_134[1].substring(1);
}
switch(_133){
case "d":
if((!_12f)||(_12f=="YYYY-MM-DD")||(_12f=="MM-DD-YYYY")||(_12f=="DD-MM-YYYY")||(_12f=="DD-MMM-YYYY")||(_12f=="daf_default")){
var _135=_12e.split("-");
}else{
return null;
}
if(_135.length==3){
switch(_12f){
case "MM-DD-YYYY":
var fDay=+_135[1];
var _137=+_135[0];
var _138=+_135[2];
break;
case "YYYY-MM-DD":
var fDay=+_135[2];
var _137=+_135[1];
var _138=+_135[0];
break;
case "DD-MM-YYYY":
var fDay=+_135[0];
var _137=+_135[1];
var _138=+_135[2];
break;
case "DD-MMM-YYYY":
var fDay=+_135[0];
if((""+parseInt(+_135[1]))==+_135[1]){
var _137=+_135[1];
}else{
var _137=+(findInArray(STR["calendar_month_abr"],_135[1],null,true))+1;
}
var _138=+_135[2];
break;
case "4daf_default":
default:
var fDay=+_135[2];
var _137=+_135[1];
var _138=+_135[0];
break;
}
}else{
return null;
}
if(_137>12){
_137=12;
}
if(_137<1){
_137=1;
}
if(_138<999){
_138+=2000;
}
fValidateDate=new Date(_138,(_137-1),fDay);
if(fValidateDate.getFullYear()!=_138){
var _139=new Date();
_138=_139.getFullYear();
}
if(fValidateDate.getMonth()!=(_137-1)){
_137=0;
}
if(fValidateDate.getDate()!=fDay){
fDay=1;
}
if(_137<10){
_137="0"+_137;
}
if(fDay<10){
fDay="0"+fDay;
}
switch(_130){
case "MM-DD-YYYY":
var _13a=""+_137+"-"+fDay+"-"+_138;
break;
case "DD-MM-YYYY":
var _13a=""+fDay+"-"+_137+"-"+_138;
break;
case "DD-MMM-YYYY":
var _13a=""+fDay+"-"+STR["calendar_month_abr"][(_137-1)]+"-"+_138;
break;
case "YYYY-MM-DD":
var _13a=""+_138+"-"+_137+"-"+fDay;
break;
case "daf_default":
default:
var _13a=""+_138+"-"+_137+"-"+fDay;
break;
}
return _13a;
break;
case "b":
switch(_12f){
case "True":
if(STR["ttrue"].toLowerCase()==_12e.toLowerCase()){
var _13b=true;
}else{
var _13b=false;
}
break;
case "Yes":
if(STR["yes"].toLowerCase()==_12e.toLowerCase()){
var _13b=true;
}else{
var _13b=false;
}
break;
case "Male":
if(STR["male"].toLowerCase()==_12e.toLowerCase()){
var _13b=true;
}else{
var _13b=false;
}
break;
case "daf_default":
default:
if("true"==_12e.toLowerCase()){
var _13b=true;
}else{
var _13b=false;
}
break;
}
if(_13b){
switch(_130){
case "True":
var _13a=STR["ttrue"];
break;
case "Yes":
var _13a=STR["yes"];
break;
case "Male":
var _13a=STR["male"];
break;
case "Checkbox":
if(_132=="calendar"){
var _13a="<div style=\"text-align:center; float: left\"><div class=\"fourdaf_checkbox_check\"></div></div>";
}else{
var _13a="<div style=\"text-align:center;\"><div class=\"fourdaf_checkbox_check\"></div></div>";
}
break;
case "daf_default":
default:
var _13a="True";
break;
}
}else{
switch(_130){
case "True":
var _13a=STR["ffalse"];
break;
case "Yes":
var _13a=STR["no"];
break;
case "Male":
var _13a=STR["female"];
break;
case "Checkbox":
if(_132=="calendar"){
var _13a="<div style=\"text-align:center; float: left\"><div class=\"fourdaf_checkbox_uncheck\"></div></div>";
}else{
var _13a="<div style=\"text-align:center;\"><div class=\"fourdaf_checkbox_uncheck\"></div></div>";
}
break;
case "daf_default":
default:
var _13a="False";
break;
}
}
return _13a;
}
}
function generateUniqueId(obj){
var idC=dax_uniqueId++;
var idN=obj.id;
if(!idN){
idN="gen_id_";
}
obj.id=idN+idC;
}
function placeRecordData(_13f,_140,_141,_142,_143){
if(!_13f){
debugAlert("placeRecord data needs target node reference where record data will be placed");
return false;
}
if(_140){
switch(_140.toString()){
case "[object ImageBrowserCell]":
if(_140.recordId){
var _142=_140.recordId;
var _141=_140.boundTo.table.tableid;
}else{
debugAlert("placeRecordData could not find table or record id for image browser/data matrix.");
return false;
}
var url=dax_bridge.url+"GetRecord?sessionid="+dax_bridge.sessionId+"&tableid="+_141+"&recordid="+_142;
var _145={targetRef:_13f,objectRef:_140,tableId:_141,recordId:_142};
_145.onPopulateFunction=_143;
makeCall(url,onPlaceRecordData,_145);
break;
case "[object DataTreeGridRow]":
if(_140.recordId){
var _142=_140.recordId;
var _141=_140.prv.mParent.owner.table.tableid;
}else{
debugAlert("placeRecordData could not find table or record id for data tree row.");
return false;
}
var url=dax_bridge.url+"GetRecord?sessionid="+dax_bridge.sessionId+"&tableid="+_141+"&recordid="+_142;
var _145={targetRef:_13f,objectRef:_140,tableId:_141,recordId:_142};
_145.onPopulateFunction=_143;
makeCall(url,onPlaceRecordData,_145);
break;
case "[object CalendarCell]":
if(_140.recordId){
var _142=_140.recordId;
var _141=_140.owner.table.tableid;
}else{
debugAlert("placeRecordData could not find table or record id for calendar cell.");
return false;
}
var url=dax_bridge.url+"GetRecord?sessionid="+dax_bridge.sessionId+"&tableid="+_141+"&recordid="+_142;
var _145={targetRef:_13f,objectRef:_140,tableId:_141,recordId:_142};
_145.onPopulateFunction=_143;
makeCall(url,onPlaceRecordData,_145);
break;
case "[object GridRow]":
if(_140.recordId){
var _142=_140.recordId;
var _141=_140.prv.mParent.owner.owner.table.tableid;
}else{
debugAlert("placeRecordData could not find table or record id for calendar cell.");
return false;
}
var url=dax_bridge.url+"GetRecord?sessionid="+dax_bridge.sessionId+"&tableid="+_141+"&recordid="+_142;
var _145={targetRef:_13f,objectRef:_140,tableId:_141,recordId:_142};
_145.onPopulateFunction=_143;
makeCall(url,onPlaceRecordData,_145);
break;
}
}else{
if((!_141)||(!_142)){
debugAlert("placeRecord needs table and record id since object reference isn't passed.");
return false;
}
_141=getTable(_141);
if(!_141){
debugAlert("placeRecord could not find the passed table.");
return false;
}
var url=dax_bridge.url+"GetRecord?sessionid="+dax_bridge.sessionId+"&tableid="+_141.tableid+"&recordid="+_142;
var _145={targetRef:_13f,objectRef:null,tableId:_141,recordId:_142};
_145.onPopulateFunction=_143;
makeCall(url,onPlaceRecordData,_145);
}
}
function onPlaceRecordData(_146,_147){
if(_146.readyState!=4){
return;
}
placeQuery=new Query(_147.tableId);
placeQuery.parseResult(_146);
var _148=getElementsByClassName(_147.targetRef,"4daf_",true);
if(!(_148.length>0)){
debugAlert("No valid page objects found for placeRecordData call.");
return false;
}
for(var _149=0;_149<_148.length;_149++){
var _14a=_148[_149].className;
var _14b=_14a.split(" ");
var _14c=findInArray(_14b,"4daf_",0,false,true);
var _14d=ReplaceString(_14b[_14c],"."," ");
var _14e=getField(_14d.slice(5));
if(!_14e){
debugAlert("placeRecordData could not find the field "+_14b[_14c].slice(5));
return false;
}
var _14f=placeQuery.result;
if(_14f){
if(_14f.length>0){
for(var _150=0;_150<_14f[0].fields.length;_150++){
if(_14f[0].fields[_150].id==_14e.fieldid){
if((_14e.fieldtype=="picture")&&(_148[_149].nodeName.toLowerCase()=="img")){
_148[_149].src=_14f[0].fields[_150].value;
}else{
if(_148[_149].nodeName.toLowerCase()=="input"){
_148[_149].value=_14f[0].fields[_150].value;
}else{
if(_148[_149].nodeName.toLowerCase()=="div"){
_148[_149].innerHTML=_14f[0].fields[_150].value;
}else{
if(_148[_149].nodeName.toLowerCase()=="span"){
_148[_149].innerHTML=_14f[0].fields[_150].value;
}else{
if(_148[_149].nodeName.toLowerCase()=="textarea"){
_148[_149].innerHTML=_14f[0].fields[_150].value;
}else{
if(_148[_149].nodeName.toLowerCase()=="td"){
_148[_149].innerHTML=_14f[0].fields[_150].value;
}
}
}
}
}
}
}
}
}
}
}
if(_147.onPopulateFunction){
_147.onPopulateFunction(_147.tableId,_147.recordId);
}
}
function saveRecordData(_151,_152,_153){
var _154=getElementsByClassName(_151,"4daf_",true);
if(!(_154.length>0)){
debugAlert("No valid page objects found for placeRecordData call.");
return false;
}
var url=dax_bridge.url+"addRecord?sessionid="+connection.sessionId+"&tableid="+getTable(_152).tableid;
for(var _156=0;_156<_154.length;_156++){
var _157=_154[_156].className;
var _158=_157.split(" ");
var _159=findInArray(_158,"4daf_",0,false,true);
var _15a=getField(_158[_159].slice(5));
if(!_15a){
debugAlert("placeRecordData could not find the field "+_158[_159].slice(5));
break;
}
var _15b="";
if((_154[_156].nodeName.toLowerCase()=="input")&&(_154[_156].type=="text")){
_15b=_154[_156].value;
}else{
if((_154[_156].nodeName.toLowerCase()=="input")&&(_154[_156].type=="hidden")){
_15b=_154[_156].value;
}else{
if(_154[_156].nodeName.toLowerCase()=="textarea"){
_15b=_154[_156].value;
}else{
if((_154[_156].nodeName.toLowerCase()=="input")&&(_154[_156].type=="checkbox")){
_15b=_154[_156].checked;
}
}
}
}
url+="&field"+_15a.fieldid+"="+_15b;
}
makeCall(url,onSaveRecordData,_153);
}
function onSaveRecordData(_15c,_15d){
if(_15c.readyState!=4){
return;
}
if(_15d){
_15d(_15c);
}
}
function checkResponse(_15e){
if(!_15e){
return true;
}
if(!_15e.responseXML){
return true;
}
var _15f=_15e.responseXML.getElementsByTagName("error").item(0);
if(!_15f){
return false;
}
var _160=_15f.getElementsByTagName("errorCode");
if((_160)&&(_160[0])){
var _161=_160[0];
var _162=_161.getAttribute("hint");
var _163=_161.getAttribute("message");
switch(_162){
case "IllegalAccessPoint":
case "InvalidSessionId":
if(dax_bridge.isClient){
if(dax_bridge.shuttingDown){
return;
}else{
dax_bridge.shuttingDown=true;
}
alert(_163);
window.onbeforeunload=null;
window.location.reload(false);
break;
}else{
debugAlert("<b>Error</b> (code: "+_162+"): "+_163);
if(typeof (console)!="undefined"){
if(typeof (console.log)!="undefined"){
console.log("4DAF error (code: "+_162+"): "+_163);
}
}
fourdaf_dev_errorTrap(_162,_163);
return true;
}
default:
debugAlert("<b>Error</b> (code: "+_162+"): "+_163);
if(typeof (console)!="undefined"){
if(typeof (console.log)!="undefined"){
console.log("4DAF error (code: "+_162+"): "+_163);
}
}
fourdaf_dev_errorTrap(_162,_163);
return true;
}
}
}
function DAX_Bridge_GetChoiceList(_164,_165){
var url=dax_bridge.url+"GetChoiceList?sessionid="+dax_bridge.sessionId+"&choicelist="+_164;
makeCall(url,DAX_Bridge_GetChoiceList_handler,_165);
}
function DAX_Bridge_GetChoiceList_handler(_167,_168){
if(_167.readyState!=4){
return;
}
var _169=checkResponse(_167);
if(_169){
debugAlert("getChoiceList request error.");
_168.choicelistloaded=true;
return false;
}
if(_168.selectedIndex>-1){
var _16a=(_168.options[_168.selectedIndex].value)?(_168.options[_168.selectedIndex].value):null;
}else{
var _16a=null;
}
var _16b=false;
var list=_167.responseXML.getElementsByTagName("list").item(0);
var _16d=list?list.getElementsByTagName("listitem"):null;
if(_16a){
if(_168.format.charAt(0)=="d"){
_16a=doFormat(_16a,"4daf_default",_168.format,"date");
}
}
if(!_16d){
if(_16a){
_168.options[0]=new Option(_16a,_16a);
}else{
_168.options[0]=new Option(STR["no_data_found"],null);
}
_168.selectedIndex=0;
_168.choicelistloaded=true;
return false;
}
if(_16d.length==0){
if(_16a){
_168.options[0]=new Option(_16a,_16a);
}else{
_168.options[0]=new Option(STR["no_data_found"],null);
}
_168.selectedIndex=0;
_168.choicelistloaded=true;
return false;
}
_168.options.length=0;
for(var _16e=0;_16e<_16d.length;_16e++){
var _16f=(_16d.item(_16e).firstChild)?(_16d.item(_16e).firstChild.nodeValue):null;
if(_16f){
if(_168.format.charAt(0)=="d"){
_16f=doFormat(_16f,"YYYY-MM-DD",_168.format,"date");
}
_168.options[_16e]=new Option(_16f,_16f);
if(_16a){
if(_16f==_16a){
_168.selectedIndex=_16e;
_16b=true;
}
}
}
}
_168.onchange(true);
if(!_168.disableChoiceList){
_168.disabled=false;
}
_168.choicelistloaded=true;
}
function Connection(){
this.sessionId="";
this.language="";
this.address=new Object();
this.address.url="/DAX/";
this.address.login=this.address.url+"Login";
this.address.gettablelist=this.address.url+"GetTableList";
this.address.getfieldlist=this.address.url+"GetFieldList";
this.address.allrecords=this.address.url+"AllRecords";
this.address.query=this.address.url+"Query";
this.address.clearquery=this.address.url+"ClearQuery";
this.address.getrecord=this.address.url+"GetRecord";
this.address.deleterecord=this.address.url+"DeleteRecord";
this.address.modifyrecord=this.address.url+"ModifyRecord";
this.address.addrecord=this.address.url+"AddRecord";
this.address.getrelatedlist=this.address.url+"GetRelatedList";
this.address.executecallback=this.address.url+"ExecuteCallBack";
this.address.getcallback=this.address.url+"GetCallBack";
this.address.getDDWInfo=this.address.url+"GetDDWInfo";
this.address.getgeneralprefs=this.address.url+"GetPreferences";
this.address.getgrouplist=this.address.url+"AdminGetGroupList";
this.address.admingettablepreferences=this.address.url+"AdminGetTablePreferences";
this.address.admingetfieldpreferences=this.address.url+"AdminGetFieldPreferences";
this.address.adminsettablepreferences=this.address.url+"AdminSetTablePreferences";
this.address.adminsetfieldpreferences=this.address.url+"AdminSetFieldPreferences";
this.address.adminsetselectionview=this.address.url+"AdminSetSelectionView";
this.address.adminsetfieldbreakpoint=this.address.url+"AdminSetBreakPoint";
this.address.admincreatenewview=this.address.url+"AdminCreateVirtualTable";
this.address.admindeleteview=this.address.url+"AdminDeleteVirtualTable";
this.address.admingetrelatedtables=this.address.url+"AdminGetRelatedTable";
this.address.admingetgeneralprefs=this.address.url+"AdminGetPreferences";
this.address.adminsetgeneralprefs=this.address.url+"AdminSetPreferences";
this.address.admingetcallback=this.address.url+"AdminGetCallBack";
this.address.adminsetcallback=this.address.url+"AdminSetCallBack";
this.address.adminsettableposition=this.address.url+"AdminSetTablePosition";
this.address.adminsetfieldposition=this.address.url+"AdminSetFieldPosition";
this.address.admincreateDDWinfo=this.address.url+"AdminCreateDDWInfo";
this.address.admindeleteDDWinfo=this.address.url+"AdminDeleteDDW";
this.address.adminsetDDWtoobject=this.address.url+"AdminSetDDWToObject";
this.address.admingetQueryList=this.address.url+"AdminGetQueriesList";
this.address.adminsetQueryInfo=this.address.url+"AdminSetQueryInfo";
this.address.admindeleteQuery=this.address.url+"AdminDeleteQuery";
this.address.admingetquerytemplates=this.address.url+"AdminGetQueryTemplates";
this.address.adminSetQueryTemplate=this.address.url+"AdminSetQueryTemplate";
this.address.adminSetQueryPosition=this.address.url+"AdminSetQueryPosition";
this.address.AdminSetAllRecords=this.address.url+"AdminSetAllRecords";
this.address.AdminGetAllRecords=this.address.url+"AdminGetAllRecords";
this.address.AdminGetFormats=this.address.url+"getformats";
this.address.AdminDeleteReport=this.address.url+"DeleteReport";
this.address.admingetReportList=this.address.url+"ReportsList";
this.address.adminLoadReport=this.address.url+"LoadReport";
this.command=function(_170){
return this.address.url+_170+"?sessionid="+this.sessionId;
};
this.setAddress=function(url){
this.address.url=url;
};
this.admin=false;
}
var connection=new Connection();
function getXMLHttpRequest(){
var _172=false;
if(window.XMLHttpRequest){
_172=new XMLHttpRequest();
if(_172.overrideMimeType){
_172.overrideMimeType("text/xml");
}
}else{
if(window.ActiveXObject){
}
}
return _172;
}
function makeRequest(url,_174,_175){
var _176=getXMLHttpRequest();
if(!_176){
return;
}
_176.onreadystatechange=function(){
_174(_176);
};
var _177="GET";
if(_175){
_177="POST";
}
try{
_176.open(_177,url,true);
if(_175){
_176.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
}
_176.send(_175);
}
catch(e){
alert(e);
}
}
function buildFieldList(_178){
var _179=getXMLHttpRequest();
if(_179){
try{
var url=connection.address.getfieldlist+"?tableid="+_178+"&sessionid="+connection.sessionId;
_179.open("GET",url,false);
_179.send(null);
drawFields(_179,_178);
}
catch(e){
}
}
}
function drawFields(_17b,_17c){
if(_17b.readyState!=4||_17b.status!=200){
return;
}
var _17d=_17b.responseXML.getElementsByTagName("fields").item(0);
var _17e=_17d?_17d.getElementsByTagName("field"):null;
var tp=structure;
var _17d=null;
for(var i in tp.tables){
if(tp.tables[i].tableid==_17c){
_17d=tp.tables[i];
_17d.fields=new Array();
}
}
if(!_17e){
_17d.updating=false;
if(browser.ie6){
_17b.onreadystatechange=function(){
};
}else{
_17b.onreadystatechange=null;
}
delete _17b;
return;
}
for(var i=0;i<_17e.length;i++){
field_name=_17e.item(i).getAttribute("alias");
field_id=_17e.item(i).getAttribute("id");
field_type=_17e.item(i).getAttribute("type");
field_unique=_17e.item(i).getAttribute("unique");
field_mandatory=_17e.item(i).getAttribute("mandatory");
field_nonmodifiable=_17e.item(i).getAttribute("nonModifiable");
field_nonenterable=_17e.item(i).getAttribute("nonEnterable");
field_breaklevel=_17e.item(i).getAttribute("breaklevel");
field_format=_17e.item(i).getAttribute("format");
field_ddw=_17e.item(i).getAttribute("ddw");
field_fieldrecordid=_17e.item(i).getAttribute("fieldrecordid");
if(_17d){
var _181={fieldname:field_name,fieldid:field_id,fieldtype:field_type,fieldunique:field_unique,fieldmandatory:field_mandatory,fieldnonModifiable:field_nonmodifiable,fieldnonEnterable:field_nonenterable,fieldbreaklevel:field_breaklevel,fieldformat:field_format,fieldddw:field_ddw,fieldrecordid:field_fieldrecordid};
_17d.fields.push(_181);
}
}
if(_17d){
_17d.cached=true;
_17d.updating=false;
}
if(browser.ie6){
_17b.onreadystatechange=function(){
};
}else{
_17b.onreadystatechange=null;
}
delete _17b;
}
function buildTableList(_182){
if(_182.readyState!=4){
return;
}
var _183=_182.responseXML.getElementsByTagName("tables").item(0);
var _184=_183?_183.getElementsByTagName("table"):null;
if(!_184){
return;
}
structure.tables.length=0;
for(i=0;i<_184.length;i++){
var _185=_184.item(i).getAttribute("id");
var _186=_184.item(i).getAttribute("alias");
var _187={tableid:_185,tablename:_186,updating:true,cached:false};
_187.updating=false;
structure.tables.push(_187);
}
structure.updating=false;
structure.cached=true;
if(browser.ie6){
_182.onreadystatechange=function(){
};
}else{
_182.onreadystatechange=null;
}
delete _182;
}
function errorCheck(_188){
try{
var _189=_188.getElementsByTagName("error");
if(_189){
_189=_189.item(0);
}else{
return false;
}
var _18a=_189.getElementsByTagName("errorCode");
if(_18a){
_18a=_18a.item(0);
}else{
return false;
}
var text=getTextNode(_18a);
err=text.nodeValue;
on_error(err);
return true;
}
catch(e){
}
return false;
}
function login(_18c){
if(_18c.readyState!=4){
return;
}
$("loginspinner").style.display="none";
var _18d=_18c.responseXML;
if(checkResponse(_18c)){
on_login_error();
return;
}
_18d=_18d.getElementsByTagName("loginresult").item(0);
if(!_18d){
return;
}
var _18e=_18d.getAttribute("success")=="true";
if(_18e){
var _18f=_18d.getElementsByTagName("sessionId").item(0);
connection.language=_18d.getAttribute("language");
if(_18f){
connection.sessionId=_18f.firstChild.nodeValue;
connection.admin=_18f.getAttribute("AdminFlag")!="no";
if(AdminShowAdmin){
if(!connection.admin){
on_login_error();
}else{
on_login_success();
}
}else{
on_login_success();
}
}else{
on_login_error();
}
}else{
on_login_error();
}
if(browser.ie6){
_18c.onreadystatechange=function(){
};
}else{
_18c.onreadystatechange=null;
}
delete _18c;
}
function query(_190,_191){
if(_190.readyState!=4){
return;
}
var _192=_190.responseXML.getElementsByTagName("queryResult").item(0);
checkResponse(_190);
if(!_192){
if(_191.onafterload){
_191.onafterload(false);
}
return;
}
var _193=_192.getAttribute("tableid");
var _194=_192.getAttribute("queryid");
var _195=_192.getAttribute("tablename");
var _196=_192.getAttribute("recordsinselection");
var rows=_192.getElementsByTagName("row");
var _198=null;
var grid=null;
if(_191.grid!=null&&_191.grid!=undefined){
grid=_191.grid;
}else{
grid=new Grid();
_191.appendChild(grid.dom);
_191.grid=grid;
var _19a=new Array();
grid.total=_196;
}
for(var i=0;i<rows.length;i++){
var row=new Array();
var _19d=rows.item(i).getElementsByTagName("field");
for(var k=0;k<_19d.length;k++){
var _19f=getTextNode(_19d.item(k));
if(_19f!=null||_19f!=undefined){
row[k]=_19f.nodeValue;
}else{
row[k]="";
}
if(i==0&&isDefined(_19a)){
_19a[k]=_19d.item(k).getAttribute("name");
}
}
grid.insertRow(row);
}
if(isDefined(_19a)){
for(var i=0;i<_19a.length;i++){
grid.column(i).setTitle(_19a[i]);
}
var _1a0=new GridColumn();
_1a0.type=0;
var _1a1=grid.length;
}else{
var _1a0=grid.column(0);
}
grid.refresh();
if(_191.onafterload){
_191.onafterload(true);
}
if(browser.ie6){
_190.onreadystatechange=function(){
};
}else{
_190.onreadystatechange=null;
}
delete _190;
}
function refresh_table(obj){
var _1a3=null;
if(!(_1a3=getParentByClassName(obj,"window_toolbar"))){
return;
}
var _1a4=_1a3.parent.contentArea;
var grid=_1a4.grid;
grid.reload();
}
function expandRecord(_1a6,row){
if(_1a6.readyState!=4){
return;
}
var _1a8=_1a6.responseXML.getElementsByTagName("queryResult").item(0);
var _1a9=checkResponse(_1a6);
var _1aa=_1a8.getAttribute("tableid");
var _1ab=row.parentNode;
var _1ac=row.getElementsByTagName("td").length;
var _1ad=_1a8.getElementsByTagName("row").item(0);
var _1ae=_1ad.getAttribute("recordid");
var _1af=_1ad.getElementsByTagName("field");
_1ab=drawRecordInput(_1af,_1ab,_1aa);
var _1b0=_1ab.recordInput.getElementsByTagName("input");
for(var i=0;i<_1af.length;i++){
var _1b2=_1af.item(i).getAttribute("name");
var _1b3=_1af.item(i).getAttribute("id");
var _1b4=structure.getField(_1aa,_1b3).fieldtype;
for(var k=0;k<_1b0.length;k++){
var _1b6=_1b0.item(i);
if(_1b6.name==_1b2){
var text=getTextNode(_1af.item(i));
switch(_1b4){
case "picture":
_1b6.img.src=text.nodeValue;
_1b6.href.href=_1b6.img.src;
break;
default:
if(text){
_1b6.value=text.nodeValue;
}
}
k=_1b0.length;
}
}
}
_1ab.expander.parent=row;
if(browser.ie){
_1ab.expander.style.display="block";
}else{
_1ab.expander.style.display="table-row";
}
_1ab.recordInput.recordid=_1ae;
_1ab.recordInput.tableid=_1aa;
_1ab.recordInput.style.visibility="visible";
_1ab.recordInput.style.display="block";
_1ab.expanded=true;
_1ab.insertBefore(_1ab.expander,row.nextSibling);
if(browser.ie6){
_1a6.onreadystatechange=function(){
};
}else{
_1a6.onreadystatechange=null;
}
delete _1a6;
}
function selectRecord(_1b8){
var row=this.parentNode.parentNode.parentNode;
if(!row.selected){
row.className="recordHighlight";
row.selected=true;
}else{
if(row.selectionid%2){
row.className="recordLine";
}else{
row.className="recordLineAlt";
}
row.selected=false;
}
_1b8.cancelBubble=true;
_1b8.returnValue=false;
}
function delete_records(obj){
var _1bb=null;
if(!(_1bb=getParentByClassName(obj,"window_toolbar"))){
return;
}
var win=_1bb.parent;
var _1bd=win.contentArea;
var grid=_1bd.grid;
if(!isDefined(grid.selection)||!isDefined(grid.selection.selected)){
return;
}
var rv=confirm(STR["confirm_delete_records"]);
if(!rv){
return;
}
var url=connection.command(DB.DELETE_RECORD);
var _1c1="sessionid="+connection.sessionId+"&tableid="+grid.selection.tableId+"&recordid=";
for(recordId in grid.selection.selected){
if(grid.selection.selected[recordId]){
_1c1+=recordId+",";
}
}
var _1c2=getXMLHttpRequest();
if(!_1c2){
return;
}
try{
debugAlert("<b>delete_record url:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
debugAlert("<b>delete_record post:</b>"+_1c1);
_1c2.onreadystatechange=function(){
deleteRecord(_1c2,obj);
};
_1c2.open("POST",url,true);
_1c2.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
_1c2.send(_1c1);
}
catch(e){
alert(e);
if(browser.ie6){
_1c2.onreadystatechange=function(){
};
}else{
_1c2.onreadystatechange=null;
}
delete _1c2;
}
}
function deleteRecord(_1c3,obj){
if(_1c3.readyState!=4){
return;
}
var _1c5=_1c3.responseXML.getElementsByTagName("result").item(0);
var _1c6=checkResponse(_1c3);
if(!isDefined(_1c5)){
var _1c7=_1c3.responseXML.getElementsByTagName("errorCode");
if((_1c7)&&(_1c7[0])){
var _1c8=_1c7[0];
alert(_1c8.getAttribute("message"));
}
if(browser.ie6){
_1c3.onreadystatechange=function(){
};
}else{
_1c3.onreadystatechange=null;
}
delete _1c3;
return;
}
var _1c9=null;
if(!(_1c9=getParentByClassName(obj,"window_toolbar"))){
return;
}
var win=_1c9.parent;
var _1cb=win.contentArea;
var grid=_1cb.grid;
if(grid.selection.selected){
grid.selection.selected=new Array();
}
inline_query(obj,null,"*");
if(browser.ie6){
_1c3.onreadystatechange=function(){
};
}else{
_1c3.onreadystatechange=null;
}
delete _1c3;
}
function save_new_record(_1cd){
if(!_1cd){
return;
}
var url=connection.address.addrecord+"?sessionid="+connection.sessionId+"&tableid="+_1cd.tableid;
var _1cf=getElementsByClassName(_1cd,"fieldValue");
for(var i=0;i<_1cf.length;i++){
url+="&field"+_1cf[i].fieldid+"="+_1cf[i].value;
}
makeRequest(url,saveRecord,null);
}
function save_record(obj){
var _1d2=getParentByClassName(obj,"recordInput");
if(!_1d2){
return;
}
var url=connection.address.modifyrecord+"?sessionid="+connection.sessionId+"&tableid="+_1d2.tableid+"&recordid="+_1d2.recordid;
var _1d4=getElementsByClassName(_1d2,"fieldValue");
for(var i=0;i<_1d4.length;i++){
url+="&field"+_1d4[i].fieldid+"="+_1d4[i].value;
}
makeRequest(url,saveRecord,null);
}
function saveRecord(_1d6){
if(_1d6.readyState!=4){
return;
}
if(browser.ie6){
_1d6.onreadystatechange=function(){
};
}else{
_1d6.onreadystatechange=null;
}
delete _1d6;
}
function close_record(obj){
var _1d8=getParentByClassName(obj,"recordInput");
var _1d9=_1d8.parentNode;
var _1da=_1d9.parerentNode;
_1d9.style.display="none";
_1da.expanded=false;
}
function create_record(obj){
var _1dc=null;
if(!(_1dc=getParentByClassName(obj,"window_toolbar"))){
return;
}
var win=_1dc.parent;
if(win.table.fieldsDetail.length==0){
return false;
}
var _1de=win.getEditor();
var grid=win.contentArea.grid;
_1de.record={recordId:-1,tableId:grid.selection.tableId};
_1de.buildEditorByTable(grid.selection.tableId);
_1de.edit();
}
function save_query(obj,_1e1,_1e2,_1e3,_1e4){
var _1e5=null;
if(!(_1e5=getParentByClassName(obj,"window_toolbar"))){
return;
}
var win=_1e5.parent;
var _1e7=win.toolbars[1];
if(_1e7!=null&&_1e7!=undefined){
var tabs=_1e7.parent;
var _1e9=tabs.current.tooltip;
var tab=tabs.insert(_1e3);
tab.m.innerHTML="<div style=\"display:inline; float: left\">"+_1e3+"</div><div class=\"dax_taskbar_close\"></div>";
if(_1e9){
tab.tooltip=_1e9+" "+STR["and"]+" <br />";
}else{
tab.tooltip="";
}
var _1eb=getElementByClassName(tab.m,"dax_taskbar_close");
if(_1eb){
_1eb.boundTo=tab;
_1eb.onclick=function(){
var tabs=this.boundTo.parent;
if(!tabs.lock){
tabs.lock=true;
if(this.boundTo.tooltip){
hideTooltip();
}
tabs.remove(this.boundTo.index);
tabs.refresh();
tabs.lock=false;
}
};
}
tab.tooltip+="<b>"+getField(_1e1,_1e2).fieldalias+"</b> "+STR["starts_with"]+" <b>"+_1e3+"</b>";
obj.owner.currentQueryId=obj.owner.grid.receivedQueryId;
obj.owner.grid.currentQueryId=obj.owner.grid.receivedQueryId;
obj.owner.search.inputBox.queryId=obj.owner.grid.receivedQueryId;
obj.owner.grid.selection.queryId=obj.owner.grid.receivedQueryId;
obj.inputBox.queryId=obj.owner.grid.receivedQueryId;
tab.owner=obj.owner;
tab.queryId=_1e4;
obj.owner.currentTab=tab;
tab.onswitch=function(){
if(this.owner.grid.selection){
this.owner.grid.selection.selected=new Array();
}
this.owner.currentTab=this;
inline_query(obj,_1e2,"*",this.queryId);
this.owner.search.inputBox.value="";
getElementByClassName(this.owner.dom,"queryname").queryId=this.queryId;
};
tab.userMouseOver=function(_1ed){
if(this.tooltip){
objectPos=getObjectPosition(this.r);
showTooltip(this.tooltip,objectPos.x,objectPos.y+this.r.offsetHeight);
}
};
tab.userMouseOut=function(_1ee){
if(this.tooltip){
hideTooltip();
}
};
tabs.refresh();
}
}
function activateTab(_1ef,tab){
tab.actor.className="tabItemActive";
var _1f1=tab.parent;
_1f1.current=tab;
for(var i in _1f1.tabs){
if(_1f1.tabs[i]!=tab){
_1f1.tabs[i].actor.className="tabItemInactive";
}
}
on_tab_switched(tab);
}
function drawRecordInput(_1f3,_1f4,_1f5){
if(!_1f3||!_1f4){
return;
}
if(!_1f4.expander){
_1f4.expander=document.createElement("tr");
var area=document.createElement("td");
area.colSpan=_1f3.length+1;
var doc=frames["framework"].document;
_1f4.recordInput=getElementByClassName(doc,"recordInput").cloneNode(true);
for(var i=0;i<_1f3.length;i++){
var _1f9=_1f3.item(i).getAttribute("id");
var _1fa=getElementByClassName(_1f4.recordInput,"fieldLabel");
var _1fb=getElementByClassName(_1f4.recordInput,"fieldArea");
var _1fc=structure.getField(_1f5,_1f9).fieldtype;
if(i>0){
_1fa=_1fa.cloneNode(true);
_1fb=_1fb.cloneNode(true);
}else{
var _1fd=_1fb.parentNode;
var _1fe=_1fd.parentNode;
var _1ff=_1fd.nextSibling;
}
var _200=_1f3.item(i).getAttribute("name");
_1fa.innerHTML=_200;
var _201=_1fb.getElementsByTagName("input").item(0);
switch(_1fc){
case "picture":
var img=document.createElement("img");
img.style.width="125px";
img.style.height="125px";
img.style.borderWidth="0px";
var link=document.createElement("a");
link.target="_blank";
link.appendChild(img);
_1fb.insertBefore(link,_201);
_201.img=img;
_201.href=link;
_201.style.display="none";
default:
_201.name=_200;
_201.fieldid=_1f9;
}
if(i>0&&(i%2==0)){
_1fd=_1fd.cloneNode(false);
_1fe.insertBefore(_1fd,_1ff);
}
_1fd.appendChild(_1fa);
_1fd.appendChild(_1fb);
}
area.appendChild(_1f4.recordInput);
_1f4.expander.appendChild(area);
}
return _1f4;
}
function populateRelated(_204,ids,_206,_207){
if(_204.readyState!=4){
return;
}
var _208=_204.responseXML;
if(!_208){
return;
}
var _209=_208.getElementsByTagName("related").item(0);
var _20a=_209.getElementsByTagName("relatedfield");
for(var i=0;i<_20a.length;i++){
var _20c=_20a[i].getAttribute("fieldname");
var _20d=_20a[i].getAttribute("tablename");
var _20e="["+_20d+"]"+_20c;
var _20f=_20a.item(i).getElementsByTagName("field").item(0);
var _210=_20a.item(i).getElementsByTagName("table").item(0);
var _211=_20f.getAttribute("fieldid");
var _212=_210.getAttribute("tableid");
for(var k=0;k<ids.length;k++){
if(_20e.toLowerCase()==ids[k].toLowerCase()){
var hr=getXMLHttpRequest();
var _215=connection.sessionId;
if(hr){
var url=connection.address.query+"?sessionId="+_215+"&tableid="+_212+"&fieldid="+_211+"&comp=equal&value="+_206[k]+"&start=1&length=1";
hr.onreadystatechange=function(){
populateElementsByIds(hr,ids,_207);
};
try{
hr.open("GET",url,true);
hr.send(null);
}
catch(e){
delete hr;
}
}
}
}
}
if(browser.ie6){
_204.onreadystatechange=function(){
};
}else{
_204.onreadystatechange=null;
}
delete _204;
}
function Record(_217,_218){
this.tableid=_217;
this.recordid=_218;
}
function cleanUp(_219,_21a){
if(_21a.substr(0,1)!="b"&&_21a.substr(0,1)!="r"&&_21a.substr(0,1)!="d"){
var _21b=/[%EUR\s+]/g;
_219=_219.toString();
while(_21b.test(_219)){
_219=_219.replace(_21b,"");
}
if(!isNaN(_219)){
_219=Math.round(_219);
}
return _219;
}else{
return _219;
}
}
function checkSize(_21c){
if(_21c.length<2){
_21c="0"+_21c;
}else{
if(_21c.length>2){
_21c=_21c.substr(0,2);
}else{
_21c=_21c;
}
}
return _21c;
}
function checkDateFormat(data,_21e){
var _21f="";
var _220=data.split("-");
if(_21e=="MM-DD-YYYY"){
if(_220[0].length==4){
_21f=_220[0]+"-"+_220[1]+"-"+_220[2];
}else{
_21f=_220[2]+"-"+_220[0]+"-"+_220[1];
}
}else{
if(_21e=="DD-MM-YYYY"||_21e=="DD-MMM-YYYY"){
if(_220[0].length==4){
_21f=_220[0]+"-"+_220[1]+"-"+_220[2];
}else{
_21f=_220[2]+"-"+_220[1]+"-"+_220[0];
}
}else{
_21f=data;
}
}
return _21f;
}
function fixValueSize(_221){
if(_221){
var _222=_221.split("-");
if(_222[0].length<2){
_222[0]="0"+_222[0];
}
if(_222[1].length<2){
_222[1]="0"+_222[1];
}
return _222[0]+"-"+_222[1]+"-"+_222[2];
}
}
function keepDetailDate(_223){
var _224=_223.split("-");
if(_224[0].length<2){
_224[0]="0"+_224[0];
}
switch(_224[1]){
case "Jan":
_224[1]="01";
break;
case "Feb":
_224[1]="02";
break;
case "Mar":
_224[1]="03";
break;
case "Apr":
_224[1]="04";
break;
case "May":
_224[1]="05";
break;
case "Jun":
_224[1]="06";
break;
case "Jul":
_224[1]="07";
break;
case "Aug":
_224[1]="08";
break;
case "Sep":
_224[1]="09";
break;
case "Oct":
_224[1]="10";
break;
case "Nov":
_224[1]="11";
break;
case "Dec":
_224[1]="12";
break;
}
if(_224[0].length==4){
return _224[0]+"-"+_224[1]+"-"+_224[2];
}else{
return _224[2]+"-"+_224[1]+"-"+_224[0];
}
}
function dateValidation(data,_226){
var _227=data.split("-");
var _228="True";
testDate=new Date(_227[0],_227[1]-1,_227[2]);
if(data!="0000-00-00"||data!="00-00-00"){
if(_227[0]>1900&&_227[0]<2100&&_227[1]>0&&_227[1]<13&&_227[2]>0&&_227[2]<32){
if(_227[1]==1||_227[1]==3||_227[1]==5||_227[1]==7||_227[1]==8||_227[1]==10||_227[1]==12){
if(_227[2]>31){
_228="False";
}else{
_228="True";
}
}else{
if(_227[1]==4||_227[1]==6||_227[1]==9||_227[1]==11){
if(_227[2]>30){
_228="False";
}else{
_228="True";
}
}else{
if(_227[1]==2){
if(_227[0]%4==0&&_227[2]<=29){
_228="True";
}else{
if(_227[0]%4!=0&&_227[2]>28){
_228="False";
}else{
_228="True";
}
}
}
}
}
}
}else{
_228="False";
}
return _228;
}
function valueOk(_229){
var _22a=/[,.]/g;
_229=_229.replace(_22a,"");
return _229;
}
function clearSpaces(_22b){
var _22c="";
_22b=""+_22b;
splitstring=_22b.split(" ");
for(i=0;i<splitstring.length;i++){
_22c+=splitstring[i];
}
return _22c;
}
function RealIntLongInt(_22d,_22e,_22f){
var _230="";
var _231="";
var _232=_22e.split(",");
var _233=_22e;
var _234=_22e;
var _22e="";
var _235="";
var _236="";
var _237=["l","i"];
var _238=0;
var nStr="";
var _22f=_22f.toString();
if(_232[0].length<1){
_232[0]="";
}
if(_234!=1){
if(_232[1].length){
if(_232[1]=="cm"){
_230=",";
}else{
if(_232[1]=="per"){
_230=".";
}else{
_230=_232[1];
}
}
}
if(_232[2]=="cm"){
_231=",";
}else{
if(_232[2]=="per"){
_231=".";
}else{
_231=_232[2];
}
}
var _23a=_22f.indexOf(_231);
if(isNaN(_22f.substr(1,1))&&_22f.substr(1,1)!="."&&_22f.substr(1,1)!=","){
_22f=_22f.replace(_22f.substr(1,1),"");
}
_22f=_22f.replace(_232[0],"");
_22f=_22f.replace(_232[4],"");
if(_230!="-"){
if(_22f.indexOf("-")!=-1){
_235="-";
var rgx=/-/g;
_22f=_22f.replace(rgx,"");
}
}
for(im=0;im<=_237.length;im++){
if(_22d==_237[im]){
_238=1;
}
}
if(!_238){
if(_231==","&&_22d!="r"){
while(_22f.indexOf(_230)!=-1){
_22f=_22f.replace(_230,"");
}
}else{
if(_231=="."&&_230.length){
while(_22f.indexOf(_230)!=-1){
_22f=_22f.replace(_230,"");
}
}
}
}
if(_22d=="i"||_22d=="l"){
if(_22f.substr(0,1)=="."){
_22f="0."+_22f.substr(_22f.indexOf(".")+1,_22f.length);
}else{
if(_22f.indexOf(",")!=-1){
var _23c=/,/g;
_22f=_22f.replace(_23c,"");
}else{
_22f=_22f;
}
}
}
nStr=_22f;
nStr+="";
nStr=nStr.replace(_230,"");
x=nStr.split(_231);
x1=x[0];
x2=x.length>1?"."+x[1]:"";
var rgx=/(\d+)(\d{3})/;
if(_230){
while(rgx.test(x1)){
x1=x1.replace(rgx,"$1"+_230+"$2");
}
}
if(x2.length){
x2=x2.replace(".",_231);
}
_22e=_22e+x1+x2;
if(_232[3].length&&_232[3]!=0&&_22d!="i"&&_22d!="l"){
if(_23a==-1){
_23d="";
}else{
_23d=_22f.substr(_22f.indexOf(_231),_22f.length);
}
var _23e=_23d;
myRegularExp=/(\%)|(\.)|(,)|(EUR)/;
if(_23e.length){
myDecimalPoint=myRegularExp.exec(_23e);
if(myDecimalPoint[0]){
_23e=_23e.replace(myDecimalPoint[0],"");
}
}
_23d=_23e;
if(_23d.length>_232[3]&&_238!=1){
_23d=_23d.substr(0,_232[3]);
if(_230==_231){
var _23f=_22e.split(_230);
_22e=_22e.substr(0,_22e.lastIndexOf(_230))+_231+_23d;
}else{
_22e=_22e.substr(0,_22e.lastIndexOf(_231));
if(!_23d){
if(_22e.lastIndexOf(_231)+1==""){
var _23d=_22f.substr(_22f.lastIndexOf(_231)+1,_22f.length);
_22e=_22e+_231+_23d;
}
}else{
_22e=_22e+_231+_23d;
}
}
}else{
if(_23d.length<_232[3]&&_238!=1){
if(_23d.length!=0||_23d!=""){
var _240=_232[3]-_23d.length;
}else{
var _240=_232[3];
}
for(z=1;z<=_240;z++){
_23d+="0";
}
_22e=x1+_231+_23d;
}else{
if(_23d.length==_232[3]&&_238!=1){
if(_232[3]!=0){
_22e=x1+_231+_23d;
}else{
_22e=x1+_23d;
}
}else{
_22e=_22e;
}
}
}
}
if(_232[4].length){
if(_232[4]=="~"){
newFor="%";
var _241=/,/g;
if(_22e.indexOf(",")!=_22e.lastIndexOf(",")){
_22e=_22e.replace(_241,"");
}
_22e=clearSpaces(_22e);
_22e=_22e+" "+newFor;
}else{
if(_232[4]=="EUR"){
_22e=_22e+" "+_232[4];
}
}
}else{
_22e=_22e+" "+_232[4];
}
if(_232[0].length){
_22e=_22e.replace(_232[0],"");
_22e=_235+_232[0]+_22e;
}else{
_22e=_235+_22e;
}
}
if(!_22e){
_22e=_22f;
}
return _22e;
}
function format(type,_243){
if(!_243&&_243!=0){
_243="00-00-00";
return _243;
}
if(!type){
return _243;
}
_243=_243.toString();
var _244=type.substring(0,1);
var type=type.slice(1);
var _245="";
switch(_244){
case "d":
if(type.indexOf("1")!=-1){
if(STR["admin_values_date"][1]){
type=STR["admin_values_date"][1].slice(1);
}else{
type="MM-DD--YYYY";
}
}else{
type=type;
}
var arrD=_243.replace("/","-");
goodData=dateValidation(_243);
arrD=_243.split("-");
dates=new Date(arrD[0],(arrD[1]-1),arrD[2]);
if(_243=="0000-00-00"){
_243="00-00-00";
return _243;
}
if(type.indexOf("YYYY")!=-1){
type=type.replace("YYYY",arrD[0]);
}else{
if(_243.indexOf("YY")!=-1){
type=type.replace("YY",arrD[0]);
}
}
if(type.indexOf("MMM")!=-1){
if(arrD[1]!="00"){
var _247=STR["calendar_month_abr"][parseInt(dates.getMonth())];
type=type.replace("MMM",_247);
}else{
_243=arrD[1]+"-"+arrD[0]+"-"+arrD[2];
return _243;
}
}else{
if(type.indexOf("MM")!=-1){
type=type.replace("MM",arrD[1]);
}
}
if(type.indexOf("DD")!=-1){
type=type.replace("DD",arrD[2]);
}
return type;
break;
case "t":
if(type.indexOf("1")!=-1){
if(STR["admin_values_time"][1]){
type=STR["admin_values_time"][1].slice(1);
}else{
type="HH:MM:SS";
}
}else{
type=type;
}
if(_243.indexOf(":")==-1){
_243=_243+":00:00";
}
var arrT=_243.split(":");
if(arrT){
if(arrT[0]){
if(arrT[0].length<2){
arrT[0]=checkSize(arrT[0]);
}
}
if(arrT[1]){
if(arrT[1].length<2||arrT[1].length>2){
arrT[1]=checkSize(arrT[1]);
}
}
if(arrT[2]){
if(arrT[2].length<2||arrT[2].length>2){
arrT[2]=checkSize(arrT[2]);
}
}
}
var _245=type;
if(type=="HH:MM:SS am/pm"&&arrT[0]<25){
if(_243=="00:00:00"&&type.indexOf("am/pm")!=-1){
_243="12:00:00 am";
}else{
if(_243=="24:00:00"&&type.indexOf("am/pm")!=-1){
_243="12:00:00 am";
}else{
if(_243=="12:00:00"&&type.indexOf("am/pm")!=-1){
_243="12:00:00 pm";
}
}
}
}else{
if(type=="HH:MM am/pm"&&arrT[0]<25){
if(_243=="00:00"&&type.indexOf("am/pm")!=-1){
_243="12:00 am";
}else{
if(_243=="24:00"&&type.indexOf("am/pm")!=-1){
_243="12:00 am";
}else{
if(_243=="12:00"&&type.indexOf("am/pm")!=-1){
_243="12:00 pm";
}
}
}
}
}
if(arrT.length<3){
if(type=="MM:SS"){
arrN="00:"+arrT[0]+":"+arrT[1];
}else{
if(arrT[1]){
arrN=arrT[0]+":"+arrT[1]+":00";
}else{
arrN=arrT[0]+":00:00";
}
}
arrT=arrN.split(":");
}
if(type.indexOf("HH")!=-1){
if(arrT[0]){
if(arrT[0]>24&&type.indexOf("am/pm")!=-1){
var _249=(arrT[0]%24);
arrT[0]=_249;
}else{
var _249=arrT[0];
}
if(type.indexOf("am/pm")!=-1){
if(arrT[0]>12){
arrT[0]=arrT[0]-12;
type=type.replace("HH",arrT[0]);
}else{
if(arrT[0]==0){
type=type.replace("HH","12");
}else{
type=type.replace("HH",arrT[0]);
}
}
}else{
if(arrT[0]>12){
if(type.indexOf("am/pm")!=-1){
arrT[0]=arrT[0]-12;
}else{
arrT[0]=arrT[0];
type=type.replace("HH",arrT[0]);
}
}else{
if(type.indexOf("am/pm")!=-1){
var _24a=arrT[0];
}else{
arrT[0]=arrT[0];
type=type.replace("HH",arrT[0]);
}
}
}
}else{
type=type.replace("HH","00");
}
}
if(type.indexOf("MM")!=-1){
if(arrT[1]){
if(arrT[1].length<2){
arrT[1]=arrT[1]+"0";
}
type=type.replace("MM",arrT[1]);
}else{
if(arrT[0]){
type=type.replace("MM",arrT[0]);
}else{
type=type.replace("MM","00");
}
}
}
if(type.indexOf("SS")!=-1){
if(arrT[2]){
if(arrT[2].length<2){
arrT[2]=arrT[2]+"0";
}
type=type.replace("SS",arrT[2].substr(0,2));
}else{
if(arrT[1]){
type=type.replace("SS",arrT[1]);
}else{
type=type.replace("SS","00");
}
}
}
myRegularExpression=/( am\/pm)|( am )| ( pm)/;
if(type.length){
myAMPM=myRegularExpression.exec(type);
if((myAMPM)&&(myAMPM[0])){
type=type.replace(myAMPM[0],"");
}
}
if(_245.indexOf("am/pm")!=-1){
if(_249>=12&&_249<24){
type=type+" pm";
}else{
type=type+" am";
}
}
typeSize=type.substr(0,type.indexOf(":"));
if(typeSize.length<2){
type="0"+type;
}
return type;
break;
case "l":
case "i":
case "r":
type=RealIntLongInt(_244,type,_243);
return type;
break;
case "a":
if(type.indexOf("1")!=-1){
return _243;
}else{
if(type.indexOf("uuuu")!=-1){
_243=_243.toLowerCase();
return _243;
}else{
if(type.indexOf("UUUU")!=-1){
_243=_243.toUpperCase();
return _243;
}else{
return _243;
}
}
}
break;
case "x":
if(type.indexOf("1")!=-1){
return _243;
}else{
if(type.indexOf("uuuu")!=-1){
_243=_243.toLowerCase();
return _243;
}else{
if(type.indexOf("UUUU")!=-1){
_243=_243.toUpperCase();
return _243;
}else{
return _243;
}
}
}
break;
case "b":
if(type.indexOf("1")!=-1){
type="T";
}
if(type.indexOf("T")!=-1){
if(_243.toLowerCase()=="t"||_243.toLowerCase()=="true"){
_243=STR["ttrue"];
}else{
_243=STR["ffalse"];
}
}else{
if(type.indexOf("Y")!=-1){
if(_243.substr(0,1).toLowerCase()=="y"||_243.toLowerCase()=="yes"||_243.toLowerCase()=="true"){
_243=STR["yes"];
}else{
_243=STR["no"];
}
}else{
if(type.indexOf("F")!=-1){
if(_243.substr(0,3).toLowerCase()=="m"||_243.toLowerCase()=="female"||_243.toLowerCase()=="false"){
_243=STR["female"];
}else{
_243=STR["male"];
}
}else{
return _243;
}
}
}
return _243;
break;
default:
return _243;
}
}
function Structure(){
this.tables=new Array();
this.updating=false;
this.cached=false;
this.getTable=function(id){
var tp=this;
for(var i in tp.tables){
if((tp.tables[i].tableid==id)||(tp.tables[i].tablename==id)){
return tp.tables[i];
}
}
return null;
};
this.getField=function(_24e,_24f){
var _250=this.getTable(_24e);
for(var i in _250.fields){
if(_250.fields[i].fieldid==_24f){
return _250.fields[i];
}
}
return null;
};
this.update=function(){
if(connection.sessionId==""||this.updating){
return;
}
if(this.cached){
return;
}
this.updating=true;
var url=connection.address.gettablelist+"?sessionId="+connection.sessionId;
makeRequest(url,buildTableList,null);
};
this.isUpdated=function(){
if(this.updating){
return false;
}
for(var i=0;i<this.tables.length;i++){
if(this.tables[i].updating){
return false;
}
}
return true;
};
return this;
}
var structure=new Structure();
var DB={SORT:"Sort",GET_RECORD:"GetRecord",MODIFY_RECORD:"ModifyRecord",ADD_RECORD:"AddRecord",DELETE_RECORD:"DeleteRecord"};

var admintablegridobject;
var adminfieldgridobject;
var ddwlistgridobject;
var querylistgridobject;
var admintableoverflow;
var admintableareaHeight;
var cachedselectdiv;
var cachedselect;
var cachedtableviewpopup;
var cachedDDWpopup;
var cachedtableviewpopup_integer;
var cachedtableviewpopup_longint;
var cachedtableviewpopup_real;
var cachedtableviewpopup_date;
var cachedtableviewpopup_time;
var cachedtableviewpopup_alpha;
var cachedtableviewpopup_text;
var cachedtableviewpopup_boolean;
var cachedtableviewpopup_none;
var cachedfieldbreakpopup;
var adminselectedtable=0;
var adminselectedrow=0;
var tablelistinitialized=false;
var ddwlistinitialized=false;
var querylistinitialized=false;
var AdminShowAdmin=false;
var isAdminLoggedIn=false;
var isAdminLoaded=false;
var isAdminAccessedFromMainPage=false;
var QueryPositionClick=false;
var QueryLastSelected=0;
var ar_Table_ID=new Array();
var ar_Table_Name=new Array();
var ar_Table_Map=new Array();
var ar_Field_ID=new Array();
var ar_Field_Name=new Array();
var ar_Field_Map=new Array();
var ar_Field_Type=new Array();
var ar_DDW_ID=new Array();
var ar_DDW_Name=new Array();
var ar_DDW_Map=new Array();
var ar_DDW_Field_ID=new Array();
var ar_DDW_Field_Name=new Array();
var ar_DDW_Field_Map=new Array();
var uniqueIDArray=new Array();
var TOGGLESTATUS={allowaccess:"true",displayinlist:"true",displayindetail:"true",displayinsearch:"true"};
function formatHeader(_1){
for(var i=0;i<_1.prv.mColumns.length;i++){
_1.prv.mColumns[i].prv.mHeader.prv.mDOM.onmousemove="";
_1.prv.mColumns[i].prv.mHeader.prv.mDOM.onmouseover="";
_1.prv.mColumns[i].prv.mHeader.prv.mDOM.style.cursor="default";
_1.prv.mColumns[i].prv.mHeader.prv.mDOM.onclick="";
_1.prv.mColumns[i].prv.mHeader.prv.mDOM.onmousedown="";
_1.prv.mColumns[i].prv.mHeader.prv.mDOM.onmouseup="";
}
}
function LoadAdmin(){
if(browser.ie){
$("tabContainer").style.top="-38px";
$("adminAccessControl").style.top="0px";
}
CachePopups();
GetGroupList();
do_requestBooleanFormats();
do_requestNumericFormats();
if(!isAdminLoaded){
var _3=new Tabs();
_3.insert(STR["dash_pi_styletab"],0);
_3.insert(STR["dash_pi_indicatorstab"],1);
_3.insert(STR["dash_pi_formattingtab"],2);
_3.insert(STR["dash_pi_linkappstab"],3);
_3.activateById(0);
_3.onswitch=function(_4){
switch(_4){
case 0:
$("adminPropertiesStyles").style.display="block";
$("adminPropertiesIndicators").style.display="none";
$("adminPropertiesFormatting").style.display="none";
$("adminPropertiesIPhoneApps").style.display="none";
break;
case 1:
$("adminPropertiesStyles").style.display="none";
$("adminPropertiesIndicators").style.display="block";
$("adminPropertiesFormatting").style.display="none";
$("adminPropertiesIPhoneApps").style.display="none";
break;
case 2:
$("adminPropertiesStyles").style.display="none";
$("adminPropertiesIndicators").style.display="none";
$("adminPropertiesFormatting").style.display="block";
$("adminPropertiesIPhoneApps").style.display="none";
break;
case 3:
$("adminPropertiesStyles").style.display="none";
$("adminPropertiesIndicators").style.display="none";
$("adminPropertiesFormatting").style.display="none";
$("adminPropertiesIPhoneApps").style.display="block";
break;
}
};
$("adminPropertiesTabs").appendChild(_3.dom);
var _5=new Tabs();
_5.insert(STR["admin_about"],0);
_5.insert(STR["admin_generalprefs"],1);
_5.insert(STR["admin_accesscontroltab"],2);
_5.insert(STR["admin_querymanager"],3);
_5.insert(STR["admin_ddwmanager"],4);
_5.insert(STR["dash_tabtitle"],5);
_5.activateById(0);
do_getDDWInfo("All",false);
_5.onswitch=function(_6,_7){
switch(_6){
case 0:
$("adminAbout").style.display="block";
$("adminGeneralPrefs").style.display="none";
$("adminAccessControl").style.display="none";
$("adminDDWManager").style.display="none";
$("adminQueryManager").style.display="none";
$("adminReportManager").style.display="none";
do_removeDashboardObject($("adminPropertyInspector"));
break;
case 1:
$("adminAbout").style.display="none";
$("adminGeneralPrefs").style.display="block";
$("adminAccessControl").style.display="none";
$("adminDDWManager").style.display="none";
$("adminQueryManager").style.display="none";
$("adminReportManager").style.display="none";
do_removeDashboardObject($("adminPropertyInspector"));
break;
case 2:
$("adminAbout").style.display="none";
$("adminGeneralPrefs").style.display="none";
$("adminAccessControl").style.display="block";
$("adminDDWManager").style.display="none";
$("adminQueryManager").style.display="none";
$("adminReportManager").style.display="none";
do_removeDashboardObject($("adminPropertyInspector"));
if(!tablelistinitialized){
do_gettablepreferences();
tablelistinitialized=true;
if(adminselectedtable!=0){
do_getfieldpreferences();
}
}else{
if(admintablegridobject.viewport.vscrollbar.increment==0){
admintablegridobject.viewport.vscrollbar.increment=10;
}
if(admintablegridobject.viewport.vscrollbar.pageIncrement==0){
admintablegridobject.viewport.vscrollbar.pageIncrement=50;
}
admintablegridobject.viewport.refresh();
admintablegridobject.grid.dom.style.maxHeight="150px";
admintablegridobject.viewport.vscrollbar.dom.style.top=admintablegridobject.viewport.content.offsetTop+"px";
admintablegridobject.viewport.vscrollbar.dom.style.left=admintablegridobject.viewport.content.offsetLeft+admintablegridobject.viewport.content.offsetWidth+"px";
}
break;
case 3:
$("adminAbout").style.display="none";
$("adminGeneralPrefs").style.display="none";
$("adminAccessControl").style.display="none";
$("adminDDWManager").style.display="none";
$("adminQueryManager").style.display="block";
$("adminReportManager").style.display="none";
do_removeDashboardObject($("adminPropertyInspector"));
var _8=GetPopupTemplate("AdminCreateQuery_Selection",ar_Table_ID,ar_Table_Name);
_8.onchange=function(){
do_getQueryFieldList(this.options[this.selectedIndex].value,false);
return false;
};
$("adminQuerySelectionPopup").innerHTML="";
$("adminQuerySelectionPopup").appendChild(_8);
ar_Table_Name[0]=STR["adminQuery_all"];
var _8=GetPopupTemplate("AdminQuery_FilterPopup",ar_Table_ID,ar_Table_Name);
_8.onchange=function(){
do_getQueryList("All",true,this.options[this.selectedIndex].value);
if(this.options[this.selectedIndex].value==0){
$("QueryListAllRecordsTitle").style.display="none";
$("QueryListAllRecordsCB").style.display="none";
}else{
$("QueryListAllRecordsTitle").style.display="block";
$("QueryListAllRecordsCB").style.display="block";
do_getAllRecordsSettings(this.options[this.selectedIndex].value);
}
return false;
};
ar_Table_Name[0]=STR["none"];
$("QueryListFilterPopup").innerHTML="";
$("QueryListFilterPopup").appendChild(_8);
$("QueryListAllRecordsTitle").style.display="none";
$("QueryListAllRecordsCB").style.display="none";
do_GetQueryTemplates();
do_getQueryList("All",true);
$("QueryList").onselectstart=function(){
return false;
};
break;
case 4:
$("adminAbout").style.display="none";
$("adminGeneralPrefs").style.display="none";
$("adminAccessControl").style.display="none";
$("adminDDWManager").style.display="block";
$("adminQueryManager").style.display="none";
$("adminReportManager").style.display="none";
do_removeDashboardObject($("adminPropertyInspector"));
if(!ddwlistinitialized){
do_getDDWInfo("All",true);
ddwlistinitialized=true;
}
break;
case 5:
$("adminAbout").style.display="none";
$("adminGeneralPrefs").style.display="none";
$("adminAccessControl").style.display="none";
$("adminDDWManager").style.display="none";
$("adminQueryManager").style.display="none";
$("adminReportManager").style.display="block";
if(_7==undefined){
do_getReportList();
var _9=GetPopupTemplate("AdminCreateReport_Selection",ar_Table_ID,ar_Table_Name);
var _9=GetPopupTemplate("AdminCreateReport_Selection",ar_Table_ID,ar_Table_Name);
$("adminReportSelectionPopup").innerHTML="";
$("adminReportSelectionPopup").appendChild(_9);
$("AdminCreateReport_Selection").onchange=function(){
if($("AdminCreateReport_Selection").options[$("AdminCreateReport_Selection").selectedIndex].value!="0"){
$("ReportStatusOnecontainer").style.display="none";
if(browser.ie){
$("admintabs").firstChild.parent.onswitch(4);
$("admintabs").firstChild.parent.onswitch(5,true);
}
}
};
$("adminReportStyleType_iPhone").onclick=function(){
if(this.value=true){
$("ReportStatusOnecontainer").style.display="block";
$("ReportStatusOnecontainer").style.backgroundColor="#FAD163";
$("ReportStatusOnecontainer").style.color="#000000";
$("ReportStatusOne").innerHTML=STR["dash_error11"];
if(browser.ie){
$("admintabs").firstChild.parent.onswitch(4);
$("admintabs").firstChild.parent.onswitch(5,true);
}
}else{
$("ReportStatusOnecontainer").style.display="none";
if(browser.ie){
$("admintabs").firstChild.parent.onswitch(4);
$("admintabs").firstChild.parent.onswitch(5,true);
}
}
};
}
break;
}
};
$("admintabs").appendChild(_5.dom);
CheckAdminPreferences();
var a=$("adminTableList");
admintablegridobject=new GridObject(a);
admintablegridobject.clear();
var _b=admintablegridobject.grid;
admintablegridobject.viewport.setOverflow(0,0);
_b.size(7);
_b.column(0).setHeader(STR["top_columns"][0]);
_b.column(1).setHeader(STR["top_columns"][1]);
_b.column(2).setHeader(STR["top_columns"][2]);
_b.column(3).setHeader(STR["top_columns"][3]);
_b.column(4).setHeader(STR["top_columns"][4]);
_b.column(5).setHeader(STR["top_columns"][5]);
_b.column(6).setHeader(STR["top_columns"][6]);
_b.column(0).setWidth(50);
_b.column(1).setWidth(175);
_b.column(2).setWidth(120);
_b.column(3).setWidth(50);
_b.column(4).setWidth(90);
_b.column(5).setWidth(140);
_b.column(6).setWidth(160);
_b.header.style.width="820px";
_b.body.style.width="820px";
admintablegridobject.viewport.dom.style.width="820px";
admintablegridobject.viewport.dom.style.maxHeight="150px";
admintablegridobject.viewport.dom.style.display="block";
admintablegridobject.viewport.onvscroll=function(_c,_d){
setStyle(this.owner.grid.body,"top",(_c*(-1)*this.vscrollbar.ratio)+"px");
};
_b.onrowselect=function(_e){
for(var i=0;i<this.prv.mRowCount;i++){
this.prv.mRows[i].setFocus(false);
}
_e.setFocus(true);
};
var a=$("adminFieldList");
adminfieldgridobject=new GridObject(a);
adminfieldgridobject.clear();
var _10=adminfieldgridobject.grid;
adminfieldgridobject.viewport.setOverflow(0,0);
_10.size(9);
_10.column(0).setHeader(STR["bottom_columns"][0]);
_10.column(1).setHeader(STR["bottom_columns"][1]);
_10.column(2).setHeader(STR["bottom_columns"][2]);
_10.column(3).setHeader(STR["bottom_columns"][3]);
_10.column(4).setHeader(STR["bottom_columns"][4]);
_10.column(5).setHeader(STR["bottom_columns"][5]);
_10.column(6).setHeader(STR["bottom_columns"][6]);
_10.column(7).setHeader(STR["bottom_columns"][7]);
_10.column(8).setHeader(STR["bottom_columns"][8]);
_10.column(0).setWidth(50);
_10.column(1).setWidth(175);
_10.column(2).setWidth(120);
_10.column(3).setWidth(50);
_10.column(4).setWidth(55);
_10.column(5).setWidth(55);
_10.column(6).setWidth(80);
_10.column(7).setWidth(80);
_10.column(8).setWidth(110);
_10.header.style.width="820px";
_10.body.style.width="820px";
adminfieldgridobject.viewport.dom.style.width="820px";
adminfieldgridobject.viewport.dom.style.maxHeight="150px";
adminfieldgridobject.viewport.dom.style.display="block";
formatHeader(adminfieldgridobject.grid);
adminfieldgridobject.viewport.onvscroll=function(_11,_12){
setStyle(this.owner.grid.body,"top",(_11*(-1)*this.vscrollbar.ratio)+"px");
};
_10.onrowselect=function(_13){
for(var i=0;i<this.prv.mRowCount;i++){
this.prv.mRows[i].setFocus(false);
}
_13.setFocus(true);
};
var a=$("DDWList");
ddwlistgridobject=new GridObject(a);
ddwlistgridobject.clear();
var _15=ddwlistgridobject.grid;
ddwlistgridobject.viewport.setOverflow(0,0);
_15.size(4);
_15.column(0).setHeader(STR["adminDDW_title"]);
_15.column(1).setHeader(STR["adminDDW_content"]);
_15.column(2).setHeader(STR["adminDDW_type"]);
_15.column(3).setHeader(STR["adminDDW_associatedTo"]);
_15.column(0).setWidth(150);
_15.column(1).setWidth(200);
_15.column(2).setWidth(75);
_15.column(3).setWidth(75);
_15.header.style.width="520px";
_15.body.style.width="520px";
ddwlistgridobject.viewport.dom.style.width="520px";
ddwlistgridobject.viewport.dom.style.maxHeight="300px";
ddwlistgridobject.viewport.dom.style.display="block";
ddwlistgridobject.viewport.onvscroll=function(_16,_17){
setStyle(this.owner.grid.body,"top",(_16*(-1)*this.vscrollbar.ratio)+"px");
};
_15.onrowselect=function(_18){
for(var i=0;i<this.prv.mRowCount;i++){
this.prv.mRows[i].setFocus(false);
}
_18.setFocus(true);
};
_15.unselectall=function(){
for(var i=0;i<this.prv.mRowCount;i++){
this.prv.mRows[i].setFocus(false);
}
};
var a=$("QueryList");
querylistgridobject=new GridObject(a);
querylistgridobject.clear();
var _1b=querylistgridobject.grid;
querylistgridobject.viewport.setOverflow(0,0);
_1b.size(4);
_1b.column(0).setHeader(STR["top_columns"][0]);
_1b.column(1).setHeader(STR["adminQuery_name"]);
_1b.column(2).setHeader(STR["adminQuery_text"]);
_1b.column(3).setHeader(STR["adminQuery_Selection"]);
_1b.column(0).setWidth(50);
_1b.column(1).setWidth(150);
_1b.column(2).setWidth(430);
_1b.column(3).setWidth(150);
_1b.header.style.width="800px";
_1b.body.style.width="800px";
querylistgridobject.viewport.dom.style.width="800px";
querylistgridobject.viewport.dom.style.maxHeight="300px";
querylistgridobject.viewport.dom.style.display="block";
querylistgridobject.viewport.onvscroll=function(_1c,_1d){
setStyle(this.owner.grid.body,"top",(_1c*(-1)*this.vscrollbar.ratio)+"px");
};
_1b.onrowdblclick=function(_1e){
this.unselectall();
_1e.setFocus(true);
if(!_1e.isDDT){
if(_1e.tableid!=undefined){
if(QueryShowDetail){
do_getQueryFieldList(_1e.tableid,true,_1e);
hideTooltip();
}
}
}
};
_1b.onrowselect=function(_1f,_20){
_20=xpEvent(_20,true);
if(QueryPositionClick){
QueryPositionClick=false;
_1f.prv.mElements[0].prv.mDOM.firstChild.firstChild.focus();
_1f.setFocus(true);
}else{
if(_20.shiftKey){
var _21=0;
var _22=0;
if(_1f.prv.mIndex<QueryLastSelected){
_21=_1f.prv.mIndex;
_22=QueryLastSelected;
}else{
_21=QueryLastSelected;
_22=_1f.prv.mIndex;
}
for(var i=_21;i<=_22;i++){
this.prv.mRows[i].setFocus(true);
}
}else{
if(_20.ctrlKey||_20.metaKey){
if(_1f.prv.mFocus){
_1f.setFocus(false);
}else{
_1f.setFocus(true);
}
}else{
this.unselectall();
_1f.setFocus(true);
}
QueryLastSelected=_1f.prv.mIndex;
}
}
};
_1b.unselectall=function(){
for(var i=0;i<this.prv.mRowCount;i++){
this.prv.mRows[i].setFocus(false);
}
};
var a=$("adminConditionsList");
conditionlistgridobject=new GridObject(a);
conditionlistgridobject.clear();
var _25=conditionlistgridobject.grid;
conditionlistgridobject.viewport.setOverflow(0,0);
conditionlistgridobject.grid.size(4);
conditionlistgridobject.grid.column(0).setHeader(STR["adminQuery_LinkTitle"]);
conditionlistgridobject.grid.column(1).setHeader(STR["adminQuery_FieldTitle"]);
conditionlistgridobject.grid.column(2).setHeader(STR["adminQuery_OperatorTitle"]);
conditionlistgridobject.grid.column(3).setHeader(STR["adminQuery_ValueTitle"]);
conditionlistgridobject.grid.column(0).setWidth(66);
conditionlistgridobject.grid.column(1).setWidth(180);
conditionlistgridobject.grid.column(2).setWidth(66);
conditionlistgridobject.grid.column(3).setWidth(180);
conditionlistgridobject.grid.header.style.width="514px";
conditionlistgridobject.grid.body.style.width="514px";
conditionlistgridobject.viewport.dom.style.width="514px";
conditionlistgridobject.viewport.dom.style.maxHeight="300px";
conditionlistgridobject.viewport.dom.style.position="relative";
conditionlistgridobject.viewport.dom.style.display="block";
conditionlistgridobject.viewport.onvscroll=function(_26,_27){
setStyle(this.owner.grid.body,"top",(_26*(-1)*this.vscrollbar.ratio)+"px");
};
conditionlistgridobject.grid.onrowselect=function(_28){
for(var i=0;i<this.prv.mRowCount;i++){
this.prv.mRows[i].setFocus(false);
}
_28.setFocus(true);
};
conditionlistgridobject.grid.unselectall=function(){
for(var i=0;i<this.prv.mRowCount;i++){
this.prv.mRows[i].setFocus(false);
}
};
var a=$("ReportList");
reportlistgridobject=new GridObject(a);
reportlistgridobject.clear();
var _2b=reportlistgridobject.grid;
reportlistgridobject.viewport.setOverflow(0,0);
_2b.size(3);
_2b.column(0).setHeader(STR["dash_list_name"]);
_2b.column(1).setHeader(STR["dash_list_description"]);
_2b.column(2).setHeader(STR["dash_list_selection"]);
_2b.column(0).setWidth(150);
_2b.column(1).setWidth(435);
_2b.column(2).setWidth(200);
_2b.header.style.width="800px";
_2b.body.style.width="800px";
reportlistgridobject.viewport.dom.style.width="800px";
reportlistgridobject.viewport.dom.style.maxHeight="300px";
reportlistgridobject.viewport.dom.style.display="block";
reportlistgridobject.viewport.onvscroll=function(_2c,_2d){
setStyle(this.owner.grid.body,"top",(_2c*(-1)*this.vscrollbar.ratio)+"px");
};
_2b.onrowdblclick=function(_2e){
this.unselectall();
_2e.setFocus(true);
if((_2e.tableid!=undefined)&&(_2e.reportname!=undefined)){
do_EditReport(_2e.tableid,_2e.reportname,_2e.type,_2e.description);
}
};
_2b.unselectall=function(){
for(var i=0;i<this.prv.mRowCount;i++){
this.prv.mRows[i].setFocus(false);
}
};
isAdminLoaded=true;
}
}
function getselectedgroup(){
var _30=$("grouppopup").selectedIndex;
return $("grouppopup").options[_30].value;
}
function do_gettablepreferences(_31){
var _32=connection.sessionId;
if(_32==""){
return;
}
var _33=getXMLHttpRequest();
if(_33){
var _34=getselectedgroup();
var url=connection.address.admingettablepreferences+"?sessionId="+_32+"&groupid="+_34;
_33.onreadystatechange=function(){
adminparsetablelist(_33,_31);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_33.open("GET",url,true);
_33.send(null);
}
catch(e){
delete _33;
}
}
}
function do_getfieldpreferences(){
if(adminselectedtable!=0){
var _36=connection.sessionId;
if(_36==""){
return;
}
var _37=getXMLHttpRequest();
if(_37){
var _38=getselectedgroup();
var url=connection.address.admingetfieldpreferences+"?sessionId="+_36+"&tableid="+adminselectedtable+"&groupid="+_38;
_37.onreadystatechange=function(){
adminparsefieldlist(_37);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_37.open("GET",url,true);
_37.send(null);
}
catch(e){
delete _37;
}
}
}
}
function do_GetQueryTemplates(){
var _3a=connection.sessionId;
if(_3a==""){
return;
}
var _3b=getXMLHttpRequest();
if(_3b){
var url=connection.address.admingetquerytemplates+"?sessionId="+_3a;
_3b.onreadystatechange=function(){
adminparsequerytemplates(_3b);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_3b.open("GET",url,true);
_3b.send(null);
}
catch(e){
delete _3b;
}
}
}
function do_getQueryFieldList(_3d,_3e,_3f){
conditionlistgridobject.tableid=_3d;
var _40=connection.sessionId;
if(_40==""){
return;
}
var _41=getXMLHttpRequest();
if(_41){
var _42=getselectedgroup();
var url=connection.address.admingetfieldpreferences+"?sessionId="+_40+"&tableid="+_3d+"&groupid="+_42;
_41.onreadystatechange=function(){
adminqueryparsefieldlist(_41,_3e,_3f);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_41.open("GET",url,true);
_41.send(null);
}
catch(e){
delete _41;
}
}
}
function do_getDDWInfo(_44,_45){
var _46=connection.sessionId;
if(_46==""){
return;
}
var _47=getXMLHttpRequest();
if(_47){
var url=connection.address.getDDWInfo+"?sessionId="+_46+"&type="+_44;
_47.onreadystatechange=function(){
adminparseDDWInfo(_47,_44,_45);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_47.open("GET",url,true);
_47.send(null);
}
catch(e){
delete _47;
}
}
}
function do_getQueryList(_49,_4a,_4b){
var _4c=connection.sessionId;
if(_4c==""){
return;
}
var _4d=getXMLHttpRequest();
if(_4d){
var url=connection.address.admingetQueryList+"?sessionId="+_4c;
_4d.onreadystatechange=function(){
adminparseQueryList(_4d,_49,_4a,_4b);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_4d.open("GET",url,true);
_4d.send(null);
}
catch(e){
delete _4d;
}
}
}
function do_getReportList(){
var _4f=connection.sessionId;
if(_4f==""){
return;
}
var _50=getXMLHttpRequest();
if(_50){
var url=connection.address.admingetReportList+"?sessionId="+_4f+"&tableid=0";
_50.onreadystatechange=function(){
adminparseReportList(_50);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_50.open("GET",url,true);
_50.send(null);
}
catch(e){
delete _50;
}
}
}
function do_EditReport(_52,_53,_54,_55){
var _56=connection.sessionId;
if(_56==""){
return;
}
var _57=getXMLHttpRequest();
if(_57){
var url=connection.address.adminLoadReport+"?sessionId="+_56+"&tableid="+_52+"&reportname="+dax_bridge.encode(_53)+"&type="+_54;
_57.tableid=_52;
_57.reportname=_53;
_57.description=_55;
_57.onreadystatechange=function(){
if(_57.readyState!=4){
return;
}
var _59=_57.responseXML.getElementsByTagName("report").item(0);
if(_59){
$("ReportStatusOnecontainer").style.display="none";
var _5a=_57.tableid;
var _5b="";
for(var i=0;i<dax_bridge.tables.length;i++){
if(dax_bridge.tables[i].tableid==_5a){
_5b=i;
}
}
$("CreateReportDetail2").style.display="block";
myReport=new reporteditor($("ReportEditorMain"),_57.reportname,_5b,_57.description,true,_57);
$("ReportList").style.display="none";
$("CreateReportButton").style.display="none";
$("CancelReportButton").style.display="none";
if(browser.ie){
$("admintabs").firstChild.parent.onswitch(4);
$("admintabs").firstChild.parent.onswitch(5,true);
}
}else{
alert("An error occured when trying to open the report.");
}
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_57.open("GET",url,true);
_57.send(null);
}
catch(e){
delete _57;
}
}
}
function GetGroupList(){
var _5d=connection.sessionId;
if(_5d==""){
return;
}
var _5e=getXMLHttpRequest();
if(_5e){
var url=connection.address.getgrouplist+"?sessionId="+_5d;
_5e.onreadystatechange=function(){
adminupdategrouppopup(_5e);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_5e.open("GET",url,true);
_5e.send(null);
}
catch(e){
delete _5e;
}
}
}
function do_settableposition(_60,_61){
var _62=connection.sessionId;
if(_62==""){
return;
}
var _63=getXMLHttpRequest();
if(_63){
var url=connection.address.adminsettableposition+"?sessionId="+_62+"&tableid="+_61+"&position="+_60;
_63.onreadystatechange=function(){
onsettableposition(_63);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_63.open("GET",url,true);
_63.send(null);
}
catch(e){
delete _63;
}
}
}
function do_setfieldposition(_65,_66,_67){
var _68=connection.sessionId;
if(_68==""){
return;
}
var _69=getXMLHttpRequest();
if(_69){
var url=connection.address.adminsetfieldposition+"?sessionId="+_68+"&tableid="+_66+"&fieldid="+_67+"&position="+_65;
_69.onreadystatechange=function(){
onsetfieldposition(_69);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_69.open("GET",url,true);
_69.send(null);
}
catch(e){
delete _69;
}
}
}
function do_setselectionview(id,_6c){
var _6d=connection.sessionId;
if(_6d==""){
return;
}
var _6e=getXMLHttpRequest();
if(_6e){
var _6f=getselectedgroup();
var url=connection.address.adminsetselectionview+"?sessionId="+_6d+"&tableid="+id+"&selectionviewid="+_6c;
_6e.onreadystatechange=function(){
dummy(_6e);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_6e.open("GET",url,true);
_6e.send(null);
}
catch(e){
delete _6e;
}
}
}
function do_settablepreferences(id,_72,_73,_74,_75,_76,_77){
var _78=connection.sessionId;
if(_78==""){
return;
}
var _79=getXMLHttpRequest();
if(_79){
var _7a=getselectedgroup();
var url=connection.address.adminsettablepreferences+"?sessionId="+_78+"&groupid="+_7a+"&tableid="+id+"&alias="+dax_bridge.encode(_72)+"&visible="+_73+"&calendarview="+_74+"&datatreeview="+_75+"&datamatrixview="+_76+"&imagematrixview="+_77;
_79.onreadystatechange=function(){
dummy(_79);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_79.open("GET",url,true);
_79.send(null);
}
catch(e){
delete _79;
}
}
}
function do_setfieldpreferences(_7c,_7d,_7e,_7f,_80,_81,_82){
var _83=connection.sessionId;
if(_83==""){
return;
}
var _84=getXMLHttpRequest();
if(_84){
var _85=getselectedgroup();
if(!(isDefined(_82))){
_82="";
}
var url=connection.address.adminsetfieldpreferences+"?sessionId="+_83+"&groupid="+_85+"&tableid="+_7c+"&fieldid="+_7d+"&alias="+dax_bridge.encode(_7e)+"&inlist="+_7f+"&indetail="+_80+"&searchable="+_81+"&format="+_82;
_84.onreadystatechange=function(){
dummy(_84);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_84.open("GET",url,true);
_84.send(null);
}
catch(e){
delete _84;
}
}
}
function do_setbreakpoint(_87,_88,_89){
var _8a=connection.sessionId;
if(_8a==""){
return;
}
var _8b=getXMLHttpRequest();
if(_8b){
var _8c=getselectedgroup();
var url=connection.address.adminsetfieldbreakpoint+"?sessionId="+_8a+"&tableid="+_87+"&fieldid="+_88+"&breaklevel="+_89;
_8b.onreadystatechange=function(){
onsetbreakpoint(_8b);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_8b.open("GET",url,true);
_8b.send(null);
}
catch(e){
delete _8b;
}
}
}
function onsetbreakpoint(_8e){
if(_8e.readyState!=4){
return;
}
var _8f=checkResponse(_8e);
do_getfieldpreferences();
delete _8e;
}
function adminparsetablelist(_90,_91){
if(_90.readyState!=4){
return;
}
var _92=_90.responseXML.getElementsByTagName("tables").item(0);
var _93=checkResponse(_90);
if(!isDefined(_92)){
return false;
}
admintablegridobject.grid.clear();
admintablegridobject.grid.setFocusAll(false);
admintablegridobject.viewport.vscrollbar.slider.style.top="0px";
setStyle(admintablegridobject.grid.body,"top","0px");
var _94=_92.getElementsByTagName("table");
admintablegridobject.grid.size(7,_94.length);
formatHeader(admintablegridobject.grid);
admintablegridobject.grid.header.style.width="820px";
admintablegridobject.grid.body.style.width="820px";
admintablegridobject.viewport.dom.style.width="820px";
admintablegridobject.viewport.dom.style.maxHeight="150px";
ar_Table_ID.length=0;
ar_Table_Name.length=0;
ar_Table_Map.length=0;
ar_Table_ID.splice(0,0,"0");
ar_Table_Name.splice(0,0,STR["none"]);
for(var i=0;i<_94.length;i++){
var _96=_94.item(i);
if(_96){
if(_96.getAttribute("id")<100000){
ar_Table_ID[ar_Table_ID.length]=_96.getAttribute("id");
ar_Table_Name[ar_Table_Name.length]=_96.getAttribute("alias");
ar_Table_Map[_96.getAttribute("id")]=_96.getAttribute("alias");
}
var row=new Array();
row[0]="<center><input type='text' value='"+(i+1)+"' size=2 style='font-size:10px;'></center>";
row[4]="";
if(_96.getAttribute("id")<0){
row[1]="<div style='display: inline; position: relative; top: 0px;' class='tab_close tab_close_on' onclick='adminselectedtable="+_96.getAttribute("id")+";do_DeleteView();return true;'></div>";
row[3]="<center><div style='display: inline; position: relative; top: 3px; vertical-align: middle;'><B>View</B></div></center>";
if(_96.getAttribute("datatreeview")=="True"){
row[6]="<center><button type='button' disabled>"+STR["new_view"]+"</button></center>";
}
}
if((_96.getAttribute("id")>=0)&(_96.getAttribute("id")<=32000)){
row[1]="<div style='display: inline; position: relative; top: 0px;' class=''></div>";
row[3]="<center><div style='display: inline; position: relative; top: 3px; vertical-align: middle;'><B>Table</B></div></center>";
row[6]="<center><button type='button' onclick='adminselectedtable="+_96.getAttribute("id")+";adminselectedrow="+i+";do_GetRelatedTable();this.disabled=true;return true;'>"+STR["new_view"]+"</button></center>";
}
if((_96.getAttribute("id")>32000)&(_96.getAttribute("id")<=100000)){
row[1]="<div style='display: inline; position: relative; top: 0px;' class=''></div>";
row[3]="<center><div style='display: inline; position: relative; top: 3px; vertical-align: middle;'><B>DCS</B></div></center>";
row[6]="<center><button type='button' disabled>"+STR["new_view"]+"</button></center>";
}
if(_96.getAttribute("id")>100000){
row[1]="<div style='display: inline; position: relative; top: 0px;' class=''></div>";
row[1]+="<input type='checkbox' name='visibility_"+i+"' checked disabled><div style='display: inline; position: relative; top: -2px; vertical-align: middle;'>"+_96.getAttribute("name")+"</div>";
row[2]="<center><input type='text' value='"+_96.getAttribute("alias")+"' size=18 style='font-size:10px;'></center>";
row[3]="<center><div style='display: inline; position: relative; top: 3px; vertical-align: middle;'><B>DDW</B></div></center>";
row[6]="<center><button type='button' disabled>"+STR["new_view"]+"</button></center>";
}else{
if(_96.getAttribute("visible")=="True"){
row[1]+="<input type='checkbox' name='visibility_"+i+"' checked><div style='display: inline; position: relative; top: -2px; vertical-align: middle;'>"+_96.getAttribute("name")+"</div>";
}else{
row[1]+="<input type='checkbox' name='visibility_"+i+"'>"+_96.getAttribute("name");
}
row[2]="<center><input type='text' value='"+_96.getAttribute("alias")+"' size=18 style='font-size:10px;'></center>";
}
admintablegridobject.grid.setRow(i,row);
admintablegridobject.grid.prv.mRows[i].tableid=_96.getAttribute("id");
admintablegridobject.grid.prv.mRows[i].rowid=i;
var _98=admintablegridobject.grid.prv.mRows[i].prv.mElements[1];
_98.prv.mDOM.style.textAlign="left";
if(_96.getAttribute("id")<0){
var _99=_96.getElementsByTagName("parent");
var _9a=new Array();
var _9b=new Array();
var _9c=new Array();
_9a.length=0;
_9b.length=0;
if(_99.length==0){
_9a.splice(0,0,"0");
_9b.splice(0,0,STR["none"]);
_9c["0"]=1;
}
for(var _9d=0;_9d<_99.length;_9d++){
var _9e=_99.item(_9d);
if(_9e){
_9a[_9a.length]=_9e.getAttribute("id");
_9b[_9b.length]=_9e.getAttribute("name");
_9c[_9e.getAttribute("id")]=_9b.length;
}
}
admintablegridobject.grid.prv.mRows[i].ar_Selection_ID=_9a;
admintablegridobject.grid.prv.mRows[i].ar_Selection_Name=_9b;
admintablegridobject.grid.prv.mRows[i].ar_Selection_Map=_9c;
}
if((_96.getAttribute("id")<0)&&(_96.getAttribute("datatreeview")!="True")){
var _9f=admintablegridobject.grid.prv.mRows[i].ar_Selection_Name;
var _a0=admintablegridobject.grid.prv.mRows[i].ar_Selection_ID;
var _a1=GetPopupTemplate("selectionviewpopup_"+i,_a0,_9f);
var _98=admintablegridobject.grid.prv.mRows[i].prv.mElements[6];
_98.setContent(_a1);
_98.prv.mDOM.style.textAlign="center";
_a1.selectedIndex=admintablegridobject.grid.prv.mRows[i].ar_Selection_Map[_96.getAttribute("selectionviewid")]-1;
admintablegridobject.grid.prv.mRows[i].selectionviewid=_96.getAttribute("selectionviewid");
_a1.parent=_98;
}
var _a1=cachedtableviewpopup.cloneNode(true);
_a1.id="tableviewpopup_"+i;
if(browser.safari){
_a1.style.width="85px";
}
var _98=admintablegridobject.grid.prv.mRows[i].prv.mElements[4];
_98.setContent(_a1);
_98.prv.mDOM.style.textAlign="center";
if(_96.getAttribute("calendarview")=="True"){
_a1.selectedIndex=1;
}else{
if(_96.getAttribute("datatreeview")=="True"){
_a1.selectedIndex=2;
}else{
if(_96.getAttribute("datamatrixview")=="True"){
_a1.selectedIndex=3;
}else{
if(_96.getAttribute("imagematrixview")=="True"){
_a1.selectedIndex=4;
}else{
_a1.selectedIndex=0;
}
}
}
}
if(_96.getAttribute("id")>100000){
_a1.disabled=true;
}
_a1.parent=_98;
var _a1=cachedDDWpopup.cloneNode(true);
_a1.id="DDWpopup_"+i;
var _98=admintablegridobject.grid.prv.mRows[i].prv.mElements[5];
_98.setContent(_a1);
_98.prv.mDOM.style.textAlign="center";
if(!browser.ie){
_a1.style.maxWidth="150px;";
}
_98.prv.mDOM.ddwidready=false;
if(_96.getAttribute("ddw")==""){
_a1.selectedIndex=0;
_98.prv.mDOM.ddwid=0;
}else{
_a1.selectedIndex=ar_DDW_Map[_96.getAttribute("ddw")]-1;
}
if(_96.getAttribute("id")>100000){
_a1.disabled=true;
}
_a1.parent=_98;
}
}
if(browser.safari){
var _a2=((_94.length)*(admintablegridobject.prv.mRowHeight+5))-150+24;
}else{
if(admintablegridobject.viewport.dom.offsetHeight==0){
var _a2=((_94.length)*(admintablegridobject.prv.mRowHeight+5))-150+24;
}else{
var _a2=((_94.length)*(admintablegridobject.prv.mRowHeight+5))-admintablegridobject.viewport.dom.offsetHeight+admintablegridobject.grid.header.offsetHeight;
}
}
admintablegridobject.viewport.vscrollbar.isStatic=true;
admintablegridobject.viewport.vscrollbar.areaHeight=(_94.length)*(admintablegridobject.prv.mRowHeight+5);
admintablegridobject.viewport.setOverflow(_a2,0);
admintableareaHeight=(_94.length)*(admintablegridobject.prv.mRowHeight+5);
admintableoverflow=_a2;
admintablegridobject.viewport.refresh();
admintablegridobject.grid.dom.style.maxHeight="150px";
admintablegridobject.viewport.vscrollbar.dom.style.top=admintablegridobject.viewport.content.offsetTop+"px";
admintablegridobject.viewport.vscrollbar.dom.style.left=admintablegridobject.viewport.content.offsetLeft+admintablegridobject.viewport.content.offsetWidth+"px";
for(i=0;i<admintablegridobject.grid.prv.mRows.length;i++){
row=admintablegridobject.grid.prv.mRows[i].prv.mDOM;
row.onmouseover="";
row.onmouseout="";
row.onclick="";
for(j=0;j<admintablegridobject.grid.prv.mRows[i].prv.mElements.length;j++){
cell=admintablegridobject.grid.prv.mRows[i].prv.mElements[j].prv.mDOM;
cell.i=i;
cell.j=j;
if((cell.innerHTML!="")&&(cell.innerHTML!=" ")){
cell.parent=admintablegridobject.grid.prv.mRows[i];
cell.onmousedown="";
cell.onmousedown=function(){
if(!this.parent.prv.mFocus){
this.parent.prv.mParent.onrowselect(this.parent);
adminselectedtable=this.parent.tableid;
adminselectedrow=this.parent.rowid;
do_getfieldpreferences();
}
switch(this.j){
case 0:
this.firstChild.firstChild.focus();
this.firstChild.firstChild.parentcell=this;
this.firstChild.firstChild.tableid=this.parent.tableid;
this.firstChild.firstChild.row=this.parent;
this.firstChild.firstChild.onblur=function(){
var _a3=this.parentcell.parent.prv.mElements;
do_settableposition(_a3[0].prv.mDOM.firstChild.firstChild.value,this.tableid);
this.row.setFocus(false);
};
break;
case 2:
this.firstChild.firstChild.focus();
this.firstChild.firstChild.parentcell=this;
this.firstChild.firstChild.tableid=this.parent.tableid;
this.firstChild.firstChild.onblur=function(){
var _a4=this.parentcell.parent.prv.mElements;
if(!_a5){
var _a5=getTable(this.parentcell.parent.tableid);
}
var _a6="False";
if(_a4[1].prv.mDOM.childNodes[1].checked){
_a6="True";
}
var _a7="False";
var _a8="False";
var _a9="False";
var _aa="False";
if(_a5){
_a5.tablecalendarview="False";
_a5.tabledatatreeview="False";
_a5.tabledatamatrixview="False";
_a5.tableimagematrixview="False";
}
if(_a4[4].prv.mContent.selectedIndex=="1"){
_a7="True";
if(_a5){
_a5.tablecalendarview="True";
}
}else{
if(_a4[4].prv.mContent.selectedIndex=="2"){
_a8="True";
if(_a5){
_a5.tabledatatreeview="True";
}
}else{
if(_a4[4].prv.mContent.selectedIndex=="3"){
_a9="True";
if(_a5){
_a5.tabledatamatrixview="True";
}
}else{
if(_a4[4].prv.mContent.selectedIndex=="4"){
_aa="True";
if(_a5){
_a5.tableimagematrixview="True";
}
}
}
}
}
do_settablepreferences(this.parentcell.parent.tableid,_a4[2].prv.mDOM.firstChild.firstChild.value,_a6,_a7,_a8,_a9,_aa);
for(var h in ar_Table_Name){
if(ar_Table_ID[h]==this.parentcell.parent.tableid){
ar_Table_Name[h]=_a4[2].prv.mDOM.firstChild.firstChild.value;
ar_Table_Map[this.parentcell.parent.tableid]=_a4[2].prv.mDOM.firstChild.firstChild.value;
}
}
};
break;
default:
}
return true;
};
cell.onclick=function(){
if(!this.parent.prv.mFocus){
this.parent.prv.mParent.onrowselect(this.parent);
adminselectedtable=this.parent.tableid;
adminselectedrow=this.parent.rowid;
do_getfieldpreferences();
}
switch(this.j){
case 1:
if(!_ac){
var _ac=getTable(this.parent.tableid);
}
var _ad=this.parent.prv.mElements;
var _ae="False";
if(_ad[1].prv.mDOM.childNodes[1].checked){
_ae="True";
}
var _af="False";
var _b0="False";
var _b1="False";
var _b2="False";
if(_ac){
_ac.tablecalendarview="False";
_ac.tabledatatreeview="False";
_ac.tabledatamatrixview="False";
_ac.tableimagematrixview="False";
}
if(_ad[4].prv.mContent.selectedIndex=="1"){
_af="True";
if(_ac){
_ac.tablecalendarview="True";
}
}else{
if(_ad[4].prv.mContent.selectedIndex=="2"){
_b0="True";
if(_ac){
_ac.tabledatatreeview="True";
}
}else{
if(_ad[4].prv.mContent.selectedIndex=="3"){
_b1="True";
if(_ac){
_ac.tabledatamatrixview="True";
}
}else{
if(_ad[4].prv.mContent.selectedIndex=="4"){
_b2="True";
if(_ac){
_ac.tableimagematrixview="True";
}
}
}
}
}
if(this.parent.tableid<0){
if(_ad[4].prv.mContent.selectedIndex=="2"){
_ad[6].setContent("<center><button type='button' disabled>"+STR["new_view"]+"</button></center>");
}else{
var _b3=this.parent.ar_Selection_Name;
var _b4=this.parent.ar_Selection_ID;
var _b5=GetPopupTemplate("selectionviewpopup_"+i,_b4,_b3);
var _b6=_ad[6];
_b6.setContent(_b5);
_b6.prv.mDOM.style.textAlign="center";
_b5.selectedIndex=this.parent.ar_Selection_Map[this.parent.selectionviewid]-1;
_b5.parent=_b6;
}
}
do_settablepreferences(this.parent.tableid,_ad[2].prv.mDOM.firstChild.firstChild.value,_ae,_af,_b0,_b1,_b2);
break;
case 4:
if(!_ac){
var _ac=getTable(this.parent.tableid);
}
var _ad=this.parent.prv.mElements;
var _ae="False";
if(_ad[1].prv.mDOM.childNodes[1].checked){
_ae="True";
}
var _af="False";
var _b0="False";
var _b1="False";
var _b2="False";
if(_ac){
_ac.tablecalendarview="False";
_ac.tabledatatreeview="False";
_ac.tabledatamatrixview="False";
_ac.tableimagematrixview="False";
}
if(_ad[4].prv.mContent.selectedIndex=="1"){
_af="True";
if(_ac){
_ac.tablecalendarview="True";
}
}else{
if(_ad[4].prv.mContent.selectedIndex=="2"){
_b0="True";
if(_ac){
_ac.tabledatatreeview="True";
}
}else{
if(_ad[4].prv.mContent.selectedIndex=="3"){
_b1="True";
if(_ac){
_ac.tabledatamatrixview="True";
}
}else{
if(_ad[4].prv.mContent.selectedIndex=="4"){
_b2="True";
if(_ac){
_ac.tableimagematrixview="True";
}
}
}
}
}
if(this.parent.tableid<0){
if(_ad[4].prv.mContent.selectedIndex=="2"){
_ad[6].setContent("<center><button type='button' disabled>"+STR["new_view"]+"</button></center>");
}else{
var _b3=this.parent.ar_Selection_Name;
var _b4=this.parent.ar_Selection_ID;
var _b5=GetPopupTemplate("selectionviewpopup_"+i,_b4,_b3);
var _b6=_ad[6];
_b6.setContent(_b5);
_b6.prv.mDOM.style.textAlign="center";
_b5.selectedIndex=this.parent.ar_Selection_Map[this.parent.selectionviewid]-1;
_b5.parent=_b6;
}
}
do_settablepreferences(this.parent.tableid,_ad[2].prv.mDOM.firstChild.firstChild.value,_ae,_af,_b0,_b1,_b2);
do_getfieldpreferences();
break;
case 5:
var _ad=this.parent.prv.mElements;
do_SetDDWToObject("Selection",this.parent.tableid,_ad[5].prv.mContent.options[_ad[5].prv.mContent.selectedIndex].value);
break;
case 6:
if(this.parent.tableid<0){
var _ad=this.parent.prv.mElements;
this.parent.selectionviewid=_ad[6].prv.mContent.options[_ad[6].prv.mContent.selectedIndex].value;
do_setselectionview(this.parent.tableid,_ad[6].prv.mContent.options[_ad[6].prv.mContent.selectedIndex].value);
}
break;
default:
}
return true;
};
}else{
cell.onmouseout="";
cell.onmouseover="";
cell.onclick="";
}
}
}
delete _90;
if(_91!=undefined){
switch(_91){
case "bottom":
if(_94.length>4){
var _a2=((_94.length)*(admintablegridobject.prv.mRowHeight+5))-admintablegridobject.viewport.dom.offsetHeight+admintablegridobject.grid.header.offsetHeight;
setStyle(admintablegridobject.grid.body,"top",_a2*(-1)+"px");
setStyle(admintablegridobject.viewport.vscrollbar.slider,"top",admintablegridobject.viewport.vscrollbar.trackSpace-xpGetSize(admintablegridobject.viewport.vscrollbar.slider).height+"px");
}
var _b7=admintablegridobject.grid.prv.mRows[_94.length-1];
_b7.prv.mParent.onrowselect(_b7);
adminselectedtable=_b7.tableid;
do_getfieldpreferences();
break;
case "top":
setStyle(admintablegridobject.grid.body,"top","0px");
setStyle(admintablegridobject.viewport.vscrollbar.slider,"top","0px");
var _b7=admintablegridobject.grid.prv.mRows[0];
_b7.prv.mParent.onrowselect(_b7);
adminselectedtable=_b7.tableid;
do_getfieldpreferences();
break;
}
}
}
function adminparsefieldlist(_b8){
if(_b8.readyState!=4){
return;
}
var _b9=_b8.responseXML.getElementsByTagName("fields").item(0);
var _ba=checkResponse(_b8);
if(!isDefined(_b9)){
return false;
}
adminfieldgridobject.grid.clear();
adminfieldgridobject.viewport.vscrollbar.slider.style.top="0px";
setStyle(adminfieldgridobject.grid.body,"top","0px");
var _bb=_b9.getElementsByTagName("field");
if(_bb.length>0){
adminfieldgridobject.grid.size(9,_bb.length);
}else{
adminfieldgridobject.grid.size(9,1);
var row=new Array();
row[0]=" ";
row[1]=" ";
row[2]=" ";
row[3]=" ";
row[4]=" ";
row[5]=" ";
row[6]=" ";
row[7]=" ";
row[8]=" ";
adminfieldgridobject.grid.setRow(0,row);
}
formatHeader(adminfieldgridobject.grid);
ar_DDW_Field_ID.length=0;
ar_DDW_Field_Name.length=0;
ar_DDW_Field_Map.length=0;
ar_DDW_Field_ID.splice(0,0,"0");
ar_DDW_Field_Name.splice(0,0,STR["none"]);
for(var _bd=0;_bd<_bb.length;_bd++){
var i=_bd;
var _bf=_bb.item(i);
if(_bf){
ar_DDW_Field_ID[ar_DDW_Field_ID.length]=_bf.getAttribute("id");
ar_DDW_Field_Name[ar_DDW_Field_Name.length]="["+_bf.getAttribute("tablename")+"]"+_bf.getAttribute("name");
ar_DDW_Field_Map[_bf.getAttribute("title")]=ar_DDW_Field_Name.length;
var row=new Array();
if((_b9.getAttribute("tableid")>32000)&(_b9.getAttribute("tableid")<=100000)){
row[0]="<center><input disabled type='text' value='"+(_bd+1)+"' size=2 style='font-size:10px;'></center>";
}else{
row[0]="<center><input type='text' value='"+(_bd+1)+"' size=2 style='font-size:10px;'></center>";
}
if(_bf.getAttribute("inlist")=="True"){
if(_bf.getAttribute("indetail")=="True"){
if(_bf.getAttribute("searchable")=="True"){
row[1]="<input type='checkbox' name='fieldinlist_"+_bd+"' checked><input type='checkbox' name='fieldindetail_"+_bd+"' checked><input type='checkbox' name='fieldinsearch_"+_bd+"' checked><div style='display: inline; position: relative; top: -2px;'>["+_bf.getAttribute("tablename")+"]"+_bf.getAttribute("name")+"</div>";
}else{
row[1]="<input type='checkbox' name='fieldinlist_"+_bd+"' checked><input type='checkbox' name='fieldindetail_"+_bd+"' checked><input type='checkbox' name='fieldinsearch_"+_bd+"'><div style='display: inline; position: relative; top: -2px;'>["+_bf.getAttribute("tablename")+"]"+_bf.getAttribute("name")+"</div>";
}
}else{
if(_bf.getAttribute("searchable")=="True"){
row[1]="<input type='checkbox' name='fieldinlist_"+_bd+"' checked><input type='checkbox' name='fieldindetail_"+_bd+"'><input type='checkbox' name='fieldinsearch_"+_bd+"' checked><div style='display: inline; position: relative; top: -2px;'>["+_bf.getAttribute("tablename")+"]"+_bf.getAttribute("name")+"</div>";
}else{
row[1]="<input type='checkbox' name='fieldinlist_"+_bd+"' checked><input type='checkbox' name='fieldindetail_"+_bd+"'><input type='checkbox' name='fieldinsearch_"+_bd+"'><div style='display: inline; position: relative; top: -2px;'>["+_bf.getAttribute("tablename")+"]"+_bf.getAttribute("name")+"</div>";
}
}
}else{
if(_bf.getAttribute("indetail")=="True"){
if(_bf.getAttribute("searchable")=="True"){
row[1]="<input type='checkbox' name='fieldinlist_"+_bd+"'><input type='checkbox' name='fieldindetail_"+_bd+"' checked><input type='checkbox' name='fieldinsearch_"+_bd+"' checked>["+_bf.getAttribute("tablename")+"]"+_bf.getAttribute("name");
}else{
row[1]="<input type='checkbox' name='fieldinlist_"+_bd+"'><input type='checkbox' name='fieldindetail_"+_bd+"' checked><input type='checkbox' name='fieldinsearch_"+_bd+"'>["+_bf.getAttribute("tablename")+"]"+_bf.getAttribute("name");
}
}else{
if(_bf.getAttribute("searchable")=="True"){
row[1]="<input type='checkbox' name='fieldinlist_"+_bd+"'><input type='checkbox' name='fieldindetail_"+_bd+"'><input type='checkbox' name='fieldinsearch_"+_bd+"' checked>["+_bf.getAttribute("tablename")+"]"+_bf.getAttribute("name");
}else{
row[1]="<input type='checkbox' name='fieldinlist_"+_bd+"'><input type='checkbox' name='fieldindetail_"+_bd+"'><input type='checkbox' name='fieldinsearch_"+_bd+"'>["+_bf.getAttribute("tablename")+"]"+_bf.getAttribute("name");
}
}
}
row[2]="<center><input type='text' value='"+_bf.getAttribute("alias")+"' size=18 style='font-size:10px;'></center>";
row[3]="<center><img src='/dax/js/templates/images/"+_bf.getAttribute("type")+".png' alt='"+_bf.getAttribute("type")+"'><center>";
row[6]="<center><input id='dax_onload_"+_bf.getAttribute("id")+"' type='checkbox' value='' size=10 style='font-size:10px;'></center>";
row[7]="<center><input id='dax_ondatachange_"+_bf.getAttribute("id")+"' type='checkbox' value='' size=10 style='font-size:10px;'></center>";
adminfieldgridobject.grid.setRow(_bd,row);
var _c0={onload:$("dax_onload_"+_bf.getAttribute("id")),ondatachange:$("dax_ondatachange_"+_bf.getAttribute("id"))};
if(_bf.getAttribute("mandatory")=="True"){
adminfieldgridobject.grid.prv.mRows[_bd].prv.mElements[1].prv.mDOM.childNodes[3].disabled=true;
}
if((_bf.getAttribute("breaklevel")>0)&(admintablegridobject.grid.prv.mRows[adminselectedrow].prv.mElements[4].prv.mDOM.firstChild.selectedIndex==2)){
adminfieldgridobject.grid.prv.mRows[_bd].prv.mElements[1].prv.mDOM.childNodes[1].disabled=true;
}
adminfieldgridobject.grid.prv.mRows[_bd].tableid=_b9.getAttribute("tableid");
adminfieldgridobject.grid.prv.mRows[_bd].fieldid=_bf.getAttribute("id");
adminfieldgridobject.grid.prv.mRows[_bd].mandatory=_bf.getAttribute("mandatory");
var _c1=adminfieldgridobject.grid.prv.mRows[_bd].prv.mElements[1];
_c1.prv.mDOM.style.textAlign="left";
var _c2;
var _c3;
switch(_bf.getAttribute("type")){
case ("integer"):
var _c4=cachedtableviewpopup_integer.cloneNode(true);
break;
case ("longint"):
var _c4=cachedtableviewpopup_longint.cloneNode(true);
break;
case ("real"):
var _c4=cachedtableviewpopup_real.cloneNode(true);
break;
case ("date"):
var _c4=cachedtableviewpopup_date.cloneNode(true);
break;
case ("time"):
var _c4=cachedtableviewpopup_time.cloneNode(true);
break;
case ("alpha"):
var _c4=cachedtableviewpopup_alpha.cloneNode(true);
break;
case ("text"):
var _c4=cachedtableviewpopup_text.cloneNode(true);
break;
case ("boolean"):
var _c4=cachedtableviewpopup_boolean.cloneNode(true);
break;
default:
var _c4=cachedtableviewpopup_none.cloneNode(true);
break;
}
_c4.id="tableviewpopup_"+_bd;
var _c1=adminfieldgridobject.grid.prv.mRows[_bd].prv.mElements[4];
_c1.setContent(_c4);
_c1.prv.mDOM.style.textAlign="center";
if(browser.safari){
_c4.style.width="50px";
}else{
if(!browser.ie){
_c4.style.width="55px;";
}
}
for(var j=0;j<_c4.length;j++){
if(_c4[j].value==_bf.getAttribute("format")){
_c4.selectedIndex=j;
}
}
_c4.parent=_c1;
var _c4=cachedfieldbreakpopup.cloneNode(true);
_c4.id="fieldbreakpopup_"+_bd;
if(browser.safari){
_c4.style.width="50px";
}
var _c1=adminfieldgridobject.grid.prv.mRows[_bd].prv.mElements[5];
_c1.setContent(_c4);
_c1.prv.mDOM.style.textAlign="center";
if(_bf.getAttribute("type")=="picture"){
_c4.disabled=true;
}else{
if(admintablegridobject.grid.prv.mRows[adminselectedrow].prv.mElements[4].prv.mDOM.firstChild.selectedIndex!=2){
_c4.disabled=true;
}else{
if(_bf.getAttribute("inlist")=="False"){
_c4.disabled=true;
}else{
_c4.selectedIndex=_bf.getAttribute("breaklevel");
}
}
}
_c4.parent=_c1;
_c4.onchange=function(){
var _c6=this.parent.prv.mParent.prv.mElements;
do_setbreakpoint(this.parent.prv.mParent.tableid,this.parent.prv.mParent.fieldid,_c6[5].prv.mContent[_c6[5].prv.mContent.selectedIndex].value);
};
var _c4=cachedDDWpopup.cloneNode(true);
_c4.id="fieldviewpopup_"+_bd;
var _c1=adminfieldgridobject.grid.prv.mRows[i].prv.mElements[8];
_c1.setContent(_c4);
_c1.prv.mDOM.style.textAlign="center";
if(!browser.ie){
_c4.style.maxWidth="100px;";
}
if(_bf.getAttribute("ddw")==""){
_c4.selectedIndex=0;
_c1.prv.mDOM.ddwid=0;
}else{
_c4.selectedIndex=ar_DDW_Map[_bf.getAttribute("ddw")]-1;
}
_c4.parent=_c1;
}
}
do_getcallback(adminselectedtable,"0",_c0);
var _c7=((_bb.length)*(adminfieldgridobject.prv.mRowHeight+5))-adminfieldgridobject.viewport.dom.offsetHeight+adminfieldgridobject.grid.header.offsetHeight;
adminfieldgridobject.viewport.vscrollbar.isStatic=true;
adminfieldgridobject.viewport.vscrollbar.areaHeight=(_bb.length)*(adminfieldgridobject.prv.mRowHeight+5);
adminfieldgridobject.viewport.setOverflow(_c7,0);
adminfieldgridobject.viewport.refresh();
adminfieldgridobject.grid.dom.style.maxHeight="150px";
adminfieldgridobject.viewport.vscrollbar.dom.style.top=adminfieldgridobject.viewport.content.offsetTop+"px";
adminfieldgridobject.viewport.vscrollbar.dom.style.left=adminfieldgridobject.viewport.content.offsetLeft+adminfieldgridobject.viewport.content.offsetWidth+"px";
for(var i=0;i<adminfieldgridobject.grid.prv.mRows.length;i++){
row=adminfieldgridobject.grid.prv.mRows[i].prv.mDOM;
row.onmouseover="";
row.onmouseout="";
row.onclick="";
for(j=0;j<adminfieldgridobject.grid.prv.mRows[i].prv.mElements.length;j++){
cell=adminfieldgridobject.grid.prv.mRows[i].prv.mElements[j].prv.mDOM;
cell.i=i;
cell.j=j;
if((cell.innerHTML!="")&&(cell.innerHTML!=" ")){
cell.parent=adminfieldgridobject.grid.prv.mRows[i];
cell.onclick=function(){
if(!this.parent.prv.mFocus){
this.parent.prv.mParent.onrowselect(this.parent);
}
switch(this.j){
case 0:
this.firstChild.firstChild.focus();
this.firstChild.firstChild.parentcell=this;
this.firstChild.firstChild.onblur=function(){
var _c8=this.parentcell.parent.prv.mElements;
do_setfieldposition(_c8[0].prv.mDOM.firstChild.firstChild.value,this.parentcell.parent.tableid,this.parentcell.parent.fieldid);
};
break;
case 2:
this.firstChild.firstChild.focus();
this.firstChild.firstChild.parentcell=this;
this.firstChild.firstChild.onblur=function(){
var _c9=this.parentcell.parent.prv.mElements;
var _ca="False";
var _cb="False";
var _cc="False";
if(_c9[1].prv.mDOM.childNodes[0].checked){
_ca="True";
if(admintablegridobject.grid.prv.mRows[adminselectedrow].prv.mElements[4].prv.mDOM.firstChild.selectedIndex==2){
_c9[5].prv.mDOM.firstChild.disabled=false;
}
}else{
if(admintablegridobject.grid.prv.mRows[adminselectedrow].prv.mElements[4].prv.mDOM.firstChild.selectedIndex==2){
_c9[5].prv.mDOM.firstChild.disabled=true;
}
}
if(_c9[1].prv.mDOM.childNodes[1].checked){
_cb="True";
}
if(_c9[1].prv.mDOM.childNodes[2].checked){
_cc="True";
}
do_setfieldpreferences(this.parentcell.parent.tableid,this.parentcell.parent.fieldid,_c9[2].prv.mDOM.firstChild.firstChild.value,_ca,_cb,_cc,_c9[4].prv.mContent[_c9[4].prv.mContent.selectedIndex].value);
};
break;
case 6:
this.firstChild.firstChild.focus();
this.firstChild.firstChild.parentcell=this;
try{
if(this.firstChild.firstChild.checked){
do_setcallback(this.parent.tableid,this.parent.fieldid,"DAX_DevHook_CB_EventFired",dax_event_onload);
}else{
do_setcallback(this.parent.tableid,this.parent.fieldid,"",dax_event_onload);
}
}
catch(e){
this.firstChild.firstChild.onblur=function(){
var _cd=this.parentcell.parent.prv.mElements;
do_setcallback(this.parentcell.parent.tableid,this.parentcell.parent.fieldid,_cd[6].prv.mDOM.firstChild.firstChild.value,dax_event_onload);
};
}
break;
case 7:
this.firstChild.firstChild.focus();
this.firstChild.firstChild.parentcell=this;
try{
if(this.firstChild.firstChild.checked){
do_setcallback(this.parent.tableid,this.parent.fieldid,"DAX_DevHook_CB_EventFired",dax_event_ondatachange);
}else{
do_setcallback(this.parent.tableid,this.parent.fieldid,"",dax_event_ondatachange);
}
}
catch(e){
this.firstChild.firstChild.onblur=function(){
var _ce=this.parentcell.parent.prv.mElements;
do_setcallback(this.parentcell.parent.tableid,this.parentcell.parent.fieldid,_ce[7].prv.mDOM.firstChild.firstChild.value,dax_event_ondatachange);
};
}
break;
case 4:
case 1:
var _cf=this.parent.prv.mElements;
var _d0="False";
var _d1="False";
var _d2="False";
if(_cf[1].prv.mDOM.childNodes[0].checked){
_d0="True";
if(admintablegridobject.grid.prv.mRows[adminselectedrow].prv.mElements[4].prv.mDOM.firstChild.selectedIndex==2){
_cf[5].prv.mDOM.firstChild.disabled=false;
}
}else{
if(admintablegridobject.grid.prv.mRows[adminselectedrow].prv.mElements[4].prv.mDOM.firstChild.selectedIndex==2){
_cf[5].prv.mDOM.firstChild.disabled=true;
}
}
if(_cf[1].prv.mDOM.childNodes[1].checked){
_d1="True";
}
if(_cf[1].prv.mDOM.childNodes[2].checked){
_d2="True";
}
do_setfieldpreferences(this.parent.tableid,this.parent.fieldid,_cf[2].prv.mDOM.firstChild.firstChild.value,_d0,_d1,_d2,_cf[4].prv.mContent[_cf[4].prv.mContent.selectedIndex].value);
break;
case 5:
break;
case 8:
var _cf=this.parent.prv.mElements;
do_SetDDWToObject("Field",this.parent.tableid,_cf[8].prv.mContent.options[_cf[8].prv.mContent.selectedIndex].value,this.parent.fieldid);
break;
default:
}
var _d3=getField(adminselectedtable,this.parent.fieldid);
var _d4=structure.getTable(adminselectedtable);
if(_d4!=undefined){
if(!_d4.cached){
buildFieldList(adminselectedtable);
}
sField=structure.getField(adminselectedtable,this.parent.fieldid);
if(_cf!=undefined){
if(_d3){
_d3.fieldformat=_cf[4].prv.mContent[_cf[4].prv.mContent.selectedIndex].value;
}
if(sField){
sField.fieldformat=_cf[4].prv.mContent[_cf[4].prv.mContent.selectedIndex].value;
}
}
if(_d3){
_d3.fieldinlist=_d0;
_d3.fieldindetail=_d1;
_d3.fieldinsearch=_d2;
}
}
};
cell.onmousedown=cell.onclick;
}else{
cell.onmouseout="";
cell.onmouseover="";
cell.onclick="";
}
}
}
delete _b8;
}
function adminqueryparsefieldlist(_d5,_d6,_d7){
if(_d5.readyState!=4){
return;
}
var _d8=_d5.responseXML.getElementsByTagName("fields").item(0);
var _d9=checkResponse(_d5);
if(!isDefined(_d8)){
return false;
}
var _da=_d8.getElementsByTagName("field");
ar_Field_ID.length=0;
ar_Field_Name.length=0;
ar_Field_Map.length=0;
ar_Field_Type.length=0;
for(var i=0;i<_da.length;i++){
var _dc=_da.item(i);
if(_dc){
if(_dc.getAttribute("type")!="picture"){
ar_Field_ID[ar_Field_ID.length]=_dc.getAttribute("id");
ar_Field_Name[ar_Field_Name.length]=_dc.getAttribute("alias");
ar_Field_Map[_dc.getAttribute("id")]=_dc.getAttribute("alias");
ar_Field_Type[_dc.getAttribute("id")]=_dc.getAttribute("type");
}
}
}
var _dd=GetPopupTemplate("adminQueryConditionFieldPopup",ar_Field_ID,ar_Field_Name);
_dd.onchange=function(){
if(ar_Field_Type[this.options[this.options.selectedIndex].value]=="date"){
$("AdminQueryConditionValue").value=STR["adminQuery_dateTip"];
}else{
$("AdminQueryConditionValue").value="";
}
};
$("adminQueryConditionFieldPopupdiv").innerHTML="";
$("adminQueryConditionFieldPopupdiv").appendChild(_dd);
var _dd=GetPopupTemplate("adminquerytemplatefieldPopup",ar_Field_ID,ar_Field_Name);
if(!($("adminQueryUseTemplateCBValue").checked)){
_dd.disabled=true;
}
$("adminquerytemplatefield").innerHTML="";
$("adminquerytemplatefield").appendChild(_dd);
var _dd=GetPopupTemplate("adminqueryDynamicfieldPopup",ar_Field_ID,ar_Field_Name);
if(!($("adminQueryDynamicCBValue").checked)){
_dd.disabled=true;
}
$("adminqueryDynamicfield").innerHTML="";
$("adminqueryDynamicfield").appendChild(_dd);
var _dd=GetPopupTemplate("adminQuerySortFieldPopup",ar_Field_ID,ar_Field_Name);
$("adminQuerySortField").innerHTML="";
$("adminQuerySortField").appendChild(_dd);
if(_d6){
$("adminQuerySetName").innerHTML=_d7.prv.mElements[1].prv.mDOM.lastChild.data;
$("AdminCreateQuery_Name").value=_d7.prv.mElements[1].prv.mDOM.lastChild.data;
$("adminQuerySetSelection").innerHTML=_d7.prv.mElements[3].prv.mDOM.innerHTML;
for(var i=0;i<$("adminQuerySortFieldPopup").options.length;i++){
if($("adminQuerySortFieldPopup").options[i].value==_d7.sortfield){
$("adminQuerySortFieldPopup").options[i].selected=true;
}
}
if(_d7.sortorder=="asc"){
$("adminQuerySortOrderPopup").options[0].selected=true;
}else{
$("adminQuerySortOrderPopup").options[1].selected=true;
}
if(_d7.maxnb=="-1"){
$("adminQueryMaxNbRecordsCBValue").checked=false;
$("adminQueryMaxNbRecordsValue").disabled=true;
$("adminQueryMaxNbRecordsValue").value="";
}else{
$("adminQueryMaxNbRecordsCBValue").checked=true;
$("adminQueryMaxNbRecordsValue").disabled=false;
$("adminQueryMaxNbRecordsValue").value=_d7.maxnb;
}
var _de=_d7.queryLines;
for(var j=0;j<_de.length;j++){
var _e0=_de.item(j);
var row=new Array();
var _e2=0;
for(var i=0;i<uniqueIDArray.length;i++){
if(_e2<=uniqueIDArray[i]){
_e2=uniqueIDArray[i]+1;
}
}
uniqueIDArray[i]=_e2;
if(conditionlistgridobject.grid.prv.mRowCount==1){
if(conditionlistgridobject.grid.prv.mRows[0].prv.mElements[0].prv.mContent==""){
row[1]="<div style='display: inline; position: relative; top: -2px;' class='tab_close tab_close_on' onclick='deleteCondition("+_e2+");return false;'></div>"+ar_Field_Map[_e0.getAttribute("field")];
}else{
conditionlistgridobject.grid.insertRow(conditionlistgridobject.grid.prv.mRowCount);
row[1]="<div style='display: inline; position: relative; top: -2px;' class='tab_close tab_close_on' onclick='deleteCondition("+_e2+");return false;'></div>"+ar_Field_Map[_e0.getAttribute("field")];
}
}else{
conditionlistgridobject.grid.insertRow(conditionlistgridobject.grid.prv.mRowCount);
row[1]="<div style='display: inline; position: relative; top: -2px;' class='tab_close tab_close_on' onclick='deleteCondition("+_e2+");return false;'></div>"+ar_Field_Map[_e0.getAttribute("field")];
}
row[2]=translateQueryOperator(_e0.getAttribute("operator"));
row[3]=_e0.getAttribute("condition");
row[0]=_e0.getAttribute("link");
conditionlistgridobject.grid.setRow(conditionlistgridobject.grid.prv.mRowCount-1,row);
conditionlistgridobject.grid.prv.mRows[conditionlistgridobject.grid.prv.mRowCount-1].fieldid=_e0.getAttribute("field");
conditionlistgridobject.grid.prv.mRows[conditionlistgridobject.grid.prv.mRowCount-1].operator=_e0.getAttribute("operator");
conditionlistgridobject.grid.prv.mRows[conditionlistgridobject.grid.prv.mRowCount-1].isDynamic=_e0.getAttribute("methog");
conditionlistgridobject.grid.prv.mRows[conditionlistgridobject.grid.prv.mRowCount-1].link=_e0.getAttribute("link");
}
$("QueryList").style.display="none";
$("CreateQueryButton").style.display="none";
$("CancelQueryButton").style.display="block";
$("CreateQueryDetail2").style.display="block";
$("QueryListFilterTitle").style.display="none";
$("QueryListFilterPopup").style.display="none";
if(_d6){
var _e3=((conditionlistgridobject.grid.prv.mRowCount)*(conditionlistgridobject.prv.mRowHeight+5))-conditionlistgridobject.viewport.dom.offsetHeight+conditionlistgridobject.grid.header.offsetHeight;
conditionlistgridobject.viewport.vscrollbar.isStatic=true;
conditionlistgridobject.viewport.vscrollbar.areaHeight=(conditionlistgridobject.grid.prv.mRowCount)*(conditionlistgridobject.prv.mRowHeight+5);
conditionlistgridobject.viewport.setOverflow(_e3,0);
conditionlistgridobject.viewport.refresh();
if(conditionlistgridobject.viewport.dom.offsetHeight>300){
conditionlistgridobject.viewport.dom.style.height="300px";
}
conditionlistgridobject.viewport.vscrollbar.dom.style.top=conditionlistgridobject.viewport.content.offsetTop+"px";
conditionlistgridobject.viewport.vscrollbar.dom.style.left=conditionlistgridobject.grid.header.offsetLeft+conditionlistgridobject.grid.header.offsetWidth+"px";
}
}
delete _d5;
}
function QueryCreateCancel(){
if($("CreateQueryDetail2").style.display=="block"){
resetConditionsList();
}
$("CancelQueryButton").style.display="none";
$("CreateQueryDetail1").style.display="none";
$("CreateQueryDetail2").style.display="none";
$("CreateQueryButton").style.display="block";
$("QueryListFilterTitle").style.display="block";
$("QueryListFilterPopup").style.display="block";
$("QueryList").style.display="block";
querylistgridobject.viewport.vscrollbar.dom.style.top=querylistgridobject.viewport.content.offsetTop+"px";
querylistgridobject.viewport.vscrollbar.dom.style.left=querylistgridobject.viewport.content.offsetLeft+querylistgridobject.viewport.content.offsetWidth+"px";
}
function QuerySetTemplate(){
var _e4=connection.sessionId;
if(_e4==""){
return;
}
var _e5=getXMLHttpRequest();
if(_e5){
var _e6=getselectedgroup();
var url=connection.address.adminSetQueryTemplate+"?sessionid="+_e4+"&template="+$("adminquerytemplatesPopup").options[$("adminquerytemplatesPopup").selectedIndex].value+"&fieldid="+$("adminquerytemplatefieldPopup").options[$("adminquerytemplatefieldPopup").selectedIndex].value+"&tableid="+$("AdminCreateQuery_Selection").options[$("AdminCreateQuery_Selection").selectedIndex].value;
_e5.onreadystatechange=function(){
onQuerySetTemplate(_e5);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_e5.open("GET",url,true);
_e5.send(null);
}
catch(e){
delete _e5;
}
}
}
function onQuerySetDynamic(_e8){
if(_e8.readyState!=4){
return;
}
var _e9=_e8.responseXML.getElementsByTagName("AdminQuerySetInfo").item(0);
if(_e9){
var _ea=checkResponse(_e8);
var _eb=_e9.getElementsByTagName("Status");
var _ec=_eb.item(0);
if(_ec.getAttribute("Success")=="True"){
do_getQueryList("All",true);
$("CreateQueryButton").style.display="block";
$("QueryList").style.display="block";
$("QueryListFilterTitle").style.display="block";
$("QueryListFilterPopup").style.display="block";
$("CancelQueryButton").style.display="none";
$("CreateQueryDetail1").style.display="none";
$("CreateQueryDetail2").style.display="none";
}
}else{
$("QueryStatusOne").innerHTML=STR["adminQuery_error5"];
$("AdminCreateQuery_Selection").onmousedown=function(_ed){
$("QueryStatusOne").innerHTML="";
};
$("adminqueryDynamicfieldPopup").onmousedown=function(_ee){
$("QueryStatusOne").innerHTML="";
};
}
delete _e8;
}
function onQuerySetTemplate(_ef){
if(_ef.readyState!=4){
return;
}
var _f0=_ef.responseXML.getElementsByTagName("AdminQuerySetTemplate").item(0);
var _f1=checkResponse(_ef);
var _f2=_f0.getElementsByTagName("Status");
var _f3=_f2.item(0);
if(_f3.getAttribute("Success")=="True"){
do_getQueryList("All",true);
$("CreateQueryButton").style.display="block";
$("QueryList").style.display="block";
$("QueryListFilterTitle").style.display="block";
$("QueryListFilterPopup").style.display="block";
$("CancelQueryButton").style.display="none";
$("CreateQueryDetail1").style.display="none";
$("CreateQueryDetail2").style.display="none";
}else{
}
delete _ef;
}
function QueryCreateNext(){
var _f4=0;
if($("adminQueryNewCBValue").checked){
_f4=0;
}
if($("adminQueryDynamicCBValue").checked){
_f4=1;
}
if($("adminQueryUseTemplateCBValue").checked){
_f4=2;
}
if($("AdminCreateQuery_Selection").options[$("AdminCreateQuery_Selection").selectedIndex].value==0){
$("QueryStatusOne").innerHTML=STR["adminQuery_error1"];
$("AdminCreateQuery_Selection").onmousedown=function(_f5){
$("QueryStatusOne").innerHTML="";
};
}else{
switch(_f4){
case 0:
if($("AdminCreateQuery_Name").value!=""){
var _f6=false;
for(var i=0;i<querylistgridobject.grid.prv.mRowCount;i++){
if(querylistgridobject.grid.prv.mRows[i].tableid!=undefined){
if(($("AdminCreateQuery_Selection").options[$("AdminCreateQuery_Selection").selectedIndex].value==querylistgridobject.grid.prv.mRows[i].tableid)&($("AdminCreateQuery_Name").value==querylistgridobject.grid.prv.mRows[i].prv.mElements[0].prv.mDOM.lastChild.nodeValue)){
_f6=true;
}
}
}
if(!_f6){
$("CreateQueryDetail2").style.display="block";
$("CreateQueryDetail1").style.display="none";
$("adminQuerySetName").innerHTML=$("AdminCreateQuery_Name").value;
$("adminQuerySetSelection").innerHTML=$("AdminCreateQuery_Selection").options[$("AdminCreateQuery_Selection").selectedIndex].text;
}else{
$("AdminCreateQuery_Name").style.border="1px solid red";
$("QueryStatusOne").innerHTML=STR["adminQuery_error2part1"]+$("AdminCreateQuery_Name").value+STR["adminQuery_error2part2"];
$("AdminCreateQuery_Name").onmousedown=function(_f8){
$("AdminCreateQuery_Name").style.border="1px solid black";
$("QueryStatusOne").innerHTML="";
};
}
}else{
$("AdminCreateQuery_Name").style.border="1px solid red";
$("QueryStatusOne").innerHTML=STR["adminQuery_error3"];
$("AdminCreateQuery_Name").onmousedown=function(_f9){
$("AdminCreateQuery_Name").style.border="1px solid black";
$("QueryStatusOne").innerHTML="";
};
}
break;
case 1:
QuerySetDynamic();
break;
case 2:
QuerySetTemplate();
break;
}
}
}
function QuerySetDynamic(){
var _fa=connection.sessionId;
if(_fa==""){
return;
}
var _fb=getXMLHttpRequest();
if(_fb){
var _fc=getselectedgroup();
var url=connection.address.adminsetQueryInfo;
_fb.onreadystatechange=function(){
onQuerySetDynamic(_fb);
};
try{
var _fe="sessionid="+_fa+"&queryname="+$("AdminCreateQuery_Name").value+"&queryinfo=";
_fe+="<query name=\"4daf_unique_"+$("adminqueryDynamicfieldPopup").options[$("adminqueryDynamicfieldPopup").selectedIndex].value+"\" fieldname=\""+$("adminqueryDynamicfieldPopup").options[$("adminqueryDynamicfieldPopup").selectedIndex].text+"\" sortfield=\""+$("adminqueryDynamicfieldPopup").options[$("adminqueryDynamicfieldPopup").selectedIndex].value+"\" sortorder=\"Asc\" tableid=\""+conditionlistgridobject.tableid+"\" maxnb=\"-1\">";
_fe+="</query>";
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_fb.open("POST",url,true);
_fb.send(_fe);
}
catch(e){
delete _fb;
}
}
}
function CreateQuery(){
if(conditionlistgridobject.grid.prv.mRowCount>0){
if(conditionlistgridobject.grid.prv.mRows[0].prv.mElements[0].prv.mContent!=0){
var _ff=connection.sessionId;
if(_ff==""){
return;
}
var _100=getXMLHttpRequest();
if(_100){
var _101=getselectedgroup();
var url=connection.address.adminsetQueryInfo;
_100.onreadystatechange=function(){
onCreateQuery(_100);
};
try{
var _103=-1;
if(!($("adminQueryMaxNbRecordsValue").disabled)){
_103=$("adminQueryMaxNbRecordsValue").value;
}
var _104="sessionid="+_ff+"&queryname="+dax_bridge.encode($("AdminCreateQuery_Name").value)+"&queryinfo=<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>";
_104+="<query name=\""+dax_bridge.encode($("AdminCreateQuery_Name").value)+"\" sortfield=\""+$("adminQuerySortFieldPopup").options[$("adminQuerySortFieldPopup").selectedIndex].value+"\" sortorder=\""+$("adminQuerySortOrderPopup").options[$("adminQuerySortOrderPopup").selectedIndex].value+"\" tableid=\""+conditionlistgridobject.tableid+"\" maxnb=\""+_103+"\">";
for(var i=0;i<conditionlistgridobject.grid.prv.mRowCount;i++){
if(conditionlistgridobject.grid.prv.mRows[i].prv.mElements[0].prv.mContent!=0){
if(i==0){
link="and";
}else{
link=conditionlistgridobject.grid.prv.mRows[i].link;
}
_104+="<queryline condition=\""+dax_bridge.encode(conditionlistgridobject.grid.prv.mRows[i].prv.mElements[3].prv.mContent)+"\" field=\""+conditionlistgridobject.grid.prv.mRows[i].fieldid+"\" link=\""+link+"\" operator=\""+conditionlistgridobject.grid.prv.mRows[i].operator+"\" method=\""+conditionlistgridobject.grid.prv.mRows[i].isDynamic+"\"/>";
}
}
_104+="</query>";
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_100.open("POST",url,true);
_100.send(_104);
}
catch(e){
delete _100;
}
}
}else{
$("QueryStatusTwo").innerHTML=STR["adminQuery_error4"];
}
}else{
$("QueryStatusTwo").innerHTML=STR["adminQuery_error4"];
}
}
function onCreateQuery(_106){
if(_106.readyState!=4){
return;
}
var _107=_106.responseXML.getElementsByTagName("AdminQuerySetInfo").item(0);
var _108=checkResponse(_106);
do_getQueryList("All",true);
resetConditionsList();
$("CreateQueryButton").style.display="block";
$("QueryList").style.display="block";
$("QueryListFilterTitle").style.display="block";
$("QueryListFilterPopup").style.display="block";
$("CancelQueryButton").style.display="none";
$("CreateQueryDetail1").style.display="none";
$("CreateQueryDetail2").style.display="none";
delete _106;
}
function AdminAddCondition(){
var row=new Array();
var _10a=0;
for(var i=0;i<uniqueIDArray.length;i++){
if(_10a<=uniqueIDArray[i]){
_10a=uniqueIDArray[i]+1;
}
}
uniqueIDArray[i]=_10a;
if(conditionlistgridobject.grid.prv.mRowCount==1){
if(conditionlistgridobject.grid.prv.mRows[0].prv.mElements[0].prv.mContent==""){
row[1]="<div style='display: inline; position: relative; top: -2px;' class='tab_close tab_close_on' onclick='deleteCondition("+_10a+");return false;'></div>"+$("adminQueryConditionFieldPopup").options[$("adminQueryConditionFieldPopup").selectedIndex].text;
}else{
conditionlistgridobject.grid.insertRow(conditionlistgridobject.grid.prv.mRowCount);
row[1]="<div style='display: inline; position: relative; top: -2px;' class='tab_close tab_close_on' onclick='deleteCondition("+_10a+");return false;'></div>"+$("adminQueryConditionFieldPopup").options[$("adminQueryConditionFieldPopup").selectedIndex].text;
}
}else{
conditionlistgridobject.grid.insertRow(conditionlistgridobject.grid.prv.mRowCount);
row[1]="<div style='display: inline; position: relative; top: -2px;' class='tab_close tab_close_on' onclick='deleteCondition("+_10a+");return false;'></div>"+$("adminQueryConditionFieldPopup").options[$("adminQueryConditionFieldPopup").selectedIndex].text;
}
row[2]=$("adminQueryConditionOperatorPopup").options[$("adminQueryConditionOperatorPopup").selectedIndex].text;
row[3]=$("AdminQueryConditionValue").value;
row[0]=$("adminQueryConditionLinkPopup").options[$("adminQueryConditionLinkPopup").selectedIndex].text;
conditionlistgridobject.grid.setRow(conditionlistgridobject.grid.prv.mRowCount-1,row);
conditionlistgridobject.grid.prv.mRows[conditionlistgridobject.grid.prv.mRowCount-1].fieldid=$("adminQueryConditionFieldPopup").options[$("adminQueryConditionFieldPopup").selectedIndex].value;
conditionlistgridobject.grid.prv.mRows[conditionlistgridobject.grid.prv.mRowCount-1].operator=$("adminQueryConditionOperatorPopup").options[$("adminQueryConditionOperatorPopup").selectedIndex].value;
conditionlistgridobject.grid.prv.mRows[conditionlistgridobject.grid.prv.mRowCount-1].isDynamic=$("AdminQueryConditionTypeValue").checked;
conditionlistgridobject.grid.prv.mRows[conditionlistgridobject.grid.prv.mRowCount-1].link=$("adminQueryConditionLinkPopup").options[$("adminQueryConditionLinkPopup").selectedIndex].value;
var _10c=((conditionlistgridobject.grid.prv.mRowCount)*(conditionlistgridobject.prv.mRowHeight+5))-conditionlistgridobject.viewport.dom.offsetHeight+conditionlistgridobject.grid.header.offsetHeight;
conditionlistgridobject.viewport.vscrollbar.isStatic=true;
conditionlistgridobject.viewport.vscrollbar.areaHeight=(conditionlistgridobject.grid.prv.mRowCount)*(conditionlistgridobject.prv.mRowHeight+5);
conditionlistgridobject.viewport.setOverflow(_10c,0);
conditionlistgridobject.viewport.refresh();
$("QueryStatusTwo").innerHTML="";
if(conditionlistgridobject.viewport.dom.offsetHeight>300){
conditionlistgridobject.viewport.dom.style.height="300px";
}
conditionlistgridobject.viewport.vscrollbar.dom.style.top=conditionlistgridobject.viewport.content.offsetTop+"px";
conditionlistgridobject.viewport.vscrollbar.dom.style.left=conditionlistgridobject.grid.header.offsetLeft+conditionlistgridobject.grid.header.offsetWidth+"px";
}
function resetConditionsList(_10d){
conditionlistgridobject.grid.clear();
conditionlistgridobject.grid.size(4,1);
uniqueIDArray.length=0;
$("AdminQueryConditionValue").value="";
$("QueryStatusTwo").innerHTML="";
}
function deleteCondition(_10e){
var _10f=-1;
for(var i=0;i<uniqueIDArray.length;i++){
if(_10e==uniqueIDArray[i]){
_10f=i;
uniqueIDArray.splice(i,1);
}
}
if(_10f>=0){
conditionlistgridobject.grid.prv.mRows[_10f].prv.mDOM.className="row";
if(conditionlistgridobject.grid.prv.mRowCount==1){
conditionlistgridobject.grid.insertRow(1);
}
conditionlistgridobject.grid.removeRow(_10f);
var _111=((conditionlistgridobject.grid.prv.mRowCount)*(conditionlistgridobject.prv.mRowHeight+5))-conditionlistgridobject.viewport.dom.offsetHeight+conditionlistgridobject.grid.header.offsetHeight;
conditionlistgridobject.viewport.vscrollbar.isStatic=true;
conditionlistgridobject.viewport.vscrollbar.areaHeight=(conditionlistgridobject.grid.prv.mRowCount)*(conditionlistgridobject.prv.mRowHeight+5);
conditionlistgridobject.viewport.setOverflow(_111,0);
conditionlistgridobject.viewport.refresh();
if(conditionlistgridobject.viewport.dom.offsetHeight>300){
conditionlistgridobject.viewport.dom.style.height="300px";
}
conditionlistgridobject.viewport.vscrollbar.dom.style.top=conditionlistgridobject.viewport.content.offsetTop+"px";
conditionlistgridobject.viewport.vscrollbar.dom.style.left=conditionlistgridobject.grid.header.offsetLeft+conditionlistgridobject.grid.header.offsetWidth+"px";
if(conditionlistgridobject.grid.body.offsetTop+conditionlistgridobject.grid.body.offsetHeight<conditionlistgridobject.viewport.dom.offsetHeight){
conditionlistgridobject.grid.body.style.top=conditionlistgridobject.grid.body.offsetTop+1+"px";
setStyle(conditionlistgridobject.viewport.vscrollbar.slider,"top",conditionlistgridobject.viewport.vscrollbar.trackSpace-xpGetSize(conditionlistgridobject.viewport.vscrollbar.slider).height+"px");
}
}
}
function redrawConditionsList(){
var row=new Array();
row[0]="";
row[1]="";
row[2]="";
row[3]="";
conditionlistgridobject.grid.setRow(0,row);
conditionlistgridobject.viewport.refresh();
}
function do_getAllRecordsSettings(_113){
var _114=connection.sessionId;
if(_114==""){
return;
}
var _115=getXMLHttpRequest();
if(_115){
var _116=getselectedgroup();
var url=connection.address.AdminGetAllRecords+"?sessionid="+_114+"&tableid="+_113;
_115.onreadystatechange=function(){
onGetAllRecordsSettings(_115);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_115.open("GET",url,true);
_115.send(null);
}
catch(e){
delete _115;
}
}
}
function onGetAllRecordsSettings(_118){
if(_118.readyState!=4){
return;
}
var _119=_118.responseXML.getElementsByTagName("AdminGetAllRecords").item(0);
var _11a=checkResponse(_118);
if(_119.getAttribute("allrecords")=="false"){
$("QueryListAllRecordsCBValue").checked=false;
}else{
$("QueryListAllRecordsCBValue").checked=true;
}
delete _118;
}
function do_setAllRecordsSettings(){
var _11b=connection.sessionId;
if(_11b==""){
return;
}
var _11c=getXMLHttpRequest();
if(_11c){
var _11d=getselectedgroup();
var url=connection.address.AdminSetAllRecords+"?sessionid="+_11b+"&tableid="+$("AdminQuery_FilterPopup").options[$("AdminQuery_FilterPopup").selectedIndex].value+"&allrecords="+$("QueryListAllRecordsCBValue").checked;
_11c.onreadystatechange=function(){
dummy(_11c);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_11c.open("GET",url,true);
_11c.send(null);
}
catch(e){
delete _11c;
}
}
}
function showAdmin(_11f,_120){
if(_120){
isAdminAccessedFromMainPage=true;
}
if(!isAdminLoggedIn){
do_showDashboard($("loginForm"));
$("loginspinner").style.display="none";
$("loginForm").style.left=getMousePosition(_11f).x-281+"px";
$("loginForm").style.top=getMousePosition(_11f).y-144+"px";
if($("login_username").value==""){
$("login_username").focus();
}else{
$("login_password").focus();
}
AdminShowAdmin=true;
}else{
do_showDashboard($("adminSettings"),"1");
if(tablelistinitialized){
admintablegridobject.viewport.refresh();
admintablegridobject.grid.dom.style.maxHeight="150px";
admintablegridobject.viewport.vscrollbar.dom.style.top=admintablegridobject.viewport.content.offsetTop+"px";
admintablegridobject.viewport.vscrollbar.dom.style.left=admintablegridobject.viewport.content.offsetLeft+admintablegridobject.viewport.content.offsetWidth+"px";
}
}
}
function do_GetRelatedTable(){
var _121=connection.sessionId;
if(_121==""){
return;
}
var _122=getXMLHttpRequest();
if(_122){
var url=connection.address.admingetrelatedtables+"?sessionId="+_121+"&tableid="+adminselectedtable;
_122.onreadystatechange=function(){
ongetrelatedtable(_122);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_122.open("GET",url,true);
_122.send(null);
}
catch(e){
delete _122;
}
}
}
function ongetrelatedtable(_124){
if(_124.readyState!=4){
return;
}
var _125=_124.responseXML.getElementsByTagName("tables").item(0);
var _126=checkResponse(_124);
var _127=_125.getElementsByTagName("table");
var _128=new Array();
var _129=new Array();
_128[0]=STR["admin_none"];
_129[0]="0";
for(var i=0;i<_127.length;i++){
var _12b=_127.item(i);
_128[i+1]=_12b.getAttribute("Name");
_129[i+1]=_12b.getAttribute("id");
}
var node=GetPopupTemplate("relatedtable_"+adminselectedrow,_129,_128);
node.notdone=true;
var cell=admintablegridobject.grid.prv.mRows[adminselectedrow].prv.mElements[6];
cell.prv.mDOM.innerHTML=STR["adminDDW_to"]+":";
cell.prv.mDOM.appendChild(node);
cell.prv.mDOM.innerHTML="<button id='admingobutton_"+adminselectedtable+"' type='button' onclick='adminselectedtable="+adminselectedtable+";adminselectedrow="+adminselectedrow+";do_CreateNewView();this.disabled=true;return true;'>"+STR["go"]+"</button> "+cell.prv.mDOM.innerHTML;
cell.prv.mDOM.style.textAlign="center";
delete _124;
}
function do_setcallback(_12e,_12f,_130,_131){
var _132=connection.sessionId;
if(_132==""){
return;
}
var _133=getXMLHttpRequest();
if(_133){
var _134=getselectedgroup();
var url=connection.address.adminsetcallback+"?sessionId="+_132+"&groupid="+_134+"&tableid="+_12e+"&fieldid="+_12f+"&methodname="+dax_bridge.encode(_130)+"&eventid="+_131;
_133.onreadystatechange=function(){
dummy(_133);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_133.open("GET",url,true);
_133.send(null);
}
catch(e){
delete _133;
}
}
}
function do_getcallback(_136,_137,_138){
var _139=connection.sessionId;
if(_139==""){
return;
}
var _13a=getXMLHttpRequest();
if(_13a){
var _13b=getselectedgroup();
var url=connection.address.admingetcallback+"?sessionId="+_139+"&groupid="+_13b+"&tableid="+_136+"&fieldid="+_137;
_13a.onreadystatechange=function(){
ongetcallback(_13a,_138);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_13a.open("GET",url,true);
_13a.send(null);
}
catch(e){
delete _13a;
}
}
}
function ongetcallback(_13d,_13e){
if(_13d.readyState!=4){
return;
}
var _13f=_13d.responseXML.getElementsByTagName("GetCallBack").item(0);
var _140=checkResponse(_13d);
if(_13f){
var _141=_13f.getElementsByTagName("CallBack");
for(var i=0;i<_141.length;i++){
var _143=_141.item(i);
for(var j=0;j<adminfieldgridobject.grid.prv.mRows.length;j++){
if(adminfieldgridobject.grid.prv.mRows[j].fieldid==_143.getAttribute("fieldid")){
switch(_143.getAttribute("method")){
case (""):
if(_143.getAttribute("eventid")==dax_event_onload){
adminfieldgridobject.grid.prv.mRows[j].prv.mElements[6].prv.mDOM.firstChild.innerHTML="<input type='checkbox'>";
}
if(_143.getAttribute("eventid")==dax_event_ondatachange){
adminfieldgridobject.grid.prv.mRows[j].prv.mElements[7].prv.mDOM.firstChild.innerHTML="<input type='checkbox'>";
}
break;
case ("DAX_DevHook_CB_EventFired"):
if(_143.getAttribute("eventid")==dax_event_onload){
adminfieldgridobject.grid.prv.mRows[j].prv.mElements[6].prv.mDOM.firstChild.innerHTML="<input type='checkbox' checked>";
}
if(_143.getAttribute("eventid")==dax_event_ondatachange){
adminfieldgridobject.grid.prv.mRows[j].prv.mElements[7].prv.mDOM.firstChild.innerHTML="<input type='checkbox' checked>";
}
break;
default:
if(_143.getAttribute("eventid")==dax_event_onload){
adminfieldgridobject.grid.prv.mRows[j].prv.mElements[6].prv.mDOM.firstChild.innerHTML="<input id='dax_onload_"+adminfieldgridobject.grid.prv.mRows[j].fieldid+"' type='text' value='' size=10 style='font-size:10px;'>";
adminfieldgridobject.grid.prv.mRows[j].prv.mElements[6].prv.mDOM.firstChild.firstChild.value=_143.getAttribute("method");
}
if(_143.getAttribute("eventid")==dax_event_ondatachange){
adminfieldgridobject.grid.prv.mRows[j].prv.mElements[7].prv.mDOM.firstChild.innerHTML="<input id='dax_ondatachange_"+adminfieldgridobject.grid.prv.mRows[j].fieldid+"' type='text' value='' size=10 style='font-size:10px;'>";
adminfieldgridobject.grid.prv.mRows[j].prv.mElements[7].prv.mDOM.firstChild.firstChild.value=_143.getAttribute("method");
}
}
}
}
}
}
}
function do_DeleteView(){
var _145=connection.sessionId;
if(_145==""){
return;
}
var _146=getXMLHttpRequest();
if(_146){
var url=connection.address.admindeleteview+"?sessionId="+_145+"&tableid="+adminselectedtable;
_146.onreadystatechange=function(){
ondeleteview(_146);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_146.open("GET",url,true);
_146.send(null);
}
catch(e){
delete _146;
}
}
}
function ondeleteview(_148){
if(_148.readyState!=4){
return;
}
adminfieldgridobject.grid.clear();
adminfieldgridobject.viewport.vscrollbar.slider.style.top="0px";
setStyle(adminfieldgridobject.grid.body,"top","0px");
do_gettablepreferences();
delete _148;
}
function do_CreateNewView(){
var _149=connection.sessionId;
if(_149==""){
return;
}
var _14a=getXMLHttpRequest();
if(_14a){
var _14b=$("relatedtable_"+adminselectedrow);
var _14c=_14b[_14b.selectedIndex].value;
var url=connection.address.admincreatenewview+"?sessionId="+_149+"&primarytableid="+adminselectedtable+"&lastmanytableid="+_14c;
_14a.onreadystatechange=function(){
oncreateview(_14a);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_14a.open("GET",url,true);
_14a.send(null);
}
catch(e){
delete _14a;
}
}
}
function oncreateview(_14e){
if(_14e.readyState!=4){
return;
}
var _14f=_14e.responseXML.getElementsByTagName("Tables").item(0);
var _150=checkResponse(_14e);
if(_14f){
do_gettablepreferences("bottom");
}else{
do_gettablepreferences();
}
delete _14e;
}
function adminparseDDWInfo(_151,type,_153){
if(_151.readyState!=4){
return;
}
var _154=_151.responseXML.getElementsByTagName("GetDDWInfo").item(0);
var _155=checkResponse(_151);
if(!isDefined(_154)){
return false;
}
var _156=_154.getElementsByTagName("DDW");
if(_153){
ddwlistgridobject.grid.clear();
ddwlistgridobject.grid.unselectall();
ddwlistgridobject.viewport.vscrollbar.slider.style.top="0px";
setStyle(ddwlistgridobject.grid.body,"top","0px");
if(_156.length>0){
ddwlistgridobject.grid.size(4,_156.length);
}else{
ddwlistgridobject.grid.size(4,1);
var row=new Array();
row[0]=" ";
row[1]="<center>"+STR["adminDDW_noDDWs"]+"</center>";
row[2]=" ";
row[3]=" ";
ddwlistgridobject.grid.setRow(0,row);
}
formatHeader(ddwlistgridobject.grid);
ddwlistgridobject.grid.header.style.width="520px";
ddwlistgridobject.grid.body.style.width="520px";
ddwlistgridobject.viewport.dom.style.width="520px";
ddwlistgridobject.viewport.dom.style.maxHeight="300px";
}
ar_DDW_ID.length=0;
ar_DDW_Name.length=0;
ar_DDW_Map.length=0;
ar_DDW_ID.splice(0,0,"0");
ar_DDW_Name.splice(0,0,STR["none"]);
for(var i=0;i<_156.length;i++){
var _159=_156.item(i);
if(_159){
if(_159.getAttribute("associatedto")=="Other"){
ar_DDW_ID[ar_DDW_ID.length]=_159.getAttribute("ddwid");
ar_DDW_Name[ar_DDW_Name.length]=_159.getAttribute("title");
ar_DDW_Map[_159.getAttribute("title")]=ar_DDW_Name.length;
}
if(_153){
var row=new Array();
row[0]="<div style='display: inline; position: relative; top: -2px;' class='tab_close tab_close_on' onclick='DeleteDDW("+_159.getAttribute("ddwid")+");'></div>"+_159.getAttribute("title");
row[1]="<center><div id='adminddwitem_"+i+"'></div></center>";
switch(_159.getAttribute("type")){
case "LinkDynamic":
row[2]="<center>Link</center>";
break;
case "LinkStatic":
var _15a=/^\//;
if(_159.getAttribute("method").indexOf("/")!=-1){
row[2]="<center>Link</center>";
}else{
row[2]="<center>HTML</center>";
}
break;
case "Message":
row[2]="<center>Message</center>";
break;
}
row[3]="<center>"+_159.getAttribute("associatedto")+"</center>";
ddwlistgridobject.grid.setRow(i,row);
$("adminddwitem_"+i).innerHTML=_159.getAttribute("method");
}
}
}
if(_153){
var _15b=((_156.length)*(ddwlistgridobject.prv.mRowHeight+5))-ddwlistgridobject.viewport.dom.offsetHeight+ddwlistgridobject.grid.header.offsetHeight;
ddwlistgridobject.viewport.vscrollbar.isStatic=true;
ddwlistgridobject.viewport.vscrollbar.areaHeight=(_156.length)*(ddwlistgridobject.prv.mRowHeight+5);
ddwlistgridobject.viewport.setOverflow(_15b,0);
ddwlistgridobject.viewport.refresh();
ddwlistgridobject.grid.dom.style.maxHeight="300px";
ddwlistgridobject.viewport.vscrollbar.dom.style.top=ddwlistgridobject.viewport.content.offsetTop+"px";
ddwlistgridobject.viewport.vscrollbar.dom.style.left=ddwlistgridobject.viewport.content.offsetLeft+ddwlistgridobject.viewport.content.offsetWidth+"px";
}
CachePopups();
delete _151;
}
function adminparsequerytemplates(_15c){
if(_15c.readyState!=4){
return;
}
var _15d=_15c.responseXML.getElementsByTagName("templates").item(0);
var _15e=checkResponse(_15c);
var _15f=_15d.getElementsByTagName("template");
var _160=new Array();
var _161=new Array();
for(var i=0;i<_15f.length;i++){
var _163=_15f.item(i);
_160[i]=_163.getAttribute("name");
_161[i]=_163.getAttribute("name");
}
var node=GetPopupTemplate("adminquerytemplatesPopup",_161,_160);
node.disabled=true;
$("adminquerytemplates").innerHTML="";
$("adminquerytemplates").appendChild(node);
delete _15c;
}
function translateQueryOperator(_165){
var _166="";
switch(_165){
case "equal":
_166=STR["adminQuery_Operator1"];
break;
case "notequal":
_166=STR["adminQuery_Operator2"];
break;
case "less":
_166=STR["adminQuery_Operator3"];
break;
case "greater":
_166=STR["adminQuery_Operator4"];
break;
case "lesseq":
_166=STR["adminQuery_Operator5"];
break;
case "greatereq":
_166=STR["adminQuery_Operator6"];
break;
case "starts with":
_166=STR["adminQuery_Operator7"];
break;
case "ends with":
_166=STR["adminQuery_Operator8"];
break;
}
return _166;
}
function translateQueryLink(link){
var _168="";
switch(link){
case "and":
_168=STR["adminQuery_Link1"];
break;
case "or":
_168=STR["adminQuery_Link2"];
break;
}
return _168;
}
function adminparseReportList(_169){
if(_169.readyState!=4){
return;
}
var _16a=_169.responseXML.getElementsByTagName("reports").item(0);
var _16b=checkResponse(_169);
if(!isDefined(_16a)){
return false;
}
var _16c=_16a.getElementsByTagName("report");
reportlistgridobject.grid.unselectall();
reportlistgridobject.grid.clear();
reportlistgridobject.viewport.vscrollbar.slider.style.top="0px";
reportlistgridobject.viewport.vscrollbar.last=0;
setStyle(reportlistgridobject.grid.body,"top","0px");
reportlistgridobject.grid.size(3,1);
var row=new Array();
row[0]=" ";
row[1]=" ";
row[2]=" ";
reportlistgridobject.grid.setRow(0,row);
reportlistgridobject.grid.prv.mRows[0].prv.mElements[2].prv.mDOM.onmouseover="";
reportlistgridobject.grid.prv.mRows[0].tableid=null;
formatHeader(reportlistgridobject.grid);
reportlistgridobject.grid.header.style.width="800px";
reportlistgridobject.grid.body.style.width="800px";
reportlistgridobject.viewport.dom.style.width="800px";
reportlistgridobject.viewport.dom.style.maxHeight="300px";
for(var i=0;i<_16c.length;i++){
var _16f=_16c.item(i);
if(_16f){
var _170=_16f.getAttribute("tableid");
var row=new Array();
row[0]="<div style='display: inline; position: relative; top: -2px;' class='tab_close tab_close_on' onmousedown='do_DeleteReport(\""+escape(_16f.getAttribute("name"))+"\",\""+_170+"\");return false;'></div>"+_16f.getAttribute("name");
row[1]=_16f.getAttribute("description");
row[2]=ar_Table_Map[_170];
if(i>0){
reportlistgridobject.grid.insertRow(i);
}
reportlistgridobject.grid.setRow(i,row);
reportlistgridobject.grid.prv.mRows[i].tableid=_170;
reportlistgridobject.grid.prv.mRows[i].reportname=_16f.getAttribute("name");
reportlistgridobject.grid.prv.mRows[i].type=_16f.getAttribute("type");
reportlistgridobject.grid.prv.mRows[i].description=_16f.getAttribute("description");
}
}
var _171=((_16c.length)*(reportlistgridobject.prv.mRowHeight+5))-reportlistgridobject.viewport.dom.offsetHeight+reportlistgridobject.grid.header.offsetHeight;
reportlistgridobject.viewport.vscrollbar.isStatic=true;
reportlistgridobject.viewport.vscrollbar.areaHeight=(_16c.length)*(reportlistgridobject.prv.mRowHeight+5);
reportlistgridobject.viewport.setOverflow(_171,0);
reportlistgridobject.viewport.refresh();
reportlistgridobject.grid.dom.style.maxHeight="300px";
reportlistgridobject.viewport.vscrollbar.dom.style.top=reportlistgridobject.viewport.content.offsetTop+"px";
reportlistgridobject.viewport.vscrollbar.dom.style.left=reportlistgridobject.viewport.content.offsetLeft+reportlistgridobject.viewport.content.offsetWidth+"px";
}
function adminparseQueryList(_172,type,_174,_175){
if(_172.readyState!=4){
return;
}
var _176=_172.responseXML.getElementsByTagName("queries").item(0);
var _177=checkResponse(_172);
QueryShowDetail=true;
if(!isDefined(_176)){
return false;
}
var _178=_176.getElementsByTagName("query");
if(_174){
querylistgridobject.grid.unselectall();
querylistgridobject.grid.clear();
querylistgridobject.viewport.vscrollbar.slider.style.top="0px";
querylistgridobject.viewport.vscrollbar.last=0;
setStyle(querylistgridobject.grid.body,"top","0px");
querylistgridobject.grid.size(4,1);
var row=new Array();
row[0]=" ";
row[1]=" ";
row[2]="<center>"+STR["adminQuery_noQueries"]+"</center>";
row[3]=" ";
querylistgridobject.grid.setRow(0,row);
querylistgridobject.grid.prv.mRows[0].prv.mElements[2].prv.mDOM.onmouseover="";
querylistgridobject.grid.prv.mRows[0].tableid=null;
formatHeader(querylistgridobject.grid);
querylistgridobject.grid.header.style.width="820px";
querylistgridobject.grid.body.style.width="820px";
querylistgridobject.viewport.dom.style.width="820px";
querylistgridobject.viewport.dom.style.maxHeight="300px";
}
var _17a=0;
for(var i=0;i<_178.length;i++){
var _17c=_178.item(i);
if(_17c){
var _17d=_17c.getAttribute("tableid");
if((_174)&(($("AdminQuery_FilterPopup").options[$("AdminQuery_FilterPopup").selectedIndex].value==0)|($("AdminQuery_FilterPopup").options[$("AdminQuery_FilterPopup").selectedIndex].value==_17d))){
var row=new Array();
if($("AdminQuery_FilterPopup").options[$("AdminQuery_FilterPopup").selectedIndex].value!=0){
row[0]="<center><input type='text' value='"+(_17a+1)+"' size=2 style='font-size:10px;' onmouseup='onQueryPositionClick(this);return true;' onblur='QueryPositionBlur(\""+_17c.getAttribute("name")+"\","+_17d+",this);return true;'></center>";
}else{
row[0]="-";
}
if((_17c.getAttribute("name")>"4daf_unique_")&(_17c.getAttribute("name")<"4daf_unique_a")){
row[1]="<div style='display: inline; position: relative; top: -2px;' class='tab_close tab_close_on' onmousedown='DeleteQuery(\""+_17a+"\");return false;'></div>"+STR["adminQuery_DynamicQuery"];
row[2]=STR["adminQuery_DDTs"]+_17c.getAttribute("fieldname");
var _17e=STR["adminQuery_DDTs"]+_17c.getAttribute("fieldname");
}else{
row[1]="<div style='display: inline; position: relative; top: -2px;' class='tab_close tab_close_on' onmousedown='DeleteQuery(\""+_17a+"\");return false;'></div>"+_17c.getAttribute("name");
var _17f=_17c.getElementsByTagName("queryline");
var _180="";
var _181="";
var _17e="";
for(var j=0;j<_17f.length;j++){
var _183=_17f.item(j);
if(_183){
var _184=_183.getAttribute("field");
if(j!=0){
_181=translateQueryLink(_183.getAttribute("link"));
_180+=_181;
_17e+=_181;
}
_180+=" <b>"+_183.getAttribute("fieldname")+"</b> "+translateQueryOperator(_183.getAttribute("operator"))+" <b>"+_183.getAttribute("condition")+"</b> ";
if(_17e==""){
_17e+="<b>"+_183.getAttribute("fieldname")+"</b> "+translateQueryOperator(_183.getAttribute("operator"))+" <b>"+_183.getAttribute("condition")+"</b> ";
}else{
_17e+="<br/><b>"+_183.getAttribute("fieldname")+"</b> "+translateQueryOperator(_183.getAttribute("operator"))+" <b>"+_183.getAttribute("condition")+"</b> ";
}
}
}
row[2]="<center>"+_180+"</center>";
}
row[3]="<center>"+ar_Table_Map[_17d]+"</center>";
if(_17a>0){
querylistgridobject.grid.insertRow(_17a+1);
}
querylistgridobject.grid.setRow(_17a,row);
if((_17c.getAttribute("name")>"4daf_unique_")&(_17c.getAttribute("name")<"4daf_unique_a")){
querylistgridobject.grid.prv.mRows[_17a].isDDT=true;
querylistgridobject.grid.prv.mRows[_17a].DDTfieldid=_17c.getAttribute("name").substring(12);
querylistgridobject.grid.prv.mRows[_17a].prv.mElements[2].prv.mDOM.tooltip=_17e;
querylistgridobject.grid.prv.mRows[_17a].tableid=_17d;
}else{
querylistgridobject.grid.prv.mRows[_17a].tableid=_17d;
querylistgridobject.grid.prv.mRows[_17a].sortfield=_17c.getAttribute("sortfield");
querylistgridobject.grid.prv.mRows[_17a].sortorder=_17c.getAttribute("sortorder");
querylistgridobject.grid.prv.mRows[_17a].queryLines=_17f;
querylistgridobject.grid.prv.mRows[_17a].maxnb=_17c.getAttribute("maxnb");
querylistgridobject.grid.prv.mRows[_17a].prv.mElements[2].prv.mDOM.tooltip=_17e;
querylistgridobject.grid.prv.mRows[_17a].isDDT=false;
}
querylistgridobject.grid.prv.mRows[_17a].prv.mElements[2].prv.mDOM.onmouseover=function(_185){
mousePos=getMousePosition(_185);
showTooltip(this.tooltip,mousePos.x,mousePos.y);
};
querylistgridobject.grid.prv.mRows[_17a].prv.mElements[2].prv.mDOM.onmouseout=function(){
hideTooltip();
};
_17a+=1;
}
}
}
if(_174){
var _186=((_17a)*(querylistgridobject.prv.mRowHeight+5))-querylistgridobject.viewport.dom.offsetHeight+querylistgridobject.grid.header.offsetHeight;
querylistgridobject.viewport.vscrollbar.isStatic=true;
querylistgridobject.viewport.vscrollbar.areaHeight=(_17a)*(querylistgridobject.prv.mRowHeight+5);
querylistgridobject.viewport.setOverflow(_186,0);
querylistgridobject.viewport.refresh();
querylistgridobject.grid.dom.style.maxHeight="300px";
querylistgridobject.viewport.vscrollbar.dom.style.top=querylistgridobject.viewport.content.offsetTop+"px";
querylistgridobject.viewport.vscrollbar.dom.style.left=querylistgridobject.viewport.content.offsetLeft+querylistgridobject.viewport.content.offsetWidth+"px";
}
delete _172;
i=1;
}
function QueryEnableMaxNb(){
if($("adminQueryMaxNbRecordsValue").disabled){
$("adminQueryMaxNbRecordsValue").disabled=false;
}else{
$("adminQueryMaxNbRecordsValue").disabled=true;
}
}
function QueryToggle(_187){
switch(_187){
case "new":
$("adminquerytemplatesPopup").disabled=true;
$("adminquerytemplatefieldPopup").disabled=true;
$("AdminCreateQuery_Name").disabled=false;
$("adminqueryDynamicfieldPopup").disabled=true;
break;
case "template":
$("adminquerytemplatesPopup").disabled=false;
$("adminquerytemplatefieldPopup").disabled=false;
$("AdminCreateQuery_Name").disabled=true;
$("adminqueryDynamicfieldPopup").disabled=true;
break;
case "dynamic":
$("adminquerytemplatesPopup").disabled=true;
$("adminquerytemplatefieldPopup").disabled=true;
$("AdminCreateQuery_Name").disabled=true;
$("adminqueryDynamicfieldPopup").disabled=false;
break;
}
}
function onsettableposition(_188){
if(_188.readyState!=4){
return;
}
var _189=_188.responseXML.getElementsByTagName("AdminSetTablePosition").item(0);
var _18a=checkResponse(_188);
if(_189){
do_gettablepreferences();
}
delete _188;
}
function onsetfieldposition(_18b){
if(_18b.readyState!=4){
return;
}
var _18c=_18b.responseXML.getElementsByTagName("AdminSetFieldPosition").item(0);
var _18d=checkResponse(_18b);
debugAlert("onsetfieldposition");
if((!browser.ie)&&(_18c)){
do_getfieldpreferences();
}
delete _18b;
}
function CachePopups(){
cachedselectdiv=getTemplate("admindefaultdivpopup");
cachedselect=getTemplate("admindefaultpopup");
var _18e=STR["admin_view_titles"].slice();
var _18f=["0","1","2","3","4"];
cachedtableviewpopup=GetPopupTemplate("tableviewpopup_cached",_18f,_18e);
var _190=ar_DDW_Name;
var _191=ar_DDW_ID;
cachedDDWpopup=GetPopupTemplate("DDWpopup_cached",_191,_190);
_18e=STR["admin_titles_integer"];
_18f=STR["admin_values_integer"];
cachedtableviewpopup_integer=GetPopupTemplate("tableviewpopup_integer_cached",_18f,_18e,"100");
_18e=STR["admin_titles_longint"];
_18f=STR["admin_values_longint"];
cachedtableviewpopup_longint=GetPopupTemplate("tableviewpopup_longint_cached",_18f,_18e,"100");
_18e=STR["admin_titles_real"];
_18f=STR["admin_values_real"];
cachedtableviewpopup_real=GetPopupTemplate("tableviewpopup_real_cached",_18f,_18e,"100");
_18e=STR["admin_titles_date"];
_18f=STR["admin_values_date"];
cachedtableviewpopup_date=GetPopupTemplate("tableviewpopup_date_cached",_18f,_18e,"100");
_18e=STR["admin_titles_time"];
_18f=STR["admin_values_time"];
cachedtableviewpopup_time=GetPopupTemplate("tableviewpopup_time_cached",_18f,_18e,"100");
_18e=STR["admin_titles_alpha"];
_18f=STR["admin_values_alpha"];
cachedtableviewpopup_alpha=GetPopupTemplate("tableviewpopup_alpha_cached",_18f,_18e,"100");
_18e=STR["admin_titles_text"];
_18f=STR["admin_values_text"];
cachedtableviewpopup_text=GetPopupTemplate("tableviewpopup_text_cached",_18f,_18e,"100");
_18e=STR["admin_titles_boolean"];
_18f=STR["admin_values_boolean"];
cachedtableviewpopup_boolean=GetPopupTemplate("tableviewpopup_boolean_cached",_18f,_18e,"100");
_18e=STR["admin_titles_none"];
_18f=STR["admin_values_none"];
cachedtableviewpopup_none=GetPopupTemplate("tableviewpopup_none_cached",_18f,_18e,"100");
admin_break_titles=[STR["none"],"1","2","3","4","5","6","7","8"];
admin_break_values=["0","1","2","3","4","5","6","7","8"];
cachedfieldbreakpopup=GetPopupTemplate("fieldbreakpopup_cached",admin_break_values,admin_break_titles);
}
function adminupdategrouppopup(_192){
if(_192.readyState!=4){
return;
}
var _193=_192.responseXML.getElementsByTagName("GroupList").item(0);
var _194=checkResponse(_192);
var _195=_193.getElementsByTagName("Group");
var _196=new Array();
var _197=new Array();
_196[0]=STR["admin_allusers"];
_197[0]="0";
for(var i=0;i<_195.length;i++){
var _199=_195.item(i);
_196[i+1]=_199.getAttribute("Name");
_197[i+1]=_199.getAttribute("ID");
}
var node=GetPopupTemplate("grouppopup",_197,_196);
node.onchange=function(){
do_gettablepreferences();
do_getfieldpreferences();
return true;
};
$("adminGroupPopup").appendChild(node);
do_gettablepreferences();
tablelistinitialized=true;
delete _192;
}
function AdminToggleAll(_19b){
switch(_19b){
case "allowaccess":
var rows=admintablegridobject.grid.prv.mRows;
if(rows.length>0){
var _19d=0;
while(rows[_19d].tableid>100000){
_19d++;
}
if(rows[_19d].prv.mElements[1].prv.mDOM.childNodes[1].checked){
TOGGLESTATUS.allowaccess="true";
}else{
TOGGLESTATUS.allowaccess="false";
}
}
if(TOGGLESTATUS.allowaccess=="false"){
param3="True";
TOGGLESTATUS.allowaccess="true";
}else{
param3="False";
TOGGLESTATUS.allowaccess="false";
}
for(var i=0;i<rows.length;i++){
if(rows[i].tableid<=100000){
var cols=rows[i].prv.mElements;
if(param3=="True"){
cols[1].prv.mDOM.childNodes[1].checked=true;
}else{
cols[1].prv.mDOM.childNodes[1].checked=false;
}
var _1a0="False";
var _1a1="False";
var _1a2="False";
var _1a3="False";
if(cols[4].prv.mContent.selectedIndex=="1"){
_1a0="True";
}else{
if(cols[4].prv.mContent.selectedIndex=="2"){
_1a1="True";
}else{
if(cols[4].prv.mContent.selectedIndex=="3"){
_1a2="True";
}else{
if(cols[4].prv.mContent.selectedIndex=="4"){
_1a3="True";
}
}
}
}
do_settablepreferences(rows[i].tableid,cols[2].prv.mDOM.firstChild.firstChild.value,param3,_1a0,_1a1,_1a2,_1a3);
}
}
break;
case "allowaccessfield_o":
var rows=adminfieldgridobject.grid.prv.mRows;
if(rows.length>0){
var _19d=0;
while(rows[_19d].prv.mElements[1].prv.mDOM.childNodes[0].disabled==true){
_19d++;
}
if(rows[_19d].prv.mElements[1].prv.mDOM.childNodes[0].checked){
TOGGLESTATUS.displayinlist="true";
}else{
TOGGLESTATUS.displayinlist="false";
}
}
if(TOGGLESTATUS.displayinlist=="false"){
param3="True";
TOGGLESTATUS.displayinlist="true";
}else{
param3="False";
TOGGLESTATUS.displayinlist="false";
}
for(var i=0;i<rows.length;i++){
var cols=rows[i].prv.mElements;
if(cols[1].prv.mDOM.childNodes[0].disabled==false){
if(param3=="True"){
cols[1].prv.mDOM.childNodes[0].checked=true;
if(admintablegridobject.grid.prv.mRows[adminselectedrow].prv.mElements[4].prv.mDOM.firstChild.selectedIndex==2){
cols[5].prv.mDOM.firstChild.disabled=false;
}
}else{
cols[1].prv.mDOM.childNodes[0].checked=false;
cols[5].prv.mDOM.firstChild.disabled=true;
}
do_setfieldpreferences(adminselectedtable,rows[i].fieldid,cols[2].prv.mDOM.firstChild.firstChild.value,param3,cols[1].prv.mDOM.childNodes[1].checked,cols[1].prv.mDOM.childNodes[2].checked);
}
}
break;
case "allowaccessfield_i":
var rows=adminfieldgridobject.grid.prv.mRows;
if(rows.length>0){
var _19d=0;
while(rows[_19d].prv.mElements[1].prv.mDOM.childNodes[1].disabled==true){
_19d++;
}
if(rows[_19d].prv.mElements[1].prv.mDOM.childNodes[1].checked){
TOGGLESTATUS.displayindetail="true";
}else{
TOGGLESTATUS.displayindetail="false";
}
}
if(TOGGLESTATUS.displayindetail=="false"){
_1a0="True";
TOGGLESTATUS.displayindetail="true";
}else{
_1a0="False";
TOGGLESTATUS.displayindetail="false";
}
for(var i=0;i<rows.length;i++){
var cols=rows[i].prv.mElements;
if(cols[1].prv.mDOM.childNodes[1].disabled==false){
if(_1a0=="True"){
cols[1].prv.mDOM.childNodes[1].checked=true;
}else{
cols[1].prv.mDOM.childNodes[1].checked=false;
}
do_setfieldpreferences(adminselectedtable,rows[i].fieldid,cols[2].prv.mDOM.firstChild.firstChild.value,cols[1].prv.mDOM.childNodes[0].checked,_1a0,cols[1].prv.mDOM.childNodes[2].checked);
}
}
break;
case "allowaccessfield_s":
var rows=adminfieldgridobject.grid.prv.mRows;
if(rows.length>0){
var _19d=0;
while(rows[_19d].prv.mElements[1].prv.mDOM.childNodes[2].disabled==true){
_19d++;
}
if(rows[_19d].prv.mElements[1].prv.mDOM.childNodes[2].checked){
TOGGLESTATUS.displayinsearch="true";
}else{
TOGGLESTATUS.displayinsearch="false";
}
}
if(TOGGLESTATUS.displayinsearch=="false"){
_1a1="True";
TOGGLESTATUS.displayinsearch="true";
}else{
_1a1="False";
TOGGLESTATUS.displayinsearch="false";
}
for(var i=0;i<rows.length;i++){
var cols=rows[i].prv.mElements;
if(cols[1].prv.mDOM.childNodes[2].disabled==false){
if(_1a1=="True"){
cols[1].prv.mDOM.childNodes[2].checked=true;
}else{
cols[1].prv.mDOM.childNodes[2].checked=false;
}
do_setfieldpreferences(adminselectedtable,rows[i].fieldid,cols[2].prv.mDOM.firstChild.firstChild.value,cols[1].prv.mDOM.childNodes[0].checked,cols[1].prv.mDOM.childNodes[1].checked,_1a1);
}
}
break;
default:
}
}
function dummy(_1a4){
if(_1a4){
if(_1a4.readyState!=4){
return;
}
}
delete _1a4;
}
function setPrefs_taskbar(_1a5){
if(taskbar){
taskbar.position(_1a5.options[_1a5.selectedIndex].value);
}
var _1a6=connection.sessionId;
if(_1a6==""){
return;
}
var _1a7=getXMLHttpRequest();
if(_1a7){
var url=connection.address.adminsetgeneralprefs+"?sessionId="+_1a6+"&taskbar="+_1a5.options[_1a5.selectedIndex].value;
_1a7.onreadystatechange=function(){
dummy(_1a7);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_1a7.open("GET",url,true);
_1a7.send(null);
}
catch(e){
delete _1a7;
}
}
return true;
}
function setPrefs_style(_1a9){
setActiveStyleSheet(_1a9.options[_1a9.selectedIndex].text);
WindowManager.redraw();
var _1aa=connection.sessionId;
if(_1aa==""){
return;
}
var _1ab=getXMLHttpRequest();
if(_1ab){
var url=connection.address.adminsetgeneralprefs+"?sessionId="+_1aa+"&style="+_1a9.options[_1a9.selectedIndex].text;
_1ab.onreadystatechange=function(){
dummy(_1ab);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_1ab.open("GET",url,true);
_1ab.send(null);
}
catch(e){
delete _1ab;
}
}
return true;
}
function setPrefs_preload(_1ad){
var _1ae=connection.sessionId;
if(_1ae==""){
return;
}
var _1af=getXMLHttpRequest();
if(_1af){
var url=connection.address.adminsetgeneralprefs+"?sessionId="+_1ae+"&preloadmaxnb="+_1ad.options[_1ad.selectedIndex].text;
_1af.onreadystatechange=function(){
dummy(_1af);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_1af.open("GET",url,true);
_1af.send(null);
}
catch(e){
delete _1af;
}
}
return true;
}
function CheckAdminPreferences(){
var _1b1=connection.sessionId;
if(_1b1==""){
return;
}
var _1b2=getXMLHttpRequest();
if(_1b2){
var url=connection.address.admingetgeneralprefs+"?sessionId="+_1b1;
_1b2.onreadystatechange=function(){
onGetAdminPrefs(_1b2);
};
try{
debugAlert("<b>DAX:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_1b2.open("GET",url,true);
_1b2.send(null);
}
catch(e){
delete _1b2;
}
}
return true;
}
function onGetAdminPrefs(_1b4){
if(_1b4.readyState!=4){
return;
}
var _1b5=_1b4.responseXML.getElementsByTagName("Preferences").item(0);
var _1b6=checkResponse(_1b4);
if(!isDefined(_1b5)){
return false;
}
var _1b7=_1b5.getElementsByTagName("*");
for(var _1b8=0;_1b8<_1b7.length;_1b8++){
if(_1b7.item(_1b8).nodeName.indexOf("dax_colwidth")!=-1){
var _1b9=getTable(_1b7.item(_1b8).nodeName.substr(13));
_1b9.columnWidths=_1b7.item(_1b8).firstChild.nodeValue;
}
}
var _1ba=_1b5.getElementsByTagName("taskbar");
taskbarpopup=$("admintaskbarpopup");
if(_1ba.length>0){
for(var j=0;j<taskbarpopup.length;j++){
if(taskbarpopup[j].value==_1ba.item(0).lastChild.nodeValue){
taskbarpopup.selectedIndex=j;
}
}
}
var _1bc=_1b5.getElementsByTagName("style");
var _1bd=[];
for(i=0;(a=document.getElementsByTagName("link")[i]);i++){
if(a.getAttribute("title")){
_1bd[i]=a.getAttribute("title");
}
}
var node=GetPopupTemplate("adminstylepopup",_1bd,_1bd);
node.onchange=function(){
setPrefs_style(this);
return true;
};
node.style.fontSize="";
$("adminstylepopupdiv").innerHTML="";
$("adminstylepopupdiv").appendChild(node);
stylepopup=$("adminstylepopup");
if(_1bc.length>0){
for(var j=0;j<stylepopup.length;j++){
if(stylepopup[j].value==_1bc.item(0).lastChild.nodeValue){
stylepopup.selectedIndex=j;
}
}
}
if(taskbar){
if(taskbar.dom.style.display!="none"){
taskbar.refresh();
}
}
if(aSidebar){
aSidebar.redraw(true);
}
}
function CreateDDW(){
var _1bf=connection.sessionId;
if(_1bf==""){
return;
}
var _1c0=getXMLHttpRequest();
if(_1c0){
var _1c1=$("AdminCreateDDW_Title").value;
var _1c2=$("AdminCreateDDW_Method").value;
var _1c3=$("AdminCreateDDW_Type").selectedIndex;
var type=$("AdminCreateDDW_Type").options[_1c3].value;
var _1c3=$("AdminCreateDDW_Associatedto").selectedIndex;
var _1c5=$("AdminCreateDDW_Associatedto").options[_1c3].value;
var url=connection.address.admincreateDDWinfo+"?sessionId="+_1bf+"&Title="+dax_bridge.encode(_1c1)+"&Method="+dax_bridge.encode(_1c2)+"&Type="+type+"&AssociatedTo="+dax_bridge.encode(_1c5);
_1c0.onreadystatechange=function(){
onCreateDDW(_1c0);
};
try{
debugAlert("<b>DAX:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_1c0.open("GET",url,true);
_1c0.send(null);
}
catch(e){
delete _1c0;
}
}
}
function onCreateDDW(_1c7){
if(_1c7.readyState!=4){
return;
}
var _1c8=_1c7.responseXML.getElementsByTagName("CreateDDWInfo").item(0);
var _1c9=checkResponse(_1c7);
if(_1c8){
$("CreateDDWButton").style.display="block";
$("CancelDDWButton").style.display="none";
$("CreateDDWDetail").style.display="none";
do_getDDWInfo("All",true);
tablelistinitialized=false;
}
delete _1c7;
}
function DeleteDDW(_1ca){
var _1cb=connection.sessionId;
if(_1cb==""){
return;
}
var _1cc=getXMLHttpRequest();
if(_1cc){
var url=connection.address.admindeleteDDWinfo+"?sessionId="+_1cb+"&ddwid="+_1ca;
_1cc.onreadystatechange=function(){
onDeleteDDW(_1cc);
};
try{
debugAlert("<b>DAX:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_1cc.open("GET",url,true);
_1cc.send(null);
}
catch(e){
delete _1cc;
}
}
}
function onDeleteDDW(_1ce){
if(_1ce.readyState!=4){
return;
}
var _1cf=_1ce.responseXML.getElementsByTagName("AdminDeleteDDW").item(0);
var _1d0=checkResponse(_1ce);
if(_1cf){
do_getDDWInfo("All",true);
tablelistinitialized=false;
}
delete _1ce;
}
function onQueryPositionClick(_1d1){
QueryPositionClick=true;
_1d1.QueryPosition=_1d1.value;
}
function QueryPositionBlur(_1d2,_1d3,_1d4){
var _1d5=connection.sessionId;
var pos=_1d4.value;
if(pos==""){
pos=_1d4.QueryPosition;
}
if(_1d4.QueryPosition==pos){
return;
}
if(_1d5==""){
return;
}
var _1d7=getXMLHttpRequest();
if(_1d7){
var url=connection.address.adminSetQueryPosition+"?sessionId="+_1d5+"&queryname="+dax_bridge.encode(_1d2)+"&tableid="+_1d3+"&position="+pos;
_1d7.onreadystatechange=function(){
onQueryPositionBlur(_1d7);
};
try{
debugAlert("<b>Admin:</b>"+"<a href=\""+url+"\" target=\"_blank\">"+url+"</a>");
_1d7.open("GET",url,true);
_1d7.send(null);
}
catch(e){
delete _1d7;
}
}
QueryShowDetail=true;
return true;
}
function onQueryPositionBlur(_1d9){
if(_1d9.readyState!=4){
return;
}
var _1da=_1d9.responseXML.getElementsByTagName("AdminSetQueryPosition").item(0);
var _1db=checkResponse(_1d9);
do_getQueryList("All",true,$("AdminQuery_FilterPopup").options[$("AdminQuery_FilterPopup").selectedIndex].value);
delete _1d9;
}
function DeleteQuery(_1dc){
var _1dd=connection.sessionId;
var _1de=0;
querylistgridobject.grid.prv.mRows[_1dc].setFocus(true);
for(var i=0;i<querylistgridobject.grid.prv.mRows.length;i++){
if(queryli