descr=new Array
w=new Array
h=new Array
ratio=new Array
urls=new Array
var wmax
var hmax
var items
var showbg
var buttonbgcolor
var buttontextcolor
var descriptionbgcolor
var textcolor

//changes area

items=20	//number of items (image, url and description pairs)
tablewidth=550	//width of slide show area
tabheight=400	//height of slide show area        

buttonbgcolor="#4C007E"		//background color of buttons
buttontextcolor="#299C39"	//text color for buttons
descriptionbgcolor="#4C007E"	//background color of description area
textcolor="#FFFFFF"		//text color of description area
showbg="images/showbg.jpg"	//background picture for images and buttons area

//leave blank text color to get black text
//leave blank background color to get transparent background
//leave blank showbg to get descriptionbgcolor for background
//experiment, but make sure you don't delete quotation marks!

img=new Array
for(i=1;i<=items;i++)img[i]=new Image()

//web address for images used in show
//add or delete here rows to match the number of images;
//make sure you update the number in the square brackets:
//the next row should be img[6].src="images/next_image.jpg"
img[1].src="images/w1.jpg"
img[2].src="images/w2.jpg"
img[3].src="images/w3.jpg"
img[4].src="images/w4.jpg"
img[5].src="images/w5.jpg"
img[6].src="images/w6.jpg"
img[7].src="images/w7.jpg"
img[8].src="images/w8.jpg"
img[9].src="images/w9.jpg"
img[10].src="images/w10.jpg"
img[11].src="images/w11.jpg"
img[12].src="images/w12.jpg"
img[13].src="images/w13.jpg"
img[14].src="images/w14.jpg"
img[15].src="images/w15.jpg"
img[16].src="images/w16.jpg"
img[17].src="images/w17.jpg"
img[18].src="images/w18.jpg"
img[19].src="images/w19.jpg"
img[20].src="images/w20.jpg"

//image sizes, make sure you enter correct values
//add or delete here rows to match the number of images;
//make sure you update the number in the square brackets:
w[1]=500
h[1]=375
w[2]=500
h[2]=375
w[3]=500
h[3]=375
w[4]=500
h[4]=375
w[5]=500
h[5]=375
w[6]=500
h[6]=375
w[7]=500
h[7]=375
w[8]=500
h[8]=375
w[9]=500
h[9]=375
w[10]=500
h[10]=375
w[11]=500
h[11]=375
w[12]=500
h[12]=375
w[13]=500
h[13]=375
w[14]=500
h[14]=375
w[15]=500
h[15]=375
w[16]=500
h[16]=375
w[17]=500
h[17]=375
w[18]=500
h[18]=375
w[19]=500
h[19]=375
w[20]=500
h[20]=375

//description for each images
//add or delete here rows to match the number of images;
//make sure you update the number in the square brackets:
descr[1]="The new Bride and Groom!"
descr[2]="Sister Suzie drinking the world's finest beverage!"
descr[3]="Brother James, because he can!"
descr[4]="Hailee, Deven, Uncle Martin and Mom cutting a rug!"
descr[5]="The ring bearer and the flower girl, Deven and Hailee."
descr[6]="Almost sick of taking pictures by this time."
descr[7]="Grandma Betty with my Husband!"
descr[8]="The 2 Bobs-Father and Father!"
descr[9]="Jake talking with the man, SSGT Landreville!"
descr[10]="Best man Ryan and Ethan!"
descr[11]="Somewhere on the dance floor."
descr[12]="Sister Lacy looking beautiful!"
descr[13]="Say cheese Cameron!"
descr[14]="Angie sad/happy to see her baby getting hitched!"
descr[15]="The cutest couple there!"
descr[16]="Me and the best Navy Man!"
descr[17]="Still smiling!"
descr[18]="During Cary's rendition of Michael Jackson!"
descr[19]="Jake and I in the last dance!"
descr[20]="Right before we drove away on the honey moon!"

//link urls for each image
//add or delete here rows to match the number of images;
//make sure you update the number in the square brackets:
urls[1]=""
urls[2]=""
urls[3]=""
urls[4]=""
urls[5]=""
urls[6]=""
urls[7]=""
urls[8]=""
urls[9]=""
urls[10]=""
urls[11]=""
urls[12]=""
urls[13]=""
urls[14]=""
urls[15]=""
urls[16]=""
urls[17]=""
urls[18]=""
urls[19]=""
urls[20]=""

//end of changes area

for(i=1;i<=items;i++)descr[i]='<font color="' + textcolor + '">' + descr[i] + '</font>'


