var popup_win;
function OpenWindow(url,iWidth,iHeight) {
	var pw_left=(screen.Width-parseInt(iWidth))/2;
	var pw_top=(screen.Height-parseInt(iHeight))/2;
	
	if (!popup_win || popup_win.closed) {
		popup_win=window.open(url, 'popupwin', 'menus=0, scrollbars=auto, toolbars=0, width='+iWidth+', height='+iHeight+', screenX='+pw_left+',screenY='+pw_top+',top='+pw_top+',left='+pw_left+';');
	} else {
		popup_win.close();
		popup_win=window.open(url, 'popupwin', 'menus=0, scrollbars=auto, toolbars=0, width='+iWidth+', height='+iHeight+', screenX='+pw_left+',screenY='+pw_top+',top='+pw_top+',left='+pw_left+';');
	}
}

$(document).ready(function() {
	$("a.image_popup").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'overlayOpacity': 	0.5
	});
});
