function
msdbIeHideDialog(id)
{
 ;
 jstr = id + ".style.visibility = 'hidden';" ;
 jstr = 'document.getElementById("' + id + '").style.visibility =' + "'hidden';";
 eval(jstr);
 id.isShown = 0;
}
function
msdbShowDialog(id)
{
 msdbShowDialogAt(id, true);
}
function
msdbShowDialogAt(id, isTopLeft)
{
 ;
 jstr = 'dw = document.getElementById("' + id + '").offsetWidth ;' ;
 eval(jstr);
 jstr = 'dh = document.getElementById("' + id + '").offsetHeight ;' ;
 eval(jstr);
 sx = msdbScrollLeft();
 sy = msdbScrollTop();
 sw = document.body.clientWidth;
 sh = document.body.clientHeight;
 ax = sx + msdbTop.mouseX;
 ay = sy + msdbTop.mouseY;
 pos = new msdbPositionDialog(ax, ay, sx, sy, sw, sh, dw, dh, isTopLeft);
 jstr = 'document.getElementById("' + id + '").style.left = ' + pos.x + ";" ;
 eval(jstr);
 jstr = 'document.getElementById("' + id + '").style.top = ' + pos.y + ";" ;
 eval(jstr);
 jstr = 'document.getElementById("' + id + '").style.visibility = ' + "'visible';" ;
 eval(jstr);
 msdbSetDialogVisibility(id, 1);
}
function
msdbDiaVis(id, v)
{
 ;
 this.id = id;
 this.v = v;
 return(this);
}
function
msdbSetDialogVisibility(id, v)
{
 ;
 if ( msdbTop.dialogVis == msdbTop.undef )
  msdbTop.dialogVis = new Array();
 va = msdbTop.dialogVis;
 for(i=0;i<va.length;i++)
  if( va[i].id == id ) {
   va[i].v = v ;
   return;
  }
 va[i] = new msdbDiaVis(id, v);
}
function
msdbDialogVisibility(id)
{
 ;
 if ( msdbTop.dialogVis == msdbTop.undef )
  msdbTop.dialogVis = new Array();
 v = msdbTop.dialogVis;
 for(i=0;i<v.length;i++)
  if( v[i].id == id )
   return(v[i].v) ;
 return(0);
}
function
msdbHideDialog(id)
{
 ;
 msdbIeHideDialog(id);
 msdbSetDialogVisibility(id, 0);
}
function
msdbPositionDialog(ax, ay, sx, sy, sw, sh, dw, dh, isTopLeft)
{
 ;
 this.x = this.y = 0;
 sRight = sx + sw;
 sBottom = sy + sh ;
 mx = ax - sx;
 my = ay - sy;
 nativeX = ax;
 nativeY = ay;
 if ( isTopLeft ) {
  this.x = nativeX;
  if ( (this.x + dw) > sx + sw )
   this.x = sx + sw - dw;
  if ( this.x < sx )
   this.x = sx;
  this.y = nativeY;
  if ( (this.y + dh) > sy + sh )
   this.y = sy + sh - dh;
  if ( this.y < sy )
   this.y = sy;
 } else {
  this.x = nativeX - dw -4;
  if ( (this.x + dw) > sx + sw )
   this.x = sx + sw - dw;
  if ( this.x < sx )
   this.x = sx;
  this.y = nativeY - dh - 4;
  if ( (this.y + dh) > sy + sh )
   this.y = sy + sh - dh;
  if ( this.y < sy )
   this.y = sy;
 }
 return(this);
}
function
msdbPlaceDialog(idname, l, t)
{
 ;
 ;
 ;
 document.getElementById(idname).style.left = l + "px" ;
 ;
 document.getElementById(idname).style.top = t + "px" ;
 ;
}
function
msdbScrollLeft()
{
 var left;
 left = document.documentElement.scrollLeft ?
    document.documentElement.scrollLeft :
    document.body.scrollLeft;
 return(left);
}
function
msdbScrollTop()
{
 var top;
 top = document.documentElement.scrollTop ?
    document.documentElement.scrollTop :
    document.body.scrollTop;
 return(top);
}
