/***************************************************************************
* 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('3274324,3274226,3274200,3274156,3274080,3273962,3273783,3273356,3273041,3272973,3270717,3270316,3270295,3269973,3220629');
	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('3274324,3274226,3274200,3274156,3274080,3273962,3273783,3273356,3273041,3272973,3270717,3270316,3270295,3269973,3220629');
	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 = 'Alex Relph. sculpture - metalwork- design: ' + 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(3269926,'196747','','gallery','http://www2.clikpic.com/alexrelph/images/barnbalustrade1.jpg',369,492,'','http://www2.clikpic.com/alexrelph/images/barnbalustrade1_thumb.jpg',130, 130,0, 0,'Balustrade for barn conversion.<br>\r\nPowder coated steel.<br>\r\nGuide price from £500 per mtre','','','','','');
photos[1] = new photo(3269933,'196763','','gallery','http://www2.clikpic.com/alexrelph/images/birdrailing1.jpg',480,360,'','http://www2.clikpic.com/alexrelph/images/birdrailing1_thumb.jpg',130, 130,0, 0,'Railings for housing improvement scheme with flying bird motifs in east london.<br>\r\nGalvanised steel.','','','','','');
photos[2] = new photo(3269962,'196748','','gallery','http://www2.clikpic.com/alexrelph/images/camberwellgazebo.jpg',364,500,'','http://www2.clikpic.com/alexrelph/images/camberwellgazebo_thumb.jpg',130, 130,0, 1,'Camberwell Gazebo.<br>\r\nGalvanised / painted steel, timber and lead.<br>\r\nprivate commission.','','','','','');
photos[3] = new photo(3269973,'196748','','gallery','http://www2.clikpic.com/alexrelph/images/chelseagazebo1.jpg',400,488,'','http://www2.clikpic.com/alexrelph/images/chelseagazebo1_thumb.jpg',130, 130,1, 0,'Chelsea Gazebo.<br>\r\nGalvanised steel.<br>\r\nPrivate commission.','','','','','');
photos[4] = new photo(3269988,'196748','','gallery','http://www2.clikpic.com/alexrelph/images/chelseapergola1.jpg',500,349,'','http://www2.clikpic.com/alexrelph/images/chelseapergola1_thumb.jpg',130, 130,0, 0,'Pergola and planters.<br>\r\nGalvanised treated steel and stainless steel.<br>\r\nAt the RHS Chelsea Flower Show.','','','','','');
photos[5] = new photo(3270003,'196748','','gallery','http://www2.clikpic.com/alexrelph/images/cheynewalkpergola1.jpg',337,420,'','http://www2.clikpic.com/alexrelph/images/cheynewalkpergola1_thumb.jpg',130, 130,0, 0,'Pergola and balustrade.<br>\r\nGalvanised treated steel.<br>\r\nCommission for Collett Zarzycki Ltd Architects for private house in Cheyne Walk, Chelsea.','','','','','');
photos[6] = new photo(3270045,'196747','','gallery','http://www2.clikpic.com/alexrelph/images/chiswickgate1.jpg',337,400,'','http://www2.clikpic.com/alexrelph/images/chiswickgate1_thumb.jpg',130, 130,0, 0,'Front gate.<br>\r\nGalvanised steel.<br>\r\nPrivate commission.<br>\r\nGuide price from £500','','','','','');
photos[7] = new photo(3270063,'196747','','gallery','http://www2.clikpic.com/alexrelph/images/chiswicklowrailing1.jpg',492,369,'','http://www2.clikpic.com/alexrelph/images/chiswicklowrailing1_thumb.jpg',130, 130,0, 0,'Low railing.<br>\r\nGalvanised steel.<br>\r\nPrivate commission.','','','','','');
photos[8] = new photo(3270427,'196775','','gallery','http://www2.clikpic.com/alexrelph/images/eastleawallpanels1.jpg',400,500,'','http://www2.clikpic.com/alexrelph/images/eastleawallpanels1_thumb.jpg',130, 130,0, 0,'8 decorative wall panels for exterior walls of Eastlea School, East London.<br>\r\nDesigned in conjunction with an art project by school pupils. <br>\r\nThey also attended my workshop during fabrication.<br>\r\nGalvanised and powder coated steel and stainless steel.<br>\r\n150 x 150 cm','','','','','');
photos[9] = new photo(3270566,'196775','','gallery','http://www2.clikpic.com/alexrelph/images/eastleawallpanels22.jpg',354,500,'','http://www2.clikpic.com/alexrelph/images/eastleawallpanels22_thumb.jpg',130, 130,0, 0,'8 decorative wall panels for exterior walls of Eastlea School, East London.<br>\r\nDesigned in conjunction with an art project by school pupils. <br>\r\nThey also attended my workshop during fabrication.<br>\r\nGalvanised and powder coated steel and stainless steel.<br>\r\n150 x 150 cm','','','','','');
photos[10] = new photo(3270683,'196775','','gallery','http://www2.clikpic.com/alexrelph/images/exninggates1.jpg',400,524,'','http://www2.clikpic.com/alexrelph/images/exninggates1_thumb.jpg',130, 130,0, 0,'Railings and gates as part of community redevelopment scheme in East London. <br>\r\nCommissioned by local residents and funded by New Deal for Communities.<br>\r\nZinc sprayed and powder coated steel.','','','','','');
photos[11] = new photo(3270709,'196775','','gallery','http://www2.clikpic.com/alexrelph/images/exningrailing1.jpg',500,296,'','http://www2.clikpic.com/alexrelph/images/exningrailing1_thumb.jpg',130, 130,0, 1,'Railings and gates as part of community redevelopment scheme in East London. <br>\r\nCommissioned by local residents and funded by New Deal for Communities.<br>\r\nZinc sprayed and powder coated steel.','','','','','');
photos[12] = new photo(3270711,'196775','','gallery','http://www2.clikpic.com/alexrelph/images/exningrailingandgates1.jpg',500,267,'','http://www2.clikpic.com/alexrelph/images/exningrailingandgates1_thumb.jpg',130, 130,0, 0,'Railings and gates as part of community redevelopment scheme in East London. <br>\r\nCommissioned by local residents and funded by New Deal for Communities.<br>\r\nZinc sprayed and powder coated steel.','','','','','');
photos[13] = new photo(3270717,'196775','','gallery','http://www2.clikpic.com/alexrelph/images/exningrailingcloseup1.jpg',500,366,'','http://www2.clikpic.com/alexrelph/images/exningrailingcloseup1_thumb.jpg',130, 130,1, 0,'Railings and gates as part of community redevelopment scheme in East London. <br>\r\nCommissioned by local residents and funded by New Deal for Communities.<br>\r\nZinc sprayed and powder coated steel.','','','','','');
photos[14] = new photo(3272973,'196748','','gallery','http://www2.clikpic.com/alexrelph/images/bubblescreen1.jpg',295,500,'','http://www2.clikpic.com/alexrelph/images/bubblescreen1_thumb.jpg',130, 130,1, 0,'Bubble screen.<br>\r\nGalvanised steel.<br>\r\nGuide price from £250 per sq mtre.','','','','','');
photos[15] = new photo(3273037,'196748','','gallery','http://www2.clikpic.com/alexrelph/images/fruitcage1.jpg',400,399,'','http://www2.clikpic.com/alexrelph/images/fruitcage1_thumb.jpg',130, 130,0, 0,'Fruitcage.<br>\r\nOctagonal structure with 8 individually <br>\r\nopening doors to ease picking.<br>\r\nGalvanised / painted steel and nylon netting.<br>\r\nPrivate commission.','','','','','');
photos[16] = new photo(3273040,'196747','','gallery','http://www2.clikpic.com/alexrelph/images/gerrardscrossdoublegates1.jpg',500,333,'','http://www2.clikpic.com/alexrelph/images/gerrardscrossdoublegates1_thumb.jpg',130, 130,0, 0,'Gates for modern house in Gerrards Cross<br>\r\ncommissioned through Danielle Davies at Greenscheme.<br>\r\nGalvanised and powder coated steel.','','','','','');
photos[17] = new photo(3273041,'196747','','gallery','http://www2.clikpic.com/alexrelph/images/gerrardscrossgate1.jpg',427,384,'','http://www2.clikpic.com/alexrelph/images/gerrardscrossgate1_thumb.jpg',130, 130,1, 0,'Gates for modern house in Gerrards Cross<br>\r\ncommissioned through Danielle Davies at Greenscheme.<br>\r\nGalvanised and powder coated steel.','','','','','');
photos[18] = new photo(3273060,'196747','','gallery','http://www2.clikpic.com/alexrelph/images/glassbalustrade1.jpg',500,389,'','http://www2.clikpic.com/alexrelph/images/glassbalustrade1_thumb.jpg',130, 130,0, 0,'Balustrade.<br>\r\nNickel plated steel and glass.<br>\r\nPart of private commission <br>\r\nalso including screens and doors.','','','','','');
photos[19] = new photo(3273082,'196747','','gallery','http://www2.clikpic.com/alexrelph/images/greenpointgrills1.jpg',500,263,'','http://www2.clikpic.com/alexrelph/images/greenpointgrills1_thumb.jpg',130, 130,0, 0,'Security grills.<br>\r\nInternally mounted grills for offices <br>\r\nof Greenpoint Films.<br>\r\nPolished and waxed steel.<br>\r\nGuide price from £250 per sq mtre.','','','','','');
photos[20] = new photo(3273087,'196747','','gallery','http://www2.clikpic.com/alexrelph/images/grilldetail1.jpg',500,325,'','http://www2.clikpic.com/alexrelph/images/grilldetail1_thumb.jpg',130, 130,0, 0,'Grill detail.<br>\r\nZinc sprayed steel.','','','','','');
photos[21] = new photo(3273117,'196747','','gallery','http://www2.clikpic.com/alexrelph/images/leafbalustrade1.jpg',369,492,'','http://www2.clikpic.com/alexrelph/images/leafbalustrade1_thumb.jpg',130, 130,0, 1,'Balustrade.<br>\r\nAbstract leaf design balustrade for <br>\r\nbarn conversion.<br>\r\nPowder coated steel.<br>\r\nGuide price from £350 per sq mtre.','','','','','');
photos[22] = new photo(3273124,'198020','','gallery','http://www2.clikpic.com/alexrelph/images/lettsombalustrade1.jpg',492,369,'','http://www2.clikpic.com/alexrelph/images/lettsombalustrade1_thumb.jpg',130, 130,0, 1,'Railings, balustrade and anti-missile screens <br>\r\nfor railway foot bridge improvement scheme <br>\r\nin Plaistow, London. <br>\r\nCommissioned by London Borough of Newham.<br>\r\nZinc sprayed/galvanised and painted steel <br>\r\nto railtrack specifications.','','','','','');
photos[23] = new photo(3273126,'198020','','gallery','http://www2.clikpic.com/alexrelph/images/lettsomfootbridge1.jpg',492,369,'','http://www2.clikpic.com/alexrelph/images/lettsomfootbridge1_thumb.jpg',130, 130,0, 0,'Railings, balustrade and anti-missile screens <br>\r\nfor railway foot bridge improvement scheme <br>\r\nin Plaistow, London. <br>\r\nCommissioned by London Borough of Newham.<br>\r\nZinc sprayed/galvanised and painted steel <br>\r\nto railtrack specifications.','','','','','');
photos[24] = new photo(3273128,'198020','','gallery','http://www2.clikpic.com/alexrelph/images/lettsomrailing1.jpg',492,369,'','http://www2.clikpic.com/alexrelph/images/lettsomrailing1_thumb.jpg',130, 130,0, 0,'Railings, balustrade and anti-missile screens <br>\r\nfor railway foot bridge improvement scheme <br>\r\nin Plaistow, London. <br>\r\nCommissioned by London Borough of Newham.<br>\r\nZinc sprayed/galvanised and painted steel <br>\r\nto railtrack specifications.','','','','','');
photos[25] = new photo(3273131,'198020','','gallery','http://www2.clikpic.com/alexrelph/images/lettsomscreens1.jpg',492,369,'','http://www2.clikpic.com/alexrelph/images/lettsomscreens1_thumb.jpg',130, 130,0, 0,'Railings, balustrade and anti-missile screens <br>\r\nfor railway foot bridge improvement scheme <br>\r\nin Plaistow, London. <br>\r\nCommissioned by London Borough of Newham.<br>\r\nZinc sprayed/galvanised and painted steel <br>\r\nto railtrack specifications.','','','','','');
photos[26] = new photo(3273134,'198046','','gallery','http://www2.clikpic.com/alexrelph/images/loddonarch1.jpg',437,323,'','http://www2.clikpic.com/alexrelph/images/loddonarch1_thumb.jpg',130, 130,0, 0,'Entrance arch for Loddon Business Centre, Basingstoke.<br>\r\nCor-ten steel and stainless steel.','','','','','');
photos[27] = new photo(3273136,'196747','','gallery','http://www2.clikpic.com/alexrelph/images/malthousegate1.jpg',400,500,'','http://www2.clikpic.com/alexrelph/images/malthousegate1_thumb.jpg',130, 130,0, 0,'Garden Gate.<br>\r\nGalvanised steel.<br>\r\nPrivate commission.<br>\r\nGuide price from £800','','','','','');
photos[28] = new photo(3273141,'196748','','gallery','http://www2.clikpic.com/alexrelph/images/malthouseplanters1.jpg',500,375,'','http://www2.clikpic.com/alexrelph/images/malthouseplanters1_thumb.jpg',130, 130,0, 0,'Planters.<br>\r\nGalvanised steel.<br>\r\nPrivate commission designed to <br>\r\nmatch balustrade.<br>\r\nGuide price from £250','','','','','');
photos[29] = new photo(3273356,'198049','','gallery','http://www2.clikpic.com/alexrelph/images/memorialfence1.jpg',500,468,'','http://www2.clikpic.com/alexrelph/images/memorialfence1_thumb.jpg',130, 130,1, 0,'Gates and railings for 2 entrances at Memorial Park, West Ham, commissioned by MUF Architecture/Art LLP funded by New Deal for Communities.<br>\r\nZinc sprayed and powder coated steel, galvanised steel, stainless steel and bronze.','','','','','');
photos[30] = new photo(3273393,'198049','','gallery','http://www2.clikpic.com/alexrelph/images/memorialgate1.jpg',500,373,'','http://www2.clikpic.com/alexrelph/images/memorialgate1_thumb.jpg',130, 130,0, 0,'Gates and railings for 2 entrances at Memorial Park, West Ham, commissioned by MUF Architecture/Art LLP funded by New Deal for Communities.<br>\r\nZinc sprayed and powder coated steel, galvanised steel, stainless steel and bronze.','','','','','');
photos[31] = new photo(3273406,'198049','','gallery','http://www2.clikpic.com/alexrelph/images/memorialhamilton1.jpg',500,357,'','http://www2.clikpic.com/alexrelph/images/memorialhamilton1_thumb.jpg',130, 130,0, 0,'Gates and railings for 2 entrances at Memorial Park, West Ham, commissioned by MUF Architecture/Art LLP funded by New Deal for Communities.<br>\r\nZinc sprayed and powder coated steel, galvanised steel, stainless steel and bronze.','','','','','');
photos[32] = new photo(3273413,'198049','','gallery','http://www2.clikpic.com/alexrelph/images/memorialpark1.jpg',500,307,'','http://www2.clikpic.com/alexrelph/images/memorialpark1_thumb.jpg',130, 130,0, 0,'Gates and railings for 2 entrances at Memorial Park, West Ham, commissioned by MUF Architecture/Art LLP funded by New Deal for Communities.<br>\r\nZinc sprayed and powder coated steel, galvanised steel, stainless steel and bronze.','','','','','');
photos[33] = new photo(3273726,'198049','','gallery','http://www2.clikpic.com/alexrelph/images/memorialsign1.jpg',302,500,'','http://www2.clikpic.com/alexrelph/images/memorialsign1_thumb.jpg',130, 130,0, 1,'Gates and railings for 2 entrances at Memorial Park, West Ham, commissioned by MUF Architecture/Art LLP funded by New Deal for Communities.<br>\r\nZinc sprayed and powder coated steel, galvanised steel, stainless steel and bronze.','','','','','');
photos[34] = new photo(3273749,'196747','','gallery','http://www2.clikpic.com/alexrelph/images/millstaircase1.jpg',400,533,'','http://www2.clikpic.com/alexrelph/images/millstaircase1_thumb.jpg',130, 130,0, 0,'Staircase for Mill conversion<br>\r\ncommissioned by Bruges Tozer Architects.<br>\r\nPowder coated steel.','','','','','');
photos[35] = new photo(3273783,'196747','','gallery','http://www2.clikpic.com/alexrelph/images/millstaircase21.jpg',492,369,'','http://www2.clikpic.com/alexrelph/images/millstaircase21_thumb.jpg',130, 130,1, 0,'Balustrade for staircase.<br>\r\nPowder coated steel.<br>\r\nPrivate commission including <br>\r\nmatching screen room dividers.','','','','','');
photos[36] = new photo(3273833,'196748','','gallery','http://www2.clikpic.com/alexrelph/images/obelisk1.jpg',232,370,'','http://www2.clikpic.com/alexrelph/images/obelisk1_thumb.jpg',130, 130,0, 0,'Obelisk<br>\r\nGalvanised steel and glass.<br>\r\nAvailable to commission from £600','','','','','');
photos[37] = new photo(3273921,'196748','','gallery','http://www2.clikpic.com/alexrelph/images/pondgrills1.jpg',400,505,'','http://www2.clikpic.com/alexrelph/images/pondgrills1_thumb.jpg',130, 130,0, 0,'Pond grills.<br>\r\nGalvanised steel.<br>\r\nPrivate commission.','','','','','');
photos[38] = new photo(3273947,'196762','','gallery','http://www2.clikpic.com/alexrelph/images/portwaygates1.jpg',500,375,'','http://www2.clikpic.com/alexrelph/images/portwaygates1_thumb.jpg',130, 130,0, 1,'Railings and entrance gates for Portway Primary School,as part of school <br>\r\nimprovement scheme.<br>\r\nCommissioned by London Borough of Newham.<br>\r\nZinc sprayed and powder coated steel.','','','','','');
photos[39] = new photo(3273962,'196762','','gallery','http://www2.clikpic.com/alexrelph/images/portwayprimaryrailing1.jpg',500,332,'','http://www2.clikpic.com/alexrelph/images/portwayprimaryrailing1_thumb.jpg',130, 130,1, 0,'Railings and entrance gates for Portway Primary School,as part of school <br>\r\nimprovement scheme.<br>\r\nCommissioned by London Borough of Newham.<br>\r\nZinc sprayed and powder coated steel.','','','','','');
photos[40] = new photo(3273966,'196762','','gallery','http://www2.clikpic.com/alexrelph/images/portwayrailing3.jpg',349,500,'','http://www2.clikpic.com/alexrelph/images/portwayrailing3_thumb.jpg',130, 130,0, 0,'Railings and entrance gates for Portway Primary School,as part of school <br>\r\nimprovement scheme.<br>\r\nCommissioned by London Borough of Newham.<br>\r\nZinc sprayed and powder coated steel.','','','','','');
photos[41] = new photo(3274122,'196747','','gallery','http://www2.clikpic.com/alexrelph/images/richmondbalustrade2.jpg',500,345,'','http://www2.clikpic.com/alexrelph/images/richmondbalustrade2_thumb.jpg',130, 130,0, 0,'Garden balustrade.<br>\r\nPrivate commission for house in Richmond<br>\r\nmade with matching pergola.<br>\r\nZinc sprayed and powder coated steel.','','','','','');
photos[42] = new photo(3274125,'196748','','gallery','http://www2.clikpic.com/alexrelph/images/richmondpergola1.jpg',388,500,'','http://www2.clikpic.com/alexrelph/images/richmondpergola1_thumb.jpg',130, 130,0, 0,'Garden pergola.<br>\r\nPrivate commission for house in Richmond<br>\r\nmade with matching balustrade.<br>\r\nZinc sprayed and powder coated steel.','','','','','');
photos[43] = new photo(3274178,'196747','','gallery','http://www2.clikpic.com/alexrelph/images/securitygate1.jpg',400,500,'','http://www2.clikpic.com/alexrelph/images/securitygate1_thumb.jpg',130, 130,0, 0,'Security gate.<br>\r\nAcid etched steel.<br>\r\nPrivate commission.','','','','','');
photos[44] = new photo(3274232,'196748','','gallery','http://www2.clikpic.com/alexrelph/images/trelliscloseup1.jpg',314,500,'','http://www2.clikpic.com/alexrelph/images/trelliscloseup1_thumb.jpg',130, 130,0, 0,'Pergola trellis close up.<br>\r\nGalvanised steel.','','','','','');
photos[45] = new photo(3270268,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/dancer1.jpg',405,500,'','http://www2.clikpic.com/alexrelph/images/dancer1_thumb.jpg',130, 130,0, 0,'Dancer.<br>\r\nMild steel.<br>\r\n30 x 30 x 80 cm.','','','','','');
photos[46] = new photo(3270295,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/disco2.jpg',315,500,'','http://www2.clikpic.com/alexrelph/images/disco2_thumb.jpg',130, 130,1, 0,'Disco<br>\r\nMild steel.<br>\r\n40 x 40 x 90 cm.','','','','','');
photos[47] = new photo(3273047,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/gesture2.jpg',375,500,'','http://www2.clikpic.com/alexrelph/images/gesture2_thumb.jpg',130, 130,0, 0,'Gesture.<br>\r\nZinc sprayed steel.<br>\r\n40 x 40 x 150 cm','','','','','');
photos[48] = new photo(3273094,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/jazz1.jpg',400,500,'','http://www2.clikpic.com/alexrelph/images/jazz1_thumb.jpg',130, 130,0, 0,'Jazz.<br>\r\nMild steel.<br>\r\n16 x 16 x 55 cm.','','','','','');
photos[49] = new photo(3273102,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/jive2.jpg',335,500,'','http://www2.clikpic.com/alexrelph/images/jive2_thumb.jpg',130, 130,0, 0,'Jive.<br>\r\nWaxed mild steel.<br>\r\n20 x 20 x 40 cm.','','','','','');
photos[50] = new photo(3273739,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/millsculpture1.jpg',500,375,'','http://www2.clikpic.com/alexrelph/images/millsculpture1_thumb.jpg',130, 130,0, 0,'Relief sculpture for exterior wall of Mill conversion.<br>\r\nGalvanised steel and cast iron.','','','','','');
photos[51] = new photo(3274080,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/reachout1.jpg',334,500,'','http://www2.clikpic.com/alexrelph/images/reachout1_thumb.jpg',130, 130,1, 0,'Reach out.<br>\r\nMild steel.<br>\r\n40 x 40 x 180 cm.','','','','','');
photos[52] = new photo(3274086,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/reflex1.jpg',305,500,'','http://www2.clikpic.com/alexrelph/images/reflex1_thumb.jpg',130, 130,0, 0,'Reflex.<br>\r\nZinc sprayed steel.<br>\r\n30 x 20 x 180 inc base.','','','','','');
photos[53] = new photo(3274092,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/resonance2.jpg',333,500,'','http://www2.clikpic.com/alexrelph/images/resonance2_thumb.jpg',130, 130,0, 0,'Resonance.<br>\r\nZinc sprayed steel.<br>\r\n60 x 50 x 185 cm.','','','','','');
photos[54] = new photo(3274156,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/ringdance3.jpg',375,500,'','http://www2.clikpic.com/alexrelph/images/ringdance3_thumb.jpg',130, 130,1, 0,'Ring-dance.<br>\r\nZinc primed and powder coated steel.<br>\r\n50 x 50 x 180 cm.','','','','','');
photos[55] = new photo(3274161,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/ringdance21.jpg',319,500,'','http://www2.clikpic.com/alexrelph/images/ringdance21_thumb.jpg',130, 130,0, 0,'Gyrate.<br>\r\nMild steel.<br>\r\n50 x 50 x 200 cm.','','','','','');
photos[56] = new photo(3274171,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/ringdancestudio.jpg',368,500,'','http://www2.clikpic.com/alexrelph/images/ringdancestudio_thumb.jpg',130, 130,0, 0,'Ring-dance.<br>\r\nZinc primed and powder coated steel.<br>\r\n50 x 50 x 180 cm.','','','','','');
photos[57] = new photo(3274176,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/rythm2.jpg',357,500,'','http://www2.clikpic.com/alexrelph/images/rythm2_thumb.jpg',130, 130,0, 0,'Rythm.<br>\r\nZinc sprayed and bronzed steel.<br>\r\n60 x 60 x 180 cm.','','','','','');
photos[58] = new photo(3274196,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/spring2.jpg',395,500,'','http://www2.clikpic.com/alexrelph/images/spring2_thumb.jpg',130, 130,0, 1,'Spring.<br>\r\nWaxed mild steel.<br>\r\n20 x 20 x 80 cm.','','','','','');
photos[59] = new photo(3274199,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/stretch1.jpg',400,509,'','http://www2.clikpic.com/alexrelph/images/stretch1_thumb.jpg',130, 130,0, 0,'Stretch.<br>\r\nZinc sprayed steel.<br>\r\n40 x 50 x 200 cm.','','','','','');
photos[60] = new photo(3274207,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/symphony1.jpg',333,500,'','http://www2.clikpic.com/alexrelph/images/symphony1_thumb.jpg',130, 130,0, 0,'Symphony.<br>\r\nZinc sprayed and bronzed steel.<br>\r\n80 x 60 x 200 cm','','','','','');
photos[61] = new photo(3274213,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/totem1.jpg',333,500,'','http://www2.clikpic.com/alexrelph/images/totem1_thumb.jpg',130, 122,0, 0,'Totem.<br>\r\nMild steel.<br>\r\n35 x 30 x 90 cm.','','','','','');
photos[62] = new photo(3274259,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/twirl2.jpg',321,500,'','http://www2.clikpic.com/alexrelph/images/twirl2_thumb.jpg',130, 130,0, 0,'Twirl.<br>\r\nZinc and bronze sprayed steel.<br>\r\n50 x 40 x 185 cm.','','','','','');
photos[63] = new photo(3274263,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/twist1.jpg',333,500,'','http://www2.clikpic.com/alexrelph/images/twist1_thumb.jpg',130, 130,0, 0,'Twist.<br>\r\nMild steel.<br>\r\n16 x 16 x 45 cm.','','','','','');
photos[64] = new photo(3274333,'196736','','gallery','http://www2.clikpic.com/alexrelph/images/gymnastic.jpg',323,500,'','http://www2.clikpic.com/alexrelph/images/gymnastic_thumb.jpg',130, 123,0, 0,'Gymnastic.<br>\r\nMild steel.<br>\r\n30 x 40 x 90 cm','','','','','');
photos[65] = new photo(3220629,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/angelchairs.jpg',500,352,'','http://www2.clikpic.com/alexrelph/images/angelchairs_thumb.jpg',130, 130,1, 0,'Angel Chairs.<br>\r\nWaxed steel.<br>\r\nOriginally commissioned as set of 13 <br>\r\nwith matching dining table.<br>\r\nAvailable to commission,<br>\r\nfrom £250 each.','','','','','');
photos[66] = new photo(3269865,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/avalonchair2.jpg',323,420,'','http://www2.clikpic.com/alexrelph/images/avalonchair2_thumb.jpg',130, 130,0, 0,'Avalon garden chair <br>\r\nZinc sprayed and powder coated steel.<br>\r\nAvailable to commission from £300','','','','','');
photos[67] = new photo(3269883,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/avalontable1.jpg',500,348,'','http://www2.clikpic.com/alexrelph/images/avalontable1_thumb.jpg',130, 130,0, 0,'Avalon dining table<br>\r\nZinc sprayed / powder coated steel and glass<br>\r\nAvailable to commission from £1150','','','','','');
photos[68] = new photo(3269893,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/avoncliffetable1.jpg',500,340,'','http://www2.clikpic.com/alexrelph/images/avoncliffetable1_thumb.jpg',130, 130,0, 0,'Avoncliffe dining table.<br>\r\nZinc sprayed steel and glass.<br>\r\nAvailable to commission from £1150.','','','','','');
photos[69] = new photo(3269908,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/barcelonatableandchair1.jpg',417,400,'','http://www2.clikpic.com/alexrelph/images/barcelonatableandchair1_thumb.jpg',130, 130,0, 0,'Barcelona table and chair.<br>\r\nWaxed steel, oak and glass.<br>\r\nAvailable to commission; table from £400, chair from £220','','','','','');
photos[70] = new photo(3270236,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/clockandchair.jpg',292,420,'','http://www2.clikpic.com/alexrelph/images/clockandchair_thumb.jpg',130, 130,0, 0,'Grandfather clock and chair','','','','','');
photos[71] = new photo(3270239,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/curvybench1.jpg',500,348,'','http://www2.clikpic.com/alexrelph/images/curvybench1_thumb.jpg',130, 130,0, 0,'Curvy garden bench.<br>\r\nzinc sprayed and powder coated steel.<br>\r\nAvailable to commission from £700','','','','','');
photos[72] = new photo(3270316,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/doublebed1.jpg',500,357,'','http://www2.clikpic.com/alexrelph/images/doublebed1_thumb.jpg',130, 130,1, 0,'Double Bed.<br>\r\nMild steel and oak.<br>\r\nAvailable to commission from £600','','','','','');
photos[73] = new photo(3273021,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/fishtableandchairs4.jpg',350,504,'','http://www2.clikpic.com/alexrelph/images/fishtableandchairs4_thumb.jpg',130, 130,0, 0,'Fish table and chairs. <br>\r\nOriginally made as part of exhibition <br>\r\n\"Fish\" at Six Chapel Row Gallery.<br>\r\nElectro plated steel and iroko.','','','','','');
photos[74] = new photo(3273073,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/grandfatherclock1.jpg',272,450,'','http://www2.clikpic.com/alexrelph/images/grandfatherclock1_thumb.jpg',130, 130,0, 0,'Grandfather Clock.<br>\r\nMild steel and plaster.<br>\r\nguide price £800','','','','','');
photos[75] = new photo(3273851,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/odeonarmchair1.jpg',391,430,'','http://www2.clikpic.com/alexrelph/images/odeonarmchair1_thumb.jpg',130, 130,0, 0,'Odeon armchair<br>\r\nMild steel and upholstery.<br>\r\nAvailable to commission from £850.','','','','','');
photos[76] = new photo(3273864,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/odeondiningchair1.jpg',387,400,'','http://www2.clikpic.com/alexrelph/images/odeondiningchair1_thumb.jpg',130, 130,0, 0,'Odeon dining chair.<br>\r\nmild steel and upholstery.<br>\r\nAvailable to commission from £300','','','','','');
photos[77] = new photo(3273878,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/orchardtableandchairs1.jpg',500,324,'','http://www2.clikpic.com/alexrelph/images/orchardtableandchairs1_thumb.jpg',130, 130,0, 0,'Odeon garden table and chairs.<br>\r\nPainted steel and oak.<br>\r\nPrivate commission for orchard.','','','','','');
photos[78] = new photo(3273891,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/orionbench1.jpg',314,230,'','http://www2.clikpic.com/alexrelph/images/orionbench1_thumb.jpg',130, 130,0, 0,'Orion garden bench.<br>\r\nZinc sprayed and powder coated steel.<br>\r\nAvailable to commission from £750','','','','','');
photos[79] = new photo(3273899,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/orionchair1.jpg',337,420,'','http://www2.clikpic.com/alexrelph/images/orionchair1_thumb.jpg',130, 130,0, 0,'Orion garden chair.<br>\r\nZinc sprayed and powder coated steel.<br>\r\nAvailable to commission from £300.','','','','','');
photos[80] = new photo(3273910,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/orionset1.jpg',500,357,'','http://www2.clikpic.com/alexrelph/images/orionset1_thumb.jpg',130, 130,0, 0,'Orion garden set.<br>\r\nBench,table and chairs.<br>\r\nPrivate commission for pation','','','','','');
photos[81] = new photo(3273915,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/oriontableoutdoor1.jpg',500,392,'','http://www2.clikpic.com/alexrelph/images/oriontableoutdoor1_thumb.jpg',130, 130,0, 1,'Orion dining table and chair.<br>\r\nZinc sprayed steel and glass.<br>\r\nAvailable to commission from <br>\r\ntable - £1195, chair - £300','','','','','');
photos[82] = new photo(3274185,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/sofabench1.jpg',492,369,'','http://www2.clikpic.com/alexrelph/images/sofabench1_thumb.jpg',130, 130,0, 0,'Odeon garden bench.<br>\r\nZinc sprayed and powder coated steel.<br>\r\nAvailable to commission from £750.','','','','','');
photos[83] = new photo(3274200,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/swanbench1.jpg',291,400,'','http://www2.clikpic.com/alexrelph/images/swanbench1_thumb.jpg',130, 130,1, 0,'Swan garden bench.<br>\r\nzinc sprayed and powder coated steel.<br>\r\nAvailable to commission from £850.','','','','','');
photos[84] = new photo(3274202,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/swingbench1.jpg',500,367,'','http://www2.clikpic.com/alexrelph/images/swingbench1_thumb.jpg',130, 130,0, 1,'Swing bench.<br>\r\nStainless steel and oak.<br>\r\nAvailable to commission from £2500','','','','','');
photos[85] = new photo(3274211,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/tableinrain1.jpg',500,402,'','http://www2.clikpic.com/alexrelph/images/tableinrain1_thumb.jpg',130, 130,0, 0,'Dining table in the rain.<br>\r\nScrap mild steel.<br>\r\nGuide price-£1195','','','','','');
photos[86] = new photo(3274226,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/treebench1.jpg',277,368,'','http://www2.clikpic.com/alexrelph/images/treebench1_thumb.jpg',130, 130,1, 0,'Bench.<br>\r\nPrivate commission for bench around <br>\r\nlarge Yew tree.<br>\r\nGalvanised and powder coated steel.<br>\r\nGuide price-£1100.','','','','','');
photos[87] = new photo(3274324,'196737','','gallery','http://www2.clikpic.com/alexrelph/images/arbourseat.jpg',344,447,'','http://www2.clikpic.com/alexrelph/images/arbourseat_thumb.jpg',130, 130,1, 0,'Arbour garden seat.<br>\r\nGalvanised steel,glass and oak.<br>\r\nAvailable to commission from £1150','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(196747,'3273117','Architectural Metalwork','gallery');
galleries[1] = new gallery(196775,'3270709','Eastlea redevelopment','gallery');
galleries[2] = new gallery(196763,'3269933','Exning Road','gallery');
galleries[3] = new gallery(196748,'3269962','Garden Features','gallery');
galleries[4] = new gallery(198020,'3273124','Lettsom Footbridge.','gallery');
galleries[5] = new gallery(198046,'3273134','Loddon Arch.','gallery');
galleries[6] = new gallery(198049,'3273726','Memorial Park','gallery');
galleries[7] = new gallery(196762,'3273947','Portway School','gallery');
galleries[8] = new gallery(196749,'3273947,3273726,3273124,3270709','Public Work','gallery');
galleries[9] = new gallery(196736,'3274196','Sculpture','gallery');
galleries[10] = new gallery(196737,'3274202,3273915','Furniture','gallery');

