
/*-----------------------------------------------------------------

  JavaScript Datei für die AUC-Homepage
  Autor:           Kay Koch
  letzte Änderung:  26-11-01
------------------------------------------------------------------*/

// 1. Funktion fuer den Zugriff aufs Dokument
<!--
function DivObjDocument(div_id){
    if (!div_id || div_id.length==0) {
       div_obj = document;}
    else {
       if (document.getElementById) {// W3C
          div_obj = document; }
       else if (document.layers) {//Netscape
          div_obj = eval("document."+div_id+".document"); }
       else if (document.all) {//IE
          div_obj = eval("document.all."+div_id+".document");}}
return div_obj;}

// 2. Funktion fuer den Zugriff aufs Style Sheet
function DivObjStyle(div_id){
    if (!div_id || div_id.length==0){
       if (document.getElementById) {
           div_obj = document.style;}
       else if (document.layers){
           div_obj = document;}
       else if (document.all) {
           div_obj = document.all.style;}}
    else {
       if (document.getElementById){
          div_obj = document.getElementById(div_id).style;}
       else if (document.layers) {
          div_obj = eval("document."+div_id);}
       else if (document.all) {
          div_obj = eval("document.all."+div_id+".style");}}

return div_obj;}
// -----------------------------------------------------------------------------------------------

// globale Variablen  ----------------------------------------------------------------------------
var ImageFeld=new Array();
var pageIndex;
if ( (navigator.appName == 'Netscape') && (navigator.appVersion < '5') ){var net = true;}
// -----------------------------------------------------------------------------------------------


// hier wird überprüft, ob das Frameset geladen wurde
function checkFrame(){
         if (top.frames.length==0) {
            Address="/index.html?"+location.pathname+location.search;
            if(document.images) top.location.replace(Address);
             else top.location.href=Address;}}

// hier beginnt der Teil der Hauptbilder ----------------------------------------------------------
function button(dateiname){
         this.aus=new Image();
         this.over=new Image();
         this.aus.src="/bilder/"+dateiname+".jpg" ;
         this.over.src="/bilder/"+dateiname+"_over.jpg";
         return this;}

function laden(index){
         checkFrame();
         if (parent.document) parent.document.title=parent.frame_unten.document.title.toUpperCase();
         loadDiv();
         pulldownSet(index);
         if (index !="0" )schild('hidden');}

function over(name,div){
         if (ImageFeld[name]!=null){
         DivObjDocument(div).images[name].src = ImageFeld[name].over.src;}}

function aus(name,div){
         if (ImageFeld[name]!=null){
         DivObjDocument(div).images[name].src = ImageFeld[name].aus.src;}}
//-------------------------------------------------------------------------------------------------


// hier beginnt der Teil der bewegten Informationen der Hauptbilder -------------------------------
function loadDiv(){
         if(!net){
         DivInfos = new DivPos(0.2,320,"inhaltinfos");
         DivTauchen = new DivPos(0.2,300,"inhalttauchen");
         DivUeberuns = new DivPos(0.4,30,"inhaltueberuns");
         DivVorstand = new DivPos(0.5,380,"inhaltvorstand");
         DivMitglieder = new DivPos(0.6,180,"inhaltmitglieder");
         DivHome = new DivPos(0.7,170,"inhalthome");
         DivSuchen = new DivPos(0.8,170,"inhaltsuchen");
         oldDiv = new DivPos(0,0,"inhalttauchen");
         DivWebinfo = new DivPos(0.2,200,"inhaltwebinfo");
         DivForum = new DivPos(0.5,330,"inhaltforum");
         DivNews = new DivPos(0.2,360,"inhaltaucnews");
         DivVDST = new DivPos(0.5,330,"inhaltvdst");}
}
function DivPos(_xpos,_ypos,_name){
         this.xToXp = myXToXp;
         this.myIntervallName; this.divStylePos;; this.aktPos; this.startPos; this.endPos;
         this.divName = _name; this.endPosWidth = this.xToXp(_xpos);  this.endPosHeight = _ypos;
         this.step = 20;
         this.startPosLeft = 0; this.startPosTop = 0; this.startPosBottom = screen.availHeight-350; this.startPosRight = screen.availWidth-450;
         this.moveTo = myMoveTo; this.move = myMove; this.moveNav = myMoveNav; this.stop = myStop;
         return this;
}







