


// open a new dialog window and make it center on screen.
// default width/height: full screen if not given or 0 is given.
// default feature: resizable=yes,menubar=no,scrollbars=yes
function _openWin_() {
   if (!this.name) 
       this.name = "_win_" + (new Date()).getTime()//.toString() fixed by jgzhang by 2005-11-02 16:48
       //this.name = "_win_" + (new Date()).getSeconds().toString()

   var s = ""
   if (!this.width)  
       this.width = window.screen.availWidth - 20
   if (!this.height) 
       this.height = window.screen.availHeight - 40
   if (this.center.toLowerCase() == "yes") {
       if (this.width != window.screen.availWidth -20) 
           this.left = (window.screen.availWidth - this.width) / 2
       if (this.height != window.screen.availHeight -40) 
           this.top =  (window.screen.availHeight - this.height) / 2
   }
   if ( this.width == window.screen.availWidth - 20 )
      this.left = 0 
   if ( this.height == window.screen.availHeight - 40)
      this.top = 0

   s += "width=" + this.width + ",height=" + this.height + ","
   s += "screenX=" + this.left + ",screenY=" + this.top + ","
   s += "left=" + this.left + ",top=" + this.top + ',' 
   s += "menubar=" + this.menubar + ","
   s += "resizable=" + this.resizable + ","
   s += "scrollbars=" + this.scrollbars + ","
   s += "titlebar=" + this.titlebar + ","
   s += "location=" + this.location + ","
   s += "directories=" + this.directories + ","
   s += "alwaysraised=" + this.alwaysraised + ","
   s += "fullscreen=" + this.fullscreen 
   this.WINDOW = window.open(this.url, this.name, s)
}

function _focus_() {
   if (this.WINDOW && !this.WINDOW.closed)
       this.WINDOW.focus()
}

function _close_() {
   if (this.WINDOW && !this.WINDOW.closed)
       this.WINDOW.close()
}

function _window_() {
   this.url        = ""
   this.name       = ""
   this.width      = ""
   this.height     = ""
   this.left       = 0
   this.top        = 0
   this.center     = "yes"
   this.resizable  = "yes"
   this.scrollbars = "yes"
   this.menubar    = "no"
   this.fullscreen = "no"
   this.titlebar  = "yes"
   this.location   = "no"
   this.directories = "no"
   this.alwaysraised="yes"
   this.WINDOW = ""

   this.focus = _focus_
   this.close = _close_
   this.open = _openWin_
}


