window.thumbnails = {};
															thumbnails[5177658] = clik.newPhoto({"id":5177658,"src":"m_SQ_logo1_thumb.jpg","galleries_id":292332,"server_id":5,"link":"photo_5177658.html","width":130,"caption":"The Minogue Brothers","height":130});
															thumbnails[5178937] = clik.newPhoto({"id":5178937,"src":"m_IMG_7223_092001ee3_thumb.jpg","galleries_id":292332,"server_id":5,"link":"photo_5178937.html","width":130,"caption":"The Band","height":64});
															thumbnails[5179043] = clik.newPhoto({"id":5179043,"src":"m_Untitled-38888888_copy_thumb.jpg","galleries_id":292332,"server_id":5,"link":"photo_5179043.html","width":130,"caption":"Kyle Lee","height":104});
															thumbnails[5179076] = clik.newPhoto({"id":5179076,"src":"m_Untitled-366666666_thumb.jpg","galleries_id":292332,"server_id":5,"link":"photo_5179076.html","width":130,"caption":"Danny","height":163});
															thumbnails[5179195] = clik.newPhoto({"id":5179195,"src":"m_Untitled-1666666666_thumb.jpg","galleries_id":292332,"server_id":5,"link":"photo_5179195.html","width":130,"caption":"Uncle Cam","height":163});
															thumbnails[5177108] = clik.newPhoto({"id":5177108,"src":"m_Minogues_BBC1_thumb.jpg","galleries_id":292333,"server_id":5,"link":"photo_5177108.html","width":130,"caption":"The Minogue Brothers, LIVE!","height":81});
															thumbnails[5177105] = clik.newPhoto({"id":5177105,"src":"m_Minogues_5_thumb.jpg","galleries_id":292333,"server_id":5,"link":"photo_5177105.html","width":130,"caption":"Minogue Brothers, who else?","height":101});
															thumbnails[5177110] = clik.newPhoto({"id":5177110,"src":"m_Minogues_Glasgow1_thumb.jpg","galleries_id":292333,"server_id":5,"link":"photo_5177110.html","width":130,"caption":"Minoguean Rhapsody","height":87});
															thumbnails[5177103] = clik.newPhoto({"id":5177103,"src":"m_Minogues_4_thumb.jpg","galleries_id":292333,"server_id":5,"link":"photo_5177103.html","width":130,"caption":"Kyle Lee","height":190});
															thumbnails[6790068] = clik.newPhoto({"id":6790068,"src":"m_IMG_3159e_thumb.jpg","galleries_id":369308,"server_id":5,"link":"photo_6790068.html","width":130,"caption":"","height":62});
															thumbnails[6790067] = clik.newPhoto({"id":6790067,"src":"m_IMG_3155e_thumb.jpg","galleries_id":369308,"server_id":5,"link":"photo_6790067.html","width":130,"caption":"","height":83});
															thumbnails[6790065] = clik.newPhoto({"id":6790065,"src":"m_IMG_3129e_thumb.jpg","galleries_id":369308,"server_id":5,"link":"photo_6790065.html","width":130,"caption":"","height":76});
															thumbnails[5179025] = clik.newPhoto({"id":5179025,"src":"m_IMG_7361_230e001ggg_thumb.jpg","galleries_id":292333,"server_id":5,"link":"photo_5179025.html","width":130,"caption":"Live on stage!","height":171});
															thumbnails[5177102] = clik.newPhoto({"id":5177102,"src":"m_Minogue_6_thumb.jpg","galleries_id":292333,"server_id":5,"link":"photo_5177102.html","width":130,"caption":"Uncle Cam and Danny","height":125});
															thumbnails[5177107] = clik.newPhoto({"id":5177107,"src":"m_moon_minogues_thumb.jpg","galleries_id":292333,"server_id":5,"link":"photo_5177107.html","width":130,"caption":"Minogues?  It'd be MADNESS not to!","height":171});
															thumbnails[5178951] = clik.newPhoto({"id":5178951,"src":"m_IMG_7246_115001_thumb.jpg","galleries_id":292333,"server_id":5,"link":"photo_5178951.html","width":130,"caption":"The Band.","height":167});
															thumbnails[5179037] = clik.newPhoto({"id":5179037,"src":"m_IMG_7267_136001fff_thumb.jpg","galleries_id":292333,"server_id":5,"link":"photo_5179037.html","width":130,"caption":"Kyle Lee","height":195});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[369308] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Stirling Wedding Show Sept 2010","link":"gallery_369308.html","maxRecords":0.0,"photoIDs":[6790068.0,6790067.0,6790065.0],"skipIndex":0,"section_code":"gallery","featured_images":"6790068,6790067,6790065","id":369308,"singleSection":false});				  						galleries[292332] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Minogue Brothers","link":"gallery_292332.html","maxRecords":0.0,"photoIDs":[5177658.0,5178937.0,5179043.0,5179076.0,5179195.0],"skipIndex":0,"section_code":"gallery","featured_images":5177658.0,"id":292332,"singleSection":false});				  						galleries[292333] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Music to your ears","link":"gallery_292333.html","maxRecords":0.0,"photoIDs":[5177108.0,5177105.0,5177110.0,5177103.0,5179025.0,5177102.0,5177107.0,5178951.0,5179037.0],"skipIndex":0,"section_code":"gallery","featured_images":5177107.0,"id":292333,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '5177658,5177108,5177105,5177110';
imageSets[2] = '5177658,5177107';
imageSets[3] = '6790068,6790067,6790065,5179195,5179076,5179043,5179037,5179025,5178951,5178937,5177658,5177110,5177108,5177107,5177105,5177103,5177102';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Minogue/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Minogue/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Minogue/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Minogue/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/Minogue/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/Minogue/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Minogue/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/Minogue/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 = 'Minogue Brothers: ' + 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;
	}
}

			

