var galerija2Id="galerija2"; 
var galerija2Width=910; 
var galerija2Height=400+150; 
var firstShow=true; 
var galerija2Visible=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 toggleGalerija2(){
	if(firstShow){
		var style=document.getElementById(galerija2Id).style;
		style.left=Math.round((getAvailableWidth()-galerija2Width)/2 -8)+"px";
		style.top=Math.round((getAvailableHeight()-galerija2Height)/2 -40)+"px";
		firstShow=false;
	}
	if(galerija2Visible){
		document.getElementById('galerija2').style.display='none';
		galerija2Visible=false;
	}
	else{
		var style=document.getElementById('galerija2').style;
		style.left=Math.round((getAvailableWidth()-galerija2Width)/2 -8)+"px";
		style.top=Math.round((getAvailableHeight()-galerija2Height)/2 -40)+"px";
		style.display='block';
		galerija2Visible=true;
	}
}
function initGalerija2(){
	var element=document.getElementById(galerija2Id);
	if(element==null) return;
	var style=element.style;
	if(style==null) return;
	style.visibility="visible";
	style.position="absolute";
	style.width=galerija2Width+"px";
	style.height=galerija2Height+"px";
}
function loadGalerija2(){
	toggleGalerija2();
}
