// schlabe.js
// einbindung in fs.html
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// Udo Reinsch 2004
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// globale Variablen
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

var acThema;       // das aktuelle thema
var acPos;         // die aktuelle position innerhalb des themas
var bilder         // das verzeichnis, in dem sich die bilder befinden
var countFuss= 0;                    // zähler fuss-frame
var countMenue=0;                    // zähler menue-frame
var countTop=0;                      // zähler top-script
// navi-object definieren
function navi_obj(name) {
         this.name = name;
         this.bild = [];
}
// themen-array definieren
var thema = new Array();
    thema[0] = new navi_obj('katalog');
       thema[0].bild[0] = "kat_zyanrando.jpg";
       thema[0].bild[1] = "kat_pool.jpg";
       thema[0].bild[2] = "kat_filmset.jpg";
       thema[0].bild[3] = "kat_striewe.jpg";
       thema[0].bild[4] = "kat_notnow1.jpg";
       thema[0].bild[5] = "kat_notnow2.jpg";
    thema[1] = new navi_obj('flyer');
       thema[1].bild[0] = "fly_betriebsausflug.jpg";
       thema[1].bild[1] = "fly_geb.ticket.jpg";
       thema[1].bild[2] = "fly_blackout.jpg";
       thema[1].bild[3] = "fly_politposter.jpg";
       thema[1].bild[4] = "fly_theaterabo.jpg";
       thema[1].bild[5] = "fly_transit.jpg";
    thema[2] = new navi_obj('logo');
       thema[2].bild[0] = "ga_pluto.jpg";
       thema[2].bild[1] = "ga_juw+rehahn.jpg";
       thema[2].bild[2] = "ga_logos.jpg";
       thema[2].bild[3] = "ga_cooldiva.jpg";
       thema[2].bild[4] = "ga_buergerforum_ga.jpg";
       thema[2].bild[5] = "ga_buergerforum_poster.jpg";
       thema[2].bild[6] = "ga_tanztransit.jpg";
    thema[3] = new navi_obj('verpackung');
       thema[3].bild[0] = "pack_pflaster.gif";
       thema[3].bild[1] = "pack_mehlflocken.gif";
       thema[3].bild[2] = "pack_cheesecake.gif";
       thema[3].bild[3] = "pack_russenwaesche.jpg";
       thema[3].bild[4] = "pack_cd_black.jpg";
       thema[3].bild[5] = "pack_cd_white.jpg";
    thema[4] = new navi_obj('illustration');
       thema[4].bild[0] = "illu_ackerkraeuter.jpg";
       thema[4].bild[1] = "illu_bollos.jpg";
       thema[4].bild[2] = "illu_olds.jpg";
       thema[4].bild[3] = "illu_suse+guenter.gif";
       thema[4].bild[4] = "illu_coer+dreier.jpg";
       thema[4].bild[5] = "illu_stempel.jpg";
    thema[5] = new navi_obj('webdesign');
       thema[5].bild[0] = "web_labor.gif";
       thema[5].bild[1] = "web_elementarium.jpg";
       thema[5].bild[2] = "web_buergerforum.jpg";
       thema[5].bild[3] = "web_gin.jpg";
    thema[6] = new navi_obj('ausstellung');
       thema[6].bild[0] = "burg_intro.jpg";
       thema[6].bild[1] = "burg_vitrinedetails.jpg";
       thema[6].bild[2] = "burg_wand.jpg";
       thema[6].bild[3] = "burg_layout.jpg";
       thema[6].bild[4] = "kamenz_vitrine.jpg";
       thema[6].bild[5] = "kamenz_vitrinedetail.jpg";
    thema[7] = new navi_obj('fotografie');
       thema[7].bild[0] = "foto_trees.jpg";
       thema[7].bild[1] = "foto_london.jpg";
       thema[7].bild[2] = "foto_roterblock.jpg";
       thema[7].bild[3] = "foto_suburbs.jpg";
       thema[7].bild[4] = "foto_werner.jpg";