for(i=1;i<=items;i++)ratio[i]=h[i]/w[i]
maxs()

if(wmax>tablewidth)
{
for(i=1;i<=items;i++)
	{
		if(w[i]>tablewidth)
			{
			 w[i]=tablewidth
			 h[i]=w[i]*ratio[i]
			}
	}
maxs()
}

if(hmax>tabheight)
{
for(i=1;i<=items;i++)
	{
		if(h[i]>tabheight)
		{
		 h[i]=tabheight 
		 w[i]=h[i]/ratio[i]
		}
	}
}
maxs()


function maxs()
{
hmax=h[1]
for(j=1;j<=items;j++)
{
if(h[j]>hmax)hmax=h[j]
}
wmax=h[1]
for(j=1;j<=items;j++)
{
if(w[j]>wmax)wmax=w[j]
}
}

layerLeft = new Array
layerTop = new Array

position_layers()

function position_layers()
{
for(i=1;i<=items;i++)
{
layerLeft[i] = Math.floor((wmax-w[i])/2);
layerTop[i] = Math.floor((hmax-h[i])/2);
}
}

document.write('<STYLE TYPE="text/css">')
document.write('# container {position: relative; z-index: 1; top:0px; left:0px}')
document.write('.buttons { background: ' + buttonbgcolor + '; color: ' + buttontextcolor + '; font-weight: bold; }')
if(document.layers)document.write('# description {position: absolute; z-index: 3; top:0px; left:0px;}')

document.write('#con {position: relative; z-index: 1; top:0px; left:0px}')
for(i=1;i<=items;i++)
{
document.write('#pic'+ i + '{position: absolute; z-index: 1; top:' + layerTop[i] + 'px; left:' + layerLeft[i] + 'px; visibility:hidden}');
}
document.write('</style>')


navtest="KO"
j=0
if (document.layers)
{
navtest="OK"
layerRef="document.layers"
styleDef=""
}

if(document.all)
{
navtest="OK"
layerRef="document.all"
styleDef=".style"
}

function start()
{
eval(layerRef + '["con"].' + layerRef + '["pic1"]' + styleDef + '.visibility="visible"')
displayText(1)
currentcommand="stop"
j=1
document.playercomm.stop.disabled=true
document.playercomm.faster.disabled=true
document.playercomm.slower.disabled=true
}
var rotation
var rotspeed
rotspeed=3000

function rotate()
{
for(i=1;i<=items;i++)
{
eval(layerRef + '["con"].' + layerRef + '["pic' + i + '"]' + styleDef + '.visibility="hidden"')
}
j++
if(j==0)j=items
if(j>items)j=1
eval(layerRef + '["con"].' + layerRef + '["pic' + j + '"]' + styleDef + '.visibility="visible"')
displayText(j)
rotation = setTimeout("rotate()",rotspeed)
}

function displayText(opt){
text='<center><b>'+descr[opt]+'</b></center>'

if(document.layers){
document.layers["container"].document.layers["description"].document.write(text)
document.layers["container"].document.layers["description"].document.close();
}

if(document.all)
{
document.all["description"].innerHTML=text;
}
}

currentcommand="play"
function player(command)
{
if(currentcommand=="play")
{
if(command=="stop")
	{ 
	clearTimeout(rotation)
	currentcommand="stop"
	document.playercomm.stop.disabled=true
	document.playercomm.play.disabled=false
	document.playercomm.faster.disabled=true
	document.playercomm.slower.disabled=true
	document.playercomm.previous.disabled=false
	document.playercomm.next.disabled=false
}
}

if(currentcommand=="stop")
{
if(command=="play")
	{ 
	rotate()
	currentcommand="play"
	document.playercomm.play.disabled=true
	document.playercomm.stop.disabled=false
	document.playercomm.faster.disabled=false
	document.playercomm.slower.disabled=false
	document.playercomm.previous.disabled=true
	document.playercomm.next.disabled=true
}
}

if(command=="next")
	{ 
	clearTimeout(rotation)
	rotate()
	if(currentcommand=="stop")clearTimeout(rotation)
}

if(command=="previous")
	{ 
	clearTimeout(rotation)
	j=j-2
	rotate()
	if(currentcommand=="stop")clearTimeout(rotation)
}
}

function fasterslower(action)
	{
	if(currentcommand=="play")
		{
		if(action=="faster")
			{
			rotspeed=rotspeed-500
			if (rotspeed<0)rotspeed=0
			}
		if(action=="slower")rotspeed=rotspeed+500
		}
	}
