
<!--
//geandert - 7.12.2009
//Notdienste behandeln Leipziger 2010
//Statische Daten initialisieren
Wochentage=new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");
Monate=new Array("Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember");
function Apotheke ( Name, Strasse, Telefon ){ 
        this.Name=Name;
        this.Strasse=Strasse;
        this.Telefon=Telefon;
}

Apotheken=new Array(17);
for(i=0;i<17;i++)Apotheken[i]=new Array(2);

//A
Apotheken[0][0] = new Apotheke("Apotheke am Koppenplatz","Koppenplatz 13 - 14", "Ruf: 28 59 83 13");//X
Apotheken[0][1] = new Apotheke("Apotheke am Alexanderplatz","Otto-Braun Straße 70 - 72", "Ruf: 2 42 57 66");
//B
Apotheken[1][0] = new Apotheke("Apotheke an der Jungfernbrücke","Gertraudenstraße 19", "Ruf: 20 28 51 61");
Apotheken[1][1] = new Apotheke("Dorotheenstädtische Apotheke","Friedrichstraße 151", "Ruf: 2 04 48 17");
//C
Apotheken[2][0] = new Apotheke("Galenus Apotheke","Reinhardtstraße 7", "Ruf: 2 82 78 71");
Apotheken[2][1] = new Apotheke("Apotheke am Engelbecken","Heinrich-Heine-Straße 15", "Ruf: 27 56 02 75");
//D
Apotheken[3][0] = new Apotheke("Nordland-Apotheke","Invalidenstraße 114", "Ruf: 2 82 30 48");
Apotheken[3][1] = new Apotheke("Alexa-Apotheke","Grunerstraße 20", "Ruf: 27 58 16 40");
//E
Apotheken[4][0] = new Apotheke("Heinrich-Heine-Apotheke","Brückenstraße 13", "Ruf: 2 79 35 19");
Apotheken[4][1] = new Apotheke("Berolina-Apotheke","Rosenthaler Straße 46 - 47", "Ruf: 2 82 78 76");
//F
Apotheken[5][0] = new Apotheke("Germania-Apotheke","Weinbergsweg 1", "Ruf: 44 34 14 91");
Apotheken[5][1] = new Apotheke("Flamingo-Apotheke","Schillingstraße 12", "Ruf: 2 49 52 13");
//G
Apotheken[6][0] = new Apotheke("Heinrich-Klaproth-Apotheke","Leipziger Straße 57 - 58", "Ruf: 2 08 25 24");
Apotheken[6][1] = new Apotheke("Monbijou-Apotheke","Oranienburger Straße 69", "Ruf: 2 83 29 62");
//H
Apotheken[7][0] = new Apotheke("Aschenbachs Apotheke","Friedrichstraße 142", "Ruf: 20 45 51 00");
Apotheken[7][1] = new Apotheke("Sophien-Apotheke","Invalidenstraße 161", "Ruf: 28 59 91 73");
//J
Apotheken[8][0] = new Apotheke("City-Apotheke","Berolinastraße 7", "Ruf: 2 42 47 76");
Apotheken[8][1] = new Apotheke("Apotheke an der Charité","Luisenstraße 49", "Ruf: 28 39 00 48");
//K
Apotheken[9][0] = new Apotheke("Neptun-Apotheke im S-Bahnhof Alexanderplatz","Dircksenstraße 2", "Ruf: 24 08 54 43");
Apotheken[9][1] = new Apotheke("Friedrichstadt-Apotheke","Glinkastraße 4", "Ruf: 20 45 28 20");
//L
Apotheken[10][0] = new Apotheke("Panorama-Apotheke","Panoramastraße 1", "Ruf: 24 72 07 07");
Apotheken[10][1] = new Apotheke("Zions-Apotheke","Brunnenstraße 27", "Ruf: 4 49 21 43");
//M
Apotheken[11][0] = new Apotheke("Sanimedius-Apotheke","Kastanienallee 38", "Ruf: 4 49 02 44");
Apotheken[11][1] = new Apotheke("Münz-Apotheke","Münzstraße 5", "Ruf: 2 41 10 83");
//N
Apotheken[12][0] = new Apotheke("Robert-Koch-Apotheke","Karl-Marx-Allee 101", "Ruf: 4 27 17 17");
Apotheken[12][1] = new Apotheke("Rathaus-Apotheke Kreuzberg","Grossbeerenstraße 26", "Ruf: 2 15 80 84");
//O
Apotheken[13][0] = new Apotheke("Merlin-Apotheke","Weydingerstraße 18", "Ruf: 24 72 03 88");
Apotheken[13][1] = new Apotheke("Pluspunkt-Apotheke 1224","Friedrichstraße 60", "Ruf: 20 16 61 73");
//P
Apotheken[14][0] = new Apotheke("Adonis-Apotheke","Anklamer Straße 39 - 40", "Ruf: 44 35 88 88");
Apotheken[14][1] = new Apotheke("Nemrut-Apotheke","Solmsstraße 35", "Ruf: 6 91 58 68");
//R
Apotheken[15][0] = new Apotheke("Apotheke zum Schwan","Oranienstraße 64", "Ruf: 6 14 70 66");
Apotheken[15][1] = new Apotheke("Humbold-Apotheke","Chausseestraße 1", "Ruf: 2 82 87 90");
//S
Apotheken[16][0] = new Apotheke("Leipziger Apotheke","Leipziger Straße 43", "Ruf: 2 04 30 31");
Apotheken[16][1] = new Apotheke("Castello-Apotheke","Landsberger Allee 171", "Ruf: 97 60 33 31");

