function getActualScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	return yScroll;
}


function OpenGame(iWidth, iHeight, sText){

	var iOffset = getActualScroll() +  (iWindowHeight - (parseInt(iHeight) + 20) ) / 2;

	iOffset  = iOffset  < 60 ? 60 : iOffset;
	document.getElementById('flashgame_container_content').parentNode.style.marginTop = (iOffset- 30) + 'px'  ;

	document.getElementById('flashgame_container').style.display = 'block';
	document.getElementById('flashgame_containerbg').style.display = 'block';

	document.getElementById('flashgame_container_content').innerHTML = sText;

	document.getElementById('flashgame_container_content').previousSibling.style.width =  (parseInt(iWidth ) - 10)  + 'px';
	document.getElementById('flashgame_container_content').style.width = iWidth + 'px';
	document.getElementById('flashgame_container_content').parentNode.style.width = iWidth + 'px';

	document.getElementById('flashgame_container_content').style.height = iHeight + 'px';
	document.getElementById('flashgame_container_content').parentNode.style.height = (parseInt(iHeight) + 30) + 'px';

	
}

function CloseGame(){
	document.getElementById('flashgame_container').style.display = 'none';
	document.getElementById('flashgame_containerbg').style.display = 'none';
	document.getElementById('flashgame_container_content').innerHTML = '';
}






var iMinWidth = 1150;
var iMinHeight = 200;


function Fensterweite (){
/*	try{
		iWindowWidth = window.innerWidth;
	}
	catch(e){
		iWindowWidth = 0;
	}
*/
	iWindowWidth = 0;
	if(!iWindowWidth)
	{
		document.getElementById('windowhelper').style.display = 'block';
		iWindowWidth = document.getElementById('windowhelper').offsetLeft;
		if(iWindowWidth){
			iWindowWidth = iWindowWidth + 10;
		}
	}
	document.getElementById('windowhelper').style.display = 'none';
}

function Fensterhoehe ()
{
/*	try{
		iWindowHeight = window.innerHeight;
	}
	catch(e){
		iWindowHeight = 0;
	}
*/
	iWindowHeight = 0;
	if(!iWindowHeight)
	{
		document.getElementById('windowhelper').style.display = 'block';
		iWindowHeight = document.getElementById('windowhelper').offsetTop;
		if(iWindowHeight){
			iWindowHeight = iWindowHeight + 10;
		}
	}
	document.getElementById('windowhelper').style.display = 'none';
}

function Inhalthoehe ()
{
	if(iContentheight2.length){
		iContentheight = iContentheight2;
	}
	document.getElementById('widthHelper').style.height= iContentheight + 'px';
	document.getElementById('flashgame_containerbg').style.height= iContentheight +'px';
}

function ScaleFlash()
{
	
	if(iMinWidth > iWindowWidth ){
		iWindowWidth  = iMinWidth;
	}

	document.getElementById('widthHelper').style.width= iWindowWidth  + 'px';
	document.getElementById('widthHelper').style.overflow = 'hidden';
}

function neuAufbau()
{
	Inhalthoehe();
	Fensterweite();
	Fensterhoehe();
	ScaleFlash();
}


try{
	neuAufbau();
	window.onresize = neuAufbau;
}
catch(e){

}


