
/* ---------------------------------------------
Random Images Script by Bernard Pegis 9/1999
comments or suggestions?  pegisbt@slu.edu
Use:
the following code is inserted in the html document
which you would like to host the random images
<center>
<form name=theform>
<table>
<tr><td align=center><font size=+1>Random Image:</font></td></tr>
<tr><td align=center><i><a href="javascript:newrandomimage()">Click here</a> for another image!</i></td></tr>
<tr><td align=center><a href="javascript:showimage()"><img name="randomimage" width=200 height=135 border=0></a></td></tr>
<tr><td align=center><small><input name=caption align=center type=text size=40 onfocus="blur()"></small></td></tr>
<tr><td align=center>(Click on the picture for a full size image)</td></tr>
</table>
<hr WIDTH="100%"></center>
</form>
</center>

Notes:
The images are not preloaded--this would of course
create too long a page load delay.

An additional
<script>newrandomimage()</script>
needs to be added just prior to the </body> tag to load
allow the variables to initialize and load the first image
---------------------------------------------
*/




var piclist = new Array;
var captions = new Array;
var pics = new Array;
var ipath = 'images/photos/';
var ri= new Image;
var x = 0;
var pn = 0;
var i=0;

pn++;
piclist[pn]=ipath+'pope_thumb.jpg'
captions[pn]='The Holy Father in St. Louis'

pn++;
piclist[pn]=ipath+'jh_chriswise_thumb.jpg'
captions[pn]='Chris'

pn++;
piclist[pn]=ipath+'jh_chrismaender_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_ashweena_thumb.jpg'
captions[pn]='Ashweena -- Look out Big Mac!'

pn++;
piclist[pn]=ipath+'jh_anita_thumb.jpg'
captions[pn]='Anita -- Look out Big Mac!'

pn++;
piclist[pn]=ipath+'jh_2002_thumb.jpg'
captions[pn]='Class Picnic at end of first year'

pn++;
piclist[pn]=ipath+'jh_poolparty3_thumb.jpg'
captions[pn]='Pool Party, beginning of second year'

pn++;
piclist[pn]=ipath+'jh_poolparty2_thumb.jpg'
captions[pn]='Fr. Baker at the pool party, 2nd year'

pn++;
piclist[pn]=ipath+'jh_poolparty1_thumb.jpg'
captions[pn]='Pool Party, beginning of second year'

pn++;
piclist[pn]=ipath+'jh_noelle_penelope_thumb.jpg'
captions[pn]='Noelle and Penelope'

pn++;
piclist[pn]=ipath+'jh_noelle_penelope2_thumb.jpg'
captions[pn]='Noelle and Penelope'

pn++;
piclist[pn]=ipath+'jh_lynn_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_jose_thumb.jpg'
captions[pn]='Jose'

pn++;
piclist[pn]=ipath+'jh_joeg_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_jeremyw_thumb.jpg'
captions[pn]='Jeremy'

pn++;
piclist[pn]=ipath+'jh_jasong_thumb.jpg'
captions[pn]='Jason'

pn++;
piclist[pn]=ipath+'jh_jareds_thumb.jpg'
captions[pn]='Jared'

pn++;
piclist[pn]=ipath+'jh_ticket2_thumb.jpg'
captions[pn]='Penelope having a bad day'

pn++;
piclist[pn]=ipath+'jh_ticket_thumb.jpg'
captions[pn]='Penelope having a bad day'

pn++;
piclist[pn]=ipath+'jh_softball3_thumb.jpg'
captions[pn]='Softball Game'

pn++;
piclist[pn]=ipath+'jh_softball2_thumb.jpg'
captions[pn]='Softball Game'

pn++;
piclist[pn]=ipath+'jh_softball1_thumb.jpg'
captions[pn]='Softball Game'

pn++;
piclist[pn]=ipath+'jh_sanjayag_thumb.jpg'
captions[pn]='Sanjaya'

pn++;
piclist[pn]=ipath+'jh_classpic_thumb.jpg'
captions[pn]='Class Picture by Jon Halling'

pn++;
piclist[pn]=ipath+'lh_december_thumb.jpg'
captions[pn]='Mr. December'

