// dirks open window met autoclse

function getBigPhoto(bigPhoto,w,h,txt) {
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
mypage = '/share/bigphoto.php?photo=' + bigPhoto +'&txt=' + txt;
myname = 'bigPhoto'
settings = 'toolbar=0,resizable=0,menubar=0,location=0,status=0,scrollbars=0,Width=' +w + ',Height=' +h + ',top='+TopPosition+',left='+LeftPosition;
window.open(mypage,myname,settings);
}


// *** New Window AutoCenter
function NewWindow(mypage,myname,w,h,scroll) 
{	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings ='height='+h+',width='+w+',top='+(TopPosition-50)+',left='+LeftPosition+',scrollbars='+scroll+',resizable';
	window.open(mypage,myname,settings);
}

// *** Change Window Size to Image Size + mwidth mheight
function SetimgSize(title,mwidth,mheight) 
{	iWidth  = document.body.clientWidth;
	iHeight = document.body.clientHeight;
	iWidth  = document.images[0].width - iWidth;
	iHeight = document.images[0].height - iHeight;
	window.resizeBy(iWidth + mwidth, iHeight + mheight);
	//alert(iWidth + " x " + iHeight);
	self.focus();document.title=title;
}

//Example:
//Page with link: <a onclick="NewWindow('popupimg.html','imgname','200','200','no');">TEST</a>
//200x200 will be the average expected popup size.
//popupimg.html: <img src="comingsoon.gif" alt="comingsoon" border="0" onload="SetimgSize('CommingSoon POPUP',20,70);"></a>