var projektId="projekt";
var projektWidth=766; 
var projektHeight=518 + 100; 
var firstShow=true; 
var projektVisible=false;

function getAvailableWidth(){
	var calcWidth=0;
	if(window.innerWidth)calcWidth=window.innerWidth;
	else calcWidth=(document.compatMode=='CSS1Compat'?document.documentElement.clientWidth:document.body.clientWidth);
	return calcWidth;
}
function getAvailableHeight(){
	var calcHeight=0;
	if(window.innerHeight) calcHeight=window.innerHeight;
	else calcHeight=(document.compatMode=='CSS1Compat'?document.documentElement.clientHeight:document.body.clientHeight);
	return calcHeight;
}
function toggleProjekt(){
	if(firstShow){
		var style=document.getElementById(projektId).style;
		style.left=Math.round((getAvailableWidth()-projektWidth)/2)+"px";
		style.top=Math.round((getAvailableHeight()-projektHeight)/2)+"px";
		firstShow=false;
	}
	if(projektVisible){
		document.getElementById('projekt').style.display='none';
		projektVisible=false;
	}
	else{
		var style=document.getElementById('projekt').style;
		style.left=Math.round((getAvailableWidth()-projektWidth)/2)+"px";
		style.top=Math.round((getAvailableHeight()-projektHeight)/2)+"px";
		style.display='block';
		projektVisible=true;
	}
}
function initProjekt(){
	var element=document.getElementById(projektId);
	if(element==null) return;
	var style=element.style;
	if(style==null) return;
	style.visibility="visible";
	style.position="absolute";
	style.width=projektWidth+"px";
	style.height=projektHeight+"px";
}
function loadProjekt(){
	toggleProjekt();
}

