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 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; }

}





//Frameset prüfen + nachladen

function checkFrameset(){

  if(top.frames.length <1)

  top.location.href="index.html";

}



// Neues Fenster öffnen

function newpop(page,size_x,size_y){

OpenWin = window.open(page,"Popup","toolbar=0,menubar=0,location=0,scrollbars=1,status=0,resizable=0,copyhistory=0,left=100,top=0,width="+size_x+",height="+size_y);

}



// Bilder Slideshow in neuem Fenster

function bilder(){

OpenWin = window.open("slide.html","Popup","toolbar=0,menubar=0,location=0,scrollbars=1,status=0,resizable=0,copyhistory=0,left=100,top=0,width=620,height=540");

OpenWin.focus();

}







//Externe Links im neuen Fenster

function externLink(URL){

var opened = false;

var targetWin;

if(opened == false)

{

targetWin = window.open(URL,"externWin","menubar=1,toolbar=0,location=1,status=1,scrollbars=1,directories=0,resizable=1,copyhistory=0,left=250,top=150,width=500,height=300");

opened = true;

targetWin.focus();

}

if(targetWin.closed == true)

{

targetWin = window.open(URL,"externWin","menubar=1,toolbar=0,location=1,status=1,scrollbars=1,directories=0,resizable=1,copyhistory=0,left=250,top=150,width=500,height=300");

targetWin.focus();

}

if(targetWin.closed == false)

{

targetWin.focus();

}

}



// Formular DB-Fahrplan Einbinden mit body onload="zeit()"

function zeit() {

if (document.forms.hafasziel)

{

document.forms.formular.to.value = document.forms.hafasziel.zielbahnhof.value;

}

var jetzt = new Date();

if (jetzt.getMinutes() > 9) {

document.formular.time.value = (jetzt.getHours() + ":" + jetzt.getMinutes()); }

else {

document.formular.time.value = (jetzt.getHours() + ":0" + jetzt.getMinutes()); }

var jetzt = new Date();

monat = jetzt.getMonth();

monat++;

var jahr = jetzt.getYear();

if(jahr < 200) jahr+=1900;

if(jahr < 1999) jahr+=100;

if (monat > 9) {

document.formular.date.value = (jetzt.getDate() + "." + monat + "." + jahr); }

else {

document.formular.date.value = (jetzt.getDate() + ".0" + monat + "." + jahr); }

}






