
/* script to resize popup according to image size */

function fitPic() {	
	var iWidth = (window.innerWidth) ? window.innerWidth : document.body.clientWidth;
	var iHeight = (window.innerHeight) ? window.innerHeight : document.body.clientHeight;
	if(document.images[0].width <= 1) { return; }
    iWidth = document.images[0].width + 80 - iWidth;
    iHeight = document.images[0].height + 120 - iHeight;
    window.resizeBy(iWidth, iHeight);
	self.focus();
}