function over(nr)
{
	var nr2 = nr + 1;
	if(document.getElementById)
	{
		eval("document.getElementById('b" + nr + "').style.color = '#CC0000';");
		eval("document.getElementById('b" + nr2 + "').style.color = '#CC0000';");
	}
	else if(document.all)
	{
		eval("document.all.b" + nr + ".style.color = '#CC0000';");
		eval("document.all.b" + nr2 + ".style.color = '#CC0000';");
	}
}

function out(nr)
{
	var nr2 = nr + 1;
	if(document.getElementById)
	{
		eval("document.getElementById('b" + nr + "').style.color = 'silver';");
		eval("document.getElementById('b" + nr2 + "').style.color = 'silver';");
	}
	else if(document.all)
	{
		eval("document.all.b" + nr + ".style.color = 'silver';");
		eval("document.all.b" + nr2 + ".style.color = 'silver';");
	}
}

toc1an = new Image();
toc1an.src = "http://www.scz-jugend.enuba.de/allgemein/prev_akt.gif";

toc1aus = new Image();
toc1aus.src = "http://www.scz-jugend.enuba.de/allgemein/prev.gif"; 

toc2an = new Image();
toc2an.src = "http://www.scz-jugend.enuba.de/allgemein/home_akt.gif";

toc2aus = new Image();
toc2aus.src = "http://www.scz-jugend.enuba.de/allgemein/home.gif";

toc3an = new Image();
toc3an.src = "http://www.scz-jugend.enuba.de/allgemein/next_akt.gif";

toc3aus = new Image();
toc3aus.src = "http://www.scz-jugend.enuba.de/allgemein/next.gif";

function img_act(imgName, imgNr)
{
	var imgOn = eval(imgName + "an.src");
	if(document.getElementById)
	{
		eval("document.getElementById('" + imgName + "').src = imgOn;");
	}
	else if(document.all)
	{
		eval("document.all." + imgName + ".src = imgOn;");
	}
	else if(document.images)
	{
		document.images[imgNr].src = imgOn;
	}
}

function img_inact(imgName, imgNr)
{
	var imgOff = eval(imgName + "aus.src");
	if(document.getElementById)
	{
		eval("document.getElementById('" + imgName + "').src = imgOff;");
	}
	else if(document.all)
	{
		eval("document.all." + imgName + ".src = imgOff;");
	}
	else if(document.images)
	{
		document.images[imgNr].src = imgOff;
	}
}

function shrink(url, x, y, orig_width, orig_height)
{
	var id = url.substring(url.lastIndexOf('/')+1,url.length);
	if(document.getElementById(id).width > x && document.getElementById(id).height > y)
	{
		document.getElementById(id).width = eval(document.getElementById(id).width - x);
		document.getElementById(id).height = eval(document.getElementById(id).height - y);
		eval("window.setTimeout(\"shrink('" + url + "'," + x + "," + y + "," + orig_width + "," + orig_height + ")\", 1);");
	}
	else
	{
    // vor dem verweis die originalgröße wiederherstellen
    document.getElementById(id).width = orig_width;
    document.getElementById(id).height = orig_height;
		verweis(url);
	}
}

function shrinkImage(id, x, y, orig_width, orig_height)
{
	if(document.getElementById(id).width > x && document.getElementById(id).height > y) {
		document.getElementById(id).width = eval(document.getElementById(id).width - x);
		document.getElementById(id).height = eval(document.getElementById(id).height - y);
		eval("window.setTimeout(\"shrinkImage('" + id + "'," + x + "," + y + "," + orig_width + "," + orig_height + ")\", 1);");
	}
	else {
		// vor dem verweis die originalgröße wiederherstellen
		document.getElementById(id).width = orig_width;
		document.getElementById(id).height = orig_height;
	}
}

function resizeImage(id) {
	if(document.all && eval("document.all." + id + ".filters")) {
		eval("document.all." + id + ".filters.revealTrans.Apply();");
		eval("document.all." + id + ".style.visibility = 'hidden';");
		eval("document.all." + id + ".filters.revealTrans.Play()");
	}
	else if(document.getElementById) {
		if(document.getElementById(id).width == 150)
		{
			var x = 3;
			var y = 2;
			shrinkImage(id,x,y,150,100);
		}
		else if(document.getElementById(id).width == 100)
		{
			var x = 2;
			var y = 3;
			shrinkImage(id,x,y,100,150);
		}
	}
}


function bild(url)
{
	var id = url.substring(url.lastIndexOf('/')+1,url.length);
	if(document.all && eval("document.all." + id + ".filters"))
	{
		eval("document.all." + id + ".filters.revealTrans.Apply();");
		eval("document.all." + id + ".style.visibility = 'hidden';");
		eval("document.all." + id + ".filters.revealTrans.Play()");
		eval("window.setTimeout('verweis(" + '"' + url + '"' + ")', 1000);");
	}
	else if(document.getElementById)
	{
		if(document.getElementById(id).width == 150 && document.getElementById(id).height == 100)
		{
			var x = 3;
			var y = 2;
			shrink(url,x,y,150,100);
		}
		else if(document.getElementById(id).width == 100 && document.getElementById(id).height == 150)
		{
			var x = 2;
			var y = 3;
			shrink(url,x,y,100,150);
		}
		else
		{
			verweis(url);
		}
	}
	else
	{
		verweis(url);
	}
}

function verweis(url)
{
	var ext = url.substring(url.lastIndexOf('.')+1,url.length);
	if(ext.length > 4 || ext.length < 3) {
		eval("location.href = '" + url + "/index.php';");
	}
	else {
		location.href = url ;
	}	
}

var bildfenster = null;
function thumbs(url, width, height, title)
{
	if(!bildfenster || bildfenster.closed)
	{
		fenstername = 'Foto';
		fensterconfig = "width=" + width + ", height=" + height + ", left=" + eval(screen.width/2-width/2) + ", top=" + eval(screen.height/2-height/2) + ", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no";
		bildfenster = window.open("", fenstername, fensterconfig);
		bildfenster.document.open();
		bildfenster.document.writeln("<html><head><title>" + title + "<\/title><\/head>");
		bildfenster.document.writeln("<body bgcolor=\"#C7D3FD\" style=\"margin-top:0px; margin-left:0px; margin-right:0px; margin-bottom:0px;\"><a href=\"javascript:self.close()\"><img src=\"" + url + "\" border=\"0\" alt=\"Fenster Schlie&szlig;en\"><\/a><\/body><\/html>");
		bildfenster.document.close();
		bildfenster.focus();
	}
	else
	{
		bildfenster.focus();
	}
}
