window.thumbnails = new Object();
												thumbnails[3815649] = new thumbnail(3815649,'','','secret_thumb.jpg',130, 130,15,'#');
												thumbnails[3815652] = new thumbnail(3815652,'','','P10102331_thumb.JPG',130, 130,15,'#');
												thumbnails[3815653] = new thumbnail(3815653,'','','P10102381_thumb.JPG',130, 130,15,'#');
												thumbnails[3841681] = new thumbnail(3841681,'','','1_1_thumb.jpg',130, 100,15,'#');
												thumbnails[3768261] = new thumbnail(3768261,'229370','','after_Braque_thumb.jpg',130, 130,15,'photo_3768261.html');
												thumbnails[3768262] = new thumbnail(3768262,'229370','','anemones_and_stropes_thumb.jpg',130, 130,15,'photo_3768262.html');
												thumbnails[3768263] = new thumbnail(3768263,'229370','','asters_and_teapot_thumb.jpg',130, 130,15,'photo_3768263.html');
												thumbnails[3768265] = new thumbnail(3768265,'229370','','blue_jug_and_flowers_thumb.jpg',130, 130,15,'photo_3768265.html');
												thumbnails[3768266] = new thumbnail(3768266,'229370','','forsythia_thumb.jpg',130, 130,15,'photo_3768266.html');
												thumbnails[3815670] = new thumbnail(3815670,'232454','','chapel_Eigg_thumb.jpg',130, 130,15,'photo_3815670.html');
												thumbnails[3815671] = new thumbnail(3815671,'232454','','garden_shed_with_brooms_thumb.jpg',130, 130,15,'photo_3815671.html');
												thumbnails[3815675] = new thumbnail(3815675,'232454','','garden_shed_with_labels_thumb.jpg',130, 130,15,'photo_3815675.html');
												thumbnails[3815676] = new thumbnail(3815676,'232454','','garden_shed_with_sieve_thumb.jpg',130, 130,15,'photo_3815676.html');
												thumbnails[3815681] = new thumbnail(3815681,'232454','','storm_holkham_bay_thumb.jpg',130, 130,15,'photo_3815681.html');
												thumbnails[3815758] = new thumbnail(3815758,'232456','','cleome_and_rhus_thumb.jpg',130, 130,15,'photo_3815758.html');
												thumbnails[3815760] = new thumbnail(3815760,'232456','','newlyn_boats_1_thumb.jpg',130, 130,15,'photo_3815760.html');
												thumbnails[3815761] = new thumbnail(3815761,'232456','','newlyn_boats_2_thumb.JPG',130, 130,15,'photo_3815761.html');
												thumbnails[3815805] = new thumbnail(3815805,'232458','','red_bow_thumb.jpg',130, 130,15,'photo_3815805.html');
												thumbnails[4592190] = new thumbnail(4592190,'229369','','Barley_churchyard_w_thumb.jpg',130, 130,15,'photo_4592190.html');
												thumbnails[5699547] = new thumbnail(5699547,'229370','','vase-in-light-ed-paintnet_thumb.gif',130, 130,15,'photo_5699547.html');
												thumbnails[5699565] = new thumbnail(5699565,'229370','','white-vase-2-ed-border_thumb.gif',130, 130,15,'photo_5699565.html');
												thumbnails[5699638] = new thumbnail(5699638,'229370','','still-life-with-vase-and-lemons-ed_thumb.gif',130, 130,15,'photo_5699638.html');
												thumbnails[7165001] = new thumbnail(7165001,'229370','','P7100032_thumb.JPG',130, 130,15,'photo_7165001.html');
												thumbnails[7165006] = new thumbnail(7165006,'229369','','dawn-cumbrae_thumb.gif',130, 130,15,'photo_7165006.html');
												thumbnails[3815773] = new thumbnail(3815773,'232457','','brian_thumb.jpg',130, 130,15,'photo_3815773.html');
												thumbnails[3815816] = new thumbnail(3815816,'229370','','P6290013_thumb.jpg',130, 130,15,'photo_3815816.html');
												thumbnails[5699664] = new thumbnail(5699664,'229369','','landscape-with-stile-and-dead-tree-border_thumb.gif',130, 130,15,'photo_5699664.html');
												thumbnails[7164977] = new thumbnail(7164977,'229369','','red-rocks-cumbrae-web_thumb.gif',130, 130,15,'photo_7164977.html');
												thumbnails[7164985] = new thumbnail(7164985,'229370','','redblue5_thumb.JPG',130, 130,15,'photo_7164985.html');
												thumbnails[7168605] = new thumbnail(7168605,'229369','','docwras_trees_thumb.JPG',130, 130,15,'photo_7168605.html');
												thumbnails[7168877] = new thumbnail(7168877,'229370','','stlcred_ed_2_thumb.JPG',130, 130,15,'photo_7168877.html');
												thumbnails[7978601] = new thumbnail(7978601,'322308','','morning_gr_m_web1_thumb.jpg',130, 130,15,'photo_7978601.html');
												thumbnails[3815775] = new thumbnail(3815775,'232457','','judy_thumb.jpg',130, 130,15,'photo_3815775.html');
												thumbnails[3815802] = new thumbnail(3815802,'232458','','harriet2_thumb.jpg',130, 130,15,'photo_3815802.html');
												thumbnails[3815814] = new thumbnail(3815814,'229370','','P1010167_thumb.jpg',130, 130,15,'photo_3815814.html');
												thumbnails[5699675] = new thumbnail(5699675,'229369','','sedums-Docwras-manor-border_thumb.gif',130, 130,15,'photo_5699675.html');
												thumbnails[7168942] = new thumbnail(7168942,'229369','','wandlebury-ed_thumb.gif',130, 130,15,'photo_7168942.html');
												thumbnails[7978579] = new thumbnail(7978579,'322308','','_docwras_april_ed_web_thumb.jpg',130, 130,15,'photo_7978579.html');
												thumbnails[7978726] = new thumbnail(7978726,'229370','','still_life_maroon_bg_ed_thumb.jpg',130, 130,15,'photo_7978726.html');
												thumbnails[3815726] = new thumbnail(3815726,'229369','','weeds_ed_thumb.jpg',130, 130,15,'photo_3815726.html');
												thumbnails[3815778] = new thumbnail(3815778,'232457','','lesley1_thumb.jpg',130, 130,15,'photo_3815778.html');
												thumbnails[3815801] = new thumbnail(3815801,'232458','','harriet1_thumb.jpg',130, 130,15,'photo_3815801.html');
												thumbnails[3815812] = new thumbnail(3815812,'229370','','P1010006_thumb.jpg',130, 130,15,'photo_3815812.html');
												thumbnails[5729838] = new thumbnail(5729838,'229370','','P1010053_thumb.JPG',130, 130,15,'photo_5729838.html');
												thumbnails[7164979] = new thumbnail(7164979,'229369','','rocks-cmbrae_thumb.gif',130, 130,15,'photo_7164979.html');
												thumbnails[7168603] = new thumbnail(7168603,'229369','','docwras_white_flowers_ed_thumb.JPG',130, 130,15,'photo_7168603.html');
												thumbnails[7978594] = new thumbnail(7978594,'322308','','rapefield_coton_ed_web_thumb.jpg',130, 130,15,'photo_7978594.html');
												thumbnails[3815693] = new thumbnail(3815693,'229369','','clearing_ed_thumb.jpg',130, 130,15,'photo_3815693.html');
												thumbnails[3815768] = new thumbnail(3815768,'232457','','akashadeva_thumb.jpg',130, 130,15,'photo_3815768.html');
												thumbnails[3815800] = new thumbnail(3815800,'232458','','blue_streak_thumb.jpg',130, 130,15,'photo_3815800.html');
												thumbnails[3815822] = new thumbnail(3815822,'229370','','studio_table_thumb.jpg',130, 130,15,'photo_3815822.html');
												thumbnails[7168598] = new thumbnail(7168598,'229369','','boats-cumb.webgif_thumb.gif',130, 130,15,'photo_7168598.html');
												thumbnails[7978606] = new thumbnail(7978606,'322308','','_barrow_and_bins_ed_web_thumb.jpg',130, 130,15,'photo_7978606.html');
												thumbnails[3815779] = new thumbnail(3815779,'232457','','maria_thumb.jpg',130, 130,15,'photo_3815779.html');
												thumbnails[3815804] = new thumbnail(3815804,'232458','','harriet3_thumb.jpg',130, 130,15,'photo_3815804.html');
												thumbnails[3815821] = new thumbnail(3815821,'229370','','still_life_with_bonesP1010003_thumb.jpg',130, 130,15,'photo_3815821.html');
												thumbnails[4592087] = new thumbnail(4592087,'229369','','trees_Barley_manor_w_thumb.jpg',130, 130,15,'photo_4592087.html');
												thumbnails[7164973] = new thumbnail(7164973,'229369','','wimpgdn3_thumb.JPG',130, 130,15,'photo_7164973.html');
												thumbnails[7978616] = new thumbnail(7978616,'322308','','pond_w_fence_ed_web_thumb.jpg',130, 130,15,'photo_7978616.html');
												thumbnails[3815770] = new thumbnail(3815770,'232457','','anjali_thumb.jpg',130, 130,15,'photo_3815770.html');
												thumbnails[3815818] = new thumbnail(3815818,'229370','','red_box_and_bottles_thumb.jpg',130, 130,15,'photo_3815818.html');
												thumbnails[7168606] = new thumbnail(7168606,'229369','','montbretias-cumbrae-ed_thumb.gif',130, 130,15,'photo_7168606.html');
												thumbnails[7978620] = new thumbnail(7978620,'322308','','rapefilds_linton_ed_web_thumb.jpg',130, 130,15,'photo_7978620.html');
												thumbnails[3815714] = new thumbnail(3815714,'229369','','P7100023_thumb.JPG',130, 130,15,'photo_3815714.html');
												thumbnails[3815771] = new thumbnail(3815771,'232457','','anna_thumb.jpg',130, 130,15,'photo_3815771.html');
												thumbnails[3815819] = new thumbnail(3815819,'229370','','shells_ed_thumb.jpg',130, 130,15,'photo_3815819.html');
												thumbnails[5729585] = new thumbnail(5729585,'229369','','P1010045_thumb.JPG',130, 130,15,'photo_5729585.html');
												thumbnails[5729734] = new thumbnail(5729734,'229370','','P1010050_thumb.JPG',130, 130,15,'photo_5729734.html');
												thumbnails[3815699] = new thumbnail(3815699,'229369','','evening_punt1_thumb.jpg',130, 130,15,'photo_3815699.html');
												thumbnails[3815815] = new thumbnail(3815815,'229370','','P1010171_thumb.jpg',130, 130,15,'photo_3815815.html');
												thumbnails[3815813] = new thumbnail(3815813,'229370','','P1010130_thumb.jpg',130, 130,15,'photo_3815813.html');
												thumbnails[4592341] = new thumbnail(4592341,'229369','','path_Eigg_w_thumb.jpg',130, 130,15,'photo_4592341.html');
												thumbnails[3815811] = new thumbnail(3815811,'229370','','nerines_ed_thumb.jpg',130, 130,15,'photo_3815811.html');
												thumbnails[3815722] = new thumbnail(3815722,'229369','','stream1_thumb.jpg',130, 130,15,'photo_3815722.html');
												thumbnails[3815691] = new thumbnail(3815691,'229369','','cherry1_thumb.jpg',130, 130,15,'photo_3815691.html');
												thumbnails[4592331] = new thumbnail(4592331,'229369','','vajraloka_woods_w_thumb.jpg',130, 130,15,'photo_4592331.html');
												thumbnails[7164997] = new thumbnail(7164997,'229370','','blueyellow_thumb.gif',130, 130,15,'photo_7164997.html');
												thumbnails[3815718] = new thumbnail(3815718,'229369','','red_bush_ed_thumb.jpg',130, 130,15,'photo_3815718.html');
												thumbnails[4590891] = new thumbnail(4590891,'229369','','cactus_w_thumb.jpg',130, 130,15,'photo_4590891.html');
												thumbnails[7165020] = new thumbnail(7165020,'229369','','dead-and-live-trees-ed_thumb.gif',130, 130,15,'photo_7165020.html');
												thumbnails[3815721] = new thumbnail(3815721,'229369','','row_of_trees_Eigg_thumb.jpg',130, 130,15,'photo_3815721.html');
												thumbnails[3815704] = new thumbnail(3815704,'229369','','lake1_thumb.jpg',130, 130,15,'photo_3815704.html');
												thumbnails[5699611] = new thumbnail(5699611,'229369','','almond-with-white-fence_thumb.gif',130, 130,15,'photo_5699611.html');
												thumbnails[5699615] = new thumbnail(5699615,'229369','','almond-trees_thumb.gif',130, 130,15,'photo_5699615.html');
												thumbnails[3815717] = new thumbnail(3815717,'229369','','rainy_afternoon_Eigg1_thumb.jpg',130, 130,15,'photo_3815717.html');
												thumbnails[5699619] = new thumbnail(5699619,'229369','','Alpandeire-street_thumb.gif',130, 130,15,'photo_5699619.html');
												thumbnails[3815706] = new thumbnail(3815706,'229369','','lake_with_island_thumb.jpg',130, 130,15,'photo_3815706.html');
												thumbnails[3815702] = new thumbnail(3815702,'229369','','garden_washing_thumb.jpg',130, 130,15,'photo_3815702.html');
												thumbnails[3815690] = new thumbnail(3815690,'229369','','castor_oil_plants1_thumb.jpg',130, 130,15,'photo_3815690.html');
												thumbnails[3815697] = new thumbnail(3815697,'229369','','courtyard_venice_thumb.jpg',130, 130,15,'photo_3815697.html');
												thumbnails[3815731] = new thumbnail(3815731,'229369','','wimpole_tree_and_ha-ha_thumb.jpg',130, 130,15,'photo_3815731.html');
												thumbnails[3815708] = new thumbnail(3815708,'229369','','leaf_in_wind_thumb.jpg',130, 130,15,'photo_3815708.html');
												thumbnails[3815710] = new thumbnail(3815710,'229369','','open_leaf_thumb.jpg',130, 130,15,'photo_3815710.html');
												thumbnails[5699605] = new thumbnail(5699605,'229369','','tree-at-dusk_thumb.gif',130, 130,15,'photo_5699605.html');
												thumbnails[5699626] = new thumbnail(5699626,'229369','','orange-trees-with-stream_thumb.gif',130, 130,15,'photo_5699626.html');
												thumbnails[5699624] = new thumbnail(5699624,'229369','','orange-tree_thumb.gif',130, 130,15,'photo_5699624.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[322308] = new gallery(322308,'7978620,7978616,7978606,7978601,7978594,7978579','recent','gallery',[7978601,7978579,7978594,7978606,7978616,7978620],0, 0, '', 'gallery_322308.html',0,0);
				  					galleries[229369] = new gallery(229369,'5699664,4592087','landscape','gallery',[4592190,7165006,5699664,7164977,7168605,5699675,7168942,3815726,7164979,7168603,3815693,7168598,4592087,7164973,7168606,3815714,5729585,3815699,4592341,3815722,3815691,4592331,3815718,4590891,7165020,3815721,3815704,5699611,5699615,3815717,5699619,3815706,3815702,3815690,3815697,3815731,3815708,3815710,5699605,5699626,5699624],0, 0, '', 'gallery_229369.html',0,0);
				  					galleries[229370] = new gallery(229370,'3768266','still life','gallery',[3768261,3768262,3768263,3768265,3768266,5699547,5699565,5699638,7165001,3815816,7164985,7168877,3815814,7978726,3815812,5729838,3815822,3815821,3815818,3815819,5729734,3815815,3815813,3815811,7164997],0, 0, '', 'gallery_229370.html',0,0);
				  					galleries[232457] = new gallery(232457,'3815770','portraits','gallery',[3815773,3815775,3815778,3815768,3815779,3815770,3815771],0, 0, '', 'gallery_232457.html',0,0);
				  					galleries[232458] = new gallery(232458,'3815801','stars','gallery',[3815805,3815802,3815801,3815800,3815804],0, 0, '', 'gallery_232458.html',0,0);
				  					galleries[232454] = new gallery(232454,'3815676','etchings','gallery',[3815670,3815671,3815675,3815676,3815681],0, 0, '', 'gallery_232454.html',0,0);
				  					galleries[232456] = new gallery(232456,'3815758','monoprints','gallery',[3815758,3815760,3815761],0, 0, '', 'gallery_232456.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '3841681';
imageSets[2] = '5699664,4592087,3815801,3815770,3815758,3815676,3815652,3768266';
imageSets[3] = '4592341,4592331,4592190,4592087';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/abi/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/abi/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/abi/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/abi/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/abi/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/abi/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/abi/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/abi/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/abi/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/abi/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/abi/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/abi/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/abi/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/abi/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/abi/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/abi/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/abi/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/abi/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/abi/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/abi/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/abi/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/abi/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));		  $('body').trigger('clikUpdate');		}, 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 = 'Paintings by Saddhahadaya: ' + 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));      $('body').trigger('clikUpdate');    }        
    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 == undefined) {
    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.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;
	}
}

			

