var text,adress,titel,maxDatum,minDatum;
maxDatum=309;
minDatum=9;
text="";
monat=1;
jahr=1;
datum=jahr*100+monat;


        Monatsname = new Array
        ("Januar","Februar","M&auml;rz","April","Mai","Juni","Juli",
        "August","September","Oktober","November","Dezember");

if(document.images)
 {var button=new Image();
 var button1=new Image();
 var feilbuttonz=new Image();
 var feilbuttonv=new Image();
 var feilbuttonaniz=new Image();
 var feilbuttonaniv=new Image();
 button.src="images/button1.gif";
 button1.src="images/buttonani.gif";
 feilbuttonz.src="images/feilbuttonz.gif";
 feilbuttonv.src="images/feilbuttonv.gif";
 feilbuttonaniz.src="images/feilbuttonaniz.gif";
 feilbuttonaniv.src="images/feilbuttonaniv.gif";}

function actframe()
{
switch (top.HAUPT.location.href.split("/")[top.HAUPT.location.href.split("/").length-1])
       {
       case"tabelle.htm":
            WriteHead(top.TITELD.document);
            WriteTitle(top.TITELD.document,GetTitle(),260,2,14);
            Schaltflaeche(top.TITELD.document,0,0,120,32,"Fahrer","Fahrerwertung","Die aktuelle Fahrerwertung",32,-26,"./fahrer.htm");
            Pfeil(top.TITELD.document,"z",120,0,120,32,"Back","Zur&uuml;ck","Bl&auml;ttert einen Monat zur&uuml;ck",32,-28,Zurueck());
            WriteEnd(top.TITELD.document);
       break;

       case"news.htm":
            WriteHead(top.TITELD.document);
            WriteTitle(top.TITELD.document,"Aktuelles von der Bahn",140,2,14);
            WriteEnd(top.TITELD.document);
       break;

       case"start.htm":
            WriteHead(top.TITELD.document);
            WriteTitle(top.TITELD.document,"Herzlich willkommen auf den Internetseiten der Löberitzer Kartbahnen...." ,2,2,14);
            WriteEnd(top.TITELD.document);
       break;

       case"offen.htm":
            WriteHead(top.TITELD.document);
            WriteTitle(top.TITELD.document,"Und so haben wir für Sie geöffnet...",140,2,14);
            WriteEnd(top.TITELD.document);
       break;

       case"preise.htm":
            WriteHead(top.TITELD.document);
            WriteTitle(top.TITELD.document,"Unsere Preisliste kann sich sehen lassen...",140,2,14);
            WriteEnd(top.TITELD.document);
       break;

       case"reserv.htm":
            WriteHead(top.TITELD.document);
            WriteTitle(top.TITELD.document,"Reservierungsformular",140,2,14);
            WriteEnd(top.TITELD.document);
       break;

       case"fahrer.htm":
            WriteHead(top.TITELD.document);
            WriteTitle(top.TITELD.document,"Aktuelle Fahrerwertung",140,2,14);
            Schaltflaeche(top.TITELD.document,0,0,120,32,"back","Zur&uuml;ck Top 20","Zur&uuml;ck zu den Top 20",32,-26,"./tabelle.htm");
            WriteEnd(top.TITELD.document);
       break;

default:
 WriteHead(top.TITELD.document);
 WriteTitle(top.TITELD.document,GetTitle(),260,5,14);
 Schaltflaeche(top.TITELD.document,0,0,120,32,"Fahrer","Fahrerwertung","Die aktuelle Fahrerwertung",32,-26,"fahrer.htm");
 if(datum > minDatum)Pfeil(top.TITELD.document,"z",130,0,120,32,"Back","Zur&uuml;ck", "Bl&auml;ttert einen Monat zur&uuml;ck",32,-28,Zurueck());
  if(text < "a.htm")Pfeil(top.TITELD.document,"v",550,0,120,32,"Forw","Vorw&auml;rts", "Bl&auml;ttert einen Monat weiter",32,-28,Vor());
 WriteEnd(top.TITELD.document);
break;
       }
}

function Zurueck()
{

   text= top.HAUPT.location.href.split("/")[top.HAUPT.location.href.split("/").length-1];
        if(text >="a.htm")
                {
                jahr=Math.floor(maxDatum/100);
                monat=maxDatum-jahr*100;
                }else
                {
                datum=Number(String(text).split(".")[0]);
                jahr=Math.floor(datum/100);
                monat=datum-jahr*100;
                }
   monat=(monat-1 == 0)?12:monat-1;
   jahr=(monat==12)?jahr-1:jahr;
   datum=jahr*100+monat;
   return String(datum)+".htm";

}

