function ein(nummer){
var layer = document.getElementById("layer" + nummer).style.visibility = 'visible'
}
function aus(nummer){
var layer = document.getElementById("layer" + nummer).style.visibility = 'hidden';
}

function allaus(x){
var i = 0;
aus(x+i);
i++;
aus(x+i);
i++;
aus(x+i);
i++;
aus(x+i);
i++;
aus(x+i);
i++;
aus(x+i);
i++;
aus(x+i);
i++;
aus(x+i);
i++;
}

function initb()
{
	if(window.innerWidth) //NS-Browser Breite
  		{
  			fensterbreite=parseInt(window.innerWidth)
  			pausen =1000;
  		}
	else  //IE-Browser
		{
			fensterbreite = parseInt(document.body.clientWidth)
			pausen =1000;
		}
	return fensterbreite / 2;
		}
function initbone()// Hintergrund MITTE
{
	if(window.innerWidth) //NS-Browser Breite
  		{
  			fensterbreite=parseInt(window.innerWidth)
  			pausen =1000;
  		}
	else  //IE-Browser
		{
			fensterbreite = parseInt(document.body.clientWidth)
			pausen =1000;
		}
	return fensterbreite / 2 -800/2 +50; // Hintergrundbreite
		}

function inith()
		{
	if(window.innerWidth) //NS-Browser Breite
		{
			fensterhoehe=parseInt(window.innerHeight)
		}
	else  //IE-Browser
		{
			fensterhoehe=parseInt(document.body.clientHeight)
		}
	return fensterhoehe / 2;
		}
function inithone(x)
                {
        if(window.innerWidth) //NS-Browser Breite
                {
                        fensterhoehe=parseInt(window.innerHeight)
                }
        else  //IE-Browser
                {
                        fensterhoehe=parseInt(document.body.clientHeight)
                }
        return fensterhoehe - (fensterhoehe /100 * x);
                }

function weiter(x){
ein(x+200);
aus(x);
}

function zurueck(x){
aus(x);
ein(x-200);
}



function bewegung()//Entgültige Position
	{
	 	Bild1_XPos =initb()-800/2;//	Bild1_XPos =initb(2)-785/2;
		Bild1_yPos =inith()-inith()+ 10	;	//inith(95*(inith(0)/100));//inith(inith(0))+ 20;//Prozentuale Verschiebung

		//Bild_Positionieren("logo",Bild1_XPos+10,Bild1_yPos );
		//Bild_Positionieren("navitabelle",Bild1_XPos,Bild1_yPos +60);
		//Bild_Positionieren("banner",Bild1_XPos+145,Bild1_yPos +70);
	  //	Bild_Positionieren("besteck",Bild1_XPos+625,Bild1_yPos +70);
	  //	Bild_Positionieren("teller",Bild1_XPos+625,Bild1_yPos +70);
 		//Bild_Positionieren("hintergrund",Bild1_XPos,inith(1)-inith(1));

	  //	Bild_Positionieren("layer1",Bild1_XPos+114,Bild1_yPos + 70);
	  //	Bild_Positionieren("layer2",Bild1_XPos+114,Bild1_yPos + 110);
	  //	Bild_Positionieren("layer3",Bild1_XPos+114,Bild1_yPos + 150);
	  //	Bild_Positionieren("layer4",Bild1_XPos+114,Bild1_yPos + 190);
	  //		Bild_Positionieren("layer5",Bild1_XPos+114,Bild1_yPos + 230);
	  //		Bild_Positionieren("layer6",Bild1_XPos+114,Bild1_yPos + 270);
	  //		Bild_Positionieren("layer7",Bild1_XPos+114,Bild1_yPos + 310);
	  //		Bild_Positionieren("layer8",Bild1_XPos+114,Bild1_yPos + 350);
	  //	Bild_Positionieren("layer0",Bild1_XPos + 210,Bild1_yPos );

		MeinTimer = window.setTimeout("bewegung();", pausen);

	}

function Bild_Positionieren(Bild_Name, links, oben)
{
	if (document.layers)
		{
			eval("document.layers['"+Bild_Name+"'].top=oben");
			eval("document.layers['"+Bild_Name+"'].left=links");
		}
	else if (document.all)
		{
			eval("document.all."+Bild_Name+".style.top=oben");
			eval("document.all."+Bild_Name+".style.left=links");
		}
	else if (document.getElementById)
		{
			document.getElementById(Bild_Name).style.top=oben;
			document.getElementById(Bild_Name).style.left=links;
		}
}


