function showPicture(NAME, WIDTH, HEIGHT)
{
	var url = 'grafik/' + NAME + '.jpg';
	var x, y, posX, posY;

	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	} else {
		x = window.innerWidth;
		y = window.innerHeight;
	}
	
	posX = Math.round(x / 2) - Math.round(WIDTH / 2);
	posY = Math.round(y / 2) - Math.round(HEIGHT / 2);
	
	document.getElementById('popupLayer').style.top = '0px';
	document.getElementById('popupLayer').style.left = '0px';
	document.getElementById('popupLayer').style.width = x + 'px';
	document.getElementById('popupLayer').style.height = y + 'px';
	document.getElementById('popupLayer').style.display = 'block';
	document.getElementById('popupPicture').src = url;
	document.getElementById('popupPicture').onload = showLayer(posX, posY, WIDTH, HEIGHT);
}

function showLayer(posX, posY, WIDTH, HEIGHT)
{
	document.getElementById('pictureLayer').style.top = posY + 'px';
	document.getElementById('pictureLayer').style.left = posX + 'px';
	document.getElementById('pictureLayer').style.width = WIDTH + 'px';
	document.getElementById('pictureLayer').style.height = HEIGHT + 'px';
	document.getElementById('pictureLayer').style.display = 'block';
}

function hidePicture()
{
	document.getElementById('popupLayer').style.display = 'none';
	document.getElementById('pictureLayer').style.display = 'none';
}
