window.thumbnails = {};
															thumbnails[5681843] = clik.newPhoto({"id":5681843,"src":"5293FO002071_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":98});
															thumbnails[5681869] = clik.newPhoto({"id":5681869,"src":"10009A002793_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":99});
															thumbnails[5681873] = clik.newPhoto({"id":5681873,"src":"0100090038381_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":174});
															thumbnails[5681884] = clik.newPhoto({"id":5681884,"src":"010122021379_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":98});
															thumbnails[5681888] = clik.newPhoto({"id":5681888,"src":"010009004034_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":103});
															thumbnails[5681890] = clik.newPhoto({"id":5681890,"src":"010122020872_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":107});
															thumbnails[5681899] = clik.newPhoto({"id":5681899,"src":"010122021378_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":90});
															thumbnails[5809042] = clik.newPhoto({"id":5809042,"src":"1_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":71});
															thumbnails[5809043] = clik.newPhoto({"id":5809043,"src":"2_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":66});
															thumbnails[5809045] = clik.newPhoto({"id":5809045,"src":"3_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":84});
															thumbnails[5809046] = clik.newPhoto({"id":5809046,"src":"4_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":74});
															thumbnails[8513968] = clik.newPhoto({"id":8513968,"src":"01_1_thumb.jpg","galleries_id":"","server_id":38,"link":"#","width":130,"caption":"","height":80});
															thumbnails[5770835] = clik.newPhoto({"id":5770835,"src":"16_thumb.jpg","galleries_id":326721,"server_id":5,"link":"photo_5770835.html","width":130,"caption":1.0,"height":71});
															thumbnails[5770844] = clik.newPhoto({"id":5770844,"src":"141_thumb.jpg","galleries_id":326721,"server_id":5,"link":"photo_5770844.html","width":130,"caption":2.0,"height":74});
															thumbnails[6260846] = clik.newPhoto({"id":6260846,"src":"48_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_6260846.html","width":130,"caption":"Helena Rasker","height":180});
															thumbnails[7486677] = clik.newPhoto({"id":7486677,"src":"2_3BA4AD2F-1EC9-DFB6-0918C98E1BE674E5_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_7486677.html","width":130,"caption":"Mike del Ferro","height":195});
															thumbnails[7486685] = clik.newPhoto({"id":7486685,"src":"6_3BC639B1-1EC9-DFB6-095CE5699163F639_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_7486685.html","width":130,"caption":"Edith Leerkes","height":187});
															thumbnails[5669884] = clik.newPhoto({"id":5669884,"src":"17_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5669884.html","width":130,"caption":"Wilbert Bulsink","height":86});
															thumbnails[5667487] = clik.newPhoto({"id":5667487,"src":"15_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5667487.html","width":130,"caption":"Ties Mellema","height":194});
															thumbnails[7605514] = clik.newPhoto({"id":7605514,"src":"19_06549832-1EC9-DFB6-0940B6BD3293C4A6_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_7605514.html","width":130,"caption":"peter prommel","height":173});
															thumbnails[5669896] = clik.newPhoto({"id":5669896,"src":"251_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5669896.html","width":130,"caption":"Brandt Attema","height":196});
															thumbnails[5667498] = clik.newPhoto({"id":5667498,"src":"43_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5667498.html","width":130,"caption":"Andre Heuvelman","height":86});
															thumbnails[5667510] = clik.newPhoto({"id":5667510,"src":"1_E12DCDB1-1EC9-D45B-1CCE4935BB7FD370_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5667510.html","width":130,"caption":"Aisling Casey","height":195});
															thumbnails[5667519] = clik.newPhoto({"id":5667519,"src":"10_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5667519.html","width":130,"caption":"Koen Kaptijn","height":196});
															thumbnails[6143207] = clik.newPhoto({"id":6143207,"src":"12_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_6143207.html","width":130,"caption":"Oene van Geel","height":87});
															thumbnails[5712117] = clik.newPhoto({"id":5712117,"src":"5_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5712117.html","width":130,"caption":"Floris Mijnders","height":86});
															thumbnails[6658215] = clik.newPhoto({"id":6658215,"src":"13_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_6658215.html","width":130,"caption":"Santiago Cimadevilla","height":194});
															thumbnails[5712313] = clik.newPhoto({"id":5712313,"src":"62_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5712313.html","width":130,"caption":"Mattijs van der Woerd","height":195});
															thumbnails[6658044] = clik.newPhoto({"id":6658044,"src":"9_D3129277-1EC9-D45B-1C2EB8820CE393AD_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_6658044.html","width":130,"caption":"Jan Willem Baljet","height":195});
															thumbnails[5669893] = clik.newPhoto({"id":5669893,"src":"144_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5669893.html","width":130,"caption":"Emi ohi Resnick","height":194});
															thumbnails[5701909] = clik.newPhoto({"id":5701909,"src":"252_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5701909.html","width":130,"caption":"Bart de Vrees","height":96});
															thumbnails[5719150] = clik.newPhoto({"id":5719150,"src":"17_E1545A97-1EC9-D45B-1C2DCDB3C75F31AF_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5719150.html","width":130,"caption":"Nora Mulder","height":89});
															thumbnails[5712180] = clik.newPhoto({"id":5712180,"src":"171_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5712180.html","width":130,"caption":"Tiziana Pintus","height":147});
															thumbnails[5701651] = clik.newPhoto({"id":5701651,"src":"21_E142CEB5-1EC9-D45B-1C8C0E5A222FBB45_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5701651.html","width":130,"caption":"Michael Gieler","height":98});
															thumbnails[5701950] = clik.newPhoto({"id":5701950,"src":"161_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5701950.html","width":130,"caption":"Sonja van Beek","height":195});
															thumbnails[5712110] = clik.newPhoto({"id":5712110,"src":"233_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5712110.html","width":130,"caption":"Johan van der Linden","height":87});
															thumbnails[5712178] = clik.newPhoto({"id":5712178,"src":"19_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5712178.html","width":130,"caption":"Johan van Iersel","height":195});
															thumbnails[5667486] = clik.newPhoto({"id":5667486,"src":"210_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5667486.html","width":130,"caption":"David Dramm","height":98});
															thumbnails[5701667] = clik.newPhoto({"id":5701667,"src":"38_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5701667.html","width":130,"caption":"Joël Waterman","height":116});
															thumbnails[6672762] = clik.newPhoto({"id":6672762,"src":"22_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_6672762.html","width":130,"caption":"Michiel Weidner","height":98});
															thumbnails[5669897] = clik.newPhoto({"id":5669897,"src":"33_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5669897.html","width":130,"caption":"Joris van Rijn","height":194});
															thumbnails[5712403] = clik.newPhoto({"id":5712403,"src":"322_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5712403.html","width":130,"caption":"Vasile Nedea","height":86});
															thumbnails[5767656] = clik.newPhoto({"id":5767656,"src":"44_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5767656.html","width":130,"caption":"Thomas Myrmel","height":98});
															thumbnails[7486681] = clik.newPhoto({"id":7486681,"src":"4_3BBAC10C-1EC9-DFB6-09FE5A39891C120D_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_7486681.html","width":130,"caption":"Marieke de Bruin","height":128});
															thumbnails[6143209] = clik.newPhoto({"id":6143209,"src":"26_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_6143209.html","width":130,"caption":"Ilja Leonard Pfeijffer","height":160});
															thumbnails[6658406] = clik.newPhoto({"id":6658406,"src":"1_D3174130-1EC9-D45B-1CD0BEAA9BE4E103_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_6658406.html","width":130,"caption":"Maarten Ornstein","height":195});
															thumbnails[6484123] = clik.newPhoto({"id":6484123,"src":"3_2A933E8F-24E8-5EC4-4FD13A74FF0D81F3_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_6484123.html","width":130,"caption":"Heleen Hulst","height":160});
															thumbnails[7022592] = clik.newPhoto({"id":7022592,"src":"42_2A92088E-24E8-5EC4-4F301AD2C434D669_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_7022592.html","width":130,"caption":"David Jentgens","height":86});
															thumbnails[7487014] = clik.newPhoto({"id":7487014,"src":"5_3F3E1C1A-1EC9-DFB6-093822F92902F73A_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_7487014.html","width":130,"caption":"Jeanette Landré","height":87});
															thumbnails[6072435] = clik.newPhoto({"id":6072435,"src":"21_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_6072435.html","width":130,"caption":"Wilmar de Visser","height":195});
															thumbnails[5667723] = clik.newPhoto({"id":5667723,"src":"11_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5667723.html","width":130,"caption":"Jorgen van Rijen","height":195});
															thumbnails[6484111] = clik.newPhoto({"id":6484111,"src":"1365x2048_COP-IMG_2412_thumb.jpeg","galleries_id":321100,"server_id":5,"link":"photo_6484111.html","width":130,"caption":"Gerard Bouwhuis","height":87});
															thumbnails[5944630] = clik.newPhoto({"id":5944630,"src":"1_C91ACCB2-1EC9-D45B-1CA66BF52E4CCBF6_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5944630.html","width":130,"caption":"Julija Hartig","height":195});
															thumbnails[5679948] = clik.newPhoto({"id":5679948,"src":"claron1_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5679948.html","width":130,"caption":"Claron Mcfadden","height":182});
															thumbnails[6018620] = clik.newPhoto({"id":6018620,"src":"3323397174_bd332e9db5_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_6018620.html","width":130,"caption":"Anne Laberge","height":88});
															thumbnails[5669898] = clik.newPhoto({"id":5669898,"src":"23_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5669898.html","width":130,"caption":"Mike Fentross","height":148});
															thumbnails[7022591] = clik.newPhoto({"id":7022591,"src":"6_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_7022591.html","width":130,"caption":"Marije Nie","height":86});
															thumbnails[5669875] = clik.newPhoto({"id":5669875,"src":"15_E1515FE5-1EC9-D45B-1CF862C58A3B9636_thumb.jpg","galleries_id":321100,"server_id":5,"link":"photo_5669875.html","width":130,"caption":"Martin Fondse","height":195});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[321100] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"de artiesten van Splendor","link":"section385077.html","maxRecords":0.0,"photoIDs":[6260846.0,7486677.0,7486685.0,5669884.0,5667487.0,7605514.0,5669896.0,5667498.0,5667510.0,5667519.0,6143207.0,5712117.0,6658215.0,5712313.0,6658044.0,5669893.0,5701909.0,5719150.0,5712180.0,5701651.0,5701950.0,5712110.0,5712178.0,5667486.0,5701667.0,6672762.0,5669897.0,5712403.0,5767656.0,7486681.0,6143209.0,6658406.0,6484123.0,7022592.0,7487014.0,6072435.0,5667723.0,6484111.0,5944630.0,5679948.0,6018620.0,5669898.0,7022591.0,5669875.0],"skipIndex":0,"section_code":"section385077","featured_images":5667487.0,"id":321100,"singleSection":true});				  						galleries[326721] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"de droom","link":"section391721.html","maxRecords":0.0,"photoIDs":[5770835.0,5770844.0],"skipIndex":0,"section_code":"section391721","featured_images":"5770844,5770835","id":326721,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8513968';
imageSets[2] = '5667487';
imageSets[3] = '8513968,7605514,7487014,7486685,7486681,7486677,7022592,7022591,6672762,6658406,6658215,6658044,6484123,6484111,6260846,6143209,6143207,6072435,6018620,5944630,5809046,5809045,5809043,5809042,5770844,5770835,5767656,5719150,5712403,5712313,5712180,5712178,5712117,5712110,5701950,5701909,5701667,5701651,5681899,5681890,5681888,5681884,5681873,5681869,5681843,5679948,5669898,5669897,5669896,5669893';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Splendor/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Splendor/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Splendor/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Splendor/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/Splendor/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/Splendor/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Splendor/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/Splendor/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 += 'section391721.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 && 'section391721' != '') {
					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 = 'Splendor Amsterdam: ' + 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>';
	}
				
				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> &euro;' + (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" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			temp += '<input type="hidden" name="item_name" value="'+item_name+'">';
			ref = '';
			if(this.photo_ref != ''){
				ref = this.photo_ref+' - '+this.caption;
			}
			else{
				ref = this.id+' - '+this.caption;
			}
			price = amount;								temp += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="Splendor">';
					temp += '<input type="hidden" name="currency_code" value="EUR">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="Splendor">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						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;
	}
}

			

