X_origin = 230;
Y_origin = 0;

meinMenue.Registry = []
meinMenue.aniLen = 250
meinMenue.hideDelay = 150
meinMenue.minCPUResolution = 10


function meinMenue(id, dir, left, top, width, height)
{
        this.ie  = document.all ? 1 : 0
        this.ns4 = document.layers ? 1 : 0
        this.dom = document.getElementById ? 1 : 0

        if (this.ie || this.ns4 || this.dom) {
                this.id                  = id
                this.dir                 = dir
                this.orientation         = dir == "left" || dir == "right" ? "h" : "v"
                this.dirType             = dir == "right" || dir == "down" ? "-" : "+"
                this.dim                 = this.orientation == "h" ? width : height
                this.hideTimer           = false
                this.aniTimer            = false
                this.open                = false
                this.over                = false
                this.startTime           = 0

                this.gRef = "meinMenue_"+id
                eval(this.gRef+"=this")
                meinMenue.Registry[id] = this

                var d = document
                d.write('<style type="text/css">')
                d.write('#' + this.id + 'Container { visibility:hidden; ')
                d.write('left:' + left + 'px; ')
                d.write('top:' + top + 'px; ')
                d.write('overflow:hidden; }')
                d.write('#' + this.id + 'Container, #' + this.id + 'Content { position:absolute; ')
                d.write('width:' + width + 'px; ')
                d.write('z-index: 10; ')
                d.write('height:' + height + 'px; ')
                d.write('clip:rect(0 ' + width + ' ' + height + ' 0); ')
                d.write('}')
                d.write('</style>')

                this.load()
        }
}

meinMenue.prototype.load = function() {
        var d = document
        var lyrId1 = this.id + "Container"
        var lyrId2 = this.id + "Content"
        var obj1 = this.dom ? d.getElementById(lyrId1) : this.ie ? d.all[lyrId1] : d.layers[lyrId1]
        if (obj1) var obj2 = this.ns4 ? obj1.layers[lyrId2] : this.ie ? d.all[lyrId2] : d.getElementById(lyrId2)
        var temp

        if (!obj1 || !obj2) window.setTimeout(this.gRef + ".load()", 100)
        else {
                this.container        = obj1
                this.Menue                = obj2
                this.style                = this.ns4 ? this.Menue : this.Menue.style
                this.homePos        = eval("0" + this.dirType + this.dim)
                this.outPos                = 0
                this.accelConst        = (this.outPos - this.homePos) / meinMenue.aniLen / meinMenue.aniLen

                if (this.ns4) this.Menue.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);
                this.Menue.onmouseover = new Function("meinMenue.showMenue('" + this.id + "')")
                this.Menue.onmouseout = new Function("meinMenue.hideMenue('" + this.id + "')")

                this.endSlide()
        }
}

meinMenue.showMenue = function(id)
{
        var reg = meinMenue.Registry
        var obj = meinMenue.Registry[id]

        if (obj.container) {
                obj.over = true
                if (obj.hideTimer) { reg[id].hideTimer = window.clearTimeout(reg[id].hideTimer) }
                if (!obj.open && !obj.aniTimer) reg[id].startSlide(true)
        }
}

meinMenue.hideMenue = function(id)
{
        var obj = meinMenue.Registry[id]
        if (obj.container) {
                if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
                obj.hideTimer = window.setTimeout("meinMenue.hide('" + id + "')", meinMenue.hideDelay);
        }
}

meinMenue.hide = function(id)
{
        var obj = meinMenue.Registry[id]
        obj.over = false
        if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
        obj.hideTimer = 0
        if (obj.open && !obj.aniTimer) obj.startSlide(false)
}

meinMenue.prototype.startSlide = function(open) {
        this[open ? "onactivate" : "ondeactivate"]()
        this.open = open
        if (open) this.setVisibility(true)
        this.startTime = (new Date()).getTime()
        this.aniTimer = window.setInterval(this.gRef + ".slide()", meinMenue.minCPUResolution)
}

meinMenue.prototype.slide = function() {
        var elapsed = (new Date()).getTime() - this.startTime
        if (elapsed > meinMenue.aniLen) this.endSlide()
        else {
                var d = Math.round(Math.pow(meinMenue.aniLen-elapsed, 2) * this.accelConst)
                if (this.open && this.dirType == "-")                d = -d
                else if (this.open && this.dirType == "+")        d = -d
                else if (!this.open && this.dirType == "-")        d = -this.dim + d
                else                                                                                d = this.dim + d
                this.moveTo(d)
        }
}

