var galerija5Id="galerija5"; 
var galerija5Width=910; 
var galerija5Height=400+150;
var firstShow=true; 
var galerija5Visible=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 toggleGalerija5(){
	if(firstShow){
		var style=document.getElementById(galerija5Id).style;
		style.left=Math.round((getAvailableWidth()-galerija5Width)/2 -8)+"px";
		style.top=Math.round((getAvailableHeight()-galerija5Height)/2 -40)+"px";
		firstShow=false;
	}
	if(galerija5Visible){
		document.getElementById('galerija5').style.display='none';
		galerija5Visible=false;
	}
	else{
		var style=document.getElementById('galerija5').style;
		style.left=Math.round((getAvailableWidth()-galerija5Width)/2 -8)+"px";
		style.top=Math.round((getAvailableHeight()-galerija5Height)/2 -40)+"px";
		style.display='block';
		galerija5Visible=true;
	}
}
function initGalerija5(){
	var element=document.getElementById(galerija5Id);
	if(element==null) return;
	var style=element.style;
	if(style==null) return;
	style.visibility="visible";
	style.position="absolute";
	style.width=galerija5Width+"px";
	style.height=galerija5Height+"px";
}
function loadGalerija5(){
	toggleGalerija5();
}
