/*
 *************************************************
 *  copyright: Georg Tummeltshammer, April 2000  *
 *  all rights reserved!                         *
 *************************************************
 */

var layerRef='';
var styleSwitch='';
var imgSwitch='';
var browser=0;
var name=navigator.appName;
var ver=parseInt(navigator.appVersion);
var breite=screen.width;
var hoehe=screen.height;
var ibreite=screen.availWidth;
var ihoehe=screen.availHeight;

if (name == "Netscape" && ver >= "4") browser=5;
else if (name == "Microsoft Internet Explorer" && ver >= "4") browser=4;
else if (name == "Netscape" && ver == "3") browser=3;
else if (name == "Microsoft Internet Explorer") browser=2;
else if (name == "Netscape" && ver == "2") browser=1;


//   **********************************************
//   ***      Weiterleitung zur Auflösung     *****
//   **********************************************

function gotoresolution()
	{
	if (breite > 900) ladedatei = "1024fr.htm";
	else ladedatei = "800fr.htm";
	parent.location.href = ladedatei;
	}



//   **********************************************
//   ***   Bildschirm anpassen (Breite,Höhe)  *****
//   **********************************************


function anpassen()
	{
	parent.moveTo (0,0);
	if (name == "Netscape")
		{
		parent.outerWidth=(ibreite);
		parent.outerHeight=(ihoehe);
		}
	else { parent.resizeTo (ibreite,ihoehe);}
	}
	
	
function posit(lid,x,y)
	{
	init();
	eval(layerRef + '.' + lid + styleSwitch + '.left = '+ x +' ;');
	eval(layerRef + '.' + lid + styleSwitch + '.top = '+ y +' ;');
	showlayer(lid);
	}
	
	

//   **********************************************
//   ***                 Zeit                 *****
//   **********************************************

woTag=new Array;
woTag[0]="Sonntag"
woTag[1]="Montag"
woTag[2]="Dienstag"
woTag[3]="Mittwoch"
woTag[4]="Donnerstag"
woTag[5]="Freitag"
woTag[6]="Samstag"

 
function showtime()
	{
	//document.write(datum+" "+zeit);
	document.write(d.toGMTString());
	setTimeout('document.location.reload()',10000);
	}

function upDat() {
                 d=new Date(); 
		 dh=d.getHours();
		 dh=(dh>9) ? dh :"0"+dh;
		 dm=d.getMinutes();
		 dm=(dm>9) ? dm :"0"+dm;
		 ds=d.getSeconds();
		 ds=(ds>9) ? ds :"0"+ds;

		 datum=woTag[d.getDay()]+", "+d.getDate()+"."+(d.getMonth()+1)+"."+d.getYear()+", ";
		 zeit=dh+":"+dm+":"+ds;
                 
		if (!ver4) { return };
                 
                if (NS4){
                        whichEl = eval("document.time" + ".document");                      
		     	with (whichEl) 
		     		{
                        	open();
                        	write("<P CLASS='intro'>" + datum +" "+zeit + "</P>");
                        	close();
                        	}
                     	}
              	else 	{
                        whichEl = document.all.time;
                        whichEl.innerHTML = "<P CLASS='intro'>" + datum +" "+zeit + "</P>";                    
		 	}
             	setTimeout('upDat()',500);    
             	}



//  *********************************************
//  *  Bewegen, ein- und ausblenden von Layern  *
//  *********************************************

var ux,uy,a,b,c,x1,y1,s1,lid;

function init()
	{
	if (navigator.appName == 'Netscape' && navigator.appVersion.charAt (0)>='4')
	    {
            layerRef = 'document.layers';
            styleSwitch = '';
            imgSwitch = '.document.images';
            }
        else
       	    {
            if (navigator.appName == 'Microsoft Internet Explorer' && navigator.appVersion.charAt (0)>='4')
	    	{
               	layerRef = 'document.all';
               	styleSwitch = '.style';
               	imgSwitch = '';
            	}
            else
            	{
            	alert ("Diese Seite wurde für Netscape 4 (oder höher) und Internet Explorer 4 (oder höher) optimiert");
            	}
             }
        }
        

function hidelayer(layerID)
	{
	init();
	eval(layerRef + '["' + layerID + '"]' + styleSwitch + '.visibility="hidden"');
	}

