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=15		//number of items (image, url and description pairs)
tablewidth=400	//width of slide show area
tabheight=300	//height of slide show area        

buttonbgcolor="#cccccc"		//background color of buttons
buttontextcolor="#000000"	//text color for buttons
descriptionbgcolor="#ffffff"	//background color of description area
textcolor="#000000"		//text color of description area
showbg="background4.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="s_wildbunch.jpg"
img[2].src="s_desperados.jpg"
img[3].src="s_gunfighters.jpg"
img[4].src="s_cliffpalace2.jpg"
img[5].src="s_bowman.jpg"
img[6].src="s_northernbarn.jpg"
img[7].src="s_trempeleau.jpg"
img[8].src="s_lehrback.jpg"
img[9].src="s_aredwingsummer.jpg"
img[10].src="s_redwingboathouses.jpg"
img[11].src="s_stoneware5.jpg"
img[12].src="s_ancientloco.jpg"
img[13].src="s_charliesaddle.jpg"
img[14].src="s_taoslight.jpg"
img[15].src="s_capitolreefpetro.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]=248
w[2]=305
h[2]=400
w[3]=270
h[3]=400
w[4]=295
h[4]=400
w[5]=500
h[5]=346
w[6]=500
h[6]=346
w[7]=500
h[7]=250
w[8]=500
h[8]=253
w[9]=305
h[9]=400
w[10]=272
h[10]=400
w[11]=500
h[11]=274
w[12]=400
h[12]=295
w[13]=400
h[13]=337
w[14]=500
h[14]=346
w[15]=500
h[15]=398

//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]="<p class='genretitle'><a href='wildbunch.htm'>     	 		Wild Bunch<br>       </a></p><p class='title'>Wild Bunch - The Gathering</p>"
descr[2]="<p class='genretitle'><a href='western.htm'>     				Western<br>     		 </a></p><p class='title'>Desperados </p>"
descr[3]="<p class='genretitle'><a href='western.htm'>     				Western<br>          </a></p><p class='title'>Gunfighters  </p>"
descr[4]="<p class='genretitle'><a href='southwestern.htm'>   		Southwestern<br>     </a></p><p class='title'>Cliff Palaces</p>"
descr[5]="<p class='genretitle'><a href='southwestern.htm'>   		Southwestern<br>     </a></p><p class='title'>Bow Man</p>"
descr[6]="<p class='genretitle'><a href='landscape.htm'>   				Landscape<br>        </a></p><p class='title'>Northern Barn</p>"
descr[7]="<p class='genretitle'><a href='landscape.htm'>   				Landscape<br>        </a></p><p class='title'>Trempeleau View</p>"
descr[8]="<p class='genretitle'><a href='landscape.htm'>   				Landscape<br>        </a></p><p class='title'>Lehrback Road</p>"
descr[9]="<p class='genretitle'><a href='redwing.htm'>     				Red Wing<br>         </a></p><p class='title'>A Red Wing Summer</p>"
descr[10]="<p class='genretitle'><a href='redwing.htm'>    		 		Red Wing<br>         </a></p><p class='title'>Red Wing Boat Houses</p>"
descr[11]="<p class='genretitle'><a href='redwingpottery.htm'>    Red Wing Pottery<br> </a></p><p class='title'>Stoneware of Red Wing V</p>"
descr[12]="<p class='genretitle'><a href='western.htm'>     			Western<br>          </a></p><p class='title'>Ancient Locomotive  </p>"
descr[13]="<p class='genretitle'><a href='western.htm'>     			Western<br>          </a></p><p class='title'>Charlie's Saddle  </p>"
descr[14]="<p class='genretitle'><a href='southwestern.htm'>      Southwestern<br>     </a></p><p class='title'>Taos Light</p>"
descr[15]="<p class='genretitle'><a href='southwestern.htm'>   		Southwestern<br> 		 </a></p><p class='title'>Capitol Reef Petroglyphs</p>"

//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]="wildbunch.htm"
urls[2]="western.htm"
urls[3]="western.htm"
urls[4]="southwestern.htm"
urls[5]="southwestern.htm"
urls[6]="landscape.htm"
urls[7]="landscape.htm"
urls[8]="landscape.htm"
urls[9]="redwing.htm"
urls[10]="redwing.htm"
urls[11]="redwingpottery.htm"
urls[12]="western.htm"
urls[13]="western.htm"
urls[14]="southwestern.htm"
urls[15]="southwestern.htm"

//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);
layerTop[i] = 0;
}
}

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="next"
j=1
document.playercomm.stop.disabled=false
document.playercomm.play.disabled=true
}
var rotation
var rotspeed
rotspeed=3000
//	clearTimeout(rotation)
//	rotate()

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='<b>'+descr[opt]+'</b>'

if(document.layers){
document.layers["container"].document.layers["descrip"].document.write(text)
document.layers["container"].document.layers["descrip"].document.close();
}

if(document.all)
{
document.all["descrip"].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.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.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)
}
}

