<!--
/* 	All functions are cross browser tested
	10:39 19.02.2010 
	Frank Weisbrodt 
*/

/* window openers */

// center and no resize
function cn(url, name, w, h)
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=no,toolbar=no'
	winContent = window.open(url, name, winprops)
	winContent.focus()
}

// center and resize
function cy(url, name, w, h)
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,resizable=yes,toolbar=no'
	winContent = window.open(url, name, winprops)
	winContent.focus()
}

// set position and no resize
function wn(url, name, w, h, t, l) 
{
	winprops = 'height='+h+',width='+w+',top='+t+',left='+l+',scrollbars=no,resizable=no,toolbar=no'
	winContent = window.open(url, name, winprops)
	winContent.focus();
}

// set position and resize
function wy(url, name, w, h, t, l)
{
	winprops = 'height='+h+',width='+w+',top='+t+',left='+l+',scrollbars=yes,resizable=yes,toolbar=no'
	winContent = window.open(url, name, winprops)
	winContent.focus();
}

/* Show - hide DIV tags */
// click to show and click to hide
function show(x)
{
	 if (document.getElementById(x).style.display == 'block')
	 {
		document.getElementById(x).style.display = 'none';
	 }
	 else
	 {
		document.getElementById(x).style.display = 'block';
	 }
}

// click to show and click to hide, change the trigger
function showChange(x, href)
{
	if (document.getElementById(x).style.display == 'block')
	{
		document.getElementById(x).style.display = 'none';
		href.innerHTML = '[+]'
	}
	else
	{
		document.getElementById(x).style.display = 'block';
		href.innerHTML = '[&ndash;]'
	}
}

// Only one at the same time
var lastdisplayed = null;
var hideme = null;

function showHide(x)
{
	// remove the text
	if (document.getElementById(x).style.display == 'block')
	{
		document.getElementById(x).style.display = 'none';
	}
	// show text
	else
	{	
		if (lastdisplayed != null) {
		   hideme = document.getElementById(lastdisplayed);
		   hideme.style.display = 'none';
		}
		document.getElementById(x).style.display = 'block';
		lastdisplayed = x;
	}
}

// Only one at the same time, change the trigger
// Danke Christine
var lastdisplayed = null;
var lastref = null;
var hideme = null;

function toggle(x, href)
{
	// remove the text and set +
	if (document.getElementById(x).style.display == 'block')
	{
		document.getElementById(x).style.display = 'none';
		href.innerHTML = '[+]';
	}
	// show text and -
	else
	{	
		if (lastdisplayed != null) {
		   hideme = document.getElementById(lastdisplayed);
		   hideme.style.display = 'none';
		   lastref.innerHTML = '[+]';
		}
		document.getElementById(x).style.display = 'block';
		href.innerHTML = '[&ndash;]';
		lastdisplayed = x;
		lastref = href;
	}
}  

/*
	Zebratabelle (c) 2008 J. Strübig
	Letzte Änderungen: 11:56 29.03.2010
	Frank Weisbrodt
*/
function ZT(t) {
	var obj = t;
	var rows = [];
	var self = this;
	
	var hasBody = !!t.getElementsByTagName('tbody').length;
	var body = t.getElementsByTagName('tbody').length ? t.getElementsByTagName('tbody')[0] : t;
	var rows = body.getElementsByTagName('tr');
	for(var i = 0; i < rows.length; i += 2) rows[i].className += ' odd';
}
ZT.init = function() {
	// Alle Tabellen der Klasse ZT
	var t = document.getElementsByTagName('table');
	var r = /\bZT\b/i;
	for(var i = 0; i < t.length; i++) {
		if(t[i].className && r.test(t[i].className) ) {
		var tmp = new ZT(t[i]);
		}
	}
};
// ZT.init();
// ist der Trigger, muss ins Dokument

//-->
