window.thumbnails = new Object();
												thumbnails[974400] = new thumbnail(974400,'','Lake District From The Air by Simon Kirwan, published by Myriad Books','lakefromair_thumb.jpg',130, 130,1,'							photo_974400.html');
												thumbnails[3337210] = new thumbnail(3337210,'','MV Riverdance on Cleveleys beach, near Blackpool','_LBP2484_thumb.jpg',130, 87,1,'							photo_3337210.html');
												thumbnails[971342] = new thumbnail(971342,'73032','GMEX Arena, Manchester','_LBP7331_thumb.jpg',130, 86,1,'							photo_971342.html');
												thumbnails[971350] = new thumbnail(971350,'73032','Central Library, Manchester','_LBP7335_thumb.jpg',130, 86,1,'							photo_971350.html');
												thumbnails[971580] = new thumbnail(971580,'73032','Urbis Museum & MEN Arena','_LBP7337_thumb.jpg',130, 86,1,'							photo_971580.html');
												thumbnails[971582] = new thumbnail(971582,'73032','Manchester City Centre','_LBP7340_thumb.jpg',130, 86,1,'							photo_971582.html');
												thumbnails[992959] = new thumbnail(992959,'73032','Manchester City Centre','_LBP7343_thumb.jpg',130, 86,1,'							photo_992959.html');
												thumbnails[992960] = new thumbnail(992960,'73032','Manchester City Centre','_LBP7349_thumb.jpg',130, 86,1,'							photo_992960.html');
												thumbnails[992961] = new thumbnail(992961,'73032','Manchester City Centre','_LBP7358_thumb.jpg',130, 86,1,'							photo_992961.html');
												thumbnails[992963] = new thumbnail(992963,'73032','Manchester City Centre','_LBP7363_thumb.jpg',130, 86,1,'							photo_992963.html');
												thumbnails[971610] = new thumbnail(971610,'73045','Liver Building, Cunard Building, Port of Liverpool Building - The Three Graces','_LBP6211_thumb.jpg',130, 86,1,'							photo_971610.html');
												thumbnails[971613] = new thumbnail(971613,'73045','Metropolitan Cathedral of Christ the King, Liverpool','_LBP6204_thumb.jpg',130, 86,1,'							photo_971613.html');
												thumbnails[971617] = new thumbnail(971617,'73045','Lime Street Station, Liverpool','_LBP6206_thumb.jpg',130, 86,1,'							photo_971617.html');
												thumbnails[971619] = new thumbnail(971619,'73045','Albert Dock, Liverpool','_LBP6215_thumb.jpg',130, 86,1,'							photo_971619.html');
												thumbnails[975069] = new thumbnail(975069,'73045','Liverpool city centre & waterfront','_LBP6223_thumb.jpg',130, 86,1,'							photo_975069.html');
												thumbnails[975071] = new thumbnail(975071,'73045','King\'s Dock development, Liverpool','_LBP6225_thumb.jpg',130, 86,1,'							photo_975071.html');
												thumbnails[992952] = new thumbnail(992952,'73045','Liverpool waterfront & city centre','_LBP6235_thumb.jpg',130, 86,1,'							photo_992952.html');
												thumbnails[992956] = new thumbnail(992956,'73045','Liver Building, Cunard Building, Port of Liverpool Building','_LBP6229_thumb.jpg',130, 86,1,'							photo_992956.html');
												thumbnails[3337214] = new thumbnail(3337214,'73045','Liverpool ONE Retail Development','_SK26199_thumb.jpg',130, 87,1,'							photo_3337214.html');
												thumbnails[3337215] = new thumbnail(3337215,'73045','Liverpool ONE Retail Development','_SK26206_thumb.jpg',130, 87,1,'							photo_3337215.html');
												thumbnails[3337216] = new thumbnail(3337216,'73045','Liverpool, showing Echo Arena and BT Convention Centre, Albert Dock and Liverpool ONE','_SK35695_thumb.jpg',130, 87,1,'							photo_3337216.html');
												thumbnails[971622] = new thumbnail(971622,'73046','Ambleside and Lake Windermere','ambleside2374_thumb.jpg',130, 86,1,'							photo_971622.html');
												thumbnails[971628] = new thumbnail(971628,'73046','Keswick & Derwent Water','keswick2400_thumb.jpg',130, 86,1,'							photo_971628.html');
												thumbnails[971634] = new thumbnail(971634,'73046','Skiddaw','skiddaw2391_thumb.jpg',130, 86,1,'							photo_971634.html');
												thumbnails[971638] = new thumbnail(971638,'73046','Coniston Old Man','conistonoldman2442_thumb.jpg',130, 86,1,'							photo_971638.html');
												thumbnails[992930] = new thumbnail(992930,'73046','Angle Tarn, Cumbria','angletarn5401_thumb.jpg',130, 86,1,'							photo_992930.html');
												thumbnails[992933] = new thumbnail(992933,'73046','Belle Isle, Lake Windermere','belleisle5444_thumb.jpg',130, 86,1,'							photo_992933.html');
												thumbnails[992935] = new thumbnail(992935,'73046','Crummock Water, Buttermere','crummock5509_thumb.jpg',130, 86,1,'							photo_992935.html');
												thumbnails[992942] = new thumbnail(992942,'73046','Sca Fell Pike, Wasdale','scafellpike2408_thumb.jpg',130, 86,1,'							photo_992942.html');
												thumbnails[971642] = new thumbnail(971642,'73047','Aran Fawddwy','aranfawddwy0107_thumb.jpg',130, 86,1,'							photo_971642.html');
												thumbnails[971646] = new thumbnail(971646,'73047','Bardsey Island','bardsey6296_thumb.jpg',130, 86,1,'							photo_971646.html');
												thumbnails[971651] = new thumbnail(971651,'73047','Mount Snowdon','snowdon6339_thumb.jpg',130, 86,1,'							photo_971651.html');
												thumbnails[971659] = new thumbnail(971659,'73047','Afon Mawdach Estuary','mawdach0139_thumb.jpg',130, 86,1,'							photo_971659.html');
												thumbnails[973800] = new thumbnail(973800,'73047','Mawdach Estuary','_LBP6943_thumb.jpg',130, 79,1,'							photo_973800.html');
												thumbnails[973802] = new thumbnail(973802,'73047','Cardiff Docklands Development','_LBP6788_thumb.jpg',130, 79,1,'							photo_973802.html');
												thumbnails[973803] = new thumbnail(973803,'73047','Mawdach Estuary','picture-50_thumb.jpg',130, 86,1,'							photo_973803.html');
												thumbnails[973804] = new thumbnail(973804,'73047','Menai Bridge, Anglesey','menai6275_thumb.jpg',130, 86,1,'							photo_973804.html');
												thumbnails[975064] = new thumbnail(975064,'73047','Whiteford Point, Pembrokeshire','whitefordpoint6635_thumb.jpg',130, 86,1,'							photo_975064.html');
												thumbnails[975162] = new thumbnail(975162,'73047','Mumbles Head, Wales','mumbles6609_thumb.jpg',130, 86,1,'							photo_975162.html');
												thumbnails[975164] = new thumbnail(975164,'73047','Porth Iago, Lleyn Peninsula, North Wales','porthiago6294_thumb.jpg',130, 86,1,'							photo_975164.html');
												thumbnails[975166] = new thumbnail(975166,'73047','Skokholm Island, Pembroke, Wales','skokholm6701_thumb.jpg',130, 86,1,'							photo_975166.html');
												thumbnails[975168] = new thumbnail(975168,'73047','Yr Eifl, Lleyn Peninsula, Wales','yreifl6287_thumb.jpg',130, 86,1,'							photo_975168.html');
												thumbnails[992916] = new thumbnail(992916,'73047','Arenig Fawr, Snowdonia','arenigfawr0093_thumb.jpg',130, 86,1,'							photo_992916.html');
												thumbnails[992918] = new thumbnail(992918,'73047','Cadair Idris, Snowdonia','cadairidris6327_thumb.jpg',130, 86,1,'							photo_992918.html');
												thumbnails[992924] = new thumbnail(992924,'73047','Tenby, Pembrokeshire','tenby6661_thumb.jpg',130, 86,1,'							photo_992924.html');
												thumbnails[971725] = new thumbnail(971725,'73060','Anfield Park, Liverpool FC','_LBP8281_thumb.jpg',130, 79,1,'							photo_971725.html');
												thumbnails[971732] = new thumbnail(971732,'73060','Millennium Stadium, Cardiff','_LBP6776_thumb.jpg',130, 79,1,'							photo_971732.html');
												thumbnails[971827] = new thumbnail(971827,'73060','Ewood Park, Blackburn Rovers FC','_LBP2614_thumb.jpg',130, 86,1,'							photo_971827.html');
												thumbnails[971833] = new thumbnail(971833,'73060','Goodison Park, Everton FC','_LBP8305_thumb.jpg',130, 86,1,'							photo_971833.html');
												thumbnails[3337212] = new thumbnail(3337212,'73060','City of Manchester Stadium, Eastlands, home of Manchester City FC','_LBP6050_thumb.jpg',130, 87,1,'							photo_3337212.html');
												thumbnails[3337213] = new thumbnail(3337213,'73060','JJB Stadium, Wigan, home of Wigan Warriors RLFC and Wigan Athletic FC','_LBP6943_1_thumb.jpg',130, 87,1,'							photo_3337213.html');
												thumbnails[971861] = new thumbnail(971861,'73063','Caernarfon Castle','caernarfon6282_thumb.jpg',130, 86,1,'							photo_971861.html');
												thumbnails[971867] = new thumbnail(971867,'73063','Beaumaris Castle, Anglesey','beaumaris6268_thumb.jpg',130, 86,1,'							photo_971867.html');
												thumbnails[971871] = new thumbnail(971871,'73063','Carew Castle','carewcastle6678_thumb.jpg',130, 86,1,'							photo_971871.html');
												thumbnails[971876] = new thumbnail(971876,'73063','Raglan Castle','raglancastle6530_thumb.jpg',130, 86,1,'							photo_971876.html');
												thumbnails[971910] = new thumbnail(971910,'73066','St Joseph\'s College, Upholland','DSCF9575_thumb.jpg',130, 79,1,'							photo_971910.html');
												thumbnails[971912] = new thumbnail(971912,'73066','Haigh Hall, Wigan','haighaerial (1)_thumb.jpg',130, 79,1,'							photo_971912.html');
												thumbnails[971914] = new thumbnail(971914,'73066','Caravan Park, Kinmel Bay, North Wales','kinmelbay6240_thumb.jpg',130, 79,1,'							photo_971914.html');
												thumbnails[971915] = new thumbnail(971915,'73066','Water Treatment Plant, West Lancashire','wateraerial (1)_thumb.jpg',130, 79,1,'							photo_971915.html');
												thumbnails[975044] = new thumbnail(975044,'73066','Containers, Liverpool Freeport','containers_thumb.jpg',130, 86,1,'							photo_975044.html');
												thumbnails[975055] = new thumbnail(975055,'73066','Southport Beach and Seafront','southportaerial_thumb.jpg',130, 87,1,'							photo_975055.html');
												thumbnails[975067] = new thumbnail(975067,'73066','Marine Way Bridge, Southport under construction','bridgeaerial_thumb.jpg',130, 87,1,'							photo_975067.html');
												thumbnails[972283] = new thumbnail(972283,'73069','Taylor Woodrow NHS Hospital Site, St Helens Feb 2007','_LBP1196_thumb.jpg',130, 86,1,'							photo_972283.html');
												thumbnails[972284] = new thumbnail(972284,'73069','Taylor Woodrow NHS Hospital Site, St Helens March 2007','_LBP1833_thumb.jpg',130, 86,1,'							photo_972284.html');
												thumbnails[972288] = new thumbnail(972288,'73069','Taylor Woodrow NHS Hospital Site, St Helens April 2007','_LBP2492_thumb.jpg',130, 86,1,'							photo_972288.html');
												thumbnails[972302] = new thumbnail(972302,'73069','Taylor Woodrow NHS Hospital Site, St Helens May 2007','_LBP2938_thumb.jpg',130, 86,1,'							photo_972302.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[73032] = new gallery(73032,'992963,992961,992960,992959,971582,971580,971350,971342','Manchester Aerial Views','gallery',[971342,971350,971580,971582,992959,992960,992961,992963],0, 0, '', '																																																																																																							gallery_73032.html',0,0);
				  					galleries[73045] = new gallery(73045,'3337216,3337215,3337214,992956,992952,975071,975069,971619,971617,971613','Liverpool Aerial Views','gallery',[971610,971613,971617,971619,975069,975071,992952,992956,3337214,3337215,3337216],0, 0, '', '																																																																																																							gallery_73045.html',0,0);
				  					galleries[73046] = new gallery(73046,'992942,992935,992933,992930,971638,971634,971628,971622','Lake District From The Air','gallery',[971622,971628,971634,971638,992930,992933,992935,992942],0, 0, '', '																																																																																																							gallery_73046.html',0,0);
				  					galleries[73047] = new gallery(73047,'992924,992918,992916,975168,975166,975164,975162,975064,973804,973803','Wales From The Air','gallery',[971642,971646,971651,971659,973800,973802,973803,973804,975064,975162,975164,975166,975168,992916,992918,992924],0, 0, '', '																																																																																																							gallery_73047.html',0,0);
				  					galleries[73060] = new gallery(73060,'3337213,3337212,971833,971827,971732,971725','Football Stadiums Aerial Views','gallery',[971725,971732,971827,971833,3337212,3337213],0, 0, '', '																																																																																																							gallery_73060.html',0,0);
				  					galleries[73063] = new gallery(73063,'971876,971871,971867,971861','Castles of Wales Aerial Views','gallery',[971861,971867,971871,971876],0, 0, '', '																																																																																																							gallery_73063.html',0,0);
				  					galleries[73066] = new gallery(73066,'975067,975055,975044,971915,971914,971912,971910','Architecture Aerial Views','gallery',[971910,971912,971914,971915,975044,975055,975067],0, 0, '', '																																																																																																							gallery_73066.html',0,0);
				  					galleries[73069] = new gallery(73069,'972302,972288,972284,972283','Construction Progress Aerial Views','gallery',[972283,972284,972288,972302],0, 0, '', '																																																																																																							gallery_73069.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '3337215,3337214,3337212,3337210,992963,992961,992960,992959,992956,992952,992942,992935,992933,992930,992924,992918,992916,975168,975166,975164,975162,975071,975069,975067,975064,975055,975044,973804,973803,973802,973800,971915,971914,971910,971861,971833,971732,971725,971651,971646,971642,971638,971628,971622,971610,971350';
imageSets[3] = '3337216,3337215,3337214,3337213,3337212,3337210,992963,992961,992960,992959,992956,992952,992942,992935,992933,992930,992924,992918,992916,975168,975166,975164,975162,975071,975069,975067,975064,975055,975044,974400,973804,973803,973802,973800,972302,972288,972284,972283,971915,971914,971912,971910,971876,971871,971867,971861,971833,971827,971732,971725';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://www.clikchurch.com/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/lightboxaerial/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/lightboxaerial/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {

	imageID = randomListVal('');
		if (!basic) {
	img.src = photos[imageID].src;
	img.width = photos[imageID].width;
	img.height = photos[imageID].height;
  img.parentNode.title = img.alt = photos[imageID].caption;
	}
	else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
				
	}
			}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}
