var buttons=new Array();
var preloadbuttons=new Array();
var photos=new Array();
var photoslink=new Array();
var preloadphotos=new Array();

//Dimensions of Photos in your Album (All photos should have the same dimensions):
var iWidth=150;
var iHeight=110;

//Paths to Photos in your Album (You can have as many as you want):
photos[0]="images/photo1.jpg"
photos[1]="images/photo2.jpg"
photos[2]="images/photo3.jpg"
photos[3]="images/photo4.jpg"
photos[4]="images/photo5.jpg"

//Links for Photos in your Album (Don't define if the images don't have a link):
photoslink[0]="http://www.smartwebby.com/website_templates/default.asp"
photoslink[1]="http://www.smartwebby.com/website_templates/default.asp"

//Photo Album Functions:
function applyeffect(){
	if (document.all && photo_album.filters){
		photo_album.filters.revealTrans.Transition=Math.floor(Math.random()*23);
		photo_album.filters.revealTrans.stop();
		photo_album.filters.revealTrans.apply();
		document.images.photo_album.src=photos[cursor];
		photo_album.filters.revealTrans.play();
	}
	else document.images.photo_album.src=photos[cursor];
	window.status="Photo "+(cursor+1)+" of "+photos.length;
}
function previous_photo(){
	pause_album();
	if (cursor>0) cursor--;
	else cursor=photos.length-1;
	applyeffect();
}
function next_photo(slideshow){
	if (slideshow==0) pause_album();
	if (iStop==0 || slideshow==0){
		if (cursor<photos.length-1) cursor++;
		else cursor=0;
		applyeffect();
		if (slideshow==1){
			if(document.all && photo_album.filters) setTimeout("play_album();",3000);
			else play_album();
		}
	}
}
function transport(){
	if (photoslink[cursor]!=null && photoslink[cursor]!="") window.open(photoslink[cursor]);
}
function play_album() {
	timeOn = setTimeout("next_photo(1)",3000);
}
function pause_album(){
	if (iStop==0) {
		document.images.pause_start.src=buttons[0].src;
		iStop=1;
	}
	if (document.all && photo_album.filters){
		photo_album.filters.revealTrans.stop();
		photo_album.filters.revealTrans.apply();
	}
	return;
}
function stop_album() {
	cursor=0;
	document.images.photo_album.src=photos[cursor];
	pause_album();
}
function album(){
	if (iStop==1){
		iStop=0;
		play_album();
		document.images.pause_start.src=buttons[1].src;
	}
	else pause_album();
}
preloadbuttons[0]="images/start.gif";
preloadbuttons[1]="images/pause.gif";
buttons[0]=new Image();
buttons[0].src=preloadbuttons[0];
buttons[1]=new Image();
buttons[1].src=preloadbuttons[1];
var cursor=0;
var iStop=0;
for (i=0;i<photos.length;i++){
	preloadphotos[i]=new Image();
	preloadphotos[i].src=photos[i];
}