/***************************************************************************
* 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('184432');
	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('184432');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if ('gallery' != '') {
						if (photos[j].galleries_id != '') {
						document.write('<a href="' + photos[j].section_code + '_' + photos[j].galleries_id + '.html">');
						}
						else {
						document.write('<a href="gallery.html">');
						}
			}
			document.write('<img src="' + photos[j].src + '" width="' + photos[j].width + '" height="' + photos[j].height + '" class="mainhomepageimage" id="mainSample" name="mainSample" alt="' + photos[j].caption  + '" border="0">');
			if ('gallery' != '') {
				document.write('</a>');
			}
			break;
		}
	}
	
}

/***************************************************************************
* Show the next image in a gallery.  field = hidden field containing       *
* image_id                                                                 *
*  img = reference to image object in which to show image                  *
***************************************************************************/
function next(field,img) {

	debug('IN next');
	imageID = field.value;
	
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			break;
		}
	}
	debug('image is ' + j);
	nextImg = -1;
	k= j + 1;
	while (nextImg < 0) {
		for (; k < photos.length; k++) {
			debug('testing image ' + k + ': gallery = ' + photos[k].galleries_id + '(existing: ' + photos[j].galleries_id + ')');
			if (photos[k].galleries_id == photos[j].galleries_id) {
				nextImg = k;
				debug('setting  nextImg = ' + k);
				break;
			}
		}
		if (nextImg == -1) {
			k = 0;
		}
	}
	if (nextImg != -1) {
		updateImage(nextImg, field,img);
	}


}


