<!--
//  This library is free software; you can redistribute it and/or
//  modify it under the terms of the GNU Lesser General Public
//  License as published by the Free Software Foundation; either
//  version 2.1 of the License, or (at your option) any later version.
//  This library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//  Lesser General Public License for more details.
//  Copyright (C) 2001-2003  Schlund + Partner AG
//  You should have received a copy of the GNU Lesser General Public
//  License along with this library; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//  Editiert von Simon Knapp, hpserver.de - kostenlose Homepage Tools

var __js_allLayers  = new Array();

function nw(id) {
    if (__js_allLayers[id] != null) {
        return __js_allLayers[id];
    } else {
        var temp = new __js_Layer(id);
        __js_allLayers[id] = temp;
        return temp;
    }
}

function mv() {
    for (var i = 0; i < mv.arguments.length; i++) {
        var layer = nw(mv.arguments[i]);
        if (layer.visible) {
            layer.hide();
            layer.hideChildren();
        } else {
            layer.show();
        }
    }
}

function sw() {
    for (var i = 0; i < sw.arguments.length; i++) {
        var layer = nw(sw.arguments[i]);
        if (!layer.visible) {
            layer.show();
        }
    }
}

function hd() {
    for (var i = 0; i < hd.arguments.length; i++) {
        var layer = nw(hd.arguments[i]);
        if (layer.visible) {
            layer.hide();
            layer.hideChildren();
        }
    }
}

function __js_Layer(layer_id) {
    this.initialized = false;
    this.parents     = new Array();
    this.children    = new Array();
    this.switch_on   = new Array();
    this.switch_off  = new Array();
    this.visible     = true;
    this.frame       = null;
    this.store       = null;
    this.id          = layer_id;
    this.element     = null;

    this.init = function (visible, frame, store) {
        this.store   = store;
        this.frame   = frame;
        this.element = frame.document.getElementById(this.getId());

        var fromcookie =  "nocookie";
        if (navigator.cookieEnabled == true && store != "false") {
            var cookie = document.cookie;
            if (cookie.indexOf("LR_" + this.getId() + "=true") >= 0) {
                fromcookie =  "true";
            } else if (cookie.indexOf("LR_" + this.getId() + "=false") >= 0) {
                fromcookie = "false";
            }
        }
        if (fromcookie == "true") {
            this.show();
        } else if (fromcookie == "false") {
            this.hide();
        } else {
            if (visible == 'false') {
                this.hide();
            } else {
                this.show();
            }
        }
        this.initialized = true;
    };

    this.getId       = function () { return this.id; };
    this.getFrame    = function () { return this.frame; };
    this.getChildren = function () { return this.children; };
    this.getParents  = function () { return this.parents; };

    this.addChild    = function (child) { this.children[this.children.length] = child; };
    this.addParent   = function (parent) { this.parents[this.parents.length] = parent; };

    this.show     = function () { this.__change(true, '', 'none'); };
    this.hide     = function () { this.__change(false, 'none', ''); };
    this.__change = function (cookievis, elemvis, switchoffvis) {
        if (navigator.cookieEnabled == true && this.store != "false") {
            document.cookie = "LR_" + this.getId() + "=" + cookievis + "; path=/";
        }
        this.element.style.display = elemvis;
        this.visible = cookievis;
        if (this.switch_off != null && this.switch_off.length > 0) {
            for (var i = 0; i < this.switch_off.length; i++) {
                var temp = this.switch_off[i];
                temp.style.display = switchoffvis;
            }
        }
        if (this.switch_on != null && this.switch_on.length > 0) {
            for (var i = 0; i < this.switch_on.length; i++) {
                var temp = this.switch_on[i];
                temp.style.display = elemvis;
            }
        }
    };

    this.hideChildren = function () {
        if (this.children != null && this.children.length > 0) {
            for (var i = 0; i < this.children.length; i++) {
                var temp = this.children[i];
                temp.hide();
                temp.hideChildren();
            }
        }
    };

    this.addSwitchOn  = function (switchon) {
        this.switch_on[this.switch_on.length] = switchon;
        if (this.initialized && !this.visible) {
            switchon.style.display = 'none';
        }
    };

    this.addSwitchOff = function (switchoff) {
        this.switch_off[this.switch_off.length] = switchoff;
        if (this.initialized && this.visible) {
            switchoff.style.display = 'none';
        }
    };

    this.moveRight  = function (val) { this.element.style.right = val; };
    this.moveBottom = function (val) { this.element.style.bottom = val; };
    this.moveLeft   = function (val) { this.element.style.left = val; };
    this.moveTop    = function (val) { this.element.style.top = val; };

    this.getRight   = function () { return this.element.style.right; };
    this.getBottom  = function () { return this.element.style.bottom; };
    this.getLeft    = function () { return this.element.style.left; };
    this.getTop     = function () { return this.element.style.top; };

}
-->