/***************************************************************************
* 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('1744596');
	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('1744596');
	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)) {
		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 + '" border="0">';
						field.value = photos[nextImg].id;
			document.getElementById('imageTitle').innerHTML = 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(1752338,'117733','','gallery','http://www1.clikpic.com/robinmayes/images/A&C1.jpg',343,500,'','http://www1.clikpic.com/robinmayes/images/A&C1_thumb.jpg',89, 130,0, 0,'','','','','','');
photos[1] = new photo(1752343,'117733','','gallery','http://www1.clikpic.com/robinmayes/images/A&C3.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/A&C3_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[2] = new photo(1752346,'117733','','gallery','http://www1.clikpic.com/robinmayes/images/A&C4.jpg',390,500,'','http://www1.clikpic.com/robinmayes/images/A&C4_thumb.jpg',101, 130,0, 0,'','','','','','');
photos[3] = new photo(1752347,'117733','','gallery','http://www1.clikpic.com/robinmayes/images/A&C5.jpg',500,380,'','http://www1.clikpic.com/robinmayes/images/A&C5_thumb.jpg',130, 99,0, 0,'','','','','','');
photos[4] = new photo(1752348,'117733','','gallery','http://www1.clikpic.com/robinmayes/images/A&C6.jpg',500,360,'','http://www1.clikpic.com/robinmayes/images/A&C6_thumb.jpg',130, 94,0, 0,'','','','','','');
photos[5] = new photo(1752349,'117733','','gallery','http://www1.clikpic.com/robinmayes/images/A&C8.jpg',342,500,'','http://www1.clikpic.com/robinmayes/images/A&C8_thumb.jpg',89, 130,0, 0,'','','','','','');
photos[6] = new photo(1752350,'117733','','gallery','http://www1.clikpic.com/robinmayes/images/A&C9.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/A&C9_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[7] = new photo(1752351,'117733','','gallery','http://www1.clikpic.com/robinmayes/images/A&C12.jpg',500,336,'','http://www1.clikpic.com/robinmayes/images/A&C12_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[8] = new photo(1752352,'117733','','gallery','http://www1.clikpic.com/robinmayes/images/A&C14.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/A&C14_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[9] = new photo(1752353,'117733','','gallery','http://www1.clikpic.com/robinmayes/images/A&C15.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/A&C15_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[10] = new photo(1752354,'117733','','gallery','http://www1.clikpic.com/robinmayes/images/A&C17.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/A&C17_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[11] = new photo(1752355,'117733','','gallery','http://www1.clikpic.com/robinmayes/images/A&C18.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/A&C18_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[12] = new photo(1752357,'117733','','gallery','http://www1.clikpic.com/robinmayes/images/A&C20.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/A&C20_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[13] = new photo(1752358,'117733','','gallery','http://www1.clikpic.com/robinmayes/images/A&C21.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/A&C21_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[14] = new photo(1752359,'117733','','gallery','http://www1.clikpic.com/robinmayes/images/A&C25.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/A&C25_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[15] = new photo(1753574,'117821','','gallery','http://www1.clikpic.com/robinmayes/images/AR1.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/AR1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[16] = new photo(1753583,'117821','','gallery','http://www1.clikpic.com/robinmayes/images/AR3.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/AR3_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[17] = new photo(1753631,'117821','','gallery','http://www1.clikpic.com/robinmayes/images/AR8.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/AR8_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[18] = new photo(1753632,'117821','','gallery','http://www1.clikpic.com/robinmayes/images/AR6.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/AR6_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[19] = new photo(1753637,'117821','','gallery','http://www1.clikpic.com/robinmayes/images/AR10.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/AR10_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[20] = new photo(1753643,'117821','','gallery','http://www1.clikpic.com/robinmayes/images/AR14.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/AR14_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[21] = new photo(1753648,'117821','','gallery','http://www1.clikpic.com/robinmayes/images/AR13.jpg',395,500,'','http://www1.clikpic.com/robinmayes/images/AR13_thumb.jpg',103, 130,0, 0,'','','','','','');
photos[22] = new photo(1753656,'117821','','gallery','http://www1.clikpic.com/robinmayes/images/AR16.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/AR16_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[23] = new photo(1753677,'117821','','gallery','http://www1.clikpic.com/robinmayes/images/AR17.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/AR17_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[24] = new photo(1753682,'117821','','gallery','http://www1.clikpic.com/robinmayes/images/AR23.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/AR23_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[25] = new photo(1753686,'117821','','gallery','http://www1.clikpic.com/robinmayes/images/AR29.jpg',500,330,'','http://www1.clikpic.com/robinmayes/images/AR29_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[26] = new photo(1753691,'117821','','gallery','http://www1.clikpic.com/robinmayes/images/AR30.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/AR30_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[27] = new photo(1753697,'117821','','gallery','http://www1.clikpic.com/robinmayes/images/AR34.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/AR34_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[28] = new photo(1753698,'117821','','gallery','http://www1.clikpic.com/robinmayes/images/AR42.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/AR42_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[29] = new photo(1754620,'117828','','gallery','http://www1.clikpic.com/robinmayes/images/P1.jpg',335,500,'','http://www1.clikpic.com/robinmayes/images/P1_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[30] = new photo(1754622,'117828','','gallery','http://www1.clikpic.com/robinmayes/images/P3.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/P3_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[31] = new photo(1754624,'117828','','gallery','http://www1.clikpic.com/robinmayes/images/P5.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/P5_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[32] = new photo(1754626,'117828','','gallery','http://www1.clikpic.com/robinmayes/images/P4.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/P4_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[33] = new photo(1754629,'117828','','gallery','http://www1.clikpic.com/robinmayes/images/P6.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/P6_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[34] = new photo(1754631,'117828','','gallery','http://www1.clikpic.com/robinmayes/images/P7.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/P7_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[35] = new photo(1754633,'117828','','gallery','http://www1.clikpic.com/robinmayes/images/P8.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/P8_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[36] = new photo(1754634,'117828','','gallery','http://www1.clikpic.com/robinmayes/images/P9.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/P9_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[37] = new photo(1754637,'117828','','gallery','http://www1.clikpic.com/robinmayes/images/P18.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/P18_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[38] = new photo(1755537,'117934','','gallery','http://www1.clikpic.com/robinmayes/images/ED2.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/ED2_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[39] = new photo(1755539,'117934','','gallery','http://www1.clikpic.com/robinmayes/images/ED7.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/ED7_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[40] = new photo(1755543,'117934','','gallery','http://www1.clikpic.com/robinmayes/images/ED8.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/ED8_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[41] = new photo(1755545,'117934','','gallery','http://www1.clikpic.com/robinmayes/images/ED12.jpg',500,332,'','http://www1.clikpic.com/robinmayes/images/ED12_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[42] = new photo(1755549,'117934','','gallery','http://www1.clikpic.com/robinmayes/images/ED13.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/ED13_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[43] = new photo(1755552,'117934','','gallery','http://www1.clikpic.com/robinmayes/images/ED15.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/ED15_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[44] = new photo(1755556,'117934','','gallery','http://www1.clikpic.com/robinmayes/images/ED19.jpg',500,351,'','http://www1.clikpic.com/robinmayes/images/ED19_thumb.jpg',130, 91,0, 0,'','','','','','');
photos[45] = new photo(1755558,'117934','','gallery','http://www1.clikpic.com/robinmayes/images/ED27.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/ED27_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[46] = new photo(1755560,'117934','','gallery','http://www1.clikpic.com/robinmayes/images/ED28.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/ED28_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[47] = new photo(1755581,'117936','','gallery','http://www1.clikpic.com/robinmayes/images/M1.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/M1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[48] = new photo(1755588,'117936','','gallery','http://www1.clikpic.com/robinmayes/images/M4.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/M4_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[49] = new photo(1755597,'117936','','gallery','http://www1.clikpic.com/robinmayes/images/M5.jpg',500,350,'','http://www1.clikpic.com/robinmayes/images/M5_thumb.jpg',130, 91,0, 0,'','','','','','');
photos[50] = new photo(1755602,'117936','','gallery','http://www1.clikpic.com/robinmayes/images/M7.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/M7_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[51] = new photo(1755605,'117936','','gallery','http://www1.clikpic.com/robinmayes/images/M11.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/M11_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[52] = new photo(1755606,'117936','','gallery','http://www1.clikpic.com/robinmayes/images/M10.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/M10_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[53] = new photo(1755608,'117936','','gallery','http://www1.clikpic.com/robinmayes/images/M20.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/M20_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[54] = new photo(1755635,'117936','','gallery','http://www1.clikpic.com/robinmayes/images/M18.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/M18_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[55] = new photo(1755637,'117936','','gallery','http://www1.clikpic.com/robinmayes/images/M14.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/M14_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[56] = new photo(1755687,'117952','','gallery','http://www1.clikpic.com/robinmayes/images/B1.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/B1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[57] = new photo(1755688,'117952','','gallery','http://www1.clikpic.com/robinmayes/images/B2.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/B2_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[58] = new photo(1755690,'117952','','gallery','http://www1.clikpic.com/robinmayes/images/B3.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/B3_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[59] = new photo(1755697,'117952','','gallery','http://www1.clikpic.com/robinmayes/images/B10.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/B10_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[60] = new photo(1755701,'117952','','gallery','http://www1.clikpic.com/robinmayes/images/B13.jpg',368,500,'','http://www1.clikpic.com/robinmayes/images/B13_thumb.jpg',96, 130,0, 0,'','','','','','');
photos[61] = new photo(1755704,'117952','','gallery','http://www1.clikpic.com/robinmayes/images/B11.jpg',320,500,'','http://www1.clikpic.com/robinmayes/images/B11_thumb.jpg',83, 130,0, 0,'','','','','','');
photos[62] = new photo(1755707,'117952','','gallery','http://www1.clikpic.com/robinmayes/images/B12.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/B12_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[63] = new photo(1755709,'117952','','gallery','http://www1.clikpic.com/robinmayes/images/B16.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/B16_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[64] = new photo(1755710,'117952','','gallery','http://www1.clikpic.com/robinmayes/images/B19.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/B19_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[65] = new photo(1755711,'117952','','gallery','http://www1.clikpic.com/robinmayes/images/B30.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/B30_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[66] = new photo(1755712,'117952','','gallery','http://www1.clikpic.com/robinmayes/images/B31.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/B31_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[67] = new photo(1755713,'117952','','gallery','http://www1.clikpic.com/robinmayes/images/B29.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/B29_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[68] = new photo(1755898,'117973','','gallery','http://www1.clikpic.com/robinmayes/images/O5.jpg',322,500,'','http://www1.clikpic.com/robinmayes/images/O5_thumb.jpg',84, 130,0, 0,'','','','','','');
photos[69] = new photo(1755931,'117973','','gallery','http://www1.clikpic.com/robinmayes/images/O7.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/O7_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[70] = new photo(1755952,'117973','','gallery','http://www1.clikpic.com/robinmayes/images/O14.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/O14_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[71] = new photo(1755958,'117973','','gallery','http://www1.clikpic.com/robinmayes/images/O9.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/O9_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[72] = new photo(1755964,'117973','','gallery','http://www1.clikpic.com/robinmayes/images/O13.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/O13_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[73] = new photo(1755968,'117973','','gallery','http://www1.clikpic.com/robinmayes/images/O12.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/O12_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[74] = new photo(1755969,'117973','','gallery','http://www1.clikpic.com/robinmayes/images/O24.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/O24_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[75] = new photo(1755972,'117973','','gallery','http://www1.clikpic.com/robinmayes/images/O25.jpg',500,330,'','http://www1.clikpic.com/robinmayes/images/O25_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[76] = new photo(1755976,'117973','','gallery','http://www1.clikpic.com/robinmayes/images/O26.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/O26_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[77] = new photo(1759182,'118154','','gallery','http://www1.clikpic.com/robinmayes/images/I6.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/I6_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[78] = new photo(1759184,'118154','','gallery','http://www1.clikpic.com/robinmayes/images/I13.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/I13_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[79] = new photo(1759185,'118154','','gallery','http://www1.clikpic.com/robinmayes/images/I16.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/I16_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[80] = new photo(1759190,'118154','','gallery','http://www1.clikpic.com/robinmayes/images/I24.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/I24_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[81] = new photo(1759192,'118154','','gallery','http://www1.clikpic.com/robinmayes/images/I26.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/I26_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[82] = new photo(1759199,'118154','','gallery','http://www1.clikpic.com/robinmayes/images/I43.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/I43_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[83] = new photo(1759202,'118154','','gallery','http://www1.clikpic.com/robinmayes/images/I31.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/I31_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[84] = new photo(1759204,'118154','','gallery','http://www1.clikpic.com/robinmayes/images/I41.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/I41_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[85] = new photo(1759328,'118154','','gallery','http://www1.clikpic.com/robinmayes/images/I50.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/I50_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[86] = new photo(1759331,'118154','','gallery','http://www1.clikpic.com/robinmayes/images/I1.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/I1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[87] = new photo(1759337,'118154','','gallery','http://www1.clikpic.com/robinmayes/images/I46.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/I46_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[88] = new photo(1759339,'118154','','gallery','http://www1.clikpic.com/robinmayes/images/I48.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/I48_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[89] = new photo(1763724,'118480','','gallery','http://www1.clikpic.com/robinmayes/images/jamie1a.jpg',500,371,'','http://www1.clikpic.com/robinmayes/images/jamie1a_thumb.jpg',130, 97,0, 0,'','','','','','');
photos[90] = new photo(1763725,'118480','','gallery','http://www1.clikpic.com/robinmayes/images/m&s1a.jpg',500,430,'','http://www1.clikpic.com/robinmayes/images/m&s1a_thumb.jpg',130, 112,0, 0,'','','','','','');
photos[91] = new photo(1763743,'118480','','gallery','http://www1.clikpic.com/robinmayes/images/s2a.jpg',500,362,'','http://www1.clikpic.com/robinmayes/images/s2a_thumb.jpg',130, 94,0, 0,'','','','','','');
photos[92] = new photo(1763746,'118480','','gallery','http://www1.clikpic.com/robinmayes/images/sl1a.jpg',369,500,'','http://www1.clikpic.com/robinmayes/images/sl1a_thumb.jpg',96, 130,0, 0,'','','','','','');
photos[93] = new photo(1763749,'118480','','gallery','http://www1.clikpic.com/robinmayes/images/sl2a.jpg',377,500,'','http://www1.clikpic.com/robinmayes/images/sl2a_thumb.jpg',98, 130,0, 0,'','','','','','');
photos[94] = new photo(1763753,'118480','','gallery','http://www1.clikpic.com/robinmayes/images/sl3a.jpg',379,500,'','http://www1.clikpic.com/robinmayes/images/sl3a_thumb.jpg',98, 130,0, 0,'','','','','','');
photos[95] = new photo(1763789,'118480','','gallery','http://www1.clikpic.com/robinmayes/images/sl4a.jpg',376,500,'','http://www1.clikpic.com/robinmayes/images/sl4a_thumb.jpg',98, 130,0, 0,'','','','','','');
photos[96] = new photo(1763792,'118480','','gallery','http://www1.clikpic.com/robinmayes/images/sl5a.jpg',372,500,'','http://www1.clikpic.com/robinmayes/images/sl5a_thumb.jpg',97, 130,0, 0,'','','','','','');
photos[97] = new photo(1763794,'118480','','gallery','http://www1.clikpic.com/robinmayes/images/sl6a.jpg',368,500,'','http://www1.clikpic.com/robinmayes/images/sl6a_thumb.jpg',96, 130,0, 0,'','','','','','');
photos[98] = new photo(1764509,'118480','','gallery','http://www1.clikpic.com/robinmayes/images/ser1.jpg',335,500,'','http://www1.clikpic.com/robinmayes/images/ser1_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[99] = new photo(1764510,'118480','','gallery','http://www1.clikpic.com/robinmayes/images/ser2.jpg',344,500,'','http://www1.clikpic.com/robinmayes/images/ser2_thumb.jpg',89, 130,0, 0,'','','','','','');
photos[100] = new photo(1764512,'118480','','gallery','http://www1.clikpic.com/robinmayes/images/ser3.jpg',342,500,'','http://www1.clikpic.com/robinmayes/images/ser3_thumb.jpg',89, 130,0, 0,'','','','','','');
photos[101] = new photo(1764513,'118480','','gallery','http://www1.clikpic.com/robinmayes/images/ser4.jpg',331,500,'','http://www1.clikpic.com/robinmayes/images/ser4_thumb.jpg',86, 130,0, 0,'','','','','','');
photos[102] = new photo(1744589,'108034','','gallery','http://www1.clikpic.com/robinmayes/images/PR1.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/PR1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[103] = new photo(1744596,'108034','','gallery','http://www1.clikpic.com/robinmayes/images/PR2.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/PR2_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[104] = new photo(1744612,'108034','','gallery','http://www1.clikpic.com/robinmayes/images/PR3.jpg',319,500,'','http://www1.clikpic.com/robinmayes/images/PR3_thumb.jpg',83, 130,0, 0,'','','','','','');
photos[105] = new photo(1744723,'108034','','gallery','http://www1.clikpic.com/robinmayes/images/PR4.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/PR4_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[106] = new photo(1744761,'108034','','gallery','http://www1.clikpic.com/robinmayes/images/PR5.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/PR5_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[107] = new photo(1744859,'108034','','gallery','http://www1.clikpic.com/robinmayes/images/PR6.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/PR6_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[108] = new photo(1745026,'108034','','gallery','http://www1.clikpic.com/robinmayes/images/PR7.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/PR7_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[109] = new photo(1745820,'108034','','gallery','http://www1.clikpic.com/robinmayes/images/PR8.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/PR8_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[110] = new photo(1745876,'108034','','gallery','http://www1.clikpic.com/robinmayes/images/PR9.jpg',333,500,'','http://www1.clikpic.com/robinmayes/images/PR9_thumb.jpg',87, 130,0, 0,'','','','','','');
photos[111] = new photo(1745887,'108034','','gallery','http://www1.clikpic.com/robinmayes/images/PR10.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/PR10_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[112] = new photo(1748124,'108034','','gallery','http://www1.clikpic.com/robinmayes/images/PR11.jpg',345,500,'','http://www1.clikpic.com/robinmayes/images/PR11_thumb.jpg',90, 130,0, 0,'','','','','','');
photos[113] = new photo(1752133,'108034','','gallery','http://www1.clikpic.com/robinmayes/images/PR122.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/PR122_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[114] = new photo(1752140,'108034','','gallery','http://www1.clikpic.com/robinmayes/images/PR13.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/PR13_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[115] = new photo(1752141,'108034','','gallery','http://www1.clikpic.com/robinmayes/images/PR14.jpg',500,333,'','http://www1.clikpic.com/robinmayes/images/PR14_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[116] = new photo(1752142,'108034','','gallery','http://www1.clikpic.com/robinmayes/images/PR15.jpg',328,500,'','http://www1.clikpic.com/robinmayes/images/PR15_thumb.jpg',85, 130,0, 0,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(117821,'1753698,1753697,1753691,1753686,1753682,1753677,1753656,1753648,1753643,1753637','Annual Reports','gallery');
galleries[1] = new gallery(117733,'1752359,1752358,1752357,1752355,1752354,1752353,1752352,1752351,1752350,1752349','Awards & Conferences','gallery');
galleries[2] = new gallery(117952,'1755713,1755712,1755711,1755710,1755709,1755707,1755704,1755701,1755697,1755690','Brochures','gallery');
galleries[3] = new gallery(117934,'1755560,1755558,1755556,1755552,1755549,1755545,1755543,1755539,1755537','Editorial','gallery');
galleries[4] = new gallery(118154,'1759339,1759337,1759331,1759328,1759204,1759202,1759199,1759192,1759190,1759185','Industrial','gallery');
galleries[5] = new gallery(117936,'1755637,1755635,1755608,1755606,1755605,1755602,1755597,1755588,1755581','Marketing','gallery');
galleries[6] = new gallery(117973,'1755976,1755972,1755969,1755968,1755964,1755958,1755952,1755931,1755898','Office','gallery');
galleries[7] = new gallery(117828,'1754637,1754634,1754633,1754631,1754629,1754626,1754624,1754622,1754620','Portraits','gallery');
galleries[8] = new gallery(118480,'1764513,1764512,1764510,1764509,1763794,1763792,1763789,1763753,1763749,1763746','Recently Published Work','gallery');
galleries[9] = new gallery(108034,'1752142,1752141,1752140,1752133,1748124,1745887,1745876,1745820,1745026,1744859','PR','gallery');

