var adWindow = null;
var _IMG_FOLDER = "";

function popupAd( url, name, height, width )
{ // Pops up an Ad window.
  // Precondition: url is the address of the page to show or an empty string.
  //   name is the name of the ad window. height and width are the dimensions of
  //   the ad window in pixels. 
  // Postcondition: An Ad window is displayed. If url is an empty string,
  //   nothing will be displayed. A reference to this window is stored in global
  //   variable adWindow.
  
	var winName = (name)? name : "AdWindow";
	var winFeatures = "toolbar=0," + 
			  "directories=0," + 
			  "menubar=0," + 
			  "scrollbars=1," + 
			  "resizable=1," + 
			  "maximize=0," + 
			  "width=" + ((width)? width : 480) + "," + 
			  "height=" + ((height)? height : 450) + "";

	// Open ad pop-up window for non-WebTV browsers because 
	//   WebTV doesn't support the window.open() method.
	if( navigator.appName.indexOf("WebTV") == -1 )
	{
		if( url )  // URL available?
		{  // Pop up ad
			adWindow = window.open( url, winName, winFeatures );
		}
	}
}

function showImageWindow( url, width, height, description )
{
	var scrollBarOffset = 40;
	var closeButtonOffset = 20;
	var echoerUrl = "ImageEchoer.asp?imgurl=" + escape( _IMG_FOLDER + url ) + "&width=" + escape( width ) + "&height=" + escape( height ) + "&desc=" + escape( description );
	popupAd( echoerUrl, 'ImgWin', height + scrollBarOffset + closeButtonOffset, width + scrollBarOffset );
}

