window.thumbnails = {};
thumbnails[8814180] = clik.newPhoto({"link":"photo_8814180.html","caption":"The Carollers' Wives, 2010","height":113,"id":8814180,"server_id":21,"src":"for_web_The_Carollers_Wives_Screen_Print1_thumb.jpg","galleries_id":464047,"width":160});
thumbnails[8814185] = clik.newPhoto({"link":"photo_8814185.html","caption":"The Mother of Masopust, 2010","height":218,"id":8814185,"server_id":21,"src":"for_web_The_Mother_of_Masopust_Screen_Print_thumb.jpg","galleries_id":464047,"width":160});
thumbnails[8808380] = clik.newPhoto({"link":"photo_8808380.html","caption":"Charter of the Common Man, 2011","height":161,"id":8808380,"server_id":21,"src":"charter_of_the_common_man_thumb.jpg","galleries_id":464075,"width":160});
thumbnails[8810470] = clik.newPhoto({"link":"photo_8810470.html","caption":"Ostara, 2009","height":232,"id":8810470,"server_id":21,"src":"web_Ostara_screen_print_20091_thumb.jpg","galleries_id":464048,"width":160});
thumbnails[8814171] = clik.newPhoto({"link":"photo_8814171.html","caption":"Festive Days, 2008","height":231,"id":8814171,"server_id":21,"src":"web_Festive_Days_thumb.jpg","galleries_id":464050,"width":160});
thumbnails[8814188] = clik.newPhoto({"link":"photo_8814188.html","caption":"The Suitors, 2007","height":200,"id":8814188,"server_id":21,"src":"for_web_the_suitors1_thumb.jpg","galleries_id":464052,"width":160});
thumbnails[8814167] = clik.newPhoto({"link":"photo_8814167.html","caption":"Crown of Darkness, 2007","height":214,"id":8814167,"server_id":21,"src":"for_web_Crown_of_darkness_thumb.jpg","galleries_id":464052,"width":160});
thumbnails[8814183] = clik.newPhoto({"link":"photo_8814183.html","caption":"The Fertile Couple, 2008","height":231,"id":8814183,"server_id":21,"src":"web_fertile_couple_thumb.jpg","galleries_id":464050,"width":160});
thumbnails[8814187] = clik.newPhoto({"link":"photo_8814187.html","caption":"The Spring Rising, 2011","height":115,"id":8814187,"server_id":21,"src":"web_The_Spring_Rising_2011_thumb.jpg","galleries_id":464075,"width":160});
thumbnails[8814192] = clik.newPhoto({"link":"photo_8814192.html","caption":"Winter and Spring, 2009","height":107,"id":8814192,"server_id":21,"src":"web_Winter_and_Spring_for_press_thumb.jpg","galleries_id":464048,"width":160});
thumbnails[8810514] = clik.newPhoto({"link":"photo_8810514.html","caption":"Ostara and the Hare, 2009","height":81,"id":8810514,"server_id":21,"src":"oath_web_thumb.jpg","galleries_id":464075,"width":160});
thumbnails[8814172] = clik.newPhoto({"link":"photo_8814172.html","caption":"Beheading of the Cockerel, 2009","height":107,"id":8814172,"server_id":21,"src":"web_Beheading_of_the_cockerel_for_press_thumb.jpg","galleries_id":464048,"width":160});
thumbnails[8814173] = clik.newPhoto({"link":"photo_8814173.html","caption":"Beauty for One Day, 2008","height":231,"id":8814173,"server_id":21,"src":"web_beauty_for_one_day_thumb.jpg","galleries_id":464050,"width":160});
thumbnails[8814191] = clik.newPhoto({"link":"photo_8814191.html","caption":"Wedding Night, 2007","height":200,"id":8814191,"server_id":21,"src":"for_web_wedding_night_thumb.jpg","galleries_id":464052,"width":160});
thumbnails[8814106] = clik.newPhoto({"link":"photo_8814106.html","caption":"Baked Spring, 2009","height":378,"id":8814106,"server_id":21,"src":"for_web_bakedspring1_thumb.jpg","galleries_id":464075,"width":160});
thumbnails[8814189] = clik.newPhoto({"link":"photo_8814189.html","caption":"The Wedding Flower, 2008","height":111,"id":8814189,"server_id":21,"src":"web_the_wedding_flower_thumb.jpg","galleries_id":464050,"width":160});
thumbnails[8813446] = clik.newPhoto({"link":"photo_8813446.html","caption":"(Super 8 film, Duration 09:13 min)","height":120,"id":8813446,"server_id":21,"src":"web_still_image2._WEDDING_RITUALS_thumb.jpg","galleries_id":464059,"width":160});
thumbnails[8813684] = clik.newPhoto({"link":"photo_8813684.html","caption":"(Super 8 Film, Duration 9 min 13 secs)","height":120,"id":8813684,"server_id":21,"src":"web_still_image3._WEDDING_RITUALS_thumb.jpg","galleries_id":464059,"width":160});
thumbnails[8814088] = clik.newPhoto({"link":"photo_8814088.html","caption":"(HD video, 7 minutes 30 seconds)","height":120,"id":8814088,"server_id":21,"src":"for_web_masopust_still_image_1_thumb.jpg","galleries_id":464066,"width":160});
thumbnails[8814121] = clik.newPhoto({"link":"photo_8814121.html","caption":"(Video, 10min 33sec)","height":90,"id":8814121,"server_id":21,"src":"for_web_film_still_equinox_8_thumb.jpg","galleries_id":464067,"width":160});
thumbnails[8814124] = clik.newPhoto({"link":"photo_8814124.html","caption":"(Video, 10min 33sec)","height":90,"id":8814124,"server_id":21,"src":"for_web_spring_equinox_video_still_2_thumb.jpg","galleries_id":464067,"width":160});
thumbnails[8814132] = clik.newPhoto({"link":"photo_8814132.html","caption":"(Spring Equinox, 2009)","height":90,"id":8814132,"server_id":21,"src":"for_web_video_still_buskova_6_thumb.jpg","galleries_id":464067,"width":160});
thumbnails[8814135] = clik.newPhoto({"link":"photo_8814135.html","caption":"(Video, 10min 33sec)","height":90,"id":8814135,"server_id":21,"src":"for_web_video_still_buskova_7_thumb.jpg","galleries_id":464067,"width":160});
thumbnails[8814143] = clik.newPhoto({"link":"photo_8814143.html","caption":"(HD video, 7 minutes 30 seconds)","height":120,"id":8814143,"server_id":21,"src":"for_web_masopust_still_image_2_thumb.jpg","galleries_id":464066,"width":160});
thumbnails[8814148] = clik.newPhoto({"link":"photo_8814148.html","caption":"(HD video, 7 minutes 30 seconds)","height":120,"id":8814148,"server_id":21,"src":"for_web_masopust_still_image_3_thumb.jpg","galleries_id":464066,"width":160});
thumbnails[8814149] = clik.newPhoto({"link":"photo_8814149.html","caption":"(HD video, 7 minutes 30 seconds)","height":120,"id":8814149,"server_id":21,"src":"for_web_masopust_still_image_4_thumb.jpg","galleries_id":464066,"width":160});
thumbnails[8814159] = clik.newPhoto({"link":"photo_8814159.html","caption":"(Super 8 film, Duration: 06:40 min)","height":120,"id":8814159,"server_id":21,"src":"for_web_still_image2._FORGOTTEN_MARRIAGE_thumb.jpg","galleries_id":464064,"width":160});
thumbnails[8814160] = clik.newPhoto({"link":"photo_8814160.html","caption":"(Super 8 film, Duration: 06:40 min)","height":120,"id":8814160,"server_id":21,"src":"for_web_still_image3._FORGOTTEN_MARRIAGE_thumb.jpg","galleries_id":464064,"width":160});
thumbnails[8814162] = clik.newPhoto({"link":"photo_8814162.html","caption":"(Super 8 film, Duration: 06:40 min)","height":120,"id":8814162,"server_id":21,"src":"for_web_still_image_1.FORGOTTEN_MARRIAGE_thumb.jpg","galleries_id":464064,"width":160});
thumbnails[8814092] = clik.newPhoto({"link":"photo_8814092.html","caption":"(The Rose Ritual, Doudleby 2010)","height":120,"id":8814092,"server_id":21,"src":"for_web_document_masopust_4_thumb.jpg","galleries_id":464060,"width":160});
thumbnails[8814097] = clik.newPhoto({"link":"photo_8814097.html","caption":"Masopust, 2010","height":120,"id":8814097,"server_id":21,"src":"for_web_document_masopust_2_thumb.jpg","galleries_id":464060,"width":160});
thumbnails[8814100] = clik.newPhoto({"link":"photo_8814100.html","caption":"Masopust, 2010","height":120,"id":8814100,"server_id":21,"src":"for_web_document_masopust_5_thumb.jpg","galleries_id":464060,"width":160});
thumbnails[8814103] = clik.newPhoto({"link":"photo_8814103.html","caption":"Spring Equinox, 2009","height":107,"id":8814103,"server_id":21,"src":"for_web_document_photo_of_spring_equinox_2_thumb.jpg","galleries_id":464061,"width":160});
thumbnails[8814112] = clik.newPhoto({"link":"photo_8814112.html","caption":"Spring Equinox, 2009","height":107,"id":8814112,"server_id":21,"src":"for_web_document_Spring_Equinox_thumb.jpg","galleries_id":464061,"width":160});
thumbnails[8814119] = clik.newPhoto({"link":"photo_8814119.html","caption":"(Spring Equinox, 2009)","height":107,"id":8814119,"server_id":21,"src":"for_web_Buskova_filming_Spring_Equinox_thumb.jpg","galleries_id":464061,"width":160});
thumbnails[8814150] = clik.newPhoto({"link":"photo_8814150.html","caption":"(176 Zabludowicz Collection Performance, 2009)","height":107,"id":8814150,"server_id":21,"src":"for_web_performance_2_thumb.jpg","galleries_id":464062,"width":160});
thumbnails[8814151] = clik.newPhoto({"link":"photo_8814151.html","caption":"(176 Zabludowicz Collection Performance, 2009)","height":116,"id":8814151,"server_id":21,"src":"for_web_performance_3_thumb.jpg","galleries_id":464062,"width":160});
thumbnails[8814155] = clik.newPhoto({"link":"photo_8814155.html","caption":"(176 Zabludowicz Collection Performance, 2009)","height":107,"id":8814155,"server_id":21,"src":"for_web_performance_176_thumb.jpg","galleries_id":464062,"width":160});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
galleries[464075] = clik.newGallery({"photoIDs":[8808380,8814187,8810514,8814106],"link":"section561639_464075.html","skipIndex":0,"section_code":"section561639","id":464075,"parentGallery":"","featured_images":8808380,"maxRecords":0,"usePopups":false,"singleSection":false,"title":"Affordable Editions"});galleries[464066] = clik.newGallery({"photoIDs":[8814088,8814143,8814148,8814149],"link":"section561653_464066.html","skipIndex":0,"section_code":"section561653","id":464066,"parentGallery":"","featured_images":"8814149,8814148,8814143,8814088","maxRecords":0,"usePopups":false,"singleSection":false,"title":"Masopust"});galleries[464060] = clik.newGallery({"photoIDs":[8814092,8814097,8814100],"link":"section561684_464060.html","skipIndex":0,"section_code":"section561684","id":464060,"parentGallery":"","featured_images":"8814100,8814097,8814092","maxRecords":0,"usePopups":false,"singleSection":false,"title":"Masopust "});galleries[464062] = clik.newGallery({"photoIDs":[8814150,8814151,8814155],"link":"section561684_464062.html","skipIndex":0,"section_code":"section561684","id":464062,"parentGallery":"","featured_images":"8814155,8814151,8814150","maxRecords":0,"usePopups":false,"singleSection":false,"title":"176 Performance"});galleries[464047] = clik.newGallery({"photoIDs":[8814180,8814185],"link":"section561639_464047.html","skipIndex":0,"section_code":"section561639","id":464047,"parentGallery":"","featured_images":8814185,"maxRecords":0,"usePopups":false,"singleSection":false,"title":"Masopust"});galleries[464067] = clik.newGallery({"photoIDs":[8814121,8814124,8814132,8814135],"link":"section561653_464067.html","skipIndex":0,"section_code":"section561653","id":464067,"parentGallery":"","featured_images":"8814135,8814132,8814124,8814121","maxRecords":0,"usePopups":false,"singleSection":false,"title":"Spring Equinox"});galleries[464064] = clik.newGallery({"photoIDs":[8814159,8814160,8814162],"link":"section561653_464064.html","skipIndex":0,"section_code":"section561653","id":464064,"parentGallery":"","featured_images":"8814162,8814160,8814159","maxRecords":0,"usePopups":false,"singleSection":false,"title":"Forgotten Marriage"});galleries[464048] = clik.newGallery({"photoIDs":[8810470,8814192,8814172],"link":"section561639_464048.html","skipIndex":0,"section_code":"section561639","id":464048,"parentGallery":"","featured_images":8810470,"maxRecords":0,"usePopups":false,"singleSection":false,"title":"Spring Equinox"});galleries[464061] = clik.newGallery({"photoIDs":[8814103,8814112,8814119],"link":"section561684_464061.html","skipIndex":0,"section_code":"section561684","id":464061,"parentGallery":"","featured_images":"8814119,8814112,8814103","maxRecords":0,"usePopups":false,"singleSection":false,"title":"Sprinq Equinox"});galleries[464059] = clik.newGallery({"photoIDs":[8813446,8813684],"link":"section561653_464059.html","skipIndex":0,"section_code":"section561653","id":464059,"parentGallery":"","featured_images":"8813684,8813446","maxRecords":0,"usePopups":false,"singleSection":false,"title":"Wedding Rituals"});galleries[464050] = clik.newGallery({"photoIDs":[8814171,8814183,8814173,8814189],"link":"section561639_464050.html","skipIndex":0,"section_code":"section561639","id":464050,"parentGallery":"","featured_images":8814171,"maxRecords":0,"usePopups":false,"singleSection":false,"title":"Forgotten Marriage"});galleries[464052] = clik.newGallery({"photoIDs":[8814188,8814167,8814191],"link":"section561639_464052.html","skipIndex":0,"section_code":"section561639","id":464052,"parentGallery":"","featured_images":8814188,"maxRecords":0,"usePopups":false,"singleSection":false,"title":"Wedding Rituals"});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[3] = '8814192,8814191,8814189,8814188,8814187,8814185,8814183,8814180,8814173,8814172,8814171,8814167,8814162,8814160,8814159,8814155,8814151,8814150,8814149,8814148,8814143,8814135,8814132,8814124,8814121,8814119,8814112,8814106,8814103,8814100,8814097,8814092,8814088,8813684,8813446,8810514,8810470,8808380';
imageSets[2] = '8814185,8814188,8814171,8810470,8808380';
imageSets[1] = '8808380';
imageSets[246363] = '8810470';
imageSets[246365] = '8808380';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/terezabuskova/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/terezabuskova/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 += 'section561639.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 && 'section561639' != '') {
					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 = 'Tereza Buskova: ' + 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> ' + (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 += '<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;
	}
}

		

