var lastThumb = "tn12"  //remembers the ID of the last thumbnail to be made invisible


function changeGallery(){
	var Index = document.form1.select1.selectedIndex
	switch(Index){
	case 0:
		gal02()
		break
	case 1:
		gal03()
		break
	case 2:
		galM1()
		break
	case 3:
		galM2()
		break
	case 4:
		galM3()
		break
	case 5:
		galM4()
		break
	}
}



function ChangeThumbs(gal, ImageList){
	document.images.tn01.src="images/"+gal+"/tn_"+ImageList[0][0]+".jpg"
	document.images.tn02.src="images/"+gal+"/tn_"+ImageList[1][0]+".jpg"
	document.images.tn03.src="images/"+gal+"/tn_"+ImageList[2][0]+".jpg"
	document.images.tn04.src="images/"+gal+"/tn_"+ImageList[3][0]+".jpg"
	document.images.tn05.src="images/"+gal+"/tn_"+ImageList[4][0]+".jpg"
	document.images.tn06.src="images/"+gal+"/tn_"+ImageList[5][0]+".jpg"
	document.images.tn07.src="images/"+gal+"/tn_"+ImageList[6][0]+".jpg"
	document.images.tn08.src="images/"+gal+"/tn_"+ImageList[7][0]+".jpg"
	document.images.tn09.src="images/"+gal+"/tn_"+ImageList[8][0]+".jpg"
	document.images.tn10.src="images/"+gal+"/tn_"+ImageList[9][0]+".jpg"
	document.images.tn11.src="images/"+gal+"/tn_"+ImageList[10][0]+".jpg"
	document.images.tn12.src="images/"+gal+"/tn_"+ImageList[11][0]+".jpg"

	document.images.tn01.alt=ImageList[0][0]+"  ("+ImageList[0][1]+")"
	document.images.tn02.alt=ImageList[1][0]+"  ("+ImageList[1][1]+")"
	document.images.tn03.alt=ImageList[2][0]+"  ("+ImageList[2][1]+")"
	document.images.tn04.alt=ImageList[3][0]+"  ("+ImageList[3][1]+")"
	document.images.tn05.alt=ImageList[4][0]+"  ("+ImageList[4][1]+")"
	document.images.tn06.alt=ImageList[5][0]+"  ("+ImageList[5][1]+")"
	document.images.tn07.alt=ImageList[6][0]+"  ("+ImageList[6][1]+")"
	document.images.tn08.alt=ImageList[7][0]+"  ("+ImageList[7][1]+")"
	document.images.tn09.alt=ImageList[8][0]+"  ("+ImageList[8][1]+")"
	document.images.tn10.alt=ImageList[9][0]+"  ("+ImageList[9][1]+")"
	document.images.tn11.alt=ImageList[10][0]+"  ("+ImageList[10][1]+")"
	document.images.tn12.alt=ImageList[11][0]+"  ("+ImageList[11][1]+")"
	ChangePic(document.images.tn01.src, document.images.tn01.alt, 15)
}

function forward(){
	ThumbPos ++
	if (ThumbPos >=27){ThumbPos = 15}
	ChangePic(document.images[ThumbPos].src, document.images[ThumbPos].alt, ThumbPos)
	//document.images[ThumbPos].click()
}

function back(){
	ThumbPos --
	if (ThumbPos <=14){ThumbPos = 26}
	ChangePic(document.images[ThumbPos].src, document.images[ThumbPos].alt, ThumbPos)
	//document.images[ThumbPos].click()
}

function ChangePic(p, cap, tn) {

	var bit = p.split("/")
	var n = bit[bit.length-1].split("_")
	var pa = bit[bit.length-3] + "/" + bit[bit.length-2] + "/" + n[1]
	ThumbPos = tn
	var tnName = tn-14
	if(tnName<10){
		tnName = "tn0"+tnName
	}else{
		tnName = "tn"+tnName
	}
	var obj = document.getElementById(tnName)
	obj.style.visibility = "hidden";
	obj= document.getElementById(lastThumb);
	obj.style.visibility = "visible";
	document.images.pic.src=pa
	lastThumb = tnName
	//for IE (must also set visibility of imgObj to "hidden" before trans)
	//imgObj.style.visibility = "hidden"
	//doTrans(pa)
	//document.images.pic.alt=cap
	caption.innerHTML = cap
}

