function xy(ort,x,y) {ox[ort]=x;oy[ort]=y}
var ox=new Array(), oy=new Array();
// die folgenden Koordinaten wurden auf der Grundlage von
// ../bildercube/D-karte.gif erstellt (Größe: 450x600 Pixel; Faktor 2,95)
xy('Hamburg'    ,208,128);
xy('Hannover'   ,186,205);
xy('Bremen'     ,149,155);
xy('Magdeburg'  ,282,228);
xy('Berlin'     ,360,196);
xy('D&uuml;sseldorf' , 45,294);
xy('K&ouml;ln'       , 55,312);
xy('Leipzig'    ,318,289);
xy('Erfurt'     ,253,316);
xy('Dresden'    ,385,307);
xy('Bonn'       , 62,332);
xy('Frankfurt/Main'  ,139,381);
xy('Offenbach/Main', 142,391);
xy('W&uuml;rzburg', 204,397);
xy('Tauberbischofsheim',190,430);
xy('Kleinrinderfeld',199,405);
xy('Triefenstein', 190,397);
xy('Hettstadt', 195,385);
xy('Saarbr&uuml;cken', 54,438);
xy('Stuttgart'  ,161,479);
xy('Freiburg'   , 92,537);
xy('M&uuml;nchen'    ,277,530);

function dyndiv(dname,mdiv,bx,by,txt){ // einfacher dynamischer DIV ...
 this.name=dname;
 this.div=document.getElementById(mdiv);
 this.x=bx;
 this.y=by;
 this.xy=DDxy;
 this.str=txt;
 this.cont=DDcont;
 this.restore=DDrestore;
 // this.restore();
}
function DDxy(px,py){ // ändert die aktuelle position ...
  if (px!=null) {this.x=px;this.y=py;}
  // var st=Array();for (el in this.div.style){st.push(el+ ": "+this.div.style[el])};st.sort();
  // alert("DDxy aufgerufen! für "+ this.div.id +"\nx: " + this.x + "\ny: " + this.y);
  with(this.div.style) {left = this.x; top=this.y}
  // alert("DDxy ist fertig");
}
function DDcont(cont) { // ändert den Inhalt
  if (cont==null) cont='';
  this.div.innerHTML=cont;
}
function DDspotpos(ort,xtra) { // =this.set berechnet neue Koordinaten und einen neuen Spottxt ...
// benutzt und die globalen Arrays ox[] und oy[]
  sc=this.map.sc;si=this.hsize;s=sc*si;
  if (ort!=null) {
    this.ort =ort;
    this.ortx=ox[ort];
    this.orty=oy[ort];
    this.lost=(this.ortx==null?true:false);
  }
  if (this.lost) {
    this.ortx=this.nullx;this.orty=this.nully;
    this.cont('<p class=lost>'+(xtra!=null?xtra+'.: ':'')+'Der Cube ist zur Zeit in '+
              this.ort+' &#8212 wo auch immer das ist ...</p>');}
  else
    this.cont('<img src=\"../bildercube/gesamt/pix.gif\" height='+3*s+' width='+3*s+'>'+
               (xtra!=null?'<div class="num">'+xtra+'</div>':''));
  this.xy(this.ortx*sc+this.map.x-s,this.orty*sc+this.map.y-s);
}
function DDrestore() {
this.cont(this.str);
this.xy();
a=DDrestore.arguments;
for(i=0; i<a.length; i++) eval(a[i]+'.cont()');
}
function zoommapObj(bx,by){
this.map=new Array ('map_klein_klein.gif','map_klein_hell.gif');
this.sc=new Array (.4,0.8333);
this.x =new Array (bx,120);
this.y =new Array (by,90);
this.zoom=0;
this.MO= new mapObj('map',this.x[this.zoom],this.y[this.zoom],-this.sc[this.zoom],this.map[this.zoom]);
this.SO= new spotObj('spot',this.MO,8);
this.restore=ZMrestore;
this.toggle=ZMtoggle;
this.cont=ZMcont;
this.toggle();
}
function ZMrestore() {
 this.MO.restore();this.SO.set();
}
function ZMtoggle(i) {
 this.zoom= (i==null?0:(this.zoom+i)%2);
 this.MO.newscale(this.x[this.zoom],this.y[this.zoom],this.sc[this.zoom],this.map[this.zoom])
 this.MO.restore();
 this.SO.set();
}
function ZMcont() {this.MO.cont();this.SO.cont()}

