/***************************************************************************
* Create a photo object                                                    *
***************************************************************************/
function photo(id, galleries_id, photo_ref, section_code, src, width, height, caption, thumbnail, thumbnail_width, thumbnail_height, home, gallery, description, takendate, photographer, location, item_price, purchase_instruction) {
	this.id = id;
	this.galleries_id = galleries_id;
	this.photo_ref = photo_ref;
	this.section_code = section_code;
	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;
	this.item_price = item_price;
	this.purchase_instruction = purchase_instruction;
}
/***************************************************************************
* Create a gallery object                                                  *
***************************************************************************/

function gallery(id,featured_images,title,section_code) {
	this.id = id;
	this.featured_images = featured_images;
	this.title = title;
	this.section_code = section_code;}

/***************************************************************************
* Select a random value from a comma separated list                        *
***************************************************************************/
function randomListVal(list) {
	arrayVals = list.split(',');
	pos = Math.round(Math.random() * (arrayVals.length - 1));
	debug('Returning ' + arrayVals[pos] + ' as random image');
	return arrayVals[pos];
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {

	imageID = randomListVal('3593896,3593557,3527494,3527459,3527457,3527456,3527455,3527452,3527450,3527448,3527446,3527444,3527442,3527440,3527437,3527435,3527433,3527395,3527385,3521286,3513748,3513745,3512539,3512421,3512371,3512367,3512328,3512300,3512289,3512281,3512272,3512229,3512218,3512182,3512150');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if (!basic) {
			img.src = 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 = photos[j].src;
				document.images[img.name] = newImage;
				debug(newImage.src);
			}
			break;
		}
	}
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline() {
	
	imageID = randomListVal('3593896,3593557,3527494,3527459,3527457,3527456,3527455,3527452,3527450,3527448,3527446,3527444,3527442,3527440,3527437,3527435,3527433,3527395,3527385,3521286,3513748,3513745,3512539,3512421,3512371,3512367,3512328,3512300,3512289,3512281,3512272,3512229,3512218,3512182,3512150');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if ('gallery' != '') {
						if (photos[j].galleries_id != '') {
						document.write('<a href="' + photos[j].section_code + '_' + photos[j].galleries_id + '.html">');
						}
						else {
						document.write('<a href="gallery.html">');
						}
			}
			document.write('<img src="' + photos[j].src + '" width="' + photos[j].width + '" height="' + photos[j].height + '" class="mainhomepageimage" id="mainSample" name="mainSample" alt="' + photos[j].caption  + '" border="0">');
			if ('gallery' != '') {
				document.write('</a>');
			}
			break;
		}
	}
	
}

/***************************************************************************
* Show the next image in a gallery.  field = hidden field containing       *
* image_id                                                                 *
*  img = reference to image object in which to show image                  *
***************************************************************************/
function next(field,img) {

	debug('IN next');
	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);
	}


}


/***************************************************************************
* Set a new image on the gallery detail page given its array position      *
***************************************************************************/
function updateImage (nextImg, field,img) {
	debug('Updating image');
	if (!basic && !((0) || (0))) {
		debug('In updateImage');
		debug('setting  img src = ' + photos[nextImg].src);
		
					
			document.getElementById('imagePhoto').innerHTML = '<img class="mainphoto" src="' + photos[nextImg].src + ' " id="mainPic" name="mainPic" width="' + photos[nextImg].width + '" height="' + photos[nextImg].height + '" alt="' + photos[nextImg].caption + '">';
						field.value = photos[nextImg].id;
			document.getElementById('imageTitle').innerHTML = photos[nextImg].caption;
									document.title = 'ABELLPHOTOGRAPHY: ' + photos[nextImg].caption;
										/* apply 'blank' classname to element where */			if ( photos[nextImg].caption == '') {
				document.getElementById('imageTitle').style.className = 'blank';
			}
			else {
				document.getElementById('imageTitle').style.className = 'normal';
			}
						temp = '';
			if (photos[nextImg].description != '') {
				temp = temp +  '<p id="imageDescription">' + photos[nextImg].description + '</p>';
			}
						if (photos[nextImg].photo_ref != '') {
				temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + photos[nextImg].photo_ref + '</p>';
			}
						if (photos[nextImg].takendate != '') {
				debug('Resetting taken date');
				temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + photos[nextImg].takendate + '</p>';
			}
			
			if (photos[nextImg].location != '') {
				debug('Resetting location');
				temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  photos[nextImg].location + '</p>';
			}
			
			if (photos[nextImg].photographer != '') {
				debug('Resetting photographer');
				temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + photos[nextImg].photographer + '</p>';
			}
			if (temp != '') {				temp = temp + '<div class="spacer"></div>';			}					if (temp == '') {
			document.getElementById('imageDetails').style.display = 'none';
		}
		else {
			document.getElementById('imageDetails').style.display = 'block';
		}
		document.getElementById('imageDetails').innerHTML =temp;	
		
	}
	else {
		debug('Redirecting to id ' + photos[nextImg].id);
		window.location = 'photo_' + photos[nextImg].id + '.html';
	}
}

