//-----arbeit 20071205 ---------------------------------------------------start
function overNavPic(whichPic){
        if (document.images){
            mysrc = document.images[whichPic].src;
            myname = mysrc.substring(mysrc.lastIndexOf("/")+1);
            myprefix = myname.substring(0,myname.lastIndexOf(".")-1);
            mysuffix = myname.substring(myname.lastIndexOf("."));
            mypath = mysrc.substring(0,mysrc.lastIndexOf("/")+1);
            document.images[whichPic].src = mypath + myprefix + "2" + mysuffix ;
        }

}
function outNavPic(whichPic){
        if (document.images){
            mysrc = document.images[whichPic].src;
            myname = mysrc.substring(mysrc.lastIndexOf("/")+1);
            myprefix = myname.substring(0,myname.lastIndexOf(".")-1);
            mysuffix = myname.substring(myname.lastIndexOf("."));
            mypath = mysrc.substring(0,mysrc.lastIndexOf("/")+1);
            document.images[whichPic].src = mypath + myprefix + "1" + mysuffix ;
        }
}

//-----arbeit 20071126 ---------------------------------------------------start

var isNav, isIE
var lastdiv = ""
var coll = ""
var styleObj = ""
if(navigator.appName=="Netscape"){
        isNav=true
} else {
        isIE=true
        coll="all."
        styleObj=".style"
}
function centerIt(){
        location.reload();
}
function js_show(what, where){
//alert(what);
        if (lastdiv != ""){
                js_hide(lastdiv);
        }
        if (isNav){
        if (document.getElementById(what + "parent")){
                document.getElementById(what + "parent").style.visibility="visible";
                document.getElementById(what + "parent").style.left=where;
                document.getElementById(what + "parent").style.top=0;
                document.getElementById(what + "child").style.visibility="visible";
                document.getElementById(what + "child").style.left =where-1;
                document.getElementById("navoutmouse").style.visibility="visible";
                document.getElementById("navoutmouse").style.left=where-32;
                document.getElementById("navoutmouse").style.top=-16;
        }
        } else {
                if (eval(document.all(what+ "parent"))) {
                        var obj=eval("document." + coll + what + "parent" + styleObj);
                        obj.visibility="visible";
                        obj.left = where;
                        obj.top = 0;
                        var obj=eval("document." + coll + what + "child" + styleObj);
                        obj.visibility="visible";
                        obj.left = where-1;
                        var obj=eval("document." + coll + "navoutmouse" + styleObj);
                        obj.visibility="visible";
                        obj.left = where - 32;
                        obj.top = -16;

                }
        }
        lastdiv = what;
}
function js_hide(what){
        if (isNav){
        if (document.getElementById(what + "parent")){
                document.getElementById(what + "parent").style.visibility="hidden";
                document.getElementById(what + "child").style.visibility="hidden";
                document.getElementById("navoutmouse").style.visibility="hidden";
        }
        } else {
        if (eval(document.all(what+ "parent"))) {
                var obj=eval("document." + coll + what + "parent" + styleObj);
                obj.visibility="hidden";

                var obj=eval("document." + coll + what + "child" + styleObj);
                obj.visibility="hidden";

                var obj=eval("document." + coll + "navoutmouse" + styleObj);
                obj.visibility="hidden";
        }
        }
}









//-----arbeit 20070304 ---------------------------------------------------
var clipTop = 0;
var clipWidth = 0;
var clipBottom = 0;
var clipHeight = 0;
var distfromtop = 0;     //distfromtop = -clipTop;
var clipareaHeight = 0;
var containerScrollboxHeight;
var         DHTML = (document.getElementById || document.all || document.layers);
var time,stepsize,theTime,theHeight,DHTML,clipratio,scrollboxScale;

//-----arbeit 20070304 ---------------------------------------------------start
function initpage(){
                //initvariables();
        try {
                var objcliparea = new getObj('cliparea');
                if (!objcliparea){
                } else {
                        initvariables();
                }
        }
        catch(er) {
        }
}

function initvariables(){

        if (!DHTML) return;
        var objcontaintercliparea = new getObj('container_cliparea');
        var objcliparea = new getObj('cliparea');
        var objcontainerscrollbox = new getObj('containerscrollbox');
        var objscrollbox = new getObj('scrollbox');
        var objcontainerscrollbar = new getObj('containerscrollbar');

        clipWidth = objcontaintercliparea.obj.offsetWidth;
        clipBottom = objcontaintercliparea.obj.offsetHeight;
        clipHeight = objcontaintercliparea.obj.offsetHeight;

        clipareaHeight = objcliparea.obj.offsetHeight;
        containerScrollboxHeight = objcontainerscrollbox.obj.offsetHeight

        clipratio = clipHeight / clipareaHeight
        scrollboxScale = containerScrollboxHeight / clipHeight
        scrollboxScale = scrollboxScale * clipratio

        if (document.getElementById || document.all)        {
                objcliparea.style.clip = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,0)';
                clipratio = (clipBottom)  / (clipareaHeight)
                if (clipratio < 1){
                        objscrollbox.style.height = Math.round(clipratio * containerScrollboxHeight);
                } else {
                        objscrollbox.style.height = containerScrollboxHeight;
                        containerscrollbar.style.visibility="hidden";
                }
        }
        if (document.getElementById || document.all)        {
                //alert (clipWidth + "/" + clipBottom);
        }
}

