
/* Copyright (c) 1999-2005 silvr.net */

function tableAltRowcolor(tableClass, cssClass, odd) {
	if (document.getElementById) {
		var objs = document.getElementsByTagName('table');
		var el, l;
		for (var k = objs.length; k--;) {
			if (cssClassName.test(objs[k], tableClass)) {
				el = objs[k].getElementsByTagName('tbody')[0].getElementsByTagName('tr');
				l = el.length;
				for (var i = 0; i < l; i++) {
					(odd ? !(i % 2) : (i % 2)) ? cssClassName.add(el[i], cssClass) : 0;
}	}	}	}	}

var cssClassName = {
	add:  function(obj, cssClass) { obj.className += (obj.className ? ' ' : '') + cssClass; },
	del:  function(obj, cssClass) { obj.className = obj.className.replace(new RegExp('^'+cssClass+'\\b| '+cssClass+'\\b'), ''); },
	test: function(obj, cssClass) { return new RegExp('\\b'+cssClass+'\\b').test(obj.className); }
};


/// framing...
var getViewport = {
	W: function() { return (window.innerWidth)?window.innerWidth:(document.documentElement && document.documentElement.clientWidth)?document.documentElement.clientWidth:(document.body && document.body.clientWidth)?document.body.clientWidth:0; },
	H: function() {	return (window.innerHeight)?window.innerHeight:(document.documentElement && document.documentElement.clientHeight)?document.documentElement.clientHeight:(document.body && document.body.clientHeight)?document.body.clientHeight:0; }
};

if (document.getElementById && !/opera.5|opera.6/i.test(navigator.userAgent)) {
	var newCss = '<style type="text/css" media="screen">' +
	'body { overflow: hidden; }' +
	((/msie 6/i.test(navigator.userAgent)) ? 'html { overflow: hidden; }' : '') +
	'#footer { position: absolute; bottom:0px; left:' + Math.max((getViewport.W() - 770) / 2, 10) + 'px; }' +
	'#main-row { overflow: auto; height:'+ Math.max(getViewport.H() -170, 0) + 'px; }' +
	'</style>';
	document.write(newCss);
}

function fakedFrame() {
	if (document.getElementById) {
		document.getElementById('footer').style.left = Math.max((getViewport.W() - 770) / 2, 10) + 'px';
		document.getElementById('main-row').style.height = Math.max(getViewport.H() -170, 0) + 'px';
	}
}


window.onload = function() {
	fakedFrame();
	tableAltRowcolor('daten','odd',1);
};

window.onresize = function() {
	fakedFrame();
};

