/***************************************************************************
* 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('6192794,6186754,6186750,6186749,6186690,6186684,6186679,5936196,5936181,5936178,5936174,5936171,5936169,5935835,5935833,5935824,5935819,5935813,5935807,5935798,5935796,5935789,5935786,5935778,5935775,5935773,5935766,5935763,5935758,5935754,5935752,5935749,5935745,5935740,5935736,5935728,5935725,5935722,5935717,5935708,5935700,5935694,5935687,5935679,5935671,5935664,4887860,4887852,2722410,2722399');
	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('6192794,6186754,6186750,6186749,6186690,6186684,6186679,5936196,5936181,5936178,5936174,5936171,5936169,5935835,5935833,5935824,5935819,5935813,5935807,5935798,5935796,5935789,5935786,5935778,5935775,5935773,5935766,5935763,5935758,5935754,5935752,5935749,5935745,5935740,5935736,5935728,5935725,5935722,5935717,5935708,5935700,5935694,5935687,5935679,5935671,5935664,4887860,4887852,2722410,2722399');
	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 = 'The URC in the Isle of Man.: ' + 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 thecurrent 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(6186679,'345533','','gallery','http://www.clikchurch.com/standrews/images/one_in_the_park_crowd_streams_in_web_site.JPG',400,300,'Crowds Stream In.','http://www.clikchurch.com/standrews/images/one_in_the_park_crowd_streams_in_web_site_thumb.JPG',130, 98,0, 0,'Christians island-wide joined together in Nobls Park for worship, and the signature of our new, shared, covenant.','20/06/10','','','','');
photos[1] = new photo(6186684,'345533','','gallery','http://www.clikchurch.com/standrews/images/one_in_the_park_band_get_ready_web_site.JPG',400,300,'Band get ready.','http://www.clikchurch.com/standrews/images/one_in_the_park_band_get_ready_web_site_thumb.JPG',130, 98,0, 0,'The musicians were able to take advantage of the full sound system.','20/06/10','','','','');
photos[2] = new photo(6186690,'345533','','gallery','http://www.clikchurch.com/standrews/images/one_in_the_park_crowd.JPG',400,300,'Tent fills up.','http://www.clikchurch.com/standrews/images/one_in_the_park_crowd_thumb.JPG',130, 98,0, 0,'Crowd/congregation take their sats.','20/06/10','','','','');
photos[3] = new photo(6186749,'345533','','gallery','http://www.clikchurch.com/standrews/images/one_in_the_park_ready_to_sign_web_site.JPG',400,300,'Preparing to sign the Coventant.','http://www.clikchurch.com/standrews/images/one_in_the_park_ready_to_sign_web_site_thumb.JPG',130, 98,0, 0,'Leaders of almost all the island\'s Christian denominations stand together, ready to sing the Covenant.','20/06/10','','','','');
photos[4] = new photo(6186750,'345533','','gallery','http://www.clikchurch.com/standrews/images/one_in_the_park_the_covenant_web_site.JPG',400,533,'The Covenant document','http://www.clikchurch.com/standrews/images/one_in_the_park_the_covenant_web_site_thumb.JPG',130, 173,0, 0,'','20/06/10','','','','');
photos[5] = new photo(6186754,'345533','','gallery','http://www.clikchurch.com/standrews/images/one_in_the_park_signatures_web_site.JPG',400,300,'Signatures...','http://www.clikchurch.com/standrews/images/one_in_the_park_signatures_web_site_thumb.JPG',130, 98,0, 0,'Some familiar names amongst the signatories.','20/06/10','','','','');
photos[6] = new photo(2722410,'20931','','gallery','http://www.clikchurch.com/standrews/images/Church congregation and outing 002small.jpg',400,300,'We decided to take a new congregation \'family\' picture in July 2008.','http://www.clikchurch.com/standrews/images/Church congregation and outing 002small_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[7] = new photo(2500602,'20931','','gallery','http://www.clikchurch.com/standrews/images/Kirsty, small.jpg',400,399,'Kirsty Quine becomes a Church member in June 2008','http://www.clikchurch.com/standrews/images/Kirsty, small_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[8] = new photo(1759699,'20931','','gallery','http://www.clikchurch.com/standrews/images/August 4th 2007 004 crop.jpg',400,261,'Tidying the grounds.  How many Brians does it take to paint a line?','http://www.clikchurch.com/standrews/images/August 4th 2007 004 crop_thumb.jpg',130, 85,0, 0,'Work party to tidy the carpark.','04/08/07','','','','');
photos[9] = new photo(1759705,'20931','','gallery','http://www.clikchurch.com/standrews/images/August 4th 2007 006.jpg',400,268,'The sweepers.','http://www.clikchurch.com/standrews/images/August 4th 2007 006_thumb.jpg',130, 87,0, 0,'Workparty to tidy carpark.','04/08/07','','','','');
photos[10] = new photo(1759708,'20931','','gallery','http://www.clikchurch.com/standrews/images/August 4th 2007 007.jpg',400,600,'It is good to see men dressed for the job!','http://www.clikchurch.com/standrews/images/August 4th 2007 007_thumb.jpg',130, 195,0, 0,'workparty to tidy carpark.','04/08/07','','','','');
photos[11] = new photo(1759714,'20931','','gallery','http://www.clikchurch.com/standrews/images/August 4th 2007 0051.jpg',400,267,'And they\'re still painting that line - one to paint, one to supervise....','http://www.clikchurch.com/standrews/images/August 4th 2007 0051_thumb.jpg',130, 87,0, 0,'work party to tidy carpark.','04/08/07','','','','');
photos[12] = new photo(872997,'22019','','gallery','http://www.clikchurch.com/standrews/images/cake stall day 010 smaller.jpg',400,267,'Magnus and Katie in the book corner.','http://www.clikchurch.com/standrews/images/cake stall day 010 smaller_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[13] = new photo(6192794,'22019','','gallery','http://www.clikchurch.com/standrews/images/Jacobs_ladder_-_website.JPG',400,300,'Jacob\'s Ladder - in chocolate fingers and gingerbread men...','http://www.clikchurch.com/standrews/images/Jacobs_ladder_-_website_thumb.JPG',130, 98,0, 0,'','','','','','');
photos[14] = new photo(243908,'22019','','gallery','http://www.clikchurch.com/standrews/images/Web Amber Joel and Danny.jpg',400,267,'Learning about our faith is fun.','http://www.clikchurch.com/standrews/images/Web Amber Joel and Danny_thumb.jpg',130, 87,0, 0,'Sunday School.','','','','','');
photos[15] = new photo(872885,'22019','','gallery','http://www.clikchurch.com/standrews/images/cake stall day 007website.jpg',300,200,'In the middle is Gillian - chief cake maker.  Kirsty and Juan also baked for us.','http://www.clikchurch.com/standrews/images/cake stall day 007website_thumb.jpg',130, 87,0, 0,'Cake Stall for Comic Relief, 25th March 2007','','','','','');
photos[16] = new photo(2722396,'87274','','gallery','http://www.clikchurch.com/standrews/images/Ealee and Katie, websized.jpg',400,315,'Ealee and Katie at the Wildlife Park, Church outing 2008','http://www.clikchurch.com/standrews/images/Ealee and Katie, websized_thumb.jpg',130, 102,0, 0,'','','','','','');
photos[17] = new photo(2722395,'87274','','gallery','http://www.clikchurch.com/standrews/images/Jackie and lemur websized.jpg',400,300,'Church secretary continues her recruitment drive...','http://www.clikchurch.com/standrews/images/Jackie and lemur websized_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[18] = new photo(2722397,'87274','','gallery','http://www.clikchurch.com/standrews/images/wildlife park train websized.jpg',400,300,'On the train.','http://www.clikchurch.com/standrews/images/wildlife park train websized_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[19] = new photo(2722398,'87274','','gallery','http://www.clikchurch.com/standrews/images/Sandy et al, websized.jpg',400,301,'Sandy et al, Wildlife Park 2008.','http://www.clikchurch.com/standrews/images/Sandy et al, websized_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[20] = new photo(2722399,'87274','','gallery','http://www.clikchurch.com/standrews/images/Pauline and Ron, websized.jpg',400,533,'Pauline and Ron.','http://www.clikchurch.com/standrews/images/Pauline and Ron, websized_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[21] = new photo(1218392,'87274','','gallery','http://www.clikchurch.com/standrews/images/church outing july 2007 web 11.jpg',400,267,'This is all of us, with our tram, on the Church Outing 2007.','http://www.clikchurch.com/standrews/images/church outing july 2007 web 11_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[22] = new photo(352585,'45395','','gallery','http://www.clikchurch.com/standrews/images/webpic1.jpg',400,267,'Many people watch the T.T. races from St. Andrew\'s grounds.','http://www.clikchurch.com/standrews/images/webpic1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[23] = new photo(352594,'45395','','gallery','http://www.clikchurch.com/standrews/images/webpic2.jpg',400,267,'We sell large numbers of baps, cakes, tea, coffee etc. to these visitors, for Church funds.','http://www.clikchurch.com/standrews/images/webpic2_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[24] = new photo(352597,'45395','','gallery','http://www.clikchurch.com/standrews/images/webpic3.jpg',400,600,'The hot-dog production line!','http://www.clikchurch.com/standrews/images/webpic3_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[25] = new photo(352603,'45395','','gallery','http://www.clikchurch.com/standrews/images/webpic5.jpg',400,267,'Ans just as important - the kitchen crew.','http://www.clikchurch.com/standrews/images/webpic5_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[26] = new photo(701396,'53878','','gallery','http://www.clikchurch.com/standrews/images/wEBSITE1.JPG',300,214,'The participants of Nativity 2006 all together.','http://www.clikchurch.com/standrews/images/wEBSITE1_thumb.JPG',130, 93,0, 1,'','','','','','');
photos[27] = new photo(701397,'53878','','gallery','http://www.clikchurch.com/standrews/images/website2.JPG',300,225,'Everyone from a different angle!','http://www.clikchurch.com/standrews/images/website2_thumb.JPG',130, 98,0, 0,'','','Alison C','','','');
photos[28] = new photo(701401,'53878','','gallery','http://www.clikchurch.com/standrews/images/website3.JPG',300,225,'Charlotte, Daniel and Magnus were our wise men.','http://www.clikchurch.com/standrews/images/website3_thumb.JPG',130, 98,0, 0,'','','Alison C','','','');
photos[29] = new photo(701404,'53878','','gallery','http://www.clikchurch.com/standrews/images/2007_0101Image0037.JPG',400,533,'Bethany and Katie were our angels, Kirsty and Juan read for us.  And Joel chose to be part of the congregation!','http://www.clikchurch.com/standrews/images/2007_0101Image0037_thumb.JPG',130, 173,0, 0,'','','Alison C.','','','');
photos[30] = new photo(701406,'53878','','gallery','http://www.clikchurch.com/standrews/images/websit5.JPG',300,400,'Amber was one of our shepherds - or shepherdesses!','http://www.clikchurch.com/standrews/images/websit5_thumb.JPG',130, 173,0, 0,'','','Alison /c','','','');
photos[31] = new photo(701408,'53878','','gallery','http://www.clikchurch.com/standrews/images/websi6.JPG',300,400,'And here is Ealee, the other shepherdess with Katie.','http://www.clikchurch.com/standrews/images/websi6_thumb.JPG',130, 173,0, 0,'','','Alison C.','','','');
photos[32] = new photo(632740,'53878','','gallery','http://www.clikchurch.com/standrews/images/Advent candles1forweb1.JPG',400,267,'Advent Candles 2006.','http://www.clikchurch.com/standrews/images/Advent candles1forweb1_thumb.JPG',130, 87,0, 0,'','','','','','');
photos[33] = new photo(1759722,'53878','','gallery','http://www.clikchurch.com/standrews/images/Nativity web3.jpg',400,267,'Nativity 2007','http://www.clikchurch.com/standrews/images/Nativity web3_thumb.jpg',130, 87,0, 0,'Children and adults together for Christmas 2007.','17/12/07','','','','');
photos[34] = new photo(1759723,'53878','','gallery','http://www.clikchurch.com/standrews/images/Nativity web 2.jpg',400,267,'Nativity 2007','http://www.clikchurch.com/standrews/images/Nativity web 2_thumb.jpg',130, 87,0, 0,'The theme was \'What does Christmas stand for?\'','17/12/07','','','','');
photos[35] = new photo(4887852,'278739','','gallery','http://www.clikchurch.com/standrews/images/church_website_harvest_2009_a.jpg',400,300,'Harvest Service 2009','http://www.clikchurch.com/standrews/images/church_website_harvest_2009_a_thumb.jpg',130, 98,0, 0,'Church decorated for harvest 2009','12/10/09','','','','');
photos[36] = new photo(4887860,'278739','','gallery','http://www.clikchurch.com/standrews/images/church_website_harvest_2009_b.jpg',400,300,'Harvest Service 2009','http://www.clikchurch.com/standrews/images/church_website_harvest_2009_b_thumb.jpg',130, 98,0, 0,'Harvest gifts, Harvest Service 2009','12/10/09','','','','');
photos[37] = new photo(5935664,'334825','Vestibule - Introduction - Jill Wilkinson','gallery','http://www.clikchurch.com/standrews/images/1_Vestibule_1.jpg',400,300,'All things Bright & Beautiful - Jill Wilkinson','http://www.clikchurch.com/standrews/images/1_Vestibule_1_thumb.jpg',130, 98,0, 0,'Vestibule - Introduction - Jill Wilkinson','','','','','');
photos[38] = new photo(5935671,'334825','Vestibule - Introduction - Jill Wilkinson','gallery','http://www.clikchurch.com/standrews/images/1_Vestibule_2.JPG',400,533,'All Things Bright & Beautiful - Jill Wilkinson','http://www.clikchurch.com/standrews/images/1_Vestibule_2_thumb.JPG',130, 173,0, 0,'Vestibule - Introduction - Jill Wilkinson','','','','','');
photos[39] = new photo(5935679,'334825','Love & Marriage - Evelyn Walton','gallery','http://www.clikchurch.com/standrews/images/2_Window_3.jpg',400,300,'Love & Marriage - Evelyn Walton','http://www.clikchurch.com/standrews/images/2_Window_3_thumb.jpg',130, 98,0, 0,'Love & Marriage - Evelyn Walton','','','','','');
photos[40] = new photo(5935687,'334825','Love & Marriage - Evelyn Walton ','gallery','http://www.clikchurch.com/standrews/images/2_Window_2.JPG',400,533,'Love & Marriage - Evelyn Walton','http://www.clikchurch.com/standrews/images/2_Window_2_thumb.JPG',130, 173,0, 0,'Love & Marriage - Evelyn Walton','','','','','');
photos[41] = new photo(5935694,'334825','Celebtration - Trudi Hudson','gallery','http://www.clikchurch.com/standrews/images/3_Window_3.jpg',400,533,'Celebtration - Trudi Hudson','http://www.clikchurch.com/standrews/images/3_Window_3_thumb.jpg',130, 173,0, 0,'Celebtration - Trudi Hudson','','','','','');
photos[42] = new photo(5935700,'334825','Celebration - Trudi Hudson','gallery','http://www.clikchurch.com/standrews/images/3_Window_2.JPG',400,533,'Celebration - Trudi Hudson','http://www.clikchurch.com/standrews/images/3_Window_2_thumb.JPG',130, 173,0, 0,'Celebration - Trudi Hudson','','','','','');
photos[43] = new photo(5935708,'334825','Family - Jill Wilkinson & Rena Buffine','gallery','http://www.clikchurch.com/standrews/images/4_Centre_3.jpg',400,300,'Family - Jill Wilkinson & Rena Buffine','http://www.clikchurch.com/standrews/images/4_Centre_3_thumb.jpg',130, 98,0, 0,'Family - Jill Wilkinson & Rena Buffine','','','','','');
photos[44] = new photo(5935717,'334825','Family - Jill Wilkinson & Rena Buffine','gallery','http://www.clikchurch.com/standrews/images/4_Centre_2.JPG',400,533,'Family - Jill Wilkinson & Rena Buffine','http://www.clikchurch.com/standrews/images/4_Centre_2_thumb.JPG',130, 173,0, 0,'Family - Jill Wilkinson & Rena Buffine','','','','','');
photos[45] = new photo(5935722,'334825','Home - Sue Cannell','gallery','http://www.clikchurch.com/standrews/images/5_Window_3.jpg',400,533,'Home - Sue Cannell','http://www.clikchurch.com/standrews/images/5_Window_3_thumb.jpg',130, 173,0, 0,'Home - Sue Cannell','','','','','');
photos[46] = new photo(5935725,'334825','Home - Sue Cannell','gallery','http://www.clikchurch.com/standrews/images/5_Window_2.JPG',400,533,'Home - Sue Cannell','http://www.clikchurch.com/standrews/images/5_Window_2_thumb.JPG',130, 173,0, 0,'Home - Sue Cannell','','','','','');
photos[47] = new photo(5935728,'334825','Health & Welfare - Jean Walmsley','gallery','http://www.clikchurch.com/standrews/images/6_Window_4.jpg',400,533,'Health & Welfare - Jean Walmsley','http://www.clikchurch.com/standrews/images/6_Window_4_thumb.jpg',130, 173,0, 0,'Health & Welfare - Jean Walmsley','','','','','');
photos[48] = new photo(5935736,'334825','Health & Welfare - Jean Walmsley','gallery','http://www.clikchurch.com/standrews/images/6_Window_2.JPG',400,533,'Health & Welfare - Jean Walmsley','http://www.clikchurch.com/standrews/images/6_Window_2_thumb.JPG',130, 173,0, 0,'Health & Welfare - Jean Walmsley','','','','','');
photos[49] = new photo(5935740,'334825','Birth & Baptism - Wendy Nelson','gallery','http://www.clikchurch.com/standrews/images/7_Font_3.jpg',400,533,'Birth & Baptism - Wendy Nelson','http://www.clikchurch.com/standrews/images/7_Font_3_thumb.jpg',130, 173,0, 0,'Birth & Baptism - Wendy Nelson','','','','','');
photos[50] = new photo(5935745,'334825','Birth & Baptism - Wendy Nelson','gallery','http://www.clikchurch.com/standrews/images/7_Font_2.JPG',400,533,'Birth & Baptism - Wendy Nelson','http://www.clikchurch.com/standrews/images/7_Font_2_thumb.JPG',130, 173,0, 0,'Birth & Baptism - Wendy Nelson','','','','','');
photos[51] = new photo(5935749,'334825','Nature - Trinity Sunday School ','gallery','http://www.clikchurch.com/standrews/images/8_Side_Table_5.jpg',400,533,'Nature - Trinity Sunday School','http://www.clikchurch.com/standrews/images/8_Side_Table_5_thumb.jpg',130, 173,0, 0,'Nature - Trinity Sunday School','','','','','');
photos[52] = new photo(5935752,'334825','Work, Trade & Profession - Joyce Wilson','gallery','http://www.clikchurch.com/standrews/images/9_Window_4.jpg',400,300,'Work, Trade & Profession - Joyce Wilson','http://www.clikchurch.com/standrews/images/9_Window_4_thumb.jpg',130, 98,0, 0,'Work, Trade & Profession - Joyce Wilson','','','','','');
photos[53] = new photo(5935754,'334825','Humility - Margaret Parr','gallery','http://www.clikchurch.com/standrews/images/10_Communion_Table_3.jpg',400,300,'Humility - Margaret Parr','http://www.clikchurch.com/standrews/images/10_Communion_Table_3_thumb.jpg',130, 98,0, 0,'Humility - Margaret Parr','','','','','');
photos[54] = new photo(5935758,'334825','Friendship - Trinity Girl Guides','gallery','http://www.clikchurch.com/standrews/images/11_Chancel_3.jpg',400,300,'Friendship - Trinity Girl Guides','http://www.clikchurch.com/standrews/images/11_Chancel_3_thumb.jpg',130, 98,0, 0,'Friendship - Trinity Girl Guides','','','','','');
photos[55] = new photo(5935763,'334825','Friendship - Trinity Girl Guides','gallery','http://www.clikchurch.com/standrews/images/11_Chancel_2.JPG',400,533,'Friendship - Trinity Girl Guides','http://www.clikchurch.com/standrews/images/11_Chancel_2_thumb.JPG',130, 173,0, 0,'Friendship - Trinity Girl Guides','','','','','');
photos[56] = new photo(5935766,'334825','Salvation - Rena Buffine & Pat Corrin','gallery','http://www.clikchurch.com/standrews/images/12_Pulpit_3.jpg',400,533,'Salvation - Rena Buffine & Pat Corrin','http://www.clikchurch.com/standrews/images/12_Pulpit_3_thumb.jpg',130, 173,0, 0,'Salvation - Rena Buffine & Pat Corrin','','','','','');
photos[57] = new photo(5935773,'334825','Unity of Creation - Julia Garfield','gallery','http://www.clikchurch.com/standrews/images/13_Window_1.JPG',400,533,'Unity of Creation - Julia Garfield','http://www.clikchurch.com/standrews/images/13_Window_1_thumb.JPG',130, 173,0, 0,'Unity of Creation - Julia Garfield','','','','','');
photos[58] = new photo(5935775,'334825','Unity of Creation - Julia Garfield','gallery','http://www.clikchurch.com/standrews/images/13_Window_2.JPG',400,533,'Unity of Creation - Julia Garfield','http://www.clikchurch.com/standrews/images/13_Window_2_thumb.JPG',130, 173,0, 0,'Unity of Creation - Julia Garfield','','','','','');
photos[59] = new photo(5935778,'334825','Peace & Tranquility - Sue Webb','gallery','http://www.clikchurch.com/standrews/images/14_Window_1.JPG',400,533,'Peace & Tranquility - Sue Webb','http://www.clikchurch.com/standrews/images/14_Window_1_thumb.JPG',130, 173,0, 0,'Peace & Tranquility - Sue Webb','','','','','');
photos[60] = new photo(5935786,'334825','Peace & Tranquility - Sue Webb','gallery','http://www.clikchurch.com/standrews/images/14_Window_2.JPG',400,533,'Peace & Tranquility - Sue Webb','http://www.clikchurch.com/standrews/images/14_Window_2_thumb.JPG',130, 173,0, 0,'Peace & Tranquility - Sue Webb','','','','','');
photos[61] = new photo(5935789,'334825','Education - Lin Thompson','gallery','http://www.clikchurch.com/standrews/images/15_Window_3.jpg',400,300,'Education - Lin Thompson','http://www.clikchurch.com/standrews/images/15_Window_3_thumb.jpg',130, 98,0, 0,'Education - Lin Thompson','','','','','');
photos[62] = new photo(5935796,'334825','Food & Drink - Wendy Nelson','gallery','http://www.clikchurch.com/standrews/images/16_Window_3.jpg',400,300,'Food & Drink - Wendy Nelson','http://www.clikchurch.com/standrews/images/16_Window_3_thumb.jpg',130, 98,0, 0,'Food & Drink - Wendy Nelson','','','','','');
photos[63] = new photo(5935798,'334825','Giving - Anne Corrin & Rosemary Povey','gallery','http://www.clikchurch.com/standrews/images/17_Window_4.jpg',400,300,'Giving - Anne Corrin & Rosemary Povey','http://www.clikchurch.com/standrews/images/17_Window_4_thumb.jpg',130, 98,0, 0,'Giving - Anne Corrin & Rosemary Povey','','','','','');
photos[64] = new photo(5935807,'334825','Discovery & Invention - Margaret Cristal','gallery','http://www.clikchurch.com/standrews/images/18_Lift_4.jpg',400,300,'Discovery & Invention - Margaret Cristal','http://www.clikchurch.com/standrews/images/18_Lift_4_thumb.jpg',130, 98,0, 0,'Discovery & Invention - Margaret Cristal','','','','','');
photos[65] = new photo(5935813,'334825','Discovery & Invention - Margaret Cristal','gallery','http://www.clikchurch.com/standrews/images/18_Lift_2.JPG',400,533,'Discovery & Invention - Margaret Cristal','http://www.clikchurch.com/standrews/images/18_Lift_2_thumb.JPG',130, 173,0, 0,'Discovery & Invention - Margaret Cristal','','','','','');
photos[66] = new photo(5935819,'334825','Music - Carol Christian & Shirley Kneale','gallery','http://www.clikchurch.com/standrews/images/19_Back_Wall_3.jpg',400,533,'Music - Carol Christian & Shirley Kneale','http://www.clikchurch.com/standrews/images/19_Back_Wall_3_thumb.jpg',130, 173,0, 0,'Music - Carol Christian & Shirley Kneale','','','','','');
photos[67] = new photo(5935824,'334825','Eternity - Jill Wilkinson','gallery','http://www.clikchurch.com/standrews/images/20_Vestibule_1.JPG',400,300,'Eternity - Jill Wilkinson','http://www.clikchurch.com/standrews/images/20_Vestibule_1_thumb.JPG',130, 98,0, 0,'Eternity - Jill Wilkinson','','','','','');
photos[68] = new photo(5935833,'334825','Eternity - Jill Wilkinson','gallery','http://www.clikchurch.com/standrews/images/20_Vestibule_2.JPG',400,533,'Eternity - Jill Wilkinson','http://www.clikchurch.com/standrews/images/20_Vestibule_2_thumb.JPG',130, 173,0, 0,'Eternity - Jill Wilkinson','','','','','');
photos[69] = new photo(5935835,'334825','Trinity Garden - Gail Swain','gallery','http://www.clikchurch.com/standrews/images/21_Front_Garden.JPG',400,300,'Trinity Garden - Gail Swain','http://www.clikchurch.com/standrews/images/21_Front_Garden_thumb.JPG',130, 98,0, 0,'Trinity Garden - Gail Swain','','','','','');
photos[70] = new photo(5936169,'334959','Rev Philip Smith @ 60','gallery','http://www.clikchurch.com/standrews/images/Philip_60.JPG',400,533,'Rev Philip Smith @ 60','http://www.clikchurch.com/standrews/images/Philip_60_thumb.JPG',130, 173,0, 0,'Rev Philip Smith @ 60','','','','','');
photos[71] = new photo(5936171,'334959','Celebration Cake - 60 - Rev Philip Smith','gallery','http://www.clikchurch.com/standrews/images/Philip_60_Cake.JPG',400,533,'Celebration Cake - 60 - Rev Philip Smith','http://www.clikchurch.com/standrews/images/Philip_60_Cake_thumb.JPG',130, 173,0, 0,'Celebration Cake - 60 - Rev Philip Smith','','','','','');
photos[72] = new photo(5936174,'334959','Rev Philip Smith - 60 - Party Time','gallery','http://www.clikchurch.com/standrews/images/Philip_60_Party_1.JPG',400,300,'Rev Philip Smith - 60 - Party Time','http://www.clikchurch.com/standrews/images/Philip_60_Party_1_thumb.JPG',130, 98,0, 0,'Rev Philip Smith - 60 - Party Time','','','','','');
photos[73] = new photo(5936178,'334959','Rev Philip Smith - 60 - Party Time','gallery','http://www.clikchurch.com/standrews/images/Philip_60_Party_2.JPG',400,533,'Rev Philip Smith - 60 - Party Time','http://www.clikchurch.com/standrews/images/Philip_60_Party_2_thumb.JPG',130, 173,0, 0,'Rev Philip Smith - 60 - Party Time','','','','','');
photos[74] = new photo(5936181,'334959','Remembering Jamie Jackson - New Flood ','gallery','http://www.clikchurch.com/standrews/images/Church_Lit_1.JPG',400,300,'Celebrating the Life of Jamie Jackson - New Flood Lights','http://www.clikchurch.com/standrews/images/Church_Lit_1_thumb.JPG',130, 98,0, 0,'Celebrating the Life of Jamie Jackson - New Flood Lights','','','','','');
photos[75] = new photo(5936196,'334959','Remembering Jamie Jackson - New Flood Lights','gallery','http://www.clikchurch.com/standrews/images/Window_11.JPG',300,400,'Remembering Jamie Jackson - New Flood Lights','http://www.clikchurch.com/standrews/images/Window_11_thumb.JPG',130, 173,0, 0,'Remembering Jamie Jackson - New Flood Lights','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(345533,'6186754,6186750,6186749,6186690,6186684,6186679','One in The Park, June 2010','gallery');
galleries[1] = new gallery(20931,'2722410,2500602,1759714,1759708,1759705,1759699','Congregation','gallery');
galleries[2] = new gallery(22019,'6192794,872997,872885,243908','St. Andrews\' Children.','gallery');
galleries[3] = new gallery(87274,'2722399,2722398,2722397,2722396,2722395,1218392','Church outing','gallery');
galleries[4] = new gallery(45395,'352603,352597,352594,352585','TT Teas','gallery');
galleries[5] = new gallery(53878,'701396','Nativity Pictures.','gallery');
galleries[6] = new gallery(278739,'4887860,4887852','Other occasions.','gallery');
galleries[7] = new gallery(334825,'5935835,5935833,5935824,5935819,5935813,5935807,5935798,5935796,5935789,5935786','Trinity _ Flower Festival 2009','gallery');
galleries[8] = new gallery(334959,'5936196,5936181,5936178,5936174,5936171,5936169','Trinity - Celebrations','gallery');