//-----arbeit 20070304 ---------------------------------------------------ende


function scrollayer(layername,amt,tim){
        if (!DHTML) return;
        thelayer = new getObj(layername); //thelayer = cliparea
        if (!thelayer) return;
        stepsize = amt;
        theTime = tim;
        realscroll();
}
function realscroll(){
        if (!DHTML) return;
        var objscrollbox = new getObj('scrollbox');
        if (clipareaHeight-clipBottom < stepsize){
                realamount = clipareaHeight-clipBottom;
        } else if (clipTop < -stepsize){
                realamount = -clipTop;
        } else {
                realamount = stepsize;
        }
        clipTop += realamount;
        clipBottom += realamount;
        distfromtop -= realamount;
        if ( clipBottom > clipareaHeight || clipTop < 0)        {
                clipTop -= realamount;
                clipBottom -= realamount;
                distfromtop += realamount;
        }
        if (document.getElementById || document.all)        {
                clipstring = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,0)';
                thelayer.style.clip = clipstring;
                thelayer.style.top = distfromtop + 'px';
                objscrollbox.style.top = Math.round(scrollboxScale * clipTop) +'px';
        }
        time = setTimeout('realscroll()',theTime);
}


function stopscroll(){
        if (time) clearTimeout(time);
}
//drag scrollbar----------------------------------------------

var ddEnabled=false;
var scrollboxOldPosition;
var itsmescrollbox;

function startdrag(e) {
        if(!document.all) {
                objekt=e.target.id;
        } else {
                objekt=event.srcElement.id;
        }
        if(objekt) {
                if (objekt=="scrollbox"){
                        itsmescrollbox=1;
                } else {
                        itsmescrollbox=0;
                }
                if(!document.all) {
                        event=e;
                }
                startY=event.clientY;
                ddEnabled=true;
                var objscrollbox = new getObj('scrollbox');
                scrollboxOldPosition = (parseInt(objscrollbox.style.top));
                if (isNaN(scrollboxOldPosition)){
                        scrollboxOldPosition = 0;
                }
                document.onmousemove=realdrag;
        }
}
function realdrag(e) {
        if (ddEnabled){
                if(itsmescrollbox==1) {
                        if(!document.all) {
                                event=e;
                        }
                        Ywert=event.clientY-startY;
                        document.getElementById(objekt).style.top = scrollboxOldPosition + Ywert;
                        if (Ywert > 0){
                                if (parseInt(document.getElementById(objekt).style.top) + parseInt(document.getElementById(objekt).style.height) > containerScrollboxHeight){
                                        window.status = parseInt(document.getElementById(objekt).style.top) + parseInt(document.getElementById(objekt).style.height);
                                        document.getElementById(objekt).style.top =  containerScrollboxHeight - parseInt(document.getElementById(objekt).style.height) ;
                                }
                        } else {
                                if (parseInt(document.getElementById(objekt).style.top)<0){
                                        document.getElementById(objekt).style.top = 0;
                                }
                        }
                        wkstepsize = Math.round((parseInt(document.getElementById(objekt).style.top))/scrollboxScale);
                        realdragdriven('cliparea',wkstepsize);

                }
        }
        return false;
}
function realdragdriven(layername,amt){
        if (!DHTML) return;
        thelayer = new getObj(layername); //thelayer = cliparea
        if (!thelayer) return;
        stepsize = -amt;
        clipTop = -stepsize;
        clipBottom = clipTop+clipHeight;
        distfromtop = stepsize;
        if (document.getElementById || document.all)        {
                clipstring = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,0)';
                thelayer.style.clip = clipstring;
                thelayer.style.top = distfromtop + 'px';
        }
}
function stopdrag(){
        ddEnabled=false;
}

document.onmousedown=startdrag;
document.onmouseup=stopdrag;
//document.onmouseout=stopdrag;

function getObj(name)
{
  if (document.getElementById)
  {
    this.obj = document.getElementById(name);
        this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
    this.obj = document.all[name];
        this.style = document.all[name].style;
  }
  else if (document.layers)
  {
           this.obj = document.layers[name];
           this.style = document.layers[name];
  }
}