/***************************************************************************
* 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('2356357,2356243,2356150,2356124,2356111,2356103,2354017,2094281,2094276,1930023,1930018,1930008,1929913,1929911,1929253,1929206,1928907,1928887');
	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('2356357,2356243,2356150,2356124,2356111,2356103,2354017,2094281,2094276,1930023,1930018,1930008,1929913,1929911,1929253,1929206,1928907,1928887');
	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 = 'RACHEL SAVAGE PAINTINGS: ' + 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].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(1929205,'129404','','gallery','http://www1.clikpic.com/rachelsavageart/images/whitby from the pier. square oil on canvas £305mm x 305mm £235.JPG',500,505,'WHITBY FROM THE PIER','http://www1.clikpic.com/rachelsavageart/images/whitby from the pier_thumb. square oil on canvas £305mm x 305mm £235.JPG',130, 131,0, 0,'','','','','','');
photos[1] = new photo(1929206,'129404','','gallery','http://www1.clikpic.com/rachelsavageart/images/whitby gull. square. oil on canvas 305mm x 305mm £235.jpg',500,503,'GULL','http://www1.clikpic.com/rachelsavageart/images/whitby gull_thumb. square. oil on canvas 305mm x 305mm £235.jpg',130, 131,1, 1,'','','','','','');
photos[2] = new photo(1929208,'129404','','gallery','http://www1.clikpic.com/rachelsavageart/images/whitby pier. rectangle. oil on canvas405mm x 510mm £300.jpg',500,623,'PIER AND JORDAN','http://www1.clikpic.com/rachelsavageart/images/whitby pier_thumb. rectangle. oil on canvas405mm x 510mm £300.jpg',130, 162,0, 0,'','','','','','');
photos[3] = new photo(1929211,'129404','','gallery','http://www1.clikpic.com/rachelsavageart/images/whitby pier. square oil on canvas 305mm x 305mm £235..jpg',500,497,'LIGHTHOUSE','http://www1.clikpic.com/rachelsavageart/images/whitby pier_thumb. square oil on canvas 305mm x 305mm £235..jpg',130, 129,0, 0,'','','','','','');
photos[4] = new photo(1929247,'129408','','gallery','http://www1.clikpic.com/rachelsavageart/images/blue damselflies and ocean study mixed media 535x650 £245.JPG',500,622,'BLUE DAMSELS AND CORAL','http://www1.clikpic.com/rachelsavageart/images/blue damselflies and ocean study mixed media 535x650 £245_thumb.JPG',130, 162,0, 0,'','','','','','');
photos[5] = new photo(1929250,'129408','','gallery','http://www1.clikpic.com/rachelsavageart/images/mustard butterflies and ocean study mixed media 545x650 £245.JPG',500,606,'MUSTARD BUTTERFLIES AND CORAL','http://www1.clikpic.com/rachelsavageart/images/mustard butterflies and ocean study mixed media 545x650 £245_thumb.JPG',130, 158,0, 0,'','','','','','');
photos[6] = new photo(1929253,'129408','','gallery','http://www1.clikpic.com/rachelsavageart/images/olive swallows xed media 535x650 £245.JPG',500,608,'OLIVE SWALLOWS AND CORAL','http://www1.clikpic.com/rachelsavageart/images/olive swallows xed media 535x650 £245_thumb.JPG',130, 158,1, 1,'','','','','','');
photos[7] = new photo(1929255,'129408','','gallery','http://www1.clikpic.com/rachelsavageart/images/yellow bluetits and ocean study mixed media 550x650 £245.JPG',500,605,'YELLOW BLUETITS AND CORAL','http://www1.clikpic.com/rachelsavageart/images/yellow bluetits and ocean study mixed media 550x650 £245_thumb.JPG',130, 157,0, 0,'','','','','','');
photos[8] = new photo(1929261,'129408','','gallery','http://www1.clikpic.com/rachelsavageart/images/yellow butterflies and ocean study mixed media on canvas 530x640 £245.jpg',500,609,'YELLOW BUTTERFLIES AND CORAL','http://www1.clikpic.com/rachelsavageart/images/yellow butterflies and ocean study mixed media on canvas 530x640 £245_thumb.jpg',130, 158,0, 0,'','','','','','');
photos[9] = new photo(1930006,'129444','','gallery','http://www1.clikpic.com/rachelsavageart/images/delay mixed media on canvas 1200x1500 £500.jpg',500,602,'','http://www1.clikpic.com/rachelsavageart/images/delay mixed media on canvas 1200x1500 £500_thumb.jpg',130, 156,0, 0,'','','','','','');
photos[10] = new photo(1930008,'129444','','gallery','http://www1.clikpic.com/rachelsavageart/images/leaving mixed media on canvas1190x1500 £500.jpg',500,628,'LEAVING','http://www1.clikpic.com/rachelsavageart/images/leaving mixed media on canvas1190x1500 £500_thumb.jpg',130, 163,1, 0,'','','','','','');
photos[11] = new photo(1930011,'129444','','gallery','http://www1.clikpic.com/rachelsavageart/images/misinformation mixed media on canvas 1200x1500 £500.jpg',500,635,'MISINFORMATION','http://www1.clikpic.com/rachelsavageart/images/misinformation mixed media on canvas 1200x1500 £500_thumb.jpg',130, 165,0, 0,'','','','','','');
photos[12] = new photo(1930018,'129444','','gallery','http://www1.clikpic.com/rachelsavageart/images/the big yin.mixed media on canvas 1600 x 1600 n.f.s.jpg',500,509,'THE BIG YIN (FOR JIM)','http://www1.clikpic.com/rachelsavageart/images/the big yin_thumb.mixed media on canvas 1600 x 1600 n.f.s.jpg',130, 132,1, 1,'','','','','','');
photos[13] = new photo(1930023,'129444','','gallery','http://www1.clikpic.com/rachelsavageart/images/through the gates horisontal blues mixed media on canvas 1190x1500 £500.jpg',500,629,'THROUGH THE GATES','http://www1.clikpic.com/rachelsavageart/images/through the gates horisontal blues mixed media on canvas 1190x1500 £500_thumb.jpg',130, 164,1, 1,'','','','','','');
photos[14] = new photo(1930039,'129444','','gallery','http://www1.clikpic.com/rachelsavageart/images/through the gates vertical blues mixed media on canvas 1190x1500 £500.jpg',500,630,'THROUGH THE GATES VERTICAL BLUES','http://www1.clikpic.com/rachelsavageart/images/through the gates vertical blues mixed media on canvas 1190x1500 £500_thumb.jpg',130, 164,0, 0,'','','','','','');
photos[15] = new photo(1930044,'129444','','gallery','http://www1.clikpic.com/rachelsavageart/images/waiting on the platform mixed media on canvas 1500x1200 £500.jpg',500,621,'WAITING ON THE PLATFORM','http://www1.clikpic.com/rachelsavageart/images/waiting on the platform mixed media on canvas 1500x1200 £500_thumb.jpg',130, 161,0, 0,'','','','','','');
photos[16] = new photo(1930051,'129450','','gallery','http://www1.clikpic.com/rachelsavageart/images/dune study 2 oil on paper..JPG',500,826,'DUNE STUDY 2 OIL ON PAPER','http://www1.clikpic.com/rachelsavageart/images/dune study 2 oil on paper_thumb..JPG',130, 215,0, 0,'','','','','','');
photos[17] = new photo(1930054,'129450','','gallery','http://www1.clikpic.com/rachelsavageart/images/dune study 1 oil on paper..JPG',500,732,'DUNE STUDY 1 OIL ON PAPER','http://www1.clikpic.com/rachelsavageart/images/dune study 1 oil on paper_thumb..JPG',130, 190,0, 0,'','','','','','');
photos[18] = new photo(1930067,'129450','','gallery','http://www1.clikpic.com/rachelsavageart/images/3rd section of dune study 2.JPG',500,375,'SECTION (DUNE STUDY 2)','http://www1.clikpic.com/rachelsavageart/images/3rd section of dune study 2_thumb.JPG',130, 98,0, 0,'','','','','','');
photos[19] = new photo(2094276,'139652','','gallery','http://www1.clikpic.com/rachelsavageart/images/RS1.jpg',415,622,'RACHEL SAVAGE IN HER LEEDS STUDIO','http://www1.clikpic.com/rachelsavageart/images/RS1_thumb.jpg',130, 195,1, 1,'','','','','','');
photos[20] = new photo(2094281,'139652','','gallery','http://www1.clikpic.com/rachelsavageart/images/RS3.jpg',415,622,'RACHEL','http://www1.clikpic.com/rachelsavageart/images/RS3_thumb.jpg',130, 195,1, 1,'','','','','','');
photos[21] = new photo(2354017,'153297','','gallery','http://www1.clikpic.com/rachelsavageart/images/479.JPG',384,480,'','http://www1.clikpic.com/rachelsavageart/images/479_thumb.JPG',130, 163,1, 1,'','','','','','');
photos[22] = new photo(2354018,'153297','','gallery','http://www1.clikpic.com/rachelsavageart/images/480.JPG',388,480,'','http://www1.clikpic.com/rachelsavageart/images/480_thumb.JPG',130, 161,0, 0,'','','','','','');
photos[23] = new photo(2354019,'153297','','gallery','http://www1.clikpic.com/rachelsavageart/images/481.JPG',379,480,'','http://www1.clikpic.com/rachelsavageart/images/481_thumb.JPG',130, 165,0, 0,'','','','','','');
photos[24] = new photo(2354025,'153289','','gallery','http://www1.clikpic.com/rachelsavageart/images/491.JPG',369,480,'','http://www1.clikpic.com/rachelsavageart/images/491_thumb.JPG',130, 169,0, 0,'','','','','','');
photos[25] = new photo(2354027,'153289','','gallery','http://www1.clikpic.com/rachelsavageart/images/492.JPG',387,480,'','http://www1.clikpic.com/rachelsavageart/images/492_thumb.JPG',130, 161,0, 0,'','','','','','');
photos[26] = new photo(2354039,'153297','','gallery','http://www1.clikpic.com/rachelsavageart/images/483.JPG',374,480,'','http://www1.clikpic.com/rachelsavageart/images/483_thumb.JPG',130, 167,0, 0,'','','','','','');
photos[27] = new photo(2354040,'153289','','gallery','http://www1.clikpic.com/rachelsavageart/images/486.JPG',500,373,'','http://www1.clikpic.com/rachelsavageart/images/486_thumb.JPG',130, 97,0, 0,'','','','','','');
photos[28] = new photo(2354043,'153289','','gallery','http://www1.clikpic.com/rachelsavageart/images/498.JPG',500,498,'','http://www1.clikpic.com/rachelsavageart/images/498_thumb.JPG',130, 130,0, 0,'','','','','','');
photos[29] = new photo(2354054,'129444','','gallery','http://www1.clikpic.com/rachelsavageart/images/green and yellow text and symbols mixed media on canvas 900x900 £350.JPG',480,480,'','http://www1.clikpic.com/rachelsavageart/images/green and yellow text and symbols mixed media on canvas 900x900 £350_thumb.JPG',130, 130,0, 0,'','','','','','');
photos[30] = new photo(2354068,'129444','','gallery','http://www1.clikpic.com/rachelsavageart/images/green and yellow text and symbols no 1 mixed media on canvas 590x840 £195.jpg',500,347,'','http://www1.clikpic.com/rachelsavageart/images/green and yellow text and symbols no 1 mixed media on canvas 590x840 £195_thumb.jpg',130, 90,0, 0,'','','','','','');
photos[31] = new photo(2354070,'129444','','gallery','http://www1.clikpic.com/rachelsavageart/images/red text grey symbols mixed media on canvas 840x690 £170.jpg',395,480,'','http://www1.clikpic.com/rachelsavageart/images/red text grey symbols mixed media on canvas 840x690 £170_thumb.jpg',130, 158,0, 0,'','','','','','');
photos[32] = new photo(2354153,'153289','','gallery','http://www1.clikpic.com/rachelsavageart/images/4871.JPG',500,382,'','http://www1.clikpic.com/rachelsavageart/images/4871_thumb.JPG',130, 99,0, 0,'','','','','','');
photos[33] = new photo(2356103,'153294','','gallery','http://www1.clikpic.com/rachelsavageart/images/2511.JPG',500,496,'','http://www1.clikpic.com/rachelsavageart/images/2511_thumb.JPG',130, 129,1, 1,'','','','','','');
photos[34] = new photo(2356111,'153289','','gallery','http://www1.clikpic.com/rachelsavageart/images/2041.JPG',358,480,'','http://www1.clikpic.com/rachelsavageart/images/2041_thumb.JPG',130, 174,1, 1,'','','','','','');
photos[35] = new photo(2356120,'153287','','gallery','http://www1.clikpic.com/rachelsavageart/images/4472.JPG',500,347,'','http://www1.clikpic.com/rachelsavageart/images/4472_thumb.JPG',130, 90,0, 0,'','','','','','');
photos[36] = new photo(2356121,'153287','','gallery','http://www1.clikpic.com/rachelsavageart/images/4491.JPG',345,480,'','http://www1.clikpic.com/rachelsavageart/images/4491_thumb.JPG',130, 181,0, 0,'','','','','','');
photos[37] = new photo(2356123,'153287','','gallery','http://www1.clikpic.com/rachelsavageart/images/4531.JPG',500,348,'','http://www1.clikpic.com/rachelsavageart/images/4531_thumb.JPG',130, 90,0, 0,'','','','','','');
photos[38] = new photo(2356124,'153287','','gallery','http://www1.clikpic.com/rachelsavageart/images/4591.JPG',351,480,'','http://www1.clikpic.com/rachelsavageart/images/4591_thumb.JPG',130, 178,1, 1,'','','','','','');
photos[39] = new photo(2356125,'153287','','gallery','http://www1.clikpic.com/rachelsavageart/images/4621.JPG',339,480,'','http://www1.clikpic.com/rachelsavageart/images/4621_thumb.JPG',130, 184,0, 0,'','','','','','');
photos[40] = new photo(2356128,'153294','','gallery','http://www1.clikpic.com/rachelsavageart/images/4851.JPG',476,480,'','http://www1.clikpic.com/rachelsavageart/images/4851_thumb.JPG',130, 131,0, 0,'','','','','','');
photos[41] = new photo(2356129,'153294','','gallery','http://www1.clikpic.com/rachelsavageart/images/4941.JPG',480,480,'','http://www1.clikpic.com/rachelsavageart/images/4941_thumb.JPG',130, 130,0, 0,'','','','','','');
photos[42] = new photo(2356131,'151557','','gallery','http://www1.clikpic.com/rachelsavageart/images/4671.JPG',500,498,'','http://www1.clikpic.com/rachelsavageart/images/4671_thumb.JPG',130, 129,0, 0,'','','','','','');
photos[43] = new photo(2356133,'151557','','gallery','http://www1.clikpic.com/rachelsavageart/images/4731.JPG',500,490,'','http://www1.clikpic.com/rachelsavageart/images/4731_thumb.JPG',130, 127,0, 0,'','','','','','');
photos[44] = new photo(2356144,'151557','','gallery','http://www1.clikpic.com/rachelsavageart/images/2301.JPG',235,480,'','http://www1.clikpic.com/rachelsavageart/images/2301_thumb.JPG',130, 266,0, 0,'','','','','','');
photos[45] = new photo(2356147,'151557','','gallery','http://www1.clikpic.com/rachelsavageart/images/5081.JPG',500,330,'','http://www1.clikpic.com/rachelsavageart/images/5081_thumb.JPG',130, 86,0, 0,'','','','','','');
photos[46] = new photo(2356150,'151557','','gallery','http://www1.clikpic.com/rachelsavageart/images/5091.JPG',500,334,'','http://www1.clikpic.com/rachelsavageart/images/5091_thumb.JPG',130, 87,1, 1,'','','','','','');
photos[47] = new photo(2356163,'151557','','gallery','http://www1.clikpic.com/rachelsavageart/images/5111.JPG',500,484,'Brother and the wolf','http://www1.clikpic.com/rachelsavageart/images/5111_thumb.JPG',130, 126,0, 0,'','','','','','');
photos[48] = new photo(2356166,'153289','','gallery','http://www1.clikpic.com/rachelsavageart/images/5101.JPG',500,411,'5 a.m','http://www1.clikpic.com/rachelsavageart/images/5101_thumb.JPG',130, 107,0, 0,'','','','','','');
photos[49] = new photo(2356238,'129386','','gallery','http://www1.clikpic.com/rachelsavageart/images/aldebrough building. square. oil on canvas 405mm x 405mm £2501.jpg',500,496,'','http://www1.clikpic.com/rachelsavageart/images/aldebrough building_thumb. square. oil on canvas 405mm x 405mm £2501.jpg',130, 129,0, 0,'','','','','','');
photos[50] = new photo(2356243,'129386','','gallery','http://www1.clikpic.com/rachelsavageart/images/aldebrough building. rectangle. oil on canvas 405mm x 510mm £3001.jpg',386,480,'','http://www1.clikpic.com/rachelsavageart/images/aldebrough building_thumb. rectangle. oil on canvas 405mm x 510mm £3001.jpg',130, 162,1, 1,'','','','','','');
photos[51] = new photo(2356245,'129386','','gallery','http://www1.clikpic.com/rachelsavageart/images/aldebrough promenade60.JPG',386,480,'','http://www1.clikpic.com/rachelsavageart/images/aldebrough promenade60_thumb.JPG',130, 162,0, 0,'','','','','','');
photos[52] = new photo(2356252,'129386','','gallery','http://www1.clikpic.com/rachelsavageart/images/aldebrough promenade. square. oil on canvas 405mm x 405mm £2501.jpg',475,480,'','http://www1.clikpic.com/rachelsavageart/images/aldebrough promenade_thumb. square. oil on canvas 405mm x 405mm £2501.jpg',130, 131,0, 0,'','','','','','');
photos[53] = new photo(2356259,'151557','','gallery','http://www1.clikpic.com/rachelsavageart/images/2321.JPG',241,480,'','http://www1.clikpic.com/rachelsavageart/images/2321_thumb.JPG',130, 259,0, 0,'','','','','','');
photos[54] = new photo(2356261,'151557','','gallery','http://www1.clikpic.com/rachelsavageart/images/2351.JPG',236,480,'','http://www1.clikpic.com/rachelsavageart/images/2351_thumb.JPG',130, 264,0, 0,'','','','','','');
photos[55] = new photo(2356306,'129386','','gallery','http://www1.clikpic.com/rachelsavageart/images/aldebrough promenade50.JPG',479,480,'','http://www1.clikpic.com/rachelsavageart/images/aldebrough promenade50_thumb.JPG',130, 130,0, 0,'','','','','','');
photos[56] = new photo(2356355,'129450','','gallery','http://www1.clikpic.com/rachelsavageart/images/clifftop painting no.1 oil on canvas 1270 x 16702.JPG',360,480,'','http://www1.clikpic.com/rachelsavageart/images/clifftop painting no_thumb.1 oil on canvas 1270 x 16702.JPG',130, 173,0, 0,'','','','','','');
photos[57] = new photo(2356357,'129450','','gallery','http://www1.clikpic.com/rachelsavageart/images/clifftop painting no.2. oil on canvas 1270 x 16702.JPG',359,480,'','http://www1.clikpic.com/rachelsavageart/images/clifftop painting no_thumb.2. oil on canvas 1270 x 16702.JPG',130, 174,1, 1,'','','','','','');
photos[58] = new photo(2356395,'153289','','gallery','http://www1.clikpic.com/rachelsavageart/images/5061.JPG',500,396,'','http://www1.clikpic.com/rachelsavageart/images/5061_thumb.JPG',130, 103,0, 0,'','','','','','');
photos[59] = new photo(2356451,'153289','','gallery','http://www1.clikpic.com/rachelsavageart/images/507.JPG',500,402,'','http://www1.clikpic.com/rachelsavageart/images/507_thumb.JPG',130, 104,0, 0,'','','','','','');
photos[60] = new photo(3095282,'189909','','gallery','http://www1.clikpic.com/rachelsavageart/images/pic2.jpg',327,370,'','http://www1.clikpic.com/rachelsavageart/images/pic2_thumb.jpg',130, 147,0, 0,'','','','','','');
photos[61] = new photo(3095325,'189909','','gallery','http://www1.clikpic.com/rachelsavageart/images/pic3.jpg',375,465,'','http://www1.clikpic.com/rachelsavageart/images/pic3_thumb.jpg',130, 161,0, 0,'','','','','','');
photos[62] = new photo(3095374,'189909','','gallery','http://www1.clikpic.com/rachelsavageart/images/pic4.jpg',410,503,'','http://www1.clikpic.com/rachelsavageart/images/pic4_thumb.jpg',130, 159,0, 0,'','','','','','');
photos[63] = new photo(3095378,'189909','','gallery','http://www1.clikpic.com/rachelsavageart/images/pic7.jpg',427,475,'','http://www1.clikpic.com/rachelsavageart/images/pic7_thumb.jpg',130, 145,0, 0,'','','','','','');
photos[64] = new photo(3095379,'189909','','gallery','http://www1.clikpic.com/rachelsavageart/images/pic5.jpg',401,576,'','http://www1.clikpic.com/rachelsavageart/images/pic5_thumb.jpg',130, 187,0, 0,'','','','','','');
photos[65] = new photo(3095383,'189909','','gallery','http://www1.clikpic.com/rachelsavageart/images/pic9.jpg',433,424,'','http://www1.clikpic.com/rachelsavageart/images/pic9_thumb.jpg',130, 127,0, 0,'','','','','','');
photos[66] = new photo(3095385,'189909','','gallery','http://www1.clikpic.com/rachelsavageart/images/pic6.jpg',408,513,'','http://www1.clikpic.com/rachelsavageart/images/pic6_thumb.jpg',130, 163,0, 0,'','','','','','');
photos[67] = new photo(3095386,'189909','','gallery','http://www1.clikpic.com/rachelsavageart/images/pic11.jpg',424,569,'','http://www1.clikpic.com/rachelsavageart/images/pic11_thumb.jpg',130, 174,0, 0,'','','','','','');
photos[68] = new photo(3095387,'189909','','gallery','http://www1.clikpic.com/rachelsavageart/images/pic10.jpg',442,444,'','http://www1.clikpic.com/rachelsavageart/images/pic10_thumb.jpg',130, 131,0, 0,'','','','','','');
photos[69] = new photo(3095391,'189909','','gallery','http://www1.clikpic.com/rachelsavageart/images/pic12.jpg',416,418,'','http://www1.clikpic.com/rachelsavageart/images/pic12_thumb.jpg',130, 131,0, 0,'','','','','','');
photos[70] = new photo(3095393,'189909','','gallery','http://www1.clikpic.com/rachelsavageart/images/pic13.jpg',500,375,'','http://www1.clikpic.com/rachelsavageart/images/pic13_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[71] = new photo(3095394,'189909','','gallery','http://www1.clikpic.com/rachelsavageart/images/pic14.jpg',417,434,'','http://www1.clikpic.com/rachelsavageart/images/pic14_thumb.jpg',130, 135,0, 0,'','','','','','');
photos[72] = new photo(3095397,'189909','','gallery','http://www1.clikpic.com/rachelsavageart/images/pic15.jpg',500,375,'','http://www1.clikpic.com/rachelsavageart/images/pic15_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[73] = new photo(3095408,'189909','','gallery','http://www1.clikpic.com/rachelsavageart/images/pic8.jpg',439,441,'','http://www1.clikpic.com/rachelsavageart/images/pic8_thumb.jpg',130, 131,0, 0,'','','','','','');
photos[74] = new photo(1928776,'129354','','gallery','http://www1.clikpic.com/rachelsavageart/images/sinai coast egypt acrylic on canvas 800x800 £450.jpg',500,481,'OCEAN SERIES NO.1','http://www1.clikpic.com/rachelsavageart/images/sinai coast egypt acrylic on canvas 800x800 £450_thumb.jpg',130, 135,0, 0,'','','','','','');
photos[75] = new photo(1928843,'129354','','gallery','http://www1.clikpic.com/rachelsavageart/images/spooky lake acrylic on canvas 800x800 £450.jpg',500,480,'OCEAN SERIES 2','http://www1.clikpic.com/rachelsavageart/images/spooky lake acrylic on canvas 800x800 £450_thumb.jpg',130, 125,0, 0,'','','','','','');
photos[76] = new photo(1928867,'129354','','gallery','http://www1.clikpic.com/rachelsavageart/images/devils eye spring meets santa fe river acrylic on canvas 800x800 £450.jpg',500,526,'OCEAN SERIES 4','http://www1.clikpic.com/rachelsavageart/images/devils eye spring meets santa fe river acrylic on canvas 800x800 £450_thumb.jpg',130, 125,0, 0,'','','','','','');
photos[77] = new photo(1928887,'129354','','gallery','http://www1.clikpic.com/rachelsavageart/images/cool waters california acrylic on canvas 800x800 £450.jpg',500,516,'OCEAN SERIES 5','http://www1.clikpic.com/rachelsavageart/images/cool waters california acrylic on canvas 800x800 £450_thumb.jpg',130, 134,1, 1,'','','','','','');
photos[78] = new photo(1928907,'129354','','gallery','http://www1.clikpic.com/rachelsavageart/images/devils eye spring meets santa fe river acrylic on canvas 800x800 £4501.jpg',500,526,'ocean series 5','http://www1.clikpic.com/rachelsavageart/images/devils eye spring meets santa fe river acrylic on canvas 800x800 £4501_thumb.jpg',130, 137,1, 1,'','','','','','');
photos[79] = new photo(1929909,'129354','','gallery','http://www1.clikpic.com/rachelsavageart/images/angel fish in coral acrylic on canvas 800x800 £450.JPG',500,502,'ANGELFISH IN CORAL','http://www1.clikpic.com/rachelsavageart/images/angel fish in coral acrylic on canvas 800x800 £450_thumb.JPG',130, 130,0, 1,'','','','','','');
photos[80] = new photo(1929910,'129354','','gallery','http://www1.clikpic.com/rachelsavageart/images/angelfish on jellyfish acrylic on canvas 800x800 £450 .jpg',500,507,'ANGELFISH AND JELLYFISH','http://www1.clikpic.com/rachelsavageart/images/angelfish on jellyfish acrylic on canvas 800x800 £450 _thumb.jpg',130, 132,0, 0,'','','','','','');
photos[81] = new photo(1929911,'129354','','gallery','http://www1.clikpic.com/rachelsavageart/images/blue coral acrylic on canvas 800x800 £450.jpg',500,510,'BLUE CORAL','http://www1.clikpic.com/rachelsavageart/images/blue coral acrylic on canvas 800x800 £450_thumb.jpg',130, 133,1, 1,'','','','','','');
photos[82] = new photo(1929913,'129354','','gallery','http://www1.clikpic.com/rachelsavageart/images/exploding jellyfish acrylic on canvas 800x800 £450.jpg',500,503,'EXPLODING JELLYFISH','http://www1.clikpic.com/rachelsavageart/images/exploding jellyfish acrylic on canvas 800x800 £450_thumb.jpg',130, 131,1, 1,'','','','','','');
photos[83] = new photo(1929915,'129354','','gallery','http://www1.clikpic.com/rachelsavageart/images/green sea tubes and red coral polyps acrylic on canvas 800x800 £450.jpg',500,507,'GREEN TUBES AND RED POLYPS','http://www1.clikpic.com/rachelsavageart/images/green sea tubes and red coral polyps acrylic on canvas 800x800 £450_thumb.jpg',130, 132,0, 0,'','','','','','');
photos[84] = new photo(1929938,'129354','','gallery','http://www1.clikpic.com/rachelsavageart/images/red long stemmed water lillies acrylic on canvas 800x800 £450.JPG',500,500,'WATER LILLIES','http://www1.clikpic.com/rachelsavageart/images/red long stemmed water lillies acrylic on canvas 800x800 £450_thumb.JPG',130, 130,0, 0,'','','','','','');
photos[85] = new photo(1929939,'129354','','gallery','http://www1.clikpic.com/rachelsavageart/images/sea anenome acrylic on canvas 800x800 £450.jpg',500,505,'SEA ANENOME','http://www1.clikpic.com/rachelsavageart/images/sea anenome acrylic on canvas 800x800 £450_thumb.jpg',130, 131,0, 0,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(153294,'2356103','ABBEY GARDENS WINTER PAINTINGS','gallery');
galleries[1] = new gallery(129386,'2356243','ALDEBURGH PAINTINGS','gallery');
galleries[2] = new gallery(129408,'1929253','CORAL AND STENCIL SERIES','gallery');
galleries[3] = new gallery(153287,'2356124','ELGOL PAINTINGS.','gallery');
galleries[4] = new gallery(189909,'3095408,3095397,3095394,3095393,3095391,3095387,3095386,3095385,3095383,3095379','HIGHLANDS AND THE ISLE OF SKYE','gallery');
galleries[5] = new gallery(129444,'1930023,1930018','LARGE ABSTRACT PAINTINGS','gallery');
galleries[6] = new gallery(129450,'2356357','LARGE CLIFF AND DUNE PAINTINGS WITH PAPER STUDI','gallery');
galleries[7] = new gallery(153289,'2356111','LEEDS HYDE PARK PAINTINGS.','gallery');
galleries[8] = new gallery(139652,'2094281,2094276','RACHEL SAVAGE IN HER LEEDS STUDIO','gallery');
galleries[9] = new gallery(153297,'2354017','THETFORD FOREST PAINTINGS','gallery');
galleries[10] = new gallery(151557,'2356150','WASTWATER ( LAKE DISTRICT ) OIL PAINTINGS','gallery');
galleries[11] = new gallery(129404,'1929206','WHITBY PAINTINGS','gallery');
galleries[12] = new gallery(129354,'1929913,1929911,1929909,1928907,1928887','OCEAN SERIES','gallery');

