window.thumbnails = new Object();
												thumbnails[7113833] = new thumbnail(7113833,'','','ALR_8327_thumb.jpg',130, 196,5,'#');
												thumbnails[2985541] = new thumbnail(2985541,'183966','','Lucchi sculpture_thumb.jpg',130, 173,5,'photo_2985541.html');
												thumbnails[2985545] = new thumbnail(2985545,'183966','Sofia by Anna Izzo','sophia silver7_thumb.jpg',130, 180,5,'photo_2985545.html');
												thumbnails[2985549] = new thumbnail(2985549,'183968','','Copy of La Galleria 1_thumb.jpg',130, 87,5,'photo_2985549.html');
												thumbnails[2985550] = new thumbnail(2985550,'183963','','Copy of La Galleria 11_thumb.jpg',130, 87,5,'photo_2985550.html');
												thumbnails[2987091] = new thumbnail(2987091,'183963','Entrance','DSC00941_thumb.jpg',130, 98,5,'photo_2987091.html');
												thumbnails[2987109] = new thumbnail(2987109,'183966','Ostenberg','DSC_9189_thumb.jpg',130, 196,5,'photo_2987109.html');
												thumbnails[2987131] = new thumbnail(2987131,'184080','Window on Pall Mall','kerry taylor_thumb.jpg',130, 81,5,'photo_2987131.html');
												thumbnails[2987154] = new thumbnail(2987154,'183963','mixed Show','galleria mixed show_thumb.jpg',130, 81,5,'photo_2987154.html');
												thumbnails[2987159] = new thumbnail(2987159,'183963','Window Arcade','DSC00940_thumb.jpg',130, 95,5,'photo_2987159.html');
												thumbnails[2987189] = new thumbnail(2987189,'184080',' Entrance','DSC00691_thumb.jpg',130, 231,5,'photo_2987189.html');
												thumbnails[2987191] = new thumbnail(2987191,'183968','Dune','DSC00724_thumb.jpg',130, 73,5,'photo_2987191.html');
												thumbnails[2987213] = new thumbnail(2987213,'183963','Izzo Show','DSC_0012_thumb.jpg',130, 87,5,'photo_2987213.html');
												thumbnails[2987216] = new thumbnail(2987216,'183963','window panels','DSC00211_thumb.jpg',130, 73,5,'photo_2987216.html');
												thumbnails[2987221] = new thumbnail(2987221,'183963','Yusuf Arakal','Yusuf Arakkal_thumb.jpg',130, 87,5,'photo_2987221.html');
												thumbnails[2987223] = new thumbnail(2987223,'183963','Photo','cocktail galleria_thumb.jpg',130, 98,5,'photo_2987223.html');
												thumbnails[2988187] = new thumbnail(2988187,'183968','White space','DSCF2729_thumb.jpg',130, 85,5,'photo_2988187.html');
												thumbnails[2988198] = new thumbnail(2988198,'183968','White space','DSCF2657 - Copy_thumb.jpg',130, 87,5,'photo_2988198.html');
												thumbnails[3013282] = new thumbnail(3013282,'183968','Nike','nike product launch_thumb.jpg',130, 87,5,'photo_3013282.html');
												thumbnails[3013283] = new thumbnail(3013283,'183968','Caterers','caterers_thumb.jpg',130, 84,5,'photo_3013283.html');
												thumbnails[3013388] = new thumbnail(3013388,'183968','Dwell','dwell_thumb.jpg',130, 87,5,'photo_3013388.html');
												thumbnails[3013668] = new thumbnail(3013668,'183968','dinner','dinner galleria_thumb.jpg',130, 98,5,'photo_3013668.html');
												thumbnails[3013705] = new thumbnail(3013705,'183963','','galleria-window_thumb.jpg',130, 98,5,'photo_3013705.html');
												thumbnails[3013710] = new thumbnail(3013710,'183965','','galleria floor plans_thumb.jpg',130, 95,5,'photo_3013710.html');
												thumbnails[5248269] = new thumbnail(5248269,'183963','Galleria','gallery_thumb.jpg',130, 194,5,'photo_5248269.html');
												thumbnails[5248286] = new thumbnail(5248286,'183963','Pall Mall window','la_galleria_1_thumb.jpg',130, 46,5,'photo_5248286.html');
												thumbnails[5248298] = new thumbnail(5248298,'183968','Hepburn Auction','audrey_hepburn_1_thumb.jpg',130, 87,5,'photo_5248298.html');
												thumbnails[5248309] = new thumbnail(5248309,'183968','','la_galleria_window_2_thumb.jpg',130, 87,5,'photo_5248309.html');
												thumbnails[5248312] = new thumbnail(5248312,'183968','','la_galleria_2_thumb.jpg',130, 41,5,'photo_5248312.html');
												thumbnails[5248326] = new thumbnail(5248326,'183963','Extra walls','Galleria_2_thumb.jpg',130, 53,5,'photo_5248326.html');
												thumbnails[7859708] = new thumbnail(7859708,'183963','','unit_30_white_4_thumb.jpg',130, 194,5,'photo_7859708.html');
												thumbnails[7860336] = new thumbnail(7860336,'183965','','catwalk_3_thumb.jpg',130, 209,5,'photo_7860336.html');
												thumbnails[7860411] = new thumbnail(7860411,'183965','','Freeform_board_ARO_6249_thumb.jpg',130, 91,5,'photo_7860411.html');
												thumbnails[2987116] = new thumbnail(2987116,'183968','Trade Mark party','DSC_0086_thumb.jpg',130, 194,5,'photo_2987116.html');
												thumbnails[2987204] = new thumbnail(2987204,'183968','Nike','nike 2_thumb.jpg',130, 194,5,'photo_2987204.html');
												thumbnails[2987068] = new thumbnail(2987068,'183968','Launch Sony','DSC00406_thumb.jpg',130, 231,5,'photo_2987068.html');
												thumbnails[2985542] = new thumbnail(2985542,'183967','','events_thumb.jpg',130, 84,5,'photo_2985542.html');
												thumbnails[2985546] = new thumbnail(2985546,'183967','Entrance ROA','Copy of Entrance galleria corbis_thumb.jpg',130, 86,5,'photo_2985546.html');
												thumbnails[2985547] = new thumbnail(2985547,'183957','','Copy (5) of la piccola corbis_thumb.jpg',130, 86,5,'photo_2985547.html');
												thumbnails[2985548] = new thumbnail(2985548,'183957','First Floor ','1 floor la Piccola with art_thumb.jpg',130, 98,5,'photo_2985548.html');
												thumbnails[2987184] = new thumbnail(2987184,'183956','Window','DSC_0026_thumb.jpg',130, 168,5,'photo_2987184.html');
												thumbnails[2987194] = new thumbnail(2987194,'183956','Window','DSC_0008_thumb.jpg',130, 89,5,'photo_2987194.html');
												thumbnails[2987197] = new thumbnail(2987197,'183956','External','window_long 160k_thumb.jpg',130, 61,5,'photo_2987197.html');
												thumbnails[2987207] = new thumbnail(2987207,'183957','White','DSCF2744 - Copy_thumb.jpg',130, 87,5,'photo_2987207.html');
												thumbnails[2987209] = new thumbnail(2987209,'183958','Lower Ground','DSC_0101_thumb.jpg',130, 87,5,'photo_2987209.html');
												thumbnails[2987214] = new thumbnail(2987214,'183956','','DSC_9184_thumb.jpg',130, 87,5,'photo_2987214.html');
												thumbnails[2988204] = new thumbnail(2988204,'183956','Blake','DSCF2099_thumb.jpg',130, 87,5,'photo_2988204.html');
												thumbnails[2988215] = new thumbnail(2988215,'183956','ART ROA Gallery','in remote lands_thumb.jpg',130, 87,5,'photo_2988215.html');
												thumbnails[3013393] = new thumbnail(3013393,'183967','Bar ','DSCF0110_thumb.jpg',130, 98,5,'photo_3013393.html');
												thumbnails[3013669] = new thumbnail(3013669,'183959','Arcade party','Xmas _thumb.jpg',130, 98,5,'photo_3013669.html');
												thumbnails[3013701] = new thumbnail(3013701,'183967','La Galleria Counter','dinner galleria1_thumb.jpg',130, 98,5,'photo_3013701.html');
												thumbnails[3013702] = new thumbnail(3013702,'183961','','la piccola-art_thumb.jpg',130, 98,5,'photo_3013702.html');
												thumbnails[3013704] = new thumbnail(3013704,'183957','','piccola stairs photo exhibition_thumb.jpg',130, 87,5,'photo_3013704.html');
												thumbnails[3013706] = new thumbnail(3013706,'183959','Arcade','roa outside_thumb.jpg',130, 86,5,'photo_3013706.html');
												thumbnails[3013712] = new thumbnail(3013712,'183961','','corbis viewing_thumb.jpg',130, 87,5,'photo_3013712.html');
												thumbnails[3013726] = new thumbnail(3013726,'183961','','rikki\'s B_W_thumb.jpg',130, 87,5,'photo_3013726.html');
												thumbnails[3035603] = new thumbnail(3035603,'183960','Floor plan of ROA Gallery','web ROA Gallery floor plan_thumb.jpg',130, 106,5,'photo_3035603.html');
												thumbnails[3456750] = new thumbnail(3456750,'183957','','first floor photography 2_thumb.jpg',130, 87,5,'photo_3456750.html');
												thumbnails[5248277] = new thumbnail(5248277,'183956','ROA ','frontage_thumb.jpg',130, 88,5,'photo_5248277.html');
												thumbnails[5248333] = new thumbnail(5248333,'183956','Window ROA','devon_window_thumb.jpg',130, 194,5,'photo_5248333.html');
												thumbnails[5248340] = new thumbnail(5248340,'183956','','devon_wall_thumb.jpg',130, 87,5,'photo_5248340.html');
												thumbnails[7859730] = new thumbnail(7859730,'183956','','Floor_Plan_galleria_thumb.jpg',130, 179,5,'photo_7859730.html');
												thumbnails[7859739] = new thumbnail(7859739,'183956','','la_galleria_2_C8B02786-1EC9-DFB6-09AFFC54DEABAC93_thumb.jpg',130, 41,5,'photo_7859739.html');
												thumbnails[7859741] = new thumbnail(7859741,'183957','','ROA_High_view_thumb.jpg',130, 87,5,'photo_7859741.html');
												thumbnails[7860392] = new thumbnail(7860392,'183956','','ground_floor__thumb.jpg',130, 195,5,'photo_7860392.html');
												thumbnails[7860396] = new thumbnail(7860396,'183956','','egos10_thumb.jpg',130, 192,5,'photo_7860396.html');
												thumbnails[7860399] = new thumbnail(7860399,'183956','','Egos_exhibition__8__thumb.jpg',130, 87,5,'photo_7860399.html');
												thumbnails[7860400] = new thumbnail(7860400,'183958','','Egos_exhibition_3_ARO_9667_thumb.jpg',130, 87,5,'photo_7860400.html');
												thumbnails[7860406] = new thumbnail(7860406,'183958','','MAAK_3_thumb.jpg',130, 87,5,'photo_7860406.html');
												thumbnails[7860409] = new thumbnail(7860409,'183957','','MAAK_5_thumb.jpg',130, 87,5,'photo_7860409.html');
												thumbnails[2985544] = new thumbnail(2985544,'184079','','party_thumb.jpg',130, 87,5,'photo_2985544.html');
												thumbnails[2987148] = new thumbnail(2987148,'184079','Dinner with Art','event_thumb.jpg',130, 98,5,'photo_2987148.html');
												thumbnails[2987164] = new thumbnail(2987164,'184079',' Bar','bboy glasses_thumb.jpg',130, 83,5,'photo_2987164.html');
												thumbnails[2987178] = new thumbnail(2987178,'184079','Arcade Dinner','arcade eveing with carpet_thumb.jpg',130, 100,5,'photo_2987178.html');
												thumbnails[2987181] = new thumbnail(2987181,'184079','Cocktail','cocktails with art_thumb.jpg',130, 98,5,'photo_2987181.html');
												thumbnails[2987218] = new thumbnail(2987218,'184079','Shoestring','themed for shoestring _thumb.jpg',130, 87,5,'photo_2987218.html');
												thumbnails[2988181] = new thumbnail(2988181,'184079','Dinner','dinner set_thumb.jpg',130, 87,5,'photo_2988181.html');
												thumbnails[3013666] = new thumbnail(3013666,'184079','bar arcade','bar arcade_thumb.jpg',130, 98,5,'photo_3013666.html');
												thumbnails[3456753] = new thumbnail(3456753,'184079','','wedding  galleria 2_thumb.jpg',130, 87,5,'photo_3456753.html');
												thumbnails[3456756] = new thumbnail(3456756,'184079','','wedding close-up_thumb.jpg',130, 195,5,'photo_3456756.html');
												thumbnails[2987177] = new thumbnail(2987177,'184079','Arcade Carpeted','arcade carpeted_thumb.jpg',130, 200,5,'photo_2987177.html');
												thumbnails[2987142] = new thumbnail(2987142,'184079','Art party','art with cocktails_thumb.jpg',130, 190,5,'photo_2987142.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[184080] = new gallery(184080,'2987189,2987131',' La Galleria Outside','section228075',[2987131,2987189],0, 0, '', 'section228075_184080.html',0,0);
				  					galleries[184079] = new gallery(184079,'2987218,2987181,2987178,2987164,2985544','Parties','section228190',[2985544,2987148,2987164,2987178,2987181,2987218,2988181,3013666,3456753,3456756,2987177,2987142],0, 0, '', 'section228190.html',0,1);
				  					galleries[183963] = new gallery(183963,'2987091,2985550','La Galleria  space','section228075',[2985550,2987091,2987154,2987159,2987213,2987216,2987221,2987223,3013705,5248269,5248286,5248326,7859708],0, 0, '', 'section228075_183963.html',0,0);
				  					galleries[183956] = new gallery(183956,'7860392,7859739,2987214,2987194','ROA Ground  Floor','gallery',[2987184,2987194,2987197,2987214,2988204,2988215,5248277,5248333,5248340,7859730,7859739,7860392,7860396,7860399],0, 0, '', 'gallery_183956.html',0,0);
				  					galleries[183968] = new gallery(183968,'2987191','Events','section228075',[2985549,2987191,2988187,2988198,3013282,3013283,3013388,3013668,5248298,5248309,5248312,2987116,2987204,2987068],0, 0, '', 'section228075_183968.html',0,0);
				  					galleries[183957] = new gallery(183957,'7859741','Gallery First floor ','gallery',[2985547,2985548,2987207,3013704,3456750,7859741,7860409],0, 0, '', 'gallery_183957.html',0,0);
				  					galleries[183965] = new gallery(183965,'7860411','Floorplan','section228075',[3013710,7860336,7860411],0, 0, '', 'section228075_183965.html',0,0);
				  					galleries[183958] = new gallery(183958,'7860400','Gallery Lower ground ','gallery',[2987209,7860400,7860406],0, 0, '', 'gallery_183958.html',0,0);
				  					galleries[183959] = new gallery(183959,'3013706','Arcade outside','gallery',[3013669,3013706],0, 0, '', 'gallery_183959.html',0,0);
				  					galleries[183966] = new gallery(183966,'2987109,2985545,2985541','Sculpture','section228075',[2985541,2985545,2987109],0, 0, '', 'section228075_183966.html',0,0);
				  					galleries[183960] = new gallery(183960,'3035603','Floorplan','gallery',[3035603],0, 0, '', 'gallery_183960.html',0,0);
				  					galleries[183961] = new gallery(183961,'3013726,3013712,3013702','Exhibitions','gallery',[3013702,3013712,3013726],0, 0, '', 'gallery_183961.html',0,0);
				  					galleries[183967] = new gallery(183967,'3013701','Events','gallery',[2985542,2985546,3013393,3013701],0, 0, '', 'gallery_183967.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7860396,7859708,7113833,5248277,2988215,2988204,2987209,2987159,2985550,2985548,2985542';
imageSets[2] = '7860411,7860400,7860392,7859741,7859739,3013706,3013701,2987218,2987214,2987194,2987191,2987181,2987178,2987164,2987091,2985550,2985544';
imageSets[3] = '7860409,7860406,7860399,7860336,7859730,5248340,5248333,5248326,5248312,5248309,5248298,5248286,5248277,5248269,2987221';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/hiregallery/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/hiregallery/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 += 'section228075.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 && 'section228075' != '') {
					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 = 'www.hiregallery.co.uk: ' + 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;
	}
}

			

