/***************************************************************************
* 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('2586297,2586272,2534846,2534405,2534371,2533974,2533953,2533918');
	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('2586297,2586272,2534846,2534405,2534371,2533974,2533953,2533918');
	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)) {
		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;
			document.title = 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(2533918,'162174','RP039','gallery','http://admin2.clikpic.com/emmabill/images/RP039.jpg',500,500,'','http://admin2.clikpic.com/emmabill/images/RP039_thumb.jpg',130, 130,1, 0,'','','','','','');
photos[1] = new photo(2563869,'163702','','section206058','http://admin2.clikpic.com/emmabill/images/RP060.jpg',450,450,'RP060','http://admin2.clikpic.com/emmabill/images/RP060_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[2] = new photo(2586272,'163703','','section206059','http://admin2.clikpic.com/emmabill/images/IMG_1760_2.jpg',500,400,'','http://admin2.clikpic.com/emmabill/images/IMG_1760_2_thumb.jpg',130, 104,1, 0,'','','','','','');
photos[3] = new photo(2534001,'162174','RP035','gallery','http://admin2.clikpic.com/emmabill/images/RP035.jpg',401,550,'','http://admin2.clikpic.com/emmabill/images/RP035_thumb.jpg',130, 178,0, 0,'','','','','','');
photos[4] = new photo(2586273,'163703','','section206059','http://admin2.clikpic.com/emmabill/images/IMG_3277_2.jpg',500,400,'','http://admin2.clikpic.com/emmabill/images/IMG_3277_2_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[5] = new photo(2534002,'162174','RP036','gallery','http://admin2.clikpic.com/emmabill/images/RP036.jpg',500,500,'','http://admin2.clikpic.com/emmabill/images/RP036_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[6] = new photo(2586274,'163703','','section206059','http://admin2.clikpic.com/emmabill/images/IMG_3286_2.jpg',500,400,'','http://admin2.clikpic.com/emmabill/images/IMG_3286_2_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[7] = new photo(2534008,'162174','RP037','gallery','http://admin2.clikpic.com/emmabill/images/RP037.jpg',500,500,'','http://admin2.clikpic.com/emmabill/images/RP037_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[8] = new photo(2586275,'163703','','section206059','http://admin2.clikpic.com/emmabill/images/IMG_3289_2.jpg',400,500,'','http://admin2.clikpic.com/emmabill/images/IMG_3289_2_thumb.jpg',130, 163,0, 0,'','','','','','');
photos[9] = new photo(2534080,'162174','RP021','gallery','http://admin2.clikpic.com/emmabill/images/RP021.jpg',401,550,'','http://admin2.clikpic.com/emmabill/images/RP021_thumb.jpg',130, 178,0, 0,'','','','','','');
photos[10] = new photo(2586884,'163703','','section206059','http://admin2.clikpic.com/emmabill/images/Lily 3_21.jpg',500,400,'','http://admin2.clikpic.com/emmabill/images/Lily 3_21_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[11] = new photo(2534019,'162174','RP038','gallery','http://admin2.clikpic.com/emmabill/images/RP038.jpg',500,500,'','http://admin2.clikpic.com/emmabill/images/RP038_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[12] = new photo(2586297,'163703','','section206059','http://admin2.clikpic.com/emmabill/images/IMG_3281_2.jpg',400,500,'','http://admin2.clikpic.com/emmabill/images/IMG_3281_2_thumb.jpg',130, 163,1, 0,'','','','','','');
photos[13] = new photo(2534010,'162174','RP006','gallery','http://admin2.clikpic.com/emmabill/images/RP006.jpg',500,399,'','http://admin2.clikpic.com/emmabill/images/RP006_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[14] = new photo(2534023,'162174','RP040','gallery','http://admin2.clikpic.com/emmabill/images/RP040.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP040_thumb.jpg',130, 95,0, 1,'','','','','','');
photos[15] = new photo(2534015,'162174','RP005','gallery','http://admin2.clikpic.com/emmabill/images/RP005.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP005_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[16] = new photo(2534084,'162174','RP025','gallery','http://admin2.clikpic.com/emmabill/images/RP025.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP025_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[17] = new photo(2535302,'162175','RP009','gallery','http://admin2.clikpic.com/emmabill/images/RP009.jpg',500,399,'','http://admin2.clikpic.com/emmabill/images/RP009_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[18] = new photo(2535306,'162175','RP019','gallery','http://admin2.clikpic.com/emmabill/images/RP019.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP019_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[19] = new photo(2535309,'162175','RP041','gallery','http://admin2.clikpic.com/emmabill/images/RP041.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP041_thumb.jpg',130, 95,0, 1,'','','','','','');
photos[20] = new photo(2535304,'162175','RP014','gallery','http://admin2.clikpic.com/emmabill/images/RP014.jpg',439,550,'','http://admin2.clikpic.com/emmabill/images/RP014_thumb.jpg',130, 163,0, 0,'','','','','','');
photos[21] = new photo(2535307,'162175','RP023','gallery','http://admin2.clikpic.com/emmabill/images/RP023.jpg',401,550,'','http://admin2.clikpic.com/emmabill/images/RP023_thumb.jpg',130, 178,0, 0,'','','','','','');
photos[22] = new photo(2533932,'162175','RP020','gallery','http://admin2.clikpic.com/emmabill/images/RP020.jpg',401,550,'','http://admin2.clikpic.com/emmabill/images/RP020_thumb.jpg',130, 178,0, 0,'','','','','','');
photos[23] = new photo(2535310,'162175','RP042','gallery','http://admin2.clikpic.com/emmabill/images/RP042.jpg',401,550,'','http://admin2.clikpic.com/emmabill/images/RP042_thumb.jpg',130, 178,0, 0,'','','','','','');
photos[24] = new photo(2535314,'162175','RP048','gallery','http://admin2.clikpic.com/emmabill/images/RP048.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP048_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[25] = new photo(2535312,'162175','RP030','gallery','http://admin2.clikpic.com/emmabill/images/RP030.jpg',401,550,'','http://admin2.clikpic.com/emmabill/images/RP030_thumb.jpg',130, 178,0, 0,'','','','','','');
photos[26] = new photo(2535334,'162175','RP034','gallery','http://admin2.clikpic.com/emmabill/images/RP034.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP034_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[27] = new photo(2535328,'162188','RP031','gallery','http://admin2.clikpic.com/emmabill/images/RP031.jpg',401,550,'','http://admin2.clikpic.com/emmabill/images/RP031_thumb.jpg',130, 178,0, 0,'','','','','','');
photos[28] = new photo(2534846,'162188','RP008','gallery','http://admin2.clikpic.com/emmabill/images/RP008.jpg',500,399,'','http://admin2.clikpic.com/emmabill/images/RP008_thumb.jpg',130, 104,1, 0,'','','','','','');
photos[29] = new photo(2534849,'162188','RP024','gallery','http://admin2.clikpic.com/emmabill/images/RP024.jpg',401,550,'','http://admin2.clikpic.com/emmabill/images/RP024_thumb.jpg',130, 178,0, 0,'','','','','','');
photos[30] = new photo(2534854,'162188','RP045','gallery','http://admin2.clikpic.com/emmabill/images/RP045.jpg',500,500,'','http://admin2.clikpic.com/emmabill/images/RP045_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[31] = new photo(2534975,'162188','RP013','gallery','http://admin2.clikpic.com/emmabill/images/RP013.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP013_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[32] = new photo(2533953,'162188','RP007','gallery','http://admin2.clikpic.com/emmabill/images/RP007.jpg',500,500,'','http://admin2.clikpic.com/emmabill/images/RP007_thumb.jpg',130, 130,1, 0,'','','','','','');
photos[33] = new photo(2535169,'162188','RP016','gallery','http://admin2.clikpic.com/emmabill/images/RP016.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP016_thumb.jpg',130, 95,0, 1,'','','','','','');
photos[34] = new photo(2535116,'162188','RP015','gallery','http://admin2.clikpic.com/emmabill/images/RP015.jpg',500,399,'','http://admin2.clikpic.com/emmabill/images/RP015_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[35] = new photo(2535152,'162188','RP003','gallery','http://admin2.clikpic.com/emmabill/images/RP003.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP003_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[36] = new photo(2535325,'162188','RP029','gallery','http://admin2.clikpic.com/emmabill/images/RP029.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP029_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[37] = new photo(2533968,'162189','RP002','gallery','http://admin2.clikpic.com/emmabill/images/RP002.jpg',401,550,'','http://admin2.clikpic.com/emmabill/images/RP002_thumb.jpg',130, 178,0, 0,'','','','','','');
photos[38] = new photo(2535199,'162189','RP012','gallery','http://admin2.clikpic.com/emmabill/images/RP012.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP012_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[39] = new photo(2535261,'162189','RP043','gallery','http://admin2.clikpic.com/emmabill/images/RP043.jpg',401,550,'','http://admin2.clikpic.com/emmabill/images/RP043_thumb.jpg',130, 178,0, 0,'','','','','','');
photos[40] = new photo(2535251,'162189','RP032','gallery','http://admin2.clikpic.com/emmabill/images/RP032.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP032_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[41] = new photo(2535271,'162189','RP050','gallery','http://admin2.clikpic.com/emmabill/images/RP050.jpg',500,399,'','http://admin2.clikpic.com/emmabill/images/RP050_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[42] = new photo(2535257,'162189','RP033','gallery','http://admin2.clikpic.com/emmabill/images/RP033.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP033_thumb.jpg',130, 95,0, 1,'','','','','','');
photos[43] = new photo(2535269,'162189','RP046','gallery','http://admin2.clikpic.com/emmabill/images/RP046.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP046_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[44] = new photo(2535265,'162189','RP044','gallery','http://admin2.clikpic.com/emmabill/images/RP044.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP044_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[45] = new photo(2535196,'162189','RP004','gallery','http://admin2.clikpic.com/emmabill/images/RP004.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP004_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[46] = new photo(2535274,'162189','RP051','gallery','http://admin2.clikpic.com/emmabill/images/RP051.jpg',500,399,'','http://admin2.clikpic.com/emmabill/images/RP051_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[47] = new photo(2533974,'162190','RP028','gallery','http://admin2.clikpic.com/emmabill/images/RP028.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP028_thumb.jpg',130, 95,1, 1,'','','','','','');
photos[48] = new photo(2534624,'162190','RP027','gallery','http://admin2.clikpic.com/emmabill/images/RP027.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP027_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[49] = new photo(2534651,'162190','RP018','gallery','http://admin2.clikpic.com/emmabill/images/RP018.jpg',500,332,'','http://admin2.clikpic.com/emmabill/images/RP018_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[50] = new photo(2534702,'162190','RP047','gallery','http://admin2.clikpic.com/emmabill/images/RP047.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP047_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[51] = new photo(2534709,'162190','RP010','gallery','http://admin2.clikpic.com/emmabill/images/RP010.jpg',500,410,'','http://admin2.clikpic.com/emmabill/images/RP010_thumb.jpg',130, 107,0, 0,'','','','','','');
photos[52] = new photo(2534712,'162190','RP011','gallery','http://admin2.clikpic.com/emmabill/images/RP011.jpg',500,399,'','http://admin2.clikpic.com/emmabill/images/RP011_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[53] = new photo(2534713,'162190','RP052','gallery','http://admin2.clikpic.com/emmabill/images/RP052.jpg',500,399,'','http://admin2.clikpic.com/emmabill/images/RP052_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[54] = new photo(2534716,'162190','RP056','gallery','http://admin2.clikpic.com/emmabill/images/RP056.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP056_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[55] = new photo(2535245,'162190','RP017','gallery','http://admin2.clikpic.com/emmabill/images/RP017.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP017_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[56] = new photo(2533984,'162191','RP057','gallery','http://admin2.clikpic.com/emmabill/images/RP057.jpg',500,387,'','http://admin2.clikpic.com/emmabill/images/RP057_thumb.jpg',130, 101,0, 1,'','','','','','');
photos[57] = new photo(2535343,'162191','RP053','gallery','http://admin2.clikpic.com/emmabill/images/RP053.jpg',500,399,'','http://admin2.clikpic.com/emmabill/images/RP053_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[58] = new photo(2534405,'162191','RP026','gallery','http://admin2.clikpic.com/emmabill/images/RP026.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP026_thumb.jpg',130, 95,1, 0,'','','','','','');
photos[59] = new photo(2534413,'162191','RP059','gallery','http://admin2.clikpic.com/emmabill/images/RP059.jpg',500,399,'','http://admin2.clikpic.com/emmabill/images/RP059_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[60] = new photo(2535127,'162191','RP022','gallery','http://admin2.clikpic.com/emmabill/images/RP022.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP022_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[61] = new photo(2535175,'162191','RP001','gallery','http://admin2.clikpic.com/emmabill/images/RP001.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP001_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[62] = new photo(2535341,'162191','RP049','gallery','http://admin2.clikpic.com/emmabill/images/RP049.jpg',401,550,'','http://admin2.clikpic.com/emmabill/images/RP049_thumb.jpg',130, 178,0, 0,'','','','','','');
photos[63] = new photo(2535180,'162191','RP055','gallery','http://admin2.clikpic.com/emmabill/images/RP055.jpg',500,365,'','http://admin2.clikpic.com/emmabill/images/RP055_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[64] = new photo(2535322,'162191','RP054','gallery','http://admin2.clikpic.com/emmabill/images/RP054.jpg',439,550,'','http://admin2.clikpic.com/emmabill/images/RP054_thumb.jpg',130, 163,0, 0,'','','','','','');
photos[65] = new photo(2534371,'162191','RP058','gallery','http://admin2.clikpic.com/emmabill/images/RP058.jpg',500,252,'','http://admin2.clikpic.com/emmabill/images/RP058_thumb.jpg',130, 66,1, 0,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(162174,'2534023','Gallery 1','gallery');
galleries[1] = new gallery(163702,'2563869','Gallery 1','section206058');
galleries[2] = new gallery(163703,'2586884,2586297,2586275,2586274,2586273,2586272','Gallery 1','section206059');
galleries[3] = new gallery(162175,'2535309','Gallery 2','gallery');
galleries[4] = new gallery(162188,'2535169','Gallery 3','gallery');
galleries[5] = new gallery(162189,'2535257','Gallery 4','gallery');
galleries[6] = new gallery(162190,'2533974','Gallery 5','gallery');
galleries[7] = new gallery(162191,'2533984','Gallery 6','gallery');

