


function photo(id,galleries_id,src,width,height,caption,thumbnail,thumbnail_width,thumbnail_height,home,gallery,description,takendate,photographer,location) {
	
		this.id = id;
		this.galleries_id = galleries_id;
		this.src = src;
		this.width = width;
		this.height = height;
		this.caption = caption;
		this.thumbnail = thumbnail;
		this.thumbnail_width = thumbnail_width;
		this.thumbnail_height = thumbnail_height;
		this.home = home;
		this.gallery = gallery;
		this.description = description;
		this.takendate = takendate;
		this.photographer = photographer;
		this.location = location;
}

function gallery(id,featured_images,title) {
	this.id = id;
	this.featured_images = featured_images;
	this.title = title;
}

function randomListVal(list) {
	arrayVals = list.split(',');
	pos=  Math.round(Math.random() * (arrayVals.length - 1));
	debug('Returning ' + arrayVals[pos] + ' as random image')
	return arrayVals[pos];
}

function showHomeImage(img) {

	// img = reference to image object in which to show image

	imageID = randomListVal('8576,3503');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if (!basic) {
			img.src = 'images/' + photos[j].src;
			img.width = photos[j].width;
			img.height = photos[j].height;
			}
			else {
				newImage = new Image(photos[j].width,photos[j].height);
				newImage.src = 'images/' + photos[j].src;
				document.images[img.name] = newImage;
				alert (newImage.src);
			}
			break;
		}
	}
}

function showHomeImageInline() {
	
	imageID = randomListVal('8576,3503');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			document.write('<img src="images/' + photos[j].src + '" width="' + photos[j].width + '" height="' + photos[j].height + '" class="homepageimage" id="mainSample" name="mainSample" alt="' + photos[j].caption  + '" border="0">');
			break;
		}
	}
	
}


function next(field,img) {

	// field = hidden field containing image_id
	// img = reference to image object in which to show image
	imageID = field.value;
	
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			break;
		}
	}
	debug('image is ' + j);
	nextImg = -1;
	k= j + 1;
	while (nextImg < 0) {
		for (; k < photos.length; k++) {
			debug('testing image ' + k + ': gallery = ' + photos[k].galleries_id + '(existing: ' + photos[j].galleries_id + ')');
			if (photos[k].galleries_id == photos[j].galleries_id) {
				nextImg = k;
				debug('setting  nextImg = ' + k);
				break;
			}
		}
		if (nextImg == -1) {
			k = 0;
		}
	}
	if (nextImg != -1) {
		updateImage(nextImg, field,img);
	}


}


function updateImage (nextImg, field,img) {
	// set a new image on the gallery detail page given its array position
	if (!basic) {
		debug('In updateImage');
		debug('setting  img src = ' + photos[nextImg].src);
		
		
		document.all.imagePhoto.innerHTML = '<img class="galleryimage" src="images/' + photos[nextImg].src + ' " id="mainPic" name="mainPic" width="' + photos[nextImg].width + '" height="' + photos[nextImg].height + '" alt="' + photos[nextImg].caption + '" border="0">';
		totalwidth = 754;
		middlespacerwidth = 16;
		
		document.all.lhspacer1.width = totalwidth - photos[nextImg].width - middlespacerwidth;
		document.all.lhspacer2.width = totalwidth - photos[nextImg].width - middlespacerwidth;
		document.all.lhspacer3.width = totalwidth - photos[nextImg].width - middlespacerwidth;
		document.all.midspacer1.height = photos[nextImg].height - 20;
		document.all.rhspacer1.width =photos[nextImg].width;
		document.all.rhspacer2.width = photos[nextImg].width;
		document.all.rhspacer3.width = photos[nextImg].width;
		debug('Width (lh) = ' +  (totalwidth - photos[nextImg].width - middlespacerwidth));
		debug('Width (rh) = ' +  photos[nextImg].width);
		
		field.value = photos[nextImg].id;
		document.all.imageTitle.innerHTML = '<strong>' + photos[nextImg].caption + '</strong>';
		temp = ''
		temp = temp +  '<div style="margin-bottom:12px" class="normal">' + photos[nextImg].description + '</div>';
		
		debug('Taken date is ' + photos[nextImg].takendate);
		
		if (photos[nextImg].takendate != '') {
			debug('Resetting taken date');
			temp = temp + '<div class="normal"><strong>Date: </strong>' + photos[nextImg].takendate + '</div>';
		}
		
		if (photos[nextImg].location != '') {
			debug('Resetting location');
			temp = temp + '<div class="normal"><strong>Location: </strong>' +  photos[nextImg].location + '</div>';
		}
		
		if (photos[nextImg].photographer != '') {
			debug('Resetting photographer');
			temp = temp + '<div class="normal"><strong>Photographer: </strong>' + photos[nextImg].photographer + '</div>';
		}
		
		
		
		document.all.imageCopy.innerHTML =temp;	
		
		
	}
	else {
		//debug('Redirecting to id ' + photos[nextImg].id);
		
			window.location = 'photo_' + photos[nextImg].id + '.html';
		
		
	}
	
}

