User:Gerbrant/gui/window.js

new function()

{

var docLoaded = false;

document.write("\

");

hookEvent("load", function()

{

docLoaded = true;

});

loadModule("Gerbrant.gui.taskbar", function(tb)

{

module("Gerbrant.gui.window", function(t)

{

var s;

var divWindow = document.createElement("DIV");

var divTitle = document.createElement("DIV");

var divContent = document.createElement("DIV");

var visible = true;

divTitle.className = "gerbrant-titlebar";

divContent.className = "gerbrant-windowcontent";

divWindow.className = "gerbrant-window";

divWindow.appendChild(divTitle);

divWindow.appendChild(divContent);

this.getCaption = function(){return divTitle.innerHTML;};

this.setCaption = function(t){divTitle.innerHTML = t;};

this.getVisible = function(){return visible;};

this.setVisible = function(b){divWindow.style.display =

((visible = b) ? "" : "none");};

this.getContent = function(){return divContent;};

this.getContentHTML = function(){return divContent.innerHTML;};

this.setContentHTML = function(t){divContent.innerHTML = t;};

this.setCaption(t);

function show()

{

document.getElementById("column-one").appendChild(divWindow);

}

if(docLoaded) show();

else hookEvent("load", show);

tb.addWindow(this);

});

});

}