function mapObj(mdiv,bx,by,sc,map,mx,my) {  // Objekt: richtet eine Landkarte im DIV mdiv ein
 this.div=document.getElementById(mdiv);
 this.x=bx;
 this.y=by;
 this.newscale=MOnewscale;
 this.xy=DDxy;
 this.str='<img src=\"../bildercube/gesamt/'+map+'\" border=0'+(mx?' width='+mx:'')+(my?' height='+my:'')+'>';
 this.cont=DDcont;
 this.restore=DDrestore;
 if (sc<0) sc=-sc;    // negativer Scale-Faktor bewirkt, dass das Objekt nicht sofort dargestellt wird!
 else this.restore()
 this.sc=sc;
}
function MOnewscale(bx,by,sc,map){
 this.x=bx;
 this.y=by;
 this.sc=sc;
 this.str='<a href=\"javascript:ZM.toggle(1)\"><img src=\"../bildercube/gesamt/'+map+'\" border=0></a>';
}
function spotObj(sdiv,mp,hsiz) {  // setzt den Ortsspot auf die Karte mp (=mapObj)
 this.div=document.getElementById(sdiv);
 this.map=mp;
 this.hsize=hsiz;
 this.nullx=200;
 this.nully=200;
 this.x=this.nullx;
 this.y=this.nully;
 this.ort="nirgendwo"
 this.ortx=0;
 this.orty=0;
 this.xy=DDxy;
 this.cont=DDcont;
 this.set=DDspotpos;
 }

function thumbpic(k) {
return '<a href=\"javascript:showpic(\''+this.name+'\','+k+')\" onMouseover=\"status=\''+nam[k]+' kommt aus '+place[k]+
   '\';return true;\"><img src=\"'+imgpath+'k'+pic[k]+'\" width=37 height=37 border=0'+
   ' alt=\"'+(k+1)+'.:'+nam[k]+' aus '+place[k]+' mit '+imgpath+'k_'+pic[k]+'\"></a>';
}
ZM=false;                // Dummy-Objekte für Existenzabfrage in showpic() ...
function showpic(PO,k) { // Bild 'k' und dazu gehörende Daten werden angezeigt ...
                         // 'PO' enthält den Namen des Parent-Objects ...
 a_bck='<a href=\"javascript:'+PO+'.restore(\'ZM\')\">';
 tmptxt='<table class=head13 width=450 border=0>\
 <tr height=20><td class=text align=left valign=top><a href=\"javascript:showpic(\''+PO+'\','+(k+ip)%(ip+1)+')\">&lt;&nbsp;zur&uuml;ck</a>\
  &nbsp;&nbsp;&nbsp;<a href=\"javascript:showpic(\''+PO+'\','+(k+1)%(ip+1)
  +')\">vor&nbsp;&gt;</a></td><td colspan=2><p align=right valign=top>stationsdauer : '
  +Math.floor((datum[k+1].getTime()-datum[k].getTime())/mstag)
  +' Tage</td></tr><tr height=30><td class=text colspan=3>daten zur ' 
  +(k)+'. station: <a href=\"mailto:'+addr[k]+'\">'+nam[k]
  +'</a> aus '+place[k]+'</td></tr>\
  <tr><td width=200 height=220 valign=top><img src=\"'+
  imgpath+'p'+pic[k]+'\" width=200 border=0></a></td>\
   <td with=10 >&nbsp;</td><td valign=top><div align=justify>'+txt[k]+'</div></td>\
 <tr><td colspan=2 valign=bottom><img src=\"'+imgpath+pic[k]+'\" width=200></td></tr></table>'+
 '</body>';
 eval(PO+'.cont(tmptxt)');xx=eval(PO+'.x'); yy=eval(PO+'.y');
 if (!ZM) ZM=new zoommapObj(xx+250,yy+240); // neues ZoomMapObjekt nur erzeugen, wenn noch keins existiert.
 ZM.SO.set(place[k],place[k]);

 }
Date.prototype.toString=function(wdf) {
 var wd=new Array('so','mo','di','mi','do','fr','sa')
 return (!wdf?wd[this.getDay()]+' ':'')+String(this.getDate()+100).substr(1)
        +'.'+String(this.getMonth()+101).substr(1)+'.'+this.getFullYear()
}
function datstr(dat) {
 var wd=new Array('so','mo','di','mi','do','fr','sa')
 return wd[dat.getDay()]+' '+String(dat.getDate()+100).substr(1)
        +'.'+String(dat.getMonth()+101).substr(1)+'.'+dat.getFullYear()
}
// globale Variablen:
datum[ip+1]=new Date()
var mstag = 86400000,limit=10, verweil=mstag*limit
var trefftermin=new Date()   // Termin für Abschlusstreffen in HH
var abgabe = Math.floor((datum[ip+1]-datum[ip]-verweil)/mstag)     // Tage seit dem Abgabetermin (negativ, falls Abgabetermin in der Zukunft)
trefftermin.setTime(datum[ip].getTime() + (217-ip)*verweil + Math.max(abgabe,0)*mstag)

day=" tag"+(Math.abs(abgabe)==1?" ":"e ")  // Tag: Singular oder Plural?
if (abgabe<0) abgabetxt="achtung nur noch "+(-abgabe)+day+"bis zur weitergabe!"
else                        // jetzt wird es schon eng: Terminüberschreitung:
  if (abgabe>0) abgabetxt="<font class=head13br>weitergabetermin um "+abgabe+day+"&uuml;berschritten!</font>"
  else abgabetxt="weitergabe sollte <b>heute</b> stattfinden!!"
