var picWin;

var lynx = new Array();
lynx[0] = "<a href=\"#p\" onclick=\"makeNewWindow(";
lynx[1] = ");\"><img src=\"";
lynx[2] = "\" width=\"100\" height=\"100\" border=\"0\" alt=\"";
lynx[3] = "\" /></a>";


////////////////////////////////////////////////////////////////////////////////
function makeNewWindow()
////////////////////////////////////////////////////////////////////////////////
// filename to open
// width in pixels
// height in pixels
// optional: window name (open new window vs. reusing)
{
var DEBUG=false;
var newWin;
var params;
var newWinName = "picWin";
var a=makeNewWindow.arguments;
var what = a[0], wid=a[1], hyt=a[2];
var result;
if (!document.picWin)
	{
	//alert("looks like window is not open");
	result = "new";
	}
else if (document.picWin.closed)
	{
	//alert("looks like it was closed, reopen it");
	result = "closed";
	}
else
	{
	//alert("window is open");
	result = "open"
	}

wid = wid+40; // account for IE margins. grr.
hyt = hyt+30;
//alert("width: " + wid + " height:" + hyt);


if (DEBUG)
	{
	params = ",titlebar,resizable,scrollbars,location,status";
	}
else
	{
	params = ",titlebar,resizable,scrollbars";
	//params = ",fullscreen=yes";
	}


if (DEBUG) {alert("Make new window: " + what);}

if (result!="open")
{
  newWin = window.open(what,newWinName,'width=' + wid + ',height=' + hyt + params);
  newWin.moveTo( (((screen.availWidth-wid)/2)-18),(screen.availHeight-hyt)/2);
  newWin.focus();
}
else
	{
	document.picWin.location.href = what;
	document.picWin.resizeTo(wid,hyt);
	document.picWin.focus();
	}
// copy to global!
document.picWin = newWin;

return(false);
}
////////////////////////////////////////////////////////////////////////////////

