window.thumbnails = new Object();
												thumbnails[7072729] = new thumbnail(7072729,'','','portrait1_thumb.jpg',160, 128,18,'#');
												thumbnails[7071665] = new thumbnail(7071665,'263270','','SPORT_10_thumb.JPG',160, 104,18,'photo_7071665.html');
												thumbnails[7071666] = new thumbnail(7071666,'263270','','SPORT_0812_thumb.JPG',160, 98,18,'photo_7071666.html');
												thumbnails[7071667] = new thumbnail(7071667,'263270','','SPORT_14_thumb.JPG',160, 95,18,'photo_7071667.html');
												thumbnails[7071681] = new thumbnail(7071681,'263270','','SPORT_18_thumb.JPG',160, 97,18,'photo_7071681.html');
												thumbnails[7071684] = new thumbnail(7071684,'263270','','SPORT_25_thumb.JPG',160, 107,18,'photo_7071684.html');
												thumbnails[7071686] = new thumbnail(7071686,'263270','','SPORT_27_thumb.JPG',160, 103,18,'photo_7071686.html');
												thumbnails[7071688] = new thumbnail(7071688,'263270','','SPORT_29_thumb.JPG',160, 102,18,'photo_7071688.html');
												thumbnails[7071690] = new thumbnail(7071690,'263270','','SPORT_37_thumb.JPG',160, 106,18,'photo_7071690.html');
												thumbnails[7071691] = new thumbnail(7071691,'263270','','SPORT_55_thumb.JPG',160, 103,18,'photo_7071691.html');
												thumbnails[7071695] = new thumbnail(7071695,'263270','','SPORT_58_thumb.JPG',160, 107,18,'photo_7071695.html');
												thumbnails[7071696] = new thumbnail(7071696,'263270','','SPORT_60_thumb.JPG',160, 107,18,'photo_7071696.html');
												thumbnails[7071699] = new thumbnail(7071699,'263270','','SPORT_63_thumb.JPG',160, 107,18,'photo_7071699.html');
												thumbnails[7071703] = new thumbnail(7071703,'263270','','SPORT_65_thumb.JPG',160, 105,18,'photo_7071703.html');
												thumbnails[7071704] = new thumbnail(7071704,'263270','','SPORT_68_thumb.JPG',160, 101,18,'photo_7071704.html');
												thumbnails[7071705] = new thumbnail(7071705,'263270','','SPORT_69_thumb.JPG',160, 109,18,'photo_7071705.html');
												thumbnails[7071708] = new thumbnail(7071708,'263270','','SPORT_70_thumb.JPG',160, 103,18,'photo_7071708.html');
												thumbnails[7071714] = new thumbnail(7071714,'263270','','SPORT_75_thumb.JPG',160, 101,18,'photo_7071714.html');
												thumbnails[7071717] = new thumbnail(7071717,'263270','','SPORT_121_thumb.JPG',160, 104,18,'photo_7071717.html');
												thumbnails[7071721] = new thumbnail(7071721,'263270','','SPORT_221_thumb.JPG',160, 100,18,'photo_7071721.html');
												thumbnails[7071724] = new thumbnail(7071724,'263270','','SPORT_431_thumb.JPG',160, 101,18,'photo_7071724.html');
												thumbnails[7071410] = new thumbnail(7071410,'263253','','PRESS_050_thumb.JPG',160, 107,18,'photo_7071410.html');
												thumbnails[7072450] = new thumbnail(7072450,'263254','','TRAVEL_28_thumb.JPG',160, 139,18,'photo_7072450.html');
												thumbnails[7072570] = new thumbnail(7072570,'263268','','WEDDING_102_thumb.JPG',160, 105,18,'photo_7072570.html');
												thumbnails[7071352] = new thumbnail(7071352,'263253','','PRESS_044_thumb.JPG',160, 107,18,'photo_7071352.html');
												thumbnails[7072451] = new thumbnail(7072451,'263254','','TRAVEL_29_thumb.JPG',160, 120,18,'photo_7072451.html');
												thumbnails[7072564] = new thumbnail(7072564,'263268','','WEDDING_083_thumb.JPG',160, 110,18,'photo_7072564.html');
												thumbnails[7071323] = new thumbnail(7071323,'263253','','PRESS_018_thumb.JPG',160, 107,18,'photo_7071323.html');
												thumbnails[7072459] = new thumbnail(7072459,'263254','','TRAVEL_46_thumb.JPG',160, 107,18,'photo_7072459.html');
												thumbnails[7072565] = new thumbnail(7072565,'263268','','WEDDING_098_thumb.JPG',160, 100,18,'photo_7072565.html');
												thumbnails[7071349] = new thumbnail(7071349,'263253','','PRESS_038_thumb.JPG',160, 108,18,'photo_7071349.html');
												thumbnails[7072463] = new thumbnail(7072463,'263254','','TRAVEL_51_thumb.JPG',160, 105,18,'photo_7072463.html');
												thumbnails[7072580] = new thumbnail(7072580,'263268','','WEDDING_112_thumb.JPG',160, 107,18,'photo_7072580.html');
												thumbnails[7071415] = new thumbnail(7071415,'263253','','PRESS_064_thumb.JPG',160, 243,18,'photo_7071415.html');
												thumbnails[7072525] = new thumbnail(7072525,'263254','','TRAVEL_04_thumb.JPG',160, 241,18,'photo_7072525.html');
												thumbnails[7072547] = new thumbnail(7072547,'263268','','WEDDING_0751_thumb.JPG',160, 240,18,'photo_7072547.html');
												thumbnails[7071509] = new thumbnail(7071509,'263253','','PRESS_026_thumb.JPG',160, 244,18,'photo_7071509.html');
												thumbnails[7072505] = new thumbnail(7072505,'263254','','TRAVEL_38_thumb.JPG',160, 245,18,'photo_7072505.html');
												thumbnails[7072615] = new thumbnail(7072615,'263268','','WEDDING_077_thumb.JPG',160, 246,18,'photo_7072615.html');
												thumbnails[7071320] = new thumbnail(7071320,'263253','','PRESS_010_thumb.JPG',160, 239,18,'photo_7071320.html');
												thumbnails[7072524] = new thumbnail(7072524,'263254','','TRAVEL_31_thumb.JPG',160, 240,18,'photo_7072524.html');
												thumbnails[7072602] = new thumbnail(7072602,'263268','','WEDDING_149_thumb.JPG',160, 251,18,'photo_7072602.html');
												thumbnails[7071322] = new thumbnail(7071322,'263253','','PRESS_012_thumb.JPG',160, 239,18,'photo_7071322.html');
												thumbnails[7072457] = new thumbnail(7072457,'263254','','TRAVEL_42_thumb.JPG',160, 237,18,'photo_7072457.html');
												thumbnails[7072558] = new thumbnail(7072558,'263268','','WEDDING_080_thumb.JPG',160, 240,18,'photo_7072558.html');
												thumbnails[7071316] = new thumbnail(7071316,'263253','','PRESS_003_thumb.JPG',160, 104,18,'photo_7071316.html');
												thumbnails[7072446] = new thumbnail(7072446,'263254','','TRAVEL_17_thumb.JPG',160, 107,18,'photo_7072446.html');
												thumbnails[7072567] = new thumbnail(7072567,'263268','','WEDDING_101_thumb.JPG',160, 101,18,'photo_7072567.html');
												thumbnails[7071312] = new thumbnail(7071312,'263253','','PRESS_0011_thumb.JPG',160, 104,18,'photo_7071312.html');
												thumbnails[7072465] = new thumbnail(7072465,'263254','','TRAVEL_011_thumb.JPG',160, 102,18,'photo_7072465.html');
												thumbnails[7072561] = new thumbnail(7072561,'263268','','WEDDING_082_thumb.JPG',160, 104,18,'photo_7072561.html');
												thumbnails[7071420] = new thumbnail(7071420,'263253','','PRESS_0491_thumb.JPG',160, 107,18,'photo_7071420.html');
												thumbnails[7072461] = new thumbnail(7072461,'263254','','TRAVEL_47_thumb.JPG',160, 107,18,'photo_7072461.html');
												thumbnails[7072578] = new thumbnail(7072578,'263268','','WEDDING_110_thumb.JPG',160, 107,18,'photo_7072578.html');
												thumbnails[7071305] = new thumbnail(7071305,'263253','','PRESS_002_thumb.JPG',160, 107,18,'photo_7071305.html');
												thumbnails[7072504] = new thumbnail(7072504,'263254','','TRAVEL_441_thumb.JPG',160, 113,18,'photo_7072504.html');
												thumbnails[7072590] = new thumbnail(7072590,'263268','','WEDDING_123_thumb.JPG',160, 107,18,'photo_7072590.html');
												thumbnails[7071413] = new thumbnail(7071413,'263253','','PRESS_057_thumb.JPG',160, 107,18,'photo_7071413.html');
												thumbnails[7072277] = new thumbnail(7072277,'263254','','TRAVEL_02_thumb.JPG',160, 114,18,'photo_7072277.html');
												thumbnails[7072719] = new thumbnail(7072719,'263268','','WEDDING_1351_thumb.JPG',160, 104,18,'photo_7072719.html');
												thumbnails[7071343] = new thumbnail(7071343,'263253','','PRESS_031_thumb.JPG',160, 107,18,'photo_7071343.html');
												thumbnails[7072454] = new thumbnail(7072454,'263254','','TRAVEL_37_thumb.JPG',160, 107,18,'photo_7072454.html');
												thumbnails[7072714] = new thumbnail(7072714,'263268','','WEDDING_1111_thumb.JPG',160, 107,18,'photo_7072714.html');
												thumbnails[7071416] = new thumbnail(7071416,'263253','','PRESS_067_thumb.JPG',160, 103,18,'photo_7071416.html');
												thumbnails[7072447] = new thumbnail(7072447,'263254','','TRAVEL_21_thumb.JPG',160, 110,18,'photo_7072447.html');
												thumbnails[7072587] = new thumbnail(7072587,'263268','','WEDDING_116_thumb.JPG',160, 111,18,'photo_7072587.html');
												thumbnails[7071317] = new thumbnail(7071317,'263253','','PRESS_005_thumb.JPG',160, 101,18,'photo_7071317.html');
												thumbnails[7072458] = new thumbnail(7072458,'263254','','TRAVEL_43_thumb.JPG',160, 107,18,'photo_7072458.html');
												thumbnails[7072595] = new thumbnail(7072595,'263268','','WEDDING_147_thumb.JPG',160, 107,18,'photo_7072595.html');
												thumbnails[7071328] = new thumbnail(7071328,'263253','','PRESS_020_thumb.JPG',160, 107,18,'photo_7071328.html');
												thumbnails[7072452] = new thumbnail(7072452,'263254','','TRAVEL_34_thumb.JPG',160, 102,18,'photo_7072452.html');
												thumbnails[7072571] = new thumbnail(7072571,'263268','','WEDDING_103_thumb.JPG',160, 248,18,'photo_7072571.html');
												thumbnails[7071346] = new thumbnail(7071346,'263253','','PRESS_034_thumb.JPG',160, 107,18,'photo_7071346.html');
												thumbnails[7072441] = new thumbnail(7072441,'263254','','TRAVEL_06_thumb.JPG',160, 247,18,'photo_7072441.html');
												thumbnails[7072557] = new thumbnail(7072557,'263268','','WEDDING_0781_thumb.JPG',160, 107,18,'photo_7072557.html');
												thumbnails[7071331] = new thumbnail(7071331,'263253','','PRESS_023_thumb.JPG',160, 107,18,'photo_7071331.html');
												thumbnails[7072449] = new thumbnail(7072449,'263254','','TRAVEL_26_thumb.JPG',160, 102,18,'photo_7072449.html');
												thumbnails[7072717] = new thumbnail(7072717,'263268','','WEDDING_1211_thumb.JPG',160, 107,18,'photo_7072717.html');
												thumbnails[7071412] = new thumbnail(7071412,'263253','','PRESS_054_thumb.JPG',160, 240,18,'photo_7071412.html');
												thumbnails[7072443] = new thumbnail(7072443,'263254','','TRAVEL_15_thumb.JPG',160, 213,18,'photo_7072443.html');
												thumbnails[7072554] = new thumbnail(7072554,'263268','','WEDDING_0731_thumb.JPG',160, 245,18,'photo_7072554.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[263253] = new gallery(263253,'7071410','Press','gallery',[7071410,7071352,7071323,7071349,7071415,7071509,7071320,7071322,7071316,7071312,7071420,7071305,7071413,7071343,7071416,7071317,7071328,7071346,7071331,7071412],0, 0, '', 'gallery_263253.html',0,0);
				  					galleries[263254] = new gallery(263254,'7072451','Travel','gallery',[7072450,7072451,7072459,7072463,7072525,7072505,7072524,7072457,7072446,7072465,7072461,7072504,7072277,7072454,7072447,7072458,7072452,7072441,7072449,7072443],0, 0, '', 'gallery_263254.html',0,0);
				  					galleries[263268] = new gallery(263268,'7072570','Weddings','gallery',[7072570,7072564,7072565,7072580,7072547,7072615,7072602,7072558,7072567,7072561,7072578,7072590,7072719,7072714,7072587,7072595,7072571,7072557,7072717,7072554],0, 0, '', 'gallery_263268.html',0,0);
				  					galleries[263270] = new gallery(263270,'7071666','Sport','gallery',[7071665,7071666,7071667,7071681,7071684,7071686,7071688,7071690,7071691,7071695,7071696,7071699,7071703,7071704,7071705,7071708,7071714,7071717,7071721,7071724],0, 0, '', 'gallery_263270.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7072729';
imageSets[2] = '7072570,7072451,7071666,7071410';
imageSets[3] = '7072547';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/hollycant/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/hollycant/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/hollycant/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/hollycant/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/hollycant/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/hollycant/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/hollycant/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/hollycant/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/hollycant/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/hollycant/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/hollycant/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/hollycant/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/hollycant/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/hollycant/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/hollycant/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/hollycant/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/hollycant/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/hollycant/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/hollycant/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/hollycant/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/hollycant/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/hollycant/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {

	imageID = randomListVal('');
		if (!basic) {
	img.src = photos[imageID].src;
	img.width = photos[imageID].width;
	img.height = photos[imageID].height;
  img.parentNode.title = img.alt = photos[imageID].caption;
	}
	else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
				
	}
			}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}
