var picWin;

var lynx = new Array();
lynx[0] = "<a href=\"#\" 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], desc=a[3];
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 = ",titlebar,fullscreen=yes";
	}


if (DEBUG) {alert("Make new window: " + what);}

istring = "";
istring += "<html><head><title>" + desc + "</title><link rel=\"stylesheet\" type=\"text/css\"  href=\"photo.css\"  /></head>";
istring+='<body><div id="flashcontent">';
istring+='<object type="application/x-shockwave-flash" data="images/mgras.swf" width="750" height="540">';
istring+='<param name="movie" value="images/mgras.swf">';
istring+='</object></div></body></html>';

//istring += "<html><head><title>" + desc + "</title><link rel=\"stylesheet\" type=\"text/css\"  href=\"photo.css\"  /></head>";
//istring += "<body><img src=\"" + what + "\" width=\"" + wid + "\" height=\"" + hyt + "\" alt=\"\"></body></html>";


if (result!="open")
{
  newWin = window.open("",newWinName,'width=' + (wid+40) + ',height=' + (hyt+40) + params);
  //newWin.moveTo( (((screen.availWidth-wid)/2)-18),(screen.availHeight-hyt)/2);
  d = newWin.document; // shorthand
  d.write(istring);
  d.close();
  newWin.focus();
}
else
	{
	newWin = document.picWin;
	d = newWin.document; // shorthand
	d.write(istring);
	d.close();
	//document.picWin.location.href = "blank.html";
	newWin.resizeTo((wid+40),(hyt+60));
	newWin.focus();
	//alert("yoyou");
	}
//alert(istring);
// copy to global!
document.picWin = newWin;

return(false);
}
////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////
function oldmakeNewWindow()
////////////////////////////////////////////////////////////////////////////////
// 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 = ",titlebar,fullscreen=yes";
	}


if (DEBUG) {alert("Make new window: " + what);}

istring = "";
istring += "<html><head><title>" + what + "</title><link rel=\"stylesheet\" type=\"text/css\"  href=\"photo.css\"  /></head>";
istring += "<body><img src=\"" + what + "\" width=\"" + wid + "\" height=\"" + hyt + "\" alt=\"\"></body></html>";


if (result!="open")
{
  newWin = window.open("blank.html",newWinName,'width=' + wid + ',height=' + hyt + params);
  //newWin.moveTo( (((screen.availWidth-wid)/2)-18),(screen.availHeight-hyt)/2);
  newWin.focus();
  newWin.document.write(istring);
  alert("yo");
}
else
	{
	document.picWin.document.write(istring);
	//document.picWin.location.href = "blank.html";
	document.picWin.resizeTo(wid,hyt);
	document.picWin.focus();
  alert("yoyou");
	}
//alert(istring);
// copy to global!
document.picWin = newWin;

return(false);
}
////////////////////////////////////////////////////////////////////////////////

