/***************************************************************************
* 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) {
	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;
}
/***************************************************************************
* 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('767485,767478,767471,767470,767465,767451,767442,767438,767431,767428,767423');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if (!basic) {
			img.src = 'images/' + 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 = 'images/' + 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('767485,767478,767471,767470,767465,767451,767442,767438,767431,767428,767423');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			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="images/' + photos[j].src + '" width="' + photos[j].width + '" height="' + photos[j].height + '" class="mainhomepageimage" id="mainSample" name="mainSample" alt="' + photos[j].caption  + '" border="0">');
			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="images/' + 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 = 'images/' + 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(767413,'59323','','gallery','Image 00003JPG2.jpg',400,600,'','Image 00003JPG2_thumb.jpg',130, 195,0, 0,'','','','');
photos[1] = new photo(767388,'59323','','gallery','Image 00004JPG1.jpg',400,283,'','Image 00004JPG1_thumb.jpg',130, 92,0, 0,'','','','');
photos[2] = new photo(767417,'59323','','gallery','Image 00005JPG1.jpg',400,267,'','Image 00005JPG1_thumb.jpg',130, 87,0, 0,'','','','');
photos[3] = new photo(767420,'59323','','gallery','Image 00007JPG.jpg',400,283,'','Image 00007JPG_thumb.jpg',130, 92,0, 0,'','','','');
photos[4] = new photo(767423,'59323','','gallery','Image 00008JPG.jpg',400,600,'','Image 00008JPG_thumb.jpg',130, 195,1, 0,'','','','');
photos[5] = new photo(767425,'59323','','gallery','Image 00009JPG.jpg',400,600,'','Image 00009JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[6] = new photo(767428,'59323','','gallery','Image 00010JPG.jpg',400,600,'','Image 00010JPG_thumb.jpg',130, 195,1, 1,'','','','');
photos[7] = new photo(767430,'59323','','gallery','Image 00011JPG.jpg',400,600,'','Image 00011JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[8] = new photo(767431,'59323','','gallery','Image 00012JPG.jpg',400,643,'','Image 00012JPG_thumb.jpg',130, 209,1, 0,'','','','');
photos[9] = new photo(767433,'59323','','gallery','Image 00013JPG.jpg',400,267,'','Image 00013JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[10] = new photo(767435,'59323','','gallery','Image 00014JPG.jpg',400,267,'','Image 00014JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[11] = new photo(767438,'59323','','gallery','Image 00015JPG.jpg',400,614,'','Image 00015JPG_thumb.jpg',130, 200,1, 0,'','','','');
photos[12] = new photo(767440,'59323','','gallery','Image 00016JPG.jpg',400,267,'','Image 00016JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[13] = new photo(767442,'59323','','gallery','Image 00017JPG.jpg',400,267,'','Image 00017JPG_thumb.jpg',130, 87,1, 0,'','','','');
photos[14] = new photo(767444,'59323','','gallery','Image 00018JPG.jpg',400,267,'','Image 00018JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[15] = new photo(767447,'59323','','gallery','Image 00019JPG.jpg',400,565,'','Image 00019JPG_thumb.jpg',130, 184,0, 0,'','','','');
photos[16] = new photo(767449,'59323','','gallery','Image 00020JPG.jpg',400,267,'','Image 00020JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[17] = new photo(767451,'59323','','gallery','Image 00022JPG.jpg',400,600,'','Image 00022JPG_thumb.jpg',130, 195,1, 0,'','','','');
photos[18] = new photo(767453,'59323','','gallery','Image 00023JPG.jpg',400,320,'','Image 00023JPG_thumb.jpg',130, 104,0, 0,'','','','');
photos[19] = new photo(767454,'59323','','gallery','Image 00024JPG.jpg',400,600,'','Image 00024JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[20] = new photo(767456,'59323','','gallery','Image 00025JPG.jpg',400,267,'','Image 00025JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[21] = new photo(767457,'59323','','gallery','Image 00026JPG.jpg',400,267,'','Image 00026JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[22] = new photo(767459,'59323','','gallery','Image 00028JPG.jpg',400,600,'','Image 00028JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[23] = new photo(767461,'59323','','gallery','Image 00029JPG.jpg',400,600,'','Image 00029JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[24] = new photo(767463,'59323','','gallery','Image 00030JPG.jpg',400,565,'','Image 00030JPG_thumb.jpg',130, 184,0, 0,'','','','');
photos[25] = new photo(767465,'59323','','gallery','Image 00031JPG.jpg',400,320,'','Image 00031JPG_thumb.jpg',130, 104,1, 0,'','','','');
photos[26] = new photo(767466,'59323','','gallery','Image 00032JPG.jpg',400,267,'','Image 00032JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[27] = new photo(767468,'59323','','gallery','Image 00033JPG.jpg',400,267,'','Image 00033JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[28] = new photo(767470,'59323','','gallery','Image 00034JPG.jpg',400,565,'','Image 00034JPG_thumb.jpg',130, 184,1, 0,'','','','');
photos[29] = new photo(767471,'59323','','gallery','Image 00036JPG.jpg',400,500,'','Image 00036JPG_thumb.jpg',130, 163,1, 0,'','','','');
photos[30] = new photo(767474,'59323','','gallery','Image 00037JPG.jpg',400,267,'','Image 00037JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[31] = new photo(767477,'59323','','gallery','Image 00038JPG.jpg',400,600,'','Image 00038JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[32] = new photo(767478,'59323','','gallery','Image 00039JPG.jpg',400,267,'','Image 00039JPG_thumb.jpg',130, 87,1, 0,'','','','');
photos[33] = new photo(767480,'59323','','gallery','Image 00040JPG.jpg',400,600,'','Image 00040JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[34] = new photo(767482,'59323','','gallery','Image 00041JPG.jpg',400,267,'','Image 00041JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[35] = new photo(767483,'59323','','gallery','Image 00042JPG.jpg',400,267,'','Image 00042JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[36] = new photo(767484,'59323','','gallery','Image 00043JPG.jpg',400,600,'','Image 00043JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[37] = new photo(767485,'59323','','gallery','Image 00044JPG.jpg',400,600,'','Image 00044JPG_thumb.jpg',130, 195,1, 0,'','','','');
photos[38] = new photo(767486,'59323','','gallery','Image 00045JPG.jpg',400,267,'','Image 00045JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[39] = new photo(767487,'59323','','gallery','Image 00046JPG.jpg',400,601,'','Image 00046JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[40] = new photo(772061,'58144','','gallery','DSCF0039JPG.jpg',450,635,'','DSCF0039JPG_thumb.jpg',130, 183,0, 0,'','','','');
photos[41] = new photo(772066,'58144','','gallery','DSCF0255JPG.jpg',450,672,'','DSCF0255JPG_thumb.jpg',130, 194,0, 0,'','','','');
photos[42] = new photo(772072,'58144','','gallery','DSCF0260JPG.jpg',450,672,'','DSCF0260JPG_thumb.jpg',130, 194,0, 0,'','','','');
photos[43] = new photo(772078,'58144','','gallery','DSCF0043JPG.jpg',450,672,'','DSCF0043JPG_thumb.jpg',130, 194,0, 0,'','','','');
photos[44] = new photo(772082,'58144','','gallery','DSCF0265JPG.jpg',450,672,'','DSCF0265JPG_thumb.jpg',130, 194,0, 0,'','','','');
photos[45] = new photo(772085,'58144','','gallery','DSCF0047JPG.jpg',450,635,'','DSCF0047JPG_thumb.jpg',130, 183,0, 0,'','','','');
photos[46] = new photo(772087,'58144','','gallery','DSCF0131JPG.jpg',450,282,'','DSCF0131JPG_thumb.jpg',130, 81,0, 0,'','','','');
photos[47] = new photo(772093,'58144','','gallery','Image 4JPG.jpg',450,330,'','Image 4JPG_thumb.jpg',130, 95,0, 0,'','','','');
photos[48] = new photo(772095,'58144','','gallery','Image 6JPG.jpg',450,319,'','Image 6JPG_thumb.jpg',130, 92,0, 0,'','','','');
photos[49] = new photo(772099,'58144','','gallery','IMG_1580JPG.jpg',450,675,'','IMG_1580JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[50] = new photo(772101,'58144','','gallery','IMG_1619JPG.jpg',450,675,'','IMG_1619JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[51] = new photo(772103,'58144','','gallery','IMG_1621JPG.jpg',450,675,'','IMG_1621JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[52] = new photo(772105,'58144','','gallery','IMG_1693JPG.jpg',450,675,'','IMG_1693JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[53] = new photo(772109,'58144','','gallery','IMG_1637JPG.jpg',450,300,'','IMG_1637JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[54] = new photo(772111,'58144','','gallery','IMG_1776JPG.jpg',450,300,'','IMG_1776JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[55] = new photo(772114,'58144','','gallery','IMG_1794JPG.jpg',450,675,'','IMG_1794JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[56] = new photo(772117,'58144','','gallery','IMG_1796JPG.jpg',450,300,'','IMG_1796JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[57] = new photo(772123,'58144','','gallery','IMG_1798JPG.jpg',450,300,'','IMG_1798JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[58] = new photo(772126,'58144','','gallery','IMG_1809JPG.jpg',450,300,'','IMG_1809JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[59] = new photo(772127,'58144','','gallery','IMG_1848JPG.jpg',450,675,'','IMG_1848JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[60] = new photo(772128,'58144','','gallery','IMG_1900JPG.jpg',450,675,'','IMG_1900JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[61] = new photo(772420,'59847','','gallery','doorJPG.jpg',450,594,'Malta','doorJPG_thumb.jpg',130, 172,0, 0,'','','','');
photos[62] = new photo(772427,'59847','','gallery','IMG_2066JPG.jpg',450,300,'Malta','IMG_2066JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[63] = new photo(772434,'59847','','gallery','IMG_2103JPG.jpg',450,675,'Malta','IMG_2103JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[64] = new photo(772444,'59847','','gallery','IMG_2107JPG.jpg',450,675,'Malta','IMG_2107JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[65] = new photo(772451,'59847','','gallery','IMG_2137JPG.jpg',450,635,'Malta','IMG_2137JPG_thumb.jpg',130, 183,0, 0,'','','','');
photos[66] = new photo(772459,'59847','','gallery','DSCF0050_1.2JPG.jpg',450,635,'Estonia','DSCF0050_1_thumb.2JPG.jpg',130, 183,0, 0,'','','','');
photos[67] = new photo(772463,'59847','','gallery','DSCF0168.1JPG.jpg',450,672,'Hungary','DSCF0168_thumb.1JPG.jpg',130, 194,0, 0,'','','','');
photos[68] = new photo(772467,'59847','','gallery','IMG_8556JPG.jpg',450,300,'Malaysia','IMG_8556JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[69] = new photo(772475,'59847','','gallery','IMG_8558JPG.jpg',450,465,'Malaysia','IMG_8558JPG_thumb.jpg',130, 134,0, 0,'','','','');
photos[70] = new photo(772477,'59847','','gallery','IMG_8563JPG.jpg',450,675,'Malaysia','IMG_8563JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[71] = new photo(772481,'59847','','gallery','IMG_8607JPG.jpg',450,300,'Malaysia','IMG_8607JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[72] = new photo(772484,'59847','','gallery','IMG_8649JPG.jpg',450,300,'Malaysia','IMG_8649JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[73] = new photo(772489,'59847','','gallery','IMG_8655JPG.jpg',450,300,'Malaysia','IMG_8655JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[74] = new photo(772494,'59847','','gallery','IMG_8658JPG.jpg',450,300,'Malaysia','IMG_8658JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[75] = new photo(772498,'59847','','gallery','IMG_8749JPG.jpg',450,675,'Malaysia','IMG_8749JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[76] = new photo(772501,'59847','','gallery','IMG_8762JPG.jpg',450,300,'Malaysia','IMG_8762JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[77] = new photo(772514,'59847','','gallery','pic 25JPG.jpg',450,301,'South Africa','pic 25JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[78] = new photo(772519,'59847','','gallery','pic 30JPG.jpg',450,672,'South Africa','pic 30JPG_thumb.jpg',130, 194,0, 0,'','','','');
photos[79] = new photo(772522,'59847','','gallery','pic 32JPG.jpg',450,301,'South Africa','pic 32JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[80] = new photo(772526,'59847','','gallery','SA 4JPG.jpg',450,665,'South Africa','SA 4JPG_thumb.jpg',130, 192,0, 0,'','','','');
photos[81] = new photo(772529,'59847','','gallery','SA 10JPG.jpg',450,585,'South Africa','SA 10JPG_thumb.jpg',130, 169,0, 0,'','','','');
photos[82] = new photo(1126067,'59847','Peru','gallery','IMAGE 2JPG.jpg',450,675,'Peru','IMAGE 2JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[83] = new photo(1126068,'59847','','gallery','IMAGE 3JPG.jpg',450,300,'Peru','IMAGE 3JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[84] = new photo(1126069,'59847','','gallery','PERU 1JPG.jpg',450,648,'Peru','PERU 1JPG_thumb.jpg',130, 187,0, 0,'','','','');
photos[85] = new photo(1126070,'59847','','gallery','PERU 4JPG.jpg',450,675,'Peru','PERU 4JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[86] = new photo(1126071,'59847','','gallery','PERU 5JPG.jpg',450,675,'Peru','PERU 5JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[87] = new photo(1126072,'59847','','gallery','PERU 6JPG.jpg',450,675,'Peru','PERU 6JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[88] = new photo(1126073,'59847','','gallery','PERU 7JPG.jpg',450,675,'Peru','PERU 7JPG_thumb.jpg',130, 195,0, 0,'','','','');
photos[89] = new photo(1126074,'59847','','gallery','PERU 8JPG.jpg',450,626,'Peru','PERU 8JPG_thumb.jpg',130, 181,0, 0,'','','','');
photos[90] = new photo(1126075,'59847','','gallery','PERU 9JPG.jpg',450,300,'Peru','PERU 9JPG_thumb.jpg',130, 87,0, 0,'','','','');
photos[91] = new photo(1126076,'59847','','gallery','PERU 10JPG.jpg',450,300,'Peru','PERU 10JPG_thumb.jpg',130, 87,0, 0,'','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(59323,'767428','Weddings','gallery');
galleries[1] = new gallery(58144,'772128,772127,772126,772123,772117,772114,772111,772109,772105,772103','Commercial','gallery');
galleries[2] = new gallery(59847,'1126076,1126075,1126074,1126073,1126072,1126071,1126070,1126069,1126068,1126067','Travel','gallery');