function doTrans(endImage) {
        imgObj.filters[0].apply();
        
        pic.src = endImage;
		imgObj.style.visibility = "visible"
        imgObj.filters[0].play();
}

function gal01(){
	var GalName = "gal01"
	var ImageList = new Array();
	ImageList[0] = new Array("mrg04-0096", "")
	ImageList[1] = new Array("fas03-0061", "")
	ImageList[2] = new Array("rmc04-1356", "")
	ImageList[3] = new Array("clas01-0282", "")
	ImageList[4] = new Array("buc05-1315", "")
	ImageList[5] = new Array("sc02-0251", "")
	ImageList[6] = new Array("s4504-0762", "")
	ImageList[7] = new Array("can04-1666", "")
	ImageList[8] = new Array("buc07-0924", "")
	ImageList[9] = new Array("ost07-1852", "")
	ImageList[10] = new Array("ost07-1263", "")
	ImageList[11] = new Array("fas05-1474", "")
	ChangeThumbs(GalName, ImageList)
}

function gal02(){
	var GalName = "gal02"
	var ImageList = new Array();
	ImageList[0] = new Array("can05-0292", "Boda Fide - Cannes 2005")
	ImageList[1] = new Array("clas05-1210", "Ranger - Antigua Classic 2005")
	ImageList[2] = new Array("clas05-1868", "Charm III - Antigua Classic 2005")
	ImageList[3] = new Array("clas06-1058", "Victoria Of Duxberry - Antigua Classic 2006")
	ImageList[4] = new Array("stz04-1097", "Cambria - St. Tropez 2004")
	ImageList[5] = new Array("stz06-1760", "Emilia - St. Tropez 2006")
	ImageList[6] = new Array("clas05-0777", "Velsheda - Antigua Classic 2005")
	//ImageList[6] = new Array("clas06-2116", "Pazienza - Antigua Classic 2006")
	ImageList[7] = new Array("stz06-3396", "So Fong - St. Tropez 2006")
	ImageList[8] = new Array("stz06-3507", "Cholita - St. Tropez 2006")
	ImageList[9] = new Array("stz06-3610", "Dolphin - St. Tropez 2006")
	ImageList[10] = new Array("stz06-3723", "Sunshine - St. Tropez 2006")
	ImageList[11] = new Array("clas01-0711", "Savannah - Antigua Classic 2001")
	ChangeThumbs(GalName, ImageList)
}

function gal03(){
	var GalName = "gal03"
	var ImageList = new Array();
	ImageList[0] = new Array("stz06-3740", "Owl - St. Tropez 2006")
	ImageList[1] = new Array("can04-1666", "Mariquita - Cannes 2004")
	ImageList[2] = new Array("clas04-1184", "Cambria - Antigua Classic 2004")
	ImageList[3] = new Array("clas04-2066", "Ranger - Antigua Classic 2004")
	ImageList[4] = new Array("clas04-1379", "Cambria - Antigua Classic 2004")
	ImageList[5] = new Array("clas04-2401", "Velsheda - Antigua Classic 2004")
	ImageList[6] = new Array("clas04-2466", "Bolero - Antigua Classic 2004")
	ImageList[7] = new Array("clas04-2574", "Velsheda - Antigua Classic 2004")
	ImageList[8] = new Array("stz04-0739", "Eleonora and Moonbean IV - St. Tropez 2004")
	ImageList[9] = new Array("clas01-0282", "Velsheda - Antigua Classic 2001")
	ImageList[10] = new Array("clas05-0717", "Velsheda and Ranger - Antigua Classic 2005")
	ImageList[11] = new Array("clas02-0930", "Windrose - Antigua Classic 2002")
	ChangeThumbs(GalName, ImageList)
}

function galBobBryant(){
	var GalName = "galBobBryant"
	var ImageList = new Array();
	ImageList[0] = new Array("BellA300", "by Bob Bryant")
	ImageList[1] = new Array("Bellebow", "by Bob Bryant")
	ImageList[2] = new Array("brilliant01285H", "by Bob Bryant")
	ImageList[3] = new Array("eda300", "by Bob Bryant")
	ImageList[4] = new Array("Mariette2285", "by Bob Bryant")
	ImageList[5] = new Array("Mariette3285h", "by Bob Bryant")
	ImageList[6] = new Array("Marietteportside300", "by Bob Bryant")
	ImageList[7] = new Array("wait4ranger275", "by Bob Bryant")
	ImageList[8] = new Array("blank", "")
	ImageList[9] = new Array("blank", "")
	ImageList[10] = new Array("blank", "")
	ImageList[11] = new Array("blank", "")
	ChangeThumbs(GalName, ImageList)
}

