window.thumbnails = new Object();
												thumbnails[4150866] = new thumbnail(4150866,'240537','','space_01_thumb.jpg',130, 43,15,'																			photo_4150866.html');
												thumbnails[4150867] = new thumbnail(4150867,'240537','','space_02_thumb.jpg',130, 43,15,'																			photo_4150867.html');
												thumbnails[4150870] = new thumbnail(4150870,'240537','','space_04_thumb.jpg',130, 43,15,'																			photo_4150870.html');
												thumbnails[4150873] = new thumbnail(4150873,'240537','','space_05_thumb.jpg',130, 43,15,'																			photo_4150873.html');
												thumbnails[4150874] = new thumbnail(4150874,'240537','','space_06_thumb.jpg',130, 43,15,'																			photo_4150874.html');
												thumbnails[4150876] = new thumbnail(4150876,'240537','','space_09_thumb.jpg',130, 43,15,'																			photo_4150876.html');
												thumbnails[4346250] = new thumbnail(4346250,'240537','','eeart_1_thumb.jpg',130, 130,15,'																			photo_4346250.html');
												thumbnails[4346258] = new thumbnail(4346258,'240537','','eeart_2_thumb.jpg',130, 113,15,'																			photo_4346258.html');
												thumbnails[4346263] = new thumbnail(4346263,'240537','','eeart_3_thumb.jpg',130, 130,15,'																			photo_4346263.html');
												thumbnails[4346266] = new thumbnail(4346266,'240537','','eeart_4_thumb.jpg',130, 130,15,'																			photo_4346266.html');
												thumbnails[4346271] = new thumbnail(4346271,'240537','','eeart_5_thumb.jpg',130, 130,15,'																			photo_4346271.html');
												thumbnails[4346278] = new thumbnail(4346278,'240537','','eeart_6_thumb.jpg',130, 130,15,'																			photo_4346278.html');
												thumbnails[4346290] = new thumbnail(4346290,'240536','','eearch_1_thumb.jpg',130, 104,15,'																			photo_4346290.html');
												thumbnails[4346297] = new thumbnail(4346297,'240536','','eearch_2_thumb.jpg',130, 173,15,'																			photo_4346297.html');
												thumbnails[4346300] = new thumbnail(4346300,'240536','','eearch_3_thumb.jpg',130, 173,15,'																			photo_4346300.html');
												thumbnails[4346306] = new thumbnail(4346306,'240536','','eearch_4_thumb.jpg',130, 173,15,'																			photo_4346306.html');
												thumbnails[4346312] = new thumbnail(4346312,'240536','','eearch_5_thumb.jpg',130, 98,15,'																			photo_4346312.html');
												thumbnails[4346317] = new thumbnail(4346317,'240536','','eearch_6_thumb.jpg',130, 173,15,'																			photo_4346317.html');
												thumbnails[4346320] = new thumbnail(4346320,'240536','','eearch_7_thumb.jpg',130, 173,15,'																			photo_4346320.html');
												thumbnails[4346324] = new thumbnail(4346324,'240536','','eearch_8_thumb.jpg',130, 173,15,'																			photo_4346324.html');
												thumbnails[4346328] = new thumbnail(4346328,'240536','','eearch_9_thumb.jpg',130, 98,15,'																			photo_4346328.html');
												thumbnails[4700337] = new thumbnail(4700337,'270342','','printaboveslix2_thumb.jpg',130, 47,15,'																			photo_4700337.html');
												thumbnails[4700340] = new thumbnail(4700340,'270342','','printbikeshowroom1_thumb.jpg',130, 47,15,'																			photo_4700340.html');
												thumbnails[4700343] = new thumbnail(4700343,'270342','','printbikeshowroom2_thumb.jpg',130, 47,15,'																			photo_4700343.html');
												thumbnails[4700345] = new thumbnail(4700345,'270342','','printbikeshowroom3_thumb.jpg',130, 47,15,'																			photo_4700345.html');
												thumbnails[4700346] = new thumbnail(4700346,'270342','','printbikeshowroom6_thumb.jpg',130, 47,15,'																			photo_4700346.html');
												thumbnails[4700350] = new thumbnail(4700350,'270342','','printbikeshowroom7_thumb.jpg',130, 47,15,'																			photo_4700350.html');
												thumbnails[4700351] = new thumbnail(4700351,'270342','','printcarriageworkspan_thumb.jpg',130, 71,15,'																			photo_4700351.html');
												thumbnails[4700354] = new thumbnail(4700354,'270342','','printclockwork_pan_thumb.jpg',130, 49,15,'																			photo_4700354.html');
												thumbnails[4700355] = new thumbnail(4700355,'270342','','printcrofters1_thumb.jpg',130, 49,15,'																			photo_4700355.html');
												thumbnails[4700357] = new thumbnail(4700357,'270342','','printelimstorage1_thumb.jpg',130, 55,15,'																			photo_4700357.html');
												thumbnails[4700360] = new thumbnail(4700360,'270342','','printfreeshoppan_thumb.jpg',130, 49,15,'																			photo_4700360.html');
												thumbnails[4700362] = new thumbnail(4700362,'270342','','printjamaicastpan_thumb.jpg',130, 49,15,'																			photo_4700362.html');
												thumbnails[4700364] = new thumbnail(4700364,'270342','','printwhpan2_thumb.jpg',130, 44,15,'																			photo_4700364.html');
												thumbnails[4700366] = new thumbnail(4700366,'270342','','printwhpan6_thumb.jpg',130, 44,15,'																			photo_4700366.html');
												thumbnails[4700371] = new thumbnail(4700371,'270342','','printwhpan7_thumb.jpg',130, 44,15,'																			photo_4700371.html');
												thumbnails[4700373] = new thumbnail(4700373,'270342','','printwhpan10_thumb.jpg',130, 44,15,'																			photo_4700373.html');
												thumbnails[7342041] = new thumbnail(7342041,'397379','','2562_1_thumb.jpg',130, 130,15,'																			photo_7342041.html');
												thumbnails[7341870] = new thumbnail(7341870,'397379','','_MG_3149_thumb.jpg',130, 130,15,'																			photo_7341870.html');
												thumbnails[7341871] = new thumbnail(7341871,'397379','','_MG_3373_thumb.jpg',130, 130,15,'																			photo_7341871.html');
												thumbnails[7342036] = new thumbnail(7342036,'397379','','2562_2_thumb.jpg',130, 130,15,'																			photo_7342036.html');
												thumbnails[7342055] = new thumbnail(7342055,'397379','','n42406059106_1201369_9903_thumb.jpg',130, 130,15,'																			photo_7342055.html');
												thumbnails[7341974] = new thumbnail(7341974,'397379','','_MG_3455_thumb.jpg',130, 130,15,'																			photo_7341974.html');
												thumbnails[7342045] = new thumbnail(7342045,'397379','','200907narcossist__60_thumb.jpg',130, 130,15,'																			photo_7342045.html');
												thumbnails[7341993] = new thumbnail(7341993,'397379','','2009_02_05_tectonicplates022_thumb.jpg',130, 130,15,'																			photo_7341993.html');
												thumbnails[7342053] = new thumbnail(7342053,'397379','','ee080311_33_thumb.jpg',130, 130,15,'																			photo_7342053.html');
												thumbnails[7342054] = new thumbnail(7342054,'397379','','kryptic4_thumb.jpg',130, 130,15,'																			photo_7342054.html');
												thumbnails[7342051] = new thumbnail(7342051,'397379','','200907narcossist__80_thumb.jpg',130, 130,15,'																			photo_7342051.html');
												thumbnails[7342056] = new thumbnail(7342056,'397379','','n42406059106_1201370_227_thumb.jpg',130, 130,15,'																			photo_7342056.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[397379] = new gallery(397379,'7342056,7342055,7342054,7342053,7342051,7342045,7342041,7342036,7341993,7341974','12x12 Artwork','section473217',[7342041,7341870,7341871,7342036,7342055,7341974,7342045,7341993,7342053,7342054,7342051,7342056],0, 0, '', '																																																																																																																																	section473217.html',0,1);
				  					galleries[270342] = new gallery(270342,'4700373,4700371,4700366,4700364,4700362,4700360,4700357,4700355,4700354,4700351','Stokes Croft Closed Doors','section318972',[4700337,4700340,4700343,4700345,4700346,4700350,4700351,4700354,4700355,4700357,4700360,4700362,4700364,4700366,4700371,4700373],0, 0, '', '																																																																																																																																	section318972.html',0,1);
				  					galleries[240536] = new gallery(240536,'4346328,4346324,4346320,4346317,4346312,4346306,4346300,4346297,4346290','Architecture','gallery',[4346290,4346297,4346300,4346306,4346312,4346317,4346320,4346324,4346328],0, 0, '', '																																																																																																							gallery_240536.html',0,0);
				  					galleries[240537] = new gallery(240537,'4346278,4346271,4346266,4346263,4346258,4346250,4150876,4150874,4150873,4150870','Artwork','gallery',[4150866,4150867,4150870,4150873,4150874,4150876,4346250,4346258,4346263,4346266,4346271,4346278],0, 0, '', '																																																																																																							gallery_240537.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '4150876';
imageSets[3] = '7342056,7342055,7342054,7342053,7342051,7342045,7342041,7342036,7341993,7341974,7341871,7341870,4700373,4700371,4700366,4700364,4700362,4700360,4700357,4700355,4700354,4700351,4700350,4700346,4700345,4700343,4700340,4700337,4346328,4346324,4346320,4346317,4346312,4346306,4346300,4346297,4346290,4346278,4346271,4346266,4346263,4346258,4346250,4150876,4150874,4150873,4150870,4150867,4150866';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/lizeve/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/lizeve/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/lizeve/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/lizeve/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/lizeve/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/lizeve/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/lizeve/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/lizeve/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/lizeve/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/lizeve/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/lizeve/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/lizeve/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/lizeve/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/lizeve/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/lizeve/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/lizeve/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/lizeve/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/lizeve/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/lizeve/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/lizeve/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/lizeve/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/lizeve/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));		}, 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 = 'Liz Eve : ' + 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));    }        
    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 = 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>';
	}
					
	temp = temp + this.fnGetPaymentInfo();
				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>Buy now using PayPal:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> 				&pound;' + (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="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
				
		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 + '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
	temp = temp + '	<input type="hidden" name="item_option" value="' + item_option + '">';
	temp = temp + '	<input type="hidden" name="site" value="LIZEVE">';
		temp = temp + '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp = temp + '	<input type="hidden" name="quantity" value="1">';
								temp = temp + '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
			temp = temp + '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
	temp = temp + '</form>';
		temp = temp + '<div class="clearing">&nbsp;</div>';
	temp = temp + '<div id="confirmContainer">';
	temp = temp + '<div id="paymentConfirm">Item added to cart</div>';
	temp = temp + '</div>';
			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;
	}
}

			

