window.thumbnails = {};
															thumbnails[6914479] = clik.newPhoto({"id":6914479,"src":"iconic_soundng_cov_wishes_flattened_jpegsmall_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":136});
															thumbnails[7042771] = clik.newPhoto({"id":7042771,"src":"cov_cath_pic_for_web_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":158});
															thumbnails[7427321] = clik.newPhoto({"id":7427321,"src":"Ganeshas_Abode_of_Bliss_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"AbodeOfBliss","height":97});
															thumbnails[5314492] = clik.newPhoto({"id":5314492,"src":"PF_Venn_thumb.jpg","galleries_id":299126,"server_id":5,"link":"photo_5314492.html","width":130,"caption":"","height":52});
															thumbnails[5314493] = clik.newPhoto({"id":5314493,"src":"Sara_McCarthy_small1_thumb.jpg","galleries_id":299126,"server_id":5,"link":"photo_5314493.html","width":130,"caption":"","height":195});
															thumbnails[8377890] = clik.newPhoto({"id":8377890,"src":"test_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8377890.html","width":130,"caption":"Make Your Wish for Coventry!","height":136});
															thumbnails[8378444] = clik.newPhoto({"id":8378444,"src":"wish_1_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378444.html","width":130,"caption":"Artwork on the streets + ANNUAL RACING AROUND THE RING ROAD","height":136});
															thumbnails[8378449] = clik.newPhoto({"id":8378449,"src":"wish_2_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378449.html","width":130,"caption":"A greater connection to nature - too much concrete suffocates the city - makes people depressed.","height":136});
															thumbnails[8378458] = clik.newPhoto({"id":8378458,"src":"wish_3_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378458.html","width":130,"caption":"More colour and a sense of wisdom for its people","height":136});
															thumbnails[8378459] = clik.newPhoto({"id":8378459,"src":"wish_4_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378459.html","width":130,"caption":"A greater sense of integration - many cultures one race but where and how can we get to know each other better?","height":136});
															thumbnails[8378466] = clik.newPhoto({"id":8378466,"src":"wish_5_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378466.html","width":130,"caption":"That Coventry will become a more beautiful City where the spirit of the people can continue to thrive, develop nurture and be creative and productive","height":136});
															thumbnails[8378681] = clik.newPhoto({"id":8378681,"src":"wish_6_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378681.html","width":130,"caption":"I wish there was a decent vegetarian cafe that supported a greater sense of community","height":136});
															thumbnails[8378689] = clik.newPhoto({"id":8378689,"src":"wish_7_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378689.html","width":130,"caption":"Coventry's Peoples So Nice And Nice City. I think this Will be Still Same Forever AND This good is We Need Make Peace in Coventry With Coventry Sounding every Year","height":136});
															thumbnails[8378690] = clik.newPhoto({"id":8378690,"src":"wish_8_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378690.html","width":130,"caption":"I wish Coventry had a decent record shop","height":136});
															thumbnails[8378734] = clik.newPhoto({"id":8378734,"src":"wish_9_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378734.html","width":130,"caption":"OUTSIDE MUSIC VENUE More fun things to do.","height":136});
															thumbnails[8378835] = clik.newPhoto({"id":8378835,"src":"wish_10_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378835.html","width":130,"caption":"An energising modern place to be where creativity is in abundance","height":136});
															thumbnails[8378870] = clik.newPhoto({"id":8378870,"src":"wish_12_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378870.html","width":130,"caption":"PEACE HAPPINESS & TRANQUILITY FOR SELF\/FAMILY + COVENTRY. MAKE COVENTRY A BETTER PLACE TO BE.","height":136});
															thumbnails[8378872] = clik.newPhoto({"id":8378872,"src":"wish_13_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378872.html","width":130,"caption":"COV BE A COOL PLACE TO BE","height":136});
															thumbnails[8378904] = clik.newPhoto({"id":8378904,"src":"wish_14_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378904.html","width":130,"caption":"I Wish there were more friendly dogs on the streets of Coventry","height":136});
															thumbnails[8378931] = clik.newPhoto({"id":8378931,"src":"wish_15_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378931.html","width":130,"caption":"I wish that people here were more friendly - I wish Cov was happyer place.","height":136});
															thumbnails[8378934] = clik.newPhoto({"id":8378934,"src":"wish_16_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378934.html","width":130,"caption":"HOPE, LOVE Light Tranquility + Peace to Coventry and beyond","height":136});
															thumbnails[8378935] = clik.newPhoto({"id":8378935,"src":"wish_17_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378935.html","width":130,"caption":"LOVE & PEACE","height":136});
															thumbnails[8378937] = clik.newPhoto({"id":8378937,"src":"wish_18_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378937.html","width":130,"caption":"PEACE LOVE HAPPINESS","height":136});
															thumbnails[8378939] = clik.newPhoto({"id":8378939,"src":"wish_19_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378939.html","width":130,"caption":"Respect For Other Peoples Views + Wishes","height":136});
															thumbnails[8378944] = clik.newPhoto({"id":8378944,"src":"wish_20_thumb.jpg","galleries_id":444491,"server_id":5,"link":"photo_8378944.html","width":130,"caption":"Love & Light XXX TO AWAKEN LAWRENCE + SHARN XXX","height":136});
															thumbnails[8624351] = clik.newPhoto({"id":8624351,"src":"Instruments_thumb.jpg","galleries_id":455724,"server_id":5,"link":"photo_8624351.html","width":130,"caption":"","height":88});
															thumbnails[8624355] = clik.newPhoto({"id":8624355,"src":"Week_2_joss_mike1_thumb.jpg","galleries_id":455724,"server_id":5,"link":"photo_8624355.html","width":130,"caption":"","height":109});
															thumbnails[8624358] = clik.newPhoto({"id":8624358,"src":"Week_2_mike1_thumb.jpg","galleries_id":455724,"server_id":5,"link":"photo_8624358.html","width":130,"caption":"","height":109});
															thumbnails[8624359] = clik.newPhoto({"id":8624359,"src":"Week_21_thumb.jpg","galleries_id":455724,"server_id":5,"link":"photo_8624359.html","width":130,"caption":"","height":91});
															thumbnails[8624361] = clik.newPhoto({"id":8624361,"src":"Week_4_Di_and_Mosesley1_thumb.jpg","galleries_id":455724,"server_id":5,"link":"photo_8624361.html","width":130,"caption":"","height":95});
															thumbnails[8624362] = clik.newPhoto({"id":8624362,"src":"Week_5_stringd1_thumb.jpg","galleries_id":455724,"server_id":5,"link":"photo_8624362.html","width":130,"caption":"","height":81});
															thumbnails[8624369] = clik.newPhoto({"id":8624369,"src":"Week_51_thumb.jpg","galleries_id":455724,"server_id":5,"link":"photo_8624369.html","width":130,"caption":"","height":101});
															thumbnails[8624609] = clik.newPhoto({"id":8624609,"src":"Week_1_smaller_thumb.jpg","galleries_id":455724,"server_id":5,"link":"photo_8624609.html","width":130,"caption":"","height":333});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[455724] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sounding Cov Rehearsals 2011","link":"gallery_455724.html","maxRecords":0.0,"photoIDs":[8624351.0,8624355.0,8624358.0,8624359.0,8624361.0,8624362.0,8624369.0,8624609.0],"skipIndex":0,"section_code":"gallery","featured_images":"8624609,8624369,8624362,8624361,8624359,8624358,8624355,8624351","id":455724,"singleSection":false});				  						galleries[444491] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sounding Cov Wishes 2010","link":"gallery_444491.html","maxRecords":0.0,"photoIDs":[8377890.0,8378444.0,8378449.0,8378458.0,8378459.0,8378466.0,8378681.0,8378689.0,8378690.0,8378734.0,8378835.0,8378870.0,8378872.0,8378904.0,8378931.0,8378934.0,8378935.0,8378937.0,8378939.0,8378944.0],"skipIndex":0,"section_code":"gallery","featured_images":"8378944,8378939,8378937,8378935,8378934,8378931,8378904,8378872,8378870,8378835","id":444491,"singleSection":false});				  						galleries[299126] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 1","link":"gallery_299126.html","maxRecords":0.0,"photoIDs":[5314492.0,5314493.0],"skipIndex":0,"section_code":"gallery","featured_images":"5314493,5314492","id":299126,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8377890,5314492';
imageSets[2] = '5314493,5314492';
imageSets[3] = '5314493,5314492';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/mccarthyblues/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/mccarthyblues/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 = 'Performance Frequency: ' + 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;
	}
}

			

