//var root="http://userpage.fu-berlin.de/~amadeusm";
//var root="c:/ERDE-Top";
//var root="/dos/ERDE-Top";
var datei=top.location.href;
if (datei.match('#')) {
    datei=datei.slice(0,top.location.href.lastIndexOf("#"));
    }

var root=datei.slice(0,datei.lastIndexOf("/"));
var ns6=(!document.all && document.getElementById);
var ie4=(document.all);
var ns4=(document.layers);
var neuesFenster;
var glossarFenster;

if (root.indexOf("/Erdgeschichte") > 0)
  root=root.slice(0,datei.lastIndexOf("/Erdgeschichte"));
if (root.indexOf("/Gestein") > 0)
  root=root.slice(0,datei.lastIndexOf("/Gestein"));
if (root.indexOf("/Werkzeug") > 0)
  root=root.slice(0,datei.lastIndexOf("/Werkzeug"));
if (root.indexOf("/Alter") > 0)
  root=root.slice(0,datei.lastIndexOf("/Alter"));
if (root.indexOf("/Energie") > 0)
  root=root.slice(0,datei.lastIndexOf("/Energie"));
if (root.indexOf("/Z-Lebensbilder") > 0)
  root=root.slice(0,datei.lastIndexOf("/Z-Lebensbilder"));
if (root.indexOf("/einfuehrung") > 0)
  root=root.slice(0,datei.lastIndexOf("/einfuehrung"));

  if ((top.frames.length == 0) ||
     (!parent.Home && !parent.Inhalt)) {
//textsta="Die von Ihnen aufgerufene Seite ist Teil einer umfangreichen Vorlesung.\nDie Navigation kann nur im Zusammenhang mit den \u00FCbergeordneten Seiten erfolgen.\nSie wurden jetzt auf die Startseite des Projektes umgeleitet.";
//      alert(textsta);
//      top.location.href="http://userpage.fu-berlin.de/~amadeusm/index.html"; 
//     nachricht('http://userpage.fu-berlin.de/~amadeusm/umleitung.htm',500,400);
} 

function setxyPosition(name,x0,y0) {
  obj=MM_findObj(name,'');
  if (ns4) {
    obj.pageX=x0;
    obj.pageY=y0;
  }
  else if (ie4) {
    obj.style.pixelLeft=x0;
    obj.style.pixelTop=y0;
  }
  else if (ns6) {
    document.getElementById(name).style.left=x0;
    document.getElementById(name).style.top=y0;
  }
}

function xPosition (name) {
  obj=MM_findObj(name,'');
  if (ns4) {
    return obj.x;
  }
  else if (ie4) {
    return obj.offsetLeft;
  }
  else if (ns6) {
    return obj.offsetLeft;
  }
}
function yPosition (name) {
  obj=MM_findObj(name,'');
  if (ns4) {
    return obj.y;
  }
  else if (ie4) {
    return obj.offsetTop;
  }
  else if (ns6) {
    return obj.offsetTop;
  }
}
function Glossar(wort) {
    if (glossarFenster && glossarFenster.closed==false) glossarFenster.close();

    glossarFenster=open("../Glossar.htm#"+wort, "Message","left=200,top=200,width=300,height=300,dependent=yes,resizable=yes,scrollbars=yes");
}

function nachricht(datei,nx,ny) {
//if (neuesFenster) neuesFenster.focus();
//else {
    if (!nx) nx=400;
    if (!ny) ny=400;
    groesse="width="+nx+",height="+ny+",left=300,top=300,dependent=yes,resizable=yes";
    neuesFenster=open(datei, "Message", groesse);
 //}
}

function focusNachricht() {
    if (neuesFenster) neuesFenster.close();
}