acThema = "katalog";    // standartthema
acPos =1;
bilder = "bilder/";

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//Funktionen
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// wechselt das aktuelle thema
function chThema(nThema) {
var anzahl;

    //alte menue-anzeige zurücksetzen
    if(acThema != nThema) {
      top.frames['menue'].document.images[acThema].src="grafx/"+acThema+"_deac.gif";
    }

    acThema=nThema;                  // als aktuelles thema setzen
    anzahl=gibAnzahlBilder();        // wieviel bilder hat das aktuelle(neue) thema

    if (top.frames['menue'].document.images[acThema]) {
       countMenue=0;
       top.frames['menue'].document.images[acThema].src="grafx/"+acThema+"_ac.gif";
    }
    else   {                                      //  header-grafik noch nicht initialisiert
         countMenue = countMenue+1;
         if(countFuss < 150) {
            window.setTimeout("chThema('"+nThema+"')",250);}
    }
    if (top.frames['fuss'].document.images[anzahl]) {
       countFuss=0;
       top.frames['fuss'].document.images['anzahl'].src="grafx/"+anzahl+".gif";    //anzahl bilder ausgeben
    }
    else   {                                      //  header-grafik noch nicht initialisiert
         countFuss = countFuss+1;
         if(countFuss < 150) {
            window.setTimeout("chThema('"+nThema+"')",250);}
    }

    status=acThema;
    chPosition(1);
}
//------------------------------------------------------------------------------------------------------
// geht zur position innerhalb des themas
function chPosition(pos)  {
     for (i = 0; i < thema.length; i++) {   // aktuelle thema suchen
         if (acThema==thema[i].name) {        // gefunden
            // bild auswechseln
            top.frames['buehne'].document.images['bild'].src=bilder+thema[i].bild[pos-1];
            acPos = pos;
            top.frames['fuss'].document.images['position'].src="grafx/"+pos+".gif";    //position ausgeben

            if (pos==1)                                                                           //back-navi anpassen
               top.frames['fuss'].document.images['back'].src="grafx/back_deac.gif";
            else
                top.frames['fuss'].document.images['back'].src="grafx/back_ac.gif";
            if (pos==gibAnzahlBilder())                                                           //vor-navi anpassen
               top.frames['fuss'].document.images['vor'].src="grafx/vor_deac.gif";
            else
                top.frames['fuss'].document.images['vor'].src="grafx/vor_ac.gif";
             break;
         }
     }
}
//------------------------------------------------------------------------------------------------------
// geht vor oder zurück
function naviPosition(step)  {
    if ((step==-1 && acPos>1)||(step==1 && acPos<gibAnzahlBilder()))  {
       chPosition(acPos+step);
    }
}
//------------------------------------------------------------------------------------------------------
// gibt die anzahl der bilder des aktuellen themas zurück
function gibAnzahlBilder()  {
var anzahl;
     for (i = 0; i < thema.length; i++) {   // aktuelle thema suchen
         if (acThema==thema[i].name) {        // gefunden
            anzahl=thema[i].bild.length;
            return anzahl;
             break;
         }
     }
}
//------------------------------------------------------------------------------------------------------
// prüft, ob die seite in einem fremden frameset steckt und lädt ggf. die seite einzel auf
function checkFrame()    {
 if(top!=self)
  top.location=self.location;
}
//------------------------------------------------------------------------------------------------------
function popIt(seite,w,h,scroll) {
var wpar="'locationbar=no,menubar=no,status=no,resizable=yes,dependent=yes,screenX=0,screenY=0,left=0,top=0'";
 if (scroll==true) {
    wpar += ",scrollbars=yes";
 }
 wpar += ",width="+w+",height="+h
     fenster=window.open(seite,"Pop",wpar);
       if (document.all)
          fenster.moveTo(0,0);

}
//------------------------------------------------------------------------------------------------------
