window.thumbnails = new Object();
												thumbnails[5563909] = new thumbnail(5563909,'','','tidal_thumb.jpg',130, 33,5,'															#');
												thumbnails[5565897] = new thumbnail(5565897,'','beneath adj .in a lower position: at a \t<br>\r\nlower level relatively to<br>\r\n','Beneath_thumb.jpg',130, 32,5,'															#');
												thumbnails[5569894] = new thumbnail(5569894,'','bubble, bub’l, n. ball of air <br>\r\nin a liquid or solid<br>\r\n','Bubble_thumb.jpg',130, 130,5,'															#');
												thumbnails[5592933] = new thumbnail(5592933,'','horizon n, the line at which the sky and the<br>\r\nearth appear to meet<br>\r\n','horizon_thumb.jpg',130, 35,5,'															#');
												thumbnails[5593336] = new thumbnail(5593336,'','','Kosciuszko6_thumb.jpg',130, 709,5,'															#');
												thumbnails[5593517] = new thumbnail(5593517,'','coastal, adj. located on or near or \t\t\t<br>\r\nbordering a coast<br>\r\n','coastal1_thumb.jpg',130, 21,5,'															#');
												thumbnails[5620151] = new thumbnail(5620151,'','breakwater, n. a barrier built out into a body of water to protect a coast or harbour from the force of waves','breakwater_thumb.jpg',130, 58,5,'															#');
												thumbnails[5779151] = new thumbnail(5779151,'','range n.; an open region for<br>\r\ngrazing of livestock<br>\r\n','range_thumb.jpg',130, 132,5,'															#');
												thumbnails[6806260] = new thumbnail(6806260,'','driftwood n  wood cast ashore by water','driftwood_511C549F-1D09-001F-99D99D441B0351E8_thumb.jpg',130, 98,5,'															#');
												thumbnails[5563399] = new thumbnail(5563399,'315589','aquatic adj. relating to or consisting <br>\r\n   of, or being in water<br>\r\n','aquatic_thumb.jpg',130, 265,5,'																			photo_5563399.html');
												thumbnails[5563403] = new thumbnail(5563403,'315589','baths  n. pool that provides a facility for swimming<br>\r\n','baths_thumb.jpg',130, 71,5,'																			photo_5563403.html');
												thumbnails[5563407] = new thumbnail(5563407,'315589','stream, n. a body of running <br>\r\nwater flowing on the earth<br>\r\n','stream_thumb.jpg',130, 258,5,'																			photo_5563407.html');
												thumbnails[5563433] = new thumbnail(5563433,'315589','lagoon, n. an area of shallow salt water<br>\r\nseparated from the sea by sand dunes<br>\r\n','lagoon_thumb.jpg',130, 102,5,'																			photo_5563433.html');
												thumbnails[5563438] = new thumbnail(5563438,'315589','o-ce-an-ic','o-ce-an-ic1_thumb.jpg',130, 186,5,'																			photo_5563438.html');
												thumbnails[5563896] = new thumbnail(5563896,'315589','docks  n. a group of piers on a commercial waterfront that serve as a general landing<br>\r\narea for ships or boats<br>\r\n','TheDocks_thumb.jpg',130, 129,5,'																			photo_5563896.html');
												thumbnails[5563907] = new thumbnail(5563907,'315589','terrain, n. an area of land; ground','terrain_thumb.jpg',130, 102,5,'																			photo_5563907.html');
												thumbnails[5563941] = new thumbnail(5563941,'315589','tract, n. an expanse of land or water','tract_thumb.JPG',130, 130,5,'																			photo_5563941.html');
												thumbnails[5563971] = new thumbnail(5563971,'315589','coastal, adj. located on or near or    bordering a coast','coastal_thumb.jpg',130, 208,5,'																			photo_5563971.html');
												thumbnails[5563974] = new thumbnail(5563974,'374731','tide mark, n.  line on the shore <br>\r\nmade by the tide<br>\r\n','TideMarkTriptych12_thumb.jpg',130, 45,5,'																			photo_5563974.html');
												thumbnails[5565753] = new thumbnail(5565753,'315589','jetty, jet’i, n. a breakwater or <br>\r\nlanding stage<br>\r\n','jetty_thumb.jpg',130, 175,5,'																			photo_5565753.html');
												thumbnails[5565770] = new thumbnail(5565770,'315589','driftwood n  wood cast ashore by water','Driftwood_thumb.jpg',130, 98,5,'																			photo_5565770.html');
												thumbnails[5565833] = new thumbnail(5565833,'315589','mottled adj. marked or patterned<br>\r\nwith irregular patches of colour<br>\r\n','Mottled_Diptych_thumb.jpg',130, 64,5,'																			photo_5565833.html');
												thumbnails[5565856] = new thumbnail(5565856,'374731','found objects n  a natural or\t\t<br>\r\nman made objects displayed as a work <br>\r\nof art, exactly as found, or touched up<br>\r\n','FoundObjects1_thumb.jpg',130, 218,5,'																			photo_5565856.html');
												thumbnails[5565870] = new thumbnail(5565870,'315589','sandbar, n. a long sand-bank in a <br>\r\nriver or sea<br>\r\n','Sandbar_thumb.jpg',130, 173,5,'																			photo_5565870.html');
												thumbnails[5571742] = new thumbnail(5571742,'315589','dusk n. the state or period of partial darkness between day and night','dusk3_thumb.jpg',130, 98,5,'																			photo_5571742.html');
												thumbnails[5593503] = new thumbnail(5593503,'315589','           reflections, n. pl., the return of light<br>\r\n            or sound waves from a surface<br>\r\n','reflections_thumb.jpg',130, 211,5,'																			photo_5593503.html');
												thumbnails[5593507] = new thumbnail(5593507,'374731','oriental, adj., pertaining to, or characteristic of, the Orient or East','oriental_thumb.jpg',130, 218,5,'																			photo_5593507.html');
												thumbnails[5593512] = new thumbnail(5593512,'315589','reef, n. a strip or ridge of rocks, sand or coral that rises to or near the surface of a body of water','reef_thumb.jpg',130, 99,5,'																			photo_5593512.html');
												thumbnails[5593534] = new thumbnail(5593534,'315589','pier n woodwork projecting into the sea<br>\r\nor other water as a promenade<br>\r\n','pier1_thumb.jpg',130, 264,5,'																			photo_5593534.html');
												thumbnails[5620145] = new thumbnail(5620145,'315589','depth, n. the quality of being deep','depth_thumb.jpg',130, 79,5,'																			photo_5620145.html');
												thumbnails[5620146] = new thumbnail(5620146,'315589','depth, n. the quality of being deep','depth_2_thumb.jpg',130, 174,5,'																			photo_5620146.html');
												thumbnails[5620147] = new thumbnail(5620147,'315589','watery, adj. full of water','watery_thumb.jpg',130, 240,5,'																			photo_5620147.html');
												thumbnails[5620148] = new thumbnail(5620148,'315589','boardwalk  n. promenade, <br>\r\nespecially of planks, <br>\r\nalong a beach or waterfront <br>\r\n','boardwalk5_thumb.jpg',130, 99,5,'																			photo_5620148.html');
												thumbnails[5620150] = new thumbnail(5620150,'315589','strata n.pl  a layer of material, formed <br>\r\neither naturally or artificially, often one of <br>\r\na number of parallel layers <br>\r\n','strata_thumb.jpg',130, 131,5,'																			photo_5620150.html');
												thumbnails[5620164] = new thumbnail(5620164,'315589','gem n. a cut and polished \t\t\t<br>\r\nprecious stone<br>\r\n','gem_thumb.jpg',130, 102,5,'																			photo_5620164.html');
												thumbnails[5620165] = new thumbnail(5620165,'315589','boardwalk  n. promenade, especially of planks, along a beach or waterfront ','bwboardwalks_thumb.jpg',130, 246,5,'																			photo_5620165.html');
												thumbnails[5620166] = new thumbnail(5620166,'374731','coasting, v. 1.make progress without making much effort 2. sail along the coast','coasting_2_thumb.JPG',130, 210,5,'																			photo_5620166.html');
												thumbnails[5620167] = new thumbnail(5620167,'315589','marina, n. a specially designed harbour  with moorings for pleasure craft and small boats','marina_thumb.jpg',130, 127,5,'																			photo_5620167.html');
												thumbnails[5727229] = new thumbnail(5727229,'374731','pond (n) a small body of still water formed by embanking','pond_thumb.jpg',130, 130,5,'																			photo_5727229.html');
												thumbnails[5779145] = new thumbnail(5779145,'315589','watershed n.; a ridge of land that separates waters flowing to different rivers, basins, or seas','tobenamed_thumb.jpg',130, 98,5,'																			photo_5779145.html');
												thumbnails[5779147] = new thumbnail(5779147,'374731','plank n.; something to stand on or to<br>\r\ncling to for support<br>\r\n','plank_thumb.jpg',130, 129,5,'																			photo_5779147.html');
												thumbnails[5792234] = new thumbnail(5792234,'315589','ridge; n. a long narrow hilltop, mountain range, or watershed','ridge_thumb.jpg',130, 86,5,'																			photo_5792234.html');
												thumbnails[5817270] = new thumbnail(5817270,'315589','range(n); row of mountains','range_135E401A-1D09-001F-99CC79006CCBAA89_thumb.jpg',130, 64,5,'																			photo_5817270.html');
												thumbnails[5857275] = new thumbnail(5857275,'331174','number one in the series','best-of-both-worlds_1_thumb.jpg',130, 131,5,'																			photo_5857275.html');
												thumbnails[5857279] = new thumbnail(5857279,'331174','number two in the series','best-of-both-worlds_2_thumb.jpg',130, 128,5,'																			photo_5857279.html');
												thumbnails[5857283] = new thumbnail(5857283,'331174','number three in the series','best-of-both-worlds_3_thumb.jpg',130, 132,5,'																			photo_5857283.html');
												thumbnails[5857288] = new thumbnail(5857288,'331174','number four in the series','best-of-both-worlds_4_thumb.jpg',130, 130,5,'																			photo_5857288.html');
												thumbnails[5857291] = new thumbnail(5857291,'331174','number five in the series','best-of-both-worlds_5_thumb.jpg',130, 133,5,'																			photo_5857291.html');
												thumbnails[5857294] = new thumbnail(5857294,'331174','number six in the series','best-of-both-worlds_6_thumb.jpg',130, 128,5,'																			photo_5857294.html');
												thumbnails[5857296] = new thumbnail(5857296,'331174','number seven in the series','best-of-both-worlds_7_thumb.jpg',130, 129,5,'																			photo_5857296.html');
												thumbnails[5857298] = new thumbnail(5857298,'331174','number eight in the series','best_of_both_worlds_8_thumb.jpg',130, 131,5,'																			photo_5857298.html');
												thumbnails[5869930] = new thumbnail(5869930,'315589','balanced n, emotional stability; habit of calm behavior, <br>\r\njudgment,etc<br>\r\n','balance_thumb.jpg',130, 135,5,'																			photo_5869930.html');
												thumbnails[6806261] = new thumbnail(6806261,'315589','whitewater n., frothy water as in rapids or waterfalls<br>\r\n','whitewater_thumb.jpg',130, 189,5,'																			photo_6806261.html');
												thumbnails[6905998] = new thumbnail(6905998,'315589','wharf (n); a structure built on the shore so that    vessels may be moored alongside to load or unload','dockside_thumb.jpg',130, 65,5,'																			photo_6905998.html');
												thumbnails[6906010] = new thumbnail(6906010,'315589','drydock (n); a structure able to contain a ship so as to leave the ship free of water<br>\r\n','drydock_thumb.jpg',130, 128,5,'																			photo_6906010.html');
												thumbnails[6906011] = new thumbnail(6906011,'315589','post n a strong piece of timber set up as a support','post_thumb.jpg',130, 95,5,'																			photo_6906011.html');
												thumbnails[6906014] = new thumbnail(6906014,'315589','rockpool (n);  a pool of water remaining on a reef, shore platform or beach after the tide has receded','rockpool-12_thumb.jpg',130, 131,5,'																			photo_6906014.html');
												thumbnails[6906017] = new thumbnail(6906017,'315589','rockpool (n);  a pool of water remaining on a reef, shore platform or beach after the tide has receded','rockpool-22_thumb.jpg',130, 129,5,'																			photo_6906017.html');
												thumbnails[6906034] = new thumbnail(6906034,'374731','dock, n.; the waterway between two wharves or two piers','dockaseries_thumb.jpg',130, 520,5,'																			photo_6906034.html');
												thumbnails[6906035] = new thumbnail(6906035,'315589','by-path n; an indirect or rarely used path','by-path_thumb.jpg',130, 97,5,'																			photo_6906035.html');
												thumbnails[6906036] = new thumbnail(6906036,'315589','depth n; 1. the quality of being deep','depth2_thumb.jpg',130, 174,5,'																			photo_6906036.html');
												thumbnails[6906037] = new thumbnail(6906037,'315589','fluid adj.;able to flow freely, not sold or rigid','Fluid_thumb.jpg',130, 131,5,'																			photo_6906037.html');
												thumbnails[6906038] = new thumbnail(6906038,'315589','anchorage, n.; a place of or for anchoring','anchorage_thumb.jpg',130, 252,5,'																			photo_6906038.html');
												thumbnails[6906040] = new thumbnail(6906040,'315589','causeway, n. a raised path or road over a marsh or water or across land','causeway1_thumb.jpg',130, 32,5,'																			photo_6906040.html');
												thumbnails[6906046] = new thumbnail(6906046,'315589','untitled n.; deprived of a title','Untitled_thumb.jpg',130, 86,5,'																			photo_6906046.html');
												thumbnails[6906048] = new thumbnail(6906048,'315589','bubble n.; ball of air','bubble_B83CF2D1-1D09-001F-99D66D03C6AF1FAF_thumb.jpg',130, 131,5,'																			photo_6906048.html');
												thumbnails[6906050] = new thumbnail(6906050,'315589','Fairy Bower','Fairy-Bower_thumb.jpg',130, 218,5,'																			photo_6906050.html');
												thumbnails[6906051] = new thumbnail(6906051,'315589','pool n.; a casual collection of water','pool_thumb.jpg',130, 130,5,'																			photo_6906051.html');
												thumbnails[6906052] = new thumbnail(6906052,'315589','pond (a) n; small area of still water','pond-a_thumb.jpg',130, 130,5,'																			photo_6906052.html');
												thumbnails[6906053] = new thumbnail(6906053,'315589','miniaiture n.; a representation or image of something on a small or reduced scale','miniature_thumb.jpg',130, 132,5,'																			photo_6906053.html');
												thumbnails[6906055] = new thumbnail(6906055,'315589','planks n. (pl) long flat pieces of timber several inches thick','planks_thumb.jpg',130, 389,5,'																			photo_6906055.html');
												thumbnails[6973228] = new thumbnail(6973228,'315589','shallows (n) a part of a body of water of little depth','shallows_thumb.jpg',130, 130,5,'																			photo_6973228.html');
												thumbnails[6973229] = new thumbnail(6973229,'315589','lake (n) 1.inland body of water','lake_thumb.jpg',130, 130,5,'																			photo_6973229.html');
												thumbnails[7371007] = new thumbnail(7371007,'315589','dockside (n); land or area adjoining a dock  ','dockside_F448A808-24E8-5EC4-4FA2F952A220352D_thumb.jpg',130, 194,5,'																			photo_7371007.html');
												thumbnails[7371009] = new thumbnail(7371009,'315589','bollard (n); nautical a thick, low post, mounted on a wharf to which mooring lines from vessels are attached','bollard_thumb.jpg',130, 78,5,'																			photo_7371009.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[374731] = new gallery(374731,'6906034,5779147,5727229,5620166,5593507,5565856,5563974','assemblage','gallery',[5563974,5565856,5593507,5620166,5727229,5779147,6906034],0, 0, '', '																																																																																																							gallery_374731.html',0,0);
				  					galleries[315589] = new gallery(315589,'7371009,7371007,6973229,6973228,6906055,6906053,6906052,6906051,6906050,6906048','mixed media ','gallery',[5563399,5563403,5563407,5563433,5563438,5563896,5563907,5563941,5563971,5565753,5565770,5565833,5565870,5571742,5593503,5593512,5593534,5620145,5620146,5620147,5620148,5620150,5620164,5620165,5620167,5779145,5792234,5817270,5869930,6806261,6905998,6906010,6906011,6906014,6906017,6906035,6906036,6906037,6906038,6906040,6906046,6906048,6906050,6906051,6906052,6906053,6906055,6973228,6973229,7371007,7371009],0, 0, '', '																																																																																																							gallery_315589.html',0,0);
				  					galleries[331174] = new gallery(331174,'5857298,5857296,5857294,5857291,5857288,5857283,5857279,5857275','Finke River Journey','gallery',[5857275,5857279,5857283,5857288,5857291,5857294,5857296,5857298],0, 0, '', '																																																																																																							gallery_331174.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '5593336';
imageSets[3] = '7371009,7371007,6973229,6973228,6906055,6906053,6906052,6906051,6906050,6906048,6906046,6906040,6906038,6906037,6906036,6906035,6906034,6906017,6906014,6906011,6906010,6905998,6806261,6806260,5869930,5857298,5857296,5857294,5857291,5857288,5857283,5857279,5857275,5817270,5792234,5779151,5779147,5779145,5727229,5620167,5620166,5620165,5620164,5620151,5620150,5620148,5620147,5620146,5620145,5593534';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/christine21/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/christine21/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/christine21/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/christine21/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/christine21/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/christine21/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/christine21/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/christine21/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/christine21/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/christine21/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/christine21/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/christine21/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/christine21/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/christine21/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/christine21/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/christine21/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/christine21/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/christine21/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/christine21/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/christine21/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/christine21/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/christine21/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {

	imageID = randomListVal('');
		if (!basic) {
	img.src = photos[imageID].src;
	img.width = photos[imageID].width;
	img.height = photos[imageID].height;
  img.parentNode.title = img.alt = photos[imageID].caption;
	}
	else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
				
	}
			}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}