function showlayer(layerID)
	{
	init();
	eval(layerRef + '["' + layerID + '"]' + styleSwitch + '.visibility="visible"');
	}

function movelayer(layerID,x,y)
	{
	init();
	ux = eval(layerRef + '["' + layerID + '"]' + styleSwitch + '.left');
	uy = eval(layerRef + '["' + layerID + '"]' + styleSwitch + '.top');
	if (navigator.appName == 'Microsoft Internet Explorer')
		{
		if (ux.charAt(ux.length-1) == "x") {ux = Number(ux.substr(0,(ux.length-2)));}
		if (uy.charAt(uy.length-1) == "x") {uy = Number(uy.substr(0,(uy.length-2)));}
		}
	lid=layerID;
	if (x==0)
		{
		a=0;c=Math.abs(y);b=y/c;
		}
	if (y==0)
		{
		b=0;c=Math.abs(x);a=x/c;
		}
	if (y!=0 && x!=0)
		{
		c=Math.abs(y);a=x/c;b=y/c;
		if (Math.abs(a)>1){c=Math.abs(x);b=y/c;a=x/c;}
		}
	x1=0;
	move();
	}
	

function movelayerto(layerID,x,y,s)
		{
		init();
		ux = eval(layerRef + '["' + layerID + '"]' + styleSwitch + '.left');
		uy = eval(layerRef + '["' + layerID + '"]' + styleSwitch + '.top');
		if (navigator.appName == 'Microsoft Internet Explorer')
			{
			if (ux.charAt(ux.length-1) == "x") {ux = Number(ux.substr(0,(ux.length-2)));}
			if (uy.charAt(uy.length-1) == "x") {uy = Number(uy.substr(0,(uy.length-2)));}
			}
		s1=1;
		x=x-ux;y=y-uy;s1=s;
		lid=layerID;
		if (x==0)
			{
			a=0;c=Math.abs(y);b=y/c;
			}
		if (y==0)
			{
			b=0;c=Math.abs(x);a=x/c;
			}
		if (y!=0 && x!=0)
			{
			c=Math.abs(y);a=x/c;b=y/c;
			if (Math.abs(a)>1){c=Math.abs(x);b=y/c;a=x/c;}
			}
		x1=0;
		move();
		}
	
	
function move()
	{
	if (x1<=(c/s1))
		{
		x1++;
		eval(layerRef + '["' + lid + '"]' + styleSwitch + '.left = '+ (ux+=(a*s1)) +' ;');
		eval(layerRef + '["' + lid + '"]' + styleSwitch + '.top = '+ (uy+=(b*s1)) +' ;');
		setTimeout('move()',1);
		}
	}
	  

function bild(lid,nr,titel)
	{
    init();
    var Normal1 = new Image();
    Normal1.src = titel; /* Hier erste Standard-Grafik angeben */
    if (navigator.appName == 'Microsoft Internet Explorer')
    	eval(layerRef + '.' + nr +'.src = Normal1.src;');
    else
    	eval(layerRef + '.' + lid + imgSwitch + '.' + nr +'.src = Normal1.src;');
    }


/**********************************************/
/*           Hier beginnt das Scrollen        */
/**********************************************/

function res(){
//tell();
flag = false;
}



function scroll(i){
flag = true;
c=-i;
//alert(eval("document.all.text1.style.height"));
doSc();	     
}

function doSc()
	{
	if (NS4) 
		{
         	whichEl = eval("document.text1.top");			 
                }
	else 	{
         	whichEl = eval("document.all.text1.style.top");
                }
	if(flag){
		a=parseInt(whichEl);
		if(a>=53){res();
	  	a=50;	
	  	}

	if (NS4){
		document.text1.top = (a+c);
		}
	else 	{
		document.all.text1.style.top = (a+c);
		}
	setTimeout('doSc()',20);
	}
}

function go(y)
	{
	if (NS4) {
		 document.text1.top = (y);
		 }
	else 	{
		document.all.text1.style.top = (y);
		}
	}


function tell()
	{
	if (NS4) 
		{
		alert(document.text1.top) ;
		}
	else 	{
		alert(document.all.text1.style.top);
		}
	}
