/***************************************************************************
* 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('229258,183769');
	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('229258,183769');
	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)) {
		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 + '" border="0">';
						field.value = photos[nextImg].id;
			document.getElementById('imageTitle').innerHTML = 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(183796,'16951','','gallery','http://www1.clikpic.com/alancairns/images/Barnowl31.jpg',400,315,'','http://www1.clikpic.com/alancairns/images/Barnowl31_thumb.jpg',130, 102,0, 0,'','','','','','');
photos[1] = new photo(183805,'16951','','gallery','http://www1.clikpic.com/alancairns/images/bee2.jpg',400,299,'','http://www1.clikpic.com/alancairns/images/bee2_thumb.jpg',130, 97,0, 1,'','','','','','');
photos[2] = new photo(183944,'16951','','gallery','http://www1.clikpic.com/alancairns/images/common seal3.jpg',400,299,'','http://www1.clikpic.com/alancairns/images/common seal3_thumb.jpg',130, 97,0, 0,'','','','','','');
photos[3] = new photo(183948,'16951','','gallery','http://www1.clikpic.com/alancairns/images/nest15.jpg',400,337,'','http://www1.clikpic.com/alancairns/images/nest15_thumb.jpg',130, 110,0, 0,'','','','','','');
photos[4] = new photo(183949,'16951','','gallery','http://www1.clikpic.com/alancairns/images/ROBIN (cracker).jpg',400,296,'','http://www1.clikpic.com/alancairns/images/ROBIN (cracker)_thumb.jpg',130, 96,0, 0,'','','','','','');
photos[5] = new photo(228808,'16951','','gallery','http://www1.clikpic.com/alancairns/images/web1.jpg',400,330,'','http://www1.clikpic.com/alancairns/images/web1_thumb.jpg',130, 107,0, 0,'','','','','','');
photos[6] = new photo(229285,'16951','','gallery','http://www1.clikpic.com/alancairns/images/rigned plov.,dunlin.jpg',400,291,'','http://www1.clikpic.com/alancairns/images/rigned plov_thumb.,dunlin.jpg',130, 95,0, 0,'','','','','','');
photos[7] = new photo(229286,'16951','','gallery','http://www1.clikpic.com/alancairns/images/IMG_9345.jpg',400,285,'','http://www1.clikpic.com/alancairns/images/IMG_9345_thumb.jpg',130, 93,0, 0,'','','','','','');
photos[8] = new photo(229287,'16951','','gallery','http://www1.clikpic.com/alancairns/images/common toad1.jpg',400,309,'','http://www1.clikpic.com/alancairns/images/common toad1_thumb.jpg',130, 100,0, 0,'','','','','','');
photos[9] = new photo(229288,'16951','','gallery','http://www1.clikpic.com/alancairns/images/WEB2.jpg',400,283,'','http://www1.clikpic.com/alancairns/images/WEB2_thumb.jpg',130, 92,0, 0,'','','','','','');
photos[10] = new photo(201730,'18460','','gallery','http://www1.clikpic.com/alancairns/images/DSCF0175.JPG',400,526,'','http://www1.clikpic.com/alancairns/images/DSCF0175_thumb.JPG',130, 171,0, 1,'','','','','','');
photos[11] = new photo(202991,'18460','','gallery','http://www1.clikpic.com/alancairns/images/butcher copy.jpg',400,485,'','http://www1.clikpic.com/alancairns/images/butcher copy_thumb.jpg',130, 158,0, 0,'','','','','','');
photos[12] = new photo(202992,'18460','','gallery','http://www1.clikpic.com/alancairns/images/cello copy.jpg',400,497,'','http://www1.clikpic.com/alancairns/images/cello copy_thumb.jpg',130, 162,0, 0,'','','','','','');
photos[13] = new photo(202993,'18460','','gallery','http://www1.clikpic.com/alancairns/images/helen copy.jpg',400,465,'','http://www1.clikpic.com/alancairns/images/helen copy_thumb.jpg',130, 151,0, 0,'','','','','','');
photos[14] = new photo(202994,'18460','','gallery','http://www1.clikpic.com/alancairns/images/harp copy.jpg',400,597,'','http://www1.clikpic.com/alancairns/images/harp copy_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[15] = new photo(228801,'18460','','gallery','http://www1.clikpic.com/alancairns/images/41.jpg',400,522,'','http://www1.clikpic.com/alancairns/images/41_thumb.jpg',130, 170,0, 0,'','','','','','');
photos[16] = new photo(228802,'18460','','gallery','http://www1.clikpic.com/alancairns/images/site1.jpg',400,562,'','http://www1.clikpic.com/alancairns/images/site1_thumb.jpg',130, 183,0, 1,'','','','','','');
photos[17] = new photo(229258,'18460','','gallery','http://www1.clikpic.com/alancairns/images/WEBB.jpg',400,585,'','http://www1.clikpic.com/alancairns/images/WEBB_thumb.jpg',130, 190,1, 0,'','','','','','');
photos[18] = new photo(229271,'18460','','gallery','http://www1.clikpic.com/alancairns/images/WEBI.jpg',400,471,'','http://www1.clikpic.com/alancairns/images/WEBI_thumb.jpg',130, 153,0, 0,'','','','','','');
photos[19] = new photo(229884,'18460','','gallery','http://www1.clikpic.com/alancairns/images/violinist.jpg',400,568,'','http://www1.clikpic.com/alancairns/images/violinist_thumb.jpg',130, 185,0, 0,'','','','','','');
photos[20] = new photo(230000,'18460','','gallery','http://www1.clikpic.com/alancairns/images/clio-squat.jpg',400,338,'','http://www1.clikpic.com/alancairns/images/clio-squat_thumb.jpg',130, 110,0, 0,'','','','','','');
photos[21] = new photo(248617,'22516','','gallery','http://www1.clikpic.com/alancairns/images/wedweb1.jpg',400,421,'','http://www1.clikpic.com/alancairns/images/wedweb1_thumb.jpg',130, 137,0, 0,'','','','','','');
photos[22] = new photo(248618,'22516','','gallery','http://www1.clikpic.com/alancairns/images/wedweb2.jpg',400,312,'','http://www1.clikpic.com/alancairns/images/wedweb2_thumb.jpg',130, 101,0, 0,'','','','','','');
photos[23] = new photo(248619,'22516','','gallery','http://www1.clikpic.com/alancairns/images/wedweb4.jpg',400,537,'','http://www1.clikpic.com/alancairns/images/wedweb4_thumb.jpg',130, 175,0, 0,'','','','','','');
photos[24] = new photo(248665,'22516','','gallery','http://www1.clikpic.com/alancairns/images/wedweb121.jpg',400,616,'','http://www1.clikpic.com/alancairns/images/wedweb121_thumb.jpg',130, 200,0, 0,'','','','','','');
photos[25] = new photo(248664,'22516','','gallery','http://www1.clikpic.com/alancairns/images/wedweb101.jpg',517,400,'','http://www1.clikpic.com/alancairns/images/wedweb101_thumb.jpg',130, 101,0, 1,'','','','','','');
photos[26] = new photo(248660,'22516','','gallery','http://www1.clikpic.com/alancairns/images/wedweb11.jpg',400,540,'','http://www1.clikpic.com/alancairns/images/wedweb11_thumb.jpg',130, 176,0, 0,'','','','','','');
photos[27] = new photo(248662,'22516','','gallery','http://www1.clikpic.com/alancairns/images/wedweb16.jpg',400,653,'','http://www1.clikpic.com/alancairns/images/wedweb16_thumb.jpg',130, 212,0, 0,'','','','','','');
photos[28] = new photo(248661,'22516','','gallery','http://www1.clikpic.com/alancairns/images/wedweb14.jpg',400,317,'','http://www1.clikpic.com/alancairns/images/wedweb14_thumb.jpg',130, 103,0, 0,'','','','','','');
photos[29] = new photo(248666,'22516','','gallery','http://www1.clikpic.com/alancairns/images/wedweb151.jpg',400,614,'','http://www1.clikpic.com/alancairns/images/wedweb151_thumb.jpg',130, 200,0, 0,'','','','','','');
photos[30] = new photo(248651,'22516','','gallery','http://www1.clikpic.com/alancairns/images/wedweb5.jpg',400,306,'','http://www1.clikpic.com/alancairns/images/wedweb5_thumb.jpg',130, 99,0, 0,'','','','','','');
photos[31] = new photo(248659,'22516','','gallery','http://www1.clikpic.com/alancairns/images/wedweb9.jpg',400,485,'','http://www1.clikpic.com/alancairns/images/wedweb9_thumb.jpg',130, 158,0, 0,'','','','','','');
photos[32] = new photo(248658,'22516','','gallery','http://www1.clikpic.com/alancairns/images/wedweb8.jpg',400,476,'','http://www1.clikpic.com/alancairns/images/wedweb8_thumb.jpg',130, 155,0, 0,'','','','','','');
photos[33] = new photo(248656,'22516','','gallery','http://www1.clikpic.com/alancairns/images/wedweb6.jpg',400,345,'','http://www1.clikpic.com/alancairns/images/wedweb6_thumb.jpg',130, 112,0, 0,'','','','','','');
photos[34] = new photo(248657,'22516','','gallery','http://www1.clikpic.com/alancairns/images/wedweb7.jpg',400,259,'','http://www1.clikpic.com/alancairns/images/wedweb7_thumb.jpg',130, 84,0, 0,'','','','','','');
photos[35] = new photo(248663,'22516','','gallery','http://www1.clikpic.com/alancairns/images/wedweb17.jpg',400,488,'','http://www1.clikpic.com/alancairns/images/wedweb17_thumb.jpg',130, 159,0, 0,'','','','','','');
photos[36] = new photo(229312,'20693','','gallery','http://www1.clikpic.com/alancairns/images/sands1.JPG',400,265,'','http://www1.clikpic.com/alancairns/images/sands1_thumb.JPG',130, 86,0, 0,'','','','','','');
photos[37] = new photo(229313,'20693','','gallery','http://www1.clikpic.com/alancairns/images/web5.jpg',400,268,'','http://www1.clikpic.com/alancairns/images/web5_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[38] = new photo(229314,'20693','','gallery','http://www1.clikpic.com/alancairns/images/web4.jpg',400,277,'','http://www1.clikpic.com/alancairns/images/web4_thumb.jpg',130, 90,0, 0,'','','','','','');
photos[39] = new photo(229315,'20693','','gallery','http://www1.clikpic.com/alancairns/images/web3.jpg',400,272,'','http://www1.clikpic.com/alancairns/images/web3_thumb.jpg',130, 88,0, 0,'','','','','','');
photos[40] = new photo(229317,'20693','','gallery','http://www1.clikpic.com/alancairns/images/web12.jpg',400,457,'','http://www1.clikpic.com/alancairns/images/web12_thumb.jpg',130, 149,0, 0,'','','','','','');
photos[41] = new photo(229319,'20693','','gallery','http://www1.clikpic.com/alancairns/images/web21.jpg',400,245,'','http://www1.clikpic.com/alancairns/images/web21_thumb.jpg',130, 80,0, 0,'','','','','','');
photos[42] = new photo(187794,'16949','','gallery','http://www1.clikpic.com/alancairns/images/DSCF0002.JPG',268,400,'','http://www1.clikpic.com/alancairns/images/DSCF0002_thumb.JPG',130, 194,0, 1,'','','','','','');
photos[43] = new photo(187797,'16949','','gallery','http://www1.clikpic.com/alancairns/images/DSCF0008.JPG',258,400,'','http://www1.clikpic.com/alancairns/images/DSCF0008_thumb.JPG',130, 202,0, 0,'','','','','','');
photos[44] = new photo(187812,'16949','','gallery','http://www1.clikpic.com/alancairns/images/DSCF00111.JPG',400,260,'','http://www1.clikpic.com/alancairns/images/DSCF00111_thumb.JPG',130, 85,0, 0,'','','','','','');
photos[45] = new photo(188641,'16949','','gallery','http://www1.clikpic.com/alancairns/images/dome reflect .jpg',355,400,'','http://www1.clikpic.com/alancairns/images/dome reflect _thumb.jpg',130, 146,0, 0,'','','','','','');
photos[46] = new photo(188643,'16949','','gallery','http://www1.clikpic.com/alancairns/images/crane .jpg',265,400,'','http://www1.clikpic.com/alancairns/images/crane _thumb.jpg',130, 196,0, 0,'','','','','','');
photos[47] = new photo(188645,'16949','','gallery','http://www1.clikpic.com/alancairns/images/DSCF00432.jpg',400,265,'','http://www1.clikpic.com/alancairns/images/DSCF00432_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[48] = new photo(202987,'16949','','gallery','http://www1.clikpic.com/alancairns/images/botanics copy.jpg',400,584,'','http://www1.clikpic.com/alancairns/images/botanics copy_thumb.jpg',130, 190,0, 0,'','','','','','');
photos[49] = new photo(202988,'16949','','gallery','http://www1.clikpic.com/alancairns/images/escelator1.jpg',400,415,'','http://www1.clikpic.com/alancairns/images/escelator1_thumb.jpg',130, 135,0, 1,'','','','','','');
photos[50] = new photo(202989,'16949','','gallery','http://www1.clikpic.com/alancairns/images/ser foyer.jpg',400,521,'','http://www1.clikpic.com/alancairns/images/ser foyer_thumb.jpg',130, 169,0, 0,'','','','','','');
photos[51] = new photo(229901,'16949','','gallery','http://www1.clikpic.com/alancairns/images/WEB14.jpg',400,280,'','http://www1.clikpic.com/alancairns/images/WEB14_thumb.jpg',130, 91,0, 0,'','','','','','');
photos[52] = new photo(183769,'13386','','gallery','http://www1.clikpic.com/alancairns/images/20.jpg',400,261,'','http://www1.clikpic.com/alancairns/images/20_thumb.jpg',130, 85,1, 0,'','','','','','');
photos[53] = new photo(183773,'13386','','gallery','http://www1.clikpic.com/alancairns/images/dawn2.jpg',400,265,'','http://www1.clikpic.com/alancairns/images/dawn2_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[54] = new photo(183775,'13386','','gallery','http://www1.clikpic.com/alancairns/images/DSCF0025.jpg',400,265,'','http://www1.clikpic.com/alancairns/images/DSCF0025_thumb.jpg',130, 86,0, 1,'','','','','','');
photos[55] = new photo(183951,'13386','','gallery','http://www1.clikpic.com/alancairns/images/sands.JPG',400,265,'','http://www1.clikpic.com/alancairns/images/sands_thumb.JPG',130, 86,0, 0,'','','','','','');
photos[56] = new photo(188650,'13386','','gallery','http://www1.clikpic.com/alancairns/images/fox.jpg',400,301,'','http://www1.clikpic.com/alancairns/images/fox_thumb.jpg',130, 98,0, 1,'','','','','','');
photos[57] = new photo(188653,'13386','','gallery','http://www1.clikpic.com/alancairns/images/old pier drama2.jpg',400,265,'','http://www1.clikpic.com/alancairns/images/old pier drama2_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[58] = new photo(229863,'13386','','gallery','http://www1.clikpic.com/alancairns/images/WEB13.jpg',400,266,'','http://www1.clikpic.com/alancairns/images/WEB13_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[59] = new photo(229864,'13386','','gallery','http://www1.clikpic.com/alancairns/images/WEB31.jpg',400,297,'','http://www1.clikpic.com/alancairns/images/WEB31_thumb.jpg',130, 97,0, 0,'','','','','','');
photos[60] = new photo(229866,'13386','','gallery','http://www1.clikpic.com/alancairns/images/WEB41.jpg',400,265,'','http://www1.clikpic.com/alancairns/images/WEB41_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[61] = new photo(229867,'13386','','gallery','http://www1.clikpic.com/alancairns/images/WEB^.jpg',400,265,'','http://www1.clikpic.com/alancairns/images/WEB^_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[62] = new photo(196959,'20667','','gallery','http://www1.clikpic.com/alancairns/images/18.JPG',400,304,'','http://www1.clikpic.com/alancairns/images/18_thumb.JPG',130, 99,0, 0,'','','','','','');
photos[63] = new photo(196960,'20667','','gallery','http://www1.clikpic.com/alancairns/images/barny closeup liftoff2.jpg',400,265,'','http://www1.clikpic.com/alancairns/images/barny closeup liftoff2_thumb.jpg',130, 86,0, 1,'','','','','','');
photos[64] = new photo(196961,'20667','','gallery','http://www1.clikpic.com/alancairns/images/DSCF0044.JPG',400,301,'','http://www1.clikpic.com/alancairns/images/DSCF0044_thumb.JPG',130, 98,0, 0,'','','','','','');
photos[65] = new photo(196962,'20667','','gallery','http://www1.clikpic.com/alancairns/images/rspb14.JPG',400,265,'','http://www1.clikpic.com/alancairns/images/rspb14_thumb.JPG',130, 86,0, 0,'','','','','','');
photos[66] = new photo(196963,'20667','','gallery','http://www1.clikpic.com/alancairns/images/snipe.jpg',400,300,'','http://www1.clikpic.com/alancairns/images/snipe_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[67] = new photo(196964,'20667','','gallery','http://www1.clikpic.com/alancairns/images/plough1.jpg',400,301,'','http://www1.clikpic.com/alancairns/images/plough1_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[68] = new photo(229880,'20667','','gallery','http://www1.clikpic.com/alancairns/images/WEB6.jpg',400,297,'','http://www1.clikpic.com/alancairns/images/WEB6_thumb.jpg',130, 97,0, 0,'','','','','','');
photos[69] = new photo(229882,'20667','','gallery','http://www1.clikpic.com/alancairns/images/WEB111.jpg',400,273,'','http://www1.clikpic.com/alancairns/images/WEB111_thumb.jpg',130, 89,0, 0,'','','','','','');
photos[70] = new photo(229883,'20667','','gallery','http://www1.clikpic.com/alancairns/images/WEB9.jpg',400,299,'','http://www1.clikpic.com/alancairns/images/WEB9_thumb.jpg',130, 97,0, 0,'','','','','','');
photos[71] = new photo(229916,'20667','','gallery','http://www1.clikpic.com/alancairns/images/WEB22.jpg',400,278,'','http://www1.clikpic.com/alancairns/images/WEB22_thumb.jpg',130, 90,0, 0,'','','','','','');
photos[72] = new photo(196937,'17953','','gallery','http://www1.clikpic.com/alancairns/images/DSCF0009.JPG',400,265,'','http://www1.clikpic.com/alancairns/images/DSCF0009_thumb.JPG',130, 86,0, 0,'','','','','','');
photos[73] = new photo(196939,'17953','','gallery','http://www1.clikpic.com/alancairns/images/DSCF0016c.jpg',400,544,'','http://www1.clikpic.com/alancairns/images/DSCF0016c_thumb.jpg',130, 177,0, 1,'','','','','','');
photos[74] = new photo(196940,'17953','','gallery','http://www1.clikpic.com/alancairns/images/DSCF0017.JPG',400,265,'','http://www1.clikpic.com/alancairns/images/DSCF0017_thumb.JPG',130, 86,0, 0,'','','','','','');
photos[75] = new photo(196941,'17953','','gallery','http://www1.clikpic.com/alancairns/images/DSCF0020c.jpg',400,547,'','http://www1.clikpic.com/alancairns/images/DSCF0020c_thumb.jpg',130, 178,0, 0,'','','','','','');
photos[76] = new photo(196942,'17953','','gallery','http://www1.clikpic.com/alancairns/images/DSCF0022.JPG',400,431,'','http://www1.clikpic.com/alancairns/images/DSCF0022_thumb.JPG',130, 140,0, 0,'','','','','','');
photos[77] = new photo(196943,'17953','','gallery','http://www1.clikpic.com/alancairns/images/DSCF0076.JPG',400,284,'','http://www1.clikpic.com/alancairns/images/DSCF0076_thumb.JPG',130, 92,0, 0,'','','','','','');
photos[78] = new photo(196944,'17953','','gallery','http://www1.clikpic.com/alancairns/images/DSCF0087c.jpg',400,525,'','http://www1.clikpic.com/alancairns/images/DSCF0087c_thumb.jpg',130, 171,0, 0,'','','','','','');
photos[79] = new photo(196946,'17953','','gallery','http://www1.clikpic.com/alancairns/images/DSCF0088.JPG',400,305,'','http://www1.clikpic.com/alancairns/images/DSCF0088_thumb.JPG',130, 99,0, 0,'','','','','','');
photos[80] = new photo(196947,'17953','','gallery','http://www1.clikpic.com/alancairns/images/DSCF0096.JPG',400,390,'','http://www1.clikpic.com/alancairns/images/DSCF0096_thumb.JPG',130, 127,0, 0,'','','','','','');
photos[81] = new photo(229907,'17953','','gallery','http://www1.clikpic.com/alancairns/images/WEB15.jpg',400,319,'','http://www1.clikpic.com/alancairns/images/WEB15_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[82] = new photo(198769,'18114','','gallery','http://www1.clikpic.com/alancairns/images/billy1.jpg',400,593,'','http://www1.clikpic.com/alancairns/images/billy1_thumb.jpg',130, 193,0, 1,'','','','','','');
photos[83] = new photo(198770,'18114','','gallery','http://www1.clikpic.com/alancairns/images/DSCF00112.jpg',400,298,'','http://www1.clikpic.com/alancairns/images/DSCF00112_thumb.jpg',130, 97,0, 0,'','','','','','');
photos[84] = new photo(198771,'18114','','gallery','http://www1.clikpic.com/alancairns/images/DSCF00433.jpg',400,314,'','http://www1.clikpic.com/alancairns/images/DSCF00433_thumb.jpg',130, 102,0, 0,'','','','','','');
photos[85] = new photo(198772,'18114','','gallery','http://www1.clikpic.com/alancairns/images/DSCF0166.jpg',400,276,'','http://www1.clikpic.com/alancairns/images/DSCF0166_thumb.jpg',130, 90,0, 0,'','','','','','');
photos[86] = new photo(198773,'18114','','gallery','http://www1.clikpic.com/alancairns/images/nigel1.jpg',400,441,'','http://www1.clikpic.com/alancairns/images/nigel1_thumb.jpg',130, 143,0, 0,'','','','','','');
photos[87] = new photo(1744636,'117225','','gallery','http://www1.clikpic.com/alancairns/images/arcs.jpg',299,450,'Arcs','http://www1.clikpic.com/alancairns/images/arcs_thumb.jpg',130, 196,0, 0,'','','','','','');
photos[88] = new photo(1744616,'117225','','gallery','http://www1.clikpic.com/alancairns/images/dany.jpg',336,504,'Dany','http://www1.clikpic.com/alancairns/images/dany_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[89] = new photo(1744637,'117225','','gallery','http://www1.clikpic.com/alancairns/images/stained glass floor.jpg',300,450,'Stained Glass Floor','http://www1.clikpic.com/alancairns/images/stained glass floor_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[90] = new photo(1744601,'117225','','gallery','http://www1.clikpic.com/alancairns/images/dawn preperations.jpg',540,361,'Dawn Preparations','http://www1.clikpic.com/alancairns/images/dawn preperations_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[91] = new photo(1744602,'117225','','gallery','http://www1.clikpic.com/alancairns/images/heaven.jpg',360,540,'Heaven','http://www1.clikpic.com/alancairns/images/heaven_thumb.jpg',130, 195,0, 1,'','','','','','');
photos[92] = new photo(1744603,'117225','','gallery','http://www1.clikpic.com/alancairns/images/kite surfer.jpg',361,540,'Kite Surfer','http://www1.clikpic.com/alancairns/images/kite surfer_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[93] = new photo(1744604,'117225','','gallery','http://www1.clikpic.com/alancairns/images/liquid legs.jpg',540,361,'Liquid Legs','http://www1.clikpic.com/alancairns/images/liquid legs_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[94] = new photo(1744605,'117225','','gallery','http://www1.clikpic.com/alancairns/images/self portrait .jpg',540,360,'Green Boat ','http://www1.clikpic.com/alancairns/images/self portrait _thumb.jpg',130, 87,0, 0,'','','','','','');
photos[95] = new photo(1744606,'117225','','gallery','http://www1.clikpic.com/alancairns/images/sisters bathing.jpg',600,401,'Sisters Bathing','http://www1.clikpic.com/alancairns/images/sisters bathing_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[96] = new photo(1744607,'117225','','gallery','http://www1.clikpic.com/alancairns/images/twenty two.jpg',360,540,'Twenty Two','http://www1.clikpic.com/alancairns/images/twenty two_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[97] = new photo(1744608,'117225','','gallery','http://www1.clikpic.com/alancairns/images/views from a lighthouse.jpg',360,541,'Views from a Lighthouse','http://www1.clikpic.com/alancairns/images/views from a lighthouse_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[98] = new photo(1744609,'117225','','gallery','http://www1.clikpic.com/alancairns/images/yellow bouys.jpg',361,540,'Yellow Bouys','http://www1.clikpic.com/alancairns/images/yellow bouys_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[99] = new photo(1945309,'130221','','gallery','http://www1.clikpic.com/alancairns/images/BC33w.jpg',600,402,'','http://www1.clikpic.com/alancairns/images/BC33w_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[100] = new photo(1945310,'130221','','gallery','http://www1.clikpic.com/alancairns/images/BC35w.jpg',600,397,'','http://www1.clikpic.com/alancairns/images/BC35w_thumb.jpg',130, 86,0, 1,'','','','','','');
photos[101] = new photo(1945311,'130221','','gallery','http://www1.clikpic.com/alancairns/images/BC39w.jpg',600,402,'','http://www1.clikpic.com/alancairns/images/BC39w_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[102] = new photo(1945312,'130221','','gallery','http://www1.clikpic.com/alancairns/images/BC51w.jpg',600,402,'','http://www1.clikpic.com/alancairns/images/BC51w_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[103] = new photo(1945313,'130221','','gallery','http://www1.clikpic.com/alancairns/images/BC54w.jpg',600,391,'','http://www1.clikpic.com/alancairns/images/BC54w_thumb.jpg',130, 85,0, 0,'','','','','','');
photos[104] = new photo(1945314,'130221','','gallery','http://www1.clikpic.com/alancairns/images/DSCF0033w.jpg',600,402,'','http://www1.clikpic.com/alancairns/images/DSCF0033w_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[105] = new photo(1945315,'130221','','gallery','http://www1.clikpic.com/alancairns/images/DSCF0035w.jpg',600,397,'','http://www1.clikpic.com/alancairns/images/DSCF0035w_thumb.jpg',130, 86,0, 0,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(16951,'183805','Wildlife','gallery');
galleries[1] = new gallery(18460,'228802,201730','People','gallery');
galleries[2] = new gallery(22516,'248664','Weddings ','gallery');
galleries[3] = new gallery(20693,'229319,229317,229315,229314,229313,229312','Aerial Photography','gallery');
galleries[4] = new gallery(16949,'202988,187794','Architecture','gallery');
galleries[5] = new gallery(13386,'188650,183775','Landscape','gallery');
galleries[6] = new gallery(20667,'196960','Client Folio 1: R.S.P.B.','gallery');
galleries[7] = new gallery(17953,'196939','Client Folio2: LEADER+ ','gallery');
galleries[8] = new gallery(18114,'198769','Client folio 3: R.N.L.I.','gallery');
galleries[9] = new gallery(117225,'1744602','Exhibitions','gallery');
galleries[10] = new gallery(130221,'1945310','Blue Neon Circle','gallery');