meinMenue.prototype.endSlide = function() {
        this.aniTimer = window.clearTimeout(this.aniTimer)
        this.moveTo(this.open ? this.outPos : this.homePos)
        if (!this.open) this.setVisibility(false)
        if ((this.open && !this.over) || (!this.open && this.over)) {
                this.startSlide(this.over)
        }
}

meinMenue.prototype.setVisibility = function(bShow) {
        var s = this.ns4 ? this.container : this.container.style
        s.visibility = bShow ? "visible" : "hidden"
}
meinMenue.prototype.moveTo = function(p) {
        this.style[this.orientation == "h" ? "left" : "top"] = this.ns4 ? p : p + "px"
}
meinMenue.prototype.getPos = function(c) {
        return parseInt(this.style[c])
}

meinMenue.prototype.onactivate                = function() { }
meinMenue.prototype.ondeactivate        = function() { }

function MenueSetup() {
        var img, sh, sn, sd
        for (var i = 0; (img = document.images[i]); i++) {
                if (img.getAttribute) {

                        sn = img.getAttribute("src");
                        sh = img.getAttribute("hsrc");
                        sd = img.getAttribute("dsrc");

                        if (sn != "" && sn != null) {
                                img.n = new Image();
                                img.n.src = img.src;

                                if (sh != "" && sh != null) {
                                        img.h = new Image();
                                        img.h.src = sh;
                                        img.onmouseover = einschalten
                                        img.onmouseout  = ausschalten
                                }

                                if (sd != "" && sd != null) {
                                        img.d = new Image();
                                        img.d.src = sd;
                                        img.onmousedown = runter
                                }
                        }
                }
        }
}

function einschalten() {
        this.src = this.h.src;
}

function ausschalten() {
        this.src  = this.n.src;
}

function runter() {
        this.src  = this.d.src;
        this.temp = typeof(document.onmouseup) != 'undefined' && typeof(document.onmouseup) != 'unknown' ? document.onmouseup : "";
        rauf.img = this;
        document.onmouseup = rauf;
}

function rauf() {
        var ths = rauf.img;
        ths.src = ths.n.src;
        if (ths.temp) document.onmouseup = ths.temp;
}


//Menue1
new meinMenue("Menue1", "down", X_origin, Y_origin, 230, 510)
new meinMenue("Menue1a", "right", X_origin+ 230, Y_origin +21, 230, 510)
new meinMenue("Menue1b", "right", X_origin+ 230, Y_origin +79, 230, 68)
new meinMenue("Menue1c", "right", X_origin+ 230, Y_origin +123, 230, 112)
new meinMenue("Menue1d", "right", X_origin+ 230, Y_origin +145, 230, 46)
new meinMenue("Menue1e", "right", X_origin+ 230, Y_origin +189, 230, 68)
new meinMenue("Menue1f", "right", X_origin+ 230, Y_origin +211, 230, 104)
new meinMenue("Menue1g", "right", X_origin+ 230, Y_origin +233, 230, 90)
new meinMenue("Menue1h", "right", X_origin+ 230, Y_origin +277, 230, 90)
new meinMenue("Menue1i", "right", X_origin+ 230, Y_origin +299, 230, 112)
new meinMenue("Menue1j", "right", X_origin+ 230, Y_origin +321, 230, 112)
new meinMenue("Menue1k", "right", X_origin+ 230, Y_origin +343, 230, 90)
new meinMenue("Menue1l", "right", X_origin+ 230, Y_origin +365, 230, 83)
new meinMenue("Menue1m", "right", X_origin+ 230, Y_origin +387, 230, 90)

//Menue2
new meinMenue("Menue2", "down", X_origin + 158, Y_origin, 242, 270)
new meinMenue("Menue2a", "right", X_origin + 400, Y_origin +21, 190, 112)
new meinMenue("Menue2b", "right", X_origin + 400, Y_origin +109, 190, 128)
new meinMenue("Menue2c", "right", X_origin + 400, Y_origin +131, 190, 128)
new meinMenue("Menue2d", "right", X_origin + 400, Y_origin +219, 190, 68)

//Menue3
new meinMenue("Menue3", "down", X_origin + 327, Y_origin, 181, 100)
new meinMenue("Menue3a", "right", X_origin + 508, Y_origin +43, 180, 104)