function popup(image)
{
	var width = 100;
	var height = 100;
	var iLeft = ( screen.availWidth  - width ) / 2 ;
	var iTop  = ( screen.availHeight - height ) / 2 ;

	var sOptions = "toolbar=no, status=no,resizable=no,dependent=yes,scrollbars=no" ;
	sOptions += ",width=" + width ;
	sOptions += ",height=" + height ;
	sOptions += ",left=" + iLeft ;
	sOptions += ",top=" + iTop ;

	var url = 'view_img.php?dir_image=document&image_name=' + image;

	var isMSIE = /*@cc_on!@*/false;
	if ( isMSIE )
	{
		// The following change has been made otherwise IE will open the file
		// browser on a different server session (on some cases):
		// http://support.microsoft.com/default.aspx?scid=kb;en-us;831678
		// by Simone Chiaretta.
		var oWindow = window.open(url,"ViewImage",sOptions) ;

		if ( oWindow )
		{
			// Detect Yahoo popup blocker.
			try
			{
				var sTest = oWindow.name ; // Yahoo returns "something", but we can't access it, so detect that and avoid strange errors for the user.
				oWindow.opener = window ;
			}
			catch(e)
			{
				alert("The resources browser could not be opened. Make sure that all popup blockers are disabled.") ;
			}
		}
		else
			alert("The resources browser could not be opened. Make sure that all popup blockers are disabled.") ;
    }
    else
		window.open(url,"EmailtoFriend",sOptions);
}
