window.thumbnails = new Object();
												thumbnails[7153597] = new thumbnail(7153597,'19756','York City FC','IMG3515_thumb.jpg',130, 87,18,'																			photo_7153597.html');
												thumbnails[7158025] = new thumbnail(7158025,'19714','','Spa_Cycles-2_thumb.jpg',130, 86,18,'																			photo_7158025.html');
												thumbnails[7158444] = new thumbnail(7158444,'19752','','_MG_3375_thumb.jpg',130, 195,18,'																			photo_7158444.html');
												thumbnails[7158452] = new thumbnail(7158452,'19625','','20090717-IMG_9494-Edit_thumb.jpg',130, 87,18,'																			photo_7158452.html');
												thumbnails[7158460] = new thumbnail(7158460,'19714','','Bladz_poster_taster_course_thumb.jpg',130, 195,18,'																			photo_7158460.html');
												thumbnails[7158477] = new thumbnail(7158477,'19756','','IMG_0686_thumb.jpg',130, 195,18,'																			photo_7158477.html');
												thumbnails[7158485] = new thumbnail(7158485,'19625','','IMG_0921_thumb.jpg',130, 195,18,'																			photo_7158485.html');
												thumbnails[7158488] = new thumbnail(7158488,'19712','','IMG_1354_thumb.jpg',130, 195,18,'																			photo_7158488.html');
												thumbnails[7164585] = new thumbnail(7164585,'19714','','IMG_6051LR_thumb.jpg',130, 195,18,'																			photo_7164585.html');
												thumbnails[7164592] = new thumbnail(7164592,'19714','','Karen_Picking-0800_thumb.jpg',130, 195,18,'																			photo_7164592.html');
												thumbnails[7164596] = new thumbnail(7164596,'19752','','IMG_9545_thumb.jpg',130, 195,18,'																			photo_7164596.html');
												thumbnails[7164613] = new thumbnail(7164613,'19714','','Trust_mag_2007_1_thumb.jpg',130, 148,18,'																			photo_7164613.html');
												thumbnails[7164892] = new thumbnail(7164892,'19756','','IMG_4482_12x16_BW_thumb.jpg',130, 87,18,'																			photo_7164892.html');
												thumbnails[7164902] = new thumbnail(7164902,'23063','','IMG_7124_thumb.jpg',130, 87,18,'																			photo_7164902.html');
												thumbnails[7164916] = new thumbnail(7164916,'23063','','IMG_4800_thumb.jpg',130, 87,18,'																			photo_7164916.html');
												thumbnails[7164969] = new thumbnail(7164969,'19752','','IMG_9803_thumb.jpg',130, 195,18,'																			photo_7164969.html');
												thumbnails[7305999] = new thumbnail(7305999,'392587','KER 3421','KER_3421_thumb.jpg',130, 86,18,'																			photo_7305999.html');
												thumbnails[7312208] = new thumbnail(7312208,'392587','KER 3471 Portrait','KER_3471 Portrait_thumb.jpg',130, 163,18,'																			photo_7312208.html');
												thumbnails[7338989] = new thumbnail(7338989,'392587','KER-3343','KER-3343_thumb.jpg',130, 104,18,'																			photo_7338989.html');
												thumbnails[7306000] = new thumbnail(7306000,'392587','KER 3422','KER_3422_thumb.jpg',130, 86,18,'																			photo_7306000.html');
												thumbnails[7312209] = new thumbnail(7312209,'392587','KER 3473','KER_3473_thumb.jpg',130, 163,18,'																			photo_7312209.html');
												thumbnails[7338990] = new thumbnail(7338990,'392587','KER-3345','KER-3345_thumb.jpg',130, 104,18,'																			photo_7338990.html');
												thumbnails[7306001] = new thumbnail(7306001,'392587','KER 3424','KER_3424_thumb.jpg',130, 86,18,'																			photo_7306001.html');
												thumbnails[7312210] = new thumbnail(7312210,'392587','KER 3477','KER_3477_thumb.jpg',130, 104,18,'																			photo_7312210.html');
												thumbnails[7338992] = new thumbnail(7338992,'392587','KER-3355','KER-3355_thumb.jpg',130, 163,18,'																			photo_7338992.html');
												thumbnails[7306002] = new thumbnail(7306002,'392587','KER 3427','KER_3427_thumb.jpg',130, 86,18,'																			photo_7306002.html');
												thumbnails[7312211] = new thumbnail(7312211,'392587','KER 3479','KER_3479_thumb.jpg',130, 104,18,'																			photo_7312211.html');
												thumbnails[7338993] = new thumbnail(7338993,'392587','KER-3357','KER-3357_thumb.jpg',130, 104,18,'																			photo_7338993.html');
												thumbnails[7306003] = new thumbnail(7306003,'392587','KER 3428','KER_3428_thumb.jpg',130, 195,18,'																			photo_7306003.html');
												thumbnails[7312212] = new thumbnail(7312212,'392587','KER 3481','KER_3481_thumb.jpg',130, 104,18,'																			photo_7312212.html');
												thumbnails[7338994] = new thumbnail(7338994,'392587','KER-3362','KER-3362_thumb.jpg',130, 104,18,'																			photo_7338994.html');
												thumbnails[7306004] = new thumbnail(7306004,'392587','KER 3431','KER_3431_thumb.jpg',130, 195,18,'																			photo_7306004.html');
												thumbnails[7312213] = new thumbnail(7312213,'392587','KER 3482','KER_3482_thumb.jpg',130, 104,18,'																			photo_7312213.html');
												thumbnails[7338995] = new thumbnail(7338995,'392587','KER-3363','KER-3363_thumb.jpg',130, 104,18,'																			photo_7338995.html');
												thumbnails[7306005] = new thumbnail(7306005,'392587','KER 3433','KER_3433_thumb.jpg',130, 86,18,'																			photo_7306005.html');
												thumbnails[7312214] = new thumbnail(7312214,'392587','KER 3484','KER_3484_thumb.jpg',130, 104,18,'																			photo_7312214.html');
												thumbnails[7338996] = new thumbnail(7338996,'392587','KER-3369','KER-3369_thumb.jpg',130, 104,18,'																			photo_7338996.html');
												thumbnails[7306006] = new thumbnail(7306006,'392587','KER 3435','KER_3435_thumb.jpg',130, 86,18,'																			photo_7306006.html');
												thumbnails[7312215] = new thumbnail(7312215,'392587','KER 3486','KER_3486_thumb.jpg',130, 104,18,'																			photo_7312215.html');
												thumbnails[7338997] = new thumbnail(7338997,'392587','KER-3371','KER-3371_thumb.jpg',130, 104,18,'																			photo_7338997.html');
												thumbnails[7306007] = new thumbnail(7306007,'392587','KER 3437','KER_3437_thumb.jpg',130, 86,18,'																			photo_7306007.html');
												thumbnails[7312216] = new thumbnail(7312216,'392587','KER 3488','KER_3488_thumb.jpg',130, 104,18,'																			photo_7312216.html');
												thumbnails[7338998] = new thumbnail(7338998,'392587','KER-3374','KER-3374_thumb.jpg',130, 104,18,'																			photo_7338998.html');
												thumbnails[7306008] = new thumbnail(7306008,'392587','KER 3440','KER_3440_thumb.jpg',130, 195,18,'																			photo_7306008.html');
												thumbnails[7312217] = new thumbnail(7312217,'392587','KER 3492','KER_3492_thumb.jpg',130, 104,18,'																			photo_7312217.html');
												thumbnails[7338999] = new thumbnail(7338999,'392587','KER-3383','KER-3383_thumb.jpg',130, 104,18,'																			photo_7338999.html');
												thumbnails[7306009] = new thumbnail(7306009,'392587','KER 3442','KER_3442_thumb.jpg',130, 195,18,'																			photo_7306009.html');
												thumbnails[7312218] = new thumbnail(7312218,'392587','KER 3496','KER_3496_thumb.jpg',130, 104,18,'																			photo_7312218.html');
												thumbnails[7306010] = new thumbnail(7306010,'392587','KER 3443','KER_3443_thumb.jpg',130, 195,18,'																			photo_7306010.html');
												thumbnails[7312219] = new thumbnail(7312219,'392587','KER 3497','KER_3497_thumb.jpg',130, 104,18,'																			photo_7312219.html');
												thumbnails[7306011] = new thumbnail(7306011,'392587','KER 3446','KER_3446_thumb.jpg',130, 195,18,'																			photo_7306011.html');
												thumbnails[7312220] = new thumbnail(7312220,'392587','KER 3500','KER_3500_thumb.jpg',130, 104,18,'																			photo_7312220.html');
												thumbnails[7306012] = new thumbnail(7306012,'392587','KER 3447','KER_3447_thumb.jpg',130, 195,18,'																			photo_7306012.html');
												thumbnails[7312221] = new thumbnail(7312221,'392587','KER 3501','KER_3501_thumb.jpg',130, 104,18,'																			photo_7312221.html');
												thumbnails[7306013] = new thumbnail(7306013,'392587','KER 3450','KER_3450_thumb.jpg',130, 86,18,'																			photo_7306013.html');
												thumbnails[7312222] = new thumbnail(7312222,'392587','KER 3507','KER_3507_thumb.jpg',130, 104,18,'																			photo_7312222.html');
												thumbnails[7306014] = new thumbnail(7306014,'392587','KER 3452','KER_3452_thumb.jpg',130, 86,18,'																			photo_7306014.html');
												thumbnails[7312223] = new thumbnail(7312223,'392587','KER 3508','KER_3508_thumb.jpg',130, 104,18,'																			photo_7312223.html');
												thumbnails[7306015] = new thumbnail(7306015,'392587','KER 3454','KER_3454_thumb.jpg',130, 86,18,'																			photo_7306015.html');
												thumbnails[7312224] = new thumbnail(7312224,'392587','KER 3513','KER_3513_thumb.jpg',130, 104,18,'																			photo_7312224.html');
												thumbnails[7306016] = new thumbnail(7306016,'392587','KER 3456','KER_3456_thumb.jpg',130, 86,18,'																			photo_7306016.html');
												thumbnails[7312225] = new thumbnail(7312225,'392587','KER 3515','KER_3515_thumb.jpg',130, 104,18,'																			photo_7312225.html');
												thumbnails[7306017] = new thumbnail(7306017,'392587','KER 3458','KER_3458_thumb.jpg',130, 86,18,'																			photo_7306017.html');
												thumbnails[7312226] = new thumbnail(7312226,'392587','KER 3518','KER_3518_thumb.jpg',130, 104,18,'																			photo_7312226.html');
												thumbnails[7306018] = new thumbnail(7306018,'392587','KER 3460','KER_3460_thumb.jpg',130, 87,18,'																			photo_7306018.html');
												thumbnails[7312227] = new thumbnail(7312227,'392587','KER 3520','KER_3520_thumb.jpg',130, 104,18,'																			photo_7312227.html');
												thumbnails[7306019] = new thumbnail(7306019,'392587','KER 3463','KER_3463_thumb.jpg',130, 86,18,'																			photo_7306019.html');
												thumbnails[7312228] = new thumbnail(7312228,'392587','KER 3523','KER_3523_thumb.jpg',130, 104,18,'																			photo_7312228.html');
												thumbnails[7306020] = new thumbnail(7306020,'392587','KER 3464','KER_3464_thumb.jpg',130, 86,18,'																			photo_7306020.html');
												thumbnails[7312229] = new thumbnail(7312229,'392587','KER 3526','KER_3526_thumb.jpg',130, 104,18,'																			photo_7312229.html');
												thumbnails[7312230] = new thumbnail(7312230,'392587','KER 3530','KER_3530_thumb.jpg',130, 104,18,'																			photo_7312230.html');
												thumbnails[7312231] = new thumbnail(7312231,'392587','KER 3533','KER_3533_thumb.jpg',130, 104,18,'																			photo_7312231.html');
												thumbnails[7312232] = new thumbnail(7312232,'392587','KER 3538','KER_3538_thumb.jpg',130, 163,18,'																			photo_7312232.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[19714] = new gallery(19714,'7164585,7158460,7158025','Corporate PR','gallery',[7158025,7158460,7164585,7164592,7164613],0, 0, '', '																																																																																																							gallery_19714.html',0,0);
				  					galleries[19712] = new gallery(19712,'7158488','Dance','gallery',[7158488],0, 0, '', '																																																																																																							gallery_19712.html',0,0);
				  					galleries[19752] = new gallery(19752,'7164969,7164596,7158444','Landscape','gallery',[7158444,7164596,7164969],0, 0, '', '																																																																																																							gallery_19752.html',0,0);
				  					galleries[392587] = new gallery(392587,'7338999,7338998,7338997,7338996,7338995,7338994,7338993,7338992,7338990,7338989','Making a Difference Awards 2010','gallery',[7305999,7312208,7338989,7306000,7312209,7338990,7306001,7312210,7338992,7306002,7312211,7338993,7306003,7312212,7338994,7306004,7312213,7338995,7306005,7312214,7338996,7306006,7312215,7338997,7306007,7312216,7338998,7306008,7312217,7338999,7306009,7312218,7306010,7312219,7306011,7312220,7306012,7312221,7306013,7312222,7306014,7312223,7306015,7312224,7306016,7312225,7306017,7312226,7306018,7312227,7306019,7312228,7306020,7312229,7312230,7312231,7312232],0, 0, '', '																																																																																																												gallery_392587.html',0,0);
				  					galleries[23063] = new gallery(23063,'7164916,7164902','People','gallery',[7164902,7164916],0, 0, '', '																																																																																																							gallery_23063.html',0,0);
				  					galleries[19756] = new gallery(19756,'7164892,7158477','Sport','gallery',[7153597,7158477,7164892],0, 0, '', '																																																																																																							gallery_19756.html',0,0);
				  					galleries[19625] = new gallery(19625,'7158485,7158452','Still Life','gallery',[7158452,7158485],0, 0, '', '																																																																																																							gallery_19625.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7158488,7158485,7158477,7158452,7158444';
imageSets[2] = '7164969,7164916,7164902,7164892,7164596,7164585,7158488,7158485,7158477,7158460,7158452,7158444,7158025';
imageSets[3] = '7164969,7164916,7164902,7164892,7164613,7164596,7164592,7164585,7158488,7158485,7158477,7158460,7158452,7158444,7158025,7153597';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/johnkerr/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/johnkerr/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 = 'Blazing Star Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {photoinfominwidth:220};	    	      	      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>';
	}
					
	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="JOHNKERR">';
		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;
	}
}

			

