window.thumbnails = new Object();
												thumbnails[7233555] = new thumbnail(7233555,'','','sunrise1nahled1_thumb.jpg',130, 85,15,'							photo_7233555.html');
												thumbnails[812467] = new thumbnail(812467,'62816','Christy','Christy_thumb.jpg',130, 195,15,'							photo_812467.html');
												thumbnails[812468] = new thumbnail(812468,'62816','Christy1','Christy (1)_thumb.jpg',130, 163,15,'							photo_812468.html');
												thumbnails[812469] = new thumbnail(812469,'62816','','Christy (2)_thumb.jpg',130, 179,15,'							photo_812469.html');
												thumbnails[812470] = new thumbnail(812470,'62816','Christy3','Christy (3)_thumb.jpg',130, 195,15,'							photo_812470.html');
												thumbnails[812471] = new thumbnail(812471,'62816','Christy4','Christy (4)_thumb.jpg',130, 195,15,'							photo_812471.html');
												thumbnails[812472] = new thumbnail(812472,'62816','','Christy (5)_thumb.jpg',130, 149,15,'							photo_812472.html');
												thumbnails[812474] = new thumbnail(812474,'62816','Christy6','Christy (6)_thumb.jpg',130, 195,15,'							photo_812474.html');
												thumbnails[812477] = new thumbnail(812477,'62816','Christy7','Christy (7)_thumb.jpg',130, 163,15,'							photo_812477.html');
												thumbnails[812479] = new thumbnail(812479,'62816','Christy8','Christy (8)_thumb.jpg',130, 195,15,'							photo_812479.html');
												thumbnails[812481] = new thumbnail(812481,'62816','Christy9','Christy (9)_thumb.jpg',130, 195,15,'							photo_812481.html');
												thumbnails[812483] = new thumbnail(812483,'62816','Christy8','Christy (10)_thumb.jpg',130, 163,15,'							photo_812483.html');
												thumbnails[812485] = new thumbnail(812485,'62816','Christy9','Christy (11)_thumb.jpg',130, 169,15,'							photo_812485.html');
												thumbnails[814279] = new thumbnail(814279,'62815','','Eva_thumb.jpg',130, 195,15,'							photo_814279.html');
												thumbnails[814280] = new thumbnail(814280,'62815','','Eva1_thumb.jpg',130, 195,15,'							photo_814280.html');
												thumbnails[814281] = new thumbnail(814281,'62815','','Christy531_thumb.jpg',130, 195,15,'							photo_814281.html');
												thumbnails[814282] = new thumbnail(814282,'62815','','Eva2_thumb.jpg',130, 179,15,'							photo_814282.html');
												thumbnails[814283] = new thumbnail(814283,'62815','','Eva3_thumb.jpg',130, 195,15,'							photo_814283.html');
												thumbnails[814284] = new thumbnail(814284,'62815','','Petra_thumb.jpg',130, 195,15,'							photo_814284.html');
												thumbnails[814285] = new thumbnail(814285,'62815','','Petra3_thumb.jpg',130, 195,15,'							photo_814285.html');
												thumbnails[814286] = new thumbnail(814286,'62815','','JItka_thumb.jpg',130, 195,15,'							photo_814286.html');
												thumbnails[814287] = new thumbnail(814287,'62815','','Petra2_thumb.jpg',130, 195,15,'							photo_814287.html');
												thumbnails[814290] = new thumbnail(814290,'62815','','Petra5_thumb.jpg',130, 195,15,'							photo_814290.html');
												thumbnails[814295] = new thumbnail(814295,'62815','','Christy35_thumb.jpg',130, 195,15,'							photo_814295.html');
												thumbnails[814296] = new thumbnail(814296,'62815','','Petra4_thumb.jpg',130, 195,15,'							photo_814296.html');
												thumbnails[814300] = new thumbnail(814300,'62818','','podesti1_thumb.jpg',130, 195,15,'							photo_814300.html');
												thumbnails[814301] = new thumbnail(814301,'62818','','reka1_thumb.jpg',130, 87,15,'							photo_814301.html');
												thumbnails[814302] = new thumbnail(814302,'62818','','plaz1_thumb.jpg',130, 87,15,'							photo_814302.html');
												thumbnails[814303] = new thumbnail(814303,'62818','','landscape-(5)_thumb.jpg',130, 195,15,'							photo_814303.html');
												thumbnails[814304] = new thumbnail(814304,'62818','','zapadslunce2_thumb.jpg',130, 195,15,'							photo_814304.html');
												thumbnails[814305] = new thumbnail(814305,'62818','','sunrise_thumb.jpg',130, 85,15,'							photo_814305.html');
												thumbnails[814306] = new thumbnail(814306,'62818','','Fog-(12)1_thumb.jpg',130, 87,15,'							photo_814306.html');
												thumbnails[814307] = new thumbnail(814307,'62818','','Australia_sunset-(22)_thumb.jpg',130, 195,15,'							photo_814307.html');
												thumbnails[815975] = new thumbnail(815975,'62814','','Pregnancy-(7)_thumb.jpg',130, 195,15,'							photo_815975.html');
												thumbnails[815985] = new thumbnail(815985,'62809','','col (63)_thumb.jpg',130, 87,15,'							photo_815985.html');
												thumbnails[815987] = new thumbnail(815987,'62809','','baby3_thumb.jpg',130, 195,15,'							photo_815987.html');
												thumbnails[815988] = new thumbnail(815988,'62809','','baby_1week_old-(1)_thumb.jpg',130, 195,15,'							photo_815988.html');
												thumbnails[815989] = new thumbnail(815989,'62809','','col-(62)_thumb.jpg',130, 87,15,'							photo_815989.html');
												thumbnails[815990] = new thumbnail(815990,'62809','','ocka1_thumb.jpg',130, 128,15,'							photo_815990.html');
												thumbnails[815991] = new thumbnail(815991,'62809','','baby_black_and_white-(55)1_thumb.jpg',130, 195,15,'							photo_815991.html');
												thumbnails[816010] = new thumbnail(816010,'62809','','baby21_thumb.jpg',130, 195,15,'							photo_816010.html');
												thumbnails[816012] = new thumbnail(816012,'62809','','col-(64+)_thumb.jpg',130, 87,15,'							photo_816012.html');
												thumbnails[816016] = new thumbnail(816016,'62814','','tehotna (7)1_thumb.jpg',130, 196,15,'							photo_816016.html');
												thumbnails[816017] = new thumbnail(816017,'62814','','IMG_048311_thumb.jpg',130, 196,15,'							photo_816017.html');
												thumbnails[816019] = new thumbnail(816019,'62814','','tehotna-(3)3_thumb.jpg',130, 163,15,'							photo_816019.html');
												thumbnails[816021] = new thumbnail(816021,'63271','','ZL6U96971_thumb.jpg',130, 87,15,'							photo_816021.html');
												thumbnails[816022] = new thumbnail(816022,'63271','','Brent_thumb.jpg',130, 163,15,'							photo_816022.html');
												thumbnails[816023] = new thumbnail(816023,'63271','','ZL6U989711_thumb.jpg',130, 87,15,'							photo_816023.html');
												thumbnails[816024] = new thumbnail(816024,'63271','','Jana1_thumb.jpg',130, 163,15,'							photo_816024.html');
												thumbnails[816025] = new thumbnail(816025,'63272','','Fog (131)_thumb.jpg',130, 195,15,'							photo_816025.html');
												thumbnails[816026] = new thumbnail(816026,'63272','','Australia_deserts (42)_thumb.jpg',130, 87,15,'							photo_816026.html');
												thumbnails[816027] = new thumbnail(816027,'63272','','ZL6U02201_thumb.jpg',130, 87,15,'							photo_816027.html');
												thumbnails[816028] = new thumbnail(816028,'63272','','Beach (4)_thumb.jpg',130, 195,15,'							photo_816028.html');
												thumbnails[821005] = new thumbnail(821005,'62813','','Jessica3_thumb.jpg',130, 195,15,'							photo_821005.html');
												thumbnails[821006] = new thumbnail(821006,'62813','','children_colour_thumb.jpg',130, 87,15,'							photo_821006.html');
												thumbnails[821007] = new thumbnail(821007,'62813','','Roma_children-(25)1_thumb.jpg',130, 85,15,'							photo_821007.html');
												thumbnails[821009] = new thumbnail(821009,'62813','','Anna3_thumb.jpg',130, 163,15,'							photo_821009.html');
												thumbnails[821010] = new thumbnail(821010,'62813','','ZL6U94851_thumb.jpg',130, 195,15,'							photo_821010.html');
												thumbnails[821011] = new thumbnail(821011,'62813','','ZL6U9030_thumb.jpg',130, 87,15,'							photo_821011.html');
												thumbnails[821012] = new thumbnail(821012,'62813','','ZL6U9206_thumb.jpg',130, 104,15,'							photo_821012.html');
												thumbnails[821013] = new thumbnail(821013,'62813','','utika3_thumb.jpg',130, 195,15,'							photo_821013.html');
												thumbnails[4701556] = new thumbnail(4701556,'270386','','ZL6U74241_thumb.jpg',130, 93,15,'							photo_4701556.html');
												thumbnails[4701560] = new thumbnail(4701560,'270386','','ZL6U7874_ret_thumb.jpg',130, 195,15,'							photo_4701560.html');
												thumbnails[4701566] = new thumbnail(4701566,'270386','','ZL6U8036_thumb.jpg',130, 87,15,'							photo_4701566.html');
												thumbnails[4701085] = new thumbnail(4701085,'270382','','ZL6U6289_thumb.JPG',130, 195,15,'							photo_4701085.html');
												thumbnails[4701473] = new thumbnail(4701473,'270387','','44_thumb.jpg',130, 196,15,'							photo_4701473.html');
												thumbnails[4701492] = new thumbnail(4701492,'270386','','ZL6U7508_thumb.jpg',130, 195,15,'							photo_4701492.html');
												thumbnails[4701077] = new thumbnail(4701077,'270382','','IMG_7906_thumb.jpg',130, 86,15,'							photo_4701077.html');
												thumbnails[4701478] = new thumbnail(4701478,'270387','','Deco_0241_thumb.jpg',130, 87,15,'							photo_4701478.html');
												thumbnails[4701501] = new thumbnail(4701501,'270386','','Deco_0237_thumb.jpg',130, 87,15,'							photo_4701501.html');
												thumbnails[4701088] = new thumbnail(4701088,'270382','','ZL6U1421_thumb.JPG',130, 87,15,'							photo_4701088.html');
												thumbnails[4701485] = new thumbnail(4701485,'270387','','Tokio_underground_1_thumb.jpg',130, 86,15,'							photo_4701485.html');
												thumbnails[4701504] = new thumbnail(4701504,'270386','','Tokio_underground_5_thumb.jpg',130, 85,15,'							photo_4701504.html');
												thumbnails[4701099] = new thumbnail(4701099,'270382','','ZL6U4418111_thumb.jpg',130, 195,15,'							photo_4701099.html');
												thumbnails[4701488] = new thumbnail(4701488,'270387','','ZL6U5208cb_thumb.jpg',130, 195,15,'							photo_4701488.html');
												thumbnails[4701514] = new thumbnail(4701514,'270386','','ZL6U2451cb1_thumb.jpg',130, 87,15,'							photo_4701514.html');
												thumbnails[4701108] = new thumbnail(4701108,'270380','','ZL6U2040cb_thumb.jpg',130, 149,15,'							photo_4701108.html');
												thumbnails[7233545] = new thumbnail(7233545,'63272','','Fog_9nahled_thumb.jpg',130, 195,15,'							photo_7233545.html');
												thumbnails[4701114] = new thumbnail(4701114,'270380','','ZL6U3256_thumb.JPG',130, 124,15,'							photo_4701114.html');
												thumbnails[7233550] = new thumbnail(7233550,'63272','','beach_coast111nahled1_thumb.jpg',130, 87,15,'							photo_7233550.html');
												thumbnails[4701118] = new thumbnail(4701118,'270380','','ZL6U5156_thumb.JPG',130, 195,15,'							photo_4701118.html');
												thumbnails[7233599] = new thumbnail(7233599,'63272','','ZL6U1700nahled1_thumb.jpg',130, 87,15,'							photo_7233599.html');
												thumbnails[4701125] = new thumbnail(4701125,'270380','','ZL6U28071cb_thumb.jpg',130, 152,15,'							photo_4701125.html');
												thumbnails[7233607] = new thumbnail(7233607,'63272','','ZL6U3650corIInahled1_thumb.jpg',130, 87,15,'							photo_7233607.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[62814] = new gallery(62814,'816017','Tehotne zeny','gallery',[815975,816016,816017,816019],0, 0, '', '																																																																																																							gallery_62814.html',0,0);
				  					galleries[62809] = new gallery(62809,'815990','Miminka','gallery',[815985,815987,815988,815989,815990,815991,816010,816012],0, 0, '', '																																																																																																							gallery_62809.html',0,0);
				  					galleries[62813] = new gallery(62813,'821009','Deti','gallery',[821005,821006,821007,821009,821010,821011,821012,821013],0, 0, '', '																																																																																																							gallery_62813.html',0,0);
				  					galleries[270380] = new gallery(270380,'4701125,4701118,4701114,4701108','Rodinný portrét','gallery',[4701108,4701114,4701118,4701125],0, 0, '', '																																																																																																							gallery_270380.html',0,0);
				  					galleries[270382] = new gallery(270382,'4701088','Byznys portrét','gallery',[4701085,4701077,4701088,4701099],0, 0, '', '																																																																																																							gallery_270382.html',0,0);
				  					galleries[63271] = new gallery(63271,'816022','Nekonvencni portret','gallery',[816021,816022,816023,816024],0, 0, '', '																																																																																																							gallery_63271.html',0,0);
				  					galleries[62815] = new gallery(62815,'814284','Modní fotografie','gallery',[814279,814280,814281,814282,814283,814284,814285,814286,814287,814290,814295,814296],0, 0, '', '																																																																																																							gallery_62815.html',0,0);
				  					galleries[62816] = new gallery(62816,'812467','Modní portrét ','gallery',[812467,812468,812469,812470,812471,812472,812474,812477,812479,812481,812483,812485],0, 0, '', '																																																																																																							gallery_62816.html',0,0);
				  					galleries[270386] = new gallery(270386,'4701501','Lidi','gallery',[4701556,4701560,4701566,4701492,4701501,4701504,4701514],0, 0, '', '																																																																																																							gallery_270386.html',0,0);
				  					galleries[270387] = new gallery(270387,'4701478','Reportaz','gallery',[4701473,4701478,4701485,4701488],0, 0, '', '																																																																																																							gallery_270387.html',0,0);
				  					galleries[62818] = new gallery(62818,'814301','Krajina','gallery',[814300,814301,814302,814303,814304,814305,814306,814307],0, 0, '', '																																																																																																							gallery_62818.html',0,0);
				  					galleries[63272] = new gallery(63272,'816027','volna tvorba ','gallery',[816025,816026,816027,816028,7233545,7233550,7233599,7233607],0, 0, '', '																																																																																																							gallery_63272.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '816024';
imageSets[2] = '4701501,4701478,4701088,821009,816027,816022,816017,815990,814301,814284,812467';
imageSets[3] = '7233607,7233599,7233555,7233550,7233545,4701566,4701560,4701556,4701514,4701504,4701501,4701492,4701488,4701485,4701478,4701473,4701125,4701118,4701114,4701108,4701099,4701088,4701085,4701077,821013,821012,821011,821010,821009,821007,821006,821005,816028,816027,816026,816025,816024,816023,816022,816021,816019,816017,816016,816012,816010,815991,815990,815989,815988,815987';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/abelson/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/abelson/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/abelson/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/abelson/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://www.clikchurch.com/abelson/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/abelson/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/abelson/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/abelson/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/abelson/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/abelson/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/abelson/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/abelson/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/abelson/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/abelson/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/abelson/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/abelson/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/abelson/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/abelson/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/abelson/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/abelson/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/abelson/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/abelson/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 = 'Abelsonstudio: ' + 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;
	}
}

			

