/********************************/
/* JavaScript code file         */
/* www.gemmrig.de Webserver     */
/* Author: Ruediger Gemmrig     */
/* File: js_wwwgemmrigde.js     */
/* Created: 18-Jul-1998         */
/* Last modified: 20-Oct-2002   */
/********************************/



/*********************/
/* Globale Variablen */
/*********************/

var site_version = "0.06";
var email_addr = "webmaster@gemmrig.de";
var copyright = "HTML-Code and Design &copy; 1998-2002 by R&uuml;diger Gemmrig";
var first_install = "Version 0.01 established 13-Aug-1998";
var site_location = "http://www.gemmrig.de/";



/*******************************************/
/* Befreit eigene Seite aus fremden Frames */
/*******************************************/
function Frame_Elimination()
{
  if (self != top)
  {
    top.location = self.location;
  }
}



/*******************************************************/
/* Zeigt Versions-Informationen fuer die HTML-Seite an */
/*******************************************************/

function Version_Information()
{
  document.write( "Version " , site_version );
}



/*****************************************************/
/* Zeigt Update-Informationen fuer die HTML-Seite an */
/*****************************************************/

function Last_Modified()
{
  date = new Date(document.lastModified);
  month = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
  month = month[date.getMonth()];
  day_number = date.getDate();
  day_name = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
  day_name = day_name[date.getDay()];
  year = date.getYear();
  year = (year>=2000)?year:((year<80)?year+2000:year+1900);
  hour = date.getHours();
  hour = ((hour < 10) ? "0" + hour : hour);
  minute = date.getMinutes();
  minute = ((minute < 10) ? "0" + minute : minute);
  second = date.getSeconds();
  second = ((second < 10) ? "0" + second : second);
  timezoneoffset = date.getTimezoneOffset() / 60;
  date_output = (day_name + ", "  + month + " " + day_number + ", " + year + " " + hour + ":" + minute + ":" + second + " GMT " + timezoneoffset);
  document.write( "Last updated " , date_output , "<br />" );
}



/**************************************************/
/* Zeigt Copyright im HTML-Code einer Webseite an */
/**************************************************/

function Copyright()
{
  document.write( copyright );
}



/******************************************************/
/* Zeigt EMail-Adresse im HTML-Code einer Webseite an */
/******************************************************/

function email_address()
{
  document.write("E-Mail: <a href=\'mailto:" + email_addr + "\'>" + email_addr +"</a>");
}



/**************************************/
/* Zeigt Fusszeile fuer Hauptseite an */
/**************************************/

function Foot_Line_Mainpage()
{
  // document.writeln("<hr size=\'1\' />");
  document.writeln("<address>");
  document.writeln("Location: ", site_location , "<br />");
  document.writeln("Version ", site_version);
  document.writeln(" / ", first_install, "<br />");
  Last_Modified();
  document.writeln(copyright, "<br />");
  document.writeln("E-Mail <a href=\'mailto:" + email_addr + "\'>" + email_addr +"</a>");
  document.writeln("</address>");
}



/************************************************/
/* Zeigt einheitliche Fusszeile fuer Website an */
/************************************************/

function Foot_Line()
{
  // document.writeln("<hr size=\'1\' />");
  document.writeln("<address>");
  document.writeln("Version ", site_version, "<br />");
  Last_Modified();
  document.writeln(copyright , "<br />" );
  document.writeln("E-Mail <a href=\'mailto:" + email_addr + "\'>" + email_addr +"</a>");
  document.writeln("</address>");
}



/*********************************************/
/* Shows unified navigation menu for website */
/*********************************************/

function Navigation_Menue()
{
  document.write("<center>");
  document.write("<table class=\'table1\' align=\'center\' border=\'0\'");
  document.write("cellpadding=\'5\' cellspacing=\'0\'>");
  document.write("<tr class=\'tr1\'>");
  document.write("<th class=\'th11\' colspan=\'2\'>");
  document.write("Go to:</th>");
  document.write("</tr>");
  document.write("<tr class=\'tr1\'>");
  document.write("<td class=\'td11\'>");
  document.write("<a href=\'javascript:history.back()\' target=\'_parent\'>Back</a></td>");
  document.write("<td class=\'td11\'>");
  document.write("<a href=\'/index.html\' target=\'_parent\'>Home</a></td>");
  document.write("</tr>");
  document.write("<tr class=\'tr1\'>");
  document.write("<td class=\'td11\' colspan=\'2\'>");
  document.write("<a href=\'/index.html\' target=\'_parent\'>www.gemmrig.de</a></td>");
  document.write("</tr>");
  document.write("</table>");
  document.write("</center>");
  document.write("<br />");
}



/******************************************/
/* Stellt Datumsfunktionen zur Verfuegung */
/******************************************/

