window.thumbnails = {};
thumbnails[7460138] = clik.newPhoto({"link":"#","caption":"'Cover Up' Performing popular hits Live in Aylesbury town centre 2007","height":99,"id":7460138,"server_id":31,"src":"Cover_Up_live_band_thumb.jpg","galleries_id":"","width":130});
thumbnails[7810834] = clik.newPhoto({"link":"#","caption":"Maria and Mark 'COVER-UP' Duo performing at an 1980's Themed private function","height":228,"id":7810834,"server_id":31,"src":"Cover_Up-1_thumb.jpg","galleries_id":"","width":130});
thumbnails[8713752] = clik.newPhoto({"link":"#","caption":"Maria-Tutor, Performer & Singer","height":110,"id":8713752,"server_id":31,"src":"AAA_Portrait1_thumb.jpg","galleries_id":"","width":130});
thumbnails[8713792] = clik.newPhoto({"link":"#","caption":"Maria-Vocal Coach, Singer and Performer","height":85,"id":8713792,"server_id":31,"src":"AAA_Wink1_thumb.jpg","galleries_id":"","width":130});
thumbnails[7810979] = clik.newPhoto({"link":"#","caption":"","height":89,"id":7810979,"server_id":31,"src":"Singing_and_performance_Workshops-3_thumb.jpg","galleries_id":"","width":130});
thumbnails[7409594] = clik.newPhoto({"link":"photo_7409594.html","caption":"A Big Voice singing lessons, music groups and live band","height":99,"id":7409594,"server_id":31,"src":"A_BIG_VOICE_thumb.jpg","galleries_id":401345,"width":130});
thumbnails[7460058] = clik.newPhoto({"link":"photo_7460058.html","caption":"Singing teacher","height":192,"id":7460058,"server_id":31,"src":"Maria_singing_teacher1_thumb.jpg","galleries_id":401345,"width":130});
thumbnails[7460136] = clik.newPhoto({"link":"photo_7460136.html","caption":"Maria-Studio Recording","height":118,"id":7460136,"server_id":31,"src":"Maria_professional_singer1_thumb.jpg","galleries_id":401345,"width":130});
thumbnails[7474448] = clik.newPhoto({"link":"photo_7474448.html","caption":"Private singing lessons","height":98,"id":7474448,"server_id":31,"src":"Teaching-in-Schools_thumb.jpg","galleries_id":401345,"width":130});
thumbnails[7474451] = clik.newPhoto({"link":"photo_7474451.html","caption":"Maria-Pre show studio rehearsals","height":87,"id":7474451,"server_id":31,"src":"Studio-recording-Me_thumb.jpg","galleries_id":401345,"width":130});
thumbnails[8713766] = clik.newPhoto({"link":"photo_8713766.html","caption":"","height":79,"id":8713766,"server_id":31,"src":"AAA_Reflection_thumb.jpg","galleries_id":401345,"width":130});
thumbnails[7936679] = clik.newPhoto({"link":"photo_7936679.html","caption":"Tunes for Tiddlers (&Toddlers)","height":187,"id":7936679,"server_id":31,"src":"STA60226_-_Copy_thumb.JPG","galleries_id":421657,"width":130});
thumbnails[8713635] = clik.newPhoto({"link":"photo_8713635.html","caption":"Maria-Singer & Performer","height":57,"id":8713635,"server_id":31,"src":"AAA_Mic_thumb.jpg","galleries_id":401345,"width":130});
thumbnails[7810839] = clik.newPhoto({"link":"photo_7810839.html","caption":"","height":85,"id":7810839,"server_id":31,"src":"Cover_Up-4_thumb.jpg","galleries_id":421662,"width":130});
thumbnails[7936739] = clik.newPhoto({"link":"photo_7936739.html","caption":"Tunes for Toddlers (&Tiddlers)","height":305,"id":7936739,"server_id":31,"src":"STA60222_thumb.JPG","galleries_id":421657,"width":130});
thumbnails[7810843] = clik.newPhoto({"link":"photo_7810843.html","caption":"","height":85,"id":7810843,"server_id":31,"src":"Cover_Up-6_thumb.jpg","galleries_id":421662,"width":130});
thumbnails[7810970] = clik.newPhoto({"link":"photo_7810970.html","caption":"","height":98,"id":7810970,"server_id":31,"src":"Childrens_Parties-1_thumb.jpg","galleries_id":421660,"width":130});
thumbnails[7810973] = clik.newPhoto({"link":"photo_7810973.html","caption":"","height":68,"id":7810973,"server_id":31,"src":"Singing_and_performance_Workshops-1_thumb.jpg","galleries_id":421660,"width":130});
thumbnails[7811023] = clik.newPhoto({"link":"photo_7811023.html","caption":"","height":179,"id":7811023,"server_id":31,"src":"Private_Tuition-4_thumb.jpg","galleries_id":421660,"width":130});
thumbnails[7811110] = clik.newPhoto({"link":"photo_7811110.html","caption":"","height":87,"id":7811110,"server_id":31,"src":"Tunes_for_Toddlers-20_thumb.jpg","galleries_id":421657,"width":130});
thumbnails[7810846] = clik.newPhoto({"link":"photo_7810846.html","caption":"","height":190,"id":7810846,"server_id":31,"src":"Cover_Up-9_thumb.jpg","galleries_id":421662,"width":130});
thumbnails[7811123] = clik.newPhoto({"link":"photo_7811123.html","caption":"","height":87,"id":7811123,"server_id":31,"src":"Tunes_for_Toddlers-9_thumb.jpg","galleries_id":421657,"width":130});
thumbnails[7936482] = clik.newPhoto({"link":"photo_7936482.html","caption":"Aylesbury Workshop","height":98,"id":7936482,"server_id":31,"src":"114_-_Copy_thumb.JPG","galleries_id":421660,"width":130});
thumbnails[7936492] = clik.newPhoto({"link":"photo_7936492.html","caption":"Hawkslade Workshop","height":80,"id":7936492,"server_id":31,"src":"071_-_Copy_thumb.JPG","galleries_id":421660,"width":130});
thumbnails[7410435] = clik.newPhoto({"link":"photo_7410435.html","caption":"Map & Directions","height":98,"id":7410435,"server_id":31,"src":"Church_Map1_thumb.jpg","galleries_id":421657,"width":130});
thumbnails[7811145] = clik.newPhoto({"link":"photo_7811145.html","caption":"","height":103,"id":7811145,"server_id":31,"src":"Childrens_Birthdays-2_thumb.jpg","galleries_id":421661,"width":130});
thumbnails[7926497] = clik.newPhoto({"link":"photo_7926497.html","caption":"Rehearsals","height":283,"id":7926497,"server_id":31,"src":"ME_at_the_wheel_-_Copy_thumb.JPG","galleries_id":421662,"width":130});
thumbnails[9141241] = clik.newPhoto({"link":"photo_9141241.html","caption":"Tunes for Toddlers SING & LEARN Session Polyanna Pre-school","height":137,"id":9141241,"server_id":31,"src":"Pollyanna_Party_1_thumb.jpeg","galleries_id":421661,"width":130});
thumbnails[9141544] = clik.newPhoto({"link":"photo_9141544.html","caption":"Train Party-Tunnels and tracks","height":98,"id":9141544,"server_id":31,"src":"train_tunnel_and_train_tracks_1_thumb.jpg","galleries_id":421661,"width":130});
thumbnails[7810840] = clik.newPhoto({"link":"photo_7810840.html","caption":"","height":137,"id":7810840,"server_id":31,"src":"Cover_Up-5_thumb.jpg","galleries_id":421662,"width":130});
thumbnails[7811111] = clik.newPhoto({"link":"photo_7811111.html","caption":"","height":98,"id":7811111,"server_id":31,"src":"Tunes_for_Toddlers-5_thumb.jpg","galleries_id":421657,"width":130});
thumbnails[9141554] = clik.newPhoto({"link":"photo_9141554.html","caption":"Happy Birthday Choo Choo. Firerocket candle & Train cake.","height":98,"id":9141554,"server_id":31,"src":"Willaims_bday_cake_firework_1_thumb.jpg","galleries_id":421661,"width":130});
thumbnails[7590091] = clik.newPhoto({"link":"photo_7590091.html","caption":"Toddler music groups","height":87,"id":7590091,"server_id":31,"src":"ABV_T4T_Toddler_Session_12_thumb.jpg","galleries_id":421657,"width":130});
thumbnails[7810845] = clik.newPhoto({"link":"photo_7810845.html","caption":"","height":98,"id":7810845,"server_id":31,"src":"Cover_Up-8_thumb.jpg","galleries_id":421662,"width":130});
thumbnails[7810980] = clik.newPhoto({"link":"photo_7810980.html","caption":"","height":98,"id":7810980,"server_id":31,"src":"Singing_and_performance_Workshops-2_thumb.jpg","galleries_id":421660,"width":130});
thumbnails[7810998] = clik.newPhoto({"link":"photo_7810998.html","caption":"Exam Opportunites","height":98,"id":7810998,"server_id":31,"src":"Private_Tuition-1_thumb.jpg","galleries_id":401345,"width":130});
thumbnails[7925493] = clik.newPhoto({"link":"photo_7925493.html","caption":"Party Time","height":98,"id":7925493,"server_id":31,"src":"My_Sat_morning_group_kids-Smiley_faces_thumb.JPG","galleries_id":421661,"width":130});
thumbnails[8045426] = clik.newPhoto({"link":"photo_8045426.html","caption":"Birthday Party Smiles","height":85,"id":8045426,"server_id":31,"src":"IMGA0127_-_Copy_thumb.JPG","galleries_id":421661,"width":130});
thumbnails[7811114] = clik.newPhoto({"link":"photo_7811114.html","caption":"Peek-a-boo","height":87,"id":7811114,"server_id":31,"src":"Tunes_for_Toddlers-1_thumb.jpg","galleries_id":421657,"width":130});
thumbnails[7810836] = clik.newPhoto({"link":"photo_7810836.html","caption":"","height":236,"id":7810836,"server_id":31,"src":"Cover_Up-2_thumb.jpg","galleries_id":421662,"width":130});
thumbnails[7810838] = clik.newPhoto({"link":"photo_7810838.html","caption":"","height":230,"id":7810838,"server_id":31,"src":"Cover_Up-3_thumb.jpg","galleries_id":421662,"width":130});
thumbnails[7810981] = clik.newPhoto({"link":"photo_7810981.html","caption":"Studio Work-Recording","height":98,"id":7810981,"server_id":31,"src":"Singing_and_performance_Workshops-4_thumb.jpg","galleries_id":401345,"width":130});
thumbnails[7936688] = clik.newPhoto({"link":"photo_7936688.html","caption":"Tunes for TODDLERS","height":237,"id":7936688,"server_id":31,"src":"STA60221_thumb.JPG","galleries_id":421657,"width":130});
thumbnails[8430045] = clik.newPhoto({"link":"photo_8430045.html","caption":"Tunes for TIDDLERS!","height":194,"id":8430045,"server_id":31,"src":"AAAAAAAAAAA_thumb.jpg","galleries_id":421657,"width":130});
thumbnails[7811120] = clik.newPhoto({"link":"photo_7811120.html","caption":"","height":87,"id":7811120,"server_id":31,"src":"Tunes_for_Toddlers-7_thumb.jpg","galleries_id":421657,"width":130});
thumbnails[7926227] = clik.newPhoto({"link":"photo_7926227.html","caption":"Pirates of Pepper Rock Show-Maria","height":135,"id":7926227,"server_id":31,"src":"Me_in_costume_-_Copy_thumb.JPG","galleries_id":421662,"width":130});
thumbnails[7474325] = clik.newPhoto({"link":"photo_7474325.html","caption":"Baby music groups","height":87,"id":7474325,"server_id":31,"src":"tunes-for-toddlers-image-1_thumb.jpg","galleries_id":421657,"width":130});
thumbnails[7926393] = clik.newPhoto({"link":"photo_7926393.html","caption":"Maria-Pirate Show","height":135,"id":7926393,"server_id":31,"src":"ME_n_Cav_I_am_sailing_-_Copy_thumb.JPG","galleries_id":421662,"width":130});
thumbnails[7925582] = clik.newPhoto({"link":"photo_7925582.html","caption":"Hemel Hempstead Workshop","height":98,"id":7925582,"server_id":31,"src":"Hemel_Hempsted_Community_Workshop_Feb08_1_thumb.jpg","galleries_id":421660,"width":130});
thumbnails[8021806] = clik.newPhoto({"link":"photo_8021806.html","caption":"Halloween-'Hubble Bubble Toil & Trouble'","height":230,"id":8021806,"server_id":31,"src":"Halloween4_thumb.JPG","galleries_id":421657,"width":130});
thumbnails[8430533] = clik.newPhoto({"link":"photo_8430533.html","caption":"","height":316,"id":8430533,"server_id":31,"src":"Halloween-Pumpkin_William_thumb.JPG","galleries_id":421657,"width":130});
thumbnails[7925618] = clik.newPhoto({"link":"photo_7925618.html","caption":"Chesham Theatre Workshop","height":72,"id":7925618,"server_id":31,"src":"Chesham_Theatre_workshop3_thumb.jpg","galleries_id":421660,"width":130});
thumbnails[8004705] = clik.newPhoto({"link":"photo_8004705.html","caption":"Halloween-Little Pumpkin","height":105,"id":8004705,"server_id":31,"src":"Halloween3_thumb.JPG","galleries_id":421657,"width":130});
thumbnails[8004681] = clik.newPhoto({"link":"photo_8004681.html","caption":"Tunes 4 Toddler Halloween Babies","height":81,"id":8004681,"server_id":31,"src":"Halloween_babies_-_Copy_thumb.JPG","galleries_id":421657,"width":130});
thumbnails[8430676] = clik.newPhoto({"link":"photo_8430676.html","caption":"Teddybears Picnic","height":61,"id":8430676,"server_id":31,"src":"Teddy_Bears_pinic_July_6th_2010_-_Copy_thumb.jpg","galleries_id":421657,"width":130});
thumbnails[7925759] = clik.newPhoto({"link":"photo_7925759.html","caption":"Chesham Theatre Workshop2","height":72,"id":7925759,"server_id":31,"src":"Chesham_Theatre_workshop1_thumb.jpg","galleries_id":421660,"width":130});
thumbnails[8430689] = clik.newPhoto({"link":"photo_8430689.html","caption":"Easter Celebrations","height":96,"id":8430689,"server_id":31,"src":"AAA_EASTER_-_Copy_thumb.JPG","galleries_id":421657,"width":130});
thumbnails[8430673] = clik.newPhoto({"link":"photo_8430673.html","caption":"Merry Christmas Everyone","height":80,"id":8430673,"server_id":31,"src":"Crimbo_T4T_09_1_-_Copy_thumb.JPG","galleries_id":421657,"width":130});
thumbnails[7474117] = clik.newPhoto({"link":"photo_7474117.html","caption":"Maria-Performer & Singer","height":92,"id":7474117,"server_id":31,"src":"70s_Cover_Singer_thumb.JPG","galleries_id":401345,"width":130});
thumbnails[7925776] = clik.newPhoto({"link":"photo_7925776.html","caption":"Theatre Workshop","height":75,"id":7925776,"server_id":31,"src":"Chesham_Theatre_workshop4_thumb.jpg","galleries_id":421660,"width":130});
thumbnails[8430690] = clik.newPhoto({"link":"photo_8430690.html","caption":"Christmas Celebrations","height":88,"id":8430690,"server_id":31,"src":"William__Poppy_-_Copy_-_Copy_thumb.jpg","galleries_id":421657,"width":130});
thumbnails[7936472] = clik.newPhoto({"link":"photo_7936472.html","caption":"Workshop Nov 08","height":66,"id":7936472,"server_id":31,"src":"014_-_Copy_thumb.JPG","galleries_id":421660,"width":130});
thumbnails[8430691] = clik.newPhoto({"link":"photo_8430691.html","caption":"Ho Ho Ho Merry Christmas","height":186,"id":8430691,"server_id":31,"src":"Crimbo_T4T_09_1_8_thumb.JPG","galleries_id":421657,"width":130});
thumbnails[9141279] = clik.newPhoto({"link":"photo_9141279.html","caption":"SING AND LEARN POLLYANNA PRESCHOOL","height":153,"id":9141279,"server_id":31,"src":"Pollyanna_Party_session_1_thumb.jpeg","galleries_id":421657,"width":130});
thumbnails[8713740] = clik.newPhoto({"link":"photo_8713740.html","caption":"","height":114,"id":8713740,"server_id":31,"src":"AAA_Siluette_thumb.jpg","galleries_id":401345,"width":130});
thumbnails[7927042] = clik.newPhoto({"link":"photo_7927042.html","caption":"Emily Davies-Awarded DISTINCTION L.C.M Exam","height":131,"id":7927042,"server_id":31,"src":"Emily_Davies_LCM_Exam_-_Copy_thumb.JPG","galleries_id":401345,"width":130});
thumbnails[7811131] = clik.newPhoto({"link":"photo_7811131.html","caption":"","height":87,"id":7811131,"server_id":31,"src":"Tunes_for_Toddlers-17_thumb.jpg","galleries_id":421657,"width":130});
thumbnails[7936792] = clik.newPhoto({"link":"photo_7936792.html","caption":"A Big Voice~Singing Canary Bird","height":185,"id":7936792,"server_id":31,"src":"STA60107_-_Copy_thumb.JPG","galleries_id":421657,"width":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
galleries[401345] = clik.newGallery({"photoIDs":[7409594,7460058,7460136,7474448,7474451,8713766,8713635,7810998,7810981,7474117,8713740,7927042],"link":"gallery_401345.html","skipIndex":0,"section_code":"gallery","id":401345,"parentGallery":"","featured_images":8713635,"maxRecords":0,"usePopups":false,"singleSection":false,"title":"PRIVATE TUITION"});galleries[421657] = clik.newGallery({"photoIDs":[7936679,7936739,7811110,7811123,7410435,7811111,7590091,7811114,7936688,8430045,7811120,7474325,8021806,8430533,8004705,8004681,8430676,8430689,8430673,8430690,8430691,9141279,7811131,7936792],"link":"gallery_421657.html","skipIndex":0,"section_code":"gallery","id":421657,"parentGallery":"","featured_images":"9141279,8430691,8430690,8430689,8430676,8430673,8430533,8430045,8021806,8004705","maxRecords":0,"usePopups":false,"singleSection":false,"title":"Tunes For Toddlers (&Tiddlers)"});galleries[421660] = clik.newGallery({"photoIDs":[7810970,7810973,7811023,7936482,7936492,7810980,7925582,7925618,7925759,7925776,7936472],"link":"gallery_421660.html","skipIndex":0,"section_code":"gallery","id":421660,"parentGallery":"","featured_images":7810973,"maxRecords":0,"usePopups":false,"singleSection":false,"title":"Singing Workshops"});galleries[421661] = clik.newGallery({"photoIDs":[7811145,9141241,9141544,9141554,7925493,8045426],"link":"gallery_421661.html","skipIndex":0,"section_code":"gallery","id":421661,"parentGallery":"","featured_images":7811145,"maxRecords":0,"usePopups":false,"singleSection":false,"title":"Children's Musical Parties"});galleries[421662] = clik.newGallery({"photoIDs":[7810839,7810843,7810846,7926497,7810840,7810845,7810836,7810838,7926227,7926393],"link":"gallery_421662.html","skipIndex":0,"section_code":"gallery","id":421662,"parentGallery":"","featured_images":7810839,"maxRecords":0,"usePopups":false,"singleSection":false,"title":"AGENCY & LIVE MUSIC"});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[3] = '7460138,7460136,7460058,7409594';
imageSets[241020] = '7590091';
imageSets[2] = '8713635,7810839,7810973,7811145';
imageSets[1] = '7409594';
imageSets[240157] = '7460136';
imageSets[240217] = '8713766,8713752,8713792,7474117';
imageSets[240222] = '7474448';
imageSets[240216] = '7460058';
imageSets[240223] = '7474451';
imageSets[241025] = '7460138,7474117';
imageSets[241016] = '7474325';
imageSets[241027] = '7460058';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/maria1/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/maria1/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/maria1/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/maria1/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/maria1/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/maria1/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/maria1/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/maria1/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 = 'www.abigvoice.co.uk: ' + 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;
	}
}

		

