/********************************/
/* JavaScript code file         */
/* www.gemmrig.de Webserver     */
/* Author: Ruediger Gemmrig     */
/* File: js_javascripts.js      */
/* Created: 13-Aug-1998         */
/* Last modified: 14-Jul-2004   */
/********************************/



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








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


function Print_Date()
{
  document.writeln(date_month_zero,date_month,"/",date_day_zero,date_day,"/",date_year);
}


function Print_Time()
{
  document.writeln(time_hours_zero,time_hours,":",time_minutes_zero,time_minutes);
}


/*************************/
/* Current Time and Date */
/*************************/

function Show_Time_De() {
var Wochentagname =  new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");

 var Jetzt = new Date();
 var Tag = Jetzt.getDate();
 var Monat = Jetzt.getMonth() + 1;
 var Jahr = Jetzt.getYear();
 if(Jahr < 999) Jahr += 1900;
 var Stunden = Jetzt.getHours();
 var Minuten = Jetzt.getMinutes();
 var Sekunden = Jetzt.getSeconds();
 var WoTag = Jetzt.getDay();
 var Vortag  = ((Tag < 10) ? "0" : "");
 var Vormon  = ((Monat < 10) ? ".0" : ".");
 var Vorstd  = ((Stunden < 10) ? "0" : "");
 var Vormin  = ((Minuten < 10) ? ":0" : ":");
 var Vorsek  = ((Sekunden < 10) ? ":0" : ":");
 var Datum = Vortag + Tag + Vormon + Monat  + "." + Jahr;
 var Uhrzeit = Vorstd + Stunden + Vormin + Minuten + Vorsek + Sekunden;
 var Gesamt = Wochentagname[WoTag] + ", " + Datum + ", " + Uhrzeit;

 if(DHTML) {
   if(NS) setCont("id","timedate",null,"<span class=\"timedate\">" + Gesamt + "<\/span>");
   else   setCont("id","timedate",null,Gesamt);
 }
 else return;

 window.setTimeout("Show_Time_De()",1000);
}



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

function User_Welcome_English()
{
  document.writeln("<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 />");
  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>");
}