function galKeithWalker(){
	var GalName = "galKeithWalker"
	var ImageList = new Array();
	ImageList[0] = new Array("Battle", "by Keith Walker")
	ImageList[1] = new Array("Cannes", "by Keith Walker")
	ImageList[2] = new Array("DreamCatcher1", "by Keith Walker")
	ImageList[3] = new Array("Duel", "by Keith Walker")
	ImageList[4] = new Array("Equation", "by Keith Walker")
	ImageList[5] = new Array("Minerva", "by Keith Walker")
	ImageList[6] = new Array("RushHour", "by Keith Walker")
	ImageList[7] = new Array("blank", "")
	ImageList[8] = new Array("blank", "")
	ImageList[9] = new Array("blank", "")
	ImageList[10] = new Array("blank", "")
	ImageList[11] = new Array("blank", "")
	ChangeThumbs(GalName, ImageList)
}

function galTW(){
	var GalName = "galTW"
	var ImageList = new Array();
	ImageList[0] = new Array("TW01", "Photo: James Robinson Taylor - www.jrtphoto.com, St. Tropez 2006")
	ImageList[1] = new Array("TW02", "Photo: Wendy Marryshow")
	ImageList[2] = new Array("TW03", "Photo: Kenmore Henville")
	ImageList[3] = new Array("TW04", "Photo: Kenmore Henville")
	ImageList[4] = new Array("TW05", "Photo: Kenmore Henville")
	ImageList[5] = new Array("TW06", "Photo: Kenmore Henville")
	ImageList[6] = new Array("TW07", "Photo: Sally Collison - www.sallycollisonphotography.co.uk, Cowes 2005")
	ImageList[7] = new Array("TW08", "Photo: Sally Collison - www.sallycollisonphotography.co.uk, Cowes 2005")
	ImageList[8] = new Array("TW09", "Photo: Kenmore Henville")
	ImageList[9] = new Array("blank", "")
	ImageList[10] = new Array("blank", "")
	ImageList[11] = new Array("blank", "")
	ChangeThumbs(GalName, ImageList)
}

function galM1(){
	var GalName = "galM1"
	var ImageList = new Array();
	ImageList[0] = new Array("mrg04-0096crop", "Swan 45 Gold Cup in Capri 2004")
	ImageList[1] = new Array("sdb05-1234", "Settimana della Boche, Sardinia 2005")
	ImageList[2] = new Array("hr03-3096", "'Starr Trail' - st. Maarten Heineken Regatta 2003")
	ImageList[3] = new Array("asw03-1835crop", "Antigua Sailing Week 2003")
	ImageList[4] = new Array("hr06-0752mod", "st. Maarten Heineken Regatta 2006")
	ImageList[5] = new Array("adc03-0111", "Admiral's Cup - Cowes 2003")
	ImageList[6] = new Array("sc02-0251", "Amerigo - Swan Cup, Sardinia 2002")
	ImageList[7] = new Array("tob04-1361", "Tobago Sail Week 2004")
	ImageList[8] = new Array("bvi04-0484", "BVI Spring Regatta, Tortola 2004")
	ImageList[9] = new Array("asw04-5048crop", "Mari-Cha IV and Aera, Antigua Sailing Week 2004")
	ImageList[10] = new Array("tob01-1220", "business Machine - Tobago Sail Week 2001")
	ImageList[11] = new Array("asw04-4431", "Murka - Antigua Sailing Week 2004")
	ChangeThumbs(GalName, ImageList)
}

function galM2(){
	var GalName = "galM2"
	var ImageList = new Array();
	ImageList[0] = new Array("fas03-0061", "Fastnet Race start, Cowes 2003")
	ImageList[1] = new Array("rmc04-0070", "Tiketitan - Maxi Cup, Sardinia 2005")
	ImageList[2] = new Array("whw04-1622", "West Highlands Week 2004")
	ImageList[3] = new Array("asw04-4952", "Antigua Sailing Week 2004")
	ImageList[4] = new Array("hr03-0767", "St. Maarten Heineken Regatta 2003")
	ImageList[5] = new Array("asw07-4556", "Titan XII - Antigua Sailing Week 2007")
	ImageList[6] = new Array("asw04-5197", "Mari-Cha IV, Antigua Sailing Week 2004")
	ImageList[7] = new Array("s4504-2974", "Swan 45 Gold Cup, Capri 2004")
	ImageList[8] = new Array("buc05-0396", "St. Barths 'Bucket' 2005")
	ImageList[9] = new Array("rmc04-1356", "Nokia - Maxi cup, Sardinia 2004")
	ImageList[10] = new Array("fcw06-0666", "Cork Week 2006")
	ImageList[11] = new Array("buc07-1390", "St. Barths 'Bucket' 2007")
	ChangeThumbs(GalName, ImageList)
}