pn++;
piclist[pn]=ipath+'lh_a_gothic_thumb.jpg'
captions[pn]='American Gothic'

pn++;
piclist[pn]=ipath+'jh_01_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_02_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_03_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_04_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_05_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_06_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_07_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_08_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_09_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_10_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_11_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_12_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_14_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_15_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_16_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_17_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_18_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'jh_lynn_2_thumb.jpg'
captions[pn]=''

pn++;
piclist[pn]=ipath+'bp_lightning_thumb.jpg'
captions[pn]='Lightning in St. Louis'

pn++;
piclist[pn]=ipath+'jh_halloween_5_thumb.jpg';
captions[pn]='';

pn++;
piclist[pn]=ipath+'jh_halloween_6_thumb.jpg';
captions[pn]='';

pn++;
piclist[pn]=ipath+'jh_halloween_7_thumb.jpg';
captions[pn]='';

/*
pn++;
piclist[pn]=ipath+'jh_halloween_8_thumb.jpg';
captions[pn]='';
*/

pn++;
piclist[pn]=ipath+'jh_halloween_9_thumb.jpg';
captions[pn]='';

pn++;
piclist[pn]=ipath+'jh_halloween_11_thumb.jpg';
captions[pn]='';

/*
pn++;
piclist[pn]=ipath+'jh_halloween_12_thumb.jpg';
captions[pn]='';
*/

pn++;
piclist[pn]=ipath+'jh_halloween_13_thumb.jpg';
captions[pn]='';

pn++;
piclist[pn]=ipath+'jh_halloween_14_thumb.jpg';
captions[pn]='';

pn++;
piclist[pn]=ipath+'jh_halloween_15_thumb.jpg';
captions[pn]='';

pn++;
piclist[pn]=ipath+'jh_halloween_16_thumb.jpg';
captions[pn]='';

/*
pn++;
piclist[pn]=ipath+'jh_halloween_17_thumb.jpg';
captions[pn]='';
*/

pn++;
piclist[pn]=ipath+'jh_halloween_18_thumb.jpg';
captions[pn]='';

pn++;
piclist[pn]=ipath+'jh_halloween_19_thumb.jpg';
captions[pn]='';

/*
pn++;
piclist[pn]=ipath+'jh_halloween_21_thumb.jpg';
captions[pn]='';
*/

pn++;
piclist[pn]=ipath+'jh_halloween_22_thumb.jpg';
captions[pn]='';

pn++;
piclist[pn]=ipath+'bp_mo_sunset_thumb.jpg';
captions[pn]='Sunset in St. Louis';

pn++;
piclist[pn]=ipath+'jd_01_thumb.jpg';
captions[pn]='';

pn++;
piclist[pn]=ipath+'jd_02_thumb.jpg';
captions[pn]='';

/*
pn++;
piclist[pn]=ipath+'';
captions[pn]='';
*/

function newrandomimage()
	{
	var icap='';
	x=Math.random();
	x=(piclist.length*x);
        x=Math.round(x);
        if (x>pn){x=pn};
        if (x==0){x=1};
	document.randomimage.src=piclist[x];
	icap=captions[x];
/*	if (icap.length<=40)
		{
		i=(40-icap.length)/2;
		i=Math.round(i);
		for (var u=1;u<i;u++)
			{
			icap=" "+icap
			}
		}
*/
	document.theform.caption.value=icap
	}

function showimage()
	{
	var thumb=piclist[x];
	var pic=thumb.substring(0,thumb.length-10)+'.jpg';
	top.window.location=pic
	}

function cycle()
	{
	document.theform.caption.value=""
	document.randomimage.src='images/pleasewait.gif'
	waiting=setTimeout('cyclea()',2500)
	}

function cyclea()
	{
	for(i=1 ; i<=pn ; i++)
		{
		pics[i]=new Image();
		pics[i].src=piclist[i]
		}
	i=0;
	waiting=setTimeout('cycleb()',1500);
	}

function cycleb()
	{
	if (i<pn)
		{
		i++;
		x=i;
		document.randomimage.src=pics[i].src;
		document.theform.caption.value=i+"/"+pn+" "+captions[i];
		delay=setTimeout('cycleb()',1500);
		}
	}