today = new Date();
time_minutes = today.getMinutes();
if(time_minutes < 10)
{
  time_minutes_zero = "0";
}
else
{
  time_minutes_zero = "";
}
time_hours = today.getHours();
if(time_hours < 10)
{
  time_hours_zero = "0";
}
else
{
  time_hours_zero = "";
}
date_day = today.getDate();
if(date_day < 10)
{
  date_day_zero ="0";
}
else
{
  date_day_zero = "";
}
date_month = today.getMonth() + 1;
if(date_month < 10)
{
  date_month_zero ="0";
}
else
{
  date_month_zero = "";
}
if (document.all)
{
  date_year = today.getYear()
}
else 
{
  date_year = today.getYear() + 1900;
}



/************************************************************************/
/* Besucher wird in Englisch mit korrekter Anrede zur Uhrzeit begruesst */
/************************************************************************/

function User_Welcome_English()
{
/*
  document.write("<center><font SIZE=4 COLOR=red>Welcome!!</font></center>");
*/
  document.writeln("<br /><br />");
  if(time_hours < 6)
  {
    document.writeln("<h2 align=\'center\'>Welcome at</h2>");
  }
  if((time_hours >= 6) && (time_hours < 12))
  {
    document.writeln("<h2 align=\'center\'>Good Morning and Welcome to</h2>");
  }
  if((time_hours >= 12) && (time_hours < 18))
  {
    document.writeln("<h2 align=\'center\'>Good Afternoon and Welcome to</h2>");
  }
  if((time_hours >= 18) && (time_hours < 23))
  {
    document.writeln("<h2 align=\'center\'>Good Evening and Welcome to</h2>");
  }
  if(time_hours >= 23)
  {
    document.writeln("<h2 align=\'center\'>Welcome to</h2>");
  }
  document.writeln("<h1 align=\'center\'>W W W . G E M M R I G . D E</h1>");
  document.writeln("<h3 align=\'center\'>Official home of R&uuml;diger 'Gremlin' Gemmrig's websites</h3>");
  
  document.writeln("<br />");
  if((time_hours >= 0) && (time_hours < 4))
  {
    document.writeln("<p class='\span1e'\ align=\'center\'>You're up late today.</p>");
  }
  if((time_hours >= 4) && (time_hours <= 6))
  {
    document.writeln("<p class='\span1e'\ align=\'center\'>Wow! You are up early!!</p>");
  }
  document.writeln("<p class='\span1d'\ align=\'center\'>Time: ",time_hours_zero,time_hours,":",time_minutes_zero,time_minutes);
  document.writeln("&nbsp;&nbsp; Date: ",date_month_zero,date_month,"/",date_day_zero,date_day,"/",date_year,"<br></p>");
}



/***********************************************************************/
/* Besucher wird in Deutsch mit korrekter Anrede zur Uhrzeit begruesst */
/***********************************************************************/

function User_Welcome_German()
{
  document.writeln("<br /><br />");
  if(time_hours < 6)
  {
    document.writeln("<h2 align=\'center\'>Willkommen bei</h2>");
  }
  if((time_hours >= 6) && (time_hours < 12))
  {
    document.writeln("<h2 align=\'center\'>Guten Morgen und Willkommen bei</h2>");
  }
  if((time_hours >= 12) && (time_hours < 18))
  {
    document.writeln("<h2 align=\'center\'>Guten Tag und Willkommen bei</h2>");
  }
  if((time_hours >= 18) && (time_hours < 23))
  {
    document.writeln("<h2 align=\'center\'>Guten Abend und Willkommen bei</h2>");
  }
  if(time_hours >= 23)
  {
    document.writeln("<h2 align=\'center\'>Willkommen bei</h2>");
  }
  document.writeln("<h1 align=\'center\'>W W W . G E M M R I G . D E</h1>");
  document.writeln("<h3 align=\'center\'>Offizieller Webserver von R&uuml;diger 'Gremlin' Gemmrig</h3>");
  
  document.writeln("<br />");
  if((time_hours >= 0) && (time_hours < 4))
  {
    document.writeln("<p class='\span1e'\ align=\'center\'>Sie sind noch ganz sch&ouml;n sp&auml;t auf.</p>");
  }
  if((time_hours >= 4) && (time_hours <= 6))
  {
    document.writeln("<p class='\span1e'\ align=\'center\'>Hey! Sie sind ja schon fr&uuml;h auf!!</p>");
  }
  document.writeln("<p class='\span1d'\ align=\'center\'>Zeit: ",time_hours_zero,time_hours,":",time_minutes_zero,time_minutes);
  document.writeln("&nbsp;&nbsp; Datum: ",date_day_zero,date_day,"/",date_month_zero,date_month,"/",date_year,"<br></p>");
}



/*******************************************/
/* Ermittelt Browser-Daten eines Besuchers */
/*******************************************/

function Get_User_Info()
{
  var where = document.referrer;
  var name = navigator.appName;
  var vers = navigator.appVersion;
  document.write("<p align=\'center\'><font SIZE=-1 color=yellow>You came here via "+where+" "+name+" "+vers+"</font></p>");
}

