/* div_obj.js - version 2.8.2 */
/* gs: 02.06.03 - gesamten Quellcode neu formatiert (eingerückt), debug-alerts eingefügt (version 2.8) */
/* gs: 02.06.03 - LayerSlide-Funktionen gelöscht (version 2.8.1) */
/* gs: 03.06.03 - if-Bedingung für Netscape in LayerExist modifiziert (version 2.8.2) */
function Layer (id, nested_in_id, frame)
{
    //alert("div_obj.Layer() - start");
    if (!LayerExist(id, nested_in_id, frame))
    {
        //alert("div_obj.Layer() - if (!LayerExist)");
        this.exist = false;
        //alert("div_obj.Layer() - if (!LayerExist) - exist: " + exist);
        return false;
    }
    //alert("div_obj.Layer() - start 2");
    this.exist = true;
    //alert("div_obj.Layer() - exist: " + this.exist);
    this.frame = frame || self;
    //alert("div_obj.Layer() - this.frame: " + this.frame);
    if (is.DOM)
    {
        this.elm = this.event = (frame) ? parent.frames[frame].document.getElementById(id) : document.getElementById(id);
        this.css = this.elm.style;
        this.img = this.event = (frame) ? parent.frames[frame].document.images : document.images;
        this.doc = (frame) ? parent.frames[frame].document : document;
        this.x = this.elm.offsetLeft;
        this.y = this.elm.offsetTop;
        this.w = this.elm.offsetWidth;
        this.h = this.elm.offsetHeight;
    }
    else
    {
        if (is.ns4)
        {
            if (!frame)
            {
                this.css = (nested_in_id) ? document.layers[nested_in_id].document.layers[id] : document.layers[id];
                this.img = (nested_in_id) ? document.layers[nested_in_id].document.layers[id].document.images : document.layers[id].document.images;
            }
            else
            {
                this.css = (nested_in_id) ? parent.frames[frame].document.layers[nested_in_id].document.layers[id] : parent.frames[frame].document.layers[id];
                this.img = (nested_in_id) ? parent.frames[frame].document.layers[nested_in_id].document.layers[id].document.images : parent.frames[frame].document.layers[id].document.images;
            }
            this.elm = this.event = this.css;
            this.doc = this.css.document;
            this.x = this.css.left;
            this.y = this.css.top;
            this.w = this.css.document.width;
            this.h = this.css.document.height;
        }
        else if (is.ie)
        {
            this.css = (frame) ? parent.frames[frame].document.all[id].style : document.all[id].style;
            this.img = this.event = (frame) ? parent.frames[frame].document.images : document.images;
            this.elm = this.event = (frame) ? parent.frames[frame].document.all[id] : document.all[id];
            this.doc = (frame) ? parent.frames[frame].document : document;
            this.x = this.elm.offsetLeft;
            this.y = this.elm.offsetTop;
            this.w = this.elm.offsetWidth;
            this.h = this.elm.offsetHeight;
        }
    }
    this.id = id;
    this.nested_in_id = nested_in_id;
    this.slideActive = false;
    this.obj = id + "Layer";
    eval(this.obj + " = this");
    return true;
}
function LayerExist (id, nested_in_id, frame)
{
    //alert("div_obj.LayerExist() - start");
    var exist = false;
    //alert("div_obj.LayerExist() - start");
    if (is.DOM)
    {
        //alert("div_obj.LayerExist() - is.DOM");
        exist = (frame) ? parent.frames[frame].document.getElementById(id) : document.getElementById(id);
        //alert("div_obj.LayerExist() - is.DOM - exist: " + exist);
    }
    else
    {
        //alert("div_obj.LayerExist() - not.DOM");
        // gs: 27.05.03
        //if (top.is.ns)
        if (is.ns)
        {
            //alert("div_obj.LayerExist() - top.is.ns");
            if (!frame)
            {
                //alert("div_obj.LayerExist() - !frame");
                exist = (nested_in_id) ? document.layers[nested_in_id].document.layers[id] : document.layers[id];
                //alert("div_obj.LayerExist() - !frame - exist: " + exist);
            }
            else
            {
                //alert("div_obj.LayerExist() - frame");
                exist = (nested_in_id) ? parent.frames[frame].document.layers[nested_in_id].document.layers[id] : parent.frames[frame].document.layers[id];
                //alert("div_obj.LayerExist() - frame - exist: " + exist);
            }
        }
        else if (top.is.ie)
        {
            //alert("div_obj.LayerExist() - top.is.ie");
            exist = (!frame) ? document.all[id] : parent.frames[frame].document.all[id];
        }
    }
    if (!exist)
    {
        exist = false;
    }
    return exist;
}
function LayerShow()
{
    this.css.visibility = (is.ns4)? "show" : "visible";
    //alert("this.css.visibility: " + this.css.visibility);
}
Layer.prototype.show = LayerShow;
function LayerHide()
{
    this.css.visibility = (is.ns4)? "hide" : "hidden";
}
Layer.prototype.hide = LayerHide;
function LayerIsVisible()
{
    if (is.ns4)
    {
        return (this.css.visibility=='hide')? false:true;
    }
    else
    {
        return (this.css.visibility=='hidden')? false:true;
    }
}
Layer.prototype.isvisible = LayerIsVisible
function LayerClipTo(t,r,b,l)
{
    if (t==null)
        t = this.clipValues('t')
    if (r==null)
        r = this.clipValues('r')
    if (b==null)
        b = this.clipValues('b')
    if (l==null)
        l = this.clipValues('l')
    if (is.ns && !is.DOM)
    {
        this.css.clip.top = t
        this.css.clip.right = r
        this.css.clip.bottom = b
        this.css.clip.left = l
    }
    else if (is.ie || is.DOM)
        this.css.clip = "rect("+t+"px "+r+"px "+b+"px "+l+"px)"
}
Layer.prototype.clipTo = LayerClipTo;
function LayerClipBy(t,r,b,l)
{
    this.clipTo(this.clipValues('t')+t, this.clipValues('r')+r, this.clipValues('b')+b, this.clipValues('l')+l)
}
Layer.prototype.clipBy = LayerClipBy;
function LayerClipInit(clipTop,clipRight,clipBottom,clipLeft)
{
    if (is.ie)
    {
        if (arguments.length==4)
            this.clipTo(clipTop,clipRight,clipBottom,clipLeft);
        else
            if (is.ie && is.v >= 4)
            {
                this.clipTo(0, this.css.pixelWidth,this.css.pixelHeight,0);
            }
    }
}
Layer.prototype.clipInit = LayerClipInit;
function LayerClipValues(which)
{
    if (is.ie || is.DOM)
    {
        if (!this.css.clip)
        {
            this.clipInit();}
            var clipval = this.css.clip.replace(/pt/,"px");
            var clipv = clipval.split("rect(")[1].split(")")[0].split("px");
        }
    if (which=="t")
        return (is.ns && !is.DOM)? this.css.clip.top : Number(clipv[0]);
    if (which=="r")
        return (is.ns && !is.DOM)? this.css.clip.right : Number(clipv[1]);
    if (which=="b")
        return (is.ns && !is.DOM)? this.css.clip.bottom : Number(clipv[2]);
    if (which=="l")
        return (is.ns && !is.DOM)? this.css.clip.left : Number(clipv[3]);}Layer.prototype.clipValues = LayerClipValues;