/***************************************************************************
* Show the previous image for a gallery. field = hidden field containing   *
* image_id                                                                 *
*  img = reference to image object in which to show image                  *
***************************************************************************/
function previous(field,img) {


	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);	
	}
}

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.
        *
* Gallery_id = id of gallery to choose                                     *
* 
 img = reference to html image                                       *
* in which to show image                                                   *
***************************************************************************/
function showGalleryImage(gallery_id, img) {
	debug('Gallery = ' + gallery_id);
	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 = 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;
	}
}
/***************************************************************************
* Create the array of Photo objects                                        *
***************************************************************************/
photos = new Array();
photos[0] = new photo(3512150,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Bembridge_Wingmill.jpg',600,400,'Bembridge Windmill','http://www3.clikpic.com/allanbell/images/Bembridge_Wingmill_thumb.jpg',130, 87,1, 0,'Last windmill on Isle of Wight','','','','','');
photos[1] = new photo(3512155,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Bembridge_Coast_Seawall.jpg',600,400,'Coast Seawall','http://www3.clikpic.com/allanbell/images/Bembridge_Coast_Seawall_thumb.jpg',130, 87,0, 0,'Bembridge, Isle of Wight','','','','','');
photos[2] = new photo(3512182,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Bembridge_coast_Clouds.jpg',600,394,'Clouds','http://www3.clikpic.com/allanbell/images/Bembridge_coast_Clouds_thumb.jpg',130, 85,1, 0,'Isle of Wight coast','','','','','');
photos[3] = new photo(3512205,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Beach_enclave.jpg',600,400,'Beach enclave','http://www3.clikpic.com/allanbell/images/Beach_enclave_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[4] = new photo(3512209,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Lifeboat_pier_Bembridge.jpg',600,392,'Lifeboat pier Bembridge','http://www3.clikpic.com/allanbell/images/Lifeboat_pier_Bembridge_thumb.jpg',130, 85,0, 0,'Isle of Wight','','','','','');
photos[5] = new photo(3512218,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Horningsea.jpg',600,400,'Horningsea','http://www3.clikpic.com/allanbell/images/Horningsea_thumb.jpg',130, 87,1, 1,'Winter view across fields to Horningsea','','','Cambridge, England','','');
photos[6] = new photo(3512224,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Icetrack.jpg',600,400,'Frozen lake','http://www3.clikpic.com/allanbell/images/Icetrack_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[7] = new photo(3512229,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Path_to_bridge.jpg',400,600,'Path to bridge','http://www3.clikpic.com/allanbell/images/Path_to_bridge_thumb.jpg',87, 130,1, 0,'','','','','','');
photos[8] = new photo(3512234,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Footbridge.jpg',400,600,'Footbridge','http://www3.clikpic.com/allanbell/images/Footbridge_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[9] = new photo(3512243,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Overgrown_gate.jpg',400,600,'Overgrown gate','http://www3.clikpic.com/allanbell/images/Overgrown_gate_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[10] = new photo(3512248,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Petal_carpet.jpg',600,400,'Petal carpet','http://www3.clikpic.com/allanbell/images/Petal_carpet_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[11] = new photo(3512254,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Wier.jpg',600,400,'Wier','http://www3.clikpic.com/allanbell/images/Wier_thumb.jpg',130, 87,0, 0,'Wier at Baits Bite Lock','','','Cambridge','','');
photos[12] = new photo(3527440,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Autumn-Treescape.jpg',600,400,'Autumn treescape','http://www3.clikpic.com/allanbell/images/Autumn-Treescape_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[13] = new photo(3527442,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Beach-silhouette.jpg',600,353,'Beach silhouette','http://www3.clikpic.com/allanbell/images/Beach-silhouette_thumb.jpg',130, 76,1, 0,'','','','','','');
photos[14] = new photo(3527444,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Shore.jpg',600,400,'Shore','http://www3.clikpic.com/allanbell/images/Shore_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[15] = new photo(3527446,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Thoresby-Park.jpg',600,450,'Thoresby Park','http://www3.clikpic.com/allanbell/images/Thoresby-Park_thumb.jpg',130, 98,1, 0,'','','','','','');
photos[16] = new photo(3527448,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Yarmouth-Regatta-Isle-Of-Wi.jpg',600,431,'Yarmouth-Regatta-Isle-Of-Wight','http://www3.clikpic.com/allanbell/images/Yarmouth-Regatta-Isle-Of-Wi_thumb.jpg',130, 93,1, 0,'','','','','','');
photos[17] = new photo(3593557,'214329','','gallery','http://www3.clikpic.com/allanbell/images/Cycle-footbridge-Milton1.jpg',400,600,'Cycle and footbridge, Milton','http://www3.clikpic.com/allanbell/images/Cycle-footbridge-Milton1_thumb.jpg',87, 130,1, 0,'','','','Milton Cambridge','','');
photos[18] = new photo(3512272,'214330','','gallery','http://www3.clikpic.com/allanbell/images/All_Saints_Church_Godshill.jpg',600,400,'All Saints Church Godshill','http://www3.clikpic.com/allanbell/images/All_Saints_Church_Godshill_thumb.jpg',130, 87,1, 0,'','','','Isle of Wight','','');
photos[19] = new photo(3512275,'214330','','gallery','http://www3.clikpic.com/allanbell/images/Bembridge_windmill.jpg',400,600,'Bembridge windmill','http://www3.clikpic.com/allanbell/images/Bembridge_windmill_thumb.jpg',87, 130,0, 0,'Last windmill on Isle of Wight','','','Isle of Wight','','');
photos[20] = new photo(3512281,'214330','','gallery','http://www3.clikpic.com/allanbell/images/Shanklin_Old_Town.jpg',600,400,'Shanklin Old Town','http://www3.clikpic.com/allanbell/images/Shanklin_Old_Town_thumb.jpg',130, 87,1, 0,'','','','Isle of Wight','','');
photos[21] = new photo(3512282,'214330','','gallery','http://www3.clikpic.com/allanbell/images/Cottage_roof.jpg',600,400,'Cottage roof','http://www3.clikpic.com/allanbell/images/Cottage_roof_thumb.jpg',130, 87,0, 0,'','','','Cambridge','','');
photos[22] = new photo(3512285,'214330','','gallery','http://www3.clikpic.com/allanbell/images/Window.jpg',359,600,'Window','http://www3.clikpic.com/allanbell/images/Window_thumb.jpg',78, 130,0, 0,'','','','','','');
photos[23] = new photo(3527395,'214330','','gallery','http://www3.clikpic.com/allanbell/images/Fountains-Abbey.jpg',600,385,'Fountains Abbey','http://www3.clikpic.com/allanbell/images/Fountains-Abbey_thumb.jpg',130, 83,1, 0,'','','','','','');
photos[24] = new photo(3527433,'214330','','gallery','http://www3.clikpic.com/allanbell/images/Fountains-Abbey-2.jpg',600,400,'Fountains Abbey','http://www3.clikpic.com/allanbell/images/Fountains-Abbey-2_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[25] = new photo(3527435,'214330','','gallery','http://www3.clikpic.com/allanbell/images/Greenhouse.jpg',450,600,'Greenhouse','http://www3.clikpic.com/allanbell/images/Greenhouse_thumb.jpg',98, 130,1, 0,'','','','','','');
photos[26] = new photo(3527437,'214330','','gallery','http://www3.clikpic.com/allanbell/images/Wisborough-Green-Church.jpg',600,450,'Wisborough-Green-Church','http://www3.clikpic.com/allanbell/images/Wisborough-Green-Church_thumb.jpg',130, 98,1, 0,'','','','','','');
photos[27] = new photo(3512287,'214784','','gallery','http://www3.clikpic.com/allanbell/images/Frosty_Choycia.jpg',400,600,'Frosty Choycia','http://www3.clikpic.com/allanbell/images/Frosty_Choycia_thumb.jpg',87, 130,0, 0,'Choycia in winter','','','','','');
photos[28] = new photo(3512288,'214784','','gallery','http://www3.clikpic.com/allanbell/images/Fungus.jpg',600,400,'Fungus','http://www3.clikpic.com/allanbell/images/Fungus_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[29] = new photo(3512289,'214784','','gallery','http://www3.clikpic.com/allanbell/images/Sunflower.jpg',600,400,'Sunflower','http://www3.clikpic.com/allanbell/images/Sunflower_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[30] = new photo(3572840,'214784','','gallery','http://www3.clikpic.com/allanbell/images/Daffodil_Narcissus.jpg',400,600,'Daffodil Narcissus','http://www3.clikpic.com/allanbell/images/Daffodil_Narcissus_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[31] = new photo(3593566,'214784','','gallery','http://www3.clikpic.com/allanbell/images/IMG_6599.jpg',400,600,'Oak leaf','http://www3.clikpic.com/allanbell/images/IMG_6599_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[32] = new photo(3512364,'214785','','gallery','http://www3.clikpic.com/allanbell/images/Dragonfly.jpg',400,600,'Dragonfly','http://www3.clikpic.com/allanbell/images/Dragonfly_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[33] = new photo(3512367,'214785','','gallery','http://www3.clikpic.com/allanbell/images/Magpie.jpg',600,400,'Magpie','http://www3.clikpic.com/allanbell/images/Magpie_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[34] = new photo(3512368,'214785','','gallery','http://www3.clikpic.com/allanbell/images/Robin_on_song.jpg',600,400,'Robin on song','http://www3.clikpic.com/allanbell/images/Robin_on_song_thumb.jpg',130, 87,0, 0,'Robin singing in tree','','','','','');
photos[35] = new photo(3521286,'214785','','gallery','http://www3.clikpic.com/allanbell/images/Mute swan.jpg',400,600,'Mute swan','http://www3.clikpic.com/allanbell/images/Mute swan_thumb.jpg',87, 130,1, 0,'','','','','','');
photos[36] = new photo(3527385,'214785','','gallery','http://www3.clikpic.com/allanbell/images/Kestrel.jpg',600,400,'Kestrel hovering','http://www3.clikpic.com/allanbell/images/Kestrel_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[37] = new photo(3593570,'214785','','gallery','http://www3.clikpic.com/allanbell/images/IMG_0323.jpg',600,400,'Goose','http://www3.clikpic.com/allanbell/images/IMG_0323_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[38] = new photo(3512371,'214786','','gallery','http://www3.clikpic.com/allanbell/images/Live_Steam.jpg',600,400,'Live Steam','http://www3.clikpic.com/allanbell/images/Live_Steam_thumb.jpg',130, 87,1, 0,'Only steam railway on Isle of Wight','','','','','');
photos[39] = new photo(3512372,'214786','','gallery','http://www3.clikpic.com/allanbell/images/Saddle_tank_engine.jpg',600,400,'Saddle tank engine (Red)','http://www3.clikpic.com/allanbell/images/Saddle_tank_engine_thumb.jpg',130, 87,0, 0,'Isle of Wight steam railway','','','','','');
photos[40] = new photo(3512375,'214786','','gallery','http://www3.clikpic.com/allanbell/images/Saddle_tank_engine_green.jpg',400,600,'Saddle tank engine (green)','http://www3.clikpic.com/allanbell/images/Saddle_tank_engine_green_thumb.jpg',87, 130,0, 0,'Isle of Wight steam railway','','','','','');
photos[41] = new photo(3512376,'214786','','gallery','http://www3.clikpic.com/allanbell/images/Signal_box.jpg',600,400,'Signal box','http://www3.clikpic.com/allanbell/images/Signal_box_thumb.jpg',130, 87,0, 0,'Isle of Wight steam railway','','','','','');
photos[42] = new photo(3512421,'214786','','gallery','http://www3.clikpic.com/allanbell/images/Pannier_tank_engine.jpg',600,400,'Pannier tank engine','http://www3.clikpic.com/allanbell/images/Pannier_tank_engine_thumb.jpg',130, 87,1, 0,'South Devon steam railway','','','','','');
photos[43] = new photo(3512424,'214786','','gallery','http://www3.clikpic.com/allanbell/images/Workmans_hut.jpg',600,400,'Workmans hut','http://www3.clikpic.com/allanbell/images/Workmans_hut_thumb.jpg',130, 87,0, 0,'South Devon steam railway','','','','','');
photos[44] = new photo(3527452,'214786','','gallery','http://www3.clikpic.com/allanbell/images/Engine-driver-South-Devon-R.jpg',400,600,'Engine-driver-South-Devon-Railway','http://www3.clikpic.com/allanbell/images/Engine-driver-South-Devon-R_thumb.jpg',87, 130,1, 0,'','','','','','');
photos[45] = new photo(3527455,'214786','','gallery','http://www3.clikpic.com/allanbell/images/Trams.jpg',400,600,'Trams','http://www3.clikpic.com/allanbell/images/Trams_thumb.jpg',87, 130,1, 0,'','','','','','');
photos[46] = new photo(3527456,'214786','','gallery','http://www3.clikpic.com/allanbell/images/Trolley-Bus.jpg',600,400,'Trolley Bus','http://www3.clikpic.com/allanbell/images/Trolley-Bus_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[47] = new photo(3527457,'214786','','gallery','http://www3.clikpic.com/allanbell/images/Trolley-Bus-2.jpg',400,600,'Trolley Bus','http://www3.clikpic.com/allanbell/images/Trolley-Bus-2_thumb.jpg',87, 130,1, 0,'','','','','','');
photos[48] = new photo(3527459,'214786','','gallery','http://www3.clikpic.com/allanbell/images/Water-stop.jpg',400,600,'Water stop Isle of Wight Railway','http://www3.clikpic.com/allanbell/images/Water-stop_thumb.jpg',87, 130,1, 0,'','','','','','');
photos[49] = new photo(3512308,'214789','','gallery','http://www3.clikpic.com/allanbell/images/Coloured_board_Blue.jpg',600,400,'Coloured board (Blue)','http://www3.clikpic.com/allanbell/images/Coloured_board_Blue_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[50] = new photo(3512328,'214789','','gallery','http://www3.clikpic.com/allanbell/images/Coloured_board_Red.jpg',600,400,'Coloured board (Red)','http://www3.clikpic.com/allanbell/images/Coloured_board_Red_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[51] = new photo(3512339,'214789','','gallery','http://www3.clikpic.com/allanbell/images/Copy-of-Ice-patern.jpg',600,400,'Ice patern','http://www3.clikpic.com/allanbell/images/Copy-of-Ice-patern_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[52] = new photo(3512354,'214789','','gallery','http://www3.clikpic.com/allanbell/images/Gravel.jpg',400,600,'Gravel','http://www3.clikpic.com/allanbell/images/Gravel_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[53] = new photo(3512539,'214791','','gallery','http://www3.clikpic.com/allanbell/images/no-2-hawkette.jpg',450,600,'Kodak no 2 Hawkette','http://www3.clikpic.com/allanbell/images/no-2-hawkette_thumb.jpg',98, 130,1, 0,'','','','','','');
photos[54] = new photo(3512542,'214791','','gallery','http://www3.clikpic.com/allanbell/images/coronet-cub.jpg',600,450,'Coronet Cub','http://www3.clikpic.com/allanbell/images/coronet-cub_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[55] = new photo(3512546,'214791','','gallery','http://www3.clikpic.com/allanbell/images/ensign-box.jpg',511,600,'Ensign box camera','http://www3.clikpic.com/allanbell/images/ensign-box_thumb.jpg',111, 130,0, 0,'by Houghton','','','','','');
photos[56] = new photo(3513745,'214791','','gallery','http://www3.clikpic.com/allanbell/images/brownie-flash-IV.jpg',508,600,'Brownie Flash IV','http://www3.clikpic.com/allanbell/images/brownie-flash-IV_thumb.jpg',110, 130,1, 0,'','','','','','');
photos[57] = new photo(3513748,'214791','','gallery','http://www3.clikpic.com/allanbell/images/purma-special.jpg',600,388,'Purma Special','http://www3.clikpic.com/allanbell/images/purma-special_thumb.jpg',130, 84,1, 0,'','','','','','');
photos[58] = new photo(3527494,'214791','','gallery','http://www3.clikpic.com/allanbell/images/Sanderson.jpg',600,400,'Sanderson','http://www3.clikpic.com/allanbell/images/Sanderson_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[59] = new photo(3593896,'214791','','gallery','http://www3.clikpic.com/allanbell/images/Ilford_Advocate.jpg',600,388,'Ilford Advocate','http://www3.clikpic.com/allanbell/images/Ilford_Advocate_thumb.jpg',130, 84,1, 0,'','','','','','');
photos[60] = new photo(3593915,'214791','','gallery','http://www3.clikpic.com/allanbell/images/Iloca_stereo.jpg',600,315,'Iloca stereo','http://www3.clikpic.com/allanbell/images/Iloca_stereo_thumb.jpg',130, 68,0, 0,'Iloca stereo camera','','','','','');
photos[61] = new photo(3593924,'214791','','gallery','http://www3.clikpic.com/allanbell/images/Rolleicord.jpg',444,600,'Rolleicord twin lens reflex','http://www3.clikpic.com/allanbell/images/Rolleicord_thumb.jpg',96, 130,0, 0,'','','','','','');
photos[62] = new photo(3593929,'214791','','gallery','http://www3.clikpic.com/allanbell/images/shew.jpg',600,467,'Shew','http://www3.clikpic.com/allanbell/images/shew_thumb.jpg',130, 101,0, 0,'','','','','','');
photos[63] = new photo(3512293,'214790','','gallery','http://www3.clikpic.com/allanbell/images/Danger_snowball.jpg',600,400,'Danger snowball','http://www3.clikpic.com/allanbell/images/Danger_snowball_thumb.jpg',130, 87,0, 0,'Aftermath of heavy snowfall','','','','','');
photos[64] = new photo(3512297,'214790','','gallery','http://www3.clikpic.com/allanbell/images/Telephone_pole.jpg',600,400,'Telephone pole','http://www3.clikpic.com/allanbell/images/Telephone_pole_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[65] = new photo(3512300,'214790','','gallery','http://www3.clikpic.com/allanbell/images/Twin_bears.jpg',600,400,'Twin bears','http://www3.clikpic.com/allanbell/images/Twin_bears_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[66] = new photo(3527450,'214790','','gallery','http://www3.clikpic.com/allanbell/images/Gaffers day Yarmouth Isle of Wight.jpg',600,450,'Gaffers day Yarmouth Isle of Wight','http://www3.clikpic.com/allanbell/images/Gaffers day Yarmouth Isle of Wight_thumb.jpg',130, 98,1, 0,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(214329,'3512218','Landscapes','gallery');
galleries[1] = new gallery(214330,'3527437,3527435,3527433,3527395,3512285,3512282,3512281,3512275,3512272','Buildings','gallery');
galleries[2] = new gallery(214784,'3593566,3572840,3512289,3512288,3512287','Flora','gallery');
galleries[3] = new gallery(214785,'3593570,3527385,3521286,3512368,3512367,3512364','Wildlife','gallery');
galleries[4] = new gallery(214786,'3527459,3527457,3527456,3527455,3527452,3512424,3512421,3512376,3512375,3512372','Transport','gallery');
galleries[5] = new gallery(214789,'3512354,3512339,3512328,3512308','Abstract','gallery');
galleries[6] = new gallery(214791,'3593929,3593924,3593915,3593896,3527494,3513748,3513745,3512546,3512542,3512539','Old Cameras','gallery');
galleries[7] = new gallery(214790,'3527450,3512300,3512297,3512293','General','gallery');