function myXToXp(_xpos){
         if(document.body.offsetWidth)
           _leftPos = document.body.offsetWidth * _xpos;
         else
           _leftPos=window.innerWidth * _xpos;
         return Math.round(_leftPos);
}
function myStop(){
         clearInterval(this.myIntervallName);
         DivObjStyle(this.divName).visibility = "hidden";
}
function myMoveTo(_to){
         if (_to == "random"){
             zufall = Math.round(0.5 + 3.5*Math.random());
         }else if (_to == "navl")
             zufall = 5;
         DivObjStyle(this.divName).top = this.endPosHeight;
         DivObjStyle(this.divName).left = this.endPosWidth;
         this.aktPos = 0;
         switch(zufall){
          case 1:
            this.startPos = this.startPosLeft;
            this.endPos = this.endPosWidth;
            this.divStylePos ="left";
            this.myIntervallName = setInterval("oldDiv.move()",20);
            break;
          case 2:
            this.startPos = this.startPosRight;
            this.endPos = this.endPosWidth
            this.divStylePos ="left";
            this.myIntervallName = setInterval("oldDiv.move()",20);
            break;
          case 3:
            this.startPos = this.startPosTop;
            this.endPos = this.endPosHeight
            this.divStylePos ="top";
            this.myIntervallName = setInterval("oldDiv.move()",20);
            break;
          case 4:
            this.startPos = this.startPosBottom;
            this.endPos = this.endPosHeight
            this.divStylePos ="top";
            this.myIntervallName = setInterval("oldDiv.move()",20);
            break;
          case 5:
            if(document.body.scrollTop!=null){
               this.endPos = document.body.scrollTop+10;
               this.aktPos = document.body.scrollTop-150;}
            else{
               this.endPos = window.pageYOffset+10;
               this.aktPos = window.pageYOffset-150;}
            this.myIntervallName = setInterval("oldDiv.moveNav()",20);
            break;
         }
}
function myMove(){
         DivObjStyle(this.divName).visibility = "visible";
         helpPos = Math.abs(this.startPos - this.aktPos);
         if ( Math.abs(helpPos - this.endPos) >= this.step+1){
           DivObjStyle(this.divName)[this.divStylePos] = helpPos;
           this.aktPos += this.step;
         }else clearInterval(this.myIntervallName);
}
function myMoveNav(){
         DivObjStyle(this.divName).visibility = "visible";
         if ( this.endPos >= this.aktPos){
           DivObjStyle(this.divName).top = this.aktPos;
           this.aktPos += this.step;
         }else clearInterval(this.myIntervallName);
}
function layeraus(){
         if (!net)
          oldDiv.stop()
}

//-------------------------------------------------------------------------------------------------





// hier beginnt die Navigationsleiste  ------------------------------------------------------------
function pulldownSet(index){
         if (parent.frame_oben){
         parent.frame_oben.document.forms.site.auswahl.options[0].text=parent.frame_unten.document.title.toUpperCase();
         parent.frame_oben.document.forms.site.reset();}}

function schild(schalter){
         if (parent.frame_oben){
          parent.frame_oben.DivObjStyle('background').visibility = schalter;} }

function wechsel(x){
         if (x=="leer"){
            DivObjDocument().forms.site.reset();
            return;}
         else{
            DivObjDocument().forms.site.reset();
            parent.frame_unten.location.href=x;}}

//-------------------------------------------------------------------------------------------------


