var home = '0';


function enter()
{

op = setTimeout('open()',4000);
document.getElementById('enter').style.visibility='visible';
document.getElementById('content').style.visibility='hidden';
document.getElementById('right').style.visibility='hidden';

// bei erneutem aufruf
if (document.getElementById('scrollCont').style.visibility=='visible') {
  
  document.getElementById('scrollCont').style.visibility='hidden';
  navi = list.split('|');

    for(i=1;i<navi.length;i++)
    {
    doc.getElementById(navi[i]+'_nav').style.visibility='hidden';
    }
  
  home='1';
}


}
function open()
{
clearTimeout(op); // wichtig, damit der scroller nicht nochmal gestartet wird
document.getElementById('enter').style.visibility='hidden';
document.getElementById('content').style.visibility='visible';
document.getElementById('right').style.visibility='visible';
document.getElementById('scrollCont').style.visibility='visible';

if (home == '0') {
//autoscroll starten
autoScrollInit();
}

}


function show(main)
{
doc = document;

if (main == "p_weiterbildung") {
doc = parent.document;
main='weiterbildung';
navi = parent.list.split('|');
} else {
navi = list.split('|');
}

for(i=1;i<navi.length;i++)
{

doc.getElementById(navi[i]+'_nav').style.visibility='hidden';
doc.getElementById(navi[i]).className = '';
}

doc.getElementById(main+'_nav').style.visibility='visible';

// alle unterlinks entfärben
for (var a=0;a<10;a++)
    {
       if (doc.getElementById(main+'_'+a)) {
        doc.getElementById(main+'_'+a).className = ''; 
        }
   }
doc.getElementById(main+'_1').className = 'now'; //erster unterlink färben

doc.getElementById(main).className = 'now'; // link färben
load(doc.getElementById(main+'_1').name); //ersten link laden

}    
 
function showit(main,module)
{

for (var a=0;a<10;a++)
    {
       if (document.getElementById(main+'_'+a)) {
        document.getElementById(main+'_'+a).className = ''; // entfärben
        }
   }

document.getElementById(main+'_'+module).className = 'now'; //aktuellen link einfärben
load(document.getElementById(main+'_'+module).name); // laden
}

function weiterbildung()
{
show('p_weiterbildung');
}

function load(main)
{

//iframe laden
URL = './content.php?nav=' +main;
parent.iframe.location.href=URL;


//head bild
doc.getElementById('img').src = "./images/"+ main +".jpg";
}

//----> autoscroller
//Browsercheck
function checkBrowser(){
        this.ver=navigator.appVersion
        this.dom=document.getElementById?1:0
        this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
        this.ie4=(document.all && !this.dom)?1:0;
        this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
        this.ns4=(document.layers && !this.dom)?1:0;
        this.ie4mac=this.ie4 && navigator.userAgent.indexOf("Mac")>-1
        this.ie5mac=this.ie5 && navigator.userAgent.indexOf("Mac")>-1
        this.ie55=(this.ver.indexOf("MSIE 5.5")>-1 && this.dom)?1:0;
        this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5 || this.ie5mac)
        //if (this.bw=="0") { }
        return this
        
}
bw=new checkBrowser()

//Pixelabstand für Scroller-Text nach oben 
lstart=900
//true = wiederholen, false = einmalig
loop=true
//Scroller-Speed (je kleiner desto schneller) 
speed=80
//Pixelanzahl pro Schritt (ändert auch Scroller-Speed)
pr_step=1
//Objekt-Konstrukteur
function makeObj(obj,nest){
    nest=(!nest) ? '':'document.'+nest+'.'
        this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
          this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
        this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
        this.autoScroll=autoScroll;
        this.moveIt=b_moveIt; this.x; this.y;
    this.obj = obj + "Object"
    eval(this.obj + "=this")
    return this
}
function b_moveIt(x,y){
        this.x=x;this.y=y
        this.css.left=this.x
        this.css.top=this.y
}
//Objekt-Scroller (up)
function autoScroll(speed){
        if(this.y>-this.scrollHeight+lstart){
                this.moveIt(0,this.y-pr_step)
                setTimeout(this.obj+".autoScroll("+speed+")",speed)
                
        }else if(loop) {
               
                this.moveIt(0,0)
                eval(this.obj+".autoScroll("+speed+")")
          }
}
//Objekt-Init
function autoScrollInit(){
        oAutoCont=new makeObj('scrollCont')
        oAutoScroll=new makeObj('scrollText','scrollCont')
        oAutoScroll.moveIt(0,lstart)
        oAutoCont.css.visibility='visible'
        oAutoScroll.autoScroll(speed)
}


