/*********** Globale Variablen-Declaration ***********/
var imgPath="img/";
/******** Ende Globale Variablen-Declaration *********/

function lib_message(txt){alert(txt); return false}

//Lib objects ************
function lib_obj(obj,nest){ 
  if(!bw.bw) return lib_message('Old browser')
  nest=(!nest) ? "":'document.'+nest+'.'
  this.evnt=bw.dom? document.getElementById(obj):
    bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj):0;	
  if(!this.evnt) return lib_message('The layer does not exist ('+obj+')' 
    +'- \nIf your using Netscape please check the nesting of your tags!')
  this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt; 
  this.ref=bw.dom||bw.ie4?document:this.css.document;
  this.x=parseInt(this.css.left)||this.css.pixelLeft||this.evnt.offsetLeft||0;
  this.y=parseInt(this.css.top)||this.css.pixelTop||this.evnt.offsetTop||0
  this.w=this.evnt.offsetWidth||this.css.clip.width||
    this.ref.width||this.css.pixelWidth||0; 
  this.h=this.evnt.offsetHeight||this.css.clip.height||
    this.ref.height||this.css.pixelHeight||0
  this.c=0 //Clip values
  if((bw.dom || bw.ie4) && this.css.clip) {
  this.c=this.css.clip; this.c=this.c.slice(5,this.c.length-1); 
  this.c=this.c.split(' ');
  for(var i=0;i<4;i++){this.c[i]=parseInt(this.c[i])}
  }
  this.ct=this.css.clip.top||this.c[0]||0; 
  this.cr=this.css.clip.right||this.c[1]||this.w||0
  this.cb=this.css.clip.bottom||this.c[2]||this.h||0; 
  this.cl=this.css.clip.left||this.c[3]||0
  this.obj = obj + "Object"; eval(this.obj + "=this")
  return this
}

//Format Date for different Browsers ************
lib_obj.prototype.lastMod = function(){
	mdate = document.lastModified;
	if (bw.ie){
	   d     = mdate.substr(3,2) + ".";
	   m     = mdate.substr(0,2) + ".";
	   y     = mdate.substr(6,4) + " - ";
	   t     = mdate.substr(11,5);
	}else{
	   d     = mdate.substr(5,2) + ".";
	   m     = mdate.substr(8,3) + ".";
	   y     = mdate.substr(12,4) + " - ";
	   t     = mdate.substr(17,5);
	}
	this.evnt.innerHTML = (d+m+y+t);
}

//Creating layers ************
function lib_divCreate(id,cl,txt,w,c,app,ex,txt2){
  if(bw.usedom){
  	var div=document.createElement("DIV");
	div.className=cl;
	div.id=id; 
    if(txt) div.innerHTML=txt;
	if(app){
		app.appendChild(div);
		return div
	}
    if(w) document.body.appendChild(div);
	return div
  }else{
  	var dstr='<div id="'+id+'" class="'+cl+'"' 
    if(ex&&bw.reuse) dstr+=" "+ex;
	dstr+=">"+txt;
	if(txt2) dstr+=txt2; 
    if(c) dstr+='</div>';
	if(w) document.write(dstr)
	else return dstr;
  }
  return ""
}

/*
// Definitionen für Select-Box
var isCal=(location.href.indexOf("sportkal.htm")>-1 || location.href.indexOf("trainzei.htm")>-1)

if (isCal){
   var thisDate = new Date();
   var wm=(location.href.indexOf("trainzei.htm")>-1)?1:0		// 1=week / 0=month
   if (wm){
   	  dayNum=thisDate.getDay();
	  weekdays=new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");
	  var akt = weekdays[dayNum];
	  var aktTxt="heutiger Tag";
	  var lastIndex=dayNum;
	}
	else{
		monthNum=thisDate.getMonth();
		months=new Array("Januar","Februar","Maerz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember");
		var akt = months[monthNum];
		var aktTxt="aktueller&nbsp;Monat";
		var lastIndex=monthNum;
	}
	pic= new Array("&nbsp;","&nbsp;","&nbsp;","&nbsp;","&nbsp;","&nbsp;","&nbsp;","&nbsp;","&nbsp;","&nbsp;","&nbsp;","&nbsp;");
	pic[(wm?(dayNum-1):monthNum)]='<img src="' + imgPath + 'lustig.gif" width="10" height="10" alt="">&nbsp;&nbsp;&nbsp;';
}
*/