/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
  var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
		if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
    
  updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
  var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
      op = $.extend({},defaults,options),
      html = '', temp = '',
      photoId = op.nextPhoto.id,
      photoCaption = op.nextPhoto.caption,
      photoSrc = op.nextPhoto.src;
		
		if (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    if (op.$photo.length > 0) {
      html = $('<img/>',{
        'class': 'mainphoto photo',
        src: photoSrc,
        id: 'mainPic',
        name: 'mainPic',
        width: op.nextPhoto.width,
        height: op.nextPhoto.height,
        alt: photoCaption,
        css: op.css || {}
      });
      if (op.href) {
      	if (op.href.match(/<a/)) {
      	  html = $(op.href).append(html);
      	} else {
		  html = $('<a/>', {
			href: op.href,
			title: photoCaption
		  }).append(html);
	    }
      } else {
      	html = $('<a/>', {
			title: photoCaption
		  }).append(html);
      }
      if (op.speed == 0) {        op.$photo.html(html);        if (op.onBefore) {          op.onBefore.apply(op.$photo);        }        if (op.onAfter) {          op.onAfter.apply(op.$photo);        }      } else {        op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){            if (op.onAfter) {		    op.onAfter.apply(this);          }		  clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));		}, op.onBefore);
      }    }
    	if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Christine Farkas                     Visual Artist: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object') {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp = temp + '<p>Order this print:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> 							' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = temp + '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
				
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			temp = temp + '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* 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, updateLink) {
		
	if(img){
	      if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
        imageID = imageID[1];
      } else {
			  imageID = randomListVal(galleries[gallery_id].featured_images);
      }
							
			if (imageID != 0) {
				img.src = thumbnails[imageID].src;
				img.width = thumbnails[imageID].width;
				img.height = thumbnails[imageID].height;
				img.alt = galleries[gallery_id].title;
        if (updateLink) {
          $(img).parent().attr({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp = temp + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

