function popup (def,text)
{
	windowname='def';
	closebutton = "<DIV ALIGN='CENTER'><FORM><INPUT TYPE='BUTTON' ONCLICK='self.close()' VALUE='Close Window'></FORM></DIV>"
	popupwin=window.open("",windowname,"toolbar=no,location=no,directories=no,status=no,menubar=no,width=430,height=500");
	popupwin.document.write("<HTML><HEAD><TITLE>Eric Whitney's Website: Pic Viewer</TITLE></HEAD><BODY BACKGROUND='pics/background.gif'><CENTER><IMG SRC=pics/goodpics/" + def + ".jpg><P><FONT SIZE=2 COLOR=#FFFFFF FACE=Arial>" + text + "</FONT></P></CENTER>" + closebutton);
	popupwin.document.close();
}

function popup2 (pgnum)
{
	windowname='def';
	closebutton = "<DIV ALIGN='CENTER'><FORM><INPUT TYPE='BUTTON' ONCLICK='self.close()' VALUE='Close Window'></FORM></DIV>"
	popupwin=window.open("",windowname,"toolbar=no,location=no,directories=no,status=no,menubar=no,width=800,height=640");
	popupwin.document.write("<HTML><HEAD><TITLE>Eric Whitney's Website: Portfolio Page</TITLE></HEAD><BODY BACKGROUND='pics/backgroundx.gif' LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0><CENTER><IMG SRC=pics/portfolio/" + pgnum + ".jpg>");
	popupwin.document.close();
}

function blueborder1()
{
	document.write("<TABLE WIDTH=10 BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD BACKGROUND=pics/navbutton_bg.gif COLSPAN=2><IMG SRC=pics/pics_tl.gif WIDTH=8 HEIGHT=8></TD><TD BACKGROUND=pics/navbutton_bg.gif ROWSPAN=2 VALIGN=TOP ALIGN=RIGHT><IMG SRC=pics/pics_tr.gif WIDTH=8 HEIGHT=8></TD><TD ROWSPAN=3 VALIGN=TOP></TD></TR><TR><TD BACKGROUND=pics/navbutton_bg.gif ROWSPAN=2 VALIGN=BOTTOM><IMG SRC=pics/pics_bl.gif WIDTH=8 HEIGHT=8></TD><TD BACKGROUND=pics/navbutton_bg.gif WIDTH=100%>");
}
			
function blueborder2()
{
	document.write("</TD></TR><TR><TD BACKGROUND=pics/navbutton_bg.gif COLSPAN=2 ALIGN=RIGHT><IMG SRC=pics/pics_br.gif WIDTH=8 HEIGHT=8></TD></TR></TABLE>");
}

function startpage(title)
{
	document.write("<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD BACKGROUND=\"pics/toptitle.gif\" COLSPAN=2 HEIGHT=77 ALIGN=RIGHT VALIGN=CENTER><A HREF=index.html><IMG SRC=\"pics/blank.gif\" ALIGN=LEFT WIDTH=350 HEIGHT=60 BORDER=0></A><FONT COLOR=#89bbd9 FACE=ARIAL SIZE=2><B><I><FONT SIZE=1><a href=mailto:ericwhitney@alum.wustl.edu title=\"Send me an e-mail!\">E-mail: </FONT> ericwhitney@alum.wustl.edu</a>&nbsp;&nbsp;<BR><FONT SIZE=1><a href=http://www.ericwhitney.org/textmessage.html title=\"Send my cell phone a text message!\">Telephone:</FONT> (617)335-2465</a>&nbsp;&nbsp;</I></B></FONT></TD></TR><TR><TD VALIGN=TOP><TABLE WIDTH=108 BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD COLSPAN=3><IMG SRC=\"pics/navbar_top.gif\" WIDTH=108 HEIGHT=17></TD></TR>");
	navbar();
	document.write("<TR><TD COLSPAN=3><IMG SRC=\"pics/navbar_bottom.gif\" WIDTH=108 HEIGHT=141></TD></TR></TABLE></TD><TD WIDTH=100% VALIGN=TOP><TABLE BORDER=0 WIDTH=100% CELLSPACING=10><TR><TD COLSPAN=2 ALIGN=CENTER><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><IMG SRC=\"pics/arrow_right.gif\" WIDTH=49 HEIGHT=24 HSPACE=10></TD><TD><FONT COLOR=#FFFFFF FACE=ARIAL SIZE=5><B>",title,"</B></FONT></TD><TD><IMG SRC=\"pics/arrow_left.gif\" WIDTH=49 HEIGHT=24 HSPACE=10></TD></TR></TABLE></TD></TR><TR><TD WIDTH=100% VALIGN=CENTER><FONT FACE=ARIAL SIZE=3 COLOR=#FFFFFF>");
}

