window.thumbnails = {};
															thumbnails[1471364] = clik.newPhoto({"id":1471364,"src":"montage_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":98});
															thumbnails[1471800] = clik.newPhoto({"id":1471800,"src":"Black_white_model_photography_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":173});
															thumbnails[1471832] = clik.newPhoto({"id":1471832,"src":"model_portfolio_black_white_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":163});
															thumbnails[1469895] = clik.newPhoto({"id":1469895,"src":"Cool-teenagers_thumb.jpg","galleries_id":101303,"server_id":15,"link":"photo_1469895.html","width":130,"caption":"Cool Teenagers","height":162});
															thumbnails[1469566] = clik.newPhoto({"id":1469566,"src":"Natural_Portraits_children_thumb.jpg","galleries_id":101303,"server_id":15,"link":"photo_1469566.html","width":130,"caption":"Natural Portraits","height":130});
															thumbnails[1469892] = clik.newPhoto({"id":1469892,"src":"cheeky_children_thumb.jpg","galleries_id":101303,"server_id":15,"link":"photo_1469892.html","width":130,"caption":"Cheeky children","height":85});
															thumbnails[1469915] = clik.newPhoto({"id":1469915,"src":"crazy_gang_thumb.jpg","galleries_id":101303,"server_id":15,"link":"photo_1469915.html","width":130,"caption":"Crazy Gang","height":163});
															thumbnails[1469916] = clik.newPhoto({"id":1469916,"src":"fun_kids_thumb.jpg","galleries_id":101303,"server_id":15,"link":"photo_1469916.html","width":130,"caption":"Fun Kids","height":130});
															thumbnails[1469917] = clik.newPhoto({"id":1469917,"src":"happy _families_thumb.jpg","galleries_id":101303,"server_id":15,"link":"photo_1469917.html","width":130,"caption":"Happy Families","height":104});
															thumbnails[1469927] = clik.newPhoto({"id":1469927,"src":"Natural_portraits_thumb.jpg","galleries_id":101303,"server_id":15,"link":"photo_1469927.html","width":130,"caption":"Black & White<br>\r\n","height":195});
															thumbnails[1471596] = clik.newPhoto({"id":1471596,"src":"Danceing sisters_thumb.jpg","galleries_id":101303,"server_id":15,"link":"photo_1471596.html","width":130,"caption":"Dancing Sisters","height":180});
															thumbnails[1471590] = clik.newPhoto({"id":1471590,"src":"Princess_thumb.jpg","galleries_id":101303,"server_id":15,"link":"photo_1471590.html","width":130,"caption":"Princess","height":130});
															thumbnails[1469922] = clik.newPhoto({"id":1469922,"src":"laughing_sisters_thumb.jpg","galleries_id":101303,"server_id":15,"link":"photo_1469922.html","width":130,"caption":"laughing sisters","height":186});
															thumbnails[1469924] = clik.newPhoto({"id":1469924,"src":"model_girls_thumb.jpg","galleries_id":101303,"server_id":15,"link":"photo_1469924.html","width":130,"caption":"Models Girls","height":172});
															thumbnails[1469923] = clik.newPhoto({"id":1469923,"src":"Miss-poser_thumb.jpg","galleries_id":101303,"server_id":15,"link":"photo_1469923.html","width":130,"caption":"Miss Poser","height":162});
															thumbnails[1471804] = clik.newPhoto({"id":1471804,"src":"cowgirl_model_thumb.jpg","galleries_id":101441,"server_id":15,"link":"photo_1471804.html","width":130,"caption":"","height":196});
															thumbnails[1471807] = clik.newPhoto({"id":1471807,"src":"model_bourdoir_thumb.jpg","galleries_id":101441,"server_id":15,"link":"photo_1471807.html","width":130,"caption":"","height":195});
															thumbnails[1471838] = clik.newPhoto({"id":1471838,"src":"red_nightdress_thumb.jpg","galleries_id":101441,"server_id":15,"link":"photo_1471838.html","width":130,"caption":"","height":187});
															thumbnails[1471829] = clik.newPhoto({"id":1471829,"src":"model_pink_dress_thumb.jpg","galleries_id":101441,"server_id":15,"link":"photo_1471829.html","width":130,"caption":"","height":179});
															thumbnails[1471844] = clik.newPhoto({"id":1471844,"src":"Gold_floor_thumb_FCD3F755-24E8-5EC4-4FDB9C62F2EFAE60.jpg","galleries_id":101441,"server_id":15,"link":"photo_1471844.html","width":130,"caption":"","height":195});
															thumbnails[1471840] = clik.newPhoto({"id":1471840,"src":"style_thumb.jpg","galleries_id":101441,"server_id":15,"link":"photo_1471840.html","width":130,"caption":"","height":179});
															thumbnails[1471837] = clik.newPhoto({"id":1471837,"src":"red_dressed-model_thumb.jpg","galleries_id":101441,"server_id":15,"link":"photo_1471837.html","width":130,"caption":"","height":311});
															thumbnails[1471835] = clik.newPhoto({"id":1471835,"src":"model-poser_thumb.jpg","galleries_id":101441,"server_id":15,"link":"photo_1471835.html","width":130,"caption":"","height":260});
															thumbnails[1471839] = clik.newPhoto({"id":1471839,"src":"Wihte_topped_model_thumb.jpg","galleries_id":101441,"server_id":15,"link":"photo_1471839.html","width":130,"caption":"","height":241});
															thumbnails[1472502] = clik.newPhoto({"id":1472502,"src":"bride_bridesmaid_thumb.jpg","galleries_id":101531,"server_id":15,"link":"photo_1472502.html","width":130,"caption":"","height":163});
															thumbnails[1472507] = clik.newPhoto({"id":1472507,"src":"Bride_groom_sunset1_thumb.jpg","galleries_id":101531,"server_id":15,"link":"photo_1472507.html","width":130,"caption":"","height":163});
															thumbnails[1472510] = clik.newPhoto({"id":1472510,"src":"cheeky_bridesmaid_thumb.jpg","galleries_id":101531,"server_id":15,"link":"photo_1472510.html","width":130,"caption":"","height":163});
															thumbnails[1472511] = clik.newPhoto({"id":1472511,"src":"kissing kids_thumb.jpg","galleries_id":101531,"server_id":15,"link":"photo_1472511.html","width":130,"caption":"","height":162});
															thumbnails[1472514] = clik.newPhoto({"id":1472514,"src":"Laughing_bridesmaids_thumb.jpg","galleries_id":101531,"server_id":15,"link":"photo_1472514.html","width":130,"caption":"","height":163});
															thumbnails[1472517] = clik.newPhoto({"id":1472517,"src":"silhouette_thumb.jpg","galleries_id":101531,"server_id":15,"link":"photo_1472517.html","width":130,"caption":"","height":163});
															thumbnails[1472500] = clik.newPhoto({"id":1472500,"src":"black_white_laughing_group_thumb.jpg","galleries_id":101531,"server_id":15,"link":"photo_1472500.html","width":130,"caption":"","height":104});
															thumbnails[1472516] = clik.newPhoto({"id":1472516,"src":"running_bridesmaids_thumb.jpg","galleries_id":101531,"server_id":15,"link":"photo_1472516.html","width":130,"caption":"","height":104});
															thumbnails[1472519] = clik.newPhoto({"id":1472519,"src":"storey book_thumb.jpg","galleries_id":101531,"server_id":15,"link":"photo_1472519.html","width":130,"caption":"Story Books","height":93});
															thumbnails[1472521] = clik.newPhoto({"id":1472521,"src":"storey book 002_thumb.jpg","galleries_id":101531,"server_id":15,"link":"photo_1472521.html","width":130,"caption":"Story Books","height":93});
															thumbnails[1472520] = clik.newPhoto({"id":1472520,"src":"storey book 001_thumb.jpg","galleries_id":101531,"server_id":15,"link":"photo_1472520.html","width":130,"caption":"Story Books","height":93});
															thumbnails[1472522] = clik.newPhoto({"id":1472522,"src":"storey book 003_thumb.jpg","galleries_id":101531,"server_id":15,"link":"photo_1472522.html","width":130,"caption":"Story Books","height":93});
															thumbnails[1472523] = clik.newPhoto({"id":1472523,"src":"storey book 004_thumb.jpg","galleries_id":101531,"server_id":15,"link":"photo_1472523.html","width":130,"caption":"Double page from a story book","height":48});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[101303] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Natural Portraits","link":"gallery.html","maxRecords":0.0,"photoIDs":[1469895.0,1469566.0,1469892.0,1469915.0,1469916.0,1469917.0,1469927.0,1471596.0,1471590.0,1469922.0,1469924.0,1469923.0],"skipIndex":0,"section_code":"gallery","featured_images":"1471596,1471590,1469927,1469924,1469923,1469922,1469917,1469916,1469915,1469895","id":101303,"singleSection":false});				  						galleries[101441] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Model \/ Promotional Portfolios","link":"section135476.html","maxRecords":0.0,"photoIDs":[1471804.0,1471807.0,1471838.0,1471829.0,1471844.0,1471840.0,1471837.0,1471835.0,1471839.0],"skipIndex":0,"section_code":"section135476","featured_images":"1471844,1471840,1471839,1471838,1471837,1471835,1471829,1471807,1471804","id":101441,"singleSection":false});				  						galleries[101531] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"weddings","link":"section135629.html","maxRecords":0.0,"photoIDs":[1472502.0,1472507.0,1472510.0,1472511.0,1472514.0,1472517.0,1472500.0,1472516.0,1472519.0,1472521.0,1472520.0,1472522.0,1472523.0],"skipIndex":0,"section_code":"section135629","featured_images":"1472523,1472522,1472521,1472520,1472519,1472517,1472516,1472514,1472511,1472510","id":101531,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '1471364,1472516';
imageSets[3] = '1472523,1472522,1472521,1472520,1472519,1472517,1472516,1472514,1472511,1472510,1472507,1472502,1472500,1471844,1471840,1471839,1471838,1471837,1471835,1471832,1471829,1471807,1471804,1471800,1471596,1471590,1471364,1469927,1469924,1469923,1469922,1469917,1469916,1469915,1469895,1469892,1469566';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Kennyboy/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/Kennyboy/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 = 'kingsley studios: ' + 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;
	}
}

			

