window.thumbnails = new Object();
thumbnails[7451270] = new thumbnail(7451270,'403949','Gaz\'s Ibiza TDI','c1_thumb.jpg',130, 87,21,'photo_7451270.html');
thumbnails[7451272] = new thumbnail(7451272,'403949','Caged Interior','c2_thumb.jpg',130, 87,21,'photo_7451272.html');
thumbnails[7451275] = new thumbnail(7451275,'403949','Polo 20v Turbo','c3_thumb.jpg',130, 67,21,'photo_7451275.html');
thumbnails[7451282] = new thumbnail(7451282,'403949','Golf Group Shot','c4_thumb.jpg',130, 51,21,'photo_7451282.html');
thumbnails[7451288] = new thumbnail(7451288,'403949','MK5 Golf GTI On BBS RS','c5_thumb.jpg',130, 87,21,'photo_7451288.html');
thumbnails[7451289] = new thumbnail(7451289,'403949','Purple Seats','c6_thumb.jpg',130, 87,21,'photo_7451289.html');
thumbnails[7473803] = new thumbnail(7473803,'403949','Porsche 911 GT3 RS','911w_thumb.jpg',130, 182,21,'photo_7473803.html');
thumbnails[7473942] = new thumbnail(7473942,'403949','MK2 Golf on BBS RS','t1w_thumb.jpg',130, 65,21,'photo_7473942.html');
thumbnails[7473947] = new thumbnail(7473947,'403949','MK5 Golf On Air','t2w_thumb.jpg',130, 86,21,'photo_7473947.html');
thumbnails[7533483] = new thumbnail(7533483,'408404','MK2 Jetta R32','003s_thumb.jpg',130, 87,21,'photo_7533483.html');
thumbnails[7536774] = new thumbnail(7536774,'408404','MK4 Golf On Rota\'s','004s_thumb.jpg',130, 87,21,'photo_7536774.html');
thumbnails[7536779] = new thumbnail(7536779,'408404','Audi A4','008s_thumb.jpg',130, 77,21,'photo_7536779.html');
thumbnails[7536789] = new thumbnail(7536789,'408404','Black Lupo GTI','010s_thumb.jpg',130, 87,21,'photo_7536789.html');
thumbnails[7536793] = new thumbnail(7536793,'408404','BBS Wheels','011s_thumb.jpg',130, 195,21,'photo_7536793.html');
thumbnails[7536798] = new thumbnail(7536798,'408404','Lupo GTI @ Ultimate Dubs','013s_thumb.jpg',130, 105,21,'photo_7536798.html');
thumbnails[7536801] = new thumbnail(7536801,'408404','Seat Ibiza @ Ultimate Dubs','016s_thumb.jpg',130, 77,21,'photo_7536801.html');
thumbnails[7536806] = new thumbnail(7536806,'408404','Nice Rims','017s_thumb.jpg',130, 87,21,'photo_7536806.html');
thumbnails[7536812] = new thumbnail(7536812,'408404','White MK3 Golf','019s_thumb.jpg',130, 80,21,'photo_7536812.html');
thumbnails[7536818] = new thumbnail(7536818,'408404','White Audi S3','020s_thumb.jpg',130, 87,21,'photo_7536818.html');
thumbnails[7536820] = new thumbnail(7536820,'408404','Red MK4 Golf','025s_thumb.jpg',130, 70,21,'photo_7536820.html');
thumbnails[7536823] = new thumbnail(7536823,'408404','Simpy\'s MK5 On Air','027s_thumb.jpg',130, 77,21,'photo_7536823.html');
thumbnails[7536827] = new thumbnail(7536827,'408404','MK1 Jetta','031s_thumb.jpg',130, 76,21,'photo_7536827.html');
thumbnails[7536838] = new thumbnail(7536838,'408404','MK4 Golf','033s_thumb.jpg',130, 70,21,'photo_7536838.html');
thumbnails[7536873] = new thumbnail(7536873,'408404','Blue MK1 Golf','034s_thumb.jpg',130, 87,21,'photo_7536873.html');
thumbnails[7536878] = new thumbnail(7536878,'408404','Brown MK4 Golf','036s_thumb.jpg',130, 70,21,'photo_7536878.html');
thumbnails[7536882] = new thumbnail(7536882,'408404','Green MK1 Golf','037s_thumb.jpg',130, 87,21,'photo_7536882.html');
thumbnails[7536897] = new thumbnail(7536897,'408404','MK1 Golf','038s_thumb.jpg',130, 68,21,'photo_7536897.html');
thumbnails[7536902] = new thumbnail(7536902,'408404','Slammed Seat Ibiza','039s_thumb.jpg',130, 73,21,'photo_7536902.html');
thumbnails[7536911] = new thumbnail(7536911,'408404','Blue MK1 Golf','041s_thumb.jpg',130, 58,21,'photo_7536911.html');
thumbnails[7536919] = new thumbnail(7536919,'408404','Red MK2 Golf','042s_thumb.jpg',130, 87,21,'photo_7536919.html');
thumbnails[7536933] = new thumbnail(7536933,'408404','MK2 Golf','044s_thumb.jpg',130, 69,21,'photo_7536933.html');
thumbnails[7536964] = new thumbnail(7536964,'408404','Audi A4 Convertible','049s_thumb.jpg',130, 72,21,'photo_7536964.html');
thumbnails[7543086] = new thumbnail(7543086,'408404','MK3 Golf','050s_thumb.jpg',130, 70,21,'photo_7543086.html');
thumbnails[7543089] = new thumbnail(7543089,'408404','MK1 Jetta','052s_thumb.jpg',130, 54,21,'photo_7543089.html');
thumbnails[7543107] = new thumbnail(7543107,'408404','Black Mk3 Golf','054s_thumb.jpg',130, 87,21,'photo_7543107.html');
thumbnails[7543112] = new thumbnail(7543112,'408404','MK5 Jetta','055s_thumb.jpg',130, 75,21,'photo_7543112.html');
thumbnails[7543130] = new thumbnail(7543130,'408404','Passat Estate','064s_thumb.jpg',130, 87,21,'photo_7543130.html');
thumbnails[7543132] = new thumbnail(7543132,'408404','Audi Estate','067s_thumb.jpg',130, 58,21,'photo_7543132.html');
thumbnails[7543135] = new thumbnail(7543135,'408404','G-Werks R32','071s_thumb.jpg',130, 195,21,'photo_7543135.html');
thumbnails[7543140] = new thumbnail(7543140,'408404','MK6 Golf','072s_thumb.jpg',130, 64,21,'photo_7543140.html');
thumbnails[7543144] = new thumbnail(7543144,'408404','G-Werks R32','073s_thumb.jpg',130, 68,21,'photo_7543144.html');
thumbnails[7543147] = new thumbnail(7543147,'408404','MK1 Golf','075s_thumb.jpg',130, 66,21,'photo_7543147.html');
thumbnails[7543150] = new thumbnail(7543150,'408404','Audi S3','079s_thumb.jpg',130, 68,21,'photo_7543150.html');
thumbnails[7543151] = new thumbnail(7543151,'408404','Lupo GTI','087s_thumb.jpg',130, 73,21,'photo_7543151.html');
thumbnails[7543153] = new thumbnail(7543153,'408404','MK4 Golf','088s_thumb.jpg',130, 69,21,'photo_7543153.html');
thumbnails[7543158] = new thumbnail(7543158,'408404','Carb\'d MK2 Golf','098s_thumb.jpg',130, 112,21,'photo_7543158.html');
thumbnails[7543159] = new thumbnail(7543159,'408404','MK2 Golf','100s_thumb.jpg',130, 53,21,'photo_7543159.html');
thumbnails[7543163] = new thumbnail(7543163,'408404','Audi Convertible','102s_thumb.jpg',130, 59,21,'photo_7543163.html');
thumbnails[7543167] = new thumbnail(7543167,'408404','MK3 Golf VR6','104s_thumb.jpg',130, 68,21,'photo_7543167.html');
thumbnails[7543168] = new thumbnail(7543168,'408404','MK2 Golf','105s_thumb.jpg',130, 87,21,'photo_7543168.html');
thumbnails[7543170] = new thumbnail(7543170,'408404','Yellow Audi S3','114s_thumb.jpg',130, 80,21,'photo_7543170.html');
thumbnails[7543171] = new thumbnail(7543171,'408404','MK4 Bolf','123s_thumb.jpg',130, 68,21,'photo_7543171.html');
thumbnails[7543175] = new thumbnail(7543175,'408404','G-Werks Stand Overview','135s_thumb.jpg',130, 87,21,'photo_7543175.html');
thumbnails[7543177] = new thumbnail(7543177,'408404','Lupo GTI','137s_thumb.jpg',130, 77,21,'photo_7543177.html');
thumbnails[7543178] = new thumbnail(7543178,'408404','Simpy\'s MK5 Golf','145s_thumb.jpg',130, 100,21,'photo_7543178.html');
thumbnails[7543181] = new thumbnail(7543181,'408404','MK1 Golf Engine Bay','157s_thumb.jpg',130, 87,21,'photo_7543181.html');
thumbnails[7543184] = new thumbnail(7543184,'408404','Vento R32','166s_thumb.jpg',130, 73,21,'photo_7543184.html');
thumbnails[7543185] = new thumbnail(7543185,'408404','Corrado','173s_thumb.jpg',130, 101,21,'photo_7543185.html');
thumbnails[7628447] = new thumbnail(7628447,'413696','Escort Cosworth','012w_thumb.jpg',130, 87,21,'photo_7628447.html');
thumbnails[7628448] = new thumbnail(7628448,'413696','Escort Cosworth','022w1_thumb.jpg',130, 62,21,'photo_7628448.html');
thumbnails[7628449] = new thumbnail(7628449,'413696','Escort Cosworth','025w_thumb.jpg',130, 87,21,'photo_7628449.html');
thumbnails[7628450] = new thumbnail(7628450,'413696','Escort Cosworth','048w_thumb.jpg',130, 87,21,'photo_7628450.html');
thumbnails[7628452] = new thumbnail(7628452,'413696','Escort Cosworth','060w_thumb.jpg',130, 78,21,'photo_7628452.html');
thumbnails[7746451] = new thumbnail(7746451,'418877','VW Polo','006w_thumb.jpg',130, 76,21,'photo_7746451.html');
thumbnails[7746452] = new thumbnail(7746452,'418877','Volkswagen Polo','008w_thumb.jpg',130, 87,21,'photo_7746452.html');
thumbnails[7746453] = new thumbnail(7746453,'418877','Volkswagen Polo','030w_thumb.jpg',130, 87,21,'photo_7746453.html');
thumbnails[7746454] = new thumbnail(7746454,'418877','Volkswagen Polo','040w_thumb.jpg',130, 87,21,'photo_7746454.html');
thumbnails[7746456] = new thumbnail(7746456,'418877','Volkswagen Polo','041w_thumb.jpg',130, 87,21,'photo_7746456.html');
thumbnails[7940291] = new thumbnail(7940291,'427747','Wide Arch MK4 Golf','033s_7B20E4A8-1EC9-D45B-1C71E1C6AF3C76E4_thumb.jpg',130, 87,21,'photo_7940291.html');
thumbnails[7940293] = new thumbnail(7940293,'427747','Wide Arch MK4 Golf','news_thumb.jpg',130, 87,21,'photo_7940293.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
galleries[403949] = new gallery(403949,'7473947,7473942,7473803,7451289,7451288,7451282,7451275,7451272,7451270','Automotive Pictures','gallery',[7451270,7451272,7451275,7451282,7451288,7451289,7473803,7473942,7473947],0, 0, '', 'gallery_403949.html',0,0);
galleries[413696] = new gallery(413696,'7628452,7628450,7628449,7628448,7628447','Escort Cosworth Monte Carlo','gallery',[7628447,7628448,7628449,7628450,7628452],0, 0, '', 'gallery_413696.html',0,0);
galleries[427747] = new gallery(427747,'7940293,7940291','MK4 Golf','gallery',[7940291,7940293],0, 0, '', 'gallery_427747.html',0,0);
galleries[408404] = new gallery(408404,'7543185,7543184,7543181,7543178,7543177,7543175,7543171,7543170,7543168,7543167,7543163,7543159,7543158,7543153,7543151,7543150,7543147,7543144,7543140,7543135,7543132,7543130,7543112,7543107,7543089,7543086,7536964,7536933,7536919,7536911,7536902,7536897,7536882,7536878,7536873,7536838,7536827,7536823,7536820,7536818,7536812,7536806,7536801,7536798,7536793,7536789,7536779,7536774,7533483','Ultimate Dubs 2011','gallery',[7533483,7536774,7536779,7536789,7536793,7536798,7536801,7536806,7536812,7536818,7536820,7536823,7536827,7536838,7536873,7536878,7536882,7536897,7536902,7536911,7536919,7536933,7536964,7543086,7543089,7543107,7543112,7543130,7543132,7543135,7543140,7543144,7543147,7543150,7543151,7543153,7543158,7543159,7543163,7543167,7543168,7543170,7543171,7543175,7543177,7543178,7543181,7543184,7543185],0, 0, '', 'gallery_408404.html',0,0);
galleries[418877] = new gallery(418877,'7746456,7746454,7746453,7746452,7746451','VW Polo','gallery',[7746451,7746452,7746453,7746454,7746456],0, 0, '', 'gallery_418877.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[3] = '7940293,7940291,7746456,7746454,7746453,7746452,7746451,7628452,7628450,7628449,7628448,7628447,7543185,7543184,7543181,7543178,7543177,7543175,7543171,7543170,7543168,7543167,7543163,7543159,7543158,7543153,7543151,7543150,7543147,7543144,7543140,7543135,7543132,7543130,7543112,7543107,7543089,7543086,7536964,7536933,7536919,7536911,7536902,7536897,7536882,7536878,7536873,7536838,7536827,7536823,7536820,7536818,7536812,7536806,7536801,7536798,7536793,7536789,7536779,7536774,7533483,7473947,7473942,7473803,7451289,7451288,7451282,7451275,7451272,7451270';
imageSets[2] = '7940293,7940291,7746456,7746454,7746453,7746452,7746451,7628452,7628450,7628449,7628448,7628447,7543185,7543184,7543181,7543178,7543177,7543175,7543171,7543170,7543168,7543167,7543163,7543159,7543158,7543153,7543151,7543150,7543147,7543144,7543140,7543135,7543132,7543130,7543112,7543107,7543089,7543086,7536964,7536933,7536919,7536911,7536902,7536897,7536882,7536878,7536873,7536838,7536827,7536823,7536820,7536818,7536812,7536806,7536801,7536798,7536793,7536789,7536779,7536774,7533483,7473947,7473942,7473803,7451289,7451288,7451282,7451275,7451272,7451270';
imageSets[1] = '7940293,7940291,7746456,7746454,7746453,7746452,7746451,7628452,7628450,7628449,7628448,7628447,7543185,7543184,7543181,7543178,7543177,7543175,7543171,7543170,7543168,7543167,7543163,7543159,7543158,7543153,7543151,7543150,7543147,7543144,7543140,7543135,7543132,7543130,7543112,7543107,7543089,7543086,7536964,7536933,7536919,7536911,7536902,7536897,7536882,7536878,7536873,7536838,7536827,7536823,7536820,7536818,7536812,7536806,7536801,7536798,7536793,7536789,7536779,7536774,7533483,7473947,7473942,7473803,7451289,7451288,7451282,7451275,7451272,7451270';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/adamkennedy/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/adamkennedy/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 = 'Adam Kennedy 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 == undefined) {
    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="ADAMKENNEDY">';
		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;
	}
}

		

