var shows = true;
var folder = false;
var ftitle = "";
var pshown = 1;
var jetzt = new Date();
var Jahresmonat = jetzt.getMonth();
var Monat = new Array("jan", "feb", "mrz", "apr", "mai", "jun",
                      "jul", "aug", "sep", "okt", "nov", "dez");
var fwidth = "";
var fheight = "";					  

function start(ID) {
// u-Elemente anzeigen
var uelements = document.getElementsByTagName("u");
var count = uelements.length;
for (var i = 0; i < count; i++) {
	document.getElementsByTagName("u")[i].style.display = "inline";
	}

// JS-Hinweis ausblenden
if (document.getElementById("jshinweis")) {
	document.getElementById("jshinweis").style.display = "none"; }

// Webcounter-Image laden
if (document.getElementById("countimg")) {
var siteurl = document.URL;
var pathelem = siteurl.split("/");
if ( pathelem[0] == "http:" ) {
	if (pathelem[3]) { var counttext = pathelem[3]; }
	if (pathelem[4]) { var counttext = pathelem[3] + " : " + pathelem[4]; }
	if (pathelem[5]) { var counttext = pathelem[3] + " : " + pathelem[4] + " : " + pathelem[5]; }
	if (pathelem[6]) { var counttext = pathelem[3] + " : " + pathelem[4] + " : " + pathelem[5] + " : " + pathelem[6]; }
	document.getElementById("countimg").src = "http://webcounter.goweb.de/18995FREESTRING-" + counttext;
	}
}
}

function count(ID) {
if (document.getElementById("countimg")) {
var siteurl = document.URL;
var counttext = ":";
var pathelem = siteurl.split("/");
if ( pathelem[0] == "http:" ) {
	if (pathelem[4]) { counttext = pathelem[3]; }
	if (pathelem[5]) { counttext = pathelem[3] + " : " + pathelem[4]; }
	if (pathelem[6]) { counttext = pathelem[3] + " : " + pathelem[4] + " : " + pathelem[5]; }
	document.getElementById("countimg").src = "http://webcounter.goweb.de/18995FREESTRING-" + counttext + " : " + ID;
}
}
}

function winopen(select, width, height, title) {
	if (folder == true) {
		var url = select + "/" + path + "01." + ftype; }
	else {
		var url = path + select + "." + ftype; }
	parent.frame.location.href = url;
	if (fwidth > (document.body.clientWidth - 48)) { fwidth = (document.body.clientWidth - 48); }
	if (fheight > (document.body.clientHeight - 72)) { fheight = (document.body.clientHeight - 72); }	
	if (fwidth == "" ) { fwidth = (document.body.clientWidth - 48); }
	if (fheight == "" ) { fheight = (document.body.clientHeight - 72); }	
	var width = fwidth;
	var height = fheight;
	document.getElementById('layer').style.width = "100%";
	document.getElementById('layer').style.height = "100%";	
	document.getElementById('frame').style.width = width + "px";
	document.getElementById('frame').style.height = height + "px";
	document.getElementById('frahmen').style.width = (width+16)	+ "px";
	document.getElementById('frahmen').style.height = (height+40) + "px";
	document.getElementById('frame').style.marginLeft = "-" + (width/2) + "px";
	document.getElementById('frame').style.marginBottom = "-" + ((height/2)+12) + "px";	
	document.getElementById('frahmen').style.marginLeft = "-" + ((width+16)/2) + "px";
	document.getElementById('frahmen').style.marginBottom = "-" + ((height+40)/2) + "px";
	document.getElementById('body').style.overflow = "hidden";			
	document.getElementById('layer').style.display = "block";
	document.getElementById('frahmen').style.display = "block";	
	document.getElementById('frame').style.display = "block";
	if ( title == undefined ) {
		if ( ftitle == "" ) { title = select;}
		else { title = ftitle; }
	}	
	document.getElementById('winname').innerHTML = title;
}

function winclose(ID) {
	document.getElementById('body').style.overflow = "auto";
	document.getElementById('layer').style.display = "none";
	document.getElementById('frahmen').style.display = "none";		
	document.getElementById('frame').style.display = "none";	
}	

function hide(ID) {
	if (ID == "vmon") {
	for (var i = 0; i < Jahresmonat; i++) {
	document.getElementById(Monat[i]).style.display = "none"; }
	shows = true;
	if (Jahresmonat == 0) {
	document.getElementById('switch').style.display = "none"; }	
	}
	else {
	document.getElementById(ID).style.display = "none"; 
	shows = true; }
}

