
// ==============================================
//          offline Navigation Bibel 
//
// Datum:     10.05.2000
//
// Autor:     Markus Haeger (haeger@hipposoft.de)
//            http://hipposoft.de/
//
// getestet:  Netscape Navigator 4 (Linux/Win95/98/NT)
//            MSIE 4               (Win95/NT)
//            MSIE 5               (Win98/NT)
//	          
//

    var my_style = 'color:#000000; background-color:#BDBDAD;';
    var my_los = 0;
    if (window.location.hash)
     {
       with (document)
        {
	  my_hash = window.location.hash.substr(window.location.hash.indexOf("#")+1,window.location.hash.length);
	  if (my_hash.charCodeAt(0) == 65) my_los = 1;
	  my_hash = parseInt(my_hash.substr(1,my_hash.length));
	  my_hash++;
	  if (my_los) freshup(my_hash);
          writeln('<style type="text/css">');
          writeln('.a'+my_hash+' {'+my_style+'}');
          writeln('</style>');
          
          if (document.layers && my_los)
           {
             my_hash--;
             setTimeout("eval('window.location.hash = \"a"+my_hash+"\"')",200);
           }
        }
     } 
    else
     {
       freshup(0);
     }

var Count = 0;
function freshup(i){
  if (Count++ > 30) return; // aufgeben
  if (parent.Navigation)
   {
     if (parent.Navigation.loaded) 
      {
      	if (i>0) parent.Navigation.geheZu(a,b,c,i,0);
      	else     parent.Navigation.geheZu(a,b,c,0,0);
      }
     else setTimeout('freshup('+i+')',200);
   }
}   



function go(r){
	if (!parent.Navigation) return;
	if (!parent.Navigation.loaded) return;
	if (r == 0)
	 { 
	 	 if (a==0 && b==19 && c==1) 
	 	  {
	 	    parent.Navigation.geheZu(a,b,0,0,1);
	 	    return;
	 	  }
	 	 if (c > 1) parent.Navigation.geheZu(a,b,c-1,0,1);
	 	 else 
	 	  {
	 	    if (b > 1) parent.Navigation.geheZu(a,b-1,parent.Navigation.Buecher[a][b-2].Kapitel,0,1);
	 	    else
	 	     {
	 	       if (a > 0) parent.Navigation.geheZu(0,parent.Navigation.Buecher[0].length,parent.Navigation.Buecher[0][parent.Navigation.Buecher[0].length-1].Kapitel,0,1);
	 	       else alert("Der Anfang der Bibel wurde erreicht!\t");
	 	     }
	 	  } 	 
	 }
	else
	 { 
	 	 if (a==0 && b==19 && c==9)
	 	  { alert("Achtung");
	 	    parent.Navigation.geheZu(a,b+1,1,0,1); 
	 	    parent.Navigation.Ester = false;
	 	    return;
	 	  }
	 	 if (c < parent.Navigation.Buecher[a][b-1].Kapitel) parent.Navigation.geheZu(a,b,c+1,0,1);
	 	 else 
	 	  {
	 	    if (b < parent.Navigation.Buecher[a].length)
	 	     {
	 	       if (a==0 && b==18) parent.Navigation.geheZu(a,b+1,0,0,1);
	 	       else parent.Navigation.geheZu(a,b+1,1,0,1);
	 	     }
	 	    else
	 	     {
	 	       if (a < 1) parent.Navigation.geheZu(1,1,1,0,1);
	 	       else alert("Das Ende der Bibel wurde erreicht\t");
	 	     }
	 	  } 
   }
}	
     
