/**
 *	Photo Gallery script
 *	for LearnToSalsa.com
 *	by Kevin Lynn Brown
 *	Copyright 2001 All rights reserved
 */

var galleryIdx = 0;
var galleryImg =  new Array();

Object.prototype.text = "";
Object.prototype.value = "";

function makeGalleryImages() {
	var a = 0;
	for (var b = 0; b < makeGalleryImages.arguments.length; b+=2) {
		galleryImg[a] = new Object();
		galleryImg[a].value = makeGalleryImages.arguments[b];
		galleryImg[a].text = makeGalleryImages.arguments[b+1];
		a++;
	}
}

makeGalleryImages(
	"tenia1","Tenia 1",
	"tenia2","Tenia 2",
	"tenia3","Tenia 3",
	"tenia4","Tenia 4",
	"tenia5","Tenia 5",
	"tenia6","Tenia 6",
	"tenia7","Tenia 7",
	"tenia8","Tenia 8",
	"titopuente80optQsh","Tito & Whitney with Tenia, Salseras",
	"salseras80optQsh","Tenia & Salseras",
	"tenia+hythum70","Tenia & Hythum dancing",
	"teniadancing70","Tenia dancing",
	"competition70","Salsa dancers",
	"studio1-70","Tenia studio promo 1",
	"studio2-70","Tenia studio promo 2",
	"studio3-70","Tenia studio promo 3",
	"studio4-70","Tenia studio promo 4",
	"teniabeach70","Tenia beach promo",
	"teniaportrait70","Portrait of Tenia",
	"stiletto1-70","Stiletto Salsa 1",
	"stiletto2-70","Stiletto Salsa 2",
	"stiletto3-70","Stiletto Salsa 3",
	"stiletto4-70","Stiletto Salsa 4",
	"mandie70","Mandie of Stiletto Salsa",
	"tenia+humberto_rehearse70","Tenia and Humberto rehearsing",
	"elise+louie70","Elise and Louie",
	"elise+mark+tenia70","Tenia with Mark and Elise",
	"girls70","Stiletto Salsa Promo",
	"rehearsing70","Stiletto Salsa Rehearsing",
	"sportsmans_lodge70","Sportsman's Lodge",
	"tenia+elise_xmas70","Tenia and Elise at Christmas",
	"elise+christian70","Elise and Christian",
	"tenia+humberto70","Tenia and Humberto 1",
	"tenia+humberto2-70","Tenia and Humberto 2"
)

function getImage(name) {
	if (MSIE) {
		parent.galleryFrame.document.galleryImage.src = pleaseWait.src;
		parent.galleryFrame.document.galleryImage.src = "../img/gallery/" + name + ".jpg";
	}
	else if (NETSCAPE) {
		parent.galleryFrame.location.href = "gallery/" + name + ".php";
	}
}

function prev() {
	if (document.galleryControls.pictures.selectedIndex > 1) {
		document.galleryControls.pictures.selectedIndex--;
		if (MSIE) {
			parent.galleryFrame.document.galleryImage.src = pleaseWait.src;
			parent.galleryFrame.document.galleryImage.src = "../img/gallery/" + galleryImg[document.galleryControls.pictures.selectedIndex].value + ".jpg";
		}
		else if (NETSCAPE) {
			parent.galleryFrame.location.href = "gallery/" + galleryImg[document.galleryControls.pictures.selectedIndex].value + ".php";
		}
	}
	else {
		return;
	}
}

function next() {
	if (document.galleryControls.pictures.selectedIndex < galleryImg.length-1) {
		document.galleryControls.pictures.selectedIndex++
		if (MSIE) {
			parent.galleryFrame.document.galleryImage.src = pleaseWait.src;
			parent.galleryFrame.document.galleryImage.src = "../img/gallery/" + galleryImg[document.galleryControls.pictures.selectedIndex].value + ".jpg";
		}
		else if (NETSCAPE) {
			parent.galleryFrame.location.href = "gallery/" + galleryImg[document.galleryControls.pictures.selectedIndex].value + ".php";
		}
	}
	else {
		return;
	}
}

function setup() {
	var n = 0;
	for (var i = 0; i < galleryImg.length; i++) {
		document.galleryControls.pictures.options[n] = new Option(galleryImg[i].text, galleryImg[i].value);
		n++;
	}
	document.galleryControls.pictures.selectedIndex = (galleryIdx >= 1) ? galleryIdx-1:galleryIdx;
}
