/***************************************************************************
* 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('2862809');
	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('2862809');
	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) || (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 + '">';
						field.value = photos[nextImg].id;
			document.getElementById('imageTitle').innerHTML = photos[nextImg].caption;
									document.title = 'Ed Bradley Art: ' + 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(2862809,'177496','Oil on Canvas - Framed 34\"X 46\"','gallery','http://admin2.clikpic.com/eddieb/images/Diamonds.JPG',500,348,'Diamonds','http://admin2.clikpic.com/eddieb/images/Diamonds_thumb.JPG',129, 90,1, 1,'Artist: Ed Bradley','30/09/08','','',1200.00,'Diamonds');
photos[1] = new photo(2862870,'177496','Oil on Canvas - Framed 25\" X 32\"','gallery','http://admin2.clikpic.com/eddieb/images/Eva.JPG',450,614,'Eva','http://admin2.clikpic.com/eddieb/images/Eva_thumb.JPG',130, 177,0, 0,'Artist: Ed Bradley','30/09/08','','',700.00,'Eva');
photos[2] = new photo(2862879,'177496','Oil on Canvas -Framed 24\" X 32\"','gallery','http://admin2.clikpic.com/eddieb/images/lines.JPG',499,358,'Lines','http://admin2.clikpic.com/eddieb/images/lines_thumb.JPG',130, 93,0, 0,'Artist: Ed Bradley','30/09/08','','',600.00,'Lines');
photos[3] = new photo(2862899,'177496','Mixed media on Canvas - 16\" X 12\"','gallery','http://admin2.clikpic.com/eddieb/images/Natasha.JPG',450,588,'Natasha','http://admin2.clikpic.com/eddieb/images/Natasha_thumb.JPG',130, 169,0, 0,'Artist: Ed Bradley','30/09/08','','',350.00,'Natasha');
photos[4] = new photo(2862916,'177496','Oil on Canvas - 10\" X 10\" panel','gallery','http://admin2.clikpic.com/eddieb/images/Shaba.JPG',450,456,'Shaba','http://admin2.clikpic.com/eddieb/images/Shaba_thumb.JPG',130, 131,0, 0,'Artist: Ed Bradley','30/09/08','','',250.00,'Shaba');
photos[5] = new photo(2862923,'177496','Oil on Canvas 30\"X 24\" unframed','gallery','http://admin2.clikpic.com/eddieb/images/reclining nude.JPG',499,402,'Reclining nude - SOLD','http://admin2.clikpic.com/eddieb/images/reclining nude_thumb.JPG',130, 104,0, 0,'Artist: Ed Bradley','30/09/08','','','','Reclining nude  sold');
photos[6] = new photo(2863010,'177497','Oil on board - unframed 24\" X 18\"','gallery','http://admin2.clikpic.com/eddieb/images/Bog_in_Autunm.JPG',450,610,'Bog in Autumn','http://admin2.clikpic.com/eddieb/images/Bog_in_Autunm_thumb.JPG',130, 176,0, 0,'Artist: Ed Bradley','30/09/08','','',350.00,'Bog in Autumn');
photos[7] = new photo(2863077,'177497','Oil on Canvas - Framed 19\" X 43\"','gallery','http://admin2.clikpic.com/eddieb/images/Cork_Bonded_Warehouses.JPG',499,200,'Cork Bonded Warehouses Ltd','http://admin2.clikpic.com/eddieb/images/Cork_Bonded_Warehouses_thumb.JPG',130, 52,0, 0,'Artist: Ed Bradley','30/09/08','','',400.00,'Cork Bonded Warehouses Ltd');
photos[8] = new photo(2863091,'177497','Mixed media -  framed  24\" X 18\"','gallery','http://admin2.clikpic.com/eddieb/images/Miles_To_Go_Before_I_Sleep.JPG',450,521,'Miles to go before I sleep...SOLD','http://admin2.clikpic.com/eddieb/images/Miles_To_Go_Before_I_Sleep_thumb.JPG',130, 150,0, 1,'Artist: Ed Bradley','30/09/08','','','','Miles to go before I sleep...  -  Sold');
photos[9] = new photo(3521651,'177496','Oil on Canvas  16\" X 12\" Unframed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0964.JPG',500,660,'Sunshine','http://admin2.clikpic.com/eddieb/images/IMG_0964_thumb.JPG',130, 172,0, 0,'Artist Ed Bradley','','','',650.00,'Sunshine');
photos[10] = new photo(3521660,'177496','Oil on Canvas 14\" X 18\" unframed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0962.JPG',500,385,'Curves','http://admin2.clikpic.com/eddieb/images/IMG_0962_thumb.JPG',130, 100,0, 0,'Artist Ed Bradley','','','',400.00,'Curves');
photos[11] = new photo(3521670,'177496','Oil on Canvas 20\" X 30\" unframed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0961.JPG',500,334,'Kiaria','http://admin2.clikpic.com/eddieb/images/IMG_0961_thumb.JPG',130, 87,0, 0,'Artist Ed Bradley','','','',650.00,'Kiaria');
photos[12] = new photo(3521677,'177496','Oil on Canvas','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0957.JPG',500,411,'Girl with the gold bar','http://admin2.clikpic.com/eddieb/images/IMG_0957_thumb.JPG',130, 107,0, 0,'Artist Ed Bradley','','','',550.00,'Girl with Gold Bar');
photos[13] = new photo(3521692,'177496','Oil on Canvas','gallery','http://admin2.clikpic.com/eddieb/images/Phoenix.JPG',450,574,'Phoenix','http://admin2.clikpic.com/eddieb/images/Phoenix_thumb.JPG',130, 166,0, 0,'Artist Ed Bradley','','','',950.00,'Phoenix');
photos[14] = new photo(3525568,'215744','Oil on Canvas   9\" X 11\"  Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0938.JPG',500,653,'firebird','http://admin2.clikpic.com/eddieb/images/IMG_0938_thumb.JPG',130, 170,0, 0,'Artis Ed Bradley','','','',160.00,'Fire bird');
photos[15] = new photo(3525572,'215744','Oil on Canvas  9\" X 11\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0941.JPG',500,670,'Teacher','http://admin2.clikpic.com/eddieb/images/IMG_0941_thumb.JPG',130, 174,0, 0,'Artist: Ed Bradley','','','',160.00,'Teacher');
photos[16] = new photo(3525573,'215744','Oil on Canvas  9\" X 11\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0944.JPG',500,400,'Tequila sunrise','http://admin2.clikpic.com/eddieb/images/IMG_0944_thumb.JPG',130, 104,0, 0,'Artist : Ed Bradley','','','',160.00,'Tequila Sunrise');
photos[17] = new photo(3525575,'215744','Oil on Canvas  9\" X 11\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0945.JPG',500,656,'Dandy','http://admin2.clikpic.com/eddieb/images/IMG_0945_thumb.JPG',130, 171,0, 0,'Artist : Ed Bradley','','','',160.00,'Dandy');
photos[18] = new photo(3525578,'215744','Oil on Canvas  9\" X 11\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0946.JPG',500,402,'Sea Bird','http://admin2.clikpic.com/eddieb/images/IMG_0946_thumb.JPG',130, 105,0, 0,'Artist : Ed Bradley','','','',160.00,'Sea Bird');
photos[19] = new photo(3525583,'215744','Oil on Canvas  9\" X 11\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0937.JPG',500,381,'seascape','http://admin2.clikpic.com/eddieb/images/IMG_0937_thumb.JPG',130, 99,0, 0,'Artist : Ed Bradley','','','',160.00,'Seascape');
photos[20] = new photo(3525590,'215744','Oil on Canvas  9\" X 11\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0942.JPG',500,394,'Starburst','http://admin2.clikpic.com/eddieb/images/IMG_0942_thumb.JPG',130, 102,0, 0,'Artist Ed Bradley','','','',160.00,'Star burst');
photos[21] = new photo(3532217,'177497','Oil/ mixed media on Canvas  18\" X 24\" unframed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_1054t.JPG',500,658,'Just beyond these trees...','http://admin2.clikpic.com/eddieb/images/IMG_1054t_thumb.JPG',130, 171,0, 0,'Artist Ed Bradley','','','',750.00,'Just beyond these trees...');
photos[22] = new photo(3532225,'177497','Oil / mixed medis on Canvas 18\" X 24\" unframed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_1053t.JPG',500,667,'Winter clearing','http://admin2.clikpic.com/eddieb/images/IMG_1053t_thumb.JPG',130, 173,0, 0,'Artist Ed Bradley','','','',750.00,'Winter Clearing');
photos[23] = new photo(3532227,'215744','Oil on Canvas','gallery','http://admin2.clikpic.com/eddieb/images/IMG_1042t.JPG',500,388,'Three blind mice...','http://admin2.clikpic.com/eddieb/images/IMG_1042t_thumb.JPG',130, 101,0, 0,'Artist Ed Bradley','','','',400.00,'Three blind mice...');
photos[24] = new photo(3532433,'215744','Oil on Canval 26\" X 22\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_1037t.JPG',500,414,'Evolution','http://admin2.clikpic.com/eddieb/images/IMG_1037t_thumb.JPG',130, 108,0, 0,'Artist Ed Bradley','','','',550.00,'Evolution');
photos[25] = new photo(3532438,'215744','Oil on Canvas 16\" X 26\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_1045t.JPG',500,279,'Maelstrom','http://admin2.clikpic.com/eddieb/images/IMG_1045t_thumb.JPG',130, 73,0, 0,'Artist Ed Bradley','','','',450.00,'Maelstrom');
photos[26] = new photo(3532443,'215744','Oil on Canvas 17\" X 26\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_1040t.JPG',500,310,'Volcano','http://admin2.clikpic.com/eddieb/images/IMG_1040t_thumb.JPG',130, 81,0, 0,'Artist Ed Bradley','','','',500.00,'Volcano');
photos[27] = new photo(3532453,'215744','Oil on Canvas 19\" X 24\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_1039t.JPG',500,383,'Fire','http://admin2.clikpic.com/eddieb/images/IMG_1039t_thumb.JPG',130, 100,0, 0,'Artist Ed Bradley','','','',450.00,'Fire');
photos[28] = new photo(3532640,'177496','Oil on Canvas 20\" X 24\" unframed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_1008t.JPG',500,410,'Long Journey into darkness...','http://admin2.clikpic.com/eddieb/images/IMG_1008t_thumb.JPG',130, 107,0, 0,'Artist Ed Bradley','','','',600.00,'Long Journey into Darkness...');
photos[29] = new photo(2862712,'177017','Oil on Canvas - 20\" X 8\" panel','gallery','http://admin2.clikpic.com/eddieb/images/Dawn_At_Sea.JPG',499,174,'Dawn at Sea','http://admin2.clikpic.com/eddieb/images/Dawn_At_Sea_thumb.JPG',130, 45,0, 0,'Artist: Ed Bradley','30/10/08','','',200.00,'Dawn at Sea');
photos[30] = new photo(2862723,'177017','Oil on Canvas - Framed','gallery','http://admin2.clikpic.com/eddieb/images/Night Wave On The Rocks.JPG',499,420,'Night Wave on the Rocks','http://admin2.clikpic.com/eddieb/images/Night Wave On The Rocks_thumb.JPG',130, 109,0, 0,'Artist : Ed Bradley','30/10/08','','',250.00,'Night Wave on the Rocks');
photos[31] = new photo(2851534,'177017','Oil on Canvas Framed - 32\" X 24\"','gallery','http://admin2.clikpic.com/eddieb/images/wave 1.jpg',500,414,'Wave 1','http://admin2.clikpic.com/eddieb/images/wave 1_thumb.jpg',130, 108,0, 0,'Artist Ed Bradley','28/10/08','','',250.00,'Wave 1   : ');
photos[32] = new photo(2851866,'177017','Oil on Canvas - Framed 24\" x 30\"','gallery','http://admin2.clikpic.com/eddieb/images/Breaking_Wave.JPG',500,405,'Breaking Wave','http://admin2.clikpic.com/eddieb/images/Breaking_Wave_thumb.JPG',130, 105,0, 1,'Artist : Ed Bradley','28/10/08','','',650.00,'Breaking wave');
photos[33] = new photo(2862733,'177017','Oil on Canvas - Framed 32\" X 20\"','gallery','http://admin2.clikpic.com/eddieb/images/On this island.JPG',499,318,'On this Island   SOLD','http://admin2.clikpic.com/eddieb/images/On this island_thumb.JPG',130, 82,0, 0,'Artist: Ed Bradley','30/09/08','','','','On this Island  Sold');
photos[34] = new photo(2862749,'177017','Oil on Canvas - 20\" X 8\" -panel','gallery','http://admin2.clikpic.com/eddieb/images/Seacape On This Island.JPG',499,168,'Seascape - island','http://admin2.clikpic.com/eddieb/images/Seacape On This Island_thumb.JPG',130, 43,0, 0,'Artist: Ed Bradley','30/09/08','','',200.00,'Seascape - island');
photos[35] = new photo(2862752,'177017','Oil on Canvas - 16\" X 16\"  panel','gallery','http://admin2.clikpic.com/eddieb/images/skellig_rock.JPG',453,450,'Skellig Rock','http://admin2.clikpic.com/eddieb/images/skellig_rock_thumb.JPG',129, 129,0, 0,'Artist: Ed Bradley','30/09/08','','',250.00,'Skellig Rock');
photos[36] = new photo(2862758,'177017','Oil on Canvas - Framed 24\" X 30\"','gallery','http://admin2.clikpic.com/eddieb/images/Surf.JPG',499,403,'Surf','http://admin2.clikpic.com/eddieb/images/Surf_thumb.JPG',130, 104,0, 0,'Artist: Ed Bradley','30/09/08','','',450.00,'Surf');
photos[37] = new photo(2862760,'177017','Oil on Canvas','gallery','http://admin2.clikpic.com/eddieb/images/Surf_1.JPG',499,372,'Surf 1','http://admin2.clikpic.com/eddieb/images/Surf_1_thumb.JPG',130, 96,0, 0,'Artist: Ed Bradley','30/09/08','','',300.00,'Surf 1');
photos[38] = new photo(2862762,'177017','Oil on Canvas','gallery','http://admin2.clikpic.com/eddieb/images/Surf_2.JPG',499,418,'Surf 2','http://admin2.clikpic.com/eddieb/images/Surf_2_thumb.JPG',130, 108,0, 0,'Artist: Ed Bradley','30/09/08','','',300.00,'Surf 2   ');
photos[39] = new photo(2862766,'177017','Oil on Canvas- 14\" X 10\"','gallery','http://admin2.clikpic.com/eddieb/images/Surf_3.JPG',499,370,'Surf 3','http://admin2.clikpic.com/eddieb/images/Surf_3_thumb.JPG',130, 96,0, 0,'Artist: Ed Bradley','30/09/08','','',25.00,'Surf 3');
photos[40] = new photo(2862769,'177017','Oil on Canvas  - Framed 26\" X 20\"','gallery','http://admin2.clikpic.com/eddieb/images/Surf_4 .JPG',499,389,'Surf 4','http://admin2.clikpic.com/eddieb/images/Surf_4 _thumb.JPG',130, 101,0, 0,'Artist: Ed Bradley','30/09/08','','',300.00,'Surf 4');
photos[41] = new photo(2862794,'177017','Oil on Canvas - Framed 12\" X 14\"','gallery','http://admin2.clikpic.com/eddieb/images/Wave_1.JPG',500,428,'Wave 1','http://admin2.clikpic.com/eddieb/images/Wave_1_thumb.JPG',129, 111,0, 0,'Artist: Ed Bradley','30/09/08','','',250.00,'Wave 1');
photos[42] = new photo(2862798,'177017','Oil on Canvas','gallery','http://admin2.clikpic.com/eddieb/images/Wave_2.JPG',500,408,'Wave 2  Sold','http://admin2.clikpic.com/eddieb/images/Wave_2_thumb.JPG',129, 106,0, 0,'Artist: Ed Bradley','30/09/08','','','','Wave 2');
photos[43] = new photo(3522086,'177017','Oil on Canvas 20\" X 8\" unframed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0965.JPG',500,196,'Clew bay','http://admin2.clikpic.com/eddieb/images/IMG_0965_thumb.JPG',130, 51,0, 0,'Artist : Ed Bradley','','','',200.00,'Clewbay');
photos[44] = new photo(3522090,'177017','Oil on Canvas 20\" X 8\" unframed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0966.JPG',500,199,'Clew Bay 2','http://admin2.clikpic.com/eddieb/images/IMG_0966_thumb.JPG',130, 52,0, 0,'Artist ED Bradley','','','',200.00,'Clew Bay 2');
photos[45] = new photo(3522091,'177017','Oil on Canvas 20\" X 8\" unframed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0967.JPG',500,199,'Calm seas','http://admin2.clikpic.com/eddieb/images/IMG_0967_thumb.JPG',130, 52,0, 0,'Artist  Ed Bradley','','','',200.00,'Calm  Seas');
photos[46] = new photo(2862935,'177018','Oil on Canvas - Framed 25\" X 32\"','gallery','http://admin2.clikpic.com/eddieb/images/abstract_land scape1.JPG',499,352,'Landscape 1','http://admin2.clikpic.com/eddieb/images/abstract_land scape1_thumb.JPG',130, 91,0, 0,'Artist: Ed Bradley','30/09/08','','',450.00,'Landscape 1');
photos[47] = new photo(2862944,'177018','Oil on Paper - Framed','gallery','http://admin2.clikpic.com/eddieb/images/africa.JPG',499,424,'Africa','http://admin2.clikpic.com/eddieb/images/africa_thumb.JPG',130, 110,0, 1,'Artist: Ed Bradley','30/09/08','','','','Africa - Sold');
photos[48] = new photo(2862954,'177018','Oil on Canvas - 39\" X 12\" panel','gallery','http://admin2.clikpic.com/eddieb/images/Calm_After _storm.JPG',499,167,'Calm after the storm','http://admin2.clikpic.com/eddieb/images/Calm_After _storm_thumb.JPG',130, 43,0, 0,'Artist: Ed Bradley','30/09/08','','',450.00,'Calm after the storm');
photos[49] = new photo(2862988,'177018','Oil on canvas - Framed - 39\" X 12\"','gallery','http://admin2.clikpic.com/eddieb/images/day.JPG',499,202,'Day sold','http://admin2.clikpic.com/eddieb/images/day_thumb.JPG',130, 52,0, 0,'Artist: Ed Bradley','30/09/08','','','','Day - sold');
photos[50] = new photo(2862992,'177018','Oil on Paper - Framed','gallery','http://admin2.clikpic.com/eddieb/images/fire.JPG',499,258,'Fire  SOLD','http://admin2.clikpic.com/eddieb/images/fire_thumb.JPG',130, 67,0, 0,'Artist: Ed Bradley','30/09/08','','','','Fire  Sold');
photos[51] = new photo(2862997,'177018','Oil on Canvas Triptich - Framed 34\" X 30\"','gallery','http://admin2.clikpic.com/eddieb/images/Ice_On_Fire.JPG',500,392,'Ice on Fire   SOLD','http://admin2.clikpic.com/eddieb/images/Ice_On_Fire_thumb.JPG',129, 101,0, 0,'Artist: Ed Bradley','30/09/08','','','','Ice on Fire   - Sold ');
photos[52] = new photo(2863002,'177018','Oil on Canvas Triptich - 3 X 8\" X 24\"','gallery','http://admin2.clikpic.com/eddieb/images/Prisim.JPG',499,436,'Prism   SOLD','http://admin2.clikpic.com/eddieb/images/Prisim_thumb.JPG',130, 113,0, 0,'Artist: Ed Bradley','30/09/08','','','','Prism   -  Sold');
photos[53] = new photo(2863005,'177018','Oil on Canvas - 39\" X 12\" panel','gallery','http://admin2.clikpic.com/eddieb/images/Storm.JPG',499,169,'Storm','http://admin2.clikpic.com/eddieb/images/Storm_thumb.JPG',130, 44,0, 0,'Artist: Ed Bradley','30/09/08','','',450.00,'Storm');
photos[54] = new photo(2863083,'177018','Oil on Paper - Framed 34\" X 30\"','gallery','http://admin2.clikpic.com/eddieb/images/headspace.JPG',500,391,'Head space','http://admin2.clikpic.com/eddieb/images/headspace_thumb.JPG',129, 101,0, 0,'Artist: Ed Bradley','30/09/08','','',300.00,'Head space');
photos[55] = new photo(3522101,'177018','Oil on Canvas 15\" X 26\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0922.JPG',500,265,'Gates','http://admin2.clikpic.com/eddieb/images/IMG_0922_thumb.JPG',130, 69,0, 0,'Artist Ed Bradley','','','',350.00,'Gates');
photos[56] = new photo(3522105,'177018','Oil on Paper 15\" X 26\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0924.JPG',500,258,'Mango forest','http://admin2.clikpic.com/eddieb/images/IMG_0924_thumb.JPG',130, 67,0, 0,'Artist Ed Bradley','','','',350.00,'Mango Forest');
photos[57] = new photo(3522110,'177018','Oil on Paper','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0921.JPG',500,382,'the Eyes','http://admin2.clikpic.com/eddieb/images/IMG_0921_thumb.JPG',130, 99,0, 0,'Artist Ed Bardley','','','',250.00,'The Eyes');
photos[58] = new photo(3522118,'177018','Oil on Paper 12\" x 10 \" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0930.JPG',500,595,'Fall','http://admin2.clikpic.com/eddieb/images/IMG_0930_thumb.JPG',130, 155,0, 0,'','','','',180.00,'Fall');
photos[59] = new photo(3522119,'177018','Oil on Paper 12\" X 10 \" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0932.JPG',500,594,'Tree','http://admin2.clikpic.com/eddieb/images/IMG_0932_thumb.JPG',130, 154,0, 0,'Artist Ed Bradley','','','',180.00,'Tree');
photos[60] = new photo(3522121,'177018','Oil on Canvas 12\" X 10\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0933.JPG',500,587,'Tree 2','http://admin2.clikpic.com/eddieb/images/IMG_0933_thumb.JPG',130, 153,0, 0,'Artist Ed Bradley','','','',180.00,'Tree 2');
photos[61] = new photo(3522135,'177018','Oil on Paper 12X 10\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0934.JPG',500,597,'Snow tree 1','http://admin2.clikpic.com/eddieb/images/IMG_0934_thumb.JPG',130, 155,0, 0,'','','','',180.00,'Snow tree 1');
photos[62] = new photo(3522137,'177018','Oil on Canvas 12\" X 10\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0935.JPG',500,582,'Snow Tree 2','http://admin2.clikpic.com/eddieb/images/IMG_0935_thumb.JPG',130, 151,0, 0,'Artist: Ed Bradley','','','',180.00,'Snow Tree 2');
photos[63] = new photo(3522138,'177018','Oil on Canvas  25\" X 15\" framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0928.JPG',500,1880,'Forever Autum','http://admin2.clikpic.com/eddieb/images/IMG_0928_thumb.JPG',130, 489,0, 0,'Artist Ed Bradley','','','',250.00,'Forever Autum');
photos[64] = new photo(3522202,'177018','Oil on Paper 14\" X 17\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0947.JPG',500,670,'Forest','http://admin2.clikpic.com/eddieb/images/IMG_0947_thumb.JPG',130, 174,0, 0,'Artist Ed Bradley','','','',350.00,'Forest');
photos[65] = new photo(3522206,'177018','Oil on Canvas','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0956.JPG',500,141,'Fire','http://admin2.clikpic.com/eddieb/images/IMG_0956_thumb.JPG',130, 37,0, 0,'Artist Ed Bradley','','','',650.00,'Fire');
photos[66] = new photo(3522263,'177018','Oil on Canvas  12\" X 14\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0951.JPG',500,411,'Bush fire','http://admin2.clikpic.com/eddieb/images/IMG_0951_thumb.JPG',130, 107,0, 0,'Artist Ed Bradley','','','',350.00,'Bush Fire');
photos[67] = new photo(3522295,'177018','Oil on Canvas  ','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0920.JPG',500,357,'','http://admin2.clikpic.com/eddieb/images/IMG_0920_thumb.JPG',130, 93,0, 0,'Artist Ed Bradley','','','',300.00,'');
photos[68] = new photo(3522317,'177018','Oil on Cavnas 30\" X 10\" unframed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0958.JPG',500,161,'Abstract landscape 1','http://admin2.clikpic.com/eddieb/images/IMG_0958_thumb.JPG',130, 42,0, 0,'Artist Ed Bradley','','','',300.00,'Abstract Landscape 1');
photos[69] = new photo(3522320,'177018','Oil on Canvas','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0959.JPG',500,401,'View from a room','http://admin2.clikpic.com/eddieb/images/IMG_0959_thumb.JPG',130, 104,0, 0,'Artist Ed Bradley','','','',450.00,'View from a Room');
photos[70] = new photo(3522354,'177018','Oil om Canvas 30\" X 10\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0960.JPG',500,161,'Calm','http://admin2.clikpic.com/eddieb/images/IMG_0960_thumb.JPG',130, 42,0, 0,'Artist Ed Bradley','','','',300.00,'Calm');
photos[71] = new photo(3522364,'177018','Oil on Canvas 30\" X 10\" unframed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_1050t.JPG',500,162,'Golden view','http://admin2.clikpic.com/eddieb/images/IMG_1050t_thumb.JPG',130, 42,0, 0,'Artist Ed Bradley','','','',300.00,'Golden View');
photos[72] = new photo(3525606,'177018','Oil on Paper  16\" X 14\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0952.JPG',500,434,'Kenya','http://admin2.clikpic.com/eddieb/images/IMG_0952_thumb.JPG',130, 113,0, 0,'','','','',250.00,'Keyna');
photos[73] = new photo(3525608,'177018','Oil on Paper  12\" X 14\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0953.JPG',500,403,'Africa II','http://admin2.clikpic.com/eddieb/images/IMG_0953_thumb.JPG',130, 105,0, 0,'Artist Ed Bradley','','','',350.00,'Africa II');
photos[74] = new photo(3532872,'177018','Oil on Paper 15\" X 30\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_0923.JPG',500,249,'untitled','http://admin2.clikpic.com/eddieb/images/IMG_0923_thumb.JPG',130, 65,0, 0,'','','','',300.00,'Untitled');
photos[75] = new photo(3532941,'177018','Oil on Canvas 14\" X 18\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_1012t.JPG',500,386,'splat!!!','http://admin2.clikpic.com/eddieb/images/IMG_1012t_thumb.JPG',130, 100,0, 0,'Artist Ed Bradley','','','',400.00,'Splat !!!');
photos[76] = new photo(3532943,'177018','Oil on Canvas 14\" X 18\" Framed','gallery','http://admin2.clikpic.com/eddieb/images/IMG_1014t.JPG',500,382,'Abstract colours...','http://admin2.clikpic.com/eddieb/images/IMG_1014t_thumb.JPG',130, 99,0, 0,'Artist Ed Bradley','','','',400.00,'Abstract Colours.');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(177496,'2862809','female form','gallery');
galleries[1] = new gallery(177497,'2863091','Other','gallery');
galleries[2] = new gallery(215744,'3532453,3532443,3532438,3532433,3532227,3525590,3525583,3525578,3525575,3525573','Paint sculptures','gallery');
galleries[3] = new gallery(177017,'2851866','Seascapes','gallery');
galleries[4] = new gallery(177018,'2862944','Abstract','gallery');

