window.thumbnails = new Object();
												thumbnails[4378051] = new thumbnail(4378051,'','Romantic Callas nr.1','8438_thumb.jpg',130, 112,18,'															#');
												thumbnails[4379620] = new thumbnail(4379620,'257103','Seashells composition','clk_1002_RD_thumb.jpg',130, 87,18,'																			photo_4379620.html');
												thumbnails[4379708] = new thumbnail(4379708,'256719','Romantic Callas nr. 1','84381_thumb.jpg',130, 112,18,'																			photo_4379708.html');
												thumbnails[4379713] = new thumbnail(4379713,'257103','Callas in black and white','8436_thumb.jpg',130, 128,18,'																			photo_4379713.html');
												thumbnails[4379718] = new thumbnail(4379718,'256718','African eyes','8633609-md_thumb.jpg',130, 123,18,'																			photo_4379718.html');
												thumbnails[4379720] = new thumbnail(4379720,'257103','Anemone flower','8653091-md_thumb.jpg',130, 118,18,'																			photo_4379720.html');
												thumbnails[4379789] = new thumbnail(4379789,'257105','Chawan and Sakura flower','clk__1345_RD_thumb.jpg',130, 94,18,'																			photo_4379789.html');
												thumbnails[4379795] = new thumbnail(4379795,'257105','Still life with chinese calligraphy brush and tea cup','9084_thumb.jpg',130, 103,18,'																			photo_4379795.html');
												thumbnails[4380120] = new thumbnail(4380120,'257105','Chawan and protea flower','clk_2071_RD_thumb.jpg',130, 87,18,'																			photo_4380120.html');
												thumbnails[4380344] = new thumbnail(4380344,'257105','Still life with celadon vase , sea shell and chinese brush','clk_3752_RD_thumb.jpg',130, 94,18,'																			photo_4380344.html');
												thumbnails[4380389] = new thumbnail(4380389,'257105','Vintage Chawans','clk_3650_RD_thumb.jpg',130, 125,18,'																			photo_4380389.html');
												thumbnails[4391384] = new thumbnail(4391384,'256718','Vanitas with pomegranate and sheashell','RD_Vanitas_with_pomegr_alch_and_sea_shell_thumb.jpg',130, 100,18,'																			photo_4391384.html');
												thumbnails[4391386] = new thumbnail(4391386,'256718','The calligrapher\'s desk','rRD_Clk_the_calligrapher_desk_thumb.jpg',130, 92,18,'																			photo_4391386.html');
												thumbnails[4391390] = new thumbnail(4391390,'256718','\'\'Bodegon\'\' (Still life)  with garlics','RD_CLK_Still_life_with_garlics_thumb.jpg',130, 106,18,'																			photo_4391390.html');
												thumbnails[4391395] = new thumbnail(4391395,'256718','Memories','RD_CLK_memories_thumb.jpg',130, 111,18,'																			photo_4391395.html');
												thumbnails[4391397] = new thumbnail(4391397,'257104','Orchid close-up','RD_8567202-md_thumb.jpg',130, 93,18,'																			photo_4391397.html');
												thumbnails[4391408] = new thumbnail(4391408,'257104','Iris close-up','RD_8934753-md_thumb.jpg',130, 178,18,'																			photo_4391408.html');
												thumbnails[4391423] = new thumbnail(4391423,'257112','Still life with iron lantern and brass pots','RD_Still_life_with_iron_lantern_and_brass_pots_MG_1720_thumb.jpg',130, 122,18,'																			photo_4391423.html');
												thumbnails[4395876] = new thumbnail(4395876,'257103','Still life with iron lamps','RD___MG_0142_thumb.jpg',130, 97,18,'																			photo_4395876.html');
												thumbnails[4395879] = new thumbnail(4395879,'257112','Still life with iron lamp and seashells','8796535-md_thumb.jpg',130, 115,18,'																			photo_4395879.html');
												thumbnails[4396042] = new thumbnail(4396042,'257104','Anemone flower<br>\r\n ','RD_8671058-md_thumb.jpg',130, 98,18,'																			photo_4396042.html');
												thumbnails[4402172] = new thumbnail(4402172,'257103','....you and me (still life with two protea flowers)','RD_HDR__MG_0111__jpg__mon_thumb.jpg',130, 90,18,'																			photo_4402172.html');
												thumbnails[4402178] = new thumbnail(4402178,'257103','Dried Ananas ','9269893-md_thumb.jpg',130, 100,18,'																			photo_4402178.html');
												thumbnails[4402195] = new thumbnail(4402195,'256719','Lysanthis flowers','9319532-md_thumb.jpg',130, 98,18,'																			photo_4402195.html');
												thumbnails[4402202] = new thumbnail(4402202,'256719','Irises','8934752-md_thumb.jpg',130, 104,18,'																			photo_4402202.html');
												thumbnails[4408927] = new thumbnail(4408927,'258302','Arabian Horse Stallion <br>\r\n   Oils on paper','top_IMG_3073_thumb.jpg',130, 122,18,'																			photo_4408927.html');
												thumbnails[4408940] = new thumbnail(4408940,'258302','Arabian Horse  Mare<br>\r\n  Oils on canvas','top_IMG_3116_thumb.jpg',130, 87,18,'																			photo_4408940.html');
												thumbnails[4443471] = new thumbnail(4443471,'258302','The King ','AHA_2006_THE_KING_EE_2006__CR_ridotto_thumb.jpg',130, 109,18,'																			photo_4443471.html');
												thumbnails[4443474] = new thumbnail(4443474,'258302','Bay stallion','_rd_MG_4290_thumb.jpg',130, 87,18,'																			photo_4443474.html');
												thumbnails[4443478] = new thumbnail(4443478,'258302','Young stallion head study','Young_Stallion_head_study_WTC_OR_1_thumb.jpg',130, 195,18,'																			photo_4443478.html');
												thumbnails[4448193] = new thumbnail(4448193,'257112','Shells composition in Sepia','9508504-md_thumb.jpg',130, 106,18,'																			photo_4448193.html');
												thumbnails[4448197] = new thumbnail(4448197,'257112','Vintage sea shells','9067955-lg_thumb.jpg',130, 94,18,'																			photo_4448197.html');
												thumbnails[4448207] = new thumbnail(4448207,'256719','Rubies','8563863-lg_thumb.jpg',130, 150,18,'																			photo_4448207.html');
												thumbnails[4448210] = new thumbnail(4448210,'256718','Ebony and Ivory','8755496-md_thumb.jpg',130, 93,18,'																			photo_4448210.html');
												thumbnails[4448224] = new thumbnail(4448224,'256718','Vanitas with vase, seashells and protea flower','8564160-md_thumb.jpg',130, 101,18,'																			photo_4448224.html');
												thumbnails[4512464] = new thumbnail(4512464,'257103','Still life with glasses and seashell','RD_RDD__SHELL_AND_GLASSES_MG_0573_thumb.jpg',130, 100,18,'																			photo_4512464.html');
												thumbnails[4563013] = new thumbnail(4563013,'257103','Still life with my old Leica','RD_tp_leica__s-l__bw_MG_2532_thumb.jpg',130, 88,18,'																			photo_4563013.html');
												thumbnails[4563016] = new thumbnail(4563016,'257103','Leica and seashell','rd__leica_sl__MG_2548_thumb.jpg',130, 87,18,'																			photo_4563016.html');
												thumbnails[4563027] = new thumbnail(4563027,'256718','My old Leica and sea shells','RD_Leica_SL__MG_2538_thumb.jpg',130, 87,18,'																			photo_4563027.html');
												thumbnails[5276468] = new thumbnail(5276468,'295902','','RD_folding_mania_thumb.jpg',130, 89,18,'																			photo_5276468.html');
												thumbnails[5276488] = new thumbnail(5276488,'295902','','Framed_RD_Tp_Leicas__MG_4336_thumb.jpg',130, 96,18,'																			photo_5276488.html');
												thumbnails[5276493] = new thumbnail(5276493,'295902','','Tp_Baldina__MG_4300_thumb.jpg',130, 94,18,'																			photo_5276493.html');
												thumbnails[5346207] = new thumbnail(5346207,'295902','','balld_baldina_thumb.jpg',130, 92,18,'																			photo_5346207.html');
												thumbnails[5346214] = new thumbnail(5346214,'295902','','LEICA_M6_thumb.jpg',130, 87,18,'																			photo_5346214.html');
												thumbnails[5346216] = new thumbnail(5346216,'295902','','kodak_retina_thumb.jpg',130, 90,18,'																			photo_5346216.html');
												thumbnails[5346217] = new thumbnail(5346217,'295902','','Vintage_Voight__MG_4369_thumb.jpg',130, 99,18,'																			photo_5346217.html');
												thumbnails[5346218] = new thumbnail(5346218,'295902','','zeiss_ikonta_thumb.jpg',130, 87,18,'																			photo_5346218.html');
												thumbnails[5346220] = new thumbnail(5346220,'295902','','TP_Vint_macro__MG_4367_thumb.jpg',130, 97,18,'																			photo_5346220.html');
												thumbnails[5346221] = new thumbnail(5346221,'295902','','voigt_vitomatic_3_thumb.jpg',130, 87,18,'																			photo_5346221.html');
												thumbnails[5346222] = new thumbnail(5346222,'295902','','Voigt_Bitomatic_1_thumb.jpg',130, 87,18,'																			photo_5346222.html');
												thumbnails[7329675] = new thumbnail(7329675,'396564','\'\'Morandiana\'\' nr. 1','RD_Morandiana_nr1._2_-_Baby_Rollei_con_Rolleinar_nr_2_thumb.jpg',130, 130,18,'																			photo_7329675.html');
												thumbnails[7329686] = new thumbnail(7329686,'396564','Seashells ','rd_Conchiglie___Rolleiflex_35_Planar__con_Rolleinar_nr_2_thumb.jpg',130, 130,18,'																			photo_7329686.html');
												thumbnails[7346000] = new thumbnail(7346000,'396564','African Eyes','African_eyes_thumb.jpg',130, 133,18,'																			photo_7346000.html');
												thumbnails[7346004] = new thumbnail(7346004,'396564','','_MG_2231_thumb.jpg',130, 126,18,'																			photo_7346004.html');
												thumbnails[7346007] = new thumbnail(7346007,'396564','\'\'Sola\'\'','Conchiglia_sola__-__Baby_Rollei__rolleinars_nr_3_thumb.jpg',130, 131,18,'																			photo_7346007.html');
												thumbnails[7346009] = new thumbnail(7346009,'396564','Glasses and roses ','I_bicchieri_di_Sudek_ROLLEIFLEX_3.5F_rolleinars_nr_2_thumb.jpg',130, 131,18,'																			photo_7346009.html');
												thumbnails[7346011] = new thumbnail(7346011,'396564','Morandiana nr. 3','I_vetri_di_Morandi__._Rolleicord_III_-_Rolleinars_nr_3_thumb.jpg',130, 123,18,'																			photo_7346011.html');
												thumbnails[7346015] = new thumbnail(7346015,'396564','Morandiana nr. 5 in sepia','Morandiana_in_Sepia_-_Rolleiflex_35_planar_rolleinars_3_thumb.jpg',130, 132,18,'																			photo_7346015.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[258302] = new gallery(258302,'4443478,4443474,4443471,4408940,4408927','Arabian Horse Art','gallery',[4408927,4408940,4443471,4443474,4443478],0, 0, '', '																																																																																																							gallery_258302.html',0,0);
				  					galleries[257103] = new gallery(257103,'4563016,4563013,4512464,4402178,4402172,4395876,4379720,4379713,4379620','Black and White','gallery',[4379620,4379713,4379720,4395876,4402172,4402178,4512464,4563013,4563016],0, 0, '', '																																																																																																							gallery_257103.html',0,0);
				  					galleries[257104] = new gallery(257104,'4396042,4391408,4391397','Macro','gallery',[4391397,4391408,4396042],0, 0, '', '																																																																																																							gallery_257104.html',0,0);
				  					galleries[257105] = new gallery(257105,'4380389,4380344,4380120,4379795,4379789','Orientalia','gallery',[4379789,4379795,4380120,4380344,4380389],0, 0, '', '																																																																																																							gallery_257105.html',0,0);
				  					galleries[396564] = new gallery(396564,'7346015,7346011,7346009,7346007,7346004,7346000,7329686,7329675','STILL and STILL ','gallery',[7329675,7329686,7346000,7346004,7346007,7346009,7346011,7346015],0, 0, '', '																																																																																																							gallery_396564.html',0,0);
				  					galleries[257112] = new gallery(257112,'4448197,4448193,4395879,4391423','Textures and Shapes','gallery',[4391423,4395879,4448193,4448197],0, 0, '', '																																																																																																							gallery_257112.html',0,0);
				  					galleries[295902] = new gallery(295902,'5346222,5346221,5346220,5346218,5346217,5346216,5346214,5346207,5276493,5276488','Vintage Cameras','gallery',[5276468,5276488,5276493,5346207,5346214,5346216,5346217,5346218,5346220,5346221,5346222],0, 0, '', '																																																																																																							gallery_295902.html',0,0);
				  					galleries[256718] = new gallery(256718,'4563027,4448224,4448210,4391395,4391390,4391386,4391384,4379718','Still Life','gallery',[4379718,4391384,4391386,4391390,4391395,4448210,4448224,4563027],0, 0, '', '																																																																																																							gallery_256718.html',0,0);
				  					galleries[256719] = new gallery(256719,'4448207,4402202,4402195,4379708','Flowers','gallery',[4379708,4402195,4402202,4448207],0, 0, '', '																																																																																																							gallery_256719.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7346015,7346011,7346009,7346007,7346004,7346000,7329686,7329675,5346222,5346221,5346220,5346218,5346217,5346216,5346214,5346207,5276493,5276488,5276468,4563027,4563016,4563013,4512464,4448224,4448210,4448207,4448197,4448193,4443478,4443474,4443471,4408940,4408927,4402202,4402195,4402178,4402172,4396042,4395879,4395876,4391423,4391408,4391397,4391395,4391390,4391386,4391384,4380389,4380344,4380120';
imageSets[3] = '7346015,7346011,7346009,7346007,7346004,7346000,7329686,7329675,5346222,5346221,5346220,5346218,5346217,5346216,5346214,5346207,5276493,5276488,5276468,4563027,4563016,4563013,4512464,4448224,4448210,4448207,4448197,4448193,4443478,4443474,4443471,4408940,4408927,4402202,4402195,4402178,4402172,4396042,4395879,4395876,4391423,4391408,4391397,4391395,4391390,4391386,4391384,4380389,4380344,4380120';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Paolita/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Paolita/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Paolita/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Paolita/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Paolita/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Paolita/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Paolita/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Paolita/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Paolita/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Paolita/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Paolita/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Paolita/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Paolita/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Paolita/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Paolita/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/Paolita/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/Paolita/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Paolita/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Paolita/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Paolita/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Paolita/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Paolita/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 = 'Fine Art Photography and Arabian Horse Painting: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {photoinfominwidth:220};	    	      	      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> 				$' + (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="PAOLITA">';
		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;
	}
}

			

