window.thumbnails = {};
															thumbnails[5546945] = clik.newPhoto({"id":5546945,"src":"20070805141152_00001_thumb.jpg","galleries_id":476282,"server_id":15,"link":"photo_5546945.html","width":130,"caption":"","height":92});
															thumbnails[5547114] = clik.newPhoto({"id":5547114,"src":"20070805141822_00001_thumb.jpg","galleries_id":476283,"server_id":15,"link":"photo_5547114.html","width":130,"caption":"Inchy","height":92});
															thumbnails[5547206] = clik.newPhoto({"id":5547206,"src":"20070819111004_00001_thumb.jpg","galleries_id":476284,"server_id":15,"link":"photo_5547206.html","width":130,"caption":"Pug 106 GTi & 307","height":184});
															thumbnails[5547210] = clik.newPhoto({"id":5547210,"src":"20070819111106_00001_thumb.jpg","galleries_id":476284,"server_id":15,"link":"photo_5547210.html","width":130,"caption":"Toyota Avensis","height":184});
															thumbnails[5547214] = clik.newPhoto({"id":5547214,"src":"20070819111211_00001_thumb.jpg","galleries_id":476284,"server_id":15,"link":"photo_5547214.html","width":130,"caption":"Toyota Corolla T Sport","height":184});
															thumbnails[5547253] = clik.newPhoto({"id":5547253,"src":"20070819112152_00001_thumb.jpg","galleries_id":476284,"server_id":15,"link":"photo_5547253.html","width":130,"caption":"Escort Cabrio","height":92});
															thumbnails[5547331] = clik.newPhoto({"id":5547331,"src":"20071223104010_00001_thumb.jpg","galleries_id":476282,"server_id":15,"link":"photo_5547331.html","width":130,"caption":"","height":92});
															thumbnails[5547188] = clik.newPhoto({"id":5547188,"src":"20070819110423_00001_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547188.html","width":130,"caption":"Triumph Spitfire","height":92});
															thumbnails[5546897] = clik.newPhoto({"id":5546897,"src":"20070527090916_00001_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5546897.html","width":130,"caption":"Ford Anglia","height":92});
															thumbnails[5547202] = clik.newPhoto({"id":5547202,"src":"20070819110908_00001_thumb.jpg","galleries_id":476282,"server_id":15,"link":"photo_5547202.html","width":130,"caption":"","height":184});
															thumbnails[5547057] = clik.newPhoto({"id":5547057,"src":"White_RS2000_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547057.html","width":130,"caption":"Ford Escort Mk2 RS2000","height":92});
															thumbnails[5547199] = clik.newPhoto({"id":5547199,"src":"20070819110738_00001_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547199.html","width":130,"caption":"Ford Escort Mk2","height":92});
															thumbnails[5547338] = clik.newPhoto({"id":5547338,"src":"Escort_Green_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547338.html","width":130,"caption":"Ford Escort MK1 RS","height":92});
															thumbnails[5547337] = clik.newPhoto({"id":5547337,"src":"Escort_Blue_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547337.html","width":130,"caption":"Ford Escort Mk1 RS","height":92});
															thumbnails[5547340] = clik.newPhoto({"id":5547340,"src":"Lotus_Cortina_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547340.html","width":130,"caption":"Lotus Cortina","height":92});
															thumbnails[5547356] = clik.newPhoto({"id":5547356,"src":"Mustang_White_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547356.html","width":130,"caption":"Mustang GT350","height":92});
															thumbnails[5547336] = clik.newPhoto({"id":5547336,"src":"Cobra_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547336.html","width":130,"caption":"Cobra","height":92});
															thumbnails[5547345] = clik.newPhoto({"id":5547345,"src":"Mini_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547345.html","width":130,"caption":"Mini","height":92});
															thumbnails[5547324] = clik.newPhoto({"id":5547324,"src":"20070819112704_00001_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547324.html","width":130,"caption":"Mini","height":92});
															thumbnails[5547330] = clik.newPhoto({"id":5547330,"src":"20070819112746_00001_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547330.html","width":130,"caption":"Morris Minor","height":92});
															thumbnails[5547273] = clik.newPhoto({"id":5547273,"src":"20070819112340_00001_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547273.html","width":130,"caption":"Viva GT","height":92});
															thumbnails[5547259] = clik.newPhoto({"id":5547259,"src":"20070819112251_00001_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547259.html","width":130,"caption":"Magnum","height":92});
															thumbnails[5547320] = clik.newPhoto({"id":5547320,"src":"20070819112519_00001_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547320.html","width":130,"caption":"MG Midget","height":92});
															thumbnails[5547322] = clik.newPhoto({"id":5547322,"src":"20070819112604_00001_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547322.html","width":130,"caption":"MG Roadster","height":92});
															thumbnails[5547344] = clik.newPhoto({"id":5547344,"src":"MGB_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547344.html","width":130,"caption":"MGB Roadster","height":92});
															thumbnails[5547342] = clik.newPhoto({"id":5547342,"src":"MBG_GT_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547342.html","width":130,"caption":"MGB GT","height":92});
															thumbnails[5547277] = clik.newPhoto({"id":5547277,"src":"20070819112432_00001_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547277.html","width":130,"caption":"MGB GT","height":92});
															thumbnails[5547249] = clik.newPhoto({"id":5547249,"src":"20070819111937_00001_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547249.html","width":130,"caption":"Daimler","height":92});
															thumbnails[5547333] = clik.newPhoto({"id":5547333,"src":"Bean_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547333.html","width":130,"caption":"Bean","height":92});
															thumbnails[5547224] = clik.newPhoto({"id":5547224,"src":"20070819111324_00001_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547224.html","width":130,"caption":"Mini","height":184});
															thumbnails[5547194] = clik.newPhoto({"id":5547194,"src":"20070819110637_00001_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_5547194.html","width":130,"caption":"","height":184});
															thumbnails[4436475] = clik.newPhoto({"id":4436475,"src":"Anglia_thumb.jpg","galleries_id":251110,"server_id":15,"link":"photo_4436475.html","width":130,"caption":"Ford Anglia","height":184});
															thumbnails[9038306] = clik.newPhoto({"id":9038306,"src":"robots_thumb.jpg","galleries_id":314315,"server_id":15,"link":"photo_9038306.html","width":130,"caption":"Happy Birthday","height":92});
															thumbnails[9038311] = clik.newPhoto({"id":9038311,"src":"birthday_cat_thumb.jpg","galleries_id":251111,"server_id":15,"link":"photo_9038311.html","width":130,"caption":"Birthday Cat","height":184});
															thumbnails[9038321] = clik.newPhoto({"id":9038321,"src":"snow_cow_thumb.jpg","galleries_id":314300,"server_id":15,"link":"photo_9038321.html","width":130,"caption":"Snow Cow","height":92});
															thumbnails[9038346] = clik.newPhoto({"id":9038346,"src":"boy_racer_thumb.jpg","galleries_id":314622,"server_id":15,"link":"photo_9038346.html","width":130,"caption":"Boy Racer","height":184});
															thumbnails[9038316] = clik.newPhoto({"id":9038316,"src":"cat_with_baloon_thumb.jpg","galleries_id":251111,"server_id":15,"link":"photo_9038316.html","width":130,"caption":"Cat with balloon","height":184});
															thumbnails[9038374] = clik.newPhoto({"id":9038374,"src":"snow_cat_thumb.jpg","galleries_id":314300,"server_id":15,"link":"photo_9038374.html","width":130,"caption":"Snow Cat","height":184});
															thumbnails[9087796] = clik.newPhoto({"id":9087796,"src":"flower_power_c_2_thumb.jpg","galleries_id":314608,"server_id":15,"link":"photo_9087796.html","width":130,"caption":"Flower Power","height":184});
															thumbnails[9087831] = clik.newPhoto({"id":9087831,"src":"camp_kenny1_4_thumb.jpg","galleries_id":314622,"server_id":15,"link":"photo_9087831.html","width":130,"caption":"Camp Kenny","height":184});
															thumbnails[9038364] = clik.newPhoto({"id":9038364,"src":"disco_diva_thumb.jpg","galleries_id":314608,"server_id":15,"link":"photo_9038364.html","width":130,"caption":"Disco Diva","height":184});
															thumbnails[9038368] = clik.newPhoto({"id":9038368,"src":"girl_racer_thumb.jpg","galleries_id":314608,"server_id":15,"link":"photo_9038368.html","width":130,"caption":"Girl Racer","height":184});
															thumbnails[9069635] = clik.newPhoto({"id":9069635,"src":"Confused_thumb.jpg","galleries_id":314608,"server_id":15,"link":"photo_9069635.html","width":130,"caption":"Confused.cow","height":130});
															thumbnails[9069639] = clik.newPhoto({"id":9069639,"src":"Daisey_thumb.jpg","galleries_id":314608,"server_id":15,"link":"photo_9069639.html","width":130,"caption":"Daisey","height":130});
															thumbnails[9038309] = clik.newPhoto({"id":9038309,"src":"birthday_cow_thumb.jpg","galleries_id":314608,"server_id":15,"link":"photo_9038309.html","width":130,"caption":"Birthday Cow","height":92});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[251110] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Classic Cars","link":"gallery_251110.html","maxRecords":0.0,"photoIDs":[5547188.0,5546897.0,5547057.0,5547199.0,5547338.0,5547337.0,5547340.0,5547356.0,5547336.0,5547345.0,5547324.0,5547330.0,5547273.0,5547259.0,5547320.0,5547322.0,5547344.0,5547342.0,5547277.0,5547249.0,5547333.0,5547224.0,5547194.0,4436475.0],"skipIndex":0,"section_code":"gallery","featured_images":5547224.0,"id":251110,"singleSection":false});				  						galleries[314608] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Cows Collection","link":"section307843_314608.html","maxRecords":0.0,"photoIDs":[9087796.0,9038364.0,9038368.0,9069635.0,9069639.0,9038309.0],"skipIndex":0,"section_code":"section307843","featured_images":9038368.0,"id":314608,"singleSection":false});				  						galleries[314622] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Bulls Collection","link":"section307843_314622.html","maxRecords":0.0,"photoIDs":[9038346.0,9087831.0],"skipIndex":0,"section_code":"section307843","featured_images":9038346.0,"id":314622,"singleSection":false});				  						galleries[476284] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Modern Cars","link":"gallery_476284.html","maxRecords":0.0,"photoIDs":[5547206.0,5547210.0,5547214.0,5547253.0],"skipIndex":0,"section_code":"gallery","featured_images":5547206.0,"id":476284,"singleSection":false});				  						galleries[251111] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Cats Collection","link":"section307843_251111.html","maxRecords":0.0,"photoIDs":[9038311.0,9038316.0],"skipIndex":0,"section_code":"section307843","featured_images":9038316.0,"id":251111,"singleSection":false});				  						galleries[476282] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Stock Cars","link":"gallery_476282.html","maxRecords":0.0,"photoIDs":[5546945.0,5547331.0,5547202.0],"skipIndex":0,"section_code":"gallery","featured_images":5547202.0,"id":476282,"singleSection":false});				  						galleries[476283] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Animals","link":"gallery_476283.html","maxRecords":0.0,"photoIDs":[5547114.0],"skipIndex":0,"section_code":"gallery","featured_images":5547114.0,"id":476283,"singleSection":false});				  						galleries[314300] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Christmas Collection","link":"section307843_314300.html","maxRecords":0.0,"photoIDs":[9038321.0,9038374.0],"skipIndex":0,"section_code":"section307843","featured_images":9038374.0,"id":314300,"singleSection":false});				  						galleries[314315] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Robots","link":"section307843_314315.html","maxRecords":0.0,"photoIDs":[9038306.0],"skipIndex":0,"section_code":"section307843","featured_images":9038306.0,"id":314315,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '9038364';
imageSets[2] = '5547206,5547114,9038346,9038306,9038374,9038316,5547202,9038368,5547224';
imageSets[3] = '9038368';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Artcar01/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/Artcar01/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 || photos || {})[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:'',$detailContainer:'',
                    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 (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Artcar: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		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.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			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', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
	temp += this.fnGetPaymentInfo();
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '') {
											temp += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="ARTCAR01">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							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 += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			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({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* 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 += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

