var popup = null;



function CreateWnd (file, width, height, resize)

{

var doCenter = false;

if  ((popup == null) || popup.closed)

	{

	attribs = "";

	if (resize) 

		size = "yes"; 

	else size = "no";



	for(var item in window)

		{ 

		if(item == "screen") 

			{ 

			doCenter = true; break; 

			} 

		}



	if (doCenter)

		{	

		// if the screen is smaller than the window, override the resize setting

		if	(screen.width <= width || screen.height <= height) 

			size = "yes";



		WndTop  = 100; // (screen.height - height) / 2;

		WndLeft = 100; // (screen.width  - width)  / 2;



		attribs = "width=" + width + ",height=" + height + ",resizable=" + size + 

				  ",scrollbars=no,status=no,toolbar=no,directories=no,menubar=no,location=no,top=" + WndTop + ",left=" + WndLeft;

		}

	else

		{

		/*/

		/ / There is still one last thing we can do for JavaScrpt 1.1

		/ / users in Netscape.  Using the AWT in Java we can pull the

		/ / information we need, provided it is enabled.

		/*/

		if	(navigator.appName=="Netscape" && navigator.javaEnabled())

			{	/*/ center the window /*/

			

			var toolkit = java.awt.Toolkit.getDefaultToolkit();

			var screen_size = toolkit.getScreenSize();

			

			// if the screen is smaller than the window, override the resize setting

			if(screen_size.width <= width || screen_size.height <= height) 

				size = "yes";

			

			WndTop  = 100; // (screen_size.height - height) / 2;

			WndLeft = 100; // (screen_size.width  - width)  / 2;

			

			attribs = "width=" + width + ",height=" + height + ",resizable=" + size + 

						",scrollbars=no,status=no,toolbar=no,directories=no,menubar=no,location=no,top=" + WndTop + ",left=" + WndLeft;

			}

		else

			{	/*/ use the default window position /*/

			// override the resize setting

			size = "yes";

			attribs = "width=" + width + ",height=" + height + ",resizable=" + size  

						",scrollbars=no,status=no,toolbar=no,directories=no,menubar=no,location=no";

			}

		}

	// create the window

	popup = open(file, "", attribs);

	}

else  // window already open ...

	{

	// destory the current window

	DestroyWnd();

	// recurse, just once, to display the new window

	CreateWnd(file, width, height, resize);

	}

}



function DestroyWnd ()

{

// close the current window

if  (popup != null)

	{

	popup.close();

	popup = null;

	}

}



function PopupImage(sPicURL) 

{ 

// window.open("..\scripts\popup.htm?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");

CreateWnd("image_popup.htm?"+sPicURL,1000,1000,true);

}



function PopupFlash(sURL, width, height) 

{ 

// window.open("..\scripts\popup.htm?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");

CreateWnd(sURL,width,height,true);

}



