/*all scripts by matthias loibner;
matthias@loibner.net*/

ie = (document.all) ? 1 : 0;
n = (document.layers) ? 1 : 0;
js4 = ((n || ie) && parseInt(navigator.appVersion) >= 4);
finit=0;

function init_menu()
{
    if (js4)
    {
     ini = window.setInterval("init_m()",55);
    }
}

function init_m()
{
    if (js4 && top.frames.display && top.frames.display.finit == 2)
    {
     arr = new Array();
     arr[0] = new arrow('top.frames.display','lr',-141,-(top.frames.menu.innerWidth)-9,0);
     arr[1] = new arrow('top.frames.menu','lr',-5,-5,0);
     arr[2] = new arrow('top.frames.menu','ud',0,0,-6);
     arr[1].fill();
     arr[2].fill();
     clipped_table = (n) ? top.frames.menu.document.table2 : top.frames.menu.document.all.table2.style;
         if (n)
         {
          document.captureEvents(Event.MOUSEMOVE);
          document.onmousemove=mousemove;
         }
     clearInterval(ini);
     finit = 2;
    }
}

function init_display()
{
    if (js4)
    {
     ini = window.setInterval("init_d()",111);
    }
 }

function init_d()
{
    if (js4 && top.frames.menu && top.frames.menu.finit > 0)
    {
     arr = new Array();
     arr[0] = new arrow('top.frames.display','lr',-5,-5,10);
     arr[1] = new arrow('top.frames.menu','lr',131,(top.frames.menu.innerWidth)-1,-10);
     arr[2] = new arrow('top.frames.menu','ud',-5,-5,-6);
     arr[0].fill();

     clipped_table = (n) ? top.frames.menu.document.table2 : top.frames.menu.document.all.table2.style;

        if (n)
        {
         document.captureEvents(Event.MOUSEMOVE);
         document.onmousemove=mousemove;
        }

     window.clearInterval(ini);
     finit = 2;
     top.frames.menu.init_m();
    }
}



function mousemove(e)
{
 cross(e);
 highlight(e);
}

function cross(e)
{
    if (js4 && finit == 2)
    {
         for (i=0;i<arr.length;i++)
         {
          arr[i].move(e);
         }
    }

}

function highlight(e)
{
    if (finit == 2 && clipped_table)
    {
     hi = (n) ? e.pageY - 43 : window.event.y - 43;
     lo = (n) ? e.pageY - 41 : window.event.y - 41;
       if (ie)
       {
        clipped_table.clip = "rect(" + hi + "px 300px " + lo + "px 0px)";
       }
       else
       {
        clipped_table.clip.top = hi;
        clipped_table.clip.bottom = lo;
       }
    }
}

function arrow(where,dir,ie_l,ns_l,t)
{
 this.css = (n) ? eval(where + '.document.' + dir) : eval(where + '.document.all.' + dir + '.style');
 this.dir = dir;
 this.ie_l = ie_l;
 this.ns_l = ns_l;
 this.t = t;
 this.move = move;
 this.fill = fill;
 this.doc = (n) ? eval(where + '.document.' + dir + '.document') : eval('document.all.' + dir)
}

function move(e)
{
    if (this.dir == "lr")
    {
     this.css.left = (n) ? e.pageX + this.ns_l : window.event.x + this.ie_l;
    }
    else
    {
     this.css.top = (n) ? e.pageY + this.t : window.event.y + this.t;
    }
}

function fill()
{
 content = unescape('<img src=\"' + tree + this.dir + '.gif\" border=\"0\" top=\"0px\" left=\"0px\">');
    if (n)
    {
     this.doc.open();
     this.doc.write(content);
     this.doc.close();
    }
    else
    {
     this.doc.innerHTML = content;
    }
}