window.thumbnails = new Object();
												thumbnails[3527796] = new thumbnail(3527796,'','','DSCN0906_thumb.jpg',130, 173,15,'#');
												thumbnails[3527833] = new thumbnail(3527833,'','','DSCN1346_thumb.jpg',130, 121,15,'#');
												thumbnails[3527856] = new thumbnail(3527856,'','','DSCN0878_thumb.jpg',130, 173,15,'#');
												thumbnails[3527870] = new thumbnail(3527870,'','','DSCN0891_thumb.jpg',130, 173,15,'#');
												thumbnails[3527892] = new thumbnail(3527892,'','','DSCN0312a_thumb.jpg',130, 98,15,'#');
												thumbnails[3527942] = new thumbnail(3527942,'','','RSCN2503_thumb.jpg',130, 173,15,'#');
												thumbnails[3527966] = new thumbnail(3527966,'','','wed-6_thumb.jpg',130, 96,15,'#');
												thumbnails[3528027] = new thumbnail(3528027,'','','DSCN2327_thumb.jpg',130, 173,15,'#');
												thumbnails[3551890] = new thumbnail(3551890,'','','DSC_4919_thumb.jpg',130, 194,15,'#');
												thumbnails[3551896] = new thumbnail(3551896,'','','DSC_4987_thumb.jpg',130, 194,15,'#');
												thumbnails[3551903] = new thumbnail(3551903,'','','DSC_0329_thumb.jpg',130, 86,15,'#');
												thumbnails[3551909] = new thumbnail(3551909,'','','DSC_0362_thumb.jpg',130, 195,15,'#');
												thumbnails[3551913] = new thumbnail(3551913,'','','DSC_4990a_thumb.jpg',130, 87,15,'#');
												thumbnails[3551928] = new thumbnail(3551928,'','','DSC_5022_thumb.jpg',130, 194,15,'#');
												thumbnails[3551935] = new thumbnail(3551935,'','','DSC_5059_thumb.jpg',130, 194,15,'#');
												thumbnails[3551938] = new thumbnail(3551938,'','','DSC_5061a_thumb.jpg',130, 115,15,'#');
												thumbnails[3552114] = new thumbnail(3552114,'','','_DSC0628_001_thumb.jpg',130, 195,15,'#');
												thumbnails[3746765] = new thumbnail(3746765,'','','Trevor-Hupton_thumb.jpg',130, 195,15,'#');
												thumbnails[5395488] = new thumbnail(5395488,'','','swpp-transparent_thumb.gif',130, 59,15,'#');
												thumbnails[3522625] = new thumbnail(3522625,'','','_DSC0548_001_thumb.jpg',130, 87,15,'#');
												thumbnails[3523378] = new thumbnail(3523378,'','','DSC_0280_thumb.jpg',130, 87,15,'#');
												thumbnails[3522943] = new thumbnail(3522943,'','','DSCN0183_thumb.JPG',130, 98,15,'#');
												thumbnails[3523373] = new thumbnail(3523373,'','','_DSC1075_thumb.jpg',130, 221,15,'#');
												thumbnails[3523385] = new thumbnail(3523385,'','','DSC_0335_thumb.jpg',130, 194,15,'#');
												thumbnails[3522699] = new thumbnail(3522699,'','','_DSC0843_thumb.jpg',130, 195,15,'#');
												thumbnails[3522848] = new thumbnail(3522848,'','','DSC_6749_thumb.jpg',130, 87,15,'#');
												thumbnails[3522814] = new thumbnail(3522814,'','','DSC_7261_thumb.jpg',130, 87,15,'#');
												thumbnails[3522812] = new thumbnail(3522812,'','','DSC_7289_thumb.jpg',130, 87,15,'#');
												thumbnails[3522808] = new thumbnail(3522808,'','','DSC_7360_thumb.jpg',130, 87,15,'#');
												thumbnails[3523380] = new thumbnail(3523380,'','','DSC_0289_thumb.jpg',130, 154,15,'#');
												thumbnails[3522940] = new thumbnail(3522940,'','','DSC_7379_thumb.jpg',130, 194,15,'#');
												thumbnails[3522801] = new thumbnail(3522801,'','','DSCN0337_thumb.JPG',130, 98,15,'#');
												thumbnails[3522787] = new thumbnail(3522787,'','','DSC_64091_thumb.jpg',130, 105,15,'#');
												thumbnails[3522784] = new thumbnail(3522784,'','','DSC_0258_thumb.jpg',130, 87,15,'#');
												thumbnails[3522799] = new thumbnail(3522799,'','','DSCN0343_thumb.JPG',130, 173,15,'#');
												thumbnails[3522796] = new thumbnail(3522796,'','','DSCN0330_thumb.JPG',130, 173,15,'#');
												thumbnails[3522858] = new thumbnail(3522858,'','','DSC_6698_thumb.jpg',130, 194,15,'#');
												thumbnails[3522806] = new thumbnail(3522806,'','','DSC_7377_thumb.jpg',130, 194,15,'#');
												thumbnails[3522804] = new thumbnail(3522804,'','','DSC_7395_thumb.jpg',130, 194,15,'#');
												thumbnails[3522736] = new thumbnail(3522736,'','','DSC_01771_thumb.jpg',130, 169,15,'#');
												thumbnails[3523379] = new thumbnail(3523379,'','','DSCN1362a_thumb.jpg',130, 133,15,'#');
												thumbnails[3523402] = new thumbnail(3523402,'383012','','RSCN2485_thumb.jpg',130, 107,15,'photo_3523402.html');
												thumbnails[3564947] = new thumbnail(3564947,'383012','','DSC_6926a_thumb.jpg',130, 194,15,'photo_3564947.html');
												thumbnails[3564964] = new thumbnail(3564964,'383012','','DSC_7136_thumb.jpg',130, 87,15,'photo_3564964.html');
												thumbnails[3569719] = new thumbnail(3569719,'383012','','DSC_6491_thumb.jpg',130, 87,15,'photo_3569719.html');
												thumbnails[3586940] = new thumbnail(3586940,'383012','','DSC_0295b_thumb.jpg',130, 130,15,'photo_3586940.html');
												thumbnails[3586950] = new thumbnail(3586950,'383012','','DSC_03201_thumb.jpg',130, 87,15,'photo_3586950.html');
												thumbnails[3621900] = new thumbnail(3621900,'383012','','DSCN0967_thumb.jpg',130, 98,15,'photo_3621900.html');
												thumbnails[3621953] = new thumbnail(3621953,'383012','','DSCN0873_thumb.jpg',130, 98,15,'photo_3621953.html');
												thumbnails[3622173] = new thumbnail(3622173,'383012','','DSCN2702_thumb.jpg',130, 98,15,'photo_3622173.html');
												thumbnails[3622246] = new thumbnail(3622246,'383012','','DSC_7334_thumb.jpg',130, 87,15,'photo_3622246.html');
												thumbnails[3622298] = new thumbnail(3622298,'383012','','DSC_0302b_thumb.jpg',130, 194,15,'photo_3622298.html');
												thumbnails[5395394] = new thumbnail(5395394,'383012','','M__L_Sissons-1_thumb.jpg',130, 163,15,'photo_5395394.html');
												thumbnails[5395396] = new thumbnail(5395396,'383012','','M__L_Sissons-25_thumb.jpg',130, 123,15,'photo_5395396.html');
												thumbnails[5395412] = new thumbnail(5395412,'383012','','M__L_Sissons-31_thumb.jpg',130, 86,15,'photo_5395412.html');
												thumbnails[5395414] = new thumbnail(5395414,'383012','','M__L_Sissons-37_thumb.jpg',130, 130,15,'photo_5395414.html');
												thumbnails[5395416] = new thumbnail(5395416,'383012','','M__L_Sissons-79_thumb.jpg',130, 86,15,'photo_5395416.html');
												thumbnails[5395418] = new thumbnail(5395418,'383012','','M__L_Sissons-145_thumb.jpg',130, 195,15,'photo_5395418.html');
												thumbnails[5395419] = new thumbnail(5395419,'383012','','M__L_Sissons-159-2_thumb.jpg',130, 195,15,'photo_5395419.html');
												thumbnails[5395421] = new thumbnail(5395421,'383012','','M__L_Sissons-163-2_thumb.jpg',130, 195,15,'photo_5395421.html');
												thumbnails[5395422] = new thumbnail(5395422,'383012','','M__L_Sissons-218_thumb.jpg',130, 130,15,'photo_5395422.html');
												thumbnails[5395423] = new thumbnail(5395423,'383012','','M__L_Sissons-240_thumb.jpg',130, 86,15,'photo_5395423.html');
												thumbnails[5395424] = new thumbnail(5395424,'383012','','M__L_Sissons-266-2_thumb.jpg',130, 86,15,'photo_5395424.html');
												thumbnails[5395425] = new thumbnail(5395425,'383012','','M__L_Sissons-294_thumb.jpg',130, 197,15,'photo_5395425.html');
												thumbnails[5395426] = new thumbnail(5395426,'383012','','M__L_Sissons-300_thumb.jpg',130, 195,15,'photo_5395426.html');
												thumbnails[5395427] = new thumbnail(5395427,'383012','','M__L_Sissons-333_thumb.jpg',130, 195,15,'photo_5395427.html');
												thumbnails[6475842] = new thumbnail(6475842,'383012','','S__L_Mosley_-_Dignan00134_thumb.jpg',130, 86,15,'photo_6475842.html');
												thumbnails[6475846] = new thumbnail(6475846,'383012','','S__L_Mosley_-_Dignan00157_thumb.jpg',130, 195,15,'photo_6475846.html');
												thumbnails[6475847] = new thumbnail(6475847,'383012','','S__L_Mosley_-_Dignan00200_thumb.jpg',130, 130,15,'photo_6475847.html');
												thumbnails[6475850] = new thumbnail(6475850,'383012','','S__L_Mosley_-_Dignan00206_thumb.jpg',130, 195,15,'photo_6475850.html');
												thumbnails[6475853] = new thumbnail(6475853,'383012','','S__L_Mosley_-_Dignan00283_thumb.jpg',130, 130,15,'photo_6475853.html');
												thumbnails[6475856] = new thumbnail(6475856,'383012','','S__L_Mosley_-_Dignan00294_thumb.jpg',130, 195,15,'photo_6475856.html');
												thumbnails[6475857] = new thumbnail(6475857,'383012','','S__L_Mosley_-_Dignan00295_thumb.jpg',130, 195,15,'photo_6475857.html');
												thumbnails[6475859] = new thumbnail(6475859,'383012','','S__L_Mosley_-_Dignan00360_thumb.jpg',130, 195,15,'photo_6475859.html');
												thumbnails[6475861] = new thumbnail(6475861,'383012','','K__S_Kennedy00064_thumb.jpg',130, 195,15,'photo_6475861.html');
												thumbnails[6475862] = new thumbnail(6475862,'383012','','K__S_Kennedy00161_thumb.jpg',130, 86,15,'photo_6475862.html');
												thumbnails[6475864] = new thumbnail(6475864,'383012','','K__S_Kennedy00259_thumb.jpg',130, 86,15,'photo_6475864.html');
												thumbnails[6475865] = new thumbnail(6475865,'383012','','K__S_Kennedy00262_thumb.jpg',130, 195,15,'photo_6475865.html');
												thumbnails[6475866] = new thumbnail(6475866,'383012','','K__S_Kennedy00268_thumb.jpg',130, 86,15,'photo_6475866.html');
												thumbnails[6475867] = new thumbnail(6475867,'383012','','K__S_Kennedy00285_thumb.jpg',130, 130,15,'photo_6475867.html');
												thumbnails[6475869] = new thumbnail(6475869,'383012','','K__S_Kennedy00289_thumb.jpg',130, 86,15,'photo_6475869.html');
												thumbnails[6475870] = new thumbnail(6475870,'383012','','K__S_Kennedy00345_thumb.jpg',130, 94,15,'photo_6475870.html');
												thumbnails[6475873] = new thumbnail(6475873,'383012','','K__S_Kennedy00359_thumb.jpg',130, 195,15,'photo_6475873.html');
												thumbnails[6475875] = new thumbnail(6475875,'383012','','K__S_Kennedy00369_thumb.jpg',130, 195,15,'photo_6475875.html');
												thumbnails[6475877] = new thumbnail(6475877,'383012','','K__S_Kennedy00399_thumb.jpg',130, 195,15,'photo_6475877.html');
												thumbnails[6475879] = new thumbnail(6475879,'383012','','K__S_Kennedy00407_thumb.jpg',130, 195,15,'photo_6475879.html');
												thumbnails[6475880] = new thumbnail(6475880,'383012','','K__S_Kennedy00434_thumb.jpg',130, 195,15,'photo_6475880.html');
												thumbnails[7049158] = new thumbnail(7049158,'383012','','Composite_thumb.jpg',130, 130,15,'photo_7049158.html');
												thumbnails[7079125] = new thumbnail(7079125,'383012','','F__L_Mendelsohn_00124_thumb.jpg',130, 86,15,'photo_7079125.html');
												thumbnails[7079136] = new thumbnail(7079136,'383012','','F__L_Mendelsohn_001241_thumb.jpg',130, 86,15,'photo_7079136.html');
												thumbnails[7079139] = new thumbnail(7079139,'383012','','F__L_Mendelsohn_00140_thumb.jpg',130, 86,15,'photo_7079139.html');
												thumbnails[7079141] = new thumbnail(7079141,'383012','','F__L_Mendelsohn_00176_thumb.jpg',130, 86,15,'photo_7079141.html');
												thumbnails[7079143] = new thumbnail(7079143,'383012','','F__L_Mendelsohn_00226_thumb.jpg',130, 86,15,'photo_7079143.html');
												thumbnails[7079144] = new thumbnail(7079144,'383012','','F__L_Mendelsohn_00204_thumb.jpg',130, 86,15,'photo_7079144.html');
												thumbnails[7079145] = new thumbnail(7079145,'383012','','F__L_Mendelsohn_00249_thumb.jpg',130, 86,15,'photo_7079145.html');
												thumbnails[7079147] = new thumbnail(7079147,'383012','','F__L_Mendelsohn_00278_thumb.jpg',130, 86,15,'photo_7079147.html');
												thumbnails[7079152] = new thumbnail(7079152,'383012','','F__L_Mendelsohn_00243_thumb.jpg',130, 86,15,'photo_7079152.html');
												thumbnails[7079156] = new thumbnail(7079156,'383012','','F__L_Mendelsohn_00270_thumb.jpg',130, 192,15,'photo_7079156.html');
												thumbnails[7079157] = new thumbnail(7079157,'383012','','F__L_Mendelsohn_00262_thumb.jpg',130, 195,15,'photo_7079157.html');
												thumbnails[7079159] = new thumbnail(7079159,'383012','','F__L_Mendelsohn_00255_thumb.jpg',130, 195,15,'photo_7079159.html');
												thumbnails[7079160] = new thumbnail(7079160,'383012','','F__L_Mendelsohn_00256_thumb.jpg',130, 195,15,'photo_7079160.html');
												thumbnails[7079164] = new thumbnail(7079164,'383012','','F__L_Mendelsohn_00272_thumb.jpg',130, 130,15,'photo_7079164.html');
												thumbnails[7079166] = new thumbnail(7079166,'383012','','F__L_Mendelsohn_00287_thumb.jpg',130, 130,15,'photo_7079166.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[383012] = new gallery(383012,'6475873,6475850,5395421','Gallery','section423788',[3523402,3564947,3564964,3569719,3586940,3586950,3621900,3621953,3622173,3622246,3622298,5395394,5395396,5395412,5395414,5395416,5395418,5395419,5395421,5395422,5395423,5395424,5395425,5395426,5395427,6475842,6475846,6475847,6475850,6475853,6475856,6475857,6475859,6475861,6475862,6475864,6475865,6475866,6475867,6475869,6475870,6475873,6475875,6475877,6475879,6475880,7049158,7079125,7079136,7079139,7079141,7079143,7079144,7079145,7079147,7079152,7079156,7079157,7079159,7079160,7079164,7079166],0, 0, '', 'section423788.html',0,1);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7049158';
imageSets[2] = '6475873,6475850,5395421';
imageSets[3] = '5395427,5395426,5395425,5395424,5395423,5395422,5395419,5395418,5395416,5395414,5395412,5395396,5395394';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/runningman/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/runningman/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/runningman/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/runningman/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/runningman/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/runningman/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/runningman/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/runningman/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/runningman/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/runningman/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/runningman/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/runningman/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/runningman/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/runningman/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www2.clikpic.com/runningman/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/runningman/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/runningman/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/runningman/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/runningman/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/runningman/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/runningman/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/runningman/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 += 'section423788.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 && 'section423788' != '') {
					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 = 'Select Images Photography: ' + 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 = 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;
	}
}

		

