window.thumbnails = {};
															thumbnails[4200778] = clik.newPhoto({"id":4200778,"src":"Summer_paint_web_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":173});
															thumbnails[4200837] = clik.newPhoto({"id":4200837,"src":"Summer_paint_2web1_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":173});
															thumbnails[4200873] = clik.newPhoto({"id":4200873,"src":"Summer_paint_3web_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":173});
															thumbnails[7405169] = clik.newPhoto({"id":7405169,"src":"part_waveweb_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"Part of Tryptych","height":173});
															thumbnails[7405193] = clik.newPhoto({"id":7405193,"src":"waveonwallweb_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"Tryptych Wave","height":98});
															thumbnails[7405261] = clik.newPhoto({"id":7405261,"src":"Waveweb_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"Tryptych Wave","height":98});
															thumbnails[4182838] = clik.newPhoto({"id":4182838,"src":"_Hotcoreweb1_thumb.jpg","galleries_id":248985,"server_id":15,"link":"photo_4182838.html","width":130,"caption":"Hot Core ","height":190});
															thumbnails[4184448] = clik.newPhoto({"id":4184448,"src":"web_Volcanic_shower_thumb.jpg","galleries_id":248985,"server_id":15,"link":"photo_4184448.html","width":130,"caption":"Volcanic Shower - SOLD","height":130});
															thumbnails[4184522] = clik.newPhoto({"id":4184522,"src":"FrancesJ-Eternal-Flame_web_thumb.jpg","galleries_id":248985,"server_id":15,"link":"photo_4184522.html","width":130,"caption":"Eternal Flame- SOLD","height":85});
															thumbnails[4185342] = clik.newPhoto({"id":4185342,"src":"Femme_fatalweb_thumb.jpg","galleries_id":248985,"server_id":15,"link":"photo_4185342.html","width":130,"caption":"Femme Fatale - SOLD","height":133});
															thumbnails[4185654] = clik.newPhoto({"id":4185654,"src":"_Flameweb_thumb.jpg","galleries_id":248985,"server_id":15,"link":"photo_4185654.html","width":130,"caption":"Flame Sold","height":98});
															thumbnails[4185701] = clik.newPhoto({"id":4185701,"src":"FrancesJSheetFlameweb_thumb.jpg","galleries_id":248985,"server_id":15,"link":"photo_4185701.html","width":130,"caption":"Volcanic SOLD ","height":131});
															thumbnails[4185730] = clik.newPhoto({"id":4185730,"src":"Frances-Jordan-Cavernweb2jpg_thumb.jpg","galleries_id":248986,"server_id":15,"link":"photo_4185730.html","width":130,"caption":"Cavern","height":120});
															thumbnails[4185744] = clik.newPhoto({"id":4185744,"src":"Drifted_Sandweb_thumb.jpg","galleries_id":248986,"server_id":15,"link":"photo_4185744.html","width":130,"caption":"Drifted Sand","height":98});
															thumbnails[4186532] = clik.newPhoto({"id":4186532,"src":"Valentine_Bouquetweb_thumb.jpg","galleries_id":248998,"server_id":15,"link":"photo_4186532.html","width":130,"caption":"Valentine's Bouquet SOLD","height":173});
															thumbnails[4194006] = clik.newPhoto({"id":4194006,"src":"Gateweb_thumb.jpg","galleries_id":248998,"server_id":15,"link":"photo_4194006.html","width":130,"caption":"Beyond the garden gate    Sold","height":173});
															thumbnails[4194008] = clik.newPhoto({"id":4194008,"src":"Rose1web_thumb.jpg","galleries_id":248998,"server_id":15,"link":"photo_4194008.html","width":130,"caption":"Summer vase Sold","height":98});
															thumbnails[4194116] = clik.newPhoto({"id":4194116,"src":"FrancesJnightfallsweb_thumb.jpg","galleries_id":248986,"server_id":15,"link":"photo_4194116.html","width":130,"caption":"Night Falls - SOLD","height":148});
															thumbnails[7405331] = clik.newPhoto({"id":7405331,"src":"Cosmicweb_thumb.jpg","galleries_id":248985,"server_id":15,"link":"photo_7405331.html","width":130,"caption":"Cosmic","height":130});
															thumbnails[7405334] = clik.newPhoto({"id":7405334,"src":"IMG_0057web_thumb.jpg","galleries_id":248985,"server_id":15,"link":"photo_7405334.html","width":130,"caption":"Hot Core (Framed)","height":217});
															thumbnails[7405339] = clik.newPhoto({"id":7405339,"src":"IMG_0072web_thumb.jpg","galleries_id":248985,"server_id":15,"link":"photo_7405339.html","width":130,"caption":"Lifeforce (Framed)","height":130});
															thumbnails[7405359] = clik.newPhoto({"id":7405359,"src":"SunSurfaceweb_thumb.jpg","galleries_id":248985,"server_id":15,"link":"photo_7405359.html","width":130,"caption":"Sun Surface (Framed)","height":141});
															thumbnails[7404696] = clik.newPhoto({"id":7404696,"src":"Loch_Linnie_painting_thumb.jpg","galleries_id":248997,"server_id":15,"link":"photo_7404696.html","width":130,"caption":"Loch Linnhie SOLD","height":96});
															thumbnails[7405069] = clik.newPhoto({"id":7405069,"src":"3_thumb.jpg","galleries_id":248997,"server_id":15,"link":"photo_7405069.html","width":130,"caption":"Out of the Blue","height":182});
															thumbnails[7405368] = clik.newPhoto({"id":7405368,"src":"Partimagetextureweb_thumb.jpg","galleries_id":248997,"server_id":15,"link":"photo_7405368.html","width":130,"caption":"Out of the Blue (section showing texture)","height":173});
															thumbnails[7405351] = clik.newPhoto({"id":7405351,"src":"IMG_0078web_thumb.jpg","galleries_id":248997,"server_id":15,"link":"photo_7405351.html","width":130,"caption":"Loch Linnhe as day becomes night","height":130});
															thumbnails[7405344] = clik.newPhoto({"id":7405344,"src":"IMG_0074web_thumb.jpg","galleries_id":248997,"server_id":15,"link":"photo_7405344.html","width":130,"caption":"Sirens (Framed)","height":159});
															thumbnails[7405118] = clik.newPhoto({"id":7405118,"src":"Splashcropped2_thumb.jpg","galleries_id":248997,"server_id":15,"link":"photo_7405118.html","width":130,"caption":"Splash","height":163});
															thumbnails[4185752] = clik.newPhoto({"id":4185752,"src":"wave1web_thumb.jpg","galleries_id":248997,"server_id":15,"link":"photo_4185752.html","width":130,"caption":"Wave Sold","height":195});
															thumbnails[4185776] = clik.newPhoto({"id":4185776,"src":"Oceandeepweb_thumb.jpg","galleries_id":248997,"server_id":15,"link":"photo_4185776.html","width":130,"caption":"Ocean deep Sold may be purchased as a Gyclee print","height":104});
															thumbnails[4185849] = clik.newPhoto({"id":4185849,"src":"Ocean-Currentweb_thumb.jpg","galleries_id":248997,"server_id":15,"link":"photo_4185849.html","width":130,"caption":"Ocean Current","height":132});
															thumbnails[4185904] = clik.newPhoto({"id":4185904,"src":"Deep_currentweb_thumb.jpg","galleries_id":248997,"server_id":15,"link":"photo_4185904.html","width":130,"caption":"Deep current - SOLD","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[248985] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 1 The Elements - Fire","link":"gallery_248985.html","maxRecords":0.0,"photoIDs":[4182838.0,4184448.0,4184522.0,4185342.0,4185654.0,4185701.0,7405331.0,7405334.0,7405339.0,7405359.0],"skipIndex":0,"section_code":"gallery","featured_images":4185342.0,"id":248985,"singleSection":false});				  						galleries[248986] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 2 The Elements - Earth","link":"gallery_248986.html","maxRecords":0.0,"photoIDs":[4185730.0,4185744.0,4194116.0],"skipIndex":0,"section_code":"gallery","featured_images":"4194116,4185744,4185730","id":248986,"singleSection":false});				  						galleries[248997] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 3 - The Elements - Water","link":"gallery_248997.html","maxRecords":0.0,"photoIDs":[7404696.0,7405069.0,7405368.0,7405351.0,7405344.0,7405118.0,4185752.0,4185776.0,4185849.0,4185904.0],"skipIndex":0,"section_code":"gallery","featured_images":7404696.0,"id":248997,"singleSection":false});				  						galleries[248998] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 4- Watercolours","link":"gallery_248998.html","maxRecords":0.0,"photoIDs":[4186532.0,4194006.0,4194008.0],"skipIndex":0,"section_code":"gallery","featured_images":"4194008,4194006,4186532","id":248998,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '4182838';
imageSets[2] = '4185342,7404696';
imageSets[3] = '7405069';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/francesj/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/francesj/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/francesj/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/francesj/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/francesj/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/francesj/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/francesj/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 && backgrounds[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 = 'Frances Jordan Artist: ' + 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.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="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		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 += '<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;
	}
}

			

