/***************************************************************************
* 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('2571171,2571169,2571167,2571166,2571165,2571163,2571142,2571140,2571139,2571138,2571137,2571136,2571135,2570809,2570808,2570807,2570806,2570805,2570797,2570796,2570795,2570794,2570792,2570791,2570790,2570789,2570759,2570758,2570756,2570755,2570747,2570745,2570744,2570742,2570741,2569351,2569349,2569341,2569340,2569339,2569338,2569336,2569289,2569287,2569271,2569169,2569168,2569167,2569165,2569139');
	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('2571171,2571169,2571167,2571166,2571165,2571163,2571142,2571140,2571139,2571138,2571137,2571136,2571135,2570809,2570808,2570807,2570806,2570805,2570797,2570796,2570795,2570794,2570792,2570791,2570790,2570789,2570759,2570758,2570756,2570755,2570747,2570745,2570744,2570742,2570741,2569351,2569349,2569341,2569340,2569339,2569338,2569336,2569289,2569287,2569271,2569169,2569168,2569167,2569165,2569139');
	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;
			document.title = 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(2570789,'162088','','gallery','http://www2.clikpic.com/drwright39/images/Icantletthemout1.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Icantletthemout1_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[1] = new photo(2570790,'162088','','gallery','http://www2.clikpic.com/drwright39/images/Icantletthemout4.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Icantletthemout4_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[2] = new photo(2570791,'162088','','gallery','http://www2.clikpic.com/drwright39/images/Icantletthemout7.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Icantletthemout7_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[3] = new photo(2570792,'162088','','gallery','http://www2.clikpic.com/drwright39/images/Icantletthemout10.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Icantletthemout10_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[4] = new photo(2570794,'162088','','gallery','http://www2.clikpic.com/drwright39/images/Icantletthemout13.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Icantletthemout13_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[5] = new photo(2570795,'162088','','gallery','http://www2.clikpic.com/drwright39/images/Icantletthemout16.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Icantletthemout16_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[6] = new photo(2570796,'162088','','gallery','http://www2.clikpic.com/drwright39/images/Icantletthemout19.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Icantletthemout19_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[7] = new photo(2570797,'162088','','gallery','http://www2.clikpic.com/drwright39/images/Icantletthemout23.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Icantletthemout23_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[8] = new photo(2570741,'162089','','gallery','http://www2.clikpic.com/drwright39/images/Noteventomyself1.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Noteventomyself1_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[9] = new photo(2570742,'162089','','gallery','http://www2.clikpic.com/drwright39/images/Noteventomyself4.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Noteventomyself4_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[10] = new photo(2570744,'162089','','gallery','http://www2.clikpic.com/drwright39/images/Noteventomyself7.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Noteventomyself7_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[11] = new photo(2570745,'162089','','gallery','http://www2.clikpic.com/drwright39/images/Noteventomyself10.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Noteventomyself10_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[12] = new photo(2570747,'162089','','gallery','http://www2.clikpic.com/drwright39/images/Noteventomyself13.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Noteventomyself13_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[13] = new photo(2570755,'162089','','gallery','http://www2.clikpic.com/drwright39/images/Noteventomyself16.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Noteventomyself16_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[14] = new photo(2570756,'162089','','gallery','http://www2.clikpic.com/drwright39/images/Noteventomyself19.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Noteventomyself19_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[15] = new photo(2570758,'162089','','gallery','http://www2.clikpic.com/drwright39/images/Noteventomyself22.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Noteventomyself22_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[16] = new photo(2570759,'162089','','gallery','http://www2.clikpic.com/drwright39/images/Noteventomyself25.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Noteventomyself25_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[17] = new photo(2565443,'163538','','gallery','http://www2.clikpic.com/drwright39/images/Toodangerousoutside1.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Toodangerousoutside1_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[18] = new photo(2565448,'163538','','gallery','http://www2.clikpic.com/drwright39/images/Toodangerousoutside4.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Toodangerousoutside4_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[19] = new photo(2565449,'163538','','gallery','http://www2.clikpic.com/drwright39/images/Toodangerousoutside7.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Toodangerousoutside7_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[20] = new photo(2565450,'163538','','gallery','http://www2.clikpic.com/drwright39/images/Toodangerousoutside10.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Toodangerousoutside10_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[21] = new photo(2565454,'163538','','gallery','http://www2.clikpic.com/drwright39/images/Toodangerousoutside13.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Toodangerousoutside13_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[22] = new photo(2565457,'163538','','gallery','http://www2.clikpic.com/drwright39/images/Toodangerousoutside16.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Toodangerousoutside16_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[23] = new photo(2565459,'163538','','gallery','http://www2.clikpic.com/drwright39/images/Toodangerousoutside19.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Toodangerousoutside19_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[24] = new photo(2565412,'163537','','gallery','http://www2.clikpic.com/drwright39/images/Untolddreams12.JPG',500,375,'','http://www2.clikpic.com/drwright39/images/Untolddreams12_thumb.JPG',130, 98,0, 0,'','','','','','');
photos[25] = new photo(2565414,'163537','','gallery','http://www2.clikpic.com/drwright39/images/Untolddreams41.JPG',500,375,'','http://www2.clikpic.com/drwright39/images/Untolddreams41_thumb.JPG',130, 98,0, 0,'','','','','','');
photos[26] = new photo(2565415,'163537','','gallery','http://www2.clikpic.com/drwright39/images/Untolddreams71.JPG',450,600,'','http://www2.clikpic.com/drwright39/images/Untolddreams71_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[27] = new photo(2565417,'163537','','gallery','http://www2.clikpic.com/drwright39/images/Untolddreams131.JPG',450,600,'','http://www2.clikpic.com/drwright39/images/Untolddreams131_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[28] = new photo(2565419,'163537','','gallery','http://www2.clikpic.com/drwright39/images/Untolddreams161.JPG',450,600,'','http://www2.clikpic.com/drwright39/images/Untolddreams161_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[29] = new photo(2570805,'163763','','gallery','http://www2.clikpic.com/drwright39/images/Hiddenpassions1.JPG',450,600,'','http://www2.clikpic.com/drwright39/images/Hiddenpassions1_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[30] = new photo(2570806,'163763','','gallery','http://www2.clikpic.com/drwright39/images/Hiddenpassions4.JPG',450,600,'','http://www2.clikpic.com/drwright39/images/Hiddenpassions4_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[31] = new photo(2570807,'163763','','gallery','http://www2.clikpic.com/drwright39/images/Hiddenpassions7.JPG',450,600,'','http://www2.clikpic.com/drwright39/images/Hiddenpassions7_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[32] = new photo(2570808,'163763','','gallery','http://www2.clikpic.com/drwright39/images/Hiddenpassions10.JPG',450,600,'','http://www2.clikpic.com/drwright39/images/Hiddenpassions10_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[33] = new photo(2570809,'163763','','gallery','http://www2.clikpic.com/drwright39/images/Hiddenpassions13.JPG',450,600,'','http://www2.clikpic.com/drwright39/images/Hiddenpassions13_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[34] = new photo(2565400,'163764','','gallery','http://www2.clikpic.com/drwright39/images/Unheardstories1.JPG',450,600,'','http://www2.clikpic.com/drwright39/images/Unheardstories1_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[35] = new photo(2565401,'163764','','gallery','http://www2.clikpic.com/drwright39/images/Unheardstories4.JPG',450,600,'','http://www2.clikpic.com/drwright39/images/Unheardstories4_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[36] = new photo(2565405,'163764','','gallery','http://www2.clikpic.com/drwright39/images/Unheardstories7.JPG',450,600,'','http://www2.clikpic.com/drwright39/images/Unheardstories7_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[37] = new photo(2565406,'163764','','gallery','http://www2.clikpic.com/drwright39/images/Unheardstories10.JPG',450,600,'','http://www2.clikpic.com/drwright39/images/Unheardstories10_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[38] = new photo(2565407,'163764','','gallery','http://www2.clikpic.com/drwright39/images/Unheardstories13.JPG',450,600,'','http://www2.clikpic.com/drwright39/images/Unheardstories13_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[39] = new photo(2565409,'163764','','gallery','http://www2.clikpic.com/drwright39/images/Unheardstories16.JPG',450,600,'','http://www2.clikpic.com/drwright39/images/Unheardstories16_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[40] = new photo(2565411,'163764','','gallery','http://www2.clikpic.com/drwright39/images/Unheardstories19.JPG',450,600,'','http://www2.clikpic.com/drwright39/images/Unheardstories19_thumb.JPG',130, 173,0, 0,'','','','','','');
photos[41] = new photo(2569137,'163765','','gallery','http://www2.clikpic.com/drwright39/images/Safeinside1.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/Safeinside1_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[42] = new photo(2569139,'163765','','gallery','http://www2.clikpic.com/drwright39/images/Safeinside4.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/Safeinside4_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[43] = new photo(2569165,'163765','','gallery','http://www2.clikpic.com/drwright39/images/Safeinside7.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/Safeinside7_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[44] = new photo(2569167,'163765','','gallery','http://www2.clikpic.com/drwright39/images/Safeinside10.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Safeinside10_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[45] = new photo(2569168,'163765','','gallery','http://www2.clikpic.com/drwright39/images/Safeinside13.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Safeinside13_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[46] = new photo(2569169,'163765','','gallery','http://www2.clikpic.com/drwright39/images/Safeinside16.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Safeinside16_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[47] = new photo(2565492,'163773','','gallery','http://www2.clikpic.com/drwright39/images/Stiffledhopes1.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/Stiffledhopes1_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[48] = new photo(2565494,'163773','','gallery','http://www2.clikpic.com/drwright39/images/Stiffledhopes4.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Stiffledhopes4_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[49] = new photo(2565498,'163773','','gallery','http://www2.clikpic.com/drwright39/images/Stiffledhopes7.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Stiffledhopes7_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[50] = new photo(2565499,'163773','','gallery','http://www2.clikpic.com/drwright39/images/Stiffledhopes10.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Stiffledhopes10_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[51] = new photo(2565501,'163773','','gallery','http://www2.clikpic.com/drwright39/images/Stiffledhopes13.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Stiffledhopes13_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[52] = new photo(2565502,'163773','','gallery','http://www2.clikpic.com/drwright39/images/Stiffledhopes16.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Stiffledhopes16_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[53] = new photo(2569271,'163774','','gallery','http://www2.clikpic.com/drwright39/images/Outofsight1.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/Outofsight1_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[54] = new photo(2569287,'163774','','gallery','http://www2.clikpic.com/drwright39/images/Outofsight4.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/Outofsight4_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[55] = new photo(2569289,'163774','','gallery','http://www2.clikpic.com/drwright39/images/Outofsight7.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/Outofsight7_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[56] = new photo(2569336,'163774','','gallery','http://www2.clikpic.com/drwright39/images/Outofsight10.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/Outofsight10_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[57] = new photo(2569338,'163774','','gallery','http://www2.clikpic.com/drwright39/images/Outofsight13.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/Outofsight13_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[58] = new photo(2569339,'163774','','gallery','http://www2.clikpic.com/drwright39/images/Outofsight16.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/Outofsight16_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[59] = new photo(2569340,'163774','','gallery','http://www2.clikpic.com/drwright39/images/Outofsight19.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/Outofsight19_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[60] = new photo(2569341,'163774','','gallery','http://www2.clikpic.com/drwright39/images/Outofsight22.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/Outofsight22_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[61] = new photo(2569349,'163774','','gallery','http://www2.clikpic.com/drwright39/images/Outofsight25.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Outofsight25_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[62] = new photo(2569351,'163774','','gallery','http://www2.clikpic.com/drwright39/images/Outofsight28.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/Outofsight28_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[63] = new photo(2571163,'163767','','gallery','http://www2.clikpic.com/drwright39/images/CommondreamsI1.jpg',450,600,'','http://www2.clikpic.com/drwright39/images/CommondreamsI1_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[64] = new photo(2571165,'163767','','gallery','http://www2.clikpic.com/drwright39/images/CommondreamsI4.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/CommondreamsI4_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[65] = new photo(2571166,'163767','','gallery','http://www2.clikpic.com/drwright39/images/CommondreamsI7.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/CommondreamsI7_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[66] = new photo(2571167,'163767','','gallery','http://www2.clikpic.com/drwright39/images/CommondreamsI10.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/CommondreamsI10_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[67] = new photo(2571169,'163767','','gallery','http://www2.clikpic.com/drwright39/images/CommondreamsI13.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/CommondreamsI13_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[68] = new photo(2571171,'163767','','gallery','http://www2.clikpic.com/drwright39/images/CommondreamsI16.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/CommondreamsI16_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[69] = new photo(2571135,'163775','','gallery','http://www2.clikpic.com/drwright39/images/CommondreamsII&Smalldreams1.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/CommondreamsII&Smalldreams1_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[70] = new photo(2571136,'163775','','gallery','http://www2.clikpic.com/drwright39/images/CommondreamsII&Smalldreams4.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/CommondreamsII&Smalldreams4_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[71] = new photo(2571137,'163775','','gallery','http://www2.clikpic.com/drwright39/images/CommondreamsII&Smalldreams7.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/CommondreamsII&Smalldreams7_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[72] = new photo(2571138,'163775','','gallery','http://www2.clikpic.com/drwright39/images/CommondreamsII&Smalldreams10.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/CommondreamsII&Smalldreams10_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[73] = new photo(2571139,'163775','','gallery','http://www2.clikpic.com/drwright39/images/CommondreamsII&Smalldreams13.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/CommondreamsII&Smalldreams13_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[74] = new photo(2571140,'163775','','gallery','http://www2.clikpic.com/drwright39/images/CommondreamsII&Smalldreams16.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/CommondreamsII&Smalldreams16_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[75] = new photo(2571142,'163775','','gallery','http://www2.clikpic.com/drwright39/images/CommondreamsII&Smalldreams19.jpg',500,375,'','http://www2.clikpic.com/drwright39/images/CommondreamsII&Smalldreams19_thumb.jpg',130, 98,0, 0,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(162088,'2570797,2570796,2570795,2570794,2570792,2570791,2570790,2570789','I can\'t let them out','gallery');
galleries[1] = new gallery(162089,'2570759,2570758,2570756,2570755,2570747,2570745,2570744,2570742,2570741','Not even to myself','gallery');
galleries[2] = new gallery(163538,'2565459,2565457,2565454,2565450,2565449,2565448,2565443','Too dangerous outside','gallery');
galleries[3] = new gallery(163537,'2565419,2565417,2565415,2565414,2565412','Untold dreams','gallery');
galleries[4] = new gallery(163763,'2570809,2570808,2570807,2570806,2570805','Hidden passions','gallery');
galleries[5] = new gallery(163764,'2565411,2565409,2565407,2565406,2565405,2565401,2565400','Unheard stories','gallery');
galleries[6] = new gallery(163765,'2569169,2569168,2569167,2569165,2569139,2569137','Safe inside','gallery');
galleries[7] = new gallery(163773,'2565502,2565501,2565499,2565498,2565494,2565492','Stiffled hopes','gallery');
galleries[8] = new gallery(163774,'2569351,2569349,2569341,2569340,2569339,2569338,2569336,2569289,2569287,2569271','Out of sight','gallery');
galleries[9] = new gallery(163767,'2571171,2571169,2571167,2571166,2571165,2571163','Common dreams I','gallery');
galleries[10] = new gallery(163775,'2571142,2571140,2571139,2571138,2571137,2571136,2571135','Common dreams II & Small dreams','gallery');

