////////////////////////////////////////////////////////////////////////////////////
// scripts.js version 0.1 for my personal webpage at www.fberke.de
// Copyright Frank Berke 2003. All rights reserved
//
// Created by Frank Berke (frank@fberke.de). Last modified 2004-04-28
// Some fundamental ideas by JavaScript Kit (http://javascriptkit.com),
// and overLib by Erik Bosrup (erik@bosrup.com)
//
// This script has been created for personal use, but I permit anyone to feel free
// copying whatever is useful from here and use it for his or herown projects without
// even asking me for permission.
//
// Please be so kind as to give me some credit when using JavaScripts that are
// inspired by my code, as I don't charge you for it... mentioning me in your
// comments as I do above will be sufficient - thank you.
////////////////////////////////////////////////////////////////////////////////////



/////////////////////////////////////////////////////////////////////////////////////
// FUNCTION OPENPOPUP
//
// This function's intention is to open a popup window containing a picture submitted
// by the variable POPURL, and display it at the appropriate size, submitted by the
// variables W (=width), and H (=height).
// The windows opened will appear without any control elements, which is intended.
/////////////////////////////////////////////////////////////////////////////////////

function openpopup(popurl, w, h) {
	winpops=window.open(popurl, "", "width = "+w+", height = "+h+", ");
}


/////////////////////////////////////////////////////////////////////////////////////
// FUNCTION GETLASTMODIFIED
//
// This function delivers the date and time the document has been changed. This
// eliminates the need for lazy people like me to change it manually.
// Maybe minutes and seconds is too much... just remove them.
/////////////////////////////////////////////////////////////////////////////////////

function getLastModified() {
var d = new Date(document.lastModified), res, value,
    browser = parseInt(navigator.appVersion),
    months = "01.02.03.04.05.06.07.08.09.10.12.";

   value = d.getYear();
   if (value<70) {value += 2000};
   if (value<1000) {value += 1900};
   if ((value>=1900) && (value<1970)) {value += 100};
   if (browser<4) { res = String(d.getDate())+". "+d.getMonth()+". "+value+", "+d.getHours()+":" }
   else { res = String(d.getDate())+"."+months.substr(3*(d.getMonth()),3)+value+", "+d.getHours()+":" };
   value = d.getMinutes();
   if (value<10) { res += "0"+value } else { res += value };
   return res;
}


/////////////////////////////////////////////////////////////////////////////////////
// FUNCTION BROWSER_NAME
//
// This function is a slightly modified version of what Detlef Beyer presented in
// his article "HTML Rechtschreibung" in c't 8/03.
// Its main purpose now is to find out whether my website is visited with MSIE or
// *any* other browser. The cool thing is that you can actually use it in your
// document header already to load the appropriate CSS file.
// Return values are: 'ie.css' and 'screen.css'
/////////////////////////////////////////////////////////////////////////////////////

function browser_name () {
var uagent = navigator.userAgent;
var isIE = (uagent.indexOf('MSIE') >= 0) ? true : false;
var isOpera = (uagent.indexOf('Opera') >= 0) ? true : false;
var isGecko = (uagent.indexOf('Gecko') >= 0) ? true : false;
var cssfile;

	if (isIE && !isOpera) {cssfile = "ie";}
	else if (isGecko) {cssfile = "screen";}
	else if (isOpera) {cssfile = "screen";}
	else if (document.layers) {cssfile = "screen";}
	
	cssfile += ('.css');
	
	return cssfile;
}