Zyklus=new Array(0,1);
Index=0;
Schalter=true;
Interval=0;
Uhrzeit="";
Uhrzeit2="";

function InitApp(){
        InitZeit=new Date(1999,9,6,0,0,0); //Initialisierungsdatum = 6.9.1999(11.9.1999) 0 Uhr //Y= oben
        InitTag=Math.floor(InitZeit.getTime()/86400000); //Tage seit dem 1.1.1970 ermitteln
        StartZeit=new Date(); //Startdatum ermitteln
        StartTag=Math.floor(StartZeit.getTime()/86400000); //Tage seit dem 1.1.1970 ermitteln
        Heute=StartTag - InitTag - 1; //Wieviel Tage sind seit dem Initialisierungsdatum vergangen
        ZIndex=Math.floor(Heute/17)%2; //Welcher Zyklus (Nacht/Spaet) ist dran 0=y/x; 1=x/y
        if(ZIndex){
                ZyklusWechsel();
        }
        Index=Heute%17; //Index der aktuellen Apotheke ermitteln
        Std=StartZeit.getHours(); //Stundenzahl ermitteln
        
        if(Std <= 9){                    //Wenn es vor 9 Uhr ist
                Index--;                        //Apotheken von gestern anzeigen
                if(Index<0){            //Wenn heute die erste Apotheke des neuen Zyklus dran ist,
                        HeuteIndex=16;  //Zyklus und Index zur&#65533;cksetzen
                        ZyklusWechsel();
                }
                Schalter=true;          
        }
        Interval01=window.setInterval("IncIndex()",1000); //Wiederholung starten
        Print(); //Notdienste schreiben
}

function ZyklusWechsel(){
                Zyklus[0]^=1;
                Zyklus[1]^=1;
}

function IncIndex(){
         Jetzt=new Date();
        WoTag=Jetzt.getDay();
        Tag=Jetzt.getDate();
        Monat=Jetzt.getMonth();
        Jahr=Jetzt.getYear();
        Std=Jetzt.getHours();
      if(Std==22 && document.getElementById("SpaetName").className=="TextWeissNormalN1"){
              document.getElementById("SpaetName").className = "TextGrauNormalN1";
              document.getElementById("SpaetStrasse").className = "TextGrauNormal2";
              document.getElementById("SpaetRuf").className = "TextGrauNormal2";     
   
   
       }
        Minuten=Jetzt.getMinutes();
        Sek=Jetzt.getSeconds();
        if(Tag<= 9)Uhrzeit="0"+Tag;
        else Uhrzeit=Tag;
        if (Monat>5) Uhrzeit=Uhrzeit+". "+Monate[Monat]+" "
        else Uhrzeit=Uhrzeit+". "+Monate[Monat]+" "
        if(Jahr=="99")Uhrzeit=Uhrzeit+"1999";
        else Uhrzeit=Uhrzeit+Jahr;
        if(Schalter && Std == 9){
                Schalter=false;
                Index++;
                if(Index > 16){
                        Index=0;
                        ZyklusWechsel();
                }
                Print();
        }
        d = new Date(); 
        Uhrzeit2=d.getDate()+". "+Monate[d.getMonth()]+" "+d.getFullYear();
        document.getElementById("Datum").innerHTML= Uhrzeit2;
 }
        
function Print(){
  Jetzt=new Date();
        document.getElementById("SpaetName").innerHTML=Apotheken[Index][Zyklus[1]].Name;
        document.getElementById("NachtName").innerHTML=Apotheken[Index][Zyklus[0]].Name;
        document.getElementById("SpaetStrasse").innerHTML=Apotheken[Index][Zyklus[1]].Strasse;
        document.getElementById("NachtStrasse").innerHTML=Apotheken[Index][Zyklus[0]].Strasse;
        document.getElementById("SpaetRuf").innerHTML=Apotheken[Index][Zyklus[1]].Telefon;
        document.getElementById("NachtRuf").innerHTML=Apotheken[Index][Zyklus[0]].Telefon;

//      Std=Jetzt.getHours();
//      if(Std<9|Std>21){
//              document.all.SpaetName.className = "TextGrauNormalN1";
//              document.all.SpaetStrasse.className = "TextGrauNormal2";
//              document.all.SpaetRuf.className = "TextGrauNormal2";
//    }

}
// -->