/*
function showInfo(show){
	if (show){
	   dInfo.slideIt(cmpage.x50-dInfo.w/2, cmpage.y50-dInfo.h/2, 5, 5);
	   dInfo.showIt();
	}else{
		dInfo.slideIt(0, 0, 5, 5, 'dInfo.hideIt()');

	}
}
*/

/*
function initCal(){
	se=wm?akt.substr(0,2):akt.substr(0,3);
	if (!document.getElementById(se)){     // alles auf Montag bzw. Januar stellen
	   lastIndex = wm?1:0;
	   document.getElementById("oCMenu_top7").innerHTML = "&nbsp;" + (wm?weekdays[1]:months[0]);
	}
	location.href = "#h_"+String(wm?weekdays[lastIndex]:months[lastIndex]);
	setColor();
}

function change(idx){
	idx=wm?idx+1:idx;
	se=wm?String(weekdays[idx].substr(0,2)):String(months[idx].substr(0,3));
	if (!document.getElementById(se)){     // alles auf Montag bzw. Januar stellen
	   showbox('pop2');
	   return;
	}
	lastIndex=idx;
	document.getElementById("oCMenu_top7").innerHTML = "&nbsp;" + (wm?weekdays[idx]:months[idx]);
	setColor();
}

function setColor(){
	if (wm){
	for (Wtag=0; Wtag<7; Wtag++){
		if (document.getElementById(weekdays[Wtag].substr(0,2))){
			zeile = 1;
			even = false;
			while (document.getElementById(weekdays[Wtag].substr(0,2) + zeile)){
				if (even) document.getElementById(weekdays[Wtag].substr(0,2) + zeile).className = (Wtag==lastIndex)?"RowDark2":"RowDark"
				else document.getElementById(weekdays[Wtag].substr(0,2) + zeile).className = (Wtag==lastIndex)?"RowLight2":"RowLight";
				even = !even; zeile++;
			}
		}
	}
	}else{
 	for (mon=0; mon<12; mon++){
		if (document.getElementById(months[mon].substr(0,3))){
		   document.getElementById(months[mon].substr(0,3)).className = "";
		   i=1;
		   while (document.getElementById(months[mon].substr(0,3)+i)){
		   		 document.getElementById(months[mon].substr(0,3)+i).className = "";
		  		 i++;
		   }
		}
	}

 	document.getElementById(months[lastIndex].substr(0,3)).className = "RowLight";
	i=1;
	while (document.getElementById(months[lastIndex].substr(0,3)+i)){
		  document.getElementById(months[lastIndex].substr(0,3)+i).className = "RowLight";
		  i++;
	}
	}
}
*/

function init(){
	dDate = new lib_obj('stand');
	dDate.lastMod();

	//Info-Boxen (hidden)
	im='<img src="' + imgPath + (bw.ie?"ie_16.gif":"ns_16.gif") + '" width="16" height="16">&nbsp;';
	t='<br>Sie verwenden als Browser momentan ' + im + navigator.appName + bw.nstr + '.<br><br>';
	if (bw.ie5 || bw.ie55 || bw.ie6 || bw.ns6 || bw.op6 || bw.op7)
		t+='Die Darstellung dieser Seiten sollte mit diesem Browser problemlos funktionieren. Bei Problemen im Seitenaufbau informieren Sie bitte den Webmaster.<br><br>';
	else{
		t+='Diese Seite verwendet modernste Methoden der Internetseiten-Gestaltung. Eine fehlerfreie Darstellung ist nur mit ';
		t+='den Browsern IE5+ und Netscape 6+ gewährleistet!<br><br>';
	}
	t+='Die beste Darstellung dieser Seite erhalten Sie mit einer Bildschirmauflösung von 1024 * 768 Bildpunkten.<br><br>';
	t+='<div class="info2">Viel Spaß... Ihr Webmaster</div>';

	barTxt="Info zur Darstellung der Seite";
  	new popUp((cmpage.x50-200), (cmpage.y50-116), 400, 232, "pop1", t, "#D8D2D2", "#000000", "bold 10pt sans-serif", barTxt, "336699", "white", "#dddddd", "gray", "black", false, true, false, true, false);


	if (debug){
	   lib_divCreate("h","x","",1,1);
	   lib_divCreate("v","y","",1,1);
	}

}

function print(){
	fileName=wm?"trainzei_dru.htm":"sportkal_dru.htm";
	window.open(fileName,"","status=no, menubar=no, width=680,height=560, resizable=yes, scrollbars=yes")
	return false;	 
}

//---------------------
onload = init;
