window.thumbnails = {};
															thumbnails[1956932] = clik.newPhoto({"id":1956932,"src":"uw02_thumb.jpg","galleries_id":130595,"server_id":1,"link":"photo_1956932.html","width":130,"caption":"","height":87});
															thumbnails[1956968] = clik.newPhoto({"id":1956968,"src":"uw381_thumb.jpg","galleries_id":130388,"server_id":1,"link":"photo_1956968.html","width":130,"caption":"","height":94});
															thumbnails[1963193] = clik.newPhoto({"id":1963193,"src":"uw32_thumb.jpg","galleries_id":130595,"server_id":1,"link":"photo_1963193.html","width":130,"caption":"","height":111});
															thumbnails[1963201] = clik.newPhoto({"id":1963201,"src":"uw8_thumb.jpg","galleries_id":241629,"server_id":1,"link":"photo_1963201.html","width":130,"caption":"","height":94});
															thumbnails[1963202] = clik.newPhoto({"id":1963202,"src":"uw23_thumb.jpg","galleries_id":241618,"server_id":1,"link":"photo_1963202.html","width":130,"caption":"","height":136});
															thumbnails[1965172] = clik.newPhoto({"id":1965172,"src":"uw291_thumb.jpg","galleries_id":130388,"server_id":1,"link":"photo_1965172.html","width":130,"caption":"","height":134});
															thumbnails[1971031] = clik.newPhoto({"id":1971031,"src":"uw14_thumb.jpg","galleries_id":241629,"server_id":1,"link":"photo_1971031.html","width":130,"caption":"","height":112});
															thumbnails[1971056] = clik.newPhoto({"id":1971056,"src":"uw24_thumb.jpg","galleries_id":130595,"server_id":1,"link":"photo_1971056.html","width":130,"caption":"","height":130});
															thumbnails[2355847] = clik.newPhoto({"id":2355847,"src":"SC355_thumb.jpg","galleries_id":130388,"server_id":1,"link":"photo_2355847.html","width":130,"caption":"","height":208});
															thumbnails[2355867] = clik.newPhoto({"id":2355867,"src":"SC19_thumb.jpg","galleries_id":241618,"server_id":1,"link":"photo_2355867.html","width":130,"caption":"","height":199});
															thumbnails[2355889] = clik.newPhoto({"id":2355889,"src":"SC351_thumb.JPG","galleries_id":130388,"server_id":1,"link":"photo_2355889.html","width":130,"caption":"","height":78});
															thumbnails[3456214] = clik.newPhoto({"id":3456214,"src":"eremitos_thumb.JPG","galleries_id":130595,"server_id":1,"link":"photo_3456214.html","width":130,"caption":"","height":117});
															thumbnails[3995056] = clik.newPhoto({"id":3995056,"src":"2_plettet_kutling1a_thumb.jpg","galleries_id":130388,"server_id":1,"link":"photo_3995056.html","width":130,"caption":"","height":87});
															thumbnails[3995064] = clik.newPhoto({"id":3995064,"src":"2_plettet_kutling2a_thumb.jpg","galleries_id":130388,"server_id":1,"link":"photo_3995064.html","width":130,"caption":"","height":78});
															thumbnails[3995076] = clik.newPhoto({"id":3995076,"src":"Almulk3a_thumb.jpg","galleries_id":130595,"server_id":1,"link":"photo_3995076.html","width":130,"caption":"","height":122});
															thumbnails[3995079] = clik.newPhoto({"id":3995079,"src":"Blåmusling1a_thumb.jpg","galleries_id":241629,"server_id":1,"link":"photo_3995079.html","width":130,"caption":"","height":87});
															thumbnails[3995081] = clik.newPhoto({"id":3995081,"src":"caribvrag1_thumb.jpg","galleries_id":241612,"server_id":1,"link":"photo_3995081.html","width":130,"caption":"","height":166});
															thumbnails[3995094] = clik.newPhoto({"id":3995094,"src":"DSC_0116_2_thumb.jpg","galleries_id":241618,"server_id":1,"link":"photo_3995094.html","width":130,"caption":"","height":186});
															thumbnails[3995098] = clik.newPhoto({"id":3995098,"src":"DSC_0158_thumb.JPG","galleries_id":241618,"server_id":1,"link":"photo_3995098.html","width":130,"caption":"","height":163});
															thumbnails[3995102] = clik.newPhoto({"id":3995102,"src":"DSC_0161_thumb.JPG","galleries_id":241618,"server_id":1,"link":"photo_3995102.html","width":130,"caption":"","height":117});
															thumbnails[3995105] = clik.newPhoto({"id":3995105,"src":"DSC_0235_2_thumb.jpg","galleries_id":241618,"server_id":1,"link":"photo_3995105.html","width":130,"caption":"","height":93});
															thumbnails[3995119] = clik.newPhoto({"id":3995119,"src":"DSC_0251_2_thumb.jpg","galleries_id":241618,"server_id":1,"link":"photo_3995119.html","width":130,"caption":"","height":84});
															thumbnails[3995716] = clik.newPhoto({"id":3995716,"src":"øje_alm_ulk_thumb.JPG","galleries_id":130388,"server_id":1,"link":"photo_3995716.html","width":130,"caption":"","height":87});
															thumbnails[3995722] = clik.newPhoto({"id":3995722,"src":"Vrag1_thumb.JPG","galleries_id":241612,"server_id":1,"link":"photo_3995722.html","width":130,"caption":"","height":92});
															thumbnails[3995725] = clik.newPhoto({"id":3995725,"src":"spil_island_thumb.jpg","galleries_id":241612,"server_id":1,"link":"photo_3995725.html","width":130,"caption":"","height":87});
															thumbnails[3995739] = clik.newPhoto({"id":3995739,"src":"Trådsnegl2_thumb.JPG","galleries_id":241629,"server_id":1,"link":"photo_3995739.html","width":130,"caption":"","height":129});
															thumbnails[3995742] = clik.newPhoto({"id":3995742,"src":"Søstjerne_bk-svamp_thumb.JPG","galleries_id":130595,"server_id":1,"link":"photo_3995742.html","width":130,"caption":"","height":93});
															thumbnails[3995745] = clik.newPhoto({"id":3995745,"src":"Island1_thumb.jpg","galleries_id":241612,"server_id":1,"link":"photo_3995745.html","width":130,"caption":"","height":87});
															thumbnails[3995748] = clik.newPhoto({"id":3995748,"src":"m36b_thumb.jpg","galleries_id":241612,"server_id":1,"link":"photo_3995748.html","width":130,"caption":"","height":196});
															thumbnails[3995750] = clik.newPhoto({"id":3995750,"src":"island_brotrawl_thumb.jpg","galleries_id":241612,"server_id":1,"link":"photo_3995750.html","width":130,"caption":"","height":87});
															thumbnails[3995754] = clik.newPhoto({"id":3995754,"src":"M_36a_thumb.jpg","galleries_id":241612,"server_id":1,"link":"photo_3995754.html","width":130,"caption":"","height":88});
															thumbnails[3995802] = clik.newPhoto({"id":3995802,"src":"Trådsnegl51_thumb.JPG","galleries_id":241629,"server_id":1,"link":"photo_3995802.html","width":130,"caption":"","height":152});
															thumbnails[3995803] = clik.newPhoto({"id":3995803,"src":"Skrubbe1_thumb.JPG","galleries_id":130595,"server_id":1,"link":"photo_3995803.html","width":130,"caption":"","height":87});
															thumbnails[3995804] = clik.newPhoto({"id":3995804,"src":"Skrubbe2_thumb.jpg","galleries_id":130388,"server_id":1,"link":"photo_3995804.html","width":130,"caption":"","height":89});
															thumbnails[3995805] = clik.newPhoto({"id":3995805,"src":"Hindbærpolyp1_thumb.JPG","galleries_id":241629,"server_id":1,"link":"photo_3995805.html","width":130,"caption":"","height":194});
															thumbnails[3995854] = clik.newPhoto({"id":3995854,"src":"Nøgensnegl1_thumb.JPG","galleries_id":241629,"server_id":1,"link":"photo_3995854.html","width":130,"caption":"","height":97});
															thumbnails[3995859] = clik.newPhoto({"id":3995859,"src":"overfladedykker_thumb.JPG","galleries_id":130388,"server_id":1,"link":"photo_3995859.html","width":130,"caption":"","height":88});
															thumbnails[3995864] = clik.newPhoto({"id":3995864,"src":"Stankelbenskrabbe_thumb.JPG","galleries_id":241629,"server_id":1,"link":"photo_3995864.html","width":130,"caption":"","height":87});
															thumbnails[3995872] = clik.newPhoto({"id":3995872,"src":"Strandkrabbe2_thumb.JPG","galleries_id":241629,"server_id":1,"link":"photo_3995872.html","width":130,"caption":"","height":117});
															thumbnails[4034495] = clik.newPhoto({"id":4034495,"src":"Panserulk_a_thumb.jpg","galleries_id":241629,"server_id":1,"link":"photo_4034495.html","width":130,"caption":"","height":109});
															thumbnails[4034559] = clik.newPhoto({"id":4034559,"src":"Panserulk21_thumb.JPG","galleries_id":241629,"server_id":1,"link":"photo_4034559.html","width":130,"caption":"","height":89});
															thumbnails[4854641] = clik.newPhoto({"id":4854641,"src":"0474_thumb.jpg","galleries_id":130388,"server_id":1,"link":"photo_4854641.html","width":130,"caption":"","height":100});
															thumbnails[4854645] = clik.newPhoto({"id":4854645,"src":"DSC_0012_thumb.JPG","galleries_id":241612,"server_id":1,"link":"photo_4854645.html","width":130,"caption":"","height":163});
															thumbnails[4854647] = clik.newPhoto({"id":4854647,"src":"DSC_0012_2_thumb.jpg","galleries_id":241629,"server_id":1,"link":"photo_4854647.html","width":130,"caption":"","height":89});
															thumbnails[4854650] = clik.newPhoto({"id":4854650,"src":"DSC_0015_thumb.JPG","galleries_id":241629,"server_id":1,"link":"photo_4854650.html","width":130,"caption":"","height":104});
															thumbnails[4854651] = clik.newPhoto({"id":4854651,"src":"DSC_0045_thumb.JPG","galleries_id":241612,"server_id":1,"link":"photo_4854651.html","width":130,"caption":"","height":83});
															thumbnails[4854654] = clik.newPhoto({"id":4854654,"src":"DSC_0066_thumb.JPG","galleries_id":130595,"server_id":1,"link":"photo_4854654.html","width":130,"caption":"","height":84});
															thumbnails[4854658] = clik.newPhoto({"id":4854658,"src":"DSC_0080_thumb.jpg","galleries_id":241612,"server_id":1,"link":"photo_4854658.html","width":130,"caption":"","height":90});
															thumbnails[4854660] = clik.newPhoto({"id":4854660,"src":"DSC_01611_thumb.JPG","galleries_id":241618,"server_id":1,"link":"photo_4854660.html","width":130,"caption":"","height":122});
															thumbnails[4854663] = clik.newPhoto({"id":4854663,"src":"DSC_0422_thumb.JPG","galleries_id":241629,"server_id":1,"link":"photo_4854663.html","width":130,"caption":"","height":87});
															thumbnails[4854666] = clik.newPhoto({"id":4854666,"src":"reef0094_2_thumb.jpg","galleries_id":241618,"server_id":1,"link":"photo_4854666.html","width":130,"caption":"","height":194});
															thumbnails[4854667] = clik.newPhoto({"id":4854667,"src":"Ray557_thumb.jpg","galleries_id":241618,"server_id":1,"link":"photo_4854667.html","width":130,"caption":"","height":74});
															thumbnails[4854668] = clik.newPhoto({"id":4854668,"src":"seattle0016_2_thumb.jpg","galleries_id":241612,"server_id":1,"link":"photo_4854668.html","width":130,"caption":"","height":195});
															thumbnails[5349052] = clik.newPhoto({"id":5349052,"src":"coryp4_thumb.JPG","galleries_id":241629,"server_id":1,"link":"photo_5349052.html","width":130,"caption":"","height":100});
															thumbnails[5349066] = clik.newPhoto({"id":5349066,"src":"ulk5_thumb.JPG","galleries_id":130388,"server_id":1,"link":"photo_5349066.html","width":130,"caption":"","height":87});
															thumbnails[5349074] = clik.newPhoto({"id":5349074,"src":"søane4_thumb.JPG","galleries_id":241629,"server_id":1,"link":"photo_5349074.html","width":130,"caption":"","height":98});
															thumbnails[5349078] = clik.newPhoto({"id":5349078,"src":"skeletkrebs4_thumb.JPG","galleries_id":241629,"server_id":1,"link":"photo_5349078.html","width":130,"caption":"","height":101});
															thumbnails[5362164] = clik.newPhoto({"id":5362164,"src":"manatee1_thumb.jpg","galleries_id":130388,"server_id":1,"link":"photo_5362164.html","width":130,"caption":"","height":100});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[241618] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Blue water","link":"gallery_241618.html","maxRecords":0.0,"photoIDs":[1963202.0,2355867.0,3995094.0,3995098.0,3995102.0,3995105.0,3995119.0,4854660.0,4854666.0,4854667.0],"skipIndex":0,"section_code":"gallery","featured_images":"4854667,4854666,4854660,3995119,3995105,3995102,3995098,3995094,2355867,1963202","id":241618,"singleSection":false});				  						galleries[241629] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Makro","link":"gallery_241629.html","maxRecords":0.0,"photoIDs":[1963201.0,1971031.0,3995079.0,3995739.0,3995802.0,3995805.0,3995854.0,3995864.0,3995872.0,4034495.0,4034559.0,4854647.0,4854650.0,4854663.0,5349052.0,5349074.0,5349078.0],"skipIndex":0,"section_code":"gallery","featured_images":"5349078,5349074,5349052,4854663,4854650,4854647,4034559,4034495,3995872,3995864","id":241629,"singleSection":false});				  						galleries[241612] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wrecks","link":"gallery_241612.html","maxRecords":0.0,"photoIDs":[3995081.0,3995722.0,3995725.0,3995745.0,3995748.0,3995750.0,3995754.0,4854645.0,4854651.0,4854658.0,4854668.0],"skipIndex":0,"section_code":"gallery","featured_images":"4854668,4854658,4854651,4854645,3995754,3995750,3995748,3995745,3995725,3995722","id":241612,"singleSection":false});				  						galleries[130388] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 1","link":"gallery_130388.html","maxRecords":0.0,"photoIDs":[1956968.0,1965172.0,2355847.0,2355889.0,3995056.0,3995064.0,3995716.0,3995804.0,3995859.0,4854641.0,5349066.0,5362164.0],"skipIndex":0,"section_code":"gallery","featured_images":"5362164,5349066,4854641,3995859,3995804,3995716,3995064,3995056,2355889,2355847","id":130388,"singleSection":false});				  						galleries[130595] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 2","link":"gallery_130595.html","maxRecords":0.0,"photoIDs":[1956932.0,1963193.0,1971056.0,3456214.0,3995076.0,3995742.0,3995803.0,4854654.0],"skipIndex":0,"section_code":"gallery","featured_images":"4854654,3995803,3995742,3995076,3456214,1971056,1963193,1956932","id":130595,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '1963193';
imageSets[3] = '5362164,5349078,5349074,5349066,5349052,4854668,4854667,4854666,4854663,4854660,4854658,4854654,4854651,4854650,4854647,4854645,4854641,4034559,4034495,3995872,3995864,3995859,3995854,3995805,3995804,3995803,3995802,3995754,3995750,3995748,3995745,3995742,3995739,3995725,3995722,3995716,3995119,3995105,3995102,3995098,3995094,3995081,3995079,3995076,3995064,3995056,3456214,2355889,2355867,2355847';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/ulle/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/ulle/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/ulle/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/ulle/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/ulle/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/ulle/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/ulle/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/ulle/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 = 'ulrikwestphal.com: ' + 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;
	}
}

			

