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=380	//width of slide show area
tabheight=340	//height of slide show area        

buttonbgcolor="#000000"		//background color of buttons
buttontextcolor="#FF9900"	//text color for buttons
descriptionbgcolor=""	        //background color of description area
textcolor="#FF9900"		//text color of description area
showbg=""	                //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="SPic01.jpg"
img[2].src="SPic02.jpg"
img[3].src="SPic03.jpg"
img[4].src="SPic04.jpg"
img[5].src="SPic05.jpg"
img[6].src="SPic06.jpg"
img[7].src="SPic07.jpg"
img[8].src="SPic08.jpg"
img[9].src="SPic09.jpg"
img[10].src="SPic10.jpg"
img[11].src="SPic11.jpg"
img[12].src="SPic12.jpg"
img[13].src="SPic13.jpg"
img[14].src="SPic14.jpg"
img[15].src="SPic15.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]=240
h[1]=320
w[2]=320
h[2]=240
w[3]=181
h[3]=320
w[4]=320
h[4]=240
w[5]=240
h[5]=320
w[6]=320
h[6]=240
w[7]=252
h[7]=320
w[8]=282
h[8]=320
w[9]=220
h[9]=320
w[10]=239
h[10]=320
w[11]=216
h[11]=320
w[12]=240
h[12]=320
w[13]=240
h[13]=320
w[14]=320
h[14]=313
w[15]=311
h[15]=320

//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]="1"
descr[2]="2"
descr[3]="3"
descr[4]="4"
descr[5]="5"
descr[6]="6"
descr[7]="7"
descr[8]="8"
descr[9]="9"
descr[10]="10"
descr[11]="11"
descr[12]="12"
descr[13]="13"
descr[14]="14"
descr[15]="15"

//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]="#"

//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
		}
	}
