window.thumbnails = {};
															thumbnails[1678700] = clik.newPhoto({"id":1678700,"src":"pale pink hemp hat_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":98});
															thumbnails[1678709] = clik.newPhoto({"id":1678709,"src":"taupe floppy sisal with velvet blossom_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":98});
															thumbnails[1678724] = clik.newPhoto({"id":1678724,"src":"peach windblown_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":98});
															thumbnails[1678766] = clik.newPhoto({"id":1678766,"src":"icy white buds_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":98});
															thumbnails[1742887] = clik.newPhoto({"id":1742887,"src":"teal sisal with roses_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":174});
															thumbnails[1743597] = clik.newPhoto({"id":1743597,"src":"about11_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":98});
															thumbnails[3431274] = clik.newPhoto({"id":3431274,"src":"redrosewithpansies_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":98});
															thumbnails[3431277] = clik.newPhoto({"id":3431277,"src":"lilacflowers_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":98});
															thumbnails[3437002] = clik.newPhoto({"id":3437002,"src":"aboutmepage_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":173});
															thumbnails[8308320] = clik.newPhoto({"id":8308320,"src":"olive_hat_vintage_flowers_1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":98});
															thumbnails[3436946] = clik.newPhoto({"id":3436946,"src":"washedoutgreensisalwithfadedflower_thumb.jpg","galleries_id":94910,"server_id":1,"link":"photo_3436946.html","width":130,"caption":"","height":98});
															thumbnails[3436940] = clik.newPhoto({"id":3436940,"src":"charcoalberetwithpetal_thumb.jpg","galleries_id":94910,"server_id":1,"link":"photo_3436940.html","width":130,"caption":"","height":98});
															thumbnails[3436942] = clik.newPhoto({"id":3436942,"src":"dustypinksisalwithfadedflowers_thumb.jpg","galleries_id":94910,"server_id":1,"link":"photo_3436942.html","width":130,"caption":"","height":98});
															thumbnails[3431295] = clik.newPhoto({"id":3431295,"src":"dustypinksiname_thumb.jpg","galleries_id":94910,"server_id":1,"link":"photo_3431295.html","width":130,"caption":"","height":98});
															thumbnails[3431297] = clik.newPhoto({"id":3431297,"src":"floppysisalwithpetals_thumb.jpg","galleries_id":94910,"server_id":1,"link":"photo_3431297.html","width":130,"caption":"","height":98});
															thumbnails[3437809] = clik.newPhoto({"id":3437809,"src":"dusty pink hat with faded flowers_thumb.jpg","galleries_id":94910,"server_id":1,"link":"photo_3437809.html","width":130,"caption":"","height":98});
															thumbnails[1678708] = clik.newPhoto({"id":1678708,"src":"stack of straws_thumb.jpg","galleries_id":94910,"server_id":1,"link":"photo_1678708.html","width":130,"caption":"","height":98});
															thumbnails[3431299] = clik.newPhoto({"id":3431299,"src":"hemphatwithbow_thumb.jpg","galleries_id":94910,"server_id":1,"link":"photo_3431299.html","width":130,"caption":"","height":98});
															thumbnails[3431293] = clik.newPhoto({"id":3431293,"src":"bluegreysiname_thumb.jpg","galleries_id":94910,"server_id":1,"link":"photo_3431293.html","width":130,"caption":"","height":98});
															thumbnails[3436943] = clik.newPhoto({"id":3436943,"src":"oystersisalwithfadedflower_thumb.jpg","galleries_id":94910,"server_id":1,"link":"photo_3436943.html","width":130,"caption":"","height":98});
															thumbnails[3431296] = clik.newPhoto({"id":3431296,"src":"floppysisalwithbow_thumb.jpg","galleries_id":94910,"server_id":1,"link":"photo_3431296.html","width":130,"caption":"","height":98});
															thumbnails[3436944] = clik.newPhoto({"id":3436944,"src":"palegreysisalwithfadedflowers_thumb.jpg","galleries_id":94910,"server_id":1,"link":"photo_3436944.html","width":130,"caption":"","height":98});
															thumbnails[7106231] = clik.newPhoto({"id":7106231,"src":"pink_flower_hairclip_with_petals_12.00_thumb.jpg","galleries_id":113224,"server_id":1,"link":"photo_7106231.html","width":130,"caption":"","height":98});
															thumbnails[3436995] = clik.newPhoto({"id":3436995,"src":"pinkwindblownroseclosed_thumb.jpg","galleries_id":113224,"server_id":1,"link":"photo_3436995.html","width":130,"caption":"","height":98});
															thumbnails[7106265] = clik.newPhoto({"id":7106265,"src":"peony_rose_with_brooch_or_hairclip_10.00_thumb.jpg","galleries_id":113224,"server_id":1,"link":"photo_7106265.html","width":130,"caption":"","height":173});
															thumbnails[7106273] = clik.newPhoto({"id":7106273,"src":"vic_plum_1_thumb.jpg","galleries_id":113224,"server_id":1,"link":"photo_7106273.html","width":130,"caption":"","height":135});
															thumbnails[3436997] = clik.newPhoto({"id":3436997,"src":"pinkwindblownroseopen_thumb.jpg","galleries_id":113224,"server_id":1,"link":"photo_3436997.html","width":130,"caption":"","height":98});
															thumbnails[3436992] = clik.newPhoto({"id":3436992,"src":"pink_dog_rose_10.00_thumb.jpg","galleries_id":113224,"server_id":1,"link":"photo_3436992.html","width":130,"caption":"","height":173});
															thumbnails[1678727] = clik.newPhoto({"id":1678727,"src":"love_it_like_vintage_fascinator_27.00_thumb.jpg","galleries_id":113224,"server_id":1,"link":"photo_1678727.html","width":130,"caption":"","height":173});
															thumbnails[7106316] = clik.newPhoto({"id":7106316,"src":"cherry_blos_clip_thumb.jpg","galleries_id":113224,"server_id":1,"link":"photo_7106316.html","width":130,"caption":"","height":163});
															thumbnails[7106445] = clik.newPhoto({"id":7106445,"src":"pansy_3_thumb.jpg","galleries_id":113224,"server_id":1,"link":"photo_7106445.html","width":130,"caption":"","height":100});
															thumbnails[3431289] = clik.newPhoto({"id":3431289,"src":"little_blue_hairclip_with_petals_12.00_thumb.jpg","galleries_id":113225,"server_id":1,"link":"photo_3431289.html","width":130,"caption":"","height":98});
															thumbnails[3431286] = clik.newPhoto({"id":3431286,"src":"cream_frilly_flower_1612.00_thumb.jpg","galleries_id":113225,"server_id":1,"link":"photo_3431286.html","width":130,"caption":"","height":173});
															thumbnails[3431275] = clik.newPhoto({"id":3431275,"src":"love_it_like_vintage_veil_silvery_blue_227.00_thumb.jpg","galleries_id":113225,"server_id":1,"link":"photo_3431275.html","width":130,"caption":"","height":98});
															thumbnails[1678791] = clik.newPhoto({"id":1678791,"src":"silver_blousey_rose_with_brooch_pin_and_hairclip_34.00_thumb.jpg","galleries_id":113225,"server_id":1,"link":"photo_1678791.html","width":130,"caption":"","height":98});
															thumbnails[3437003] = clik.newPhoto({"id":3437003,"src":"soft_faded_rose_cream_with_brooch_pin_and_clip_15.00_thumb.jpg","galleries_id":113225,"server_id":1,"link":"photo_3437003.html","width":130,"caption":"","height":173});
															thumbnails[1678778] = clik.newPhoto({"id":1678778,"src":"large white blousey rose_thumb.jpg","galleries_id":113225,"server_id":1,"link":"photo_1678778.html","width":130,"caption":"","height":98});
															thumbnails[3437006] = clik.newPhoto({"id":3437006,"src":"floppy_grey_rose_1_thumb.jpg","galleries_id":113225,"server_id":1,"link":"photo_3437006.html","width":130,"caption":"","height":173});
															thumbnails[7106356] = clik.newPhoto({"id":7106356,"src":"white_flower_corsages_with_brooch_pin_16.00_thumb.jpg","galleries_id":113225,"server_id":1,"link":"photo_7106356.html","width":130,"caption":"","height":143});
															thumbnails[3437004] = clik.newPhoto({"id":3437004,"src":"creamdogrose_thumb.jpg","galleries_id":113225,"server_id":1,"link":"photo_3437004.html","width":130,"caption":"","height":98});
															thumbnails[7111538] = clik.newPhoto({"id":7111538,"src":"little_cream_flower_hair_clip_with_petals_thumb.jpg","galleries_id":113225,"server_id":1,"link":"photo_7111538.html","width":130,"caption":"","height":98});
															thumbnails[3431272] = clik.newPhoto({"id":3431272,"src":"love_it_like_vintage_veil_silvery_blue_2271.00_thumb.jpg","galleries_id":113226,"server_id":1,"link":"photo_3431272.html","width":130,"caption":"","height":98});
															thumbnails[3436936] = clik.newPhoto({"id":3436936,"src":"pink_flower_hairclip_with_petals_121.00_thumb.jpg","galleries_id":113226,"server_id":1,"link":"photo_3436936.html","width":130,"caption":"","height":98});
															thumbnails[3431269] = clik.newPhoto({"id":3431269,"src":"love_it_like_vintage_veil_pink_271.00_thumb.jpg","galleries_id":113226,"server_id":1,"link":"photo_3431269.html","width":130,"caption":"","height":173});
															thumbnails[3431271] = clik.newPhoto({"id":3431271,"src":"little_blue_hairclip_with_petals_121.00_thumb.jpg","galleries_id":113226,"server_id":1,"link":"photo_3431271.html","width":130,"caption":"","height":98});
															thumbnails[3437569] = clik.newPhoto({"id":3437569,"src":"love_it_like_vintage_fascinator_2712.00_thumb.jpg","galleries_id":113226,"server_id":1,"link":"photo_3437569.html","width":130,"caption":"","height":173});
															thumbnails[3914336] = clik.newPhoto({"id":3914336,"src":"fascinators_thumb.jpg","galleries_id":113226,"server_id":1,"link":"photo_3914336.html","width":130,"caption":"","height":98});
															thumbnails[1678736] = clik.newPhoto({"id":1678736,"src":"grey_feather_fascinator1_thumb.jpg","galleries_id":113226,"server_id":1,"link":"photo_1678736.html","width":130,"caption":"","height":173});
															thumbnails[1678749] = clik.newPhoto({"id":1678749,"src":"vintage veiled fascinator_thumb.jpg","galleries_id":113226,"server_id":1,"link":"photo_1678749.html","width":130,"caption":"","height":98});
															thumbnails[8727187] = clik.newPhoto({"id":8727187,"src":"olive_green_feather_fascinator_thumb.jpg","galleries_id":113226,"server_id":1,"link":"photo_8727187.html","width":130,"caption":"","height":98});
															thumbnails[1742969] = clik.newPhoto({"id":1742969,"src":"taupe_stripe_corsage_with_brooch_pin_or_hair_clip_16.00_thumb.jpg","galleries_id":113227,"server_id":1,"link":"photo_1742969.html","width":130,"caption":"","height":98});
															thumbnails[1678755] = clik.newPhoto({"id":1678755,"src":"white_flower_corsages_with_brooch_pin_161.00_thumb.jpg","galleries_id":113227,"server_id":1,"link":"photo_1678755.html","width":130,"caption":"","height":143});
															thumbnails[7106380] = clik.newPhoto({"id":7106380,"src":"hair_comb_print_fabric_corsage_with_brooch_pin_or_hairclip_16.00_thumb.jpg","galleries_id":113227,"server_id":1,"link":"photo_7106380.html","width":130,"caption":"","height":98});
															thumbnails[7106391] = clik.newPhoto({"id":7106391,"src":"cream_frilly_flower_16123.00_thumb.jpg","galleries_id":113227,"server_id":1,"link":"photo_7106391.html","width":130,"caption":"","height":173});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[94910] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"hats","link":"gallery.html","maxRecords":0.0,"photoIDs":[3436946.0,3436940.0,3436942.0,3431295.0,3431297.0,3437809.0,1678708.0,3431299.0,3431293.0,3436943.0,3431296.0,3436944.0],"skipIndex":0,"section_code":"gallery","featured_images":"3437809,3436946,3436944,3436943,3436942,3436940,3431299,3431297,3431296,3431295","id":94910,"singleSection":true});				  						galleries[113224] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"flowers pink","link":"section148456.html","maxRecords":0.0,"photoIDs":[7106231.0,3436995.0,7106265.0,7106273.0,3436997.0,3436992.0,1678727.0,7106316.0,7106445.0],"skipIndex":0,"section_code":"section148456","featured_images":"7106445,7106316,7106273,7106265,7106231,3436997,3436995,3436992,1678727","id":113224,"singleSection":true});				  						galleries[113225] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"silvery greys and creams","link":"section152905.html","maxRecords":0.0,"photoIDs":[3431289.0,3431286.0,3431275.0,1678791.0,3437003.0,1678778.0,3437006.0,7106356.0,3437004.0,7111538.0],"skipIndex":0,"section_code":"section152905","featured_images":"7111538,7106356,3437006,3437004,3437003,3431289,3431286,3431275,1678791,1678778","id":113225,"singleSection":true});				  						galleries[113226] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"fascinators","link":"section148473.html","maxRecords":0.0,"photoIDs":[3431272.0,3436936.0,3431269.0,3431271.0,3437569.0,3914336.0,1678736.0,1678749.0,8727187.0],"skipIndex":0,"section_code":"section148473","featured_images":"8727187,3914336,3437569,3436936,3431272,3431271,3431269,1678749,1678736","id":113226,"singleSection":true});				  						galleries[113227] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"corsages","link":"section148474.html","maxRecords":0.0,"photoIDs":[1742969.0,1678755.0,7106380.0,7106391.0],"skipIndex":0,"section_code":"section148474","featured_images":"7106391,7106380,1742969,1678755","id":113227,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '1743597';
imageSets[2] = '1678766';
imageSets[3] = '8727187,8308320,7111538,7106445,7106391,7106380,7106356,7106316,7106273,7106265,7106231,3914336,3437809,3437569,3437006,3437004,3437003,3437002,3436997,3436995,3436992,3436946,3436944,3436943,3436942,3436940,3436936,3431299,3431297,3431296,3431295,3431293,3431289,3431286,3431277,3431275,3431274,3431272,3431271,3431269,1743597,1742969,1742887,1678791,1678778,1678766,1678755,1678749,1678736,1678727';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/gilfox/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/gilfox/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/gilfox/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/gilfox/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/gilfox/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/gilfox/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/gilfox/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/gilfox/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 = 'gil fox hat designs: ' + 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>Prices exclude P&P. Buy now using Paypal:</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.payment_groups_id !== '') {
		temp += '<p>Prices exclude P&P. Buy now using Paypal:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
		 									temp += '<select class="paymentlink" name="payment_options_id" onchange="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		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 += '<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="GILFOX">';
			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;
	}
}

			

