(function () { var switchedArea = null; Rakka.switchScreen = function () { if (switchedArea == null) { switchedArea = $.DIV({}); $("div.sideBar div.outline").hide(); $("div.body") .children() .hide() .end() .append(switchedArea); } else { $(switchedArea).empty(); } return $(switchedArea); }; Rakka.restoreScreen = function () { if (switchedArea == null) { throw new Error("Rakka.restoreScreen(): not switched"); } $("div.sideBar div.outline").show(); $(switchedArea).remove(); switchedArea = null; $("div.body").children().show(); return null; }; })();