/***************************************************************************
* Set a new image on the gallery detail page given its array position      *
***************************************************************************/
function updateImage (nextImg, field,img) {
	debug('Updating image');
	if (!basic && !((0) || (0))) {
		debug('In updateImage');
		debug('setting  img src = ' + photos[nextImg].src);
		
					
			document.getElementById('imagePhoto').innerHTML = '<img class="mainphoto" src="' + photos[nextImg].src + ' " id="mainPic" name="mainPic" width="' + photos[nextImg].width + '" height="' + photos[nextImg].height + '" alt="' + photos[nextImg].caption + '">';
						field.value = photos[nextImg].id;
			document.getElementById('imageTitle').innerHTML = photos[nextImg].caption;
									document.title = 'Cheryl Chapman 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(185488,'','','','http://www1.clikpic.com/b0n3s/images/album.jpg',400,268,'','http://www1.clikpic.com/b0n3s/images/album_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[1] = new photo(191129,'','','','http://www1.clikpic.com/b0n3s/images/bruce2.jpg',400,479,'','http://www1.clikpic.com/b0n3s/images/bruce2_thumb.jpg',130, 156,0, 0,'','','','','','');
photos[2] = new photo(192861,'','','','http://www1.clikpic.com/b0n3s/images/Cheryl-camera.jpg',400,589,'','http://www1.clikpic.com/b0n3s/images/Cheryl-camera_thumb.jpg',130, 191,0, 0,'','','','','','');
photos[3] = new photo(183421,'16904','','gallery','http://www1.clikpic.com/b0n3s/images/flowers&shoe.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/flowers&shoe_thumb.jpg',130, 194,0, 0,'','','','Weybridge Registry Office','','');
photos[4] = new photo(183384,'16904','','gallery','http://www1.clikpic.com/b0n3s/images/TRAC&ELL167.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/TRAC&ELL167_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[5] = new photo(183431,'16904','','gallery','http://www1.clikpic.com/b0n3s/images/makeup.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/makeup_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[6] = new photo(183345,'16904','','gallery','http://www1.clikpic.com/b0n3s/images/Excitment.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/Excitment_thumb.jpg',130, 194,0, 0,'','','','Tylney Hall','','');
photos[7] = new photo(183354,'16904','','gallery','http://www1.clikpic.com/b0n3s/images/dress.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/dress_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[8] = new photo(183413,'16904','','gallery','http://www1.clikpic.com/b0n3s/images/dress-back.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/dress-back_thumb.jpg',130, 194,0, 1,'','','','','','');
photos[9] = new photo(183388,'16904','','gallery','http://www1.clikpic.com/b0n3s/images/dressing.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/dressing_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[10] = new photo(183405,'16904','','gallery','http://www1.clikpic.com/b0n3s/images/TRAC&ELL254.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/TRAC&ELL254_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[11] = new photo(183393,'16904','','gallery','http://www1.clikpic.com/b0n3s/images/businessflyer00070.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/businessflyer00070_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[12] = new photo(183437,'16905','','gallery','http://www1.clikpic.com/b0n3s/images/girl.jpg',400,594,'','http://www1.clikpic.com/b0n3s/images/girl_thumb.jpg',130, 193,0, 0,'','','','','','');
photos[13] = new photo(185020,'16905','','gallery','http://www1.clikpic.com/b0n3s/images/arrival-20.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/arrival-20_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[14] = new photo(183454,'16905','','gallery','http://www1.clikpic.com/b0n3s/images/H&dad.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/H&dad_thumb.jpg',130, 194,0, 1,'','','','','','');
photos[15] = new photo(185025,'16905','','gallery','http://www1.clikpic.com/b0n3s/images/arrival-40.jpg',400,268,'','http://www1.clikpic.com/b0n3s/images/arrival-40_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[16] = new photo(185027,'16905','','gallery','http://www1.clikpic.com/b0n3s/images/arrival-50.jpg',400,268,'','http://www1.clikpic.com/b0n3s/images/arrival-50_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[17] = new photo(688512,'16905','','gallery','http://www1.clikpic.com/b0n3s/images/AmyJ&Daniel0920.jpg',400,268,'','http://www1.clikpic.com/b0n3s/images/AmyJ&Daniel0920_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[18] = new photo(185032,'16905','','gallery','http://www1.clikpic.com/b0n3s/images/arrival-70.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/arrival-70_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[19] = new photo(688514,'16905','','gallery','http://www1.clikpic.com/b0n3s/images/AmyJ&Daniel0292.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/AmyJ&Daniel0292_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[20] = new photo(688516,'16905','','gallery','http://www1.clikpic.com/b0n3s/images/Mark&Robin310.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/Mark&Robin310_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[21] = new photo(731524,'52674','','gallery','http://www1.clikpic.com/b0n3s/images/00016.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/00016_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[22] = new photo(734118,'52674','','gallery','http://www1.clikpic.com/b0n3s/images/CNV00014.jpg',600,896,'','http://www1.clikpic.com/b0n3s/images/CNV00014_thumb.jpg',130, 194,0, 1,'','','','','','');
photos[23] = new photo(731539,'52674','','gallery','http://www1.clikpic.com/b0n3s/images/cer30.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/cer30_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[24] = new photo(185034,'52674','','gallery','http://www1.clikpic.com/b0n3s/images/arrival-80.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/arrival-80_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[25] = new photo(731555,'52674','','gallery','http://www1.clikpic.com/b0n3s/images/cer60.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/cer60_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[26] = new photo(731606,'52674','','gallery','http://www1.clikpic.com/b0n3s/images/cer40a.jpg',600,896,'','http://www1.clikpic.com/b0n3s/images/cer40a_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[27] = new photo(731557,'52674','','gallery','http://www1.clikpic.com/b0n3s/images/cer70.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/cer70_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[28] = new photo(731562,'52674','','gallery','http://www1.clikpic.com/b0n3s/images/cer80.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/cer80_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[29] = new photo(185035,'52674','','gallery','http://www1.clikpic.com/b0n3s/images/arrival-90.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/arrival-90_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[30] = new photo(184432,'16911','','gallery','http://www1.clikpic.com/b0n3s/images/gallery3-3.jpg',400,268,'','http://www1.clikpic.com/b0n3s/images/gallery3-3_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[31] = new photo(184430,'16911','','gallery','http://www1.clikpic.com/b0n3s/images/gallery3-1.jpg',400,268,'','http://www1.clikpic.com/b0n3s/images/gallery3-1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[32] = new photo(184433,'16911','','gallery','http://www1.clikpic.com/b0n3s/images/gallery3-2.jpg',400,268,'','http://www1.clikpic.com/b0n3s/images/gallery3-2_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[33] = new photo(184434,'16911','','gallery','http://www1.clikpic.com/b0n3s/images/gallery3-4.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/gallery3-4_thumb.jpg',130, 194,0, 1,'','','','','','');
photos[34] = new photo(184436,'16911','','gallery','http://www1.clikpic.com/b0n3s/images/gallery3-6.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/gallery3-6_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[35] = new photo(184454,'16911','','gallery','http://www1.clikpic.com/b0n3s/images/gallery3-10.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/gallery3-10_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[36] = new photo(184437,'16911','','gallery','http://www1.clikpic.com/b0n3s/images/gallery3-7.jpg',400,268,'','http://www1.clikpic.com/b0n3s/images/gallery3-7_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[37] = new photo(184439,'16911','','gallery','http://www1.clikpic.com/b0n3s/images/gallery3-8.jpg',400,268,'','http://www1.clikpic.com/b0n3s/images/gallery3-8_thumb.jpg',130, 87,0, 0,'','','','Oatlands Park Hotel','','');
photos[38] = new photo(184440,'16911','','gallery','http://www1.clikpic.com/b0n3s/images/gallery3-9.jpg',400,268,'','http://www1.clikpic.com/b0n3s/images/gallery3-9_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[39] = new photo(183754,'16912','','gallery','http://www1.clikpic.com/b0n3s/images/twoofus-1.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/twoofus-1_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[40] = new photo(183755,'16912','','gallery','http://www1.clikpic.com/b0n3s/images/twoofus-2.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/twoofus-2_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[41] = new photo(183440,'16912','','gallery','http://www1.clikpic.com/b0n3s/images/2together.jpg',400,623,'','http://www1.clikpic.com/b0n3s/images/2together_thumb.jpg',130, 202,0, 0,'','','','','','');
photos[42] = new photo(184964,'16912','','gallery','http://www1.clikpic.com/b0n3s/images/twoofus-4b.jpg',400,268,'','http://www1.clikpic.com/b0n3s/images/twoofus-4b_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[43] = new photo(184950,'16912','','gallery','http://www1.clikpic.com/b0n3s/images/twoofus-6a.jpg',400,268,'','http://www1.clikpic.com/b0n3s/images/twoofus-6a_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[44] = new photo(183760,'16912','','gallery','http://www1.clikpic.com/b0n3s/images/twoofus-5.jpg',400,268,'','http://www1.clikpic.com/b0n3s/images/twoofus-5_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[45] = new photo(183756,'16912','','gallery','http://www1.clikpic.com/b0n3s/images/twoofus-7.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/twoofus-7_thumb.jpg',130, 194,0, 1,'','','','','','');
photos[46] = new photo(186649,'16912','','gallery','http://www1.clikpic.com/b0n3s/images/twoofus-80a.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/twoofus-80a_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[47] = new photo(183758,'16912','','gallery','http://www1.clikpic.com/b0n3s/images/twoofus-9.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/twoofus-9_thumb.jpg',130, 194,0, 1,'','','','','','');
photos[48] = new photo(688269,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/001.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/001_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[49] = new photo(688270,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/002.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/002_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[50] = new photo(688271,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/003.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/003_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[51] = new photo(688274,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/004.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/004_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[52] = new photo(688278,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/005.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/005_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[53] = new photo(688279,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/00006.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/00006_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[54] = new photo(688282,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/007.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/007_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[55] = new photo(688283,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/008.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/008_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[56] = new photo(688285,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/009.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/009_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[57] = new photo(688288,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/010.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/010_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[58] = new photo(688291,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/011.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/011_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[59] = new photo(688292,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/012.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/012_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[60] = new photo(688293,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/013.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/013_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[61] = new photo(688294,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/014.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/014_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[62] = new photo(688295,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/015.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/015_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[63] = new photo(688297,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/016.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/016_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[64] = new photo(688428,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/0171.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/0171_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[65] = new photo(688430,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/018.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/018_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[66] = new photo(688432,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/019.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/019_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[67] = new photo(688434,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/020.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/020_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[68] = new photo(688435,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/021.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/021_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[69] = new photo(688436,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/022.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/022_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[70] = new photo(688439,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/023.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/023_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[71] = new photo(688440,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/024.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/024_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[72] = new photo(688441,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/025.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/025_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[73] = new photo(688445,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/026.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/026_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[74] = new photo(688446,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/027.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/027_thumb.JPG',130, 194,0, 1,'','','','','','');
photos[75] = new photo(688448,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/028.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/028_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[76] = new photo(688452,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/029.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/029_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[77] = new photo(688454,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/030.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/030_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[78] = new photo(688455,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/031.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/031_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[79] = new photo(688457,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/032.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/032_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[80] = new photo(688458,'52657','','gallery','http://www1.clikpic.com/b0n3s/images/033.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/033_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[81] = new photo(734152,'56613','','gallery','http://www1.clikpic.com/b0n3s/images/0011.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/0011_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[82] = new photo(734153,'56613','','gallery','http://www1.clikpic.com/b0n3s/images/0021.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/0021_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[83] = new photo(734154,'56613','','gallery','http://www1.clikpic.com/b0n3s/images/0031.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/0031_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[84] = new photo(734157,'56613','','gallery','http://www1.clikpic.com/b0n3s/images/0041.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/0041_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[85] = new photo(734159,'56613','','gallery','http://www1.clikpic.com/b0n3s/images/0051.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/0051_thumb.JPG',130, 194,0, 1,'','','','','','');
photos[86] = new photo(734160,'56613','','gallery','http://www1.clikpic.com/b0n3s/images/006.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/006_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[87] = new photo(734161,'56613','','gallery','http://www1.clikpic.com/b0n3s/images/0071.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/0071_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[88] = new photo(734163,'56613','','gallery','http://www1.clikpic.com/b0n3s/images/0081.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/0081_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[89] = new photo(734165,'56613','','gallery','http://www1.clikpic.com/b0n3s/images/0091.JPG',400,597,'','http://www1.clikpic.com/b0n3s/images/0091_thumb.JPG',130, 194,0, 0,'','','','','','');
photos[90] = new photo(734174,'56613','','gallery','http://www1.clikpic.com/b0n3s/images/0131.jpg',400,268,'','http://www1.clikpic.com/b0n3s/images/0131_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[91] = new photo(734178,'56613','','gallery','http://www1.clikpic.com/b0n3s/images/0151.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/0151_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[92] = new photo(734180,'56613','','gallery','http://www1.clikpic.com/b0n3s/images/0141.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/0141_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[93] = new photo(734200,'56613','','gallery','http://www1.clikpic.com/b0n3s/images/0181.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/0181_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[94] = new photo(734202,'56613','','gallery','http://www1.clikpic.com/b0n3s/images/0121.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/0121_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[95] = new photo(734203,'56613','','gallery','http://www1.clikpic.com/b0n3s/images/0301.JPG',400,268,'','http://www1.clikpic.com/b0n3s/images/0301_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[96] = new photo(185738,'17042','','gallery','http://www1.clikpic.com/b0n3s/images/bride zoom.jpg',380,578,'','http://www1.clikpic.com/b0n3s/images/bride zoom_thumb.jpg',130, 198,0, 1,'','','','','','');
photos[97] = new photo(185468,'17042','','gallery','http://www1.clikpic.com/b0n3s/images/contemp-2.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/contemp-2_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[98] = new photo(185471,'17042','','gallery','http://www1.clikpic.com/b0n3s/images/contemp-10.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/contemp-10_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[99] = new photo(185465,'17042','','gallery','http://www1.clikpic.com/b0n3s/images/contemp-1.jpg',400,268,'','http://www1.clikpic.com/b0n3s/images/contemp-1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[100] = new photo(185472,'17042','','gallery','http://www1.clikpic.com/b0n3s/images/contemp-5.jpg',400,268,'','http://www1.clikpic.com/b0n3s/images/contemp-5_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[101] = new photo(185495,'17042','','gallery','http://www1.clikpic.com/b0n3s/images/contemp-4.jpg',400,268,'','http://www1.clikpic.com/b0n3s/images/contemp-4_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[102] = new photo(185475,'17042','','gallery','http://www1.clikpic.com/b0n3s/images/contemp-7.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/contemp-7_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[103] = new photo(183757,'17042','','gallery','http://www1.clikpic.com/b0n3s/images/twoofus-8.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/twoofus-8_thumb.jpg',130, 194,0, 1,'','','','','','');
photos[104] = new photo(185478,'17042','','gallery','http://www1.clikpic.com/b0n3s/images/contemp-9.jpg',400,597,'','http://www1.clikpic.com/b0n3s/images/contemp-9_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[105] = new photo(746536,'17044','','gallery','http://www1.clikpic.com/b0n3s/images/Lewis_01.jpg',600,402,'','http://www1.clikpic.com/b0n3s/images/Lewis_01_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[106] = new photo(746538,'17044','','gallery','http://www1.clikpic.com/b0n3s/images/Lewis_02.jpg',600,402,'','http://www1.clikpic.com/b0n3s/images/Lewis_02_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[107] = new photo(746539,'17044','','gallery','http://www1.clikpic.com/b0n3s/images/Lewis_03.jpg',600,402,'','http://www1.clikpic.com/b0n3s/images/Lewis_03_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[108] = new photo(746541,'17044','','gallery','http://www1.clikpic.com/b0n3s/images/Lewis_04.jpg',600,896,'','http://www1.clikpic.com/b0n3s/images/Lewis_04_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[109] = new photo(746545,'17044','','gallery','http://www1.clikpic.com/b0n3s/images/Lewis_05.jpg',600,896,'','http://www1.clikpic.com/b0n3s/images/Lewis_05_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[110] = new photo(746547,'17044','','gallery','http://www1.clikpic.com/b0n3s/images/Lewis_06.jpg',600,896,'','http://www1.clikpic.com/b0n3s/images/Lewis_06_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[111] = new photo(746550,'17044','','gallery','http://www1.clikpic.com/b0n3s/images/lo01.JPG',600,398,'','http://www1.clikpic.com/b0n3s/images/lo01_thumb.JPG',130, 86,0, 0,'','','','','','');
photos[112] = new photo(746551,'17044','','gallery','http://www1.clikpic.com/b0n3s/images/lo02.JPG',600,398,'','http://www1.clikpic.com/b0n3s/images/lo02_thumb.JPG',130, 86,0, 0,'','','','','','');
photos[113] = new photo(746552,'17044','','gallery','http://www1.clikpic.com/b0n3s/images/lo03.JPG',600,398,'','http://www1.clikpic.com/b0n3s/images/lo03_thumb.JPG',130, 86,0, 0,'','','','','','');
photos[114] = new photo(746553,'17044','','gallery','http://www1.clikpic.com/b0n3s/images/lo04.JPG',600,905,'','http://www1.clikpic.com/b0n3s/images/lo04_thumb.JPG',130, 196,0, 0,'','','','','','');
photos[115] = new photo(746555,'17044','','gallery','http://www1.clikpic.com/b0n3s/images/lo05.jpg',600,905,'','http://www1.clikpic.com/b0n3s/images/lo05_thumb.jpg',130, 196,0, 0,'','','','','','');
photos[116] = new photo(746562,'17044','','gallery','http://www1.clikpic.com/b0n3s/images/lo06.JPG',600,905,'','http://www1.clikpic.com/b0n3s/images/lo06_thumb.JPG',130, 196,0, 1,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(16904,'183413','The Preparation','gallery');
galleries[1] = new gallery(16905,'183454','The Arrival','gallery');
galleries[2] = new gallery(52674,'734118','The Ceremony','gallery');
galleries[3] = new gallery(16911,'184434','The Reception','gallery');
galleries[4] = new gallery(16912,'183758,183756','The Two of You  ','gallery');
galleries[5] = new gallery(52657,'688446','The Wedding Story','gallery');
galleries[6] = new gallery(56613,'734159','The Details','gallery');
galleries[7] = new gallery(17042,'185738,183757','Contemporary','gallery');
galleries[8] = new gallery(17044,'746562','On Location','gallery');

