window.thumbnails = new Object();
												thumbnails[1430166] = new thumbnail(1430166,'91804','Real Alcazar ','Real Alcazar 2_1_thumb.jpg',130, 84,18,'photo_1430166.html');
												thumbnails[1430188] = new thumbnail(1430188,'91804','','IMG_2374_1_thumb.JPG',130, 87,18,'photo_1430188.html');
												thumbnails[1481262] = new thumbnail(1481262,'91799','Javea Port','IMG_0314_1_thumb.JPG',130, 91,18,'photo_1481262.html');
												thumbnails[1521461] = new thumbnail(1521461,'100148','','IMG_0832_1_thumb.JPG',130, 87,18,'photo_1521461.html');
												thumbnails[3158464] = new thumbnail(3158464,'91799','','Hotel Puerta de la Luna_1_thumb.jpg',130, 189,18,'photo_3158464.html');
												thumbnails[4580135] = new thumbnail(4580135,'100148','','IMG_2495_3_1_thumb.JPG',130, 84,18,'photo_4580135.html');
												thumbnails[1446983] = new thumbnail(1446983,'91799','Fun in the sun','20070929_0615_1_1_thumb.JPG',130, 87,18,'photo_1446983.html');
												thumbnails[1295713] = new thumbnail(1295713,'91799','','Ghali tosca columns_1_thumb.jpg',130, 88,18,'photo_1295713.html');
												thumbnails[1360696] = new thumbnail(1360696,'91804','Cadiz Harbour','20070830_0765-trim_1_thumb.jpg',130, 92,18,'photo_1360696.html');
												thumbnails[1448145] = new thumbnail(1448145,'100148','','Untitled-Grayscale-01_2-3_1-2_1_1_1_thumb.jpg',130, 89,18,'photo_1448145.html');
												thumbnails[4638704] = new thumbnail(4638704,'265357','A Study in Saffron and Grey','GetAttachment4_thumb.jpg',130, 57,18,'photo_4638704.html');
												thumbnails[1295647] = new thumbnail(1295647,'91799','','Ghali Casa View 1_1_thumb.jpg',130, 87,18,'photo_1295647.html');
												thumbnails[1355635] = new thumbnail(1355635,'91804','Cadiz Harbour','20070830_0764_11_thumb.JPG',130, 85,18,'photo_1355635.html');
												thumbnails[4638698] = new thumbnail(4638698,'265357','','GetAttachment2_thumb.jpg',130, 98,18,'photo_4638698.html');
												thumbnails[1296303] = new thumbnail(1296303,'91799','Javea surf','IMG_4433-2_1_thumb.jpg',130, 81,18,'photo_1296303.html');
												thumbnails[1355665] = new thumbnail(1355665,'91804','','Ronda_thumb.jpg',130, 86,18,'photo_1355665.html');
												thumbnails[4638839] = new thumbnail(4638839,'265357','','GetAttachment5_thumb.jpg',130, 98,18,'photo_4638839.html');
												thumbnails[1296306] = new thumbnail(1296306,'91799','Arenal Beach, Javea','Javea Arenal Beach_1_thumb.jpg',130, 90,18,'photo_1296306.html');
												thumbnails[1360703] = new thumbnail(1360703,'91804','Cadiz Cathedral and beach','20070830_0767_1_1_thumb.JPG',130, 86,18,'photo_1360703.html');
												thumbnails[4638842] = new thumbnail(4638842,'265357','Black Swan','GetAttachment6_thumb.jpg',130, 98,18,'photo_4638842.html');
												thumbnails[4641450] = new thumbnail(4641450,'265357','California Dreamin\'','cal_thumb.JPG',130, 97,18,'photo_4641450.html');
												thumbnails[5945489] = new thumbnail(5945489,'265357','A lively debate','belive_thumb.jpg',130, 87,18,'photo_5945489.html');
												thumbnails[5945494] = new thumbnail(5945494,'265357','Study in greys ','blackwhite_thumb.jpg',130, 86,18,'photo_5945494.html');
												thumbnails[5945509] = new thumbnail(5945509,'265357','Smokey Mountain','smokymounten_thumb.jpg',130, 98,18,'photo_5945509.html');
												thumbnails[1295747] = new thumbnail(1295747,'91799','','20060611_0321_1_thumb.JPG',130, 86,18,'photo_1295747.html');
												thumbnails[1381839] = new thumbnail(1381839,'91804','Vejer Frog','Frog Fountain in Vejer_1_thumb.jpg',130, 83,18,'photo_1381839.html');
												thumbnails[4638701] = new thumbnail(4638701,'265357','Gunung Bromo, or Mount Bromo, East Java','GetAttachment3_thumb.jpg',130, 98,18,'photo_4638701.html');
												thumbnails[5945498] = new thumbnail(5945498,'265357','','halfsmoke_thumb.jpg',130, 98,18,'photo_5945498.html');
												thumbnails[5945503] = new thumbnail(5945503,'265357','Men on ice','menonice_thumb.jpg',130, 98,18,'photo_5945503.html');
												thumbnails[1381834] = new thumbnail(1381834,'91804','Pavilion in the Real Alcazar','Pavilio Real Alcazar_1_thumb.jpg',130, 83,18,'photo_1381834.html');
												thumbnails[4638690] = new thumbnail(4638690,'265357','Temple guardian at Angkor Wat','GetAttachment_thumb.jpg',130, 180,18,'photo_4638690.html');
												thumbnails[5945482] = new thumbnail(5945482,'265357','Black & Gold','2black_thumb.jpg',130, 161,18,'photo_5945482.html');
												thumbnails[5945510] = new thumbnail(5945510,'265357','Blue Lakes','threebluelakes_thumb.jpg',130, 173,18,'photo_5945510.html');
												thumbnails[1360695] = new thumbnail(1360695,'91804','Real Alcazar, Sevilla','20070831_0770_1_thumb.JPG',130, 85,18,'photo_1360695.html');
												thumbnails[1448112] = new thumbnail(1448112,'91799','Against the clock','jt12_1_thumb.jpg',130, 185,18,'photo_1448112.html');
												thumbnails[4639140] = new thumbnail(4639140,'265357','','GetAttachment8_thumb.jpg',130, 174,18,'photo_4639140.html');
												thumbnails[1360698] = new thumbnail(1360698,'91804','Ronda','20070825_0751_1_thumb.JPG',130, 195,18,'photo_1360698.html');
												thumbnails[4638694] = new thumbnail(4638694,'265357','Cambodian Family','GetAttachment1_thumb.jpg',130, 191,18,'photo_4638694.html');
												thumbnails[1381857] = new thumbnail(1381857,'91804','Real Alcazar','Alcazar tower_1_thumb.jpg',130, 195,18,'photo_1381857.html');
												thumbnails[4638873] = new thumbnail(4638873,'265357','Floating Forest','GetAttachment7_thumb.jpg',130, 178,18,'photo_4638873.html');
												thumbnails[5946658] = new thumbnail(5946658,'265367','Sevilla Wedding Day','2009_10_03_Sevilla_Lita_1465_1_thumb.JPG',130, 87,18,'photo_5946658.html');
												thumbnails[5946670] = new thumbnail(5946670,'265367','Sevilla Palm Trees','2009_10_03_Sevilla_Lita_1481_1_thumb.JPG',130, 87,18,'photo_5946670.html');
												thumbnails[5946671] = new thumbnail(5946671,'265367','Sevilla','2009_10_03_Sevilla_Lita_1492_1_1_thumb.JPG',130, 196,18,'photo_5946671.html');
												thumbnails[5946638] = new thumbnail(5946638,'265367','Javea Headland','2009_12_15_Vistamontaña_2504_1_1_thumb.JPG',130, 87,18,'photo_5946638.html');
												thumbnails[1898704] = new thumbnail(1898704,'111151','Cap Negre, Jávea','DSC00483_thumb.jpg',130, 81,18,'photo_1898704.html');
												thumbnails[5946653] = new thumbnail(5946653,'265367','Arenal Bay','2009_12_15_Vistamontaña_2485_1_1_1_thumb.JPG',130, 87,18,'photo_5946653.html');
												thumbnails[1898698] = new thumbnail(1898698,'111151','Costa Blanca','DSC00580_thumb.jpg',130, 96,18,'photo_1898698.html');
												thumbnails[1898689] = new thumbnail(1898689,'111151','Study in blue and ochre','DSCF0757_thumb.jpg',130, 107,18,'photo_1898689.html');
												thumbnails[5946655] = new thumbnail(5946655,'265367','Parador Marina','2009_12_15_Vistamontaña_2478_1_1_thumb.JPG',130, 86,18,'photo_5946655.html');
												thumbnails[1898629] = new thumbnail(1898629,'111151','Coloured houses, Spain','DSC00583_thumb.jpg',130, 96,18,'photo_1898629.html');
												thumbnails[1898679] = new thumbnail(1898679,'111151','Stone houses and blossom','DSCF0927_thumb.jpg',130, 107,18,'photo_1898679.html');
												thumbnails[1898596] = new thumbnail(1898596,'111151','Jalon Valley in Spring ','DSC005311_thumb.jpg',130, 96,18,'photo_1898596.html');
												thumbnails[1644847] = new thumbnail(1644847,'111151','St Florent-Corse','St Florent - Corse_thumb.jpg',130, 107,18,'photo_1644847.html');
												thumbnails[4580238] = new thumbnail(4580238,'265367','','IMG_0132_1_1_thumb.JPG',130, 88,18,'photo_4580238.html');
												thumbnails[1644851] = new thumbnail(1644851,'111151','Au sec à Joret, Fermanville','Au sec a´Joret Fermanville_thumb.jpg',130, 106,18,'photo_1644851.html');
												thumbnails[1644857] = new thumbnail(1644857,'111151','Vieilles coques au sec<br>\r\n','Vieilles coques au sec_thumb.jpg',130, 97,18,'photo_1644857.html');
												thumbnails[1661670] = new thumbnail(1661670,'111151','Au port','Au port_thumb.jpg',130, 97,18,'photo_1661670.html');
												thumbnails[1662563] = new thumbnail(1662563,'111151','La Barraca, Javéa ','DSC00238_thumb.JPG',130, 105,18,'photo_1662563.html');
												thumbnails[1662704] = new thumbnail(1662704,'111151','','DSCF0746_thumb.JPG',130, 106,18,'photo_1662704.html');
												thumbnails[1662706] = new thumbnail(1662706,'111151','','DSCF0753_thumb.JPG',130, 92,18,'photo_1662706.html');
												thumbnails[1662709] = new thumbnail(1662709,'111151','','DSCF0759_thumb.JPG',130, 102,18,'photo_1662709.html');
												thumbnails[1662715] = new thumbnail(1662715,'111151','','DSCF0760_thumb.JPG',130, 104,18,'photo_1662715.html');
												thumbnails[1662719] = new thumbnail(1662719,'111151','','DSCF0766_thumb.JPG',130, 108,18,'photo_1662719.html');
												thumbnails[1662721] = new thumbnail(1662721,'111151','','DSCF0933_thumb.JPG',130, 107,18,'photo_1662721.html');
												thumbnails[1662723] = new thumbnail(1662723,'111151','','DSCF0934_thumb.JPG',130, 106,18,'photo_1662723.html');
												thumbnails[1661672] = new thumbnail(1661672,'111151','La baie d\'Ecalgrain -Hague<br>\r\n','t21_thumb.jpg',130, 85,18,'photo_1661672.html');
												thumbnails[1644872] = new thumbnail(1644872,'111151','Port Racine','t40_thumb.jpg',130, 155,18,'photo_1644872.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[265367] = new gallery(265367,'4580238','Kerry Webber','section128101',[5946658,5946670,5946671,5946638,5946653,5946655,4580238],0, 0, '', 'section128101_265367.html',0,0);
				  					galleries[111151] = new gallery(111151,'1898679','Gerard Le Goubey','section128101',[1898704,1898698,1898689,1898629,1898679,1898596,1644847,1644851,1644857,1661670,1662563,1662704,1662706,1662709,1662715,1662719,1662721,1662723,1661672,1644872],0, 0, '', 'section128101_111151.html',0,0);
				  					galleries[265357] = new gallery(265357,'4638690','Malin Olsson','gallery',[4638704,4638698,4638839,4638842,4641450,5945489,5945494,5945509,4638701,5945498,5945503,4638690,5945482,5945510,4639140,4638694,4638873],0, 0, '', 'gallery_265357.html',0,0);
				  					galleries[112002] = new gallery(112002,'','Another','section128101',[],0, 0, '', 'section128101_112002.html',0,0);
				  					galleries[91799] = new gallery(91799,'1446983','Kerry Webber','gallery',[1481262,3158464,1446983,1295713,1295647,1296303,1296306,1295747,1448112],0, 0, '', 'gallery_91799.html',0,0);
				  					galleries[91804] = new gallery(91804,'1355665','George Crosby','gallery',[1430166,1430188,1360696,1355635,1355665,1360703,1381839,1381834,1360695,1360698,1381857],0, 0, '', 'gallery_91804.html',0,0);
				  					galleries[100148] = new gallery(100148,'1521461,1448145','James Everard','gallery',[1521461,4580135,1448145],0, 0, '', 'gallery_100148.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '5946638,5945489,4638842,4638704,4638698,4580238,4580135,1662721,1448145,1430188,1355665';
imageSets[2] = '4638690,4580238,1898679,1521461,1448145,1446983,1355665';
imageSets[3] = '1448145';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/kerry/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/kerry/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/kerry/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/kerry/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/kerry/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/kerry/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/kerry/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/kerry/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/kerry/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/kerry/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/kerry/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/kerry/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/kerry/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/kerry/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/kerry/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/kerry/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/kerry/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/kerry/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/kerry/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/kerry/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/kerry/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/kerry/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 = 'digiclik imagestock - españa: ' + 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 = 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> &euro;' + (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 + '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="item_name" value="'+item_name+'">';
								ref = '';
				if(this.photo_ref != ''){
					ref = this.photo_ref+' - '+this.caption;
				}
				else{
					ref = this.id+' - '+this.caption;
				}
				price = amount;					temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="">';
	temp = temp + '<input type="hidden" name="currency_code" value="EUR">';
	temp = temp + '<input type="hidden" name="add" value="1">';
					temp = temp + '<input type="hidden" name="amount" value="'+amount+'">';
	temp = temp + '<input type="hidden" name="item_number" value="'+ref+'">';
					temp = temp + '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
									temp = temp + '</form>';
								temp = temp + '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="">';
	temp = temp + '<input type="hidden" name="display" value="1">';
	temp = temp + '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
	temp = temp + '</form>';
							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;
	}
}

			