//*********************************************************************************************************************************************************


klassen="normaltop";
klasseh="onMouseOver=\"this.className='normaltop'; ein(10);\"";
klasseo="onMouseOut=\"this.className='normaltop';\""; // aus(10);
klassestadt="onMouseOver=\"ein(11);\"";


//Hier die Tage
//ohne Jahreszahlen und ohne führende Nullen

//heutiges Datum ermittel
heute=new Date();
//Tag des heutigen Datums ermitteln
tag=heute.getDate();
//Monat des heutigen Datums, +1 da js bei 0=januar anfängt
monat=heute.getMonth()+1;

//********Inhalte der Tage / Monate*******gtage[0]=new Array(tag+".4", für den monat für jeden tag gtage[0]=new Array(tag+"."+monat,
gtage=new Array();
ghotel=new Array();//***********************************************************************************
//gtage[0]=new Array("5.4","Maria")
//gtage[1]=new Array("8.4","Peter")
//gtage[2]=new Array("9.4","Klaus")
//gtage[3]=new Array("26.1","Doris")
//gtage[4]=new Array("26.1","Susi")
//gtage[5]=new Array("29.1","Elke")
//gtage[6]=new Array("13.4","Heinz")
//gtage[7]=new Array("14.4","Bernd")
//gtage[8]=new Array("15."+monat,"Wolfgang")

//Tagesliste Küche
gtage[0]=new Array(tag+"."+monat,"<div id=\"layer10\" class=\"layer10\"><font color=\"#8B0000\"><b>Heute in unseren Restaurant:</b></font><br>Tauberbischofsheimer Tralala in Curry-Früchtesauce im Reisrand, Salatteller aus Wacholdermoos dazu einen 1997er Chardonnay Rossi <\/div> ")
gtage[1]=new Array(tag+".5","<div id=\"layer10\" class=\"layer10\"><b>Heute in der Gutsschänke:</b><br>Salatteller aus Wacholdermoos dazu einen 1997er Chardonnay Rossi<\/div>");


//Tagesliste Märkte
ghotel[0]=new Array(tag+"."+monat,"<div id=\"layer10\" class=\"layer10\">...<\/div>");//******************









//Hier der Teil zum Auswerten der Tage:

treffer=new Array();
trefferhotel=new Array();//********************************
//Maße für die Animation
anzbreit=500;
anzhoch=40;

//schrittweite für den mover******************************
weite=10;
//geschwindigkeit der Animation
tempo=1;
//*******************************************************************************startposition der Animation
startposx=-anzbreit;//startposx=-anzbreit
startposy= 300 ;//startposy=-anzhoch
//Browserabfrage
ns4=0;
dom=0;
if(document.getElementById)
dom=1;
if(document.layers)
ns4=1;


//Tagesarray durchsuchen
for(i=0;i<gtage.length ;i++)
{
if(gtage[i][0]==tag+"."+monat)
//wenn gefunden Namen in Treffer schreiben
treffer[treffer.length]=gtage[i][1];
}

//Tagesarray durchsuchen//********************************
for(j=0;j<ghotel.length ;j++)//********************************
{//********************************
if(ghotel[j][0]==tag+"."+monat)//********************************//wenn gefunden Namen in Treffer schreiben//********************************
trefferhotel[trefferhotel.length]=ghotel[j][1];//********************************
}//********************************

//schreiben des Anzeigefeldes

function anzeige_erzeugenr()//********************************r
{
	if(treffer.length>0) //nur wenn tag vorhanden
	{
	if(ns4)
	document.write('<layer name="gtkind" z-Index="10" width="'+anzbreit+'" height="'+anzhoch+'" visibility="show" padding:5px; bgcolor="#F0E68C">');
	else
	document.write('<div id="gtkind" style="position:absolute;z-Index:10;width:'+anzbreit+';height:'+anzhoch+';visibility:hidden; padding:5px; background-color: #F0E68C">');
	document.write('');
	//document.write('<td width="0" valign="middle" align="center"></td>')//*** Bildbreite *********** Bild einfügen *** vor dem Zellenende <img src="geburtstag.gif">
	document.write('');
	ttexte="";
	for(i=0;i<treffer.length;i++)
	{
	ttexte+=treffer[i]+"<br>";
	}
	document.write(ttexte);
	if(treffer.length==1)//*** hat ***
	document.write(' ');
	else
	document.write(' haben ')
	//document.write('<br><a href="javascript:weg()">Info schließen</a>')
	document.write('');
	//document.write('<a href="javascript:weg()">Info schließen</a></td></tr></table>')
	if(ns4)
	document.write('</layer>');
	else
	document.write('</div>');
	}
	else
	{
	return false;
	}
}


