var Status_Daten= new Array();

// 0 = Start-Seite
// 1 = Header-Picture-Viewer
// 2 = Firmen-Profil
// 3 = Anfragen
// 4 = Impressum
// 5 = Mail-Senden
// 6 = Kontakt-Daten
// 10 = Projekt-Verwaltung

Status_Daten[0]="Herzlich Willkommen auf der Web-Präsenz von CM-Immobilien";
Status_Daten[1]="www.cm-immobilien.info - Header-Picture-Viewer";
Status_Daten[2]="www.cm-immobilien.info - Firmen-Konzeption - Firmen-Profil";
Status_Daten[3]="www.cm-immobilien.info - Stellen Sie uns eine Anfrage";
Status_Daten[4]="www.cm-immobilien.info - Unser Impressum";
Status_Daten[5]="www.cm-immobilien.info - Schreiben Sie uns eine E-Mail";
Status_Daten[6]="www.cm-immobilien.info - Unsere Kontakt-Daten";
Status_Daten[10]="www.cm-immobilien.info - Projekte-Verwaltung";

var ie4=document.all;
var ie5=document.getElementById&&document.all;
var ie6=document.getElementById&&document.all&&(navigator.appVersion.indexOf("MSIE 6.")!=-1);
var ie7=document.getElementById&&document.all&&(navigator.appVersion.indexOf("MSIE 7.")!=-1);
var ns4=document.layers;
var ns6=document.getElementById&&!document.all;
var ns7=document.getElementById&&!document.all;
var Browser_Typ;
var Rechner_Typ;
var Unix;

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------//
var MM_contentVersion=9;
var plugin=(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin:0;

   if (plugin) {

      var words = navigator.plugins["Shockwave Flash"].description.split(" ");

      for (var i = 0; i < words.length; ++i) {

         if (isNaN(parseInt(words[i])))

            continue;
            var MM_PluginVersion=words[i]; 
         }

      var MM_FlashCanPlay=MM_PluginVersion>=MM_contentVersion;
   }

   else 

   if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {

      document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
      document.write('on error resume next \n');
      document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
      document.write('</SCR' + 'IPT\> \n');
   }
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function checkBrowser(){

   this.ver=navigator.appVersion
   this.agent=navigator.userAgent
   this.dom=document.getElementById?1:0
   this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
   this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
   this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
   this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
   this.ie=this.ie4||this.ie5||this.ie6
   this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
   this.ns7=(this.dom && parseInt(this.ver) >= 6) ?1:0;
   this.ns4=(document.layers && !this.dom)?1:0;
   this.Explorer=(this.ie7||this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.ns7||this.opera5)
   return this
}

Explorer=new checkBrowser()
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function Meldung_Anzeigen() {

   alert("Diese Web-Site wurde für den Internet-Explorer 6+ und Netscape 7+ optimiert ! \n \n Sie benutzen : \n \n Browser-Typ"+
         " : "+Browser_Typ+"\n Rechner-Typ : "+Rechner_Typ+"\n \n Es kann bei Ihrem Browser-Typ zu Darstellungsfehlern kommen!\n \n"+
         "Aktuelle Browser finden Sie unter :\n \n"+
      		 "www.microsoft.com\n"+
      		 "www.netscape.de\n \n"+
      		 "Bei Fragen wenden Sie sich bitte an den Webmaster. \n \n");
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function Browser_Check() {

   isMac=(navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
   isPC=(navigator.appVersion.indexOf("Windows")!=-1) ? true : false;
   isUnix=(navigator.appVersion.indexOf("Unix")!=-1) ? true : false;
   
   if (isMac) {Rechner_Typ="Macintosh";}

   if (isPC) {Rechner_Typ="Personal-Computer";}

   if (isUnix) {Unix="Vorhanden";}

   if (ns4) {Browser_Typ="Netscape 4"; Meldung_Anzeigen();}

   if (ns6) {Browser_Typ="Netscape 6";}

   if (ns7) {Browser_Typ="Netscape 7";}

   if (ie4 && !ie5 && !ie6  && !ie7) {Browser_Typ="Internet Explorer 4"; Meldung_Anzeigen();}

   if (ie5) {Browser_Typ="Internet Explorer 5";}

   if (ie6) {Browser_Typ="Internet Explorer 6";}

   if (ie7) {Browser_Typ="Internet Explorer 7";}

   if (!ie4 && !ie5 && !ie6 && !ie7 && !ns4 && !ns6 && !ns7) {Browser_Typ="Randgruppen-Browser"; Meldung_Anzeigen ();}
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function Vollbild() {

   var BrowserName=navigator.appName;
   var BrowserVersion=navigator.appVersion;
   var VersionShort=BrowserVersion.substr(0, 1);

   if(frames) {if(top.frames.length > 0) top.location.href=self.location} else {close();}
   
   var hight=screen.availHeight;
   var wide=screen.availWidth;
   
   if (VersionShort>3) {

      if (BrowserName=="Netscape") {

         window.outerHeight=hight;
         window.outerWidth=wide;
      } else if (BrowserName=="Microsoft Internet Explorer") {window.resizeTo(wide, hight);}
   
   window.moveTo(0, 0);
   }
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function Init_Formular(Formular_Name, Formular_Feld) {

   self.focus();
   document.forms[Formular_Name].elements[Formular_Feld].focus();
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function Do_Nothing() {

   return;
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function Change_Status(Wert) {

   parent.window.document.title=Status_Daten[Wert];
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function Fenster_Positionierung(X,Y) {

   window.scrollTo(X,Y);
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function Zeige_Ebene(div,nest) {

   obj=Explorer.dom?document.getElementById(div).style:
   Explorer.ie4?document.all[div].style:
   Explorer.ns4?nest?document[nest].document[div]:document[div]:0;
   obj.visibility='visible';
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function Verstecke_Ebene(div,nest) {

   obj=Explorer.dom?document.getElementById(div).style:
   Explorer.ie4?document.all[div].style:
   Explorer.ns4?nest?document[nest].document[div]:document[div]:0;
   obj.visibility='hidden';
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function Grund_Ebene_Positionierung(div, nest, X_Wert, Y_Wert) {

   var Links;

   Links=(screen.width) ? (screen.width-X_Wert)/2:0;
   Links-=12;
   obj=Explorer.dom?document.getElementById(div).style:
   Explorer.ie4?document.all[div].style:
   Explorer.ns4?nest?document[nest].document[div]:document[div]:0;
   obj.left=[Links]+"px";
   obj.top=[Y_Wert]+"px";

   Zeige_Ebene(div,nest); //Die positionierte Ebene anzeigen, da in CSS visible = false
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function Zeige_Datum_Uhrzeit() {

   //Datum und Uhrzeitanzeige anzeigen
   Zeige_Ebene('DatumUhrzeitEbene');

  // Das Datum_Uhrzeits_Formular anzeigen
   objekt=Explorer.dom?document.getElementsByName('DateAnzeige')[0].style:
   Explorer.ie4?document.all['DateAnzeige'].style:
   Explorer.ns4?nest?document[nest].document['DateAnzeige']:document['DatumUhrzeitForm']:0;
   objekt.visibility='visible';
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function Create_Projekt_Navigation(Navigations_Uebergabe_1, Navigations_Uebergabe_2, Navigations_Uebergabe_3, Navigations_Uebergabe_4, Navigations_Uebergabe_5, Navigations_Uebergabe_6, Navigations_Uebergabe_7) {

//------------------------------------------------------------------------------------------//
//Hinweise

   //Parameter-Übergaben
   //1- Haupt(0)- oder Unter(1) - Menue
   //2- Anzahl der Einträge
   //3- Bild-Text-Bezeichnungen
   //4- Bild-Grafik-Dateiangaben mit vollständigem Pfad
   //5- alle Satz-Zeiger des Datenbank-Eintrags
   //6- Aktuell gewählter Haupt-Menue-Punkt
   //7- Aktuell gewählter Unter-Menue-Punkt
//Hinweise-Ende
//------------------------------------------------------------------------------------------//

   if (MM_FlashCanPlay) {

      document.getElementById('ProjektNavigationsEbene').innerHTML='<div id="FlashEbene_1" style="position : absolute; left : 0px; top : 0px; width : 960px; height:170px; z-index : 5">'+
                                                                   '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="960px" height="170px" hspace="0" vspace="0" align="absmiddle">'+
                                                                   '<param name="allowScriptAccess" value="sameDomain" />'+
                                                                   '<param name="movie" value="projekt_navigation/projekt_navigation_01.swf?Navigations_Uebergabe_Daten_1='+Navigations_Uebergabe_1+'&Navigations_Uebergabe_Daten_2='+Navigations_Uebergabe_2+'&Navigations_Uebergabe_Daten_3='+Navigations_Uebergabe_3+'&Navigations_Uebergabe_Daten_4='+Navigations_Uebergabe_4+'&Navigations_Uebergabe_Daten_5='+Navigations_Uebergabe_5+'&Navigations_Uebergabe_Daten_6='+Navigations_Uebergabe_6+'&Navigations_Uebergabe_Daten_7='+Navigations_Uebergabe_7+'">'+
                                                                   '<param name="quality" value="high"><param name="menu" value="false"><param name="scale" value="exactfit"><param name="wmode" value="transparent"><param name="loop" value="false">'+
                                                                   '<embed src="projekt_navigation/projekt_navigation_01.swf?Navigations_Uebergabe_Daten_1='+Navigations_Uebergabe_1+'&Navigations_Uebergabe_Daten_2='+Navigations_Uebergabe_2+'&Navigations_Uebergabe_Daten_3='+Navigations_Uebergabe_3+'&Navigations_Uebergabe_Daten_4='+Navigations_Uebergabe_4+'&Navigations_Uebergabe_Daten_5='+Navigations_Uebergabe_5+'&Navigations_Uebergabe_Daten_6='+Navigations_Uebergabe_6+'&Navigations_Uebergabe_Daten_7='+Navigations_Uebergabe_7+'" width="960px" height="170px" hspace="0" vspace="0" align="absmiddle" menu="false" allowScriptAccess="sameDomain" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" scale="exactfit" wmode="transparent" loop="false"></embed></object>'+
                                                                   '</div>';

   } else {document.getElementById('ProjektNavigationsEbene').innerHTML='<div id="FlashEbene_1" style="position : absolute; left : 0px; top : 0px; width : 960px; height:170px; z-index : 5">'+
                                                                        '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="960px" height="170px" hspace="0" vspace="0" align="absmiddle">'+
                                                                        '<param name="allowScriptAccess" value="sameDomain" />'+
                                                                        '<param name="movie" value="projekt_navigation/projekt_navigation_01.swf?Navigations_Uebergabe_Daten_1='+Navigations_Uebergabe_1+'&Navigations_Uebergabe_Daten_2='+Navigations_Uebergabe_2+'&Navigations_Uebergabe_Daten_3='+Navigations_Uebergabe_3+'&Navigations_Uebergabe_Daten_4='+Navigations_Uebergabe_4+'&Navigations_Uebergabe_Daten_5='+Navigations_Uebergabe_5+'&Navigations_Uebergabe_Daten_6='+Navigations_Uebergabe_6+'&Navigations_Uebergabe_Daten_7='+Navigations_Uebergabe_7+'">'+
                                                                        '<param name="quality" value="high"><param name="menu" value="false"><param name="scale" value="exactfit"><param name="wmode" value="transparent"><param name="loop" value="false">'+
                                                                        '<embed src="projekt_navigation/projekt_navigation_01.swf?Navigations_Uebergabe_Daten_1='+Navigations_Uebergabe_1+'&Navigations_Uebergabe_Daten_2='+Navigations_Uebergabe_2+'&Navigations_Uebergabe_Daten_3='+Navigations_Uebergabe_3+'&Navigations_Uebergabe_Daten_4='+Navigations_Uebergabe_4+'&Navigations_Uebergabe_Daten_5='+Navigations_Uebergabe_5+'&Navigations_Uebergabe_Daten_6='+Navigations_Uebergabe_6+'&Navigations_Uebergabe_Daten_7='+Navigations_Uebergabe_7+'" width="960px" height="170px" hspace="0" vspace="0" align="absmiddle" menu="false" allowScriptAccess="sameDomain" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" scale="exactfit" wmode="transparent" loop="false"></embed></object>'+
                                                                        '</div>';
   }
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------//
//Main-Init-Funktion
function Main_Init(Aktuelle_Page, Show_Navi, Navigations_Uebergabe_1, Navigations_Uebergabe_2, Navigations_Uebergabe_3, Navigations_Uebergabe_4, Navigations_Uebergabe_5, Navigations_Uebergabe_6, Navigations_Uebergabe_7) {

   Grund_Ebene_Positionierung('HauptAnker','','980','1'); // Den HauptAnker zentrieren je nach Auflösung des Clients und anzeigen
   Grund_Ebene_Positionierung('HauptAnkerSchatten','','980','1'); // Den HauptAnker-Schatten zentrieren je nach Auflösung des Clients und anzeigen

   //Die Status-Anzeige anhand der aktuellen Page-Nummer ändern
   Change_Status(Aktuelle_Page);

   //Haupt-Header-Informations anzeigen
   Zeige_Ebene('HeaderInformationsEbene');

   //Header-Grafik-Ebene anzeigen
   Zeige_Ebene('HeaderGrafikEbene01');

   //Die Schnell-Start-Navigations-Ebene anzeigen //Befindet sich in der Header-Navigations-Ebene
   Zeige_Ebene('ShortCutNavigationsEbene');

   //Datum- und Uhrzeit anzeigen
   Zeige_Datum_Uhrzeit();

   //Haupt-Footer-Informations anzeigen
   Zeige_Ebene('FooterInformationsEbene');

   //Counter-Ebene anzeigen
   Zeige_Ebene('CounterEbene');

   //Die Untere Schnell-Start-Navigations-Ebene anzeigen //Befindet sich in der Footer-Anzeige-Ebene
   Zeige_Ebene('ShortCutNavigationsEbene_Unten');

   //Die ZeitmessEbene anzeigen
   Zeige_Ebene('AnzeigeEbeneZeit');

   //Impressum-Ebene anzeigen
   Zeige_Ebene('ImpressumEbene');

   //Bei Aktuelle_Page=10 (Projekt-Verwaltung) zeige Projekt-Navigations-Ebene und erzeuge Flash-Navigations-Content, anhand der Übergabe-Variable Show_Navi
   if (Show_Navi!="0") {

      //Flash-Projekt-Navigation in Ebene erstellen
      Create_Projekt_Navigation(Navigations_Uebergabe_1, Navigations_Uebergabe_2, Navigations_Uebergabe_3, Navigations_Uebergabe_4, Navigations_Uebergabe_5, Navigations_Uebergabe_6, Navigations_Uebergabe_7);

      //Projekt-Navigations-Ebene anzeigen
      Zeige_Ebene('ProjektNavigationsEbene');

   } else {}

   //Die Loader-Hinweis-Ebene verstecken
   Verstecke_Ebene('LoaderInfoEbene');
}
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------//
