var noobSlide = new Class({ initialize: function(a) { this.items = a.items; this.mode = a.mode || 'horizontal'; this.modes = { horizontal: ['left', 'width'], vertical: ['top', 'height'] }; this.size = a.size || 60; this.box = a.box.setStyle(this.modes[this.mode][1], (this.size * this.items.length) + 'px'); this.button_event = a.button_event || 'click'; this.handle_event = a.handle_event || 'click'; this.onWalk = a.onWalk || null; this.currentIndex = null; this.previousIndex = null; this.nextIndex = null; this.interval = a.interval || 5000; this.autoPlay = a.autoPlay || false; this._play = null; this.handles = a.handles || null; if (this.handles) { this.addHandleButtons(this.handles) } this.buttons = { previous: [], next: [], play: [], playback: [], stop: [] }; if (a.addButtons) { for (var b in a.addButtons) { this.addActionButtons(b, $type(a.addButtons[b]) == 'array' ? a.addButtons[b] : [a.addButtons[b]]) } } this.fx = new Fx.Tween(this.box, $extend((a.fxOptions || { duration: 500, wait: false }), { property: this.modes[this.mode][0] })); this.walk((a.startItem || 0), true, true) }, addHandleButtons: function(a) { for (var i = 0; i < a.length; i++) { a[i].addEvent(this.handle_event, this.walk.bind(this, [i, true])) } }, addActionButtons: function(a, b) { for (var i = 0; i < b.length; i++) { switch (a) { case 'previous': b[i].addEvent(this.button_event, this.previous.bind(this, [true])); break; case 'next': b[i].addEvent(this.button_event, this.next.bind(this, [true])); break; case 'play': b[i].addEvent(this.button_event, this.play.bind(this, [this.interval, 'next', false])); break; case 'playback': b[i].addEvent(this.button_event, this.play.bind(this, [this.interval, 'previous', false])); break; case 'stop': b[i].addEvent(this.button_event, this.stop.bind(this)); break } this.buttons[a].push(b[i]) } }, previous: function(a) { this.walk((this.currentIndex > 0 ? this.currentIndex - 1 : this.items.length - 1), a) }, next: function(a) { this.walk((this.currentIndex < this.items.length - 1 ? this.currentIndex + 1 : 0), a) }, play: function(a, b, c) { this.stop(); if (!c) { this[b](false) } this._play = this[b].periodical(a, this, [false]) }, stop: function() { $clear(this._play) }, walk: function(a, b, c) { if (a != this.currentIndex) { this.currentIndex = a; this.previousIndex = this.currentIndex + (this.currentIndex > 0 ? -1 : this.items.length - 1); this.nextIndex = this.currentIndex + (this.currentIndex < this.items.length - 1 ? 1 : 1 - this.items.length); if (b) { this.stop() } if (c) { this.fx.cancel().set((this.size * -this.currentIndex) + 'px') } else { this.fx.start(this.size * -this.currentIndex) } if (b && this.autoPlay) { this.play(this.interval, 'next', true) } if (this.onWalk) { this.onWalk((this.items[this.currentIndex] || null), (this.handles && this.handles[this.currentIndex] ? this.handles[this.currentIndex] : null)) } } } });

var ie = document.all
var dom = document.getElementById
var ns4 = document.layers

var bouncelimit = 32 //(must be divisible by 8)
var direction = "up"

function initbox() {
    if (!dom && !ie && !ns4)
        return
    crossobj = (dom) ? document.getElementById("ultimas").style : ie ? document.all.ultimas : document.ultimas
    scroll_top = (ie) ? document.body.scrollTop : window.pageYOffset
    crossobj.top = scroll_top - 150
    crossobj.visibility = (dom || ie) ? "visible" : "show"
    dropstart = setInterval("ultimas()", 50)
}
function ultimas() {
    scroll_top = (ie) ? document.body.scrollTop : window.pageYOffset
    if (parseInt(crossobj.top) < 100 + scroll_top)
        crossobj.top = parseInt(crossobj.top) + 40
    else {
        clearInterval(dropstart)
        bouncestart = setInterval("bouncein()", 50)
    }
}
function bouncein() {
    crossobj.top = parseInt(crossobj.top) - bouncelimit
    if (bouncelimit < 0)
        bouncelimit += 8
    bouncelimit = bouncelimit * -1
    if (bouncelimit == 0) {
        clearInterval(bouncestart)
    }
}
function dismissbox() {
    if (window.bouncestart) clearInterval(bouncestart)
    crossobj.visibility = "hidden"
}
function get_cookie(Name) {
    var search = Name + "="
    var returnvalue = ""
    if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(search)
        if (offset != -1) {
            offset += search.length
            end = document.cookie.indexOf(";", offset)
            if (end == -1)
                end = document.cookie.length;
            returnvalue = unescape(document.cookie.substring(offset, end))
        }
    }
    return returnvalue;
}
function dropornot() {
    if (get_cookie("droppedin") == "") {
        window.onload = initbox
        document.cookie = "droppedin=yes"
    }
}
dropornot()
function redo() {
    bouncelimit = 32
    direction = "up"
    initbox()
}
window.onload = initbox


function MM_reloadPage(init) { //reloads the window if Nav4 resized
    if (init == true) with (navigator) {
        if ((appName == "Netscape") && (parseInt(appVersion) == 4)) {
            document.MM_pgW = innerWidth; document.MM_pgH = innerHeight; onresize = MM_reloadPage;
        }
    }
    else if (innerWidth != document.MM_pgW || innerHeight != document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.0
    var p, i, x; if (!d) d = document; if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
        d = parent.frames[n.substring(p + 1)].document; n = n.substring(0, p);
    }
    if (!(x = d[n]) && d.all) x = d.all[n]; for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
    for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document);
    if (!x && document.getElementById) x = document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
    var i, p, v, obj, args = MM_showHideLayers.arguments;
    for (i = 0; i < (args.length - 2); i += 3) if ((obj = MM_findObj(args[i])) != null) {
        v = args[i + 2];
        if (obj.style) { obj = obj.style; v = (v == 'show') ? 'visible' : (v = 'hide') ? 'hidden' : v; }
        obj.visibility = v;
    }
}