function anzeige_erzeugenh()//*********************************************************************************************************************
{
	if(trefferhotel.length>0) //nur wenn Geburtstag vorhanden
	{
	if(ns4)
	document.write('<layer name="gtkind" z-Index="10" width="'+anzbreit+'" height="'+anzhoch+'" visibility="show" padding:5px; bgcolor="transparent">');
	else
	document.write('<div id="gtkind" style="position:absolute;z-Index:10;width:'+anzbreit+';height:'+anzhoch+';visibility:hidden; padding:5px; background-color: transparent">');
	document.write('');
	//document.write('<td width="0" valign="middle" align="center"></td>')//*** Bildbreite *********** Bild einfügen *** vor dem Zellenende <img src="geburtstag.gif">
	document.write('');
	ttexte="";
	for(j=0;j<trefferhotel.length;j++)
	{
	ttexte+=trefferhotel[j]+"<br>";
	}
	document.write(ttexte);
	if(trefferhotel.length==1)//*** hat ***
	document.write('');
	else
	document.write('');//haben
	//document.write('<br><a href="javascript:weg()">Info schließen</a>')
	document.write('');
	//document.write('<a href="javascript:weg()">Info schließen</a></td></tr></table>')
	if(ns4)
	document.write('</layer>');
	else
	document.write('</div>');
	}
	else
	{
	return false;
	}
}//*********************************************************************************************************************





//anzeigeobject für browser anpassen
function getobj(obj)
{
return(ns4?document.layers[obj]:document.getElementById(obj).style);
}
//wird im Body-tag der HTML-Datei aufgerufen
function start()
{
if(treffer.length>0)
{
//anzeigefeld links oben aus dem Bildschirmbereich bringen
getobj('gtkind').left=-anzbreit;
getobj('gtkind').top=-anzhoch;
//anzeigefeld sichtbar machen
ns4?getobj('gtkind').visibility="show":getobj('gtkind').visibility="visible";
//animation starten
mover()
}
}
function starth()
{
if(trefferhotel.length>0)
{
//anzeigefeld links oben aus dem Bildschirmbereich bringen
getobj('gtkind').left=-anzbreit;
getobj('gtkind').top=-anzhoch;
//anzeigefeld sichtbar machen
ns4?getobj('gtkind').visibility="show":getobj('gtkind').visibility="visible";
//animation starten
mover()
}
}
//function für die Animation

function mover()
{
if(window.innerWidth)
{
//endposition für die Anzeige ermitteln
posmaxx=Bild1_XPos+200;//(parseInt(window.innerWidth)-anzbreit)/2 //******************POSITION von Rechts NS********
posmaxy=Bild1_yPos+20 ;//(parseInt(window.innerHeight)-anzhoch)/2 //******************POSITION von Oben NS*******
}
else
{
posmaxx=Bild1_XPos+200 ;//(parseInt(document.body.clientWidth)-anzbreit)/2 //******************POSITION von Rechts IE************
posmaxy=Bild1_yPos +20;//(parseInt(document.body.clientHeight)-anzhoch)/2 //******************POSITION von Oben IE**********
}
//jeweilige horizontale/vertikale Schrittweite anpassen
faktor=screen.height/screen.width
if(startposx<posmaxx||startposy>posmaxy) //wenn zielposition nicht erreicht istif(startposx<posmaxx||startposy<posmaxy)****von oben
{
//anzeigeobject bewegen
if(startposx<posmaxx)
startposx+=weite;
if(startposy>posmaxy)//*********************************************************if(startposy<posmaxy) von oben
startposy-=(weite*faktor);//startposy+=(weite*faktor)****************************if(startposy<posmaxy) von oben
getobj('gtkind').left=startposx;
getobj('gtkind').top=startposy;
setTimeout('mover()',tempo);
}
}
//ausblenden der Anzeige
function weg()
{
ns4?getobj('gtkind').visibility="hide":getobj('gtkind').visibility="hidden";
}