home *** CD-ROM | disk | FTP | other *** search
/ com!online 2002 June / comonline0602.iso / software / cogitum / CoTracker.exe / lib.___ < prev    next >
Encoding:
Text File  |  2000-10-24  |  860 b   |  22 lines

  1. function fnResize(document, window)
  2. {
  3.     var oCancel = document.all.Cancel;
  4.     var trCancel = oCancel.createTextRange();
  5.     var rcBounding = trCancel.getBoundingClientRect();
  6.     var dHeight = parseInt(window.dialogHeight.slice(0, window.dialogHeight.length - 2));
  7.     var dWidth  = parseInt(window.dialogWidth.slice(0, window.dialogWidth.length - 2));
  8.     var dbHeight = document.body.clientHeight + document.body.clientTop;
  9.     var dbWidth  = document.body.clientWidth + document.body.clientLeft;
  10.  
  11.     if (rcBounding.bottom + 5 > dbHeight) {
  12.         window.dialogHeight = (rcBounding.bottom +  
  13.             (rcBounding.bottom - rcBounding.top)            
  14.             + dHeight - dbHeight - 5).toString() + "px";            
  15.     }
  16.  
  17.     if (rcBounding.right + 5 > dbWidth) {
  18.         window.dialogWidth = (rcBounding.right +
  19.             (rcBounding.bottom - rcBounding.top)
  20.             + dWidth - dbWidth).toString() + "px";
  21.     }
  22. }