window.thumbnails = {};
															thumbnails[813788] = clik.newPhoto({"id":813788,"src":"AG14 Natural balance copy2_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":87,"caption":"","height":272});
															thumbnails[813792] = clik.newPhoto({"id":813792,"src":"AG26 copy_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":87,"caption":"","height":272});
															thumbnails[813794] = clik.newPhoto({"id":813794,"src":"AG10 Sent with love copy 2_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":87,"caption":"","height":272});
															thumbnails[813800] = clik.newPhoto({"id":813800,"src":"AG18 Birthday wishes copy_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":87,"caption":"","height":272});
															thumbnails[813795] = clik.newPhoto({"id":813795,"src":"AG80 copy_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":87,"caption":"","height":272});
															thumbnails[813798] = clik.newPhoto({"id":813798,"src":"AG13 Special delivery copy_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":87,"caption":"","height":272});
															thumbnails[813802] = clik.newPhoto({"id":813802,"src":"AG19 Hats off to you copy_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":87,"caption":"","height":272});
															thumbnails[813804] = clik.newPhoto({"id":813804,"src":"AG27 copy2_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":87,"caption":"","height":272});
															thumbnails[3703264] = clik.newPhoto({"id":3703264,"src":"treewebfinal5002_thumb.jpg","galleries_id":223799,"server_id":18,"link":"photo_3703264.html","width":130,"caption":"","height":130});
															thumbnails[3665095] = clik.newPhoto({"id":3665095,"src":"redbirdweb600_copy_thumb.jpg","galleries_id":223799,"server_id":18,"link":"photo_3665095.html","width":130,"caption":"","height":130});
															thumbnails[3665387] = clik.newPhoto({"id":3665387,"src":"pinkbird500_thumb.jpg","galleries_id":223799,"server_id":18,"link":"photo_3665387.html","width":130,"caption":"","height":130});
															thumbnails[3669065] = clik.newPhoto({"id":3669065,"src":"greenbird500web_thumb.jpg","galleries_id":223799,"server_id":18,"link":"photo_3669065.html","width":130,"caption":"","height":130});
															thumbnails[3669087] = clik.newPhoto({"id":3669087,"src":"bluedamask500_thumb.jpg","galleries_id":223799,"server_id":18,"link":"photo_3669087.html","width":130,"caption":"","height":130});
															thumbnails[3669768] = clik.newPhoto({"id":3669768,"src":"deerweb500_thumb.jpg","galleries_id":223799,"server_id":18,"link":"photo_3669768.html","width":130,"caption":"","height":130});
															thumbnails[3669988] = clik.newPhoto({"id":3669988,"src":"butterflyweb500_thumb.jpg","galleries_id":223799,"server_id":18,"link":"photo_3669988.html","width":130,"caption":"","height":130});
															thumbnails[3669989] = clik.newPhoto({"id":3669989,"src":"carweb5002_thumb.jpg","galleries_id":223799,"server_id":18,"link":"photo_3669989.html","width":130,"caption":"","height":130});
															thumbnails[3672425] = clik.newPhoto({"id":3672425,"src":"funkeygreyweb500_thumb.jpg","galleries_id":223799,"server_id":18,"link":"photo_3672425.html","width":130,"caption":"","height":130});
															thumbnails[3672489] = clik.newPhoto({"id":3672489,"src":"pinkshapeweb500_thumb.jpg","galleries_id":223799,"server_id":18,"link":"photo_3672489.html","width":130,"caption":"","height":130});
															thumbnails[3672443] = clik.newPhoto({"id":3672443,"src":"dragonflyweb500_thumb.jpg","galleries_id":223799,"server_id":18,"link":"photo_3672443.html","width":130,"caption":"","height":130});
															thumbnails[3672763] = clik.newPhoto({"id":3672763,"src":"happybirthdayweb500_thumb.jpg","galleries_id":223799,"server_id":18,"link":"photo_3672763.html","width":130,"caption":"","height":130});
															thumbnails[3703267] = clik.newPhoto({"id":3703267,"src":"6cards3_thumb.jpg","galleries_id":223799,"server_id":18,"link":"photo_3703267.html","width":130,"caption":"","height":130});
															thumbnails[3703270] = clik.newPhoto({"id":3703270,"src":"6cards4_thumb.jpg","galleries_id":223799,"server_id":18,"link":"photo_3703270.html","width":130,"caption":"","height":130});
															thumbnails[3703274] = clik.newPhoto({"id":3703274,"src":"12cards_thumb.jpg","galleries_id":223799,"server_id":18,"link":"photo_3703274.html","width":130,"caption":"","height":130});
															thumbnails[781115] = clik.newPhoto({"id":781115,"src":"Sculpture 14 text_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_781115.html","width":130,"caption":"","height":156});
															thumbnails[3673095] = clik.newPhoto({"id":3673095,"src":"treewebfinal5001_thumb.jpg","galleries_id":60597,"server_id":18,"link":"photo_3673095.html","width":130,"caption":"","height":130});
															thumbnails[781119] = clik.newPhoto({"id":781119,"src":"Sculpture 11 text_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_781119.html","width":130,"caption":"","height":156});
															thumbnails[3673107] = clik.newPhoto({"id":3673107,"src":"redbirdweb500_copy1_thumb.jpg","galleries_id":60597,"server_id":18,"link":"photo_3673107.html","width":130,"caption":"","height":130});
															thumbnails[781124] = clik.newPhoto({"id":781124,"src":"Sculpture 29 text_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_781124.html","width":130,"caption":"","height":156});
															thumbnails[3673111] = clik.newPhoto({"id":3673111,"src":"pinkbirdweb5001_thumb.jpg","galleries_id":60597,"server_id":18,"link":"photo_3673111.html","width":130,"caption":"","height":130});
															thumbnails[781128] = clik.newPhoto({"id":781128,"src":"Sculpture 34 text_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_781128.html","width":130,"caption":"","height":156});
															thumbnails[3673115] = clik.newPhoto({"id":3673115,"src":"greenbird500web1_thumb.jpg","galleries_id":60597,"server_id":18,"link":"photo_3673115.html","width":130,"caption":"","height":130});
															thumbnails[781132] = clik.newPhoto({"id":781132,"src":"Sculpture 15 text_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_781132.html","width":130,"caption":"","height":156});
															thumbnails[3699631] = clik.newPhoto({"id":3699631,"src":"bluedamask5001_thumb.jpg","galleries_id":60597,"server_id":18,"link":"photo_3699631.html","width":130,"caption":"","height":130});
															thumbnails[781161] = clik.newPhoto({"id":781161,"src":"Sculpture 18 text_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_781161.html","width":130,"caption":"","height":156});
															thumbnails[3699634] = clik.newPhoto({"id":3699634,"src":"deerweb5001_thumb.jpg","galleries_id":60597,"server_id":18,"link":"photo_3699634.html","width":130,"caption":"","height":130});
															thumbnails[781166] = clik.newPhoto({"id":781166,"src":"Sculpture 31 text_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_781166.html","width":130,"caption":"","height":156});
															thumbnails[3699638] = clik.newPhoto({"id":3699638,"src":"butterflyweb5001_thumb.jpg","galleries_id":60597,"server_id":18,"link":"photo_3699638.html","width":130,"caption":"","height":130});
															thumbnails[781189] = clik.newPhoto({"id":781189,"src":"Sculpture 30 text_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_781189.html","width":130,"caption":"","height":156});
															thumbnails[3699641] = clik.newPhoto({"id":3699641,"src":"carweb5001_thumb.jpg","galleries_id":60597,"server_id":18,"link":"photo_3699641.html","width":130,"caption":"","height":130});
															thumbnails[785054] = clik.newPhoto({"id":785054,"src":"Sculpture 32 text3_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_785054.html","width":130,"caption":"","height":156});
															thumbnails[3699645] = clik.newPhoto({"id":3699645,"src":"funkeygreyweb5001_thumb.jpg","galleries_id":60597,"server_id":18,"link":"photo_3699645.html","width":130,"caption":"","height":130});
															thumbnails[785058] = clik.newPhoto({"id":785058,"src":"Sculpture 48 text1_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_785058.html","width":130,"caption":"","height":156});
															thumbnails[3699648] = clik.newPhoto({"id":3699648,"src":"pinkshapeweb5001_thumb.jpg","galleries_id":60597,"server_id":18,"link":"photo_3699648.html","width":130,"caption":"","height":130});
															thumbnails[785063] = clik.newPhoto({"id":785063,"src":"Sculpture 25 text3_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_785063.html","width":130,"caption":"","height":156});
															thumbnails[3699650] = clik.newPhoto({"id":3699650,"src":"dragonflyweb5001_thumb.jpg","galleries_id":60597,"server_id":18,"link":"photo_3699650.html","width":130,"caption":"","height":130});
															thumbnails[785066] = clik.newPhoto({"id":785066,"src":"Scuplture 22 text3_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_785066.html","width":130,"caption":"","height":156});
															thumbnails[3699652] = clik.newPhoto({"id":3699652,"src":"happybirthdayweb5001_thumb.jpg","galleries_id":60597,"server_id":18,"link":"photo_3699652.html","width":130,"caption":"","height":130});
															thumbnails[785071] = clik.newPhoto({"id":785071,"src":"Sculpture 52 text2_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_785071.html","width":130,"caption":"","height":156});
															thumbnails[785082] = clik.newPhoto({"id":785082,"src":"Sculpture 45 text1_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_785082.html","width":130,"caption":"","height":156});
															thumbnails[785087] = clik.newPhoto({"id":785087,"src":"Scuplture 7 text2_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_785087.html","width":130,"caption":"","height":156});
															thumbnails[786562] = clik.newPhoto({"id":786562,"src":"Sculpture 35 text_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_786562.html","width":130,"caption":"","height":156});
															thumbnails[786514] = clik.newPhoto({"id":786514,"src":"Sculpture 2 text copy 21_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_786514.html","width":130,"caption":"","height":156});
															thumbnails[786545] = clik.newPhoto({"id":786545,"src":"Sculpture 51 text1_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_786545.html","width":130,"caption":"","height":156});
															thumbnails[786551] = clik.newPhoto({"id":786551,"src":"Sculpture 3 text1_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_786551.html","width":130,"caption":"","height":156});
															thumbnails[786556] = clik.newPhoto({"id":786556,"src":"Sculpture 38 text1_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_786556.html","width":130,"caption":"","height":156});
															thumbnails[786577] = clik.newPhoto({"id":786577,"src":"Sculpture 27 text1_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_786577.html","width":130,"caption":"","height":156});
															thumbnails[786631] = clik.newPhoto({"id":786631,"src":"Sculpture 37 text_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_786631.html","width":130,"caption":"","height":156});
															thumbnails[789824] = clik.newPhoto({"id":789824,"src":"Sculpture 12 text_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_789824.html","width":130,"caption":"","height":156});
															thumbnails[789828] = clik.newPhoto({"id":789828,"src":"Sculpture 53 text4_thumb.jpg","galleries_id":60584,"server_id":18,"link":"photo_789828.html","width":130,"caption":"","height":156});
															thumbnails[3776599] = clik.newPhoto({"id":3776599,"src":"post_thumb.jpg","galleries_id":230345,"server_id":18,"link":"photo_3776599.html","width":130,"caption":"","height":130});
															thumbnails[3776681] = clik.newPhoto({"id":3776681,"src":"post2_thumb.jpg","galleries_id":230345,"server_id":18,"link":"photo_3776681.html","width":130,"caption":"","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[60584] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"gallery one","link":"gallery_60584.html","maxRecords":0.0,"photoIDs":[781115.0,781119.0,781124.0,781128.0,781132.0,781161.0,781166.0,781189.0,785054.0,785058.0,785063.0,785066.0,785071.0,785082.0,785087.0,786562.0,786514.0,786545.0,786551.0,786556.0,786577.0,786631.0,789824.0,789828.0],"skipIndex":0,"section_code":"gallery","featured_images":"789824,786577,786551,786514,785087,785063,785058,785054,781166,781161,781132,781128,781124,781115","id":60584,"singleSection":false});				  						galleries[223799] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"shop ","link":"section274112.html","maxRecords":0.0,"photoIDs":[3703264.0,3665095.0,3665387.0,3669065.0,3669087.0,3669768.0,3669988.0,3669989.0,3672425.0,3672489.0,3672443.0,3672763.0,3703267.0,3703270.0,3703274.0],"skipIndex":0,"section_code":"section274112","featured_images":3703264.0,"id":223799,"singleSection":false});				  						galleries[60597] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"gallery two","link":"gallery_60597.html","maxRecords":0.0,"photoIDs":[3673095.0,3673107.0,3673111.0,3673115.0,3699631.0,3699634.0,3699638.0,3699641.0,3699645.0,3699648.0,3699650.0,3699652.0],"skipIndex":0,"section_code":"gallery","featured_images":3673095.0,"id":60597,"singleSection":false});				  						galleries[230345] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"shipping & info","link":"section281615.html","maxRecords":0.0,"photoIDs":[3776599.0,3776681.0],"skipIndex":0,"section_code":"section281615","featured_images":"3776681,3776599","id":230345,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '781115';
imageSets[2] = '3703264,3673095,781115,781124,781128,781132,781161,781166,785054,785058,785063,785087,786514,786551,786577,789824,813788,813792,813794,813795,813798,813802';
imageSets[3] = '3776681,3776599,3703274,3703270,3703267,3703264,3699652,3699650,3699648,3699645,3699641,3699638,3699634,3699631,3673115,3673111,3673107,3673095,3672763,3672489,3672443,3672425,3669989,3669988,3669768,3669087,3669065,3665387,3665095,813804,813802,813800,813798,813795,813794,813792,813788,789828,789824,786631,786577,786562,786556,786551,786545,786514,785087,785082,785071,785066';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/allygore/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/allygore/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/allygore/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/allygore/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/allygore/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/allygore/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/allygore/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/allygore/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 += 'section274112.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 && 'section274112' != '') {
					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 = 'ally gore: ' + 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>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>Buy this print online:</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="ALLYGORE">';
			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;
	}
}

			

