window.thumbnails = new Object();
												thumbnails[127464] = new thumbnail(127464,'','','m_thumb.jpg',130, 165,1,'#');
												thumbnails[127471] = new thumbnail(127471,'','','x_thumb.jpg',130, 165,1,'#');
												thumbnails[1918378] = new thumbnail(1918378,'','','Img0112_thumb.jpg',130, 182,1,'#');
												thumbnails[3232972] = new thumbnail(3232972,'','','_DSC0068_thumb.jpg',130, 79,1,'#');
												thumbnails[7694498] = new thumbnail(7694498,'','','_DSC0114_2_thumb.jpg',130, 118,1,'#');
												thumbnails[476234] = new thumbnail(476234,'','Img0099','Img0099_thumb.jpg',130, 87,1,'#');
												thumbnails[476235] = new thumbnail(476235,'','Img0102','Img0102_thumb.jpg',130, 87,1,'#');
												thumbnails[126022] = new thumbnail(126022,'11320','','DSC_0612_thumb.JPG',130, 86,1,'photo_126022.html');
												thumbnails[126028] = new thumbnail(126028,'11320','','DSC_0657_thumb.JPG',130, 196,1,'photo_126028.html');
												thumbnails[126032] = new thumbnail(126032,'11320','','DSC_0666_thumb.JPG',130, 196,1,'photo_126032.html');
												thumbnails[126036] = new thumbnail(126036,'11320','','DSC_0668_thumb.JPG',130, 86,1,'photo_126036.html');
												thumbnails[126047] = new thumbnail(126047,'11320','','DSC_0746_thumb.JPG',130, 86,1,'photo_126047.html');
												thumbnails[126054] = new thumbnail(126054,'11320','','DSC_0766_thumb.JPG',130, 86,1,'photo_126054.html');
												thumbnails[126058] = new thumbnail(126058,'11320','','DSC_0816_thumb.JPG',130, 86,1,'photo_126058.html');
												thumbnails[126068] = new thumbnail(126068,'11320','','DSC_0889_thumb.JPG',130, 86,1,'photo_126068.html');
												thumbnails[128024] = new thumbnail(128024,'11320','Home Page Image','DSC_0061_thumb.jpg',130, 196,1,'photo_128024.html');
												thumbnails[133319] = new thumbnail(133319,'11638','','DSC_0011_thumb.JPG',130, 196,1,'photo_133319.html');
												thumbnails[133321] = new thumbnail(133321,'11638','','DSC_0013_thumb.JPG',130, 196,1,'photo_133321.html');
												thumbnails[133323] = new thumbnail(133323,'11638','','DSC_0020_thumb.JPG',130, 86,1,'photo_133323.html');
												thumbnails[133324] = new thumbnail(133324,'11638','','DSC_0026_thumb.JPG',130, 86,1,'photo_133324.html');
												thumbnails[133326] = new thumbnail(133326,'11638','','DSC_0038_thumb.JPG',130, 196,1,'photo_133326.html');
												thumbnails[133328] = new thumbnail(133328,'11638','','DSC_0055_thumb.JPG',130, 196,1,'photo_133328.html');
												thumbnails[133330] = new thumbnail(133330,'11638','','DSC_0083_thumb.JPG',130, 196,1,'photo_133330.html');
												thumbnails[133331] = new thumbnail(133331,'11638','','DSC_0086_thumb.JPG',130, 86,1,'photo_133331.html');
												thumbnails[133335] = new thumbnail(133335,'11638','','DSC_0098_thumb.JPG',130, 196,1,'photo_133335.html');
												thumbnails[133337] = new thumbnail(133337,'11638','','DSC_0102_thumb.JPG',130, 86,1,'photo_133337.html');
												thumbnails[133338] = new thumbnail(133338,'11638','','DSC_0104_thumb.JPG',130, 196,1,'photo_133338.html');
												thumbnails[133341] = new thumbnail(133341,'11638','','DSC_0113_thumb.JPG',130, 196,1,'photo_133341.html');
												thumbnails[133343] = new thumbnail(133343,'11638','','DSC_0270_thumb.JPG',130, 196,1,'photo_133343.html');
												thumbnails[133344] = new thumbnail(133344,'11638','','DSC_0302_thumb.JPG',130, 196,1,'photo_133344.html');
												thumbnails[133345] = new thumbnail(133345,'11638','','DSC_0309_thumb.JPG',130, 86,1,'photo_133345.html');
												thumbnails[334627] = new thumbnail(334627,'11320','','DSC_10221_thumb.JPG',130, 196,1,'photo_334627.html');
												thumbnails[7694490] = new thumbnail(7694490,'416650','','_DSC0083_thumb.jpg',130, 196,1,'photo_7694490.html');
												thumbnails[7694493] = new thumbnail(7694493,'416650','','_DSC0113_thumb.jpg',130, 110,1,'photo_7694493.html');
												thumbnails[7694495] = new thumbnail(7694495,'416650','','_DSC0134_thumb.jpg',130, 87,1,'photo_7694495.html');
												thumbnails[7694497] = new thumbnail(7694497,'416650','','_DSC0146_thumb.jpg',130, 87,1,'photo_7694497.html');
												thumbnails[7694499] = new thumbnail(7694499,'416650','','_DSC0114_thumb.jpg',130, 87,1,'photo_7694499.html');
												thumbnails[334562] = new thumbnail(334562,'28014','Copy of Img1748 copy','Copy of Img1748 copy_thumb.jpg',130, 86,1,'photo_334562.html');
												thumbnails[334567] = new thumbnail(334567,'28014','DSC 0047','DSC_0047_thumb.jpg',130, 86,1,'photo_334567.html');
												thumbnails[334572] = new thumbnail(334572,'28014','DSC 0070-1','DSC_0070-1_thumb.jpg',130, 196,1,'photo_334572.html');
												thumbnails[334577] = new thumbnail(334577,'28014','DSC 0124-1','DSC_0124-1_thumb.jpg',130, 196,1,'photo_334577.html');
												thumbnails[334582] = new thumbnail(334582,'28014','DSC 0174','DSC_0174_thumb.jpg',130, 196,1,'photo_334582.html');
												thumbnails[334588] = new thumbnail(334588,'28014','Img1621','Img1621_thumb.jpg',130, 181,1,'photo_334588.html');
												thumbnails[334595] = new thumbnail(334595,'28014','Img1781','Img1781_thumb.jpg',130, 87,1,'photo_334595.html');
												thumbnails[334600] = new thumbnail(334600,'28014','Img1801','Img1801_thumb.jpg',130, 87,1,'photo_334600.html');
												thumbnails[334605] = new thumbnail(334605,'28014','Img1955','Img1955_thumb.jpg',130, 169,1,'photo_334605.html');
												thumbnails[2816372] = new thumbnail(2816372,'175909',' DSC0005','_DSC0005_thumb.jpg',130, 87,1,'photo_2816372.html');
												thumbnails[334563] = new thumbnail(334563,'28014','DSC 0040','DSC_0040_thumb.jpg',130, 86,1,'photo_334563.html');
												thumbnails[334568] = new thumbnail(334568,'28014','DSC 0054','DSC_0054_thumb.jpg',130, 86,1,'photo_334568.html');
												thumbnails[334573] = new thumbnail(334573,'28014','DSC 0095-1','DSC_0095-1_thumb.jpg',130, 86,1,'photo_334573.html');
												thumbnails[334578] = new thumbnail(334578,'28014','DSC 0124','DSC_0124_thumb.jpg',130, 196,1,'photo_334578.html');
												thumbnails[334583] = new thumbnail(334583,'28014','Img0149','Img0149_thumb.jpg',130, 87,1,'photo_334583.html');
												thumbnails[334589] = new thumbnail(334589,'28014','Img1699','Img1699_thumb.jpg',130, 86,1,'photo_334589.html');
												thumbnails[334596] = new thumbnail(334596,'28014','Img1795','Img1795_thumb.jpg',130, 87,1,'photo_334596.html');
												thumbnails[334601] = new thumbnail(334601,'28014','Img1803','Img1803_thumb.jpg',130, 87,1,'photo_334601.html');
												thumbnails[334606] = new thumbnail(334606,'28014','Img1956','Img1956_thumb.jpg',130, 185,1,'photo_334606.html');
												thumbnails[2816373] = new thumbnail(2816373,'175909',' DSC0069','_DSC0069_thumb.jpg',130, 87,1,'photo_2816373.html');
												thumbnails[334564] = new thumbnail(334564,'28014','DSC 0045-1','DSC_0045-1_thumb.jpg',130, 86,1,'photo_334564.html');
												thumbnails[334569] = new thumbnail(334569,'28014','DSC 0055-1','DSC_0055-1_thumb.jpg',130, 86,1,'photo_334569.html');
												thumbnails[334574] = new thumbnail(334574,'28014','DSC 0097','DSC_0097_thumb.jpg',130, 196,1,'photo_334574.html');
												thumbnails[334579] = new thumbnail(334579,'28014','DSC 0128','DSC_0128_thumb.jpg',130, 196,1,'photo_334579.html');
												thumbnails[334584] = new thumbnail(334584,'28014','Img1425','Img1425_thumb.jpg',130, 86,1,'photo_334584.html');
												thumbnails[334590] = new thumbnail(334590,'28014','Img1715','Img1715_thumb.jpg',130, 196,1,'photo_334590.html');
												thumbnails[334597] = new thumbnail(334597,'28014','Img1796','Img1796_thumb.jpg',130, 87,1,'photo_334597.html');
												thumbnails[334602] = new thumbnail(334602,'28014','Img1805','Img1805_thumb.jpg',130, 87,1,'photo_334602.html');
												thumbnails[334607] = new thumbnail(334607,'28014','Img1969','Img1969_thumb.jpg',130, 87,1,'photo_334607.html');
												thumbnails[2816374] = new thumbnail(2816374,'175909',' DSC0088','_DSC00881_thumb.jpg',130, 87,1,'photo_2816374.html');
												thumbnails[334565] = new thumbnail(334565,'28014','DSC 0046-1','DSC_0046-1_thumb.jpg',130, 86,1,'photo_334565.html');
												thumbnails[334570] = new thumbnail(334570,'28014','DSC 0055','DSC_00551_thumb.jpg',130, 86,1,'photo_334570.html');
												thumbnails[334575] = new thumbnail(334575,'28014','DSC 0102-1','DSC_0102-1_thumb.jpg',130, 86,1,'photo_334575.html');
												thumbnails[334580] = new thumbnail(334580,'28014','DSC 0133','DSC_0133_thumb.jpg',130, 196,1,'photo_334580.html');
												thumbnails[334585] = new thumbnail(334585,'28014','Img1453','Img1453_thumb.jpg',130, 86,1,'photo_334585.html');
												thumbnails[334591] = new thumbnail(334591,'28014','Img1758','Img1758_thumb.jpg',130, 86,1,'photo_334591.html');
												thumbnails[334598] = new thumbnail(334598,'28014','Img1797','Img1797_thumb.jpg',130, 87,1,'photo_334598.html');
												thumbnails[334603] = new thumbnail(334603,'28014','Img1954','Img1954_thumb.jpg',130, 87,1,'photo_334603.html');
												thumbnails[2816375] = new thumbnail(2816375,'175909',' DSC0115','_DSC0115_thumb.jpg',130, 87,1,'photo_2816375.html');
												thumbnails[334566] = new thumbnail(334566,'28014','DSC 0046','DSC_00461_thumb.jpg',130, 86,1,'photo_334566.html');
												thumbnails[334571] = new thumbnail(334571,'28014','DSC 0069-1','DSC_0069-1_thumb.jpg',130, 75,1,'photo_334571.html');
												thumbnails[334576] = new thumbnail(334576,'28014','DSC 0103','DSC_0103_thumb.jpg',130, 196,1,'photo_334576.html');
												thumbnails[334581] = new thumbnail(334581,'28014','DSC 0146-1','DSC_0146-1_thumb.jpg',130, 196,1,'photo_334581.html');
												thumbnails[334586] = new thumbnail(334586,'28014','Img1570','Img1570_thumb.jpg',130, 86,1,'photo_334586.html');
												thumbnails[334592] = new thumbnail(334592,'28014','Img1763','Img1763_thumb.jpg',130, 86,1,'photo_334592.html');
												thumbnails[334599] = new thumbnail(334599,'28014','Img1799','Img1799_thumb.jpg',130, 87,1,'photo_334599.html');
												thumbnails[334604] = new thumbnail(334604,'28014','Img19541','Img19541_thumb.jpg',130, 87,1,'photo_334604.html');
												thumbnails[2816376] = new thumbnail(2816376,'175909',' DSC0117','_DSC0117_thumb.jpg',130, 87,1,'photo_2816376.html');
												thumbnails[2816377] = new thumbnail(2816377,'175909',' DSC0131','_DSC0131_thumb.jpg',130, 194,1,'photo_2816377.html');
												thumbnails[2816378] = new thumbnail(2816378,'175909',' DSC0136','_DSC0136_thumb.jpg',130, 194,1,'photo_2816378.html');
												thumbnails[2816379] = new thumbnail(2816379,'175909',' DSC0154','_DSC0154_thumb.jpg',130, 87,1,'photo_2816379.html');
												thumbnails[2816380] = new thumbnail(2816380,'175909',' DSC0157','_DSC0157_thumb.jpg',130, 87,1,'photo_2816380.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[416650] = new gallery(416650,'7694499','Gallery 1','gallery',[7694490,7694493,7694495,7694497,7694499],0, 0, '', 'gallery_416650.html',0,0);
				  					galleries[28014] = new gallery(28014,'334607,334606,334605,334604,334603,334602,334601,334600,334599,334598','Gallery 2','gallery',[334562,334567,334572,334577,334582,334588,334595,334600,334605,334563,334568,334573,334578,334583,334589,334596,334601,334606,334564,334569,334574,334579,334584,334590,334597,334602,334607,334565,334570,334575,334580,334585,334591,334598,334603,334566,334571,334576,334581,334586,334592,334599,334604],0, 0, '', 'gallery_28014.html',0,0);
				  					galleries[175909] = new gallery(175909,'2816380,2816379,2816378,2816377,2816376,2816375,2816374,2816373,2816372','Gallery 6','gallery',[2816372,2816373,2816374,2816375,2816376,2816377,2816378,2816379,2816380],0, 0, '', 'gallery_175909.html',0,0);
				  					galleries[11320] = new gallery(11320,'334627','Gallery 3','gallery',[126022,126028,126032,126036,126047,126054,126058,126068,128024,334627],0, 0, '', 'gallery_11320.html',0,0);
				  					galleries[11638] = new gallery(11638,'133319','Gallery 4','gallery',[133319,133321,133323,133324,133326,133328,133330,133331,133335,133337,133338,133341,133343,133344,133345],0, 0, '', 'gallery_11638.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7694499,3232972,2816380,2816378,2816372,1918378,334590,133321,127471,126058';
imageSets[2] = '7694499,334627,133319';
imageSets[3] = '7694499,7694498,7694497,7694495,7694493,7694490,3232972,2816380,2816379,2816378,2816377,2816376,2816375,2816374,2816373,2816372,1918378,476235,476234,334627,334607,334606,334605,334604,334603,334602,334601,334600,334599,334598,334597,334596,334595,334592,334591,334590,334589,334588,334586,334585,334584,334583,334582,334581,334580,334579,334578,334577,334576,334575';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/steviep/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/steviep/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/steviep/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/steviep/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/steviep/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/steviep/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/steviep/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/steviep/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/steviep/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/steviep/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/steviep/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/steviep/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/steviep/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/steviep/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/steviep/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/steviep/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/steviep/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/steviep/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/steviep/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/steviep/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/steviep/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/steviep/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 = 'Cheshire Weddings: ' + 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>';
	}
					
	temp = temp + this.fnGetPaymentInfo();
				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>Buy now using PayPal:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (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="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
				
		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 + '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
	temp = temp + '	<input type="hidden" name="item_option" value="' + item_option + '">';
	temp = temp + '	<input type="hidden" name="site" value="STEVIEP">';
		temp = temp + '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp = temp + '	<input type="hidden" name="quantity" value="1">';
								temp = temp + '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
			temp = temp + '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
	temp = temp + '</form>';
		temp = temp + '<div class="clearing">&nbsp;</div>';
	temp = temp + '<div id="confirmContainer">';
	temp = temp + '<div id="paymentConfirm">Item added to cart</div>';
	temp = temp + '</div>';
			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;
	}
}

			