/*function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
    if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

*/

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function bildwechsel(mode)
   {
   if (mode == "weiter_an")
     document.weiter.src=root+"/Bilderhome/weiter_an.gif";
   else if (mode == "weiter_over")
     document.weiter.src=root+"/Bilderhome/weiter_over.gif";
   else if (mode == "zurueck_an")
     document.zurueck.src=root+"/Bilderhome/zurueck_an.gif";
   else if (mode == "zurueck_over")
     document.zurueck.src=root+"/Bilderhome/zurueck_over.gif";
   else if (mode == "home_an")
     document.home.src=root+"/Bilderhome/homen_an.gif";
   else if (mode == "home_over")
     document.home.src=root+"/Bilderhome/homen_over.gif";
   else if (mode == "index_an")
     document.index.src=root+"/Bilderhome/indexhome_an.gif";
   else if (mode == "index_over")
     document.index.src=root+"/Bilderhome/index_over.gif";
   else if (mode == "impressum_an")
     document.impressum.src=root+"/Bilderhome/impressum_an.gif";
   else if (mode == "impressum_over")
     document.impressum.src=root+"/Bilderhome/impressum_over.gif";
   else if (mode == "ueber_an")
     document.ueber.src=root+"/Bilderhome/ueber_an.gif";
   else if (mode == "ueber_over")
     document.ueber.src=root+"/Bilderhome/ueber_over.gif";
   else if (mode == "technische_an")
     document.technische.src=root+"/Bilderhome/technische_an.gif";
   else if (mode == "technische_over")
     document.technische.src=root+"/Bilderhome/technische_over.gif";
   }

function leisteoben (titel,ref3,ref4) {
var args=leisteoben.arguments;

document.open();
document.writeln("<table width=100% border=0 cellspacing=0 cellpadding=3>");
document.writeln("<colgroup width=25% span=4> </colgroup> ");
document.write("<tr valign=center> <td align=center>");
document.write("<a target=\"_top\" href=\""+root+"/index.html\"");
document.writeln("onMouseOver=\"bildwechsel('home_over')\" ");
document.writeln("onMouseOut=\"bildwechsel('home_an')\" >");
document.writeln("<img name=\"home\" src=\""+root+"/Bilderhome/homen_an.gif\" border=0></a>");
document.writeln("</td>");

if (titel == "Impressum")
  document.writeln("<td >&nbsp;</td>");
else { 
document.writeln("<td align=center>");
document.writeln("<a target=\"Inhalt\" href=\""+root+"/Verzeichnisse.htm\"");
document.writeln("onMouseOver=\"bildwechsel('index_over')\" ");
document.writeln("onMouseOut=\"bildwechsel('index_an')\" >");
document.writeln("<img name=\"index\" src=\""+root+"/Bilderhome/indexhome_an.gif\" border=0></a>");
document.writeln("</td>"); }

if (ref3 == "#" || !ref3)
  document.writeln("<td >&nbsp;</td>");
else {
document.writeln("<td align=center>");
document.writeln("<a target=\"Inhalt\" href=\""+ref3+"\"");
document.writeln("onMouseOver=\"bildwechsel('zurueck_over')\" ");
document.writeln("onMouseOut=\"bildwechsel('zurueck_an')\" >");
document.writeln("<img name=\"zurueck\" src=\""+root+"/Bilderhome/zurueck_an.gif\" border=0></a>");
document.writeln("</td>"); }

if (ref4 == "#" || !ref4)
  document.writeln("<td>&nbsp;</td>");
else {
document.writeln("<td align=center>");
document.writeln("<a target=\"Inhalt\" href=\""+ref4+"\"");
document.writeln("onMouseOver=\"bildwechsel('weiter_over')\" ");
document.writeln("onMouseOut=\"bildwechsel('weiter_an')\" >");
document.writeln("<img name=\"weiter\" src=\""+root+"/Bilderhome/weiter_an.gif\" border=0></a>");
document.writeln("</td>"); }

document.writeln("</tr>");

document.writeln("<tr valign=top> <td colspan=3>");
document.writeln("&nbsp;<b>"+titel+"</b></td>");
if (args.length < 4) {
  document.writeln("<td width=25%>&nbsp;</td>"); }
else {
  document.writeln("<td width=25% align=left>");
  document.writeln("<form name=\"liste_v\">");
  document.writeln("<select name=\"Verz\" "+"onchange=\"parent.Inhalt.location.href="+"document.liste_v.Verz.options[selectedIndex].value\" size=1>");
  document.write("<option> Verwandte Themen:");
  for (i=4; i<(args.length); i+=2)
    if (args[i]=="" || args[i]=="#") args[i]=root+"/empty.htm";
  for (i=3; i<(args.length-1); i+=2) {
    document.write("<option value=\"");
    document.write(args[i+1]);
    document.writeln("\"> "+args[i]);
  }
  document.writeln("</select> </form> </td>"); 
  }
document.writeln("</tr> </table>");
//document.writeln("</body> </html>");

//document.close();
}