function Vor()
{

   text= top.HAUPT.location.href.split("/")[top.HAUPT.location.href.split("/").length-1];
        if(text < "a.htm")
                {
                datum=Number(String(text).split(".")[0]);
                jahr=Math.floor(datum/100);
                monat=datum-jahr*100;
                }
   monat=(monat+1 == 13)?1:monat+1;
   jahr=(monat==1)?jahr+1:jahr;
   datum=jahr*100+monat;
   if(datum == maxDatum)return "tabelle.htm";else return String(datum)+".htm";

}

function Schaltflaeche (Objekt,Ox,Oy,Ob,Oh,Objname,Text,Alttext,Tx,Ty,Referenz) {
        with(Objekt){
        write("<div style=\"position:absolute;left:");
        write(Ox);
        write("px;top:");
        write(Oy);
        write("px;\">");
        write("<a href=\"");
        write(Referenz);
        write("\" style=\"text-decoration:none;\" target=\"HAUPT\" onMouseOver=\"document.");
        write(Objname);
        write(".src=button1.src\" onMouseout=\"document.");
        write(Objname);
        write(".src=button.src\">");
        write("<img src=\"images/button1.gif\" width=\"");
        write(Ob);
        write("\" height=\"");
        write(Oh);
        write("\" border=\"0\" alt=\"");
        write(Alttext);
        write("\" name=\"");
        write(Objname);
        write("\">");
        write("<div style=\"position:relative;left:");
        write(Tx);
        write("px;top:");
        write(Ty);
        write("px;\">");
        write(Text);
        write("</div></a></div>");
        }

}


function WriteHead (Objekt) {
with(Objekt) /* StyleSheets und JavaScript-Datei einbinden */
          {
          close();
          open();
 writeln("<html><head><title>FrameInhalt TITELD</title>");
 writeln("<link rel=\"stylesheet\" href=\"universal.css\" type=\"text/css\">");
 writeln("<script language=\"JavaScript\" src=\"funktionen.js\" type=\"text/javascript\"></script>");
 writeln("<noscript>Ihr Browser unterstützt derzeit kein JavaScript! Schade!</noscript>");
 writeln("</head><body bgcolor=#3060f9>");
          }

}
function WriteEnd(Objekt) {
with(Objekt) /* StyleSheets und JavaScript-Datei einbinden */
          {
          write("</body></html>");
          close();
          }

}
function WriteTitle(Objekt,titel,Links,Oben,Size) {
with(Objekt) /* StyleSheets und JavaScript-Datei einbinden */
          {
          writeln("<span style=\"position:absolute;left:",Links,"px;top:",Oben,"px;font-size:",Size,"pt;font-weight:bold;\">",titel,"</span>");
           }

}

function GetTitle () {
 text=top.HAUPT.location.href.split("/")[top.HAUPT.location.href.split("/").length-1]
        if(text >="a.htm")
                {
                jahr=Math.floor(maxDatum/100);
                monat=maxDatum-jahr*100;
                datum=maxDatum;
                titel="Top 20 Aktuell";
                }else
                {
                datum=Number(String(text).split(".")[0]);
                jahr=Math.floor(datum/100);
                monat=datum-jahr*100;
                titel="Top 20 "+ Monatsname[monat-1]+" "+String(2000+jahr);
                }
return titel;
}
function Pfeil (Objekt,Dir,Ox,Oy,Ob,Oh,Objname,Text,Alttext,Tx,Ty,Referenz) {
        with(Objekt){
        writeln("<div style=\"position:absolute;left:",Ox,"px;top:",Oy,"px;\">");
        writeln("<a href=\"",Referenz);
        write("\"style=\"text-decoration:none;\" target=\"HAUPT\" onMouseOver=\"document.");
        writeln(Objname,".src=feilbuttonani",Dir,".src \"onMouseout=\"document.",Objname,".src=feilbutton",Dir,".src\">");
        write("<img src=\"images/feilbutton",Dir,".gif\" width=\"",Ob,"\" height=\"",Oh);
        writeln("\" border=\"0\" alt=\"",Alttext,"\" name=\"",Objname,"\">");
        writeln("<div style=\"position:relative;left:",Tx,"px;top:",Ty,"px;\">",Text,"</div></a></div>");
        }

}
