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=300	//width of slide show area
tabheight=200	//height of slide show area        

buttonbgcolor="#00005E"		//background color of buttons
buttontextcolor="#FFFFFF"	//text color for buttons
descriptionbgcolor="#A3B2C1"	//background color of description area
textcolor="#663366"		//text color of description 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="oktoberfestpics/01.jpg"
img[2].src="oktoberfestpics/02.jpg"
img[3].src="oktoberfestpics/03.jpg"
img[4].src="oktoberfestpics/04.jpg"
img[5].src="oktoberfestpics/05.jpg"
img[6].src="oktoberfestpics/06.jpg"
img[7].src="oktoberfestpics/07.jpg"
img[8].src="oktoberfestpics/08.jpg"
img[9].src="oktoberfestpics/09.jpg"
img[10].src="oktoberfestpics/10.jpg"
img[11].src="oktoberfestpics/11.jpg"
img[12].src="oktoberfestpics/12.jpg"
img[13].src="oktoberfestpics/13.jpg"
img[14].src="oktoberfestpics/14.jpg"
img[15].src="oktoberfestpics/15.jpg"
img[16].src="oktoberfestpics/16.jpg"
img[17].src="oktoberfestpics/17.jpg"
img[18].src="oktoberfestpics/18.jpg"
img[19].src="oktoberfestpics/19.jpg"
img[20].src="oktoberfestpics/20.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]=400
h[1]=260
w[2]=400
h[2]=260
w[3]=400
h[3]=260
w[4]=400
h[4]=260
w[5]=400
h[5]=260
w[6]=400
h[6]=260
w[7]=400
h[7]=260
w[8]=400
h[8]=260
w[9]=400
h[9]=260
w[10]=400
h[10]=260
w[11]=400
h[11]=260
w[12]=400
h[12]=260
w[13]=400
h[13]=260
w[14]=400
h[14]=260
w[15]=400
h[15]=260
w[16]=400
h[16]=260
w[17]=400
h[17]=260
w[18]=400
h[18]=260
w[19]=400
h[19]=260
w[20]=400
h[20]=260

//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]="This years Oktoberfest Krug, mounted over one of the many beer tents."
descr[2]="The main gateway into the Oktoberfest grounds, the festival is 169 years old this year."
descr[3]="Outside the Spaten Hippodrome beer tent"
descr[4]="Tee shirts and souvenirs are plentiful"
descr[5]="All the breweries have horse drawn wagons which are extensively decorated."
descr[6]="Every beer tent has live music, playing old and new Oktoberfest favorites."
descr[7]="A really fresh Breze is part of the magic of the festival."
descr[8]="Every beer tent is packed and it can be very difficult to get a place after 7.00pm"
descr[9]="The world famous Hofbräuhaus bier tent, packed with Australians and Americans."
descr[10]="Grilled chicken is very popular and 100,000's sold every year."
descr[11]="Souvenir stands are spread thoughout the festival grounds."
descr[12]="Another beer tent, another atmosphere, and still great beer."
descr[13]="Wooden plates or tellers are great to take home. Hange on the wall or use them to eat from."
descr[14]="The Oktoberfest is not all beer, A very large fun fair is popular with everybody and great for the kids."
descr[15]="Recommended that you don't try some of these rides after drinking and eating."
descr[16]="Target shooting is great fun, and prizes can be won if you are any good."
descr[17]="The world famous Munich Steckerlfisch, Mackerel cooked over an open charcoal fire, delicious."
descr[18]="Back to the Hippodrom and Prost."
descr[19]="A view from the large carousel wheel"
descr[20]="Final view of Munich, flavour to be remembered, until next year"

//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=false
document.playercomm.faster.disabled=false
document.playercomm.slower.disabled=false
}
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=false
	document.playercomm.play.disabled=false
	document.playercomm.faster.disabled=false
	document.playercomm.slower.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=false
	document.playercomm.stop.disabled=false
	document.playercomm.faster.disabled=false
	document.playercomm.slower.disabled=false
	document.playercomm.previous.disabled=false
	document.playercomm.next.disabled=false
}
}

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
		}
	}

