// Clase FloatingWindow. var FLOATINGWINDOW_TOP = 0; var FloatingWindow_Instances = []; var modalLayer; function FloatingWindow(id) { // Propiedades. this.id = id; this.modal = false; this.onClose = ""; // Funciones Públicas. this.show = FloatingWindow_Show; this.hide = FloatingWindow_Hide; this.move = FloatingWindow_Move; this.resize = FloatingWindow_Resize; this.bringToFront = FloatingWindow_BringToFront; FloatingWindow_Instances[id] = this; } function FloatingWindow_Show(modal) { if(modal) { Common.deactivatePage(); this.modal = true; } var fw = document.getElementById(this.id); var pos = Common.getCenterPosition(fw, true); this.move(pos.x, pos.y - FLOATINGWINDOW_TOP); this.bringToFront(); } function FloatingWindow_Resize(width, height) { var win = document.getElementById(this.id); Common.resizeCool(win, width, height); } function FloatingWindow_Hide() { var win = document.getElementById(this.id); win.style.display = "none"; if(this.modal) Common.activatePage(); eval(this.onClose); } function FloatingWindow_BringToFront() { var win = document.getElementById(this.id); Common.bringToFront(win, true); win.style.display = ""; } function FloatingWindow_Move(x, y) { var win = document.getElementById(this.id); Common.setPosition(win, x, y); } // ------------------------------------------------------------------------------------------------------ // Funciones externas. // ------------------------------------------------------------------------------------------------------ function FloatingWindow_DragStart(id, ev) { var fw = document.getElementById(id); if(fw) Drag.start(fw, ev); } function FloatingWindow_Get(id) { return FloatingWindow_Instances[id]; } function OpenFloatingWindow(id, modal) { var fw = FloatingWindow_Get(id); if(fw) fw.show(modal); } function HideFloatingWindow(id) { var fw = FloatingWindow_Get(id); if(fw) fw.hide(); }