window.thumbnails = new Object();
												thumbnails[3143568] = new thumbnail(3143568,'192759','','sample29_thumb.jpg',130, 72,32,'photo_3143568.html');
												thumbnails[3159065] = new thumbnail(3159065,'192675','','DSC_02061_thumb.jpg',130, 87,32,'photo_3159065.html');
												thumbnails[3159069] = new thumbnail(3159069,'192675','','DSC_0284_thumb.jpg',130, 87,32,'photo_3159069.html');
												thumbnails[3159072] = new thumbnail(3159072,'192675','','DSC_0294_thumb.jpg',130, 87,32,'photo_3159072.html');
												thumbnails[3159087] = new thumbnail(3159087,'192675','','ELS_3894_thumb.jpg',130, 87,32,'photo_3159087.html');
												thumbnails[3159117] = new thumbnail(3159117,'192675','','ELS_4190tone_thumb.jpg',130, 87,32,'photo_3159117.html');
												thumbnails[3160022] = new thumbnail(3160022,'192758','','DSC_99b-w_thumb.jpg',130, 86,32,'photo_3160022.html');
												thumbnails[3160024] = new thumbnail(3160024,'192759','','DSC_0120effect_thumb.jpg',130, 86,32,'photo_3160024.html');
												thumbnails[3160030] = new thumbnail(3160030,'192758','','DSC_155b-w_thumb.jpg',130, 86,32,'photo_3160030.html');
												thumbnails[3160035] = new thumbnail(3160035,'192759','','DSC_0212_2_thumb.jpg',130, 86,32,'photo_3160035.html');
												thumbnails[3160038] = new thumbnail(3160038,'192759','','DSC_0276_thumb.jpg',130, 86,32,'photo_3160038.html');
												thumbnails[3160039] = new thumbnail(3160039,'192759','','DSC_0290_2_thumb.jpg',130, 86,32,'photo_3160039.html');
												thumbnails[7054915] = new thumbnail(7054915,'381912','','teaser1_thumb.jpg',130, 86,32,'photo_7054915.html');
												thumbnails[7054918] = new thumbnail(7054918,'381912','','teaser3_thumb.jpg',130, 196,32,'photo_7054918.html');
												thumbnails[7054921] = new thumbnail(7054921,'381912','','teaser10_thumb.jpg',130, 86,32,'photo_7054921.html');
												thumbnails[7054924] = new thumbnail(7054924,'381912','','teaser13_thumb.jpg',130, 196,32,'photo_7054924.html');
												thumbnails[7870542] = new thumbnail(7870542,'424843','','sample_10_thumb.jpg',130, 196,32,'photo_7870542.html');
												thumbnails[7870550] = new thumbnail(7870550,'424843','','sample1_thumb.jpg',130, 196,32,'photo_7870550.html');
												thumbnails[7870553] = new thumbnail(7870553,'424843','','sample2_thumb.jpg',130, 196,32,'photo_7870553.html');
												thumbnails[7870557] = new thumbnail(7870557,'424843','','sample3_thumb.jpg',130, 196,32,'photo_7870557.html');
												thumbnails[3752606] = new thumbnail(3752606,'228979','','DSC_1282_22_thumb.jpg',130, 196,32,'photo_3752606.html');
												thumbnails[3752630] = new thumbnail(3752630,'228979','','DSC_12874_thumb.jpg',130, 196,32,'photo_3752630.html');
												thumbnails[3159101] = new thumbnail(3159101,'192675','','ELS_4239tone_thumb.jpg',130, 87,32,'photo_3159101.html');
												thumbnails[4332043] = new thumbnail(4332043,'255068','','DSC_2938tint1_thumb.jpg',130, 86,32,'photo_4332043.html');
												thumbnails[3752611] = new thumbnail(3752611,'228979','','DSC_1336_21_thumb.jpg',130, 196,32,'photo_3752611.html');
												thumbnails[3752672] = new thumbnail(3752672,'228979','','DSC_1508_2_thumb.jpg',130, 196,32,'photo_3752672.html');
												thumbnails[4332047] = new thumbnail(4332047,'255068','','DSC_2986_thumb.jpg',130, 86,32,'photo_4332047.html');
												thumbnails[3752616] = new thumbnail(3752616,'228979','','DSC_13461_thumb.jpg',130, 196,32,'photo_3752616.html');
												thumbnails[4332054] = new thumbnail(4332054,'255068','','DSC_3053bwadjust_thumb.jpg',130, 86,32,'photo_4332054.html');
												thumbnails[3752622] = new thumbnail(3752622,'228979','','DSC_1340_22_thumb.jpg',130, 196,32,'photo_3752622.html');
												thumbnails[4332060] = new thumbnail(4332060,'255068','','DSC_3068_2_thumb.jpg',130, 86,32,'photo_4332060.html');
												thumbnails[4332062] = new thumbnail(4332062,'255068','','DSC_3081_thumb.jpg',130, 86,32,'photo_4332062.html');
												thumbnails[3752649] = new thumbnail(3752649,'228979','','DSC_1423_thumb.jpg',130, 196,32,'photo_3752649.html');
												thumbnails[4332072] = new thumbnail(4332072,'255068','','DSC_3151_thumb.jpg',130, 86,32,'photo_4332072.html');
												thumbnails[3752669] = new thumbnail(3752669,'228979','','DSC_14373_thumb.jpg',130, 196,32,'photo_3752669.html');
												thumbnails[4332075] = new thumbnail(4332075,'255068','','DSC_3157_thumb.jpg',130, 86,32,'photo_4332075.html');
												thumbnails[3159100] = new thumbnail(3159100,'192675','','ELS_4217tone_thumb.jpg',130, 87,32,'photo_3159100.html');
												thumbnails[3159992] = new thumbnail(3159992,'192758','','DSC_43_thumb.jpg',130, 196,32,'photo_3159992.html');
												thumbnails[3752659] = new thumbnail(3752659,'228979','','DSC_14661_thumb.jpg',130, 196,32,'photo_3752659.html');
												thumbnails[7054929] = new thumbnail(7054929,'381912','','teaser5_thumb.jpg',130, 86,32,'photo_7054929.html');
												thumbnails[4332115] = new thumbnail(4332115,'255068','','DSC_3228tint_thumb.jpg',130, 86,32,'photo_4332115.html');
												thumbnails[3752678] = new thumbnail(3752678,'228979','','DSC_1579_21_thumb.jpg',130, 196,32,'photo_3752678.html');
												thumbnails[4332117] = new thumbnail(4332117,'255068','','DSC_3247_thumb.jpg',130, 86,32,'photo_4332117.html');
												thumbnails[3752682] = new thumbnail(3752682,'228979','','DSC_1603_21_thumb.jpg',130, 196,32,'photo_3752682.html');
												thumbnails[4332120] = new thumbnail(4332120,'255068','','DSC_3342tint_thumb.jpg',130, 86,32,'photo_4332120.html');
												thumbnails[4332147] = new thumbnail(4332147,'255068','','DSC_3236_2_thumb.jpg',130, 86,32,'photo_4332147.html');
												thumbnails[3143566] = new thumbnail(3143566,'192758','','test33_thumb.jpg',130, 196,32,'photo_3143566.html');
												thumbnails[3159081] = new thumbnail(3159081,'192675','','ELS_3846tone_thumb.jpg',130, 195,32,'photo_3159081.html');
												thumbnails[3752753] = new thumbnail(3752753,'228979','','DSC_16841_thumb.jpg',130, 196,32,'photo_3752753.html');
												thumbnails[4332123] = new thumbnail(4332123,'255068','','DSC_3361_2_thumb.jpg',130, 72,32,'photo_4332123.html');
												thumbnails[3752756] = new thumbnail(3752756,'228979','','DSC_17432_thumb.jpg',130, 196,32,'photo_3752756.html');
												thumbnails[3143571] = new thumbnail(3143571,'192758','','test23_thumb.jpg',130, 196,32,'photo_3143571.html');
												thumbnails[3752762] = new thumbnail(3752762,'228979','','DSC_18081_thumb.jpg',130, 196,32,'photo_3752762.html');
												thumbnails[4332130] = new thumbnail(4332130,'255068','','DSC_3481_2_thumb.jpg',130, 86,32,'photo_4332130.html');
												thumbnails[3159102] = new thumbnail(3159102,'192675','','ELS_4274_thumb.jpg',130, 195,32,'photo_3159102.html');
												thumbnails[3159999] = new thumbnail(3159999,'192758','','DSC_81_2_thumb.jpg',130, 196,32,'photo_3159999.html');
												thumbnails[7054798] = new thumbnail(7054798,'381912','','riley1_thumb.jpg',130, 87,32,'photo_7054798.html');
												thumbnails[4332049] = new thumbnail(4332049,'255068','','DSC_3048_thumb.jpg',130, 196,32,'photo_4332049.html');
												thumbnails[4332119] = new thumbnail(4332119,'255068','','DSC_3277_2_thumb.jpg',130, 196,32,'photo_4332119.html');
												thumbnails[4332065] = new thumbnail(4332065,'255068','','DSC_3102_thumb.jpg',130, 196,32,'photo_4332065.html');
												thumbnails[4332090] = new thumbnail(4332090,'255068','','DSC_3202_thumb.jpg',130, 196,32,'photo_4332090.html');
												thumbnails[3159108] = new thumbnail(3159108,'192675','','ELS_4148_thumb.jpg',130, 195,32,'photo_3159108.html');
												thumbnails[4332069] = new thumbnail(4332069,'255068','','DSC_3117_thumb.jpg',130, 196,32,'photo_4332069.html');
												thumbnails[3159093] = new thumbnail(3159093,'192675','','ELS_3995_thumb.jpg',130, 195,32,'photo_3159093.html');
												thumbnails[3752750] = new thumbnail(3752750,'228979','','DSC_1607_26_thumb.jpg',130, 86,32,'photo_3752750.html');
												thumbnails[3752769] = new thumbnail(3752769,'228979','','DSC_20182_thumb.jpg',130, 86,32,'photo_3752769.html');
												thumbnails[4332091] = new thumbnail(4332091,'255068','','DSC_3211_thumb.jpg',130, 196,32,'photo_4332091.html');
												thumbnails[4332565] = new thumbnail(4332565,'255068','','DSC_3318_thumb.jpg',130, 196,32,'photo_4332565.html');
												thumbnails[4332588] = new thumbnail(4332588,'255068','','DSC_3432_thumb.jpg',130, 196,32,'photo_4332588.html');
												thumbnails[3159094] = new thumbnail(3159094,'192675','','ELS_39341_thumb.jpg',130, 195,32,'photo_3159094.html');
												thumbnails[3160007] = new thumbnail(3160007,'192758','','DSC_93_thumb.jpg',130, 196,32,'photo_3160007.html');
												thumbnails[3752689] = new thumbnail(3752689,'228979','','DSC_1624_21_thumb.jpg',130, 86,32,'photo_3752689.html');
												thumbnails[4332055] = new thumbnail(4332055,'255068','','DSC_3067_2_thumb.jpg',130, 196,32,'photo_4332055.html');
												thumbnails[7054801] = new thumbnail(7054801,'381912','','Riley61_thumb.jpg',130, 86,32,'photo_7054801.html');
												thumbnails[3752754] = new thumbnail(3752754,'228979','','DSC_1629_22_thumb.jpg',130, 86,32,'photo_3752754.html');
												thumbnails[3752774] = new thumbnail(3752774,'228979','','DSC_17553_thumb.jpg',130, 86,32,'photo_3752774.html');
												thumbnails[3160026] = new thumbnail(3160026,'192759','','DSC_0129_thumb.jpg',130, 195,32,'photo_3160026.html');
												thumbnails[7054834] = new thumbnail(7054834,'381912','','Riley21_thumb.jpg',130, 90,32,'photo_7054834.html');
												thumbnails[7054927] = new thumbnail(7054927,'381912','','teaser15_thumb.jpg',130, 86,32,'photo_7054927.html');
												thumbnails[3160053] = new thumbnail(3160053,'192759','','DSC_0420_2_thumb.jpg',130, 195,32,'photo_3160053.html');
												thumbnails[3159088] = new thumbnail(3159088,'192675','','ELS_3919_thumb.jpg',130, 195,32,'photo_3159088.html');
												thumbnails[3160044] = new thumbnail(3160044,'192759','','DSC_0309_thumb.jpg',130, 195,32,'photo_3160044.html');
												thumbnails[7054892] = new thumbnail(7054892,'381912','','Riley51_thumb.jpg',130, 87,32,'photo_7054892.html');
												thumbnails[3159063] = new thumbnail(3159063,'192675','','DSC_0282_thumb.jpg',130, 195,32,'photo_3159063.html');
												thumbnails[3159055] = new thumbnail(3159055,'192675','','DSC_0256tone_thumb.jpg',130, 196,32,'photo_3159055.html');
												thumbnails[3160046] = new thumbnail(3160046,'192759','','DSC_0329tone_thumb.jpg',130, 195,32,'photo_3160046.html');
												thumbnails[3160005] = new thumbnail(3160005,'192675','','DSC_0086tone_thumb.jpg',130, 195,32,'photo_3160005.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[192758] = new gallery(192758,'3160030,3160022,3160007,3159999,3159992,3143571,3143566','Bobby and Emma','gallery',[3160022,3160030,3159992,3143566,3143571,3159999,3160007],0, 0, '', 'gallery_192758.html',0,0);
				  					galleries[192759] = new gallery(192759,'3160053,3160046,3160044,3160039,3160038,3160035,3160026,3160024,3143568','Colin and Ellie','gallery',[3143568,3160024,3160035,3160038,3160039,3160026,3160053,3160044,3160046],0, 0, '', 'gallery_192759.html',0,0);
				  					galleries[424843] = new gallery(424843,'7870557,7870553,7870550,7870542','Lay Hoon & Peter','gallery',[7870542,7870550,7870553,7870557],0, 0, '', 'gallery_424843.html',0,0);
				  					galleries[255068] = new gallery(255068,'4332119','Mark & Selina','gallery',[4332043,4332047,4332054,4332060,4332062,4332072,4332075,4332115,4332117,4332120,4332147,4332123,4332130,4332049,4332119,4332065,4332090,4332069,4332091,4332565,4332588,4332055],0, 0, '', 'gallery_255068.html',0,0);
				  					galleries[228979] = new gallery(228979,'3752606','Roy and Kim','gallery',[3752606,3752630,3752611,3752672,3752616,3752622,3752649,3752669,3752659,3752678,3752682,3752753,3752756,3752762,3752750,3752769,3752689,3752754,3752774],0, 0, '', 'gallery_228979.html',0,0);
				  					galleries[381912] = new gallery(381912,'7054929,7054927,7054924,7054921,7054918,7054915,7054892,7054834,7054801,7054798','Sam & Kelly','gallery',[7054915,7054918,7054921,7054924,7054929,7054798,7054801,7054834,7054927,7054892],0, 0, '', 'gallery_381912.html',0,0);
				  					galleries[192675] = new gallery(192675,'3160005,3159117,3159108,3159102,3159101,3159100,3159094,3159093,3159088,3159087','Matt and Tess','gallery',[3159065,3159069,3159072,3159087,3159117,3159101,3159100,3159081,3159102,3159108,3159093,3159094,3159088,3159063,3159055,3160005],0, 0, '', 'gallery_192675.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '3752606';
imageSets[2] = '4332119,3752606';
imageSets[3] = '7054929,7054927,7054924,7054921,7054918,7054915,7054892,7054834,7054801,7054798';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/kpullan/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/kpullan/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/kpullan/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/kpullan/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/kpullan/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/kpullan/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/kpullan/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/kpullan/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/kpullan/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/kpullan/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/kpullan/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/kpullan/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/kpullan/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/kpullan/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/kpullan/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/kpullan/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/kpullan/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/kpullan/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/kpullan/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/kpullan/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/kpullan/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/kpullan/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 = 'Keith Pullan Wedding 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.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;
	}
}

			

