//****************************************************//
// verschiede JavaScript-Funktionen                   //
// H.Grasser - März 2004                              //
//****************************************************//
 
  function showpic_h(image) {
    // Windowposition ermitteln
    var x = (screen.availWidth - 640) / 2;
    var y = (screen.availHeight - 500) / 2;
    var win;
    win=window.open("", "_new", "width=640,height=500,top=" + x + ",left=" + y + ",scrollbars=yes,resizable=yes");
    win.document.write('<html><head><title>N&uuml;rtinger Magedam Run</title></head><body bgcolor="white">');
    win.document.write('<center><img src="' + image + '" /></center></body></html>');
    win.document.close();
    win.focus();
  }

  function showpic_h640(image) {
    // Windowposition ermitteln
    var x = (screen.availWidth - 640) / 2;
    var y = (screen.availHeight - 500) / 2;
    var win;
    win=window.open("", "_new", "width=660,height=470,top=" + x + ",left=" + y + ",scrollbars=yes,resizable=yes");
    win.document.write('<html><head><title>N&uuml;rtinger Magedam Run</title></head><body bgcolor="white">');
    win.document.write('<center><img src="' + image + '" /></center></body></html>');
    win.document.close();
    win.focus();
  }

  function showpic_h500(image) {
    // Windowposition ermitteln
    var x = (screen.availWidth - 640) / 2;
    var y = (screen.availHeight - 500) / 2;
    var win;
    win=window.open("", "_new", "width=550,height=420,top=" + x + ",left=" + y + ",scrollbars=yes,resizable=yes");
    win.document.write('<html><head><title>N&uuml;rtinger Magedam Run</title></head><body bgcolor="white">');
    win.document.write('<center><img src="' + image + '" /></center></body></html>');
    win.document.close();
    win.focus();
  }

  function showpic_v500(image) {
    // Windowposition ermitteln
    var x = (screen.availWidth - 500) / 2;
    var y = (screen.availHeight - 550) / 2;
    var win;
    win=window.open("", "_new", "width=490,height=560,top=" + y + ",left=" + x + ",scrollbars=yes,resizable=yes");
    win.document.write('<html><head><title>N&uuml;rtinger Magedam Run</title></head><body bgcolor="white">');
    win.document.write('<center><img src="' + image + '" /></center></body></html>');
    win.document.close();
    win.focus();
  }

// Tagesdatum anzeigen (geht so nur bei IE >= 5.5, Netscape > 4.7x 
function setDatum() {

    
     var weekdays = new Array("Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag",
	                          "Freitag", "Samstag");
     var now = new Date();
	 var day = now.getDate();
	 var month = now.getMonth() + 1;
     var year = now.getFullYear();
	 var weekday = now.getDay();
	 var hours = now.getHours();
	 var minutes = now.getMinutes();
	 var seconds = now.getSeconds();
	 var day0 = ((day < 10) ? "0" : "");
	 var month0 = ((month < 10) ? ".0" : ".");
	 var hours0 = ((hours < 10) ? "0" : "");
	 var minutes0 = ((minutes < 10) ? ".0" : ":");
	 var seconds0 = ((seconds < 10) ? ".0" : ":");
	 var output = weekdays[weekday] + ", " + day0 + day + month0 + month +
	        "." + year + ", " + hours0 + hours +
			minutes0 + minutes + seconds0 + seconds + " Uhr";
     document.getElementById("datum").innerHTML = output;
	 window.setTimeout("setDatum()", 1000);
}


// Anzahl Tage bis ermitteln... (geht so nur bei IE >= 5.5, Netscape > 4.7x 
function initStartseite() {

  setDatum();

  //var date = new Date();

  // Anzahl der Tage bis zm 11.09. ermitteln
  //var time = date.getTime();
  //date.setDate(11);
  //date.setMonth(8); // 0 = Januar

  //var tage = (date.getTime() - time) / (1000 * 60 * 60 * 24); 
  //tage = Math.round(tage);
  //var text;
  
  //if (tage >= 0) {
  //    text = "...noch " + tage + " Tage.";
  //} else {
  //    text = "Der 2. Nürtinger Magedam Run war vor " + ( -tage) + " Tagen!";
  //} 

  //document.getElementById("anzahltage").firstChild.nodeValue = text;	

}

 
