var popupStatus = 0;

//loading popup with jQuery magic!
function loadPopup()
{
	//loads popup only if it is disabled
	if(popupStatus==0)
	{
		document.getElementById("backgroundPopup").style.display='block';
		document.getElementById("popupContact").style.display='block';
		popupStatus = 1;
	}
}

//disabling popup with jQuery magic!
function disablePopup()
{
	//disables popup only if it is enabled
	if(popupStatus==1)
	{
		document.getElementById("backgroundPopup").style.display='none';
		document.getElementById("popupContact").style.display='none';
		popupStatus = 0;
	}
}

//centering popup
function centerPopup(){
	//request data for centering
	var windowWidth = document.body.clientWidth;
	var windowHeight = document.body.clientHeight;
	
	var popupHeight = 384;
	var popupWidth = 555;
	//centering
	document.getElementById("popupContact").style.top = Math.round(windowHeight/2-popupHeight/1.5) + 'px';
	document.getElementById("popupContact").style.left = Math.round(windowWidth/2-popupWidth/2) + 'px';
	
	
	try
	{
		document.getElementById("backgroundPopup").style.height = windowHeight + 'px';
	}
	catch(err)
	{
	}	
}

function readRecensioner()
{
	//centering with css
		centerPopup();
		//load popup
		loadPopup();
}
