window.thumbnails = new Object();
												thumbnails[6584951] = new thumbnail(6584951,'32723','','036Annie_thumb.jpg',130, 132,15,'photo_6584951.html');
												thumbnails[6584952] = new thumbnail(6584952,'32723','','039-egyptian-sailor_thumb.jpg',130, 195,15,'photo_6584952.html');
												thumbnails[6584953] = new thumbnail(6584953,'32723','','040Portrait---London-street-entertainer_thumb.jpg',130, 117,15,'photo_6584953.html');
												thumbnails[6584954] = new thumbnail(6584954,'32723','','044-Carnival-Girl_thumb.jpg',130, 107,15,'photo_6584954.html');
												thumbnails[6584955] = new thumbnail(6584955,'32723','','048Lou_thumb.jpg',130, 181,15,'photo_6584955.html');
												thumbnails[6584956] = new thumbnail(6584956,'32723','','049murphy_thumb.jpg',130, 87,15,'photo_6584956.html');
												thumbnails[6584957] = new thumbnail(6584957,'32723','','050cult_thumb.jpg',130, 202,15,'photo_6584957.html');
												thumbnails[6584958] = new thumbnail(6584958,'32723','','052Candid-Portrait---Where-am-I_thumb.jpg',130, 171,15,'photo_6584958.html');
												thumbnails[6584959] = new thumbnail(6584959,'32723','','053-venetian-witch_thumb.jpg',130, 198,15,'photo_6584959.html');
												thumbnails[6584960] = new thumbnail(6584960,'32723','','054-The-Blues-Singer_thumb.jpg',130, 100,15,'photo_6584960.html');
												thumbnails[6584961] = new thumbnail(6584961,'32723','','055RTRAIT-1_thumb.jpg',130, 98,15,'photo_6584961.html');
												thumbnails[6584963] = new thumbnail(6584963,'32724','','005astrantia-major_thumb.jpg',130, 130,15,'photo_6584963.html');
												thumbnails[6584964] = new thumbnail(6584964,'32724','','022-Festive-Flags_thumb.jpg',130, 98,15,'photo_6584964.html');
												thumbnails[6584966] = new thumbnail(6584966,'32724','','023venice-nights_thumb.jpg',130, 96,15,'photo_6584966.html');
												thumbnails[6584967] = new thumbnail(6584967,'32724','','026-JPM---Pictorial---Sunset-over-Sherringham-1_thumb.jpg',130, 99,15,'photo_6584967.html');
												thumbnails[6584968] = new thumbnail(6584968,'32724','','027-Pictorial---Culzean-Castle---Scotland_thumb.jpg',130, 99,15,'photo_6584968.html');
												thumbnails[6584970] = new thumbnail(6584970,'32724','','028Pictorial---One-over-the-eight_thumb.jpg',130, 101,15,'photo_6584970.html');
												thumbnails[6584973] = new thumbnail(6584973,'32724','','010Mappleton-church_thumb.jpg',130, 98,15,'photo_6584973.html');
												thumbnails[6584975] = new thumbnail(6584975,'32724','','016wlil05asg2_thumb.jpg',130, 88,15,'photo_6584975.html');
												thumbnails[6584978] = new thumbnail(6584978,'32725','','002-Marbled-White-Butterfly-Melanargia-galathea_thumb.jpg',130, 103,15,'photo_6584978.html');
												thumbnails[6584979] = new thumbnail(6584979,'32725','','004Red-Squirrel-Sciurus-vulgaris_thumb.jpg',130, 126,15,'photo_6584979.html');
												thumbnails[6584981] = new thumbnail(6584981,'32725','','007spwd03asg_thumb.jpg',130, 98,15,'photo_6584981.html');
												thumbnails[6584982] = new thumbnail(6584982,'32725','','008Magpie-Pica-pica_thumb.jpg',130, 99,15,'photo_6584982.html');
												thumbnails[6584983] = new thumbnail(6584983,'32725','','011NatHistNo1-Baby-elephant-in-Malaysia_thumb.jpg',130, 83,15,'photo_6584983.html');
												thumbnails[6584984] = new thumbnail(6584984,'32725','','012pink-dogrose_thumb.jpg',130, 132,15,'photo_6584984.html');
												thumbnails[6584985] = new thumbnail(6584985,'32725','','020Bird-of-prey_thumb.jpg',130, 111,15,'photo_6584985.html');
												thumbnails[6584986] = new thumbnail(6584986,'32725','','021crop_thumb.jpg',130, 92,15,'photo_6584986.html');
												thumbnails[6584987] = new thumbnail(6584987,'32725','','022myosoton-aquaticum_water-chickweed_thumb.jpg',130, 89,15,'photo_6584987.html');
												thumbnails[6584988] = new thumbnail(6584988,'32727','','050Glen-Nevis-canoe-race_thumb.jpg',130, 173,15,'photo_6584988.html');
												thumbnails[6584989] = new thumbnail(6584989,'32727','','051competitors-3-peaks-race-09_thumb.jpg',130, 98,15,'photo_6584989.html');
												thumbnails[6584990] = new thumbnail(6584990,'32727','','054british-juggling-convention_norwich_thumb.jpg',130, 198,15,'photo_6584990.html');
												thumbnails[6584991] = new thumbnail(6584991,'32727','','056Tug-o-War---Kettlewell-S-F-09_thumb.jpg',130, 57,15,'photo_6584991.html');
												thumbnails[6584992] = new thumbnail(6584992,'32727','','058Guiseley-music-festival-09_thumb.jpg',130, 98,15,'photo_6584992.html');
												thumbnails[6584993] = new thumbnail(6584993,'32727','','059P1100204pboat01s2_thumb.jpg',130, 98,15,'photo_6584993.html');
												thumbnails[6584995] = new thumbnail(6584995,'32727','','060for-sale_2_thumb.jpg',130, 125,15,'photo_6584995.html');
												thumbnails[6584996] = new thumbnail(6584996,'32727','','062-Performers-at-Bradford-Cultural-Olympiad-1_thumb.jpg',130, 87,15,'photo_6584996.html');
												thumbnails[6584998] = new thumbnail(6584998,'32727','','064Gargrave-show-015_thumb.jpg',130, 98,15,'photo_6584998.html');
												thumbnails[6585000] = new thumbnail(6585000,'32727','','067yachts02s2_thumb.jpg',130, 92,15,'photo_6585000.html');
												thumbnails[6585001] = new thumbnail(6585001,'32727','','068mouse-judg_bingley-show_thumb.jpg',130, 171,15,'photo_6585001.html');
												thumbnails[6585003] = new thumbnail(6585003,'32727','','072The-Penny-Plain-Theatre-Company-at-Ilkley-Summer-Festival_thumb.jpg',130, 96,15,'photo_6585003.html');
												thumbnails[6585006] = new thumbnail(6585006,'32727','','074-DM-Photo-Journalism--------End-of-the-line_thumb.jpg',130, 99,15,'photo_6585006.html');
												thumbnails[6585008] = new thumbnail(6585008,'32727','','078Friendly-contact_thumb.jpg',130, 80,15,'photo_6585008.html');
												thumbnails[6585011] = new thumbnail(6585011,'32726','','061gugenheim-bilbao_thumb.jpg',130, 146,15,'photo_6585011.html');
												thumbnails[6585012] = new thumbnail(6585012,'32726','','062RECORD-1_thumb.jpg',130, 199,15,'photo_6585012.html');
												thumbnails[6585013] = new thumbnail(6585013,'32726','','065-Record-No1-The-John-Hancock-Tower-Boston-Mass_thumb.jpg',130, 173,15,'photo_6585013.html');
												thumbnails[6585014] = new thumbnail(6585014,'32726','','067door-panel-Rochefort-en-Terre-france_thumb.jpg',130, 127,15,'photo_6585014.html');
												thumbnails[6585058] = new thumbnail(6585058,'32726','','068stglass36as2_thumb.jpg',130, 67,15,'photo_6585058.html');
												thumbnails[6585061] = new thumbnail(6585061,'32726','','069Dome-detail-Santiago-de-Campastilla_thumb.jpg',130, 124,15,'photo_6585061.html');
												thumbnails[6585063] = new thumbnail(6585063,'32726','','070lighthouse-whitby_thumb.jpg',130, 173,15,'photo_6585063.html');
												thumbnails[6585066] = new thumbnail(6585066,'32726','','072ead-water-feature-at-Chateau-Trevarez_thumb.jpg',130, 173,15,'photo_6585066.html');
												thumbnails[6585067] = new thumbnail(6585067,'32726','','075-Record---Eden-Teatro---Art-deco-Building--Lisbon_thumb.jpg',130, 99,15,'photo_6585067.html');
												thumbnails[6585068] = new thumbnail(6585068,'32726','','076doorway-head-venice_thumb.jpg',130, 189,15,'photo_6585068.html');
												thumbnails[6585070] = new thumbnail(6585070,'32726','','077Anderson-Sports-Car---Glasgow-Museum_thumb.jpg',130, 98,15,'photo_6585070.html');
												thumbnails[6585071] = new thumbnail(6585071,'32726','','079sheep_brands_settle_forge_thumb.jpg',130, 114,15,'photo_6585071.html');
												thumbnails[6585073] = new thumbnail(6585073,'32726','','080RECORD-3_thumb.jpg',130, 173,15,'photo_6585073.html');
												thumbnails[6585074] = new thumbnail(6585074,'32726','','083Mushrooms-on-dislpay--Borough-Market-London_thumb.jpg',130, 95,15,'photo_6585074.html');
												thumbnails[6585075] = new thumbnail(6585075,'32726','','084St-Marys-church-window_thumb.jpg',130, 186,15,'photo_6585075.html');
												thumbnails[6585077] = new thumbnail(6585077,'32726','','087lizard-bench-beacon-fell_thumb.jpg',130, 173,15,'photo_6585077.html');
												thumbnails[6583272] = new thumbnail(6583272,'31336','Snow in the lakes - Dale Bottom','011snow-in-lakes-dale-bottom-1_thumb.jpg',130, 98,15,'photo_6583272.html');
												thumbnails[6584736] = new thumbnail(6584736,'32728','','024JPM---Pictorial---A-Wintery-Cow-and-Calf_thumb.jpg',130, 98,15,'photo_6584736.html');
												thumbnails[6583034] = new thumbnail(6583034,'31336','Dale Bottom','3-Dale-Bottom-Cumbria_thumb.jpg',130, 73,15,'photo_6583034.html');
												thumbnails[6583031] = new thumbnail(6583031,'31336','Feather','2Feather_thumb.jpg',130, 87,15,'photo_6583031.html');
												thumbnails[6584735] = new thumbnail(6584735,'32728','','017CRUMMOCK-WATER_thumb.jpg',130, 98,15,'photo_6584735.html');
												thumbnails[6583044] = new thumbnail(6583044,'31336','Carnival Queen','043-carnival-queen-Beverly_thumb.jpg',130, 100,15,'photo_6583044.html');
												thumbnails[6584733] = new thumbnail(6584733,'32728','','014-En-route-to-Alcock-Tarn_thumb.jpg',130, 92,15,'photo_6584733.html');
												thumbnails[6583277] = new thumbnail(6583277,'31336','Red and Blue (Venice Carnival)','047red-and-blue-Venice-carnival--Scott-1_thumb.jpg',130, 173,15,'photo_6583277.html');
												thumbnails[6584731] = new thumbnail(6584731,'32728','','008PATTERDALE-FROM-PRIESTS-HOLE-CAVE_thumb.jpg',130, 98,15,'photo_6584731.html');
												thumbnails[6585084] = new thumbnail(6585084,'31336','','048-The-Chinese-Dancer-Tamsin-adj_thumb.jpg',130, 194,15,'photo_6585084.html');
												thumbnails[6583027] = new thumbnail(6583027,'31336','Stained glass window-St Oswalds Guiseley','085-Stained-Glass-Window-detail-St-Oswalds-Church--Guiseley-tamsin_thumb.jpg',130, 262,15,'photo_6583027.html');
												thumbnails[6583030] = new thumbnail(6583030,'31336','Working Graffiti Artist','1Photo-Journalism------Work-of-Graffiti-Art_thumb.jpg',130, 98,15,'photo_6583030.html');
												thumbnails[6583026] = new thumbnail(6583026,'31336','Garffiti-House wall-Loule- Portugal','066-Record-of-Graffiti-on-house-wall--Loule---Portugal-Jean_thumb.jpg',130, 99,15,'photo_6583026.html');
												thumbnails[6584722] = new thumbnail(6584722,'32728','','006Arriving_thumb.jpg',130, 77,15,'photo_6584722.html');
												thumbnails[6583035] = new thumbnail(6583035,'31336','Otley Cycle Race','3Otley-Cycle-Race_thumb.jpg',130, 195,15,'photo_6583035.html');
												thumbnails[6583032] = new thumbnail(6583032,'31336','Try','2Try_thumb.jpg',130, 87,15,'photo_6583032.html');
												thumbnails[6584721] = new thumbnail(6584721,'32728','','005-Glen-Banchor_thumb.jpg',130, 98,15,'photo_6584721.html');
												thumbnails[6583038] = new thumbnail(6583038,'31336','Down Hebden Gill','14downhebden_thumb.jpg',130, 98,15,'photo_6583038.html');
												thumbnails[6583037] = new thumbnail(6583037,'31336','Hebden Gill','2hebgj38gasb_thumb.jpg',130, 98,15,'photo_6583037.html');
												thumbnails[6584718] = new thumbnail(6584718,'32728','','004lake-district-dale-bottom_thumb.jpg',130, 43,15,'photo_6584718.html');
												thumbnails[6583036] = new thumbnail(6583036,'31336','Midland Hotel Morcambe','3midland_hotel_morecambe_thumb.jpg',130, 98,15,'photo_6583036.html');
												thumbnails[6583025] = new thumbnail(6583025,'31336','Common dart','001comdart10gas-Harry_thumb.jpg',130, 98,15,'photo_6583025.html');
												thumbnails[6584715] = new thumbnail(6584715,'32728','','001gisburn-waterfall_thumb.jpg',130, 45,15,'photo_6584715.html');
												thumbnails[6583023] = new thumbnail(6583023,'31336','Robin','014Robin-Erithacus-Rubecula-Scott_thumb.jpg',130, 93,15,'photo_6583023.html');
												thumbnails[6583018] = new thumbnail(6583018,'31336','Stag','015stag0208as-Harry_thumb.jpg',130, 98,15,'photo_6583018.html');
												thumbnails[6583269] = new thumbnail(6583269,'31336','Mayflower','086-10-Record-No2-Mayflower-Plymouth-Mass-1_thumb.jpg',130, 130,15,'photo_6583269.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[32724] = new gallery(32724,'6584975,6584973,6584970,6584968,6584967,6584966,6584964,6584963','<strong>Pictorial</strong>','gallery',[6584963,6584964,6584966,6584967,6584968,6584970,6584973,6584975],0, 0, '', 'gallery_32724.html',0,0);
				  					galleries[32728] = new gallery(32728,'6584736,6584735,6584733,6584731,6584722,6584721,6584718,6584715','<strong>Landscapes</strong>','gallery',[6584736,6584735,6584733,6584731,6584722,6584721,6584718,6584715],0, 0, '', 'gallery_32728.html',0,0);
				  					galleries[32723] = new gallery(32723,'6584961,6584960,6584959,6584958,6584957,6584956,6584955,6584954,6584953,6584952,6584951','<strong>Portraits</strong','gallery',[6584951,6584952,6584953,6584954,6584955,6584956,6584957,6584958,6584959,6584960,6584961],0, 0, '', 'gallery_32723.html',0,0);
				  					galleries[32726] = new gallery(32726,'6585077,6585075,6585074,6585073,6585071,6585070,6585068,6585067,6585066,6585063,6585061,6585058,6585014,6585013,6585012,6585011','<strong>Record</strong>','gallery',[6585011,6585012,6585013,6585014,6585058,6585061,6585063,6585066,6585067,6585068,6585070,6585071,6585073,6585074,6585075,6585077],0, 0, '', 'gallery_32726.html',0,0);
				  					galleries[32725] = new gallery(32725,'6584987,6584986,6584985,6584984,6584983,6584982,6584981,6584979,6584978','<strong>Natural History</strong>','gallery',[6584978,6584979,6584981,6584982,6584983,6584984,6584985,6584986,6584987],0, 0, '', 'gallery_32725.html',0,0);
				  					galleries[32727] = new gallery(32727,'6585008,6585006,6585003,6585001,6585000,6584998,6584996,6584995,6584993,6584992,6584991,6584990,6584989,6584988','<strong>Photo-Journalism</strong>','gallery',[6584988,6584989,6584990,6584991,6584992,6584993,6584995,6584996,6584998,6585000,6585001,6585003,6585006,6585008],0, 0, '', 'gallery_32727.html',0,0);
				  					galleries[31336] = new gallery(31336,'6585084,6583277,6583272,6583269,6583044,6583038,6583037,6583036,6583035,6583034,6583032,6583031,6583030,6583027,6583026,6583025,6583023,6583018','<strong>Competition winners</strong>','gallery',[6583272,6583034,6583031,6583044,6583277,6585084,6583027,6583030,6583026,6583035,6583032,6583038,6583037,6583036,6583025,6583023,6583018,6583269],0, 0, '', 'gallery_31336.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '6585084,6585077,6585075,6585074,6585073,6585071,6585070,6585068,6585067,6585066,6585063,6585061,6585058,6585014,6585013,6585012,6585011,6585008,6585006,6585003,6585001,6585000,6584998,6584996,6584995,6584993,6584992,6584991,6584990,6584989,6584988,6584987,6584986,6584985,6584984,6584983,6584982,6584981,6584979,6584978,6584975,6584973,6584970,6584968,6584967,6584966,6584964,6584963,6584961,6584960,6584959,6584958,6584957,6584956,6584955,6584954,6584953,6584952,6584951,6584736,6584735,6584733,6584731,6584722,6584721,6584718,6584715,6583277,6583272,6583269,6583044,6583038,6583037,6583036,6583035,6583034,6583032,6583031,6583030,6583027,6583026,6583025,6583023,6583018';
imageSets[2] = '6585084,6585077,6585075,6585074,6585073,6585071,6585070,6585068,6585067,6585066,6585063,6585061,6585058,6585014,6585013,6585012,6585011,6585008,6585006,6585003,6585001,6585000,6584998,6584996,6584995,6584993,6584992,6584991,6584990,6584989,6584988,6584987,6584986,6584985,6584984,6584983,6584982,6584981,6584979,6584978,6584975,6584973,6584970,6584968,6584967,6584966,6584964,6584963,6584961,6584960,6584959,6584958,6584957,6584956,6584955,6584954,6584953,6584952,6584951,6584736,6584735,6584733,6584731,6584722,6584721,6584718,6584715,6583277,6583272,6583269,6583044,6583038,6583037,6583036,6583035,6583034,6583032,6583031,6583030,6583027,6583026,6583025,6583023,6583018';
imageSets[3] = '6585084,6585077,6585075,6585074,6585073,6585071,6585070,6585068,6585067,6585066,6585063,6585061,6585058,6585014,6585013,6585012,6585011,6585008,6585006,6585003,6585001,6585000,6584998,6584996,6584995,6584993,6584992,6584991,6584990,6584989,6584988,6584987,6584986,6584985,6584984,6584983,6584982,6584981,6584979,6584978,6584975,6584973,6584970,6584968,6584967,6584966,6584964,6584963,6584961,6584960,6584959,6584958,6584957,6584956,6584955,6584954,6584953,6584952,6584951,6584736,6584735,6584733,6584731,6584722,6584721,6584718,6584715';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/aireboroughcameraclub/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/aireboroughcameraclub/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:'',
                    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 (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    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));		  $('body').trigger('clikUpdate');		}, op.onBefore);
      }    }
    	if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'AIREBOROUGH CAMERA CLUB-Leeds.: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));      $('body').trigger('clikUpdate');    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object' || array == undefined) {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			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').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp = temp + '<p>Order this print:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = 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 = 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({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* 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 + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

