/***************************************************************************
* 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('2056139');
	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('2056139');
	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 && !((1) || (1))) {
		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 = 'Richard carter photography: ' + 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(2056164,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/desford-bird-garden-007-cop.jpg',450,300,'friendly parrot-007','http://admin2.clikpic.com/richcarter/images/desford-bird-garden-007-cop_thumb.jpg',130, 87,0, 0,'All the parrot photographs in this gallery were taken with the kind permission of Tropical bird land, desford, leicestershire','','','Desford, Leicestershire','','');
photos[1] = new photo(2056167,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/desford-bird-garden-017-cop.jpg',450,675,'red macaws-017','http://admin2.clikpic.com/richcarter/images/desford-bird-garden-017-cop_thumb.jpg',130, 195,0, 0,'All the parrot photographs in this gallery were taken with the kind permission of Tropical bird land, desford, leicestershire','','','Desford, Leicestershire','','');
photos[2] = new photo(2056169,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/desford-bird-garden-037-cop.jpg',450,300,'close-037','http://admin2.clikpic.com/richcarter/images/desford-bird-garden-037-cop_thumb.jpg',130, 87,0, 0,'All the parrot photographs in this gallery were taken with the kind permission of Tropical bird land, desford, leicestershire','','','Desford, Leicestershire','','');
photos[3] = new photo(2056171,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/desford-bird-garden-046-cop.jpg',450,300,'parrot-046','http://admin2.clikpic.com/richcarter/images/desford-bird-garden-046-cop_thumb.jpg',130, 87,0, 0,'All the parrot photographs in this gallery were taken with the kind permission of Tropical bird land, desford, leicestershire','','','Desford, Leicestershire','','');
photos[4] = new photo(2056173,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/desford-bird-garden-048-cop.jpg',450,675,'parrot-048','http://admin2.clikpic.com/richcarter/images/desford-bird-garden-048-cop_thumb.jpg',130, 195,0, 0,'All the parrot photographs in this gallery were taken with the kind permission of Tropical bird land, desford, leicestershire','','','Desford, Leicestershire','','');
photos[5] = new photo(2056175,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/desford-bird-garden-049-cop1.jpg',450,675,'hungry macaw-049','http://admin2.clikpic.com/richcarter/images/desford-bird-garden-049-cop1_thumb.jpg',130, 195,0, 0,'All the parrot photographs in this gallery were taken with the kind permission of Tropical bird land, desford, leicestershire','','','Desford, Leicestershire','','');
photos[6] = new photo(2056180,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/desford-bird-garden-062-cop.jpg',450,675,'parrot-062','http://admin2.clikpic.com/richcarter/images/desford-bird-garden-062-cop_thumb.jpg',130, 195,0, 0,'All the parrot photographs in this gallery were taken with the kind permission of Tropical bird land, desford, leicestershire','','','Desford, Leicestershire','','');
photos[7] = new photo(2056184,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/jayne-and-paige-23-copy1.jpg',450,357,'little terrier-03','http://admin2.clikpic.com/richcarter/images/jayne-and-paige-23-copy1_thumb.jpg',130, 103,0, 0,'','','','','','');
photos[8] = new photo(2056187,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/missy1-copy1.jpg',450,461,'nosey pup-1','http://admin2.clikpic.com/richcarter/images/missy1-copy1_thumb.jpg',130, 133,0, 0,'','','','','','');
photos[9] = new photo(2056188,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/missy-copy1.jpg',450,490,'tired pup-2','http://admin2.clikpic.com/richcarter/images/missy-copy1_thumb.jpg',130, 142,0, 0,'','','','','','');
photos[10] = new photo(2056190,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/pauls-dog-poppy-10-copy1.jpg',450,555,'spaniel-10','http://admin2.clikpic.com/richcarter/images/pauls-dog-poppy-10-copy1_thumb.jpg',130, 160,0, 0,'','','','','','');
photos[11] = new photo(2056193,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/pauls-dog-poppy-28-copy1.jpg',450,300,'chase-28','http://admin2.clikpic.com/richcarter/images/pauls-dog-poppy-28-copy1_thumb.jpg',130, 87,0, 0,'','','','animals,chase','','');
photos[12] = new photo(2056197,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/poppy-12-copy2.jpg',450,300,'spaniel pup-12','http://admin2.clikpic.com/richcarter/images/poppy-12-copy2_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[13] = new photo(2067685,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/duck-family16-copy1.jpg',450,300,'duck-family16','http://admin2.clikpic.com/richcarter/images/duck-family16-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[14] = new photo(2067686,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/duck-family43-copy1.jpg',450,300,'duck-family43','http://admin2.clikpic.com/richcarter/images/duck-family43-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[15] = new photo(2067687,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/duck-family46-copy1.jpg',450,300,'duck-family46','http://admin2.clikpic.com/richcarter/images/duck-family46-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[16] = new photo(2067688,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/duckling-17-copy1.jpg',450,300,'duckling-17','http://admin2.clikpic.com/richcarter/images/duckling-17-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[17] = new photo(2067689,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/duckling-18-copy1.jpg',450,300,'duckling-18','http://admin2.clikpic.com/richcarter/images/duckling-18-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[18] = new photo(2067690,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/duckling-41-copy1.jpg',450,300,'duckling-41','http://admin2.clikpic.com/richcarter/images/duckling-41-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[19] = new photo(2067691,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/heron-84-copy1.jpg',450,300,'heron-84','http://admin2.clikpic.com/richcarter/images/heron-84-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[20] = new photo(2067692,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/heron-85-copy1.jpg',450,300,'heron-85','http://admin2.clikpic.com/richcarter/images/heron-85-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[21] = new photo(2067693,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/heron-87-copy1.jpg',450,300,'heron-87','http://admin2.clikpic.com/richcarter/images/heron-87-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[22] = new photo(2067694,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/moorhen-24-copy1.jpg',450,300,'coot-24','http://admin2.clikpic.com/richcarter/images/moorhen-24-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[23] = new photo(2067695,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/swan-13-copy1.jpg',450,300,'swan-13','http://admin2.clikpic.com/richcarter/images/swan-13-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[24] = new photo(2067696,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/swan-67-copy1.jpg',450,300,'swan-67','http://admin2.clikpic.com/richcarter/images/swan-67-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[25] = new photo(2067697,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/swan-71-copy1.jpg',450,300,'swan-71','http://admin2.clikpic.com/richcarter/images/swan-71-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[26] = new photo(2067698,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/swan-72-copy1.jpg',450,300,'swan-72','http://admin2.clikpic.com/richcarter/images/swan-72-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[27] = new photo(2067699,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/swan-75-copy1.jpg',450,300,'swan-75','http://admin2.clikpic.com/richcarter/images/swan-75-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[28] = new photo(2067700,'136256','','gallery','http://admin2.clikpic.com/richcarter/images/swan-77-copy1.jpg',450,300,'swan-77','http://admin2.clikpic.com/richcarter/images/swan-77-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[29] = new photo(2056081,'136252','','gallery','http://admin2.clikpic.com/richcarter/images/DSCF0003-copy1.jpg',450,338,'dinghy-003','http://admin2.clikpic.com/richcarter/images/DSCF0003-copy1_thumb.jpg',130, 98,0, 0,'','','','Thornton reservoir, Leicestershire','','');
photos[30] = new photo(2056091,'136252','','gallery','http://admin2.clikpic.com/richcarter/images/DSCF0067-copy1.jpg',450,338,'stepping stone view','http://admin2.clikpic.com/richcarter/images/DSCF0067-copy1_thumb.jpg',130, 98,0, 0,'','','','Dovedale, Derbyshire','','');
photos[31] = new photo(2056095,'136252','','gallery','http://admin2.clikpic.com/richcarter/images/DSCF0084-copy1.jpg',450,338,'stepping stones','http://admin2.clikpic.com/richcarter/images/DSCF0084-copy1_thumb.jpg',130, 98,0, 0,'','','','Dovedale, Derbyshire','','');
photos[32] = new photo(2056139,'136252','','gallery','http://admin2.clikpic.com/richcarter/images/december-copy1.jpg',450,338,'sunrise','http://admin2.clikpic.com/richcarter/images/december-copy1_thumb.jpg',130, 98,1, 0,'','','','Burbage common,Leicestershire','','');
photos[33] = new photo(2056141,'136252','','gallery','http://admin2.clikpic.com/richcarter/images/DSCF0036-copy1.jpg',450,338,'sunset-036','http://admin2.clikpic.com/richcarter/images/DSCF0036-copy1_thumb.jpg',130, 98,0, 0,'','','','Rugby,Warwickshire','','');
photos[34] = new photo(2056148,'136252','','gallery','http://admin2.clikpic.com/richcarter/images/DSCF0041-copy1.jpg',450,338,'sunset-041','http://admin2.clikpic.com/richcarter/images/DSCF0041-copy1_thumb.jpg',130, 98,0, 0,'','','','Rugby,Warwickshire','','');
photos[35] = new photo(2056150,'136252','','gallery','http://admin2.clikpic.com/richcarter/images/DSCF0044-copy1.jpg',450,338,'sunset 2','http://admin2.clikpic.com/richcarter/images/DSCF0044-copy1_thumb.jpg',130, 98,0, 0,'','','','Rugby,Warwickshire','','');
photos[36] = new photo(2056153,'136252','','gallery','http://admin2.clikpic.com/richcarter/images/DSCF0049-copy1.jpg',450,338,'sunset 3','http://admin2.clikpic.com/richcarter/images/DSCF0049-copy1_thumb.jpg',130, 98,0, 0,'','','','Rugby,Warwickshire','','');
photos[37] = new photo(2056156,'136252','','gallery','http://admin2.clikpic.com/richcarter/images/DSCF0686-copy11.jpg',450,339,'misty sunrise','http://admin2.clikpic.com/richcarter/images/DSCF0686-copy11_thumb.jpg',130, 98,0, 0,'','','','Wibtoft,Leicestershire','','');
photos[38] = new photo(2056157,'136252','','gallery','http://admin2.clikpic.com/richcarter/images/DSCF0687-copy1.jpg',450,281,'misty','http://admin2.clikpic.com/richcarter/images/DSCF0687-copy1_thumb.jpg',130, 81,0, 0,'','','','Wibtoft,Leicestershire','','');
photos[39] = new photo(2056158,'136252','','gallery','http://admin2.clikpic.com/richcarter/images/DSCF0692-copy1.jpg',450,280,'light mist','http://admin2.clikpic.com/richcarter/images/DSCF0692-copy1_thumb.jpg',130, 81,0, 0,'','','','Wibtoft,Leicestershire','','');
photos[40] = new photo(2056161,'136252','','gallery','http://admin2.clikpic.com/richcarter/images/january-copy1.jpg',450,338,'first light','http://admin2.clikpic.com/richcarter/images/january-copy1_thumb.jpg',130, 98,0, 0,'','','','Burbage common,Leicestershire','','');
photos[41] = new photo(2056162,'136252','','gallery','http://admin2.clikpic.com/richcarter/images/september-copy1.jpg',450,338,'evening cloud','http://admin2.clikpic.com/richcarter/images/september-copy1_thumb.jpg',130, 98,0, 0,'','','','Burnham-on-sea, beech,Avon','','');
photos[42] = new photo(2098301,'139775','','gallery','http://admin2.clikpic.com/richcarter/images/jayne-and-paige-07-copy2.jpg',450,300,'portrait-007','http://admin2.clikpic.com/richcarter/images/jayne-and-paige-07-copy2_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[43] = new photo(2098306,'139775','','gallery','http://admin2.clikpic.com/richcarter/images/jayne-and-paige-11-copy2.jpg',450,300,'portrait-011','http://admin2.clikpic.com/richcarter/images/jayne-and-paige-11-copy2_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[44] = new photo(2098289,'139775','','gallery','http://admin2.clikpic.com/richcarter/images/jayne-and-paige-05-copy2.jpg',450,300,'portrait-005','http://admin2.clikpic.com/richcarter/images/jayne-and-paige-05-copy2_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[45] = new photo(2098281,'139775','','gallery','http://admin2.clikpic.com/richcarter/images/boys-portraits-16-copy2.jpg',450,500,'portraits-16','http://admin2.clikpic.com/richcarter/images/boys-portraits-16-copy2_thumb.jpg',130, 144,0, 0,'','','','','','');
photos[46] = new photo(2098282,'139775','','gallery','http://admin2.clikpic.com/richcarter/images/boys-portraits-17-copy2.jpg',450,337,'portraits-17','http://admin2.clikpic.com/richcarter/images/boys-portraits-17-copy2_thumb.jpg',130, 97,0, 0,'','','','','','');
photos[47] = new photo(2098250,'139775','','gallery','http://admin2.clikpic.com/richcarter/images/boys-portraits-15-copy2.jpg',450,432,'portraits-15','http://admin2.clikpic.com/richcarter/images/boys-portraits-15-copy2_thumb.jpg',130, 125,0, 0,'portraits','','','','','');
photos[48] = new photo(2098234,'139775','','gallery','http://admin2.clikpic.com/richcarter/images/boys-portraits-03-copy2.jpg',450,314,'portrait-003','http://admin2.clikpic.com/richcarter/images/boys-portraits-03-copy2_thumb.jpg',130, 91,0, 0,'','','','','','');
photos[49] = new photo(2098283,'139775','','gallery','http://admin2.clikpic.com/richcarter/images/boys-portraits-21-copy2.jpg',450,300,'portraits-21','http://admin2.clikpic.com/richcarter/images/boys-portraits-21-copy2_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[50] = new photo(2098239,'139775','','gallery','http://admin2.clikpic.com/richcarter/images/boys-portraits-10-copy2.jpg',450,300,'portrait-010','http://admin2.clikpic.com/richcarter/images/boys-portraits-10-copy2_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[51] = new photo(2056103,'136204','','gallery','http://admin2.clikpic.com/richcarter/images/still-life-01-copy1.jpg',450,675,'still life 1','http://admin2.clikpic.com/richcarter/images/still-life-01-copy1_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[52] = new photo(2056104,'136204','','gallery','http://admin2.clikpic.com/richcarter/images/still-life-02-copy1.jpg',450,675,'still life 2','http://admin2.clikpic.com/richcarter/images/still-life-02-copy1_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[53] = new photo(2056108,'136204','','gallery','http://admin2.clikpic.com/richcarter/images/still-life-04-copy1.jpg',450,675,'still life 3','http://admin2.clikpic.com/richcarter/images/still-life-04-copy1_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[54] = new photo(2056110,'136204','','gallery','http://admin2.clikpic.com/richcarter/images/still-life-05-copy1.jpg',450,300,'still life 4','http://admin2.clikpic.com/richcarter/images/still-life-05-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[55] = new photo(2056113,'136204','','gallery','http://admin2.clikpic.com/richcarter/images/still-life-07-copy1.jpg',450,675,'still life 5','http://admin2.clikpic.com/richcarter/images/still-life-07-copy1_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[56] = new photo(2056115,'136204','','gallery','http://admin2.clikpic.com/richcarter/images/still-life-25-copy1.jpg',450,675,'still life 6','http://admin2.clikpic.com/richcarter/images/still-life-25-copy1_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[57] = new photo(2056118,'136253','','gallery','http://admin2.clikpic.com/richcarter/images/DSCF0006-copy1.jpg',450,600,'big ben-006','http://admin2.clikpic.com/richcarter/images/DSCF0006-copy1_thumb.jpg',130, 173,0, 0,'','','','london','','');
photos[58] = new photo(2056119,'136253','','gallery','http://admin2.clikpic.com/richcarter/images/DSCF0016-copy1.jpg',450,338,'eye in the sky-016','http://admin2.clikpic.com/richcarter/images/DSCF0016-copy1_thumb.jpg',130, 98,0, 0,'','','','London','','');
photos[59] = new photo(2056122,'136253','','gallery','http://admin2.clikpic.com/richcarter/images/DSCF0060-copy1.jpg',450,649,'noon','http://admin2.clikpic.com/richcarter/images/DSCF0060-copy1_thumb.jpg',130, 187,0, 0,'','','','London','','');
photos[60] = new photo(2056124,'136253','','gallery','http://admin2.clikpic.com/richcarter/images/DSCF0078-copy1.jpg',450,338,'open bridge','http://admin2.clikpic.com/richcarter/images/DSCF0078-copy1_thumb.jpg',130, 98,0, 0,'','','','london','','');
photos[61] = new photo(2056125,'136253','','gallery','http://admin2.clikpic.com/richcarter/images/DSCF0079-copy1.jpg',450,338,'glass view','http://admin2.clikpic.com/richcarter/images/DSCF0079-copy1_thumb.jpg',130, 98,0, 0,'','','','London','','');
photos[62] = new photo(2056129,'136253','','gallery','http://admin2.clikpic.com/richcarter/images/midday-london-copy1.jpg',450,601,'mid day parliment','http://admin2.clikpic.com/richcarter/images/midday-london-copy1_thumb.jpg',130, 174,0, 0,'','','','london','','');
photos[63] = new photo(2056134,'136253','','gallery','http://admin2.clikpic.com/richcarter/images/DSCF0306-copy1-.jpg',450,338,'Attention','http://admin2.clikpic.com/richcarter/images/DSCF0306-copy1-_thumb.jpg',130, 98,0, 0,'','','','London','','');
photos[64] = new photo(2056208,'136888','','gallery','http://admin2.clikpic.com/richcarter/images/snow-15-copy1.jpg',450,300,'winters day','http://admin2.clikpic.com/richcarter/images/snow-15-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[65] = new photo(2064240,'136888','','gallery','http://admin2.clikpic.com/richcarter/images/snow-17-copy1.jpg',450,300,'snow-17','http://admin2.clikpic.com/richcarter/images/snow-17-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[66] = new photo(2064241,'136888','','gallery','http://admin2.clikpic.com/richcarter/images/snow-19-copy1.jpg',450,300,'snow-19','http://admin2.clikpic.com/richcarter/images/snow-19-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[67] = new photo(2064242,'136888','','gallery','http://admin2.clikpic.com/richcarter/images/snow-20-copy1.jpg',450,300,'snow-20','http://admin2.clikpic.com/richcarter/images/snow-20-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[68] = new photo(2064243,'136888','','gallery','http://admin2.clikpic.com/richcarter/images/snow-23-copy1.jpg',450,300,'snow-23','http://admin2.clikpic.com/richcarter/images/snow-23-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[69] = new photo(2064244,'136888','','gallery','http://admin2.clikpic.com/richcarter/images/snow-26-copy1.jpg',450,300,'snow-26','http://admin2.clikpic.com/richcarter/images/snow-26-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[70] = new photo(2064245,'136888','','gallery','http://admin2.clikpic.com/richcarter/images/snow-28-copy1.jpg',450,675,'snow-28','http://admin2.clikpic.com/richcarter/images/snow-28-copy1_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[71] = new photo(2064246,'136888','','gallery','http://admin2.clikpic.com/richcarter/images/snow-39-copy1.jpg',450,300,'snow-39','http://admin2.clikpic.com/richcarter/images/snow-39-copy1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[72] = new photo(2143161,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-007.jpg',450,675,'wedding-007','http://admin2.clikpic.com/richcarter/images/wedding-007_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[73] = new photo(2143162,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-009.jpg',450,675,'wedding-009','http://admin2.clikpic.com/richcarter/images/wedding-009_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[74] = new photo(2143163,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-011.jpg',450,675,'wedding-011','http://admin2.clikpic.com/richcarter/images/wedding-011_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[75] = new photo(2143164,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-012.jpg',450,675,'wedding-012','http://admin2.clikpic.com/richcarter/images/wedding-012_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[76] = new photo(2143165,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-015.jpg',450,675,'wedding-015','http://admin2.clikpic.com/richcarter/images/wedding-015_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[77] = new photo(2143166,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-016.jpg',450,675,'wedding-016','http://admin2.clikpic.com/richcarter/images/wedding-016_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[78] = new photo(2143167,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-027.jpg',450,675,'wedding-027','http://admin2.clikpic.com/richcarter/images/wedding-027_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[79] = new photo(2143168,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-031.jpg',450,300,'wedding-031','http://admin2.clikpic.com/richcarter/images/wedding-031_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[80] = new photo(2143169,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-034.jpg',450,788,'wedding-034','http://admin2.clikpic.com/richcarter/images/wedding-034_thumb.jpg',130, 228,0, 0,'','','','','','');
photos[81] = new photo(2143170,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-036.jpg',450,756,'wedding-036','http://admin2.clikpic.com/richcarter/images/wedding-036_thumb.jpg',130, 218,0, 0,'','','','','','');
photos[82] = new photo(2143171,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-038.jpg',450,675,'wedding-038','http://admin2.clikpic.com/richcarter/images/wedding-038_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[83] = new photo(2143172,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-041.jpg',450,675,'wedding-041','http://admin2.clikpic.com/richcarter/images/wedding-041_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[84] = new photo(2143173,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-048.jpg',450,675,'wedding-048','http://admin2.clikpic.com/richcarter/images/wedding-048_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[85] = new photo(2143174,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-050.jpg',450,300,'wedding-050','http://admin2.clikpic.com/richcarter/images/wedding-050_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[86] = new photo(2143175,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-054.jpg',450,325,'wedding-054','http://admin2.clikpic.com/richcarter/images/wedding-054_thumb.jpg',130, 94,0, 0,'','','','','','');
photos[87] = new photo(2143187,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-2349.jpg',450,675,'wedding-2349','http://admin2.clikpic.com/richcarter/images/wedding-2349_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[88] = new photo(2143176,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-055.jpg',450,300,'wedding-055','http://admin2.clikpic.com/richcarter/images/wedding-055_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[89] = new photo(2143177,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-056.jpg',450,675,'wedding-056','http://admin2.clikpic.com/richcarter/images/wedding-056_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[90] = new photo(2143178,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-058.jpg',450,675,'wedding-058','http://admin2.clikpic.com/richcarter/images/wedding-058_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[91] = new photo(2143179,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-063.jpg',450,300,'wedding-063','http://admin2.clikpic.com/richcarter/images/wedding-063_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[92] = new photo(2143180,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-071.jpg',450,300,'wedding-071','http://admin2.clikpic.com/richcarter/images/wedding-071_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[93] = new photo(2143181,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-074.jpg',450,300,'wedding-074','http://admin2.clikpic.com/richcarter/images/wedding-074_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[94] = new photo(2143182,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-075.jpg',450,300,'wedding-075','http://admin2.clikpic.com/richcarter/images/wedding-075_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[95] = new photo(2143186,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-2312.jpg',450,675,'wedding-2312','http://admin2.clikpic.com/richcarter/images/wedding-2312_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[96] = new photo(2143183,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-093.jpg',450,300,'wedding-093','http://admin2.clikpic.com/richcarter/images/wedding-093_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[97] = new photo(2143184,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-110.jpg',450,401,'wedding-110','http://admin2.clikpic.com/richcarter/images/wedding-110_thumb.jpg',130, 116,0, 0,'','','','','','');
photos[98] = new photo(2143185,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-116.jpg',450,675,'wedding-116','http://admin2.clikpic.com/richcarter/images/wedding-116_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[99] = new photo(2143188,'142283','','gallery','http://admin2.clikpic.com/richcarter/images/wedding-2365.jpg',450,675,'wedding-2365','http://admin2.clikpic.com/richcarter/images/wedding-2365_thumb.jpg',130, 195,0, 1,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(136256,'2067700,2067699,2067698,2067697,2067696,2067695,2067694,2067693,2067692,2067691','animals and birds','gallery');
galleries[1] = new gallery(136252,'2056162,2056161,2056158,2056157,2056156,2056153,2056150,2056148,2056141,2056139','landscapes','gallery');
galleries[2] = new gallery(139775,'2098306,2098301,2098289,2098283,2098282,2098281,2098250,2098239,2098234','Portraits','gallery');
galleries[3] = new gallery(136204,'2056115,2056113,2056110,2056108,2056104,2056103','flowers','gallery');
galleries[4] = new gallery(136253,'2056134,2056129,2056125,2056124,2056122,2056119,2056118','london','gallery');
galleries[5] = new gallery(136888,'2064246,2064245,2064244,2064243,2064242,2064241,2064240,2056208','snow scenes','gallery');
galleries[6] = new gallery(142283,'2143188','weddings','gallery');