/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
  var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
		if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
    
  updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
  var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
      op = $.extend({},defaults,options),
      html = '', temp = '',
      photoId = op.nextPhoto.id,
      photoCaption = op.nextPhoto.caption,
      photoSrc = op.nextPhoto.src;
		
		if (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    if (op.$photo.length > 0) {
      html = $('<img/>',{
        'class': 'mainphoto photo',
        src: photoSrc,
        id: 'mainPic',
        name: 'mainPic',
        width: op.nextPhoto.width,
        height: op.nextPhoto.height,
        alt: photoCaption,
        css: op.css || {}
      });
      if (op.href) {
      	if (op.href.match(/<a/)) {
      	  html = $(op.href).append(html);
      	} else {
		  html = $('<a/>', {
			href: op.href,
			title: photoCaption
		  }).append(html);
	    }
      } else {
      	html = $('<a/>', {
			title: photoCaption
		  }).append(html);
      }
      if (op.speed == 0) {        op.$photo.html(html);        if (op.onBefore) {          op.onBefore.apply(op.$photo);        }        if (op.onAfter) {          op.onAfter.apply(op.$photo);        }      } else {        op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){            if (op.onAfter) {		    op.onAfter.apply(this);          }		  clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));		}, op.onBefore);
      }    }
    	if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Aerial Photographer Manchester Liverpool: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object') {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp = temp + '<p>Order this print:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> 							' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = temp + '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
				
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			temp = temp + '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
		
	if(img){
	      if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
        imageID = imageID[1];
      } else {
			  imageID = randomListVal(galleries[gallery_id].featured_images);
      }
							
			if (imageID != 0) {
				img.src = thumbnails[imageID].src;
				img.width = thumbnails[imageID].width;
				img.height = thumbnails[imageID].height;
				img.alt = galleries[gallery_id].title;
        if (updateLink) {
          $(img).parent().attr({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp = temp + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

		

