window.thumbnails = new Object();
												thumbnails[3483280] = new thumbnail(3483280,'211527','Wedding 1_jpeg','12_thumb.jpg',130, 195,15,'																			photo_3483280.html');
												thumbnails[3483283] = new thumbnail(3483283,'211527','Wedding 2_jpeg','5_thumb.jpg',130, 195,15,'																			photo_3483283.html');
												thumbnails[3483286] = new thumbnail(3483286,'211527','Wedding 3_jpeg','1_thumb.jpg',130, 194,15,'																			photo_3483286.html');
												thumbnails[3483291] = new thumbnail(3483291,'211527','Wedding 4_jpeg','4_thumb.jpg',130, 195,15,'																			photo_3483291.html');
												thumbnails[3483293] = new thumbnail(3483293,'211527','Wedding 5_jpeg','6_thumb.jpg',130, 195,15,'																			photo_3483293.html');
												thumbnails[3483296] = new thumbnail(3483296,'211527','Wedding 6_jpeg','8_thumb.jpg',130, 195,15,'																			photo_3483296.html');
												thumbnails[3483299] = new thumbnail(3483299,'211527','Wedding 7_jpeg','13_thumb.jpg',130, 195,15,'																			photo_3483299.html');
												thumbnails[3483304] = new thumbnail(3483304,'211527','Wedding 8_jpeg','19_thumb.jpg',130, 195,15,'																			photo_3483304.html');
												thumbnails[3483306] = new thumbnail(3483306,'211527','Wedding 9_jpeg','18_thumb.jpg',130, 195,15,'																			photo_3483306.html');
												thumbnails[3483308] = new thumbnail(3483308,'211527','Wedding 10_jpeg','20_thumb.jpg',130, 195,15,'																			photo_3483308.html');
												thumbnails[3483313] = new thumbnail(3483313,'211527','Wedding 11_jpeg','14_thumb.jpg',130, 195,15,'																			photo_3483313.html');
												thumbnails[3483315] = new thumbnail(3483315,'211528','Portrait 12_jpeg','21_thumb.jpg',130, 102,15,'																			photo_3483315.html');
												thumbnails[3483320] = new thumbnail(3483320,'211528','Portrait 13_jpeg','22_thumb.jpg',130, 174,15,'																			photo_3483320.html');
												thumbnails[3483347] = new thumbnail(3483347,'211527','Wedding 15_jpeg','11c_thumb.jpg',130, 194,15,'																			photo_3483347.html');
												thumbnails[3483356] = new thumbnail(3483356,'211527','Wedding 16_jpeg','15_thumb.jpg',130, 194,15,'																			photo_3483356.html');
												thumbnails[3483741] = new thumbnail(3483741,'211527','Wedding 14_jpeg','web1_thumb.jpg',130, 195,15,'																			photo_3483741.html');
												thumbnails[3483742] = new thumbnail(3483742,'211527','Wedding 17_jpeg','web2_thumb.jpg',130, 195,15,'																			photo_3483742.html');
												thumbnails[3483747] = new thumbnail(3483747,'211527','Wedding 23_jpeg','web3_thumb.jpg',130, 195,15,'																			photo_3483747.html');
												thumbnails[3483750] = new thumbnail(3483750,'211527','Wedding 18_jpeg','web4_thumb.jpg',130, 195,15,'																			photo_3483750.html');
												thumbnails[3483751] = new thumbnail(3483751,'211527','Wedding 19_jpeg','web5_thumb.jpg',130, 194,15,'																			photo_3483751.html');
												thumbnails[3483755] = new thumbnail(3483755,'211527','Wedding 20_jpeg','web6_thumb.jpg',130, 195,15,'																			photo_3483755.html');
												thumbnails[3483757] = new thumbnail(3483757,'211527','Wedding 21_jpeg','web7_thumb.jpg',130, 264,15,'																			photo_3483757.html');
												thumbnails[3483759] = new thumbnail(3483759,'211527','Wedding 22_jpeg','web8_thumb.jpg',130, 183,15,'																			photo_3483759.html');
												thumbnails[3577718] = new thumbnail(3577718,'211528','Portrait 24_jpeg','Bornos004web_thumb.jpg',130, 195,15,'																			photo_3577718.html');
												thumbnails[3637690] = new thumbnail(3637690,'211528','Portrait 25_jpeg','7web_thumb.jpg',130, 164,15,'																			photo_3637690.html');
												thumbnails[3637691] = new thumbnail(3637691,'211528','Portrait 26_jpeg','8web_thumb.jpg',130, 87,15,'																			photo_3637691.html');
												thumbnails[3637693] = new thumbnail(3637693,'211528','Portrait 27_jpeg','12web_thumb.jpg',130, 123,15,'																			photo_3637693.html');
												thumbnails[3637696] = new thumbnail(3637696,'211528','Portrait 28_jpeg','ian_and_jay_2web_thumb.jpg',130, 179,15,'																			photo_3637696.html');
												thumbnails[3637697] = new thumbnail(3637697,'211528','Portrait 29_jpeg','ian_and_jay_3web_thumb.jpg',130, 60,15,'																			photo_3637697.html');
												thumbnails[3832637] = new thumbnail(3832637,'211528','Portrait_31jpeg','2web_thumb.jpg',130, 195,15,'																			photo_3832637.html');
												thumbnails[3832645] = new thumbnail(3832645,'211528','Portrait_32jpeg','3web_thumb.jpg',130, 187,15,'																			photo_3832645.html');
												thumbnails[3889919] = new thumbnail(3889919,'211528','Portrait_34jpeg','Megan4web_thumb.jpg',130, 195,15,'																			photo_3889919.html');
												thumbnails[3889922] = new thumbnail(3889922,'211528','Portrait_35jpeg','Megan_2web_thumb.jpg',130, 195,15,'																			photo_3889922.html');
												thumbnails[3889926] = new thumbnail(3889926,'211528','Portrait_36jpeg','Megan_12web_thumb.jpg',130, 180,15,'																			photo_3889926.html');
												thumbnails[3923242] = new thumbnail(3923242,'211528','Portraits 30_jpeg','002web_thumb.jpg',130, 195,15,'																			photo_3923242.html');
												thumbnails[3923248] = new thumbnail(3923248,'211528','Portrait 33_jpeg','008_1_copyweb_thumb.jpg',130, 195,15,'																			photo_3923248.html');
												thumbnails[3923251] = new thumbnail(3923251,'211528','Portrait 37_jpeg','014_copyweb_thumb.jpg',130, 195,15,'																			photo_3923251.html');
												thumbnails[3923254] = new thumbnail(3923254,'211528','Portrait 38_jpeg','017web_thumb.jpg',130, 177,15,'																			photo_3923254.html');
												thumbnails[4043273] = new thumbnail(4043273,'211527','Wedding39_jpeg','1web1_thumb.jpg',130, 172,15,'																			photo_4043273.html');
												thumbnails[4043275] = new thumbnail(4043275,'211527','Wedding40_jpeg','4web_thumb.jpg',130, 195,15,'																			photo_4043275.html');
												thumbnails[4043278] = new thumbnail(4043278,'211527','Wedding41_jpeg','12web1_thumb.jpg',130, 158,15,'																			photo_4043278.html');
												thumbnails[4043282] = new thumbnail(4043282,'211527','Wedding 42_jpeg','14web_thumb.jpg',130, 135,15,'																			photo_4043282.html');
												thumbnails[4043288] = new thumbnail(4043288,'211527','Wedding 43_jpeg','26web_thumb.jpg',130, 87,15,'																			photo_4043288.html');
												thumbnails[4043295] = new thumbnail(4043295,'211527','Wedding 43_jpeg','31web_thumb.jpg',130, 195,15,'																			photo_4043295.html');
												thumbnails[4043303] = new thumbnail(4043303,'211527','Wedding 45_jpeg','39web_thumb.jpg',130, 195,15,'																			photo_4043303.html');
												thumbnails[4241070] = new thumbnail(4241070,'211527','Wedding46_jpeg','1web2_thumb.jpg',130, 87,15,'																			photo_4241070.html');
												thumbnails[4241111] = new thumbnail(4241111,'211527','Wedding47_jpeg','5web1_thumb.jpg',130, 195,15,'																			photo_4241111.html');
												thumbnails[4241169] = new thumbnail(4241169,'211527','Wedding48_jpeg','10web_thumb.jpg',130, 195,15,'																			photo_4241169.html');
												thumbnails[4241171] = new thumbnail(4241171,'211527','Wedding49_jpeg','12web2_thumb.jpg',130, 195,15,'																			photo_4241171.html');
												thumbnails[4241174] = new thumbnail(4241174,'211527','Wedding50_jpeg','16_2web_thumb.jpg',130, 195,15,'																			photo_4241174.html');
												thumbnails[4241178] = new thumbnail(4241178,'211527','Wedding51_jpeg','16web_thumb.jpg',130, 78,15,'																			photo_4241178.html');
												thumbnails[4241179] = new thumbnail(4241179,'211527','Wedding52_jpeg','25web_thumb.jpg',130, 195,15,'																			photo_4241179.html');
												thumbnails[4241181] = new thumbnail(4241181,'211527','Wedding53_jpeg','32web_thumb.jpg',130, 87,15,'																			photo_4241181.html');
												thumbnails[4241182] = new thumbnail(4241182,'211527','Wedding54_jpeg','36web_thumb.jpg',130, 195,15,'																			photo_4241182.html');
												thumbnails[4241183] = new thumbnail(4241183,'211527','Wedding55_jpeg','41web_thumb.jpg',130, 195,15,'																			photo_4241183.html');
												thumbnails[4241185] = new thumbnail(4241185,'211527','Wedding56_jpeg','46web_thumb.jpg',130, 195,15,'																			photo_4241185.html');
												thumbnails[4241187] = new thumbnail(4241187,'211527','Wedding57_jpeg','65web_thumb.jpg',130, 87,15,'																			photo_4241187.html');
												thumbnails[4241189] = new thumbnail(4241189,'211527','Wedding59_jpeg','Katherine_and_Jonathan221_20_19_18_17web_thumb.jpg',130, 195,15,'																			photo_4241189.html');
												thumbnails[4241192] = new thumbnail(4241192,'211527','Wedding60_jpeg','Katherine_and_Jonathan222_copyweb_thumb.jpg',130, 65,15,'																			photo_4241192.html');
												thumbnails[4241197] = new thumbnail(4241197,'211527','Wedding61_jpeg','Katherine_and_Jonathan229_8_7_6web_thumb.jpg',130, 195,15,'																			photo_4241197.html');
												thumbnails[4241204] = new thumbnail(4241204,'211527','Wedding62_jpeg','Our_wedding_day147web_thumb.jpg',130, 195,15,'																			photo_4241204.html');
												thumbnails[4241389] = new thumbnail(4241389,'211527','Wedding63_jpeg','43web_thumb.jpg',130, 195,15,'																			photo_4241389.html');
												thumbnails[4241395] = new thumbnail(4241395,'211527','Wedding64_jpeg','71web_thumb.jpg',130, 195,15,'																			photo_4241395.html');
												thumbnails[4241425] = new thumbnail(4241425,'211527','Wedding66_jpeg','88web_thumb.jpg',130, 195,15,'																			photo_4241425.html');
												thumbnails[4241496] = new thumbnail(4241496,'211527','Wedding67_jpeg','75web_thumb.jpg',130, 195,15,'																			photo_4241496.html');
												thumbnails[4298027] = new thumbnail(4298027,'211527','wedding69_jpeg','1web_thumb.jpg',130, 92,15,'																			photo_4298027.html');
												thumbnails[4298130] = new thumbnail(4298130,'211527','wedding70_jpeg','28web_thumb.jpg',130, 195,15,'																			photo_4298130.html');
												thumbnails[4298132] = new thumbnail(4298132,'211527','wedding71_jpeg','48web_thumb.jpg',130, 87,15,'																			photo_4298132.html');
												thumbnails[4298135] = new thumbnail(4298135,'211527','wedding72_jpeg','60web_thumb.jpg',130, 65,15,'																			photo_4298135.html');
												thumbnails[4298140] = new thumbnail(4298140,'211527','wedding73_jpeg','68web_thumb.jpg',130, 195,15,'																			photo_4298140.html');
												thumbnails[4298336] = new thumbnail(4298336,'211527','wedding65_jpeg','76web_thumb.jpg',130, 195,15,'																			photo_4298336.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[211527] = new gallery(211527,'4298336,4298135,4298132,4241496,4241192,4241187,4241171,4241070,4043288,4043282,4043273,3483755,3483751,3483741,3483283,3483280','Wedding gallery ','gallery',[3483280,3483283,3483286,3483291,3483293,3483296,3483299,3483304,3483306,3483308,3483313,3483347,3483356,3483741,3483742,3483747,3483750,3483751,3483755,3483757,3483759,4043273,4043275,4043278,4043282,4043288,4043295,4043303,4241070,4241111,4241169,4241171,4241174,4241178,4241179,4241181,4241182,4241183,4241185,4241187,4241189,4241192,4241197,4241204,4241389,4241395,4241425,4241496,4298027,4298130,4298132,4298135,4298140,4298336],0, 0, '', '																																																																																																							gallery_211527.html',0,0);
				  					galleries[211528] = new gallery(211528,'3923254,3923251,3923248,3923242,3889926,3889922,3889919,3832645,3832637,3637697','Portrait gallery ','gallery',[3483315,3483320,3577718,3637690,3637691,3637693,3637696,3637697,3832637,3832645,3889919,3889922,3889926,3923242,3923248,3923251,3923254],0, 0, '', '																																																																																																							gallery_211528.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '4298336,4298135,4298132,4241192,4241187,4241185,4241070,4043303,4043288,4043282,4043273,3637696,3637693,3483750,3483320,3483315,3483308,3483304,3483299';
imageSets[2] = '4298336,4298135,4298132,4241496,4241192,4241187,4241171,4241070,4043288,4043282,4043273,3483755,3483751,3483741,3483283,3483280';
imageSets[3] = '4241496';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/gibraltarweddings/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/gibraltarweddings/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 = 'Gibraltar wedding photographer: ' + 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>';
	}
					
				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;
	}
}

			

