// JavaScript Document

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {

			var contentElement = document.getElementById('content_out_1');
			var footerElement = document.getElementById('footer_out_1');
			var wrapperElement = document.getElementById('wrapper');

			footerElement.style.background = '#e2b04f url(/bilder/footer_in_schatten_seite.jpg)  center top no-repeat';
			footerElement.style.height = 39 + 'px';
			document.getElementById('footer_in').style.height = 39 + 'px';

			wrapperElement.style.background = '#e2b04f url(/bilder/content_out_2.jpg)  center top repeat-y';
			wrapperElement.style.height = windowHeight + 'px';

			var contentHeight = contentElement.offsetHeight;
			var footerHeight  = footerElement.offsetHeight;

			if (windowHeight - (contentHeight + footerHeight + 349) >= 0) {
				footerElement.style.position = 'absolute';
				footerElement.style.top = (windowHeight - footerHeight) + 'px';
			}
			else {
				footerElement.style.position = 'static';
			}
		}
	}
}
$(function(){
	setFooter();
});
window.onresize = function() {
	setFooter();
}

/*$(document).ready(function(){
    $("#accordion").accordion({ header: 'h1', autoHeight: false, active: 'first child', collapsible: true, icons: { header: 'ui-icon-triangle-1-e', headerSelected: 'ui-icon-triangle-1-s' }  });
  });
*/