function previous(field,img) {

	// field = hidden field containing image_id
	// img = reference to image object in which to show image

	imageID = field.value;
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			break;
		}
	}
	debug('image is ' + j);
	nextImg = -1;
	k= j  -1;
	while (nextImg < 0) {
		for (; k >= 0; k--) {
			if (photos[k].galleries_id == photos[j].galleries_id) {
				nextImg = k;
				break;
			}
		}
		if (nextImg == -1) {
			k = photos.length -1;
		}
	}
	if (nextImg != -1) {
		updateImage(nextImg, field,img);	
	}
}


function showGalleryImage(gallery_id, img) {
	// Gallery_id = id of gallery to choose
	// img = reference to image object in which to show image
	
	for (i = 0; i < galleries.length; i++) {
		if (galleries[i].id == gallery_id) {
			imageID = randomListVal(galleries[i].featured_images);
				for (j = 0; j < photos.length; j++) {
					if (photos[j].id == imageID) {
						
						img.src = 'images/' + photos[j].thumbnail;
						img.width = photos[j].thumbnail_width;
						img.height = photos[j].thumbnail_height;
						
						break;
					}
				}
			break;
		}
	} 
}
/* if we have dynamic HTML, replace the galleries link with a list that doesn't include the
current gallery */
function showGalleries(gallery_id) {
	debug('Showing links for gallery ' + gallery_id);
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
			debug('Testing gallery ' + galleries[i].id);
			
			if (galleries[i].id != gallery_id) {
				debug('Adding link');
				if (temp != '') {
					temp = temp + ' | ';
				}
				
					temp = temp + '<a href="gallery_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
				
				
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

photos = new Array();
photos[0] = new photo(3503,644,'Cayman Diver 3.jpg',400,517,'Graham Smith','Cayman Diver 3_thumb.jpg',130, 168,1, 0,'','','Patricia A Smith','Aboard Viewfinder off Grand Cayman');
photos[1] = new photo(8576,644,'Graham back.jpg',400,560,'Graham Smith','Graham back_thumb.jpg',130, 182,1, 0,'','','Patricia A Smith','Aboard Viewfinder Grand Cayman');
photos[2] = new photo(8577,644,'Graham Surfaced.jpg',400,320,'Graham Smith','Graham Surfaced_thumb.jpg',130, 104,0, 1,'','','Patricia A Smith','Viewfinder, off Grand Cayman');
photos[3] = new photo(8559,1271,'NW Point Drop Off 1.1 jpg.jpg',400,588,'NW Point Drop Off','NW Point Drop Off 1_thumb.1 jpg.jpg',130, 191,0, 0,'','','','');
photos[4] = new photo(8561,1271,'NW Point Drop Off 1.3jpg.jpg',400,603,'NW Point Drop Off','NW Point Drop Off 1_thumb.3jpg.jpg',130, 196,0, 0,'','','','');
photos[5] = new photo(8562,1271,'NW Point Drop Off 1.4 jpg.jpg',400,603,'NW Point Drop Off','NW Point Drop Off 1_thumb.4 jpg.jpg',130, 196,0, 0,'','','','');
photos[6] = new photo(8564,1271,'Orange Canyon 1.1 jpg.jpg',400,588,'Orange Canyon','Orange Canyon 1_thumb.1 jpg.jpg',130, 191,0, 1,'','','Graham Smith','');
photos[7] = new photo(8565,1271,'Orange Canyon 1.2 jpg.jpg',400,600,'Orange Canyon','Orange Canyon 1_thumb.2 jpg.jpg',130, 195,0, 0,'','','Graham Smith','');
photos[8] = new photo(8566,1271,'Orange Canyon 1.5 jpg.jpg',400,600,'Orange Canyon','Orange Canyon 1_thumb.5 jpg.jpg',130, 195,0, 0,'','','Graham Smith','');
photos[9] = new photo(8567,1271,'Orange Canyon 1.4 jpg.jpg',400,600,'Orange Canyon','Orange Canyon 1_thumb.4 jpg.jpg',130, 195,0, 0,'','','Graham Smith','');
photos[10] = new photo(8568,1271,'Orange Canyon 1.6 jpg.jpg',400,600,'Orange Canyon','Orange Canyon 1_thumb.6 jpg.jpg',130, 195,0, 0,'','','Graham Smith','');
photos[11] = new photo(8569,1271,'Orange Canyon 1.7 jpg.jpg',400,600,'Orange Canyon','Orange Canyon 1_thumb.7 jpg.jpg',130, 195,0, 0,'','','Graham Smith','');
photos[12] = new photo(8570,1271,'Orange Canyon 1.8 jpg.jpg',400,600,'Orange Canyon','Orange Canyon 1_thumb.8 jpg.jpg',130, 195,0, 0,'','','Graham Smith','');
photos[13] = new photo(8572,1271,'Trinity Caves 1.1 jpg.jpg',400,603,'Trinity Caves','Trinity Caves 1_thumb.1 jpg.jpg',130, 196,0, 0,'','','Graham Smith','');
photos[14] = new photo(8573,1271,'Trinity Caves 1.2 jpg.jpg',400,603,'Trinity Caves','Trinity Caves 1_thumb.2 jpg.jpg',130, 196,0, 0,'','','Graham Smith','');
photos[15] = new photo(8574,1271,'Trinity Caves 1.3 jpg.jpg',400,600,'Trinity Caves','Trinity Caves 1_thumb.3 jpg.jpg',130, 195,0, 0,'','','Graham Smith','');
photos[16] = new photo(8575,1271,'Chinese Wall 1.jpg',400,586,'Chinese Wall','Chinese Wall 1_thumb.jpg',130, 190,0, 0,'','','Graham Smith','');
photos[17] = new photo(3466,427,'Damsel Fish.jpg',400,226,'Threespot damselfish (Stegastes planifrons)','Damsel Fish_thumb.jpg',130, 73,0, 0,'Grows to about 5 inches and to be found at depths up to 130ft.','','Graham Smith','Off Seven Mile Beach');
photos[18] = new photo(3469,427,'DSC_0081 copy.jpg',400,252,'Fairy basslet (Gramma loreto)','DSC_0081 copy_thumb.jpg',130, 82,0, 0,'Grows to about 3ins max and found at depths between10 and 200ft.','','Graham Smith','');
photos[19] = new photo(3470,427,'DSC_0118 copy.jpg',400,265,'Tiger grouper (Mycteroperca tigris)','DSC_0118 copy_thumb.jpg',130, 86,0, 0,'Can grow up to three and a half feet and is found in depths of 10 to 60ft.','','Graham Smith','Off Seven Mile Beach');
photos[20] = new photo(3521,427,'Bar Jack.jpg',400,266,'Bar jack (Caranx ruber)','Bar Jack_thumb.jpg',130, 86,0, 0,'May grow to 2ft max. Found at depths up to 60ft. Also known as a Skipjack','','Graham Smith','Tarpon Alley, North Wall');
photos[21] = new photo(3522,427,'Blennie 1.1 21-01-04 copy.jpg',400,265,'Spinyhead blenny (Acanthemblemaria spinosa)','Blennie 1_thumb.1 21-01-04 copy.jpg',130, 86,0, 0,'','','','');
photos[22] = new photo(3523,427,'Blennie 1.2 21-01-04 copy.jpg',400,265,'Spinyhead blenny (Acanthemblemaria spinosa)','Blennie 1_thumb.2 21-01-04 copy.jpg',130, 86,0, 0,'Found at depths between 20 and 60 feet, it grows to a maximum length of one and a quarter inches.','','','');
photos[23] = new photo(3524,427,'Blue Chromis.jpg',400,265,'Blue chromis (Chromis cyanea)','Blue Chromis_thumb.jpg',130, 86,0, 0,'Grows to 5 inches max and found at depths between 35 and 80 feet','','','');
photos[24] = new photo(3525,427,'Blue Tang 1.2 21-01-04.jpg',400,266,'Doctorfish (Acanthurus chirurgus)','Blue Tang 1_thumb.2 21-01-04.jpg',130, 86,0, 0,'Can grow up to 14ins and found at depths between 15 and 80ft.','','Graham Smith','Off Seven Mile Beach');
photos[25] = new photo(3526,427,'Blue Tang 1.3 21-01-04.jpg',400,264,'Blue Tang (Acanthurus coeruleus)','Blue Tang 1_thumb.3 21-01-04.jpg',130, 86,0, 0,'Found at depths between 10 and 60ft the blue tang may grow to 15ins max.','','Graham Smith','Off Seven Mile Beach');
photos[26] = new photo(3527,427,'Blue Tang 21-01-04.jpg',400,266,'Blue Tang (Acanthurus coeruleus)','Blue Tang 21-01-04_thumb.jpg',130, 86,0, 0,'Found at depths between 10 and 60ft the blue tang may grow to 15ins max.','','Graham Smith','Off Seven Mile Beach');
photos[27] = new photo(3528,427,'Blue Tang.jpg',400,264,'Blue Tang (Acanthurus coeruleus)','Blue Tang_thumb.jpg',130, 86,0, 0,'Found at depths between 10 and 60ft the blue tang may grow to 15ins max.','','Graham Smith','Off Seven Mile Beach');
photos[28] = new photo(3529,427,'DSC_0087.jpg',400,318,'Mutton Snapper (Lutjanus analis)','DSC_0087_thumb.jpg',130, 103,0, 0,'Grows to about 2ft 6ins max and are to be found at depths of 5 to 60 ft. A very curious fish which will approach close to divers. ','','Graham Smith','');
photos[29] = new photo(3530,427,'DSC_0088.jpg',400,266,'Mutton Snapper (Lutjanus analis)','DSC_0088_thumb.jpg',130, 86,0, 0,'Grows to about 2ft 6ins max and are to be found at depths of 5 to 60 ft. A very curious fish which will approach close to divers. ','','Graham Smith','');
photos[30] = new photo(3531,427,'DSC_0089.jpg',400,265,'Yellowtail snapper (Ocyurus chrysurus)','DSC_0089_thumb.jpg',130, 86,0, 0,'Good to eat - always on the local menus as fish of the day. In its own environment, it\'s always ready for a free meal and can give a a nasty nip if you\'ve got food with you. Grows to about 30 inches and found in depths of 10 to 60ft','','Graham Smith','Off Seven Mile Beach');
photos[31] = new photo(3631,427,'DSC_0109.jpg',400,265,'Spotfin butterflyfish (Chaetodon ocellatus)','DSC_0109_thumb.jpg',130, 86,0, 0,'Found at depths of 10 to 60ft it grows to a length of 8ins max.','','Graham Smith','Off Seven Mile Beach');
photos[32] = new photo(3632,427,'DSC_0110.jpg',400,280,'Spotfin butterflyfish (Chaetodon ocellatus)','DSC_0110_thumb.jpg',130, 91,0, 0,'Found at depths of 10 to 60ft it grows to a length of 8ins max.','','Graham Smith','Off Seven Mile Beach');
photos[33] = new photo(3633,427,'DSC_0188.jpg',400,265,'Trumpetfish (Aulostomus maculatus)','DSC_0188_thumb.jpg',130, 86,0, 0,'Found at depths from 15 to 80ft, this fish may grow to 3ft max. It often drifts in a vertical position - head down; can change colour and position itself to blend with its background.','','Graham Smith','Off Seven Mile Beach');
photos[34] = new photo(3636,427,'DSC_0259 copy.jpg',400,263,'Squirrelfish (Holocentrus ascensionis)','DSC_0259 copy_thumb.jpg',130, 85,0, 0,'Note its striking golden orange dorsal fin. These can grow to 15 inches.','','Graham Smith','');
photos[35] = new photo(3638,427,'DSC_0336.jpg',400,266,'Spanish hogfish (Bodianus rufus)','DSC_0336_thumb.jpg',130, 86,0, 0,'May grow to two feet in length','','Graham Smith','');
photos[36] = new photo(3642,427,'DSC_0583 copy.jpg',400,500,'Diamond blenny (Malacoctenus boehlkei)','DSC_0583 copy_thumb.jpg',130, 163,0, 0,'Found at depths between 25 and 80 feet, the Diamond blenny grows to about two and a half inches max.','','Graham Smith','Off Seven Mile Beach');
photos[37] = new photo(3643,427,'DSC_0592 copy.jpg',400,320,'Cony (Epinephelus fulvus)','DSC_0592 copy_thumb.jpg',130, 104,0, 0,'Note its beautiful blue body spots','','Graham Smith','');
photos[38] = new photo(3647,427,'DSC_0638 copy.jpg',400,266,'Bermuda chub (Kyphosus sectatrix)','DSC_0638 copy_thumb.jpg',130, 86,0, 0,'','','Graham Smith','');
photos[39] = new photo(3648,427,'DSC_0646 copy.jpg',400,320,'Spotted scorpionfish (Scorpaena plumieri)','DSC_0646 copy_thumb.jpg',130, 104,0, 0,'Can grow up to 18 inches long; very well camouflaged to humans as well as its prey! A very patient predator - but don\'t stand on him unless you want pain and infection!','','Graham Smith','');
photos[40] = new photo(3649,427,'DSC_0652 copy.jpg',400,320,'Smooth trunkfish (Lactophrys triqueter)','DSC_0652 copy_thumb.jpg',130, 104,0, 0,'They blow jets of water on the sand to uncover the small burrowing organisms they feed on. Fascinating little fish which grows up to about a foot in length.','','Graham Smith','Off Seven Mile Beach');
photos[41] = new photo(3651,427,'DSC_0661 copy.jpg',400,320,'Smooth trunkfish (Lactophrys triqueter)','DSC_0661 copy_thumb.jpg',130, 104,0, 0,'Grows to 12ins max. and found at depths from 15 to 80ft','','Graham Smith','Off Seven Mile Beach');
photos[42] = new photo(3659,427,'DSC_0734 copy.jpg',400,266,'Queen Angelfish (Holacanthus ciliaris)','DSC_0734 copy_thumb.jpg',130, 86,0, 0,'Generally to be found in depths of 20 to 80ft, it will grow to 18ins max.','','Graham Smith','Off Seven Mile Beach');
photos[43] = new photo(3660,427,'DSC_0747 copy.jpg',400,320,'Threespot damselfish (Stegastes planifrons)','DSC_0747 copy_thumb.jpg',130, 104,0, 0,'Keen to defend its territory, it can grow to 5ins max and is found at depths down to 130ft.','','Graham Smith','Off Seven Mile Beach');
photos[44] = new photo(3662,427,'DSC_0776 copy.jpg',400,320,'Harlequin bass (Serranus tigrinus)','DSC_0776 copy_thumb.jpg',130, 104,0, 0,'Will grow to 4ins max and is found at depths of 2 to 120ft.','','Graham Smith','Off Seven Mile Beach');
photos[45] = new photo(3663,427,'DSC_0789 copy.jpg',400,320,'Juvenile Threespot damselfish (Stegastes planifrons) ','DSC_0789 copy_thumb.jpg',130, 104,0, 0,'Keen to defend its territory, this juvenile will change colour as it grows to 5ins max. It can be found at depths up to 130ft.','','Graham Smith','Off Seven Mile Beach');
photos[46] = new photo(3670,427,'DSC_0848 copy.jpg',400,320,'Tarpon (Megalops atlanticus)','DSC_0848 copy_thumb.jpg',130, 104,0, 0,'Grow to 8ft and found at depths up to 40ft. They drift in canyons and may inhabit a specific area for years. ','','Graham Smith','Turtle Reef');
photos[47] = new photo(3671,427,'DSC_0852 copy.jpg',400,320,'Tarpon (Megalops atlanticus)','DSC_0852 copy_thumb.jpg',130, 104,0, 0,'Grow to 8ft and found at depths up to 40ft. They drift in canyons and may inhabit a specific area for years. ','','Graham Smith','Turtle Reef');
photos[48] = new photo(3674,427,'Foureye Butterfly Fish 21-01-04.jpg',400,265,'Foureye butterflyfish (Chaetodon capistratus)','Foureye Butterfly Fish 21-01-04_thumb.jpg',130, 86,0, 0,'Often found, as here, in pairs, flitting about the reef tops at between 10 and 60ft. They can grow up to 6ins max.','','Graham Smith','Off Seven Mile Beach');
photos[49] = new photo(3675,427,'Foureye butterflyfish.jpg',400,266,'Foureye butterflyfish (Chaetodon capistratus)','Foureye butterflyfish_thumb.jpg',130, 86,0, 0,'More often found in pairs flitting across the reef tops. Can grow to 6ins max and found in depth of 10 to 60ft.','','Graham Smith','Off Seven Mile Beach');
photos[50] = new photo(3676,427,'Hogfish & Bar Jack 1.2.jpg',400,265,'Hogfish (Lachnolaimus maximus) with Barjack (Caranx ruber)','Hogfish & Bar Jack 1_thumb.2.jpg',130, 86,0, 0,'These two are often found together, the hogfish doing all the work digging in the bottom of open sandy areas in search of food and the barjack alongside picking up a free meal','','Graham Smith','Off Seven Mile Beach');
photos[51] = new photo(3677,427,'Hogfish.jpg',400,286,'Hogfish (Lachnolaimus maximus)','Hogfish_thumb.jpg',130, 93,0, 0,'May grow up to 3ft and are found at depths of 10 to 100ft. This one was being cleaned - hence the silly expression!','','Graham Smith','Off Seven Mile Beach');
photos[52] = new photo(3679,427,'Horse-eye Jack 1.2.jpg',400,266,'Horse-eye jack (Caranx latus)','Horse-eye Jack 1_thumb.2.jpg',130, 86,0, 0,'May grow to two and a half feet max and are found at depths up to 60ft.','','Graham Smith','Tarpon Alley, North Wall');
photos[53] = new photo(3680,427,'Horse-eye Jack 1.3.jpg',400,244,'Horse-eye jack (Caranx latus)','Horse-eye Jack 1_thumb.3.jpg',130, 79,0, 0,'May grow to two and a half feet max and are found at depths up to 60ft.','','Graham Smith','Tarpon alley, North Wall');
photos[54] = new photo(3681,427,'Ned\'s Tunnels 049 copy.jpg',400,292,'Longfin damselfish (Stegastes diencaeus)','Ned\'s Tunnels 049 copy_thumb.jpg',130, 95,0, 0,'Can grow up to 5ins max and is found at depths from 15 to 80ft.','','Graham Smith','Off Seven Mile Beach');
photos[55] = new photo(3682,427,'Parrotfish 1.1 21-01-04.jpg',400,265,'Stoplight parrotfish (Sparisoma viride)','Parrotfish 1_thumb.1 21-01-04.jpg',130, 86,0, 0,'This Stoplight parrotfish is in its initial phase. It will eventually turn emerald green and grow to a maximum of 2ft. It is found at depths of 15 to 80ft.','','Graham Smith','Off Seven Mile Beach');
photos[56] = new photo(3683,427,'Parrotfish being cleaned.jpg',400,260,'Princess parrotfish (Scarus taeniopterus)','Parrotfish being cleaned_thumb.jpg',130, 85,0, 0,'This Princess parrotfish enjoying a clean could grow to 13ins max. It is found at depths of 10 to 80ft.','','Graham Smith','Off Seven Mile Beach');
photos[57] = new photo(3684,427,'Puffer Fish 17-01-04.jpg',400,289,'Porcupinefish (Diodon hystrix)','Puffer Fish 17-01-04_thumb.jpg',130, 94,0, 0,'Found at depths between 10 and 60ft it can grow to 3ft max. Also known as a Spotted Spiney Puffer','','Graham Smith','Off Seven Mile Beach');
photos[58] = new photo(3685,427,'Rock Hind.jpg',400,266,'Rock hind (Epinephelus adscensionis)','Rock Hind_thumb.jpg',130, 86,0, 0,'Grows to 2ft max and is found at depths between 2 and 100ft.','','Graham Smith','Off Seven Mile Beach');
photos[59] = new photo(3686,427,'Schoolmaster.jpg',400,266,'Schoolmaster (Lutjanus apodus)','Schoolmaster_thumb.jpg',130, 86,0, 0,'These schoolmasters drift, sometimes in small groups just above the reefs in the shade of large corals. They can grow up to 2ft and are found at depths of between 10 and 80ft.','','Graham Smith','Off Seven Mile Beach');
photos[60] = new photo(3687,427,'Soap Fish.jpg',400,264,'Greater soapfish (Rypticus saponaceus)','Soap Fish_thumb.jpg',130, 86,0, 0,'Grows to 13ins max. Found at depths of 15 to 60ft its a night feeder which spends the day resting on the bottom or against ledges looking as though it\'s dead.','','Graham Smith','Off Seven Mile Beach');
photos[61] = new photo(3688,427,'Squirrelfish 1.3.jpg',400,266,'Squirrelfish (Holocentrus ascensionis)','Squirrelfish 1_thumb.3.jpg',130, 86,0, 0,'','','','');
photos[62] = new photo(3689,427,'Squirrelfish 1.jpg',400,267,'Squirrelfish (Holocentrus ascensionis)','Squirrelfish 1_thumb.jpg',130, 87,0, 0,'','','','');
photos[63] = new photo(3690,427,'Squirrelfish.jpg',400,267,'Longspine Squirrelfish (Holocentrus rufus)','Squirrelfish_thumb.jpg',130, 87,0, 0,'Grows up to twelve and a half inches and found at depths between 4 and 100ft.','','Graham Smith','Off Seven Mile Beach');
photos[64] = new photo(3691,427,'Tarpon 1.1.jpg',400,266,'Tarpon (Megalops atlanticus)','Tarpon 1_thumb.1.jpg',130, 86,0, 0,'Grow to 8ft and found at depths up to 40ft. They drift in canyons and may inhabit a specific area for years. ','','Graham Smith','Tarpon Alley, North Wall');
photos[65] = new photo(3692,427,'Tarpon 1.2.jpg',400,264,'Tarpon (Megalops atlanticus)','Tarpon 1_thumb.2.jpg',130, 86,0, 0,'Grow to 8ft and found at depths up to 40ft. They drift in canyons and may inhabit a specific area for years. ','','Graham Smith','');
photos[66] = new photo(3693,427,'Tarpon 1.3.jpg',400,265,'Tarpon (Megalops atlanticus)','Tarpon 1_thumb.3.jpg',130, 86,0, 0,'Grow to 8ft and found at depths up to 40ft. They drift in canyons and may inhabit a specific area for years. ','','Graham Smith','Tarpon Alley, North Wall');
photos[67] = new photo(3695,427,'Tarpon 1.6.jpg',400,266,'Tarpon (Megalops atlanticus)','Tarpon 1_thumb.6.jpg',130, 86,0, 0,'','','','');
photos[68] = new photo(3696,427,'Tarpon 1.7.jpg',400,266,'Tarpon (Megalops atlanticus)','Tarpon 1_thumb.7.jpg',130, 86,0, 0,'Grow to 8ft and found at depths up to 40ft. They drift in canyons and may inhabit a specific area for years. ','','Graham Smith','Tarpon Alley, North Wall');
photos[69] = new photo(3697,427,'Tarpon 1.8.jpg',400,265,'Tarpon (Megalops atlanticus)','Tarpon 1_thumb.8.jpg',130, 86,0, 0,'Grow to 8ft and found at depths up to 40ft. They drift in canyons and may inhabit a specific area for years. ','','Graham Smith','Turtle Reef');
photos[70] = new photo(3698,427,'Tarpon 1.9.jpg',400,265,'Tarpon (Megalops atlanticus)','Tarpon 1_thumb.9.jpg',130, 86,0, 0,'Grow to 8ft and found at depths up to 40ft. They drift in canyons and may inhabit a specific area for years. ','','Graham Smith','Tarpon Alley, North Wall');
photos[71] = new photo(3699,427,'Tiger Grouper being cleaned.jpg',400,265,'Tiger grouper (Mycteroperca tigris)','Tiger Grouper being cleaned_thumb.jpg',130, 86,0, 0,'Can be found at depths from 10 to 60ft and can grow up to three and a half feet. This one is enjoying being cleaned.','','Graham Smith','Off Seven Mile Beach');
photos[72] = new photo(3700,427,'Two Yellow Jacks.jpg',400,266,'Schoolmaster (Lutjanus apodus)','Two Yellow Jacks_thumb.jpg',130, 86,0, 0,'These schoolmasters drift, sometimes in small groups just above the reefs in the shade of large corals. They can grow up to 2ft and are found at depths of between 10 and 80ft.','','Graham Smith','Off Seven Mile Beach');
photos[73] = new photo(3701,427,'Yellow Jack 1.2.jpg',400,265,'Schoolmaster (Lutjanus apodus)','Yellow Jack 1_thumb.2.jpg',130, 86,0, 0,'These schoolmasters drift, sometimes in small groups just above the reefs in the shade of large corals. They can grow up to 2ft and are found at depths of between 10 and 80ft.','','Graham Smith','Off Seven Mile Beach');
photos[74] = new photo(3702,427,'Yellow Jack.jpg',400,264,'Schoolmaster (Lutjanus apodus)','Yellow Jack_thumb.jpg',130, 86,0, 0,'These schoolmasters drift, sometimes in small groups just above the reefs in the shade of large corals. They can grow up to 2ft and are found at depths of between 10 and 80ft.','','Graham Smith','Off Seven Mile Beach');
photos[75] = new photo(3703,427,'Yellowtail Damselfish.jpg',400,265,'Yellowtail damselfish (Microspathodon chrysurus)','Yellowtail Damselfish_thumb.jpg',130, 86,0, 0,'Inhabits reef tops at depths between 10 and 40ft. Can grow up to seven and a half inches.','','Graham Smith','Off Seven Mile Beach');
photos[76] = new photo(8560,427,'NW Point Drop Off 1.1.jpg',400,265,'Grey Angelfish (Pomacanthus arcuatus)','NW Point Drop Off 1_thumb.1.jpg',130, 86,0, 0,'A curious fish which can grow up to 2ft long and is found at depths up to 80ft','','Graham Smith','NW Point Drop Off, Grand Cayman');
photos[77] = new photo(8563,427,'NW Point Drop Off 1.5 jpg.jpg',400,265,'Tiger Grouper (Mycteroperca tigris)','NW Point Drop Off 1_thumb.5 jpg.jpg',130, 86,0, 0,'Grows up to 3ft 6ins and is found at depths up to about 60ft.','','Graham Smith','NW Point Drop Off, Grand Cayman');
photos[78] = new photo(8571,427,'Stonefish at Bear\'s Claw.jpg',400,273,'Spotted Scorpionfish (Scorpaena plumieri)','Stonefish at Bear\'s Claw_thumb.jpg',130, 89,0, 0,'Grows up to 18 inches and found at depths of up to 50 feet','','Graham Smith','Bear\'s Claw, Grand Cayman');
photos[79] = new photo(3465,647,'Christmas Tree Worm.jpg',400,265,'Christmas tree worm (Spirobranchus giganteus)','Christmas Tree Worm_thumb.jpg',130, 86,0, 0,'','','Graham Smith','');
photos[80] = new photo(3657,647,'DSC_0691 copy.jpg',400,320,'Christmas tree worm (Spirobranchus giganteus)','DSC_0691 copy_thumb.jpg',130, 104,0, 0,'','','Graham Smith','');
photos[81] = new photo(3656,647,'DSC_0690 copy.jpg',400,320,'Christmas tree worm (Spirobranchus giganteus)','DSC_0690 copy_thumb.jpg',130, 104,0, 0,'','','Graham Smith','');
photos[82] = new photo(3655,647,'DSC_0688 copy.jpg',400,320,'Christmas tree worm (Spirobranchus giganteus)','DSC_0688 copy_thumb.jpg',130, 104,0, 0,'','','Graham Smith','');
photos[83] = new photo(3653,647,'DSC_0684 copy.jpg',400,320,'Christmas tree worm (Spirobranchus giganteus)','DSC_0684 copy_thumb.jpg',130, 104,0, 0,'','','Graham Smith','');
photos[84] = new photo(3652,647,'DSC_0679 copy.jpg',400,320,'Christmas tree worm (Spirobranchus giganteus)','DSC_0679 copy_thumb.jpg',130, 104,0, 0,'','','Graham Smith','');
photos[85] = new photo(3664,647,'DSC_0816 copy.jpg',400,320,'Christmas tree worm (Spirobranchus giganteus)','DSC_0816 copy_thumb.jpg',130, 104,0, 0,'','','Graham Smith','');
photos[86] = new photo(3635,647,'DSC_0242 copy.jpg',400,265,'Christmas tree worm (Spirobranchus giganteus)','DSC_0242 copy_thumb.jpg',130, 86,0, 0,' ','','Graham Smith','');
photos[87] = new photo(3667,647,'DSC_0826 copy.jpg',400,320,'Christmas tree worm (Spirobranchus giganteus)','DSC_0826 copy_thumb.jpg',130, 104,0, 0,'','','Graham Smith','');
photos[88] = new photo(3665,647,'DSC_0819 copy.jpg',400,320,'Christmas tree worm (Spirobranchus giganteus)','DSC_0819 copy_thumb.jpg',130, 104,0, 0,'','','Graham Smith','');
photos[89] = new photo(3645,647,'DSC_0609 copy.jpg',400,267,'Split-crown feather duster worm (Anamobaea orstedii)','DSC_0609 copy_thumb.jpg',130, 87,0, 0,'Can be found anywhere between 15 and 75 feet. The crown can be up to two inches.','','Graham Smith','');
photos[90] = new photo(3644,647,'DSC_0603 copy.jpg',400,266,'Split-crown feather duster worm (Anamobaea orstedii)','DSC_0603 copy_thumb.jpg',130, 86,0, 0,'Can be found anywhere between 15 and 75 feet. The crown can be up to two inches.','','Graham Smith','');
photos[91] = new photo(3467,666,'DSC_0034 copy.jpg',400,340,'Flamingo tongue (Cyphoma gibbosum)','DSC_0034 copy_thumb.jpg',130, 111,0, 0,'Found at depths between 5 and 45 feet, these mollusks grow up to an inch long','','Graham Smith','');
photos[92] = new photo(3634,666,'DSC_0197.jpg',400,266,'Caribbean spiny lobster (Panulirus argus)','DSC_0197_thumb.jpg',130, 86,0, 0,'Carapace can be up to 30 inches! Found in depths from 10 to 130 feet.','','Graham Smith','');
photos[93] = new photo(3637,666,'DSC_0333.jpg',400,266,'Giant anemone (Condylactis gigantea)','DSC_0333_thumb.jpg',130, 86,0, 0,'To be found between 15 and 100 feet - can grow up to 12 inches across.','','Graham Smith','');
photos[94] = new photo(3661,666,'DSC_0749 copy.jpg',400,320,'Yellowline arrow crab (Stenorhynchus seticomis)','DSC_0749 copy_thumb.jpg',130, 104,0, 0,'One and a half to two and a half inches and found at depths between 10 and 130 ft','','Graham Smith','');
photos[95] = new photo(3668,666,'DSC_0835.jpg',400,266,'Yellowline arrow crab (Stenorhynchus seticomis)','DSC_0835_thumb.jpg',130, 86,0, 0,'One and a half to two and a half inches and found at depths between 10 and 130 ft','','Graham Smith','');
photos[96] = new photo(3672,666,'DSC_0860 copy.jpg',400,320,'Coral crab (Carpilius corallinus)','DSC_0860 copy_thumb.jpg',130, 104,0, 0,'A tasty creature which will grow up to 6 inches across if allowed!','','Graham Smith','');
photos[97] = new photo(3491,641,'Emily 1.4.tif.jpg',400,586,'','Emily 1_thumb.4.tif.jpg',130, 190,0, 0,'','','','');
photos[98] = new photo(3492,641,'Emily 1.5.tif.jpg',400,586,'','Emily 1_thumb.5.tif.jpg',130, 190,0, 0,'','','','');
photos[99] = new photo(3493,641,'Emily 1.7.tif.jpg',400,586,'','Emily 1_thumb.7.tif.jpg',130, 190,0, 0,'','','','');
photos[100] = new photo(3495,641,'Emily 1.9.tif.jpg',400,586,'','Emily 1_thumb.9.tif.jpg',130, 190,0, 0,'','','','');
photos[101] = new photo(3496,641,'Emily 1.tif1.jpg',400,586,'','Emily 1_thumb.tif1.jpg',130, 190,0, 0,'','','','');
photos[102] = new photo(3497,641,'Emily 2.0.tif1.jpg',400,586,'','Emily 2_thumb.0.tif1.jpg',130, 190,0, 0,'','','','');
photos[103] = new photo(3499,641,'Emily 2.1.tif1.jpg',400,560,'','Emily 2_thumb.1.tif1.jpg',130, 182,0, 0,'','','','');
photos[104] = new photo(3500,641,'Emily 2.2.tif.jpg',400,586,'','Emily 2_thumb.2.tif.jpg',130, 190,0, 0,'','','','');
photos[105] = new photo(3501,641,'Emily 2.5.tif.jpg',400,586,'','Emily 2_thumb.5.tif.jpg',130, 190,0, 0,'','','','');
photos[106] = new photo(3502,641,'Emily 3.tif.jpg',400,586,'','Emily 3_thumb.tif.jpg',130, 190,0, 0,'','','','');
photos[107] = new photo(3639,664,'DSC_0540 copy.jpg',400,320,'Look at this Dad!','DSC_0540 copy_thumb.jpg',130, 104,0, 0,'','','Graham Smith','');
photos[108] = new photo(3640,664,'DSC_0543.jpg',400,266,'How old?','DSC_0543_thumb.jpg',130, 86,0, 0,'One of my more unusual birthday greetings!','','Graham Smith','');
photos[109] = new photo(3641,664,'DSC_0547 copy.jpg',400,267,'There\'s no need to rub it in!','DSC_0547 copy_thumb.jpg',130, 87,0, 0,'Another unusual birthday greeting!','','Graham Smith','');
photos[110] = new photo(3646,664,'DSC_0613.jpg',400,266,'Wouldn\'t catch me doing this 60\' underwater!','DSC_0613_thumb.jpg',130, 86,0, 0,'Emily - PADI Instructor','','Graham Smith','');
photos[111] = new photo(3650,664,'DSC_0653 copy.jpg',400,320,'So relaxed in the environment','DSC_0653 copy_thumb.jpg',130, 104,0, 0,'Emily - PADI Instructor','','Graham Smith','');
photos[112] = new photo(3669,664,'DSC_0842 copy.jpg',400,320,'Is that my old Nikonos she\'s holding?','DSC_0842 copy_thumb.jpg',130, 104,0, 0,'Emily - PADI Instructor demonstrating the Underwater Photography specialty','','Graham Smith','');
galleries = new Array();galleries[0] = new gallery(644,'8577','Graham Smith Photographer');
galleries[1] = new gallery(1271,'8564','Reef scenes');
galleries[2] = new gallery(427,'3521,3522,3670,3671,3674,3675,3676,3677,3679,3680,3681,8560,8563,3682,3683,3684,3685,3686,3687,3688,3689,3690,8571,3691,3692,3693,3695,3696,3697,3698,3699,3700,3701,3702,3703,3523,3524,3525,3526,3527,3528,3466,3469,3529,3530,3531,3631,3632,3470,3633,3636,3638,3642,3643,3647,3648,3649,3651,3659,3660,3662,3663','Reef Fish');
galleries[3] = new gallery(647,'3665,3667,3465,3635,3644,3645,3652,3653,3655,3656,3657,3664','Tube Worms');
galleries[4] = new gallery(666,'3668,3672,3467,3634,3637,3661','Crabs, Lobsters, Anemones & other creatures');
galleries[5] = new gallery(641,'3491,3492,3493,3495,3496,3497,3499,3500,3501,3502','Emily - 2003');
galleries[6] = new gallery(664,'3669,3639,3640,3641,3646,3650','Emily - 2004');


