/***************************************************************************
* 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('662479,615105,613759,613730,613428,613263');
	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('662479,615105,613759,613730,613428,613263');
	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 = 'Perrymanford 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(613740,'','FL02','','http://www3.clikpic.com/perrymanfordphotography/images/FL02web.jpg',358,500,'','http://www3.clikpic.com/perrymanfordphotography/images/FL02web_thumb.jpg',93, 130,0, 0,'','','Andrew Ford','','','');
photos[1] = new photo(614280,'47039','FL54','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL54web.jpg',450,450,'','http://www3.clikpic.com/perrymanfordphotography/images/FL54web_thumb.jpg',130, 130,0, 0,'','','Andrew Ford','','','');
photos[2] = new photo(614388,'47179','','section83576','http://www3.clikpic.com/perrymanfordphotography/images/R01web.jpg',358,500,'Before','http://www3.clikpic.com/perrymanfordphotography/images/R01web_thumb.jpg',93, 130,0, 0,'','','','','','');
photos[3] = new photo(613467,'47039','FL32','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL32web.jpg',450,450,'','http://www3.clikpic.com/perrymanfordphotography/images/FL32web_thumb.jpg',130, 130,0, 0,'','','Andrew Ford','','','');
photos[4] = new photo(614919,'47179','','section83576','http://www3.clikpic.com/perrymanfordphotography/images/R02web.jpg',358,500,'After','http://www3.clikpic.com/perrymanfordphotography/images/R02web_thumb.jpg',93, 130,0, 0,'','','','','','');
photos[5] = new photo(613463,'47039','FL31','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL31web.jpg',450,450,'','http://www3.clikpic.com/perrymanfordphotography/images/FL31web_thumb.jpg',130, 130,0, 0,'','','Andrew Ford','','','');
photos[6] = new photo(614920,'47179','','section83576','http://www3.clikpic.com/perrymanfordphotography/images/R03web.jpg',398,500,'Before','http://www3.clikpic.com/perrymanfordphotography/images/R03web_thumb.jpg',103, 130,0, 0,'','','','','','');
photos[7] = new photo(613469,'47039','FL27','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL27web2.jpg',450,450,'','http://www3.clikpic.com/perrymanfordphotography/images/FL27web2_thumb.jpg',130, 130,0, 0,'','','Andrew Ford','','','');
photos[8] = new photo(614921,'47179','','section83576','http://www3.clikpic.com/perrymanfordphotography/images/R04web.jpg',363,500,'After','http://www3.clikpic.com/perrymanfordphotography/images/R04web_thumb.jpg',94, 130,0, 0,'','','','','','');
photos[9] = new photo(613501,'47039','FL62','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL62web.jpg',450,450,'','http://www3.clikpic.com/perrymanfordphotography/images/FL62web_thumb.jpg',130, 130,0, 0,'','','Katie Perryman Ford','','','');
photos[10] = new photo(614938,'47179','','section83576','http://www3.clikpic.com/perrymanfordphotography/images/R07web.jpg',500,385,'Before','http://www3.clikpic.com/perrymanfordphotography/images/R07web_thumb.jpg',130, 100,0, 0,'','','','','','');
photos[11] = new photo(613505,'47039','FL40','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL40web.jpg',450,450,'','http://www3.clikpic.com/perrymanfordphotography/images/FL40web_thumb.jpg',130, 130,0, 0,'','','Andrew Ford','','','');
photos[12] = new photo(614939,'47179','','section83576','http://www3.clikpic.com/perrymanfordphotography/images/R08web.jpg',500,385,'After','http://www3.clikpic.com/perrymanfordphotography/images/R08web_thumb.jpg',130, 100,0, 0,'','','','','','');
photos[13] = new photo(613508,'47039','FL38.','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL38web.jpg',450,450,'','http://www3.clikpic.com/perrymanfordphotography/images/FL38web_thumb.jpg',130, 130,0, 0,'','','Andrew Ford','','','');
photos[14] = new photo(614936,'47179','','section83576','http://www3.clikpic.com/perrymanfordphotography/images/R05web.jpg',500,375,'Before','http://www3.clikpic.com/perrymanfordphotography/images/R05web_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[15] = new photo(614270,'47039','FL53','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL53web.jpg',450,450,'','http://www3.clikpic.com/perrymanfordphotography/images/FL53web_thumb.jpg',130, 130,0, 0,'','','Andrew Ford','','','');
photos[16] = new photo(614937,'47179','','section83576','http://www3.clikpic.com/perrymanfordphotography/images/R06web.jpg',500,375,'After','http://www3.clikpic.com/perrymanfordphotography/images/R06web_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[17] = new photo(614276,'47039','FL25','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL25-web.jpg',500,500,'','http://www3.clikpic.com/perrymanfordphotography/images/FL25-web_thumb.jpg',130, 130,0, 0,'','','Andrew Ford','','','');
photos[18] = new photo(613263,'47018','L02','gallery','http://www3.clikpic.com/perrymanfordphotography/images/L02web.jpg',500,358,'','http://www3.clikpic.com/perrymanfordphotography/images/L02web_thumb.jpg',130, 93,1, 0,'','','Andrew Ford','','','');
photos[19] = new photo(613514,'47042','FL01','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL01web.jpg',358,500,'','http://www3.clikpic.com/perrymanfordphotography/images/FL01web_thumb.jpg',93, 130,0, 0,'','','Andrew Ford','','','');
photos[20] = new photo(613228,'47018','L03','gallery','http://www3.clikpic.com/perrymanfordphotography/images/L03web.jpg',357,500,'','http://www3.clikpic.com/perrymanfordphotography/images/L03web_thumb.jpg',93, 130,0, 0,'','','Katie Perryman Ford','','','');
photos[21] = new photo(613690,'47042','FL42','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL42web.jpg',358,500,'','http://www3.clikpic.com/perrymanfordphotography/images/FL42web_thumb.jpg',93, 130,0, 0,'','','Andrew Ford','','','');
photos[22] = new photo(613694,'47042','FL16.','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL16web.jpg',358,500,'','http://www3.clikpic.com/perrymanfordphotography/images/FL16web_thumb.jpg',93, 130,0, 0,'','','Andrew Ford','','','');
photos[23] = new photo(638025,'47018','L23','gallery','http://www3.clikpic.com/perrymanfordphotography/images/L23web.jpg',358,500,'','http://www3.clikpic.com/perrymanfordphotography/images/L23web_thumb.jpg',93, 130,0, 0,'','','Katie Perryman Ford','','','');
photos[24] = new photo(638016,'47018','L04','gallery','http://www3.clikpic.com/perrymanfordphotography/images/L04web.jpg',358,500,'','http://www3.clikpic.com/perrymanfordphotography/images/L04web_thumb.jpg',93, 130,0, 0,'','','Andrew Ford','','','');
photos[25] = new photo(613266,'47018','L13','gallery','http://www3.clikpic.com/perrymanfordphotography/images/L13web.jpg',500,331,'','http://www3.clikpic.com/perrymanfordphotography/images/L13web_thumb.jpg',130, 86,0, 0,'','','Katie Perryman Ford','','','');
photos[26] = new photo(614287,'47042','FL04','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL04web.jpg',358,500,'','http://www3.clikpic.com/perrymanfordphotography/images/FL04web_thumb.jpg',93, 130,0, 0,'','','Andrew Ford','','','');
photos[27] = new photo(613268,'47018','L09','gallery','http://www3.clikpic.com/perrymanfordphotography/images/L09web.jpg',500,358,'','http://www3.clikpic.com/perrymanfordphotography/images/L09web_thumb.jpg',130, 93,0, 0,'','','Andrew Ford','','','');
photos[28] = new photo(613730,'47042','FL24','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL24web.jpg',500,500,'','http://www3.clikpic.com/perrymanfordphotography/images/FL24web_thumb.jpg',130, 130,1, 0,'','','Andrew Ford','','','');
photos[29] = new photo(613321,'47018','L10','gallery','http://www3.clikpic.com/perrymanfordphotography/images/L10web.jpg',500,358,'','http://www3.clikpic.com/perrymanfordphotography/images/L10web_thumb.jpg',130, 93,0, 0,'','','Andrew Ford','','','');
photos[30] = new photo(613324,'47018','L11','gallery','http://www3.clikpic.com/perrymanfordphotography/images/L11web.jpg',500,358,'','http://www3.clikpic.com/perrymanfordphotography/images/L11web_thumb.jpg',130, 93,0, 0,'','','Andrew Ford','','','');
photos[31] = new photo(614293,'47042','FL05','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL05web.jpg',353,500,'','http://www3.clikpic.com/perrymanfordphotography/images/FL05web_thumb.jpg',92, 130,0, 0,'','','Andrew Ford','','','');
photos[32] = new photo(614267,'47042','FL04','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL13web.jpg',500,358,'','http://www3.clikpic.com/perrymanfordphotography/images/FL13web_thumb.jpg',130, 93,0, 0,'','','Andrew Ford','','','');
photos[33] = new photo(638026,'47018','L17','gallery','http://www3.clikpic.com/perrymanfordphotography/images/L17web.jpg',500,328,'','http://www3.clikpic.com/perrymanfordphotography/images/L17web_thumb.jpg',130, 85,0, 0,'','','Andrew Ford','','','');
photos[34] = new photo(614268,'47042','FL20','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL20web.jpg',500,358,'','http://www3.clikpic.com/perrymanfordphotography/images/FL20web_thumb.jpg',130, 93,0, 0,'','','Andrew Ford','','','');
photos[35] = new photo(662479,'47042','FL67','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL67web.jpg',358,500,'','http://www3.clikpic.com/perrymanfordphotography/images/FL67web_thumb.jpg',93, 130,1, 0,'','','Andrew Ford','','','');
photos[36] = new photo(613428,'47033','FL63 mono.','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL63web.jpg',358,500,'','http://www3.clikpic.com/perrymanfordphotography/images/FL63web_thumb.jpg',93, 130,1, 0,'','','Andrew Ford','','','');
photos[37] = new photo(613759,'47106','FL48','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL48web.jpg',500,353,'','http://www3.clikpic.com/perrymanfordphotography/images/FL48web_thumb.jpg',130, 92,1, 0,'','','Andrew Ford','','','');
photos[38] = new photo(614305,'47115','L06','gallery','http://www3.clikpic.com/perrymanfordphotography/images/L06web.jpg',500,358,'','http://www3.clikpic.com/perrymanfordphotography/images/L06web_thumb.jpg',130, 93,0, 0,'','','Andrew Ford','','','');
photos[39] = new photo(614883,'47178','','section83576','http://www3.clikpic.com/perrymanfordphotography/images/S01web.jpg',500,358,'','http://www3.clikpic.com/perrymanfordphotography/images/S01web_thumb.jpg',130, 93,0, 0,'','','Andrew Ford','','','');
photos[40] = new photo(615105,'47193','','section83576','http://www3.clikpic.com/perrymanfordphotography/images/C01web.jpg',358,500,'','http://www3.clikpic.com/perrymanfordphotography/images/C01web_thumb.jpg',93, 130,1, 0,'','','Andrew Ford','','','');
photos[41] = new photo(613435,'47033','FL61 mono','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL61web.jpg',500,333,'','http://www3.clikpic.com/perrymanfordphotography/images/FL61web_thumb.jpg',130, 87,0, 0,'','','Andrew Ford','','','');
photos[42] = new photo(613761,'47106','FL49','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL49web.jpg',500,333,'','http://www3.clikpic.com/perrymanfordphotography/images/FL49web_thumb.jpg',130, 87,0, 0,'','','Andrew Ford','','','');
photos[43] = new photo(614306,'47115','L20','gallery','http://www3.clikpic.com/perrymanfordphotography/images/L20web.jpg',500,338,'','http://www3.clikpic.com/perrymanfordphotography/images/L20web_thumb.jpg',130, 88,0, 0,'','','Andrew Ford','','','');
photos[44] = new photo(614886,'47178','','section83576','http://www3.clikpic.com/perrymanfordphotography/images/S03web.jpg',358,500,'','http://www3.clikpic.com/perrymanfordphotography/images/S03web_thumb.jpg',93, 130,0, 0,'','','Andrew Ford','','','');
photos[45] = new photo(615106,'47193','','section83576','http://www3.clikpic.com/perrymanfordphotography/images/C02web.jpg',500,438,'','http://www3.clikpic.com/perrymanfordphotography/images/C02web_thumb.jpg',130, 114,0, 0,'','','Andrew Ford','','','');
photos[46] = new photo(613438,'47033','FL65 mono','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL65.jpg',353,500,'','http://www3.clikpic.com/perrymanfordphotography/images/FL65_thumb.jpg',92, 130,0, 0,'','','Andrew Ford','','','');
photos[47] = new photo(613763,'47106','FL51','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL51web.jpg',500,353,'','http://www3.clikpic.com/perrymanfordphotography/images/FL51web_thumb.jpg',130, 92,0, 0,'','','Andrew Ford','','','');
photos[48] = new photo(614309,'47115','L19','gallery','http://www3.clikpic.com/perrymanfordphotography/images/L19web.jpg',500,207,'','http://www3.clikpic.com/perrymanfordphotography/images/L19web_thumb.jpg',130, 54,0, 0,'','','Andrew Ford','','','');
photos[49] = new photo(615107,'47193','','section83576','http://www3.clikpic.com/perrymanfordphotography/images/C03web.jpg',500,360,'','http://www3.clikpic.com/perrymanfordphotography/images/C03web_thumb.jpg',130, 94,0, 0,'','','Andrew Ford','','','');
photos[50] = new photo(613439,'47033','L18 mono','gallery','http://www3.clikpic.com/perrymanfordphotography/images/L18web.jpg',500,333,'','http://www3.clikpic.com/perrymanfordphotography/images/L18web_thumb.jpg',130, 87,0, 0,'','','Katie Perryman Ford','','','');
photos[51] = new photo(613764,'47106','FL50','gallery','http://www3.clikpic.com/perrymanfordphotography/images/FL50web.jpg',500,353,'','http://www3.clikpic.com/perrymanfordphotography/images/FL50web_thumb.jpg',130, 92,0, 0,'','','Katie Perryman Ford','','','');
photos[52] = new photo(614310,'47115','T01','gallery','http://www3.clikpic.com/perrymanfordphotography/images/T01web.jpg',500,358,'','http://www3.clikpic.com/perrymanfordphotography/images/T01web_thumb.jpg',130, 93,0, 0,'','','Andrew Ford','','','');
photos[53] = new photo(613450,'47033','L16 mono','gallery','http://www3.clikpic.com/perrymanfordphotography/images/L16web.jpg',500,180,'','http://www3.clikpic.com/perrymanfordphotography/images/L16web_thumb.jpg',130, 47,0, 0,'','','Andrew Ford','','','');
photos[54] = new photo(614312,'47115','T02','gallery','http://www3.clikpic.com/perrymanfordphotography/images/T02web.jpg',358,500,'','http://www3.clikpic.com/perrymanfordphotography/images/T02web_thumb.jpg',93, 130,0, 0,'','','Andrew Ford','','','');
photos[55] = new photo(629800,'47193','','section83576','http://www3.clikpic.com/perrymanfordphotography/images/CO5web.jpg',500,357,'','http://www3.clikpic.com/perrymanfordphotography/images/CO5web_thumb.jpg',130, 93,0, 0,'','','','','','');
photos[56] = new photo(613453,'47033','L21 mono','gallery','http://www3.clikpic.com/perrymanfordphotography/images/L21web.jpg',500,181,'','http://www3.clikpic.com/perrymanfordphotography/images/L21web_thumb.jpg',130, 47,0, 0,'','','Andrew Ford','','','');
photos[57] = new photo(614313,'47115','T05','gallery','http://www3.clikpic.com/perrymanfordphotography/images/T05web.jpg',500,358,'','http://www3.clikpic.com/perrymanfordphotography/images/T05web_thumb.jpg',130, 93,0, 0,'','','Andrew Ford','','','');
photos[58] = new photo(614314,'47115','T04','gallery','http://www3.clikpic.com/perrymanfordphotography/images/T04web.jpg',358,500,'','http://www3.clikpic.com/perrymanfordphotography/images/T04web_thumb.jpg',93, 130,0, 0,'','','Katie Perryman Ford','','','');
photos[59] = new photo(614320,'47115','L22','gallery','http://www3.clikpic.com/perrymanfordphotography/images/L22web.jpg',500,386,'','http://www3.clikpic.com/perrymanfordphotography/images/L22web_thumb.jpg',130, 100,0, 0,'','','Katie Perryman Ford','','','');
photos[60] = new photo(629794,'47255','','section83576','http://www3.clikpic.com/perrymanfordphotography/images/PR5web1.jpg',353,500,'','http://www3.clikpic.com/perrymanfordphotography/images/PR5web1_thumb.jpg',92, 130,0, 0,'','','','','','');
photos[61] = new photo(616227,'47255','','section83576','http://www3.clikpic.com/perrymanfordphotography/images/PR3web.jpg',500,353,'','http://www3.clikpic.com/perrymanfordphotography/images/PR3web_thumb.jpg',130, 92,0, 0,'','','','','','');
photos[62] = new photo(620256,'47255','','section83576','http://www3.clikpic.com/perrymanfordphotography/images/PR4web.jpg',353,500,'','http://www3.clikpic.com/perrymanfordphotography/images/PR4web_thumb.jpg',92, 130,0, 0,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(46291,'662479,614293,614287,614280,614276,614270,614268,614267,613764,613763','Flowers','gallery');
galleries[1] = new gallery(47039,'614280,614276,614270,613508,613505,613501,613469,613467,613463','Flowers 1','gallery');
galleries[2] = new gallery(47179,'614939,614938,614937,614936,614921,614920,614919,614388','Restoration','section83576');
galleries[3] = new gallery(47042,'662479,614293,614287,614268,614267,613730,613694,613690,613514','Flowers 2','gallery');
galleries[4] = new gallery(47111,'638026,638025,638016,614320,614314,614313,614312,614310,614309,614306','Landscapes','gallery');
galleries[5] = new gallery(47018,'638026,638025,638016,613324,613321,613268,613266,613263,613228','Sunsets','gallery');
galleries[6] = new gallery(47033,'613453,613450,613439,613438,613435,613428','Black and white','gallery');
galleries[7] = new gallery(47193,'629800,615107,615106,615105','Commercial','section83576');
galleries[8] = new gallery(47106,'613764,613763,613761,613759','Flowers 3','gallery');
galleries[9] = new gallery(47178,'614886,614883','Social photography','section83576');
galleries[10] = new gallery(47115,'614320,614314,614313,614312,614310,614309,614306,614305','Water, sky and trees','gallery');
galleries[11] = new gallery(47255,'629794,620256,616227','Printing','section83576');


