/* ars navigandi GmbH - arscms */
/* /styles/js/std.js */

/* begin area popup window sizes ************************************************/

popupWindow_style = new Array();
popupWindow_style['standardPopup'] = {'width':558,'height':546,'xPos':40,'yPos':40,'windowOptions':'dependent=yes,scrollbars=yes,resizable=yes'};
popupWindow_style['conditions_for_participating'] = {'width':990,'height':630,'xPos':10,'yPos':10,'windowOptions':'dependent=yes,scrollbars=yes,resizable=yes'};

popupWindow_style['lesson'] = {'width':925,'height':663,'xPos':2,'yPos':2,'windowOptions':'dependent=yes,scrollbars=no,resizable=yes'};
popupWindow_style['encyclopedia'] = {'width':807,'height':630,'xPos':10,'yPos':10,'windowOptions':'dependent=yes,scrollbars=yes,resizable=yes'};
popupWindow_style['news'] = {'width':807,'height':630,'xPos':10,'yPos':10,'windowOptions':'dependent=yes,scrollbars=yes,resizable=yes'};
popupWindow_style['media'] = {'width':807,'height':630,'xPos':10,'yPos':10,'windowOptions':'dependent=yes,scrollbars=yes,resizable=yes'};
popupWindow_style['teaserspiel'] = {'width':807,'height':600,'xPos':10,'yPos':10,'windowOptions':'dependent=yes,scrollbars=no,resizable=yes'};
popupWindow_style['imagefilms'] = {'width':807,'height':640,'xPos':10,'yPos':10,'windowOptions':'dependent=yes,scrollbars=no,resizable=yes'};

/* this method find out height of possible space for content, sets maximum height for scrolling content */
function setScrollingHeight(id1,id2,minusheight1,minusheight2,bodyheightlimit,secondTry) {

	innerHeightAvailable1 = getWindowLayout()['innerHeight'];
	innerHeightAvailable2 = getWindowLayout()['innerHeight'];
	
	if (innerHeightAvailable1 > bodyheightlimit) {
		innerHeightAvailable1 = bodyheightlimit
	}

	id1Height = innerHeightAvailable1-minusheight1;
	id2Height = innerHeightAvailable2-minusheight2;
	
	agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("firefox") != -1) {
		id1Height=id1Height+150;
		id2Height=+150;
	}
	
	try {
		document.getElementById(id1).style.height=id1Height+"px";
	} catch (ex) {
		//
	}

	if (secondTry) {
		// is second try: do nothing
	} else {
		setScrollingHeight(id1,id2,minusheight1,minusheight2,bodyheightlimit,1)
	}
}
/* end area popup window sizes **************************************************/


function changeBackground(value) {
document.getElementById('mce_editor_0').contentWindow.document.body.style.backgroundImage = "url(/content/sample/images/interactive/background/"+value+")";
}