// hier beginnen der Inhalt der bewegten Informationen der Hauptbilder  ------------------------------------------------------------
if (!net){
document.write( '<div class="inhalt" id="inhaltueberuns" style="top:390;width:200;">');
document.write( '<a href="/ueberuns/ueberuns.html#wersindwir" onClick="layeraus()">Wer sind wir?</a><br>');
document.write( '<a href="/ueberuns/ueberuns.html#leistungen" onClick="layeraus()">Was bieten wir?</a><br>');
document.write( '<a href="/ueberuns/ueberuns.html#beitrag" onClick="layeraus(oldDiv)">Vereinsbeitrag</a><br>');
document.write( '<a href="/ueberuns/ueberuns.html#veranstaltungen" onClick="layeraus()">Veranstaltungen des AUC</a><br>');
document.write( '<a class="intern" href="/ueberuns/ausruestung.html" onClick="layeraus()">Leihausrüstung</a><br>');
document.write( '<a class="intern" href="/ueberuns/satzung.html" onClick="layeraus()">Unsere Satzung</a><br>');
document.write( '<a class="intern" href="/ueberuns/gaestebuch.php?mode=view" onClick="layeraus()">Gästebuch</a>');
document.write( '<img align="right" src="/bilder/end.gif" width="26" height="25" border="0" alt="" onmouseover="layeraus()"></div>');

document.write( '<div class="inhalt" id="inhalttauchen" style="top:400px;width:210px;">');
document.write( '<a href="/tauchen/tauchen.html#verein" onClick="layeraus()">Verein oder Club?</a><br>');
document.write( '<a href="/tauchen/tauchen.html#hallenbad" onClick="layeraus()">Hallenbadausbildung</a><br>');
document.write( '<a href="/tauchen/tauchen.html#freigewaesser" onClick="layeraus()">Freigewässerausbildung</a><br>');
document.write( '<a class="intern" href="/tauchen/tauchen.php?tpl=ausbildung" onClick="layeraus()">Tauchkurse und Seminare</a><br>');
document.write( '<a class="intern" href="/tauchen/tauchen.php?tpl=see" onClick="layeraus()">Tauchgewässer in Seen</a><br>');
document.write( '<a class="intern" href="/tauchen/tauchen.php?tpl=tauchbasen" onClick="layeraus()">Tauchgewässer im Meer</a><br>');
document.write( '<a class="intern" href="/tauchen/tauchen.php?tpl=regelnfrankreich" onClick="layeraus()">Tauchregelung in Frankreich</a>');
document.write( '<img align="right" src="/bilder/end.gif" width="26" height="25" border="0" alt="" onmouseover="layeraus()"></div>');

document.write( '<div class="inhalt" id="inhaltvorstand" style="top:250px; width:170px;">');
document.write( '<a href="/vorstand/vorstand.html#vorstand" onClick="layeraus()">Der <i>richtige</i> Vorstand</a><br>');
document.write( '<a href="/vorstand/vorstand.html#warte" onClick="layeraus()">Unsere Warte<i>nden</i></a><br>');
document.write( '<a href="/vorstand/vorstand.html#ausbilder" onClick="layeraus()">Die Ausbilder</a>');
document.write( '<img align="right" src="/bilder/end.gif" width="26" height="25" border="0" alt="" onmouseover="layeraus()"></div>');

document.write( '<div class="inhalt" id="inhaltinfos" style="top:400px; width:260px;">');
document.write( '<a href="/infos/infos.html#vereine" onClick="layeraus()">Vereine, Clubs und Shops in Aachen</a><br>');
document.write( '<a href="/infos/infos.html#links" onClick="layeraus()">Links zu allem und jedem<br>');
document.write( '<a href="/infos/infos.php?tpl=zeiten" onClick="layeraus()">Trainigszeiten / ausfälle<br>');
document.write( '<a class="intern" href="/tauchsportforum/main.php" onClick="layeraus()">Forum</a> / ');
document.write( '<a class="intern" href="/infos/reiseberichte.html" onClick="layeraus()">Reiseberichte</a><br>');
document.write( '<a class="intern" href="/infos/infos.php?tpl=faqs" onClick="layeraus()">faq´s</a> / ');
document.write( '<a class="intern" href="/infos/infos.php?tpl=suchfind" onClick="layeraus()">Flohmarkt</a><br>');
document.write( '<a class="intern" href="/infos/infos.php?tpl=newsauc" onClick="layeraus()">News</a> / ');
document.write( '<a class="intern" href="/infos/download.php" onClick="layeraus()">Downloads</a><br>');
document.write( '<a class="intern" href="/visiotide" onClick="layeraus()">VisioTide</a><br><br>');
document.write( '<img align="right" src="/bilder/end.gif" width="26" height="25" border="0" alt="" onmouseover="layeraus()"></div>');

document.write( '<div class="inhalt" id="inhaltmitglieder" style="top:170px; width:200px;">');
document.write( '<span class="midi">Nur für Mitglieder:</span><br>');
document.write( '<a class="intern" href="/mitglieder/mitglieder.php" onClick="layeraus()">Interne News/Dokumente</a><br>');
document.write( '<a class="intern" href="/mitglieder/auclist.php?mode=view&by=name&order=ASC">Mitgliederliste</a><br>');
document.write( '<a class="intern" href="/mitglieder/bilder.php?tpl=aegypten" onClick="layeraus()">Bilder</a><br>');
document.write( '<a class="intern" href="/mitglieder/archiv.php" onClick="layeraus()">Archiv</a>');
document.write( '<img align="right" src="/bilder/end.gif" width="26" height="25" border="0" alt="" onmouseover="layeraus()"></div>');

document.write( '<div class="inhalt" id="inhalthome" style="top:170px; width:170px;">');
document.write( '<a href="/home/home.php" onClick="layeraus()">Homepage</a><br>');
document.write( 'zurück zur Startseite');
document.write( '<img align="right" src="/bilder/end.gif" width="26" height="25" border="0" alt="" onmouseover="layeraus()"></div>');
}
//-------------------------------------------------------------------------------------------------