window.thumbnails = {};
															thumbnails[4066187] = clik.newPhoto({"id":4066187,"src":"Scarlett_Out_of_Order_Black_Border1_thumb.jpg","galleries_id":85466,"server_id":1,"link":"photo_4066187.html","width":87,"caption":"Out of Order","height":130});
															thumbnails[4067594] = clik.newPhoto({"id":4067594,"src":"IMG_7200_Val_Cropped_Bordered_thumb.jpg","galleries_id":85702,"server_id":1,"link":"photo_4067594.html","width":130,"caption":"Valeria Implatini","height":93});
															thumbnails[4072216] = clik.newPhoto({"id":4072216,"src":"IMG_7000_Desktop_style_Bordered_thumb.jpg","galleries_id":85510,"server_id":1,"link":"photo_4072216.html","width":130,"caption":"Valeria Implatini","height":87});
															thumbnails[4072249] = clik.newPhoto({"id":4072249,"src":"Daz_Bordered_thumb.jpg","galleries_id":85510,"server_id":1,"link":"photo_4072249.html","width":87,"caption":"Demondaz","height":130});
															thumbnails[4072322] = clik.newPhoto({"id":4072322,"src":"IMG_7160_Scarlett_Bordered_thumb.jpg","galleries_id":85466,"server_id":1,"link":"photo_4072322.html","width":87,"caption":"Scarlett","height":130});
															thumbnails[4067540] = clik.newPhoto({"id":4067540,"src":"Scarlett_Nightingale1_thumb.jpg","galleries_id":85466,"server_id":1,"link":"photo_4067540.html","width":87,"caption":"Scarletts Second Shoot","height":130});
															thumbnails[4067547] = clik.newPhoto({"id":4067547,"src":"Scarlett_Nightingale21_thumb.jpg","galleries_id":85466,"server_id":1,"link":"photo_4067547.html","width":87,"caption":"A Scarlett Sunset","height":130});
															thumbnails[4066451] = clik.newPhoto({"id":4066451,"src":"Scarlett3_thumb.jpg","galleries_id":85466,"server_id":1,"link":"photo_4066451.html","width":87,"caption":"Scarletts first ever shoot! ","height":130});
															thumbnails[4066462] = clik.newPhoto({"id":4066462,"src":"Scarlett4_thumb.jpg","galleries_id":85466,"server_id":1,"link":"photo_4066462.html","width":87,"caption":"Scarlett demonstrates 'Glamorous Fashion'","height":130});
															thumbnails[4066560] = clik.newPhoto({"id":4066560,"src":"Scarlett5_thumb.jpg","galleries_id":85466,"server_id":1,"link":"photo_4066560.html","width":87,"caption":"Scarlett Promoting Eclipse Photographic for me","height":130});
															thumbnails[4076650] = clik.newPhoto({"id":4076650,"src":"Waves_thumb.jpg","galleries_id":171178,"server_id":1,"link":"photo_4076650.html","width":105,"caption":"The Waves","height":130});
															thumbnails[4074563] = clik.newPhoto({"id":4074563,"src":"Stacey11_thumb.jpg","galleries_id":85510,"server_id":1,"link":"photo_4074563.html","width":87,"caption":"Stacey Li","height":130});
															thumbnails[4074582] = clik.newPhoto({"id":4074582,"src":"Danni_New_edited-2_thumb.jpg","galleries_id":85510,"server_id":1,"link":"photo_4074582.html","width":87,"caption":"Danielle May Sheehan","height":130});
															thumbnails[4065066] = clik.newPhoto({"id":4065066,"src":"Station_Road_Brampton1_thumb.jpg","galleries_id":171178,"server_id":1,"link":"photo_4065066.html","width":130,"caption":"Station Road","height":87});
															thumbnails[4076644] = clik.newPhoto({"id":4076644,"src":"IMG_5679_edited-2_thumb.jpg","galleries_id":171178,"server_id":1,"link":"photo_4076644.html","width":87,"caption":"The Tree","height":130});
															thumbnails[4067584] = clik.newPhoto({"id":4067584,"src":"IMG_5372_Jes_Headshot_Bordered1_thumb.jpg","galleries_id":85510,"server_id":1,"link":"photo_4067584.html","width":87,"caption":"Jes Fisher","height":130});
															thumbnails[4074593] = clik.newPhoto({"id":4074593,"src":"IMG_4368_3972_edited-5_thumb.jpg","galleries_id":85510,"server_id":1,"link":"photo_4074593.html","width":87,"caption":"Kayti Garbutt","height":130});
															thumbnails[4076656] = clik.newPhoto({"id":4076656,"src":"Nadia_thumb.jpg","galleries_id":85702,"server_id":1,"link":"photo_4076656.html","width":87,"caption":"Nadia Parry","height":130});
															thumbnails[4076663] = clik.newPhoto({"id":4076663,"src":"Nadia2_thumb.jpg","galleries_id":176128,"server_id":1,"link":"photo_4076663.html","width":87,"caption":"Nadia Parry","height":130});
															thumbnails[4076664] = clik.newPhoto({"id":4076664,"src":"Nadia3_thumb.jpg","galleries_id":85702,"server_id":1,"link":"photo_4076664.html","width":87,"caption":"Nadia Parry","height":130});
															thumbnails[4076674] = clik.newPhoto({"id":4076674,"src":"Nadia4_thumb.jpg","galleries_id":176128,"server_id":1,"link":"photo_4076674.html","width":87,"caption":"Nadia Parry","height":130});
															thumbnails[4076699] = clik.newPhoto({"id":4076699,"src":"Nadia5_thumb.jpg","galleries_id":176128,"server_id":1,"link":"photo_4076699.html","width":93,"caption":"Nadia Parry","height":130});
															thumbnails[4074629] = clik.newPhoto({"id":4074629,"src":"HayleyBird_thumb.jpg","galleries_id":85510,"server_id":1,"link":"photo_4074629.html","width":87,"caption":"Hayley Bird","height":130});
															thumbnails[2912825] = clik.newPhoto({"id":2912825,"src":"Rays Resized_thumb.jpg","galleries_id":171178,"server_id":1,"link":"photo_2912825.html","width":130,"caption":"I've seen the light","height":87});
															thumbnails[2790230] = clik.newPhoto({"id":2790230,"src":"nowTHATSAmoreEditone_thumb.jpg","galleries_id":85702,"server_id":1,"link":"photo_2790230.html","width":130,"caption":"Now THAT'S Amoré","height":71});
															thumbnails[2822564] = clik.newPhoto({"id":2822564,"src":"Jynxie_Figure_Nude_Bordered_thumb.jpg","galleries_id":176128,"server_id":1,"link":"photo_2822564.html","width":87,"caption":"Jynxie Amoré","height":130});
															thumbnails[2822568] = clik.newPhoto({"id":2822568,"src":"Jynxie3_Bordered_Airbrushed_Resized1_thumb.jpg","galleries_id":85510,"server_id":1,"link":"photo_2822568.html","width":93,"caption":"Jynxie Amore","height":130});
															thumbnails[4065033] = clik.newPhoto({"id":4065033,"src":"Jynxie_Amore_Bordered_Resized1_thumb.jpg","galleries_id":176128,"server_id":1,"link":"photo_4065033.html","width":87,"caption":"Jynxie Amore","height":130});
															thumbnails[2734135] = clik.newPhoto({"id":2734135,"src":"Liesl Porcher-Meen_thumb.jpg","galleries_id":85510,"server_id":1,"link":"photo_2734135.html","width":87,"caption":"Liesl Porcher-Meen","height":130});
															thumbnails[2734084] = clik.newPhoto({"id":2734084,"src":"Bex Howes_thumb.jpg","galleries_id":85702,"server_id":1,"link":"photo_2734084.html","width":87,"caption":"Bex Howes","height":130});
															thumbnails[2718865] = clik.newPhoto({"id":2718865,"src":"RedArrowsLowestoftAirshow2008_thumb.jpg","galleries_id":171179,"server_id":1,"link":"photo_2718865.html","width":130,"caption":"Red Arrows","height":87});
															thumbnails[2728693] = clik.newPhoto({"id":2728693,"src":"RedArrowsLowestoftAirshow2008-2_thumb.jpg","galleries_id":171179,"server_id":1,"link":"photo_2728693.html","width":130,"caption":"Red Arrows Display team","height":87});
															thumbnails[2728726] = clik.newPhoto({"id":2728726,"src":"RedArrowsLowestoftAirshow2008Fireworks_thumb.jpg","galleries_id":171179,"server_id":1,"link":"photo_2728726.html","width":130,"caption":"Red Arrows pretending to be Fireworks","height":87});
															thumbnails[2912844] = clik.newPhoto({"id":2912844,"src":"Rose Silhouette bordered Resized_thumb.jpg","galleries_id":171178,"server_id":1,"link":"photo_2912844.html","width":87,"caption":"My first ever Silhouette","height":130});
															thumbnails[4064240] = clik.newPhoto({"id":4064240,"src":"Rose_thumb.jpg","galleries_id":85510,"server_id":1,"link":"photo_4064240.html","width":87,"caption":"Rose Cleave","height":130});
															thumbnails[4067585] = clik.newPhoto({"id":4067585,"src":"Rose_21_thumb.jpg","galleries_id":85702,"server_id":1,"link":"photo_4067585.html","width":87,"caption":"Rose Cleave","height":130});
															thumbnails[2730408] = clik.newPhoto({"id":2730408,"src":"Ashley_21st_may_07_400_new_background_thumb.jpg","galleries_id":85702,"server_id":1,"link":"photo_2730408.html","width":130,"caption":"Ashley Emma","height":86});
															thumbnails[2718888] = clik.newPhoto({"id":2718888,"src":"Kerri_Parker_0553_thumb.jpg","galleries_id":85702,"server_id":1,"link":"photo_2718888.html","width":87,"caption":"Kerri Parker","height":130});
															thumbnails[2718875] = clik.newPhoto({"id":2718875,"src":"Montage_edited-1_thumb.jpg","galleries_id":171178,"server_id":1,"link":"photo_2718875.html","width":65,"caption":"MotoCross Bike Art","height":130});
															thumbnails[2718885] = clik.newPhoto({"id":2718885,"src":"Maxxis77_thumb.jpg","galleries_id":171180,"server_id":1,"link":"photo_2718885.html","width":87,"caption":"Stephen Sword","height":130});
															thumbnails[2729848] = clik.newPhoto({"id":2729848,"src":"Stephen_Sword1_thumb.jpg","galleries_id":171180,"server_id":1,"link":"photo_2729848.html","width":130,"caption":"Stephen Sword Led from the front in both races","height":65});
															thumbnails[2733767] = clik.newPhoto({"id":2733767,"src":"Maxxis82_thumb.jpg","galleries_id":171180,"server_id":1,"link":"photo_2733767.html","width":130,"caption":"MX2 Class Winner Stephen Sword, Promo girls Candice Collyer (left) and Gemma Newman","height":87});
															thumbnails[4067576] = clik.newPhoto({"id":4067576,"src":"Maxxis78_thumb.jpg","galleries_id":171180,"server_id":1,"link":"photo_4067576.html","width":87,"caption":"Candice and Gemma","height":130});
															thumbnails[4067578] = clik.newPhoto({"id":4067578,"src":"Maxxis18_thumb.jpg","galleries_id":171180,"server_id":1,"link":"photo_4067578.html","width":130,"caption":"","height":87});
															thumbnails[4067579] = clik.newPhoto({"id":4067579,"src":"Maxxis23_thumb.jpg","galleries_id":171180,"server_id":1,"link":"photo_4067579.html","width":87,"caption":"","height":130});
															thumbnails[4067580] = clik.newPhoto({"id":4067580,"src":"Maxxis29_thumb.jpg","galleries_id":171180,"server_id":1,"link":"photo_4067580.html","width":130,"caption":"","height":87});
															thumbnails[4067581] = clik.newPhoto({"id":4067581,"src":"Maxxis73_thumb.jpg","galleries_id":171180,"server_id":1,"link":"photo_4067581.html","width":130,"caption":"","height":87});
															thumbnails[4076645] = clik.newPhoto({"id":4076645,"src":"Birmingham_thumb.jpg","galleries_id":171178,"server_id":1,"link":"photo_4076645.html","width":98,"caption":"Reflections","height":130});
															thumbnails[4076647] = clik.newPhoto({"id":4076647,"src":"Birmingham2_thumb.jpg","galleries_id":171178,"server_id":1,"link":"photo_4076647.html","width":130,"caption":"Birmingham","height":98});
															thumbnails[4076649] = clik.newPhoto({"id":4076649,"src":"Birmingham3_thumb.jpg","galleries_id":171178,"server_id":1,"link":"photo_4076649.html","width":98,"caption":"Floozy in the Jacuzzi","height":130});
															thumbnails[1192859] = clik.newPhoto({"id":1192859,"src":"Liesl_and_Vicky_036_thumb.jpg","galleries_id":85510,"server_id":1,"link":"photo_1192859.html","width":130,"caption":"Liesl Porcher-Meen","height":86});
															thumbnails[1192869] = clik.newPhoto({"id":1192869,"src":"Liesl_and_Vicky_063_thumb.jpg","galleries_id":85702,"server_id":1,"link":"photo_1192869.html","width":86,"caption":"Liesl Porcher-Meen - Rock Chick chic","height":130});
															thumbnails[2734152] = clik.newPhoto({"id":2734152,"src":"Liesl_aged_15_thumb.jpg","galleries_id":85510,"server_id":1,"link":"photo_2734152.html","width":130,"caption":"Liesl Porcher-Meen","height":86});
															thumbnails[1192830] = clik.newPhoto({"id":1192830,"src":"Ashley_21st_may_07_350_thumb.jpg","galleries_id":85510,"server_id":1,"link":"photo_1192830.html","width":86,"caption":"Ashley Emma","height":130});
															thumbnails[2734156] = clik.newPhoto({"id":2734156,"src":"Ashley_21st_may_07_159_airbrushed_Bordered_thumb.jpg","galleries_id":85510,"server_id":1,"link":"photo_2734156.html","width":130,"caption":"Ashley Emma","height":99});
															thumbnails[1190664] = clik.newPhoto({"id":1190664,"src":"ShooFlyDontBotherMe1.jpg","galleries_id":85506,"server_id":1,"link":"photo_1190664.html","width":130,"caption":"Shoo fly, don't bother me!","height":98});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[171178] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Art, Landscapes and Silhouettes","link":"gallery_171178.html","maxRecords":0.0,"photoIDs":[4076650.0,4065066.0,4076644.0,2912825.0,2912844.0,2718875.0,4076645.0,4076647.0,4076649.0],"skipIndex":0,"section_code":"gallery","featured_images":"4076650,4076649,4076647,4076645,4076644,4065066,2912844,2912825","id":171178,"singleSection":false});				  						galleries[85466] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Featured Model - Scarlett Nightingale","link":"gallery_85466.html","maxRecords":0.0,"photoIDs":[4066187.0,4072322.0,4067540.0,4067547.0,4066451.0,4066462.0,4066560.0],"skipIndex":0,"section_code":"gallery","featured_images":"4067547,4067540,4066560,4066462,4066451,4066187","id":85466,"singleSection":false});				  						galleries[85506] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Flora and Fauna","link":"gallery_85506.html","maxRecords":0.0,"photoIDs":[1190664.0],"skipIndex":0,"section_code":"gallery","featured_images":1190664.0,"id":85506,"singleSection":false});				  						galleries[85510] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Head Shots - Portraits","link":"gallery_85510.html","maxRecords":0.0,"photoIDs":[4072216.0,4072249.0,4074563.0,4074582.0,4067584.0,4074593.0,4074629.0,2822568.0,2734135.0,4064240.0,1192859.0,2734152.0,1192830.0,2734156.0],"skipIndex":0,"section_code":"gallery","featured_images":"4074629,4072249,4072216,4067584,4064240,2822568,2734156,2734152,2734135,1192859,1192830","id":85510,"singleSection":false});				  						galleries[171179] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Lowestoft Air Show 2008","link":"gallery_171179.html","maxRecords":0.0,"photoIDs":[2718865.0,2728693.0,2728726.0],"skipIndex":0,"section_code":"gallery","featured_images":"2728726,2728693,2718865","id":171179,"singleSection":false});				  						galleries[85702] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Modelling","link":"gallery_85702.html","maxRecords":0.0,"photoIDs":[4067594.0,4076656.0,4076664.0,2790230.0,2734084.0,4067585.0,2730408.0,2718888.0,1192869.0],"skipIndex":0,"section_code":"gallery","featured_images":"4076664,4076656,4067594,4067585,2790230,2730408,2718888,1192869","id":85702,"singleSection":false});				  						galleries[176128] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Semi Nudes & Nudes - Artistic, Glamour & Figure","link":"gallery_176128.html","maxRecords":0.0,"photoIDs":[4076663.0,4076674.0,4076699.0,2822564.0,4065033.0],"skipIndex":0,"section_code":"gallery","featured_images":"4076674,4076663,4065033","id":176128,"singleSection":false});				  						galleries[171180] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sport","link":"gallery_171180.html","maxRecords":0.0,"photoIDs":[2718885.0,2729848.0,2733767.0,4067576.0,4067578.0,4067579.0,4067580.0,4067581.0],"skipIndex":0,"section_code":"gallery","featured_images":"2733767,2729848,2718885","id":171180,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '4074629,4072249,4072216,4067594,4067585,4067584,4067547,4067540,4066451,4066187,4065066,4064240,2912844,2822568,2790230,2734156,2734152,2734135,2733767,2730408,2718888,2718885,1192869,1192859,1192830';
imageSets[2] = '4076674,4076664,4076663,4076656,4076650,4076649,4076647,4076645,4076644,4074629,4072249,4072216,4067594,4067585,4067584,4067547,4067540,4066560,4066462,4066451,4066187,4065066,4065033,4064240,2912844,2912825,2822568,2790230,2734156,2734152,2734135,2733767,2730408,2729848,2718888,2718885,1192869,1192859,1192830';
imageSets[3] = '4076699,4076674,4076664,4076663,4076656,4076650,4076649,4076647,4076645,4076644,4074629,4074593,4074582,4074563,4072322,4072249,4072216,4067594,4067585,4067584,4067581,4067580,4067579,4067578,4067576,4067547,4067540,4066560,4066462,4066451,4066187,4065066,4065033,4064240,2912844,2912825,2822568,2822564,2790230,2734156,2734152,2734135,2734084,2733767,2730408,2729848,2728726,2728693,2718888,2718885';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/EclipsePhotographic/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/EclipsePhotographic/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 = 'Eclipse Photographic Services: ' + 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;
	}
}

			