function change(type,on,off,ID) {
if (type == "vmon") {
if (shows == true) { 
for (var i = 0; i < Jahresmonat; i++) {
document.getElementById(Monat[i]).style.display = "block"; }
document.getElementById('switch').innerHTML = "<a class=\"ausbl\" href=\"javascript:change(\'vmon\',0);\">vergangene Monate ausblenden</a>";
shows = false; } 
else {
for (var i = 0; i < Jahresmonat; i++) {
document.getElementById(Monat[i]).style.display = "none"; }
document.getElementById('switch').innerHTML = "<a class=\"einbl\" href=\"javascript:change(\'vmon\',0);\">vergangene Monate einblenden</a>";
shows = true;
}
}
if (type == "showhide") {
if (shows == true) {
document.getElementById(ID).style.display = "block";
document.getElementById('switch').className = "ausbl";
document.getElementById('switcht').innerHTML = off;
shows = false;
}
else {
document.getElementById(ID).style.display = "none";
document.getElementById('switch').className = "einbl";
document.getElementById('switcht').innerHTML = on;
shows = true;
}
}
}

function changepic(ID) {
if (ID == 'next') {
	pshown = (pshown + 1);
	if (pshown > anz_bild) { pshown = 1 }
	if (typeof filenames != "undefined") parent.I1.location.href = "slides/" + filenames[pshown-1] + ".html";
 	else parent.I1.location.href = "slides/" + pshown + ".html";
	document.getElementById('picnum').innerHTML = pshown;
	if (shows == false) { document.getElementById(pshown).focus(); }
	document.getElementById('picdesc').innerHTML = comments[(pshown-1)];	
	return;
	}
if (ID == 'prev') {
	pshown = (pshown - 1);
	if (pshown < 1) { pshown = anz_bild }	
	if (typeof filenames != "undefined") parent.I1.location.href = "slides/" + filenames[pshown-1] + ".html";
 	else parent.I1.location.href = "slides/" + pshown + ".html";
	document.getElementById('picnum').innerHTML = pshown;	
	if (shows == false) { document.getElementById(pshown).focus(); }
	document.getElementById('picdesc').innerHTML = comments[(pshown-1)];	
	return;
	}
if (ID == undefined) { return; }
	pshown = ID;
	document.getElementById('picnum').innerHTML = pshown;
	if (shows == false) { document.getElementById(pshown).focus(); }
	document.getElementById('picdesc').innerHTML = comments[(pshown-1)];
}	

function picopen(url,size,text) {
	var element = document.getElementById('fenster');
	var iwidth = document.documentElement.clientWidth;
	var iheight = document.documentElement.clientHeight;
	var yoffset = document.documentElement.scrollTop;
	var pheight = document.getElementById('winpic').height;
	if (size == 's') {
	var width = "464px";
	var height = "464px";
	var top = ((iheight - 464)/2)+yoffset + "px";
	var marleft = "-232px";
	}
	if (size == 'm') {
	var width = "568px";
	var height = "568px";
	var top = ((iheight - 568)/2)+yoffset + "px";
	var marleft = "-279px";
	}	
	if (size == 'l') {
	document.getElementById("winpic").src = url;		
	element.style.width = iwidth;	
	element.style.height = iheight;
	document.getElementById("winpic").style.border = "8px solid #333";
	var top = yoffset + "px";
	var marleft = "-" + ((iwidth/2)+64) + "px";
	if (document.getElementById("winpic").height > iheight) { document.getElementById("winpic").style.height = iheight-64 + "px";};
	}		
	element.className = size;
	element.style.top = top;	
	element.style.marginLeft = marleft;
	element.style.width = fwidth;
	element.style.height = fheight;
	element.style.display = "block";
	element.style.opacity = "1";
	var doctype = url.split(".");
	if (doctype[1] == "jpg" || doctype[1] == "JPG") {
	document.getElementById('winpic').src = "../images/loading.gif"; 
	document.getElementById("winpic").src = url;		
	document.getElementById('fototext').innerHTML = text; }
	if (doctype[1] == "html" || doctype[1] == "htm") {
	parent.I1.location.href = url;
	}
}

function picclose () {
    element = document.getElementById('fenster');
	for(i = 1;i <= 50;i++) 
                window.setTimeout('element.style.opacity = ' + (1 - i / 100) + ';', i); 
	window.setTimeout('document.getElementById("winpic").src = "../images/loading.gif";', 200);
	window.setTimeout('element.style.display = "none";', 200);
}

function info(ID) {
}

	