function randpic()
{
	document.write("<img src=pics/circle/circle");
	var ran = Math.random()
	var num =  15;
	if (num*ran <  1)
	{
		document.write("01.gif border=0 width=300 height=300>");
		return;
	}

	if (num*ran <  2)
	{
		document.write("02.gif border=0 width=300 height=300>");
		return;
	}

	if (num*ran <  3)
	{
		document.write("03.gif border=0 width=300 height=300>");
		return;
	}

	if (num*ran <  4)
	{
		document.write("04.gif border=0 width=300 height=300>");
		return;
	}

	if (num*ran <  5)
	{
		document.write("05.gif border=0 width=300 height=300>");
		return;
	}

	if (num*ran <  6)
	{
		document.write("06.gif border=0 width=300 height=300>");
		return;
	}

	if (num*ran <  7)
	{
		document.write("07.gif border=0 width=300 height=300>");
		return;
	}

	if (num*ran <  8)
	{
		document.write("08.gif border=0 width=300 height=300>");
		return;
	}

	if (num*ran <  9)
	{
		document.write("09.gif border=0 width=300 height=300>");
		return;
	}

	if (num*ran <  10)
	{
		document.write("10.gif border=0 width=300 height=300>");
		return;
	}

	if (num*ran <  11)
	{
		document.write("11.gif border=0 width=300 height=300>");
		return;
	}

	if (num*ran <  12)
	{
		document.write("12.gif border=0 width=300 height=300>");
		return;
	}

	if (num*ran <  13)
	{
		document.write("13.gif border=0 width=300 height=300>");
		return;
	}

	if (num*ran <  14)
	{
		document.write("14.gif border=0 width=300 height=300>");
		return;
	}

	if (num*ran <  15)
	{
		document.write("15.gif border=0 width=300 height=300>");
		return;
	}
}

function endpage()
{
	document.write("</FONT></TD></TR></TABLE></TD></TR></TABLE>");
}

function imageshadow(name,width,height)
{
	document.write("<TR><TD><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD><A HREF=photos_",name,".html><IMG SRC=photos/",name,"_small.jpg BORDER=1 WIDTH=",width," HEIGHT=",height,"></A></TD><TD BACKGROUND=pics/pics_shadow_r.gif></TD></TR><TR><TD BACKGROUND=pics/pics_shadow_b.gif></TD><TD><IMG SRC=pics/pics_shadow_br.gif WIDTH=7 HEIGHT=7></TD></TR></TABLE></TD></TR>");
}

function navlink(navtext,navfile)
{
	document.write("<TR><TD BACKGROUND=pics/navbutton_bg.gif><IMG SRC=pics/navbutton_left.gif WIDTH=7 HEIGHT=22></TD><TD WIDTH=93 BACKGROUND=pics/navbutton_bg.gif ALIGN=CENTER><FONT COLOR=#FFFFFF FACE=ARIAL SIZE=2><A HREF=",navfile,">",navtext,"</A></FONT></TD><TD BACKGROUND=pics/navbutton_bg.gif ALIGN=RIGHT><IMG SRC=pics/navbutton_right.gif WIDTH=8 HEIGHT=22></TD></TR>");
}

function piclink(pictext,picfile,onoff)
{
	document.write("<TR><TD HEIGHT=5></TD></TR><TR><TD BACKGROUND=pics/pics_bg_",onoff,".gif><FONT FACE=ARIAL SIZE=2><A HREF=",picfile,">&nbsp;",pictext,"</A></FONT></TD><TD><IMG SRC=pics/picslist_",onoff,".gif WIDTH=10 HEIGHT=20></TD></TR>");
}

function navspacer()
{
	document.write("<TR><TD COLSPAN=3><IMG SRC=pics/navbutton_separator.gif WIDTH=108 HEIGHT=13></TD></TR>");
}

function spcaption(spquote,spauthor)
{
	document.write("<b><i>\"",spquote,"\"</b> -- ",spauthor,"</i><br>");
}

function scarypic(spnumber,sptitle)
{
	document.write("<P><hr><img src=pics/scary/",spnumber,".jpg vspace=10><br>Caption: <input type=text size=50 name=",sptitle,"><P>");
}
