var defwidth  = 300;
var defheight = 400;

function popimg(src, alt, w, h)
{
	if ( !w ) w = defwidth;
	if ( !h ) h = defheight;
	
	var w1 = window.open(
		"popimg.php?src=" + encodeURI(src) + "&alt=" + encodeURI(alt) + "&w=" + w + "&h=" + h,
		"winFoto",
		"width=" + w + "," + "height=" + h +
			",titlebar=yes,menubar=no,toolbar=no,location=no,status=no,resizable=yes,scrollbars=no,directories=no");

	w1.focus();
	return false;
}

function popresize()
{
	var fw, fh;
	if ( self.innerWidth )
	{
		fw = self.innerWidth;
		fh = self.innerHeight;
	}
	else if ( document.documentElement && document.documentElement.clientWidth )
	{
		fw = document.documentElement.clientWidth;
		fh = document.documentElement.clientHeight;
	}
	else if ( document.body )
	{
		fw = document.body.clientWidth;
		fh = document.body.clientHeight;
	}
	else
	{
		fw = defwidth;
		fh = defheight;
	}

	var iw = document.getElementById("foto").width;
	var ih = document.getElementById("foto").height + 20;

	window.resizeBy(iw - fw, ih - fh);
}