function LayerMoveTo(x,y)
{
    if (x!=null)
    {
        this.x = x
        if (is.ns)
            this.css.left = this.x
        else
            this.css.pixelLeft = this.x
    }
    if (y!=null)
    {
        this.y = y
        if (is.ns)
            this.css.top = this.y
        else
            this.css.pixelTop = this.y
    }
}
Layer.prototype.moveTo = LayerMoveTo;
function LayerMoveBy(x,y)
{
    if (x!=null)
    {
        x+=this.x;
    }
    if (y!=null)
    {
        y+=this.y;
    }
    this.moveTo(x,y)
}
Layer.prototype.moveBy = LayerMoveBy;
var slideActive = false;
var someActive = false;
var nextSlide = false;
var next_slideObj = false;
var next_fn = false;
function LayerWrite(html)
{
    if (is.ns && !is.DOM)
    {
        this.doc.open();
        this.doc.write(html);
        this.doc.close();
    }
    else
    {
        this.elm.innerHTML = html;
    }
}
Layer.prototype.write = LayerWrite;
function writeCSS(str,showAlert)
{
    str = css('START')+str+css('END')
    document.write(str)
    if (showAlert)
        alert(str)
}
function css(id,left,top,width,height,color,vis,z,other)
{
    if (id=="START")
        return '<STYLE TYPE="text/css">\n'
    else if (id=="END")
        return '</STYLE>'
    var str = (left!=null && top!=null)? '#'+id+' {position:absolute; left:'+left+'px; top:'+top+'px;' : '#'+id+' {position:relative;'
    if (arguments.length>=4 && width!=null)
        str += ' width:'+width+'px;'
    if (arguments.length>=5 && height!=null)
    {
        str += ' height:'+height+'px;'
        if (arguments.length<9 || other.indexOf('clip')==-1)
            str += ' clip:rect(0px '+width+'px '+height+'px 0px);'
    }
    if (arguments.length>=6 && color!=null)
        str += (is.ns)? ' layer-background-color:'+color+';' : ' background-color:'+color+';'
    if (arguments.length>=7 && vis!=null)
        str += ' visibility:'+vis+';'
    if (arguments.length>=8 && z!=null)
        str += ' z-index:'+z+';'
    if (arguments.length==9 && other!=null)
        str += ' '+other
    str += '}\n'
    return str;
}