var theOffset = 180;
var theFrameWidth = '660px';
var params = location.search.toQueryParams();
var currentPage;
var undefined;


function setPage() {
	switch(currentPage) {
		case "home":
		case "news":
			$('centercolumn').setStyle({
				'margin' : '0px 10px 0px 10px',
				'width' : '467px'
			});
			$('rightcolumn').setStyle({
				'width' : '167px'
			}).show();
		break;

		default:
		break;
	}
}


function trueheight() {
	var theHeight = 0;
	if (window.innerHeight) {
		theHeight = window.innerHeight;
	} else if (document.body && document.documentElement.clientHeight) {
		theHeight = document.documentElement.clientHeight;
	}
	return theHeight;
}


function findLink(thePage) {
	var theLinkId = "a_" + thePage;
	return $(theLinkId);
}


function initMenu() {
	try {
		currentPage = (params.page == undefined) ? "home" : params.page;
		findLink(currentPage).addClassName("marked");
	} catch(err) {
		void(0);
	}
}


function anpassen() {
	// var fhoehe = trueheight() - theOffset;
  var fhoehe = 1250;

	/* iframe für gema */
	try {
		$('theiframe').setStyle({
			'height' : fhoehe + 'px',
			'width' : theFrameWidth
		});
	} catch(err) {
		void(0);
	}
}


document.observe("dom:loaded", function() {
				anpassen();
				initMenu();
				setPage();
			});

Event.observe(window, "resize", anpassen);



