/***************************************************************************
* 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('1726076,1726066,1697986,1697982,1697977,1643935,1643524,1643173,1643169,1643160,1531876,1383418,1366844,1312237,1312217,946113,941027');
	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('1726076,1726066,1697986,1697982,1697977,1643935,1643524,1643173,1643169,1643160,1531876,1383418,1366844,1312237,1312217,946113,941027');
	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 && !((1) || (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 = 'Kat Busby: ' + 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(941027,'','','','http://www1.clikpic.com/katbusby/images/KAT.jpg',450,600,'','http://www1.clikpic.com/katbusby/images/KAT_thumb.jpg',130, 173,1, 0,'','','','','','');
photos[1] = new photo(1745347,'','ORIGINAL PHOTO','','http://www1.clikpic.com/katbusby/images/Johns Boat Before.jpg',300,475,'Original Photograph','http://www1.clikpic.com/katbusby/images/Johns Boat Before_thumb.jpg',130, 206,0, 0,'','','','','','');
photos[2] = new photo(1745354,'','AFTER -  Black and White Treatment','','http://www1.clikpic.com/katbusby/images/JOHNS BOAT 3.jpg',300,425,'Restored - sepia treatment','http://www1.clikpic.com/katbusby/images/JOHNS BOAT 3_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[3] = new photo(1745357,'','','','http://www1.clikpic.com/katbusby/images/JOHNS BOAT 4.jpg',300,425,'Restored - sepia treatment and softened','http://www1.clikpic.com/katbusby/images/JOHNS BOAT 4_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[4] = new photo(1745359,'',' ','','http://www1.clikpic.com/katbusby/images/JOHNS BOAT 5.jpg',300,425,'Restored - black and white','http://www1.clikpic.com/katbusby/images/JOHNS BOAT 5_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[5] = new photo(1366844,'95520','PEARL OF WISDOM','gallery','http://www1.clikpic.com/katbusby/images/The-Box-3.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/The-Box-3_thumb.jpg',130, 184,1, 0,'','','','','','');
photos[6] = new photo(1366874,'95520','SUNFLOWERS TOGETHER','gallery','http://www1.clikpic.com/katbusby/images/PAIR-WATERCOLOR.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/PAIR-WATERCOLOR_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[7] = new photo(1366876,'95520','SEPTEMBER SUNFLOWER','gallery','http://www1.clikpic.com/katbusby/images/SUNFLOWER-2.jpg',400,600,'','http://www1.clikpic.com/katbusby/images/SUNFLOWER-2_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[8] = new photo(1383296,'95520','QUEEN OF HEARTS','gallery','http://www1.clikpic.com/katbusby/images/GATES-FINISHED.jpg',600,446,'','http://www1.clikpic.com/katbusby/images/GATES-FINISHED_thumb.jpg',130, 97,0, 0,'','','','','','');
photos[9] = new photo(1531872,'95520','RINGS OF TIME','gallery','http://www1.clikpic.com/katbusby/images/CLOCK.jpg',450,600,'','http://www1.clikpic.com/katbusby/images/CLOCK_thumb.jpg',130, 173,0, 1,'','','','','','');
photos[10] = new photo(1531874,'95520','THROUGH THE KEY HOLE','gallery','http://www1.clikpic.com/katbusby/images/DOOR-2.jpg',396,600,'','http://www1.clikpic.com/katbusby/images/DOOR-2_thumb.jpg',130, 197,0, 0,'','','','','','');
photos[11] = new photo(1531876,'95520','SONNING ON THAMES','gallery','http://www1.clikpic.com/katbusby/images/SONNING-BRIDGE.jpg',600,413,'','http://www1.clikpic.com/katbusby/images/SONNING-BRIDGE_thumb.jpg',130, 89,1, 0,'','','','','','');
photos[12] = new photo(1531888,'95520','SMOULDERING HEART','gallery','http://www1.clikpic.com/katbusby/images/SMOKEY-HEART.jpg',394,600,'','http://www1.clikpic.com/katbusby/images/SMOKEY-HEART_thumb.jpg',130, 198,0, 0,'','','','','','');
photos[13] = new photo(1531892,'95520','ETERNAL HEART ','gallery','http://www1.clikpic.com/katbusby/images/CANDLE-3.jpg',425,600,'','http://www1.clikpic.com/katbusby/images/CANDLE-3_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[14] = new photo(1531903,'95520','MELTING','gallery','http://www1.clikpic.com/katbusby/images/Lily-fire-2.jpg',450,600,'','http://www1.clikpic.com/katbusby/images/Lily-fire-2_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[15] = new photo(1643160,'95520','AT THE BOTTOM OF THE GARDEN','gallery','http://www1.clikpic.com/katbusby/images/AT-THE-BOTTOM-OF-THE-GARDEN.jpg',600,457,'','http://www1.clikpic.com/katbusby/images/AT-THE-BOTTOM-OF-THE-GARDEN_thumb.jpg',130, 99,1, 0,'','','','','','');
photos[16] = new photo(1643169,'95520','TEAR STAINS','gallery','http://www1.clikpic.com/katbusby/images/RAIN-DROP-4.jpg',420,600,'','http://www1.clikpic.com/katbusby/images/RAIN-DROP-4_thumb.jpg',130, 186,1, 0,'','','','','','');
photos[17] = new photo(1643173,'95520','GALLAXY OF HEARTS','gallery','http://www1.clikpic.com/katbusby/images/HEART-FINAL.jpg',600,425,'','http://www1.clikpic.com/katbusby/images/HEART-FINAL_thumb.jpg',130, 92,1, 0,'','','','','','');
photos[18] = new photo(1643516,'95520','DANCING LIGHTS','gallery','http://www1.clikpic.com/katbusby/images/KAT-MOVEMENT-A3-.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/KAT-MOVEMENT-A3-_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[19] = new photo(1643530,'95520','OAK LEAF','gallery','http://www1.clikpic.com/katbusby/images/OAK-LEAF-2.jpg',600,425,'','http://www1.clikpic.com/katbusby/images/OAK-LEAF-2_thumb.jpg',130, 92,0, 0,'','','','','','');
photos[20] = new photo(1643935,'95520','A DROP OF RAIN IN AUTUMN','gallery','http://www1.clikpic.com/katbusby/images/A-DROP-OF-RAIN-IN-AUTUMN-copy.jpg',425,600,'','http://www1.clikpic.com/katbusby/images/A-DROP-OF-RAIN-IN-AUTUMN-copy_thumb.jpg',130, 184,1, 0,'','','','','','');
photos[21] = new photo(1697977,'95520','The Golden Lake','gallery','http://www1.clikpic.com/katbusby/images/WOODS-4.jpg',600,407,'','http://www1.clikpic.com/katbusby/images/WOODS-4_thumb.jpg',130, 88,1, 0,'','','','','','');
photos[22] = new photo(1697982,'95520','Pink','gallery','http://www1.clikpic.com/katbusby/images/SHALLS-CARD-copy.jpg',600,450,'','http://www1.clikpic.com/katbusby/images/SHALLS-CARD-copy_thumb.jpg',130, 98,1, 0,'','','','','','');
photos[23] = new photo(1697986,'95520','To See a White Feather','gallery','http://www1.clikpic.com/katbusby/images/FUNGI-FEATHER-4-copy.jpg',413,600,'','http://www1.clikpic.com/katbusby/images/FUNGI-FEATHER-4-copy_thumb.jpg',130, 189,1, 1,'','','','','','');
photos[24] = new photo(1726066,'95520','ELEGANCE','gallery','http://www1.clikpic.com/katbusby/images/FLOWER-3-copy.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/FLOWER-3-copy_thumb.jpg',130, 184,1, 0,'','','','','','');
photos[25] = new photo(1726076,'95520','UNVEILED BEAUTY','gallery','http://www1.clikpic.com/katbusby/images/LILY-1.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/LILY-1_thumb.jpg',130, 184,1, 0,'','','','','','');
photos[26] = new photo(1939222,'95520','Lily','gallery','http://www1.clikpic.com/katbusby/images/IMG_1605.jpg',600,400,'','http://www1.clikpic.com/katbusby/images/IMG_1605_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[27] = new photo(1939266,'95520','Wedding Suit','gallery','http://www1.clikpic.com/katbusby/images/SUIT.jpg',425,600,'','http://www1.clikpic.com/katbusby/images/SUIT_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[28] = new photo(1939271,'95520','Single Tulip ','gallery','http://www1.clikpic.com/katbusby/images/TULIP.jpg',400,600,'','http://www1.clikpic.com/katbusby/images/TULIP_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[29] = new photo(1939272,'95520','Tulip 2','gallery','http://www1.clikpic.com/katbusby/images/TULIP-3a.jpg',400,600,'','http://www1.clikpic.com/katbusby/images/TULIP-3a_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[30] = new photo(1939275,'95520','Tulip 2 landscape','gallery','http://www1.clikpic.com/katbusby/images/TULIP-4a.jpg',600,400,'','http://www1.clikpic.com/katbusby/images/TULIP-4a_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[31] = new photo(1939334,'95520','Tulip Triptych','gallery','http://www1.clikpic.com/katbusby/images/TRIPTYCH-tulips.jpg',600,424,'','http://www1.clikpic.com/katbusby/images/TRIPTYCH-tulips_thumb.jpg',130, 92,0, 0,'','','','','','');
photos[32] = new photo(1312213,'92835','BEYOND','gallery','http://www1.clikpic.com/katbusby/images/BEYOND.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/BEYOND_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[33] = new photo(1312217,'92835','FLORA EROTICA','gallery','http://www1.clikpic.com/katbusby/images/FLORA-EROTICA.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/FLORA-EROTICA_thumb.jpg',130, 184,1, 1,'','','','','','');
photos[34] = new photo(1312228,'92835','PINK KISSES','gallery','http://www1.clikpic.com/katbusby/images/PINK-KISSES.jpg',600,424,'','http://www1.clikpic.com/katbusby/images/PINK-KISSES_thumb.jpg',130, 92,0, 0,'','','','','','');
photos[35] = new photo(1312233,'92835','SHE MELTS','gallery','http://www1.clikpic.com/katbusby/images/SHE-MELTS.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/SHE-MELTS_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[36] = new photo(1312237,'92835','RUBY RAINDROPS','gallery','http://www1.clikpic.com/katbusby/images/RUBY-RAIN-DROPS.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/RUBY-RAIN-DROPS_thumb.jpg',130, 184,1, 0,'','','','','','');
photos[37] = new photo(1312238,'92835','SHE LOVES ME...','gallery','http://www1.clikpic.com/katbusby/images/SHE-LOVES-ME.jpg',430,600,'','http://www1.clikpic.com/katbusby/images/SHE-LOVES-ME_thumb.jpg',130, 181,0, 0,'','','','','','');
photos[38] = new photo(1312240,'92835','DANCING IN THE DARK','gallery','http://www1.clikpic.com/katbusby/images/Dancing-in-the-dark.jpg',400,600,'','http://www1.clikpic.com/katbusby/images/Dancing-in-the-dark_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[39] = new photo(1312242,'92835','DANCING IN THE DARK...TOGETHER','gallery','http://www1.clikpic.com/katbusby/images/DANCING-IN-THE-DARK-TOGETHE.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/DANCING-IN-THE-DARK-TOGETHE_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[40] = new photo(1312272,'92835','CURVACIOUS','gallery','http://www1.clikpic.com/katbusby/images/CURVACIOUS.jpg',600,400,'','http://www1.clikpic.com/katbusby/images/CURVACIOUS_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[41] = new photo(521165,'40339','','gallery','http://www1.clikpic.com/katbusby/images/Diffused-Glow3.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/Diffused-Glow3_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[42] = new photo(521172,'40339','','gallery','http://www1.clikpic.com/katbusby/images/Pearl1.jpg',500,500,'','http://www1.clikpic.com/katbusby/images/Pearl1_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[43] = new photo(521188,'40339','','gallery','http://www1.clikpic.com/katbusby/images/Three.jpg',500,500,'','http://www1.clikpic.com/katbusby/images/Three_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[44] = new photo(946113,'40339','','gallery','http://www1.clikpic.com/katbusby/images/Kat-Lights1.jpg',500,333,'','http://www1.clikpic.com/katbusby/images/Kat-Lights1_thumb.jpg',130, 87,1, 1,'','','','','','');
photos[45] = new photo(1643524,'40339','THE KAT THAT GOT THE CREAM','gallery','http://www1.clikpic.com/katbusby/images/THE-CAT-THAT-GOT-THE-CREAM-copy.jpg',600,412,'','http://www1.clikpic.com/katbusby/images/THE-CAT-THAT-GOT-THE-CREAM-copy_thumb.jpg',130, 89,1, 0,'','','','','','');
photos[46] = new photo(521752,'40382','','gallery','http://www1.clikpic.com/katbusby/images/Head-on-knee.jpg',500,500,'','http://www1.clikpic.com/katbusby/images/Head-on-knee_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[47] = new photo(522355,'40382','','gallery','http://www1.clikpic.com/katbusby/images/BW-Kat-eyes-shut1.jpg',500,500,'','http://www1.clikpic.com/katbusby/images/BW-Kat-eyes-shut1_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[48] = new photo(655197,'40382','','gallery','http://www1.clikpic.com/katbusby/images/HAIR-movement.jpg',500,500,'','http://www1.clikpic.com/katbusby/images/HAIR-movement_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[49] = new photo(655199,'40382','','gallery','http://www1.clikpic.com/katbusby/images/Black-shirt-arm-around.jpg',500,491,'','http://www1.clikpic.com/katbusby/images/Black-shirt-arm-around_thumb.jpg',130, 128,0, 0,'','','','','','');
photos[50] = new photo(655200,'40382','','gallery','http://www1.clikpic.com/katbusby/images/KAT-BW-3.jpg',500,500,'','http://www1.clikpic.com/katbusby/images/KAT-BW-3_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[51] = new photo(1531928,'40382','','gallery','http://www1.clikpic.com/katbusby/images/RISING.jpg',425,600,'','http://www1.clikpic.com/katbusby/images/RISING_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[52] = new photo(1383418,'40382','REFLECTIONS','gallery','http://www1.clikpic.com/katbusby/images/REFLECTION.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/REFLECTION_thumb.jpg',130, 184,1, 0,'','','','','','');
photos[53] = new photo(680277,'52022','','gallery','http://www1.clikpic.com/katbusby/images/Adam-dark-feather.jpg',500,500,'','http://www1.clikpic.com/katbusby/images/Adam-dark-feather_thumb.jpg',130, 130,0, 1,'','','','','','');
photos[54] = new photo(680279,'52022','','gallery','http://www1.clikpic.com/katbusby/images/Adam-Nat-Rugby-Shirt.jpg',399,600,'','http://www1.clikpic.com/katbusby/images/Adam-Nat-Rugby-Shirt_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[55] = new photo(680281,'52022','','gallery','http://www1.clikpic.com/katbusby/images/Nat.jpg',400,560,'','http://www1.clikpic.com/katbusby/images/Nat_thumb.jpg',130, 182,0, 0,'','','','','','');
photos[56] = new photo(680282,'52022','','gallery','http://www1.clikpic.com/katbusby/images/Nathan-and-Adam.jpg',400,560,'','http://www1.clikpic.com/katbusby/images/Nathan-and-Adam_thumb.jpg',130, 182,0, 0,'','','','','','');
photos[57] = new photo(680283,'52022','','gallery','http://www1.clikpic.com/katbusby/images/Nathan-ans-Adam-2-01.jpg',400,560,'','http://www1.clikpic.com/katbusby/images/Nathan-ans-Adam-2-01_thumb.jpg',130, 182,0, 0,'','','','','','');
photos[58] = new photo(1294217,'91728','SOLO','gallery','http://www1.clikpic.com/katbusby/images/SOLO.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/SOLO_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[59] = new photo(1294248,'91728','DUO','gallery','http://www1.clikpic.com/katbusby/images/DUO.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/DUO_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[60] = new photo(1294257,'91728','ENCORE','gallery','http://www1.clikpic.com/katbusby/images/ENCORE.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/ENCORE_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[61] = new photo(680324,'51815','','gallery','http://www1.clikpic.com/katbusby/images/Zak.jpg',400,560,'','http://www1.clikpic.com/katbusby/images/Zak_thumb.jpg',130, 182,0, 0,'','','','','','');
photos[62] = new photo(682231,'51815','','gallery','http://www1.clikpic.com/katbusby/images/Dana.jpg',400,500,'','http://www1.clikpic.com/katbusby/images/Dana_thumb.jpg',130, 163,0, 0,'','','','','','');
photos[63] = new photo(682232,'51815','','gallery','http://www1.clikpic.com/katbusby/images/Dana-close-up.jpg',500,382,'','http://www1.clikpic.com/katbusby/images/Dana-close-up_thumb.jpg',130, 99,0, 1,'','','','','','');
photos[64] = new photo(683398,'51815','','gallery','http://www1.clikpic.com/katbusby/images/IMG_1361.jpg',500,400,'','http://www1.clikpic.com/katbusby/images/IMG_1361_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[65] = new photo(1939336,'51815','Yellow','gallery','http://www1.clikpic.com/katbusby/images/ZAK-YELLOW-ROSE-REFLECTION.jpg',450,600,'','http://www1.clikpic.com/katbusby/images/ZAK-YELLOW-ROSE-REFLECTION_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[66] = new photo(680319,'51815','','gallery','http://www1.clikpic.com/katbusby/images/Cats.jpg',500,400,'','http://www1.clikpic.com/katbusby/images/Cats_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[67] = new photo(1312296,'91714','SINGLE ROSE BEHIND GLASS','gallery','http://www1.clikpic.com/katbusby/images/SINGLE-ROSE-BEHIND-GLASS1.jpg',600,600,'','http://www1.clikpic.com/katbusby/images/SINGLE-ROSE-BEHIND-GLASS1_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[68] = new photo(1294136,'91714','HURT','gallery','http://www1.clikpic.com/katbusby/images/HURT.jpg',500,353,'','http://www1.clikpic.com/katbusby/images/HURT_thumb.jpg',130, 92,0, 0,'','','','','','');
photos[69] = new photo(1294123,'91714','PINK LADY','gallery','http://www1.clikpic.com/katbusby/images/PINK-LADY.jpg',500,353,'','http://www1.clikpic.com/katbusby/images/PINK-LADY_thumb.jpg',130, 92,0, 0,'','','','','','');
photos[70] = new photo(1294144,'91714','COLOURBLIND','gallery','http://www1.clikpic.com/katbusby/images/COLOURBLIND.jpg',500,353,'','http://www1.clikpic.com/katbusby/images/COLOURBLIND_thumb.jpg',130, 92,0, 0,'','','','','','');
photos[71] = new photo(1294056,'91714','AMBER ROSE','gallery','http://www1.clikpic.com/katbusby/images/AMBER-ROSE.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/AMBER-ROSE_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[72] = new photo(1294162,'91714','ROSES BEHIND GLASS','gallery','http://www1.clikpic.com/katbusby/images/ROSES-BEHIND-GLASS.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/ROSES-BEHIND-GLASS_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[73] = new photo(1294187,'91714','SWIRLS','gallery','http://www1.clikpic.com/katbusby/images/SWIRLS.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/SWIRLS_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[74] = new photo(1294194,'91714','WARTH OF SUMMER','gallery','http://www1.clikpic.com/katbusby/images/WARMTH-OF-SUMMER.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/WARMTH-OF-SUMMER_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[75] = new photo(1312271,'92848','LEAVES','gallery','http://www1.clikpic.com/katbusby/images/LEAVES.jpg',600,480,'','http://www1.clikpic.com/katbusby/images/LEAVES_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[76] = new photo(1312247,'92848','DETERMINATION','gallery','http://www1.clikpic.com/katbusby/images/DETERMINATION.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/DETERMINATION_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[77] = new photo(1312248,'92848','TENACITY','gallery','http://www1.clikpic.com/katbusby/images/TENACITY.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/TENACITY_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[78] = new photo(1312249,'92848','FUNNEL OF LIGHT','gallery','http://www1.clikpic.com/katbusby/images/FUNNEL-OF-LIGHT.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/FUNNEL-OF-LIGHT_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[79] = new photo(1294366,'91735','SPEARS','gallery','http://www1.clikpic.com/katbusby/images/SPEARS.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/SPEARS_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[80] = new photo(1294369,'91735','BINDING','gallery','http://www1.clikpic.com/katbusby/images/BINDING.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/BINDING_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[81] = new photo(1294374,'91735','STRENGTH','gallery','http://www1.clikpic.com/katbusby/images/STRENGTH.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/STRENGTH_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[82] = new photo(1294380,'91735','MAGIC','gallery','http://www1.clikpic.com/katbusby/images/MAGIC.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/MAGIC_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[83] = new photo(1294384,'91735','HOUR','gallery','http://www1.clikpic.com/katbusby/images/HOUR.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/HOUR_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[84] = new photo(1312200,'92865','PRELUDE','gallery','http://www1.clikpic.com/katbusby/images/PRELUDE.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/PRELUDE_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[85] = new photo(1312203,'92865','INTERLUDE','gallery','http://www1.clikpic.com/katbusby/images/INTERLUDE.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/INTERLUDE_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[86] = new photo(1312206,'92865','ENCORE','gallery','http://www1.clikpic.com/katbusby/images/SHE-WORE-PEARLS.jpg',424,600,'','http://www1.clikpic.com/katbusby/images/SHE-WORE-PEARLS_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[87] = new photo(695778,'51758','','gallery','http://www1.clikpic.com/katbusby/images/Guitar.jpg',400,571,'','http://www1.clikpic.com/katbusby/images/Guitar_thumb.jpg',130, 186,0, 0,'','','','','','');
photos[88] = new photo(738638,'51758','','gallery','http://www1.clikpic.com/katbusby/images/Bottle.jpg',400,555,'','http://www1.clikpic.com/katbusby/images/Bottle_thumb.jpg',130, 180,0, 0,'','','','','','');
photos[89] = new photo(936937,'51758','','gallery','http://www1.clikpic.com/katbusby/images/LIP-1-(1).jpg',400,566,'','http://www1.clikpic.com/katbusby/images/LIP-1-(1)_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[90] = new photo(936938,'51758','','gallery','http://www1.clikpic.com/katbusby/images/LIP-2-(1).jpg',400,566,'','http://www1.clikpic.com/katbusby/images/LIP-2-(1)_thumb.jpg',130, 184,0, 0,'','','','','','');
photos[91] = new photo(936940,'51758','','gallery','http://www1.clikpic.com/katbusby/images/leaf-3.jpg',400,571,'','http://www1.clikpic.com/katbusby/images/leaf-3_thumb.jpg',130, 186,0, 0,'','','','','','');
photos[92] = new photo(1312479,'51758','REGATTA','gallery','http://www1.clikpic.com/katbusby/images/REGATTA2.jpg',600,424,'','http://www1.clikpic.com/katbusby/images/REGATTA2_thumb.jpg',130, 92,0, 1,'','','','','','');
photos[93] = new photo(1531909,'51758','ROBIN','gallery','http://www1.clikpic.com/katbusby/images/Robin.jpg',600,468,'','http://www1.clikpic.com/katbusby/images/Robin_thumb.jpg',130, 101,0, 0,'','','','','','');
photos[94] = new photo(677948,'51758','','gallery','http://www1.clikpic.com/katbusby/images/Paints.jpg',500,500,'','http://www1.clikpic.com/katbusby/images/Paints_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[95] = new photo(680333,'51758','','gallery','http://www1.clikpic.com/katbusby/images/Rayburn.jpg',400,566,'','http://www1.clikpic.com/katbusby/images/Rayburn_thumb.jpg',130, 184,0, 0,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(95520,'1697986,1531872','NEW','gallery');
galleries[1] = new gallery(91702,'1312217','EMOTIONS 2007 ','gallery');
galleries[2] = new gallery(39930,'946113','Self Portraits','gallery');
galleries[3] = new gallery(92835,'1312217','SUGGESTIONS','gallery');
galleries[4] = new gallery(40339,'946113','Colour','gallery');
galleries[5] = new gallery(40382,'1531928,1383418,655200,655199,655197,522355,521752','Black and White','gallery');
galleries[6] = new gallery(52022,'680277','People','gallery');
galleries[7] = new gallery(91728,'1294257,1294248,1294217','THE LILY','gallery');
galleries[8] = new gallery(51815,'682232','Animals','gallery');
galleries[9] = new gallery(91714,'1312296,1294194,1294187,1294162,1294144,1294136,1294123,1294056','ROSES','gallery');
galleries[10] = new gallery(92848,'1312271,1312249,1312248,1312247','FOLIAGE','gallery');
galleries[11] = new gallery(91735,'1294384,1294380,1294374,1294369,1294366','LATIN THEME','gallery');
galleries[12] = new gallery(92865,'1312206,1312203,1312200','INTIMACY','gallery');
galleries[13] = new gallery(51758,'1312479','Random Distractions','gallery');