/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
  var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
		if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
    
  updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
  var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
      op = $.extend({},defaults,options),
      html = '', temp = '',
      photoId = op.nextPhoto.id,
      photoCaption = op.nextPhoto.caption,
      photoSrc = op.nextPhoto.src;
		
		if (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    if (op.$photo.length > 0) {
      html = $('<img/>',{
        'class': 'mainphoto photo',
        src: photoSrc,
        id: 'mainPic',
        name: 'mainPic',
        width: op.nextPhoto.width,
        height: op.nextPhoto.height,
        alt: photoCaption,
        css: op.css || {}
      });
      if (op.href) {
      	if (op.href.match(/<a/)) {
      	  html = $(op.href).append(html);
      	} else {
		  html = $('<a/>', {
			href: op.href,
			title: photoCaption
		  }).append(html);
	    }
      } else {
      	html = $('<a/>', {
			title: photoCaption
		  }).append(html);
      }
      if (op.speed == 0) {        op.$photo.html(html);        if (op.onBefore) {          op.onBefore.apply(op.$photo);        }        if (op.onAfter) {          op.onAfter.apply(op.$photo);        }      } else {        op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){            if (op.onAfter) {		    op.onAfter.apply(this);          }		  clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));		  $('body').trigger('clikUpdate');		}, op.onBefore);
      }    }
    	if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Holly Cant Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));      $('body').trigger('clikUpdate');    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object' || array == undefined) {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp = temp + '<p>Order this print:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = temp + '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
				
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			temp = temp + '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
		
	if(img){
	      if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
        imageID = imageID[1];
      } else {
			  imageID = randomListVal(galleries[gallery_id].featured_images);
      }
							
			if (imageID != 0) {
				img.src = thumbnails[imageID].src;
				img.width = thumbnails[imageID].width;
				img.height = thumbnails[imageID].height;
				img.alt = galleries[gallery_id].title;
        if (updateLink) {
          $(img).parent().attr({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp = temp + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