function galM3(){
	var GalName = "galM3"
	var ImageList = new Array();
	ImageList[0] = new Array("asw07-4159", "Antigua Sailing Week 2007")
	ImageList[1] = new Array("cw06-2393", "Cowes Week 2006")
	ImageList[2] = new Array("buc07-0924", "Falcon - St. Barths 'Bucket' 2007")
	ImageList[3] = new Array("s4504-1679", "Swan 45 Gold Cup, Capri 2004")
	ImageList[4] = new Array("tob04-0335", "Tobago Sail Week 2004")
	ImageList[5] = new Array("fas05-1475", "Fastnet Race 2005")
	ImageList[6] = new Array("rmc05-1026", "Maxi Cup, Sardinia 2005")
	ImageList[7] = new Array("buc07-1253", "Falcon - St. Barths 'Bucket' 2007")
	ImageList[8] = new Array("sc02-0265", "Swan Cup, Sardinia 2002")
	ImageList[9] = new Array("sc06-2421", "Swan Cup, Sardinia 2006")
	ImageList[10] = new Array("arc03-0284", "Spirit of Minerva - ARC finish line, St. Lucia 2003")
	ImageList[11] = new Array("cw06-2483", "Cowes Week 2006")
	ChangeThumbs(GalName, ImageList)
}

function galM4(){
	var GalName = "galM4"
	var ImageList = new Array();
	ImageList[0] = new Array("s4504-0762", "Swan 45 Gold Cup, Capri 2004")
	ImageList[1] = new Array("asw02-0237", "Antigua Sailing Week 2002")
	ImageList[2] = new Array("fcw06-1435", "Cork Week 2006")
	ImageList[3] = new Array("rmc02-0857", "Maxi Cup, Sardinia 2002")
	ImageList[4] = new Array("rmc05-0958", "Maxi Cup, Sardinia 2005")
	ImageList[5] = new Array("sc06-2944", "Swan Cup, Sardinia 2006")
	ImageList[6] = new Array("sc06-2980", "Swan Cup, Sardinia 2006")
	ImageList[7] = new Array("rmc04-1617", "Maxi Cup, Sardinia 2004")
	ImageList[8] = new Array("asw07-1109", "Cuordileone - Antigua Sailing Week 2007")
	ImageList[9] = new Array("asw03-3125", "Antigua Sailing Week 2003")
	ImageList[10] = new Array("ost06-0636", "Ravenous - Oyster Week BVI, 2006")
	ImageList[11] = new Array("tob06-2278", "Slippery When Wet - Tobago Sail Week 2006")
	ChangeThumbs(GalName, ImageList)
}

function galMaiwenn(){
	var GalName = "galMaiwenn"
	var ImageList = new Array();
	ImageList[0] = new Array("Act One", "Watercolour by Maiwenn Beadle")
	ImageList[1] = new Array("Act One Start", "Watercolour by Maiwenn Beadle")
	ImageList[2] = new Array("Arc Angel", "Watercolour by Maiwenn Beadle")
	ImageList[3] = new Array("Chippewa", "Watercolour by Maiwenn Beadle")
	ImageList[4] = new Array("Dreamland", "Watercolour by Maiwenn Beadle")
	ImageList[5] = new Array("Dreamland2", "Watercolour by Maiwenn Beadle")
	ImageList[6] = new Array("Equus", "Watercolour by Maiwenn Beadle")
	ImageList[7] = new Array("GillyB", "Watercolour by Maiwenn Beadle")
	ImageList[8] = new Array("Mistress", "Watercolour by Maiwenn Beadle")
	ImageList[9] = new Array("Night Owl", "Watercolour by Maiwenn Beadle")
	ImageList[10] = new Array("Velsheda", "Watercolour by Maiwenn Beadle")
	ImageList[11] = new Array("blank", "")
	ChangeThumbs(GalName, ImageList)
}
