/**
 * Filename    : index.js
 * Author      : Robert Cerny
 * Created     : 2007-02-09
 * Last Change : 2007-03-31
 */

CERNY.require("CO.cernyjs", "CO.navigation");

CERNY.namespace("cernyjs", CO);
CERNY.namespace("cernyjs.demos", CO);

function init() {
    CO.navigation.markLinksAsSelected();

    var consoleE = document.getElementById("console");
    if (consoleE) {
        consoleE.onclick = function() {
            if (this.big == true) {
                this.big = false;
                this.oldParent.appendChild(this.parentNode.parentNode);
                this.title = "Click to magnify!";
            } else {
                this.big = true;
                this.oldParent = this.parentNode.parentNode.parentNode;
                var newParent = document.getElementById("content").getElementsByTagName("div").item(0);
                var newSibling = document.getElementById("output-headline");
                newParent.insertBefore(this.parentNode.parentNode, newSibling);
                this.title = "Click to shrink!";
            }
        };
    }
};

