/** * QLIB 1.0 Window Abstraction * Copyright (C) 2002 2003, Quazzle.com Serge Dolgov * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * http://qlib.quazzle.com */ function QWndCtrl_center_ie4() { var b = this.document.body; this.moveTo(b.scrollLeft + Math.max(0, Math.floor((b.clientWidth - this.width) / 2)), b.scrollTop + 100); } function QWndCtrl_center_moz() { this.moveTo(self.pageXOffset + Math.max(0, Math.floor((self.innerWidth - this.width) / 2)), self.pageYOffset + 100); } function QWndCtrl_setEffects_ie4(fx) { this.effects = fx; with (this.wnd) { filters[0].enabled = (fx & 256) != 0; filters[1].enabled = (fx & 512) != 0; filters[2].enabled = (fx & 1024) != 0; filters[4].enabled = (fx & 2048) != 0; } } function QWndCtrl_setEffects_moz(fx) { this.effects = fx; } function QWndCtrl_setOpacity_ie4(op) { this.opacity = Math.max(0, Math.min(100, Math.floor(op - 0))); this.wnd.filters[3].opacity = this.opacity; this.wnd.filters[3].enabled = (this.opacity < 100); } function QWndCtrl_setOpacity_moz(op) { this.opacity = Math.max(0, Math.min(100, Math.floor(op - 0))); this.wnd.style.MozOpacity = this.opacity + "%"; } function QWndCtrl_setSize_css(w, h) { this.wnd.style.width = (this.width = Math.floor(w - 0)) + "px"; this.wnd.style.height = typeof(h) == "number" ? (this.height = Math.floor(h)) + "px" : "auto"; } function QWndCtrl_setSize_ns4(w, h) { this.wnd.clip.width = this.width = Math.floor(w - 0); if (typeof(h) == "number") { this.wnd.clip.height = this.height = Math.floor(h); } } function QWndCtrl_focus() { this.setZIndex(QWndCtrl.TOPZINDEX++); } function QWndCtrl_setZIndex_css(z) { this.wnd.style.zIndex = this.zindex = z || 0; } function QWndCtrl_setZIndex_ns4(z) { this.wnd.zIndex = this.zindex = z || 0; } function QWndCtrl_moveTo_css(x, y) { this.wnd.style.left = (this.x = Math.floor(x - 0)) + "px"; this.wnd.style.top = (this.y = Math.floor(y - 0)) + "px"; } function QWndCtrl_moveTo_ns4(x, y) { this.wnd.moveTo(this.x = Math.floor(x - 0), this.y = Math.floor(y - 0)); } function QWndCtrl_fxhandler() { this.fxhandler = QControl.nop; this.onShow(this.visible, this.tag); } function QWndCtrl_show_ie4(show) { if (this.visible != show) { var fx = false; switch (show ? this.effects & 15 : (this.effects & 240) >>> 4) { case 1: fx = this.wnd.filters[5]; break; case 2: (fx = this.wnd.filters[6]).transition = show ? 1 : 0; break; case 3: (fx = this.wnd.filters[6]).transition = show ? 3 : 2; break; case 4: (fx = this.wnd.filters[6]).transition = show ? 5 : 4; break; case 5: (fx = this.wnd.filters[6]).transition = show ? 14 : 13; break; case 6: (fx = this.wnd.filters[6]).transition = show ? 16 : 15; break; case 7: (fx = this.wnd.filters[6]).transition = 12; break; case 8: (fx = this.wnd.filters[6]).transition = 8; break; case 9: (fx = this.wnd.filters[6]).transition = 9; } if (fx) { fx.apply(); this.wnd.style.visibility = (this.visible = show) ? "visible" : "hidden"; this.fxhandler = QWndCtrl_fxhandler; fx.play(0.3); } else { this.wnd.style.visibility = (this.visible = show) ? "visible" : "hidden"; this.onShow(show, this.tag); } } } function QWndCtrl_fade_moz(op, step) { this._wndt = false; if (step) { op += step; if ((op > 0) && (op < this.opacity)) { this.wnd.style.MozOpacity = op + "%"; this._wndt = setTimeout(this.name + ".fade(" + op + "," + step + ")", 50); } else { if (op <= 0) { this.wnd.style.visibility = "hidden"; this.visible = false; } this.wnd.style.MozOpacity = this.opacity + "%"; this.onShow(this.visible, this.tag); } } } function QWndCtrl_show_moz(show) { if (this.visible != show) { if (this._wndt) { clearTimeout(this._wndt); this._wndt = false; } var step = show ? ((this.effects & 15) == 1) && Math.floor(this.opacity / 5) : ((this.effects & 240) == 16) && -Math.floor(this.opacity / 5); if (step) { if (this.visible) { this.fade(this.opacity - 0, step); } else { this.wnd.style.MozOpacity = "0%"; this.wnd.style.visibility = "visible"; this.visible = true; this.fade(0, step); } } else { this.wnd.style.visibility = (this.visible = show) ? "visible" : "hidden"; this.onShow(show, this.tag); } } } function QWndCtrl_show_css(show) { if (this.visible != show) { this.wnd.style.visibility = (this.visible = show) ? "visible" : "hidden"; this.onShow(show, this.tag); } } function QWndCtrl_show_ns4(show) { if (this.visible != show) { this.wnd.visibility = (this.visible = show) ? "show" : "hidden"; this.onShow(show, this.tag); } } function QWndCtrl_create_dom2() { with (this) { this.fxhandler = QControl.nop; var ie4 = document.body && document.body.filters; var moz = document.body && document.body.style && typeof(document.body.style.MozOpacity) == "string"; document.write('