window.thumbnails = new Object();
												thumbnails[3937368] = new thumbnail(3937368,'238822','','lolita_4_thumb.jpg',130, 130,15,'																			photo_3937368.html');
												thumbnails[3937372] = new thumbnail(3937372,'238822','','lolita_1_thumb.jpg',130, 130,15,'																			photo_3937372.html');
												thumbnails[3937376] = new thumbnail(3937376,'238822','','lolita_2_thumb.jpg',130, 130,15,'																			photo_3937376.html');
												thumbnails[3937434] = new thumbnail(3937434,'238822','','DSC_0233-red_thumb.jpg',130, 130,15,'																			photo_3937434.html');
												thumbnails[3937438] = new thumbnail(3937438,'238823','','kvadrat1_jpg_thumb.jpg',130, 130,15,'																			photo_3937438.html');
												thumbnails[3937439] = new thumbnail(3937439,'238823','','kvadrat2_jpg_thumb.jpg',130, 130,15,'																			photo_3937439.html');
												thumbnails[3937442] = new thumbnail(3937442,'222263','','jonna_thumb.jpg',130, 130,15,'																			photo_3937442.html');
												thumbnails[4016683] = new thumbnail(4016683,'222263','','Portfolio_1_thumb.jpg',130, 89,15,'																			photo_4016683.html');
												thumbnails[4016762] = new thumbnail(4016762,'238825','','001029_thumb.jpg',130, 78,15,'																			photo_4016762.html');
												thumbnails[5076302] = new thumbnail(5076302,'287184','','masker4_thumb.jpg',130, 130,15,'																			photo_5076302.html');
												thumbnails[4016651] = new thumbnail(4016651,'238825','','DSC_0104-red_thumb.jpg',130, 78,15,'																			photo_4016651.html');
												thumbnails[4016682] = new thumbnail(4016682,'222263','','Portfolio_2_thumb.jpg',130, 89,15,'																			photo_4016682.html');
												thumbnails[5076294] = new thumbnail(5076294,'287184','','masker3_thumb.jpg',130, 130,15,'																			photo_5076294.html');
												thumbnails[4016769] = new thumbnail(4016769,'222263','','Portfolio_32_thumb.jpg',130, 89,15,'																			photo_4016769.html');
												thumbnails[5076252] = new thumbnail(5076252,'287184','','masker1_thumb.jpg',130, 130,15,'																			photo_5076252.html');
												thumbnails[4016854] = new thumbnail(4016854,'222263','','Portfolio_4_thumb.jpg',130, 89,15,'																			photo_4016854.html');
												thumbnails[5076260] = new thumbnail(5076260,'287184','','masker2_thumb.jpg',130, 130,15,'																			photo_5076260.html');
												thumbnails[4016851] = new thumbnail(4016851,'222263','','Portfolio_5_thumb.jpg',130, 89,15,'																			photo_4016851.html');
												thumbnails[4016796] = new thumbnail(4016796,'222263','','Portfolio_7_thumb.jpg',130, 89,15,'																			photo_4016796.html');
												thumbnails[4016808] = new thumbnail(4016808,'222263','','Portfolio_6_thumb.jpg',130, 89,15,'																			photo_4016808.html');
												thumbnails[7438504] = new thumbnail(7438504,'240341','','Lolitadrawing11_thumb.jpg',160, 160,15,'																			photo_7438504.html');
												thumbnails[7438506] = new thumbnail(7438506,'240341','','Lolitadrawing212_thumb.jpg',160, 160,15,'																			photo_7438506.html');
												thumbnails[7438507] = new thumbnail(7438507,'240341','','Lolitadrawing31_thumb.jpg',160, 160,15,'																			photo_7438507.html');
												thumbnails[7424860] = new thumbnail(7424860,'402445','','IllDyr_11_thumb.jpg',160, 160,15,'																			photo_7424860.html');
												thumbnails[7434787] = new thumbnail(7434787,'403082','','Ask1_thumb.jpg',160, 160,15,'																			photo_7434787.html');
												thumbnails[7437579] = new thumbnail(7437579,'287186','','portrait_3_thumb.jpg',160, 160,15,'																			photo_7437579.html');
												thumbnails[7434788] = new thumbnail(7434788,'403082','','Ask2_thumb.jpg',160, 160,15,'																			photo_7434788.html');
												thumbnails[7437569] = new thumbnail(7437569,'402445','','IllDyr_2_thumb.jpg',158, 160,15,'																			photo_7437569.html');
												thumbnails[7437581] = new thumbnail(7437581,'287186','','portrait_4_thumb.jpg',160, 160,15,'																			photo_7437581.html');
												thumbnails[7434790] = new thumbnail(7434790,'403082','','Ask3_thumb.jpg',160, 160,15,'																			photo_7434790.html');
												thumbnails[7437571] = new thumbnail(7437571,'402445','','IllDyr_3_thumb.jpg',160, 124,15,'																			photo_7437571.html');
												thumbnails[7437587] = new thumbnail(7437587,'287186','','portrait_6_thumb.jpg',134, 160,15,'																			photo_7437587.html');
												thumbnails[7434791] = new thumbnail(7434791,'403082','','Ask4_thumb.jpg',160, 160,15,'																			photo_7434791.html');
												thumbnails[7437583] = new thumbnail(7437583,'287186','','portrait_5_thumb.jpg',134, 160,15,'																			photo_7437583.html');
												thumbnails[7434792] = new thumbnail(7434792,'403082','','Ask5_thumb.jpg',160, 160,15,'																			photo_7434792.html');
												thumbnails[7437577] = new thumbnail(7437577,'287186','','portrait_2_thumb.jpg',160, 124,15,'																			photo_7437577.html');
												thumbnails[7437572] = new thumbnail(7437572,'287186','','portrait_1_thumb.jpg',160, 124,15,'																			photo_7437572.html');
												thumbnails[7432150] = new thumbnail(7432150,'402873','','dictionary112_thumb.jpg',160, 160,15,'																			photo_7432150.html');
												thumbnails[7432178] = new thumbnail(7432178,'402852','','Font_1123_thumb.jpg',160, 160,15,'																			photo_7432178.html');
												thumbnails[7432248] = new thumbnail(7432248,'402853','','Lenicafont_112_thumb.jpg',113, 160,15,'																			photo_7432248.html');
												thumbnails[7432350] = new thumbnail(7432350,'402890','','Pictogram_1123_thumb.jpg',160, 160,15,'																			photo_7432350.html');
												thumbnails[7432363] = new thumbnail(7432363,'402891','','Agendalogo_112_thumb.jpg',160, 160,15,'																			photo_7432363.html');
												thumbnails[7432381] = new thumbnail(7432381,'402896','','kalender_1_thumb.jpg',113, 160,15,'																			photo_7432381.html');
												thumbnails[7437588] = new thumbnail(7437588,'403252','','Theatre_1_thumb.jpg',109, 160,15,'																			photo_7437588.html');
												thumbnails[7439346] = new thumbnail(7439346,'403317','','folder7_thumb.jpg',160, 160,15,'																			photo_7439346.html');
												thumbnails[7432151] = new thumbnail(7432151,'402873','','dictionary2123_thumb.jpg',160, 160,15,'																			photo_7432151.html');
												thumbnails[7432180] = new thumbnail(7432180,'402852','','Font_212_thumb.jpg',160, 160,15,'																			photo_7432180.html');
												thumbnails[7432252] = new thumbnail(7432252,'402853','','Lenicafont_21_thumb.jpg',113, 160,15,'																			photo_7432252.html');
												thumbnails[7432353] = new thumbnail(7432353,'402890','','Pictogram_21_thumb.jpg',160, 160,15,'																			photo_7432353.html');
												thumbnails[7432364] = new thumbnail(7432364,'402891','','Agendalogo_2123_thumb.jpg',160, 160,15,'																			photo_7432364.html');
												thumbnails[7432383] = new thumbnail(7432383,'402896','','kalender_2_thumb.jpg',113, 160,15,'																			photo_7432383.html');
												thumbnails[7437589] = new thumbnail(7437589,'403252','','Theatre_2_thumb.jpg',108, 160,15,'																			photo_7437589.html');
												thumbnails[7439345] = new thumbnail(7439345,'403317','','folder6_thumb.jpg',160, 160,15,'																			photo_7439345.html');
												thumbnails[7432160] = new thumbnail(7432160,'402873','','dictionary8123_thumb.jpg',160, 160,15,'																			photo_7432160.html');
												thumbnails[7432182] = new thumbnail(7432182,'402852','','Font_312_thumb.jpg',160, 160,15,'																			photo_7432182.html');
												thumbnails[7432254] = new thumbnail(7432254,'402853','','Lenicafont_31_thumb.jpg',113, 160,15,'																			photo_7432254.html');
												thumbnails[7432300] = new thumbnail(7432300,'402891','','Agendalogo_31_thumb.jpg',160, 160,15,'																			photo_7432300.html');
												thumbnails[7437592] = new thumbnail(7437592,'403252','','Theatre_3_thumb.jpg',109, 160,15,'																			photo_7437592.html');
												thumbnails[7439343] = new thumbnail(7439343,'403317','','folder5_thumb.jpg',160, 160,15,'																			photo_7439343.html');
												thumbnails[7432152] = new thumbnail(7432152,'402873','','dictionary312_thumb.jpg',160, 124,15,'																			photo_7432152.html');
												thumbnails[7432183] = new thumbnail(7432183,'402852','','Font_412_thumb.jpg',160, 160,15,'																			photo_7432183.html');
												thumbnails[7432258] = new thumbnail(7432258,'402853','','Lenicafont_41_thumb.jpg',113, 160,15,'																			photo_7432258.html');
												thumbnails[7439349] = new thumbnail(7439349,'403317','','folder8_thumb.jpg',160, 160,15,'																			photo_7439349.html');
												thumbnails[7432153] = new thumbnail(7432153,'402873','','dictionary412_thumb.jpg',160, 124,15,'																			photo_7432153.html');
												thumbnails[7432229] = new thumbnail(7432229,'402852','','Font_51_thumb.jpg',160, 124,15,'																			photo_7432229.html');
												thumbnails[7432259] = new thumbnail(7432259,'402853','','Lenicafont_51_thumb.jpg',113, 160,15,'																			photo_7432259.html');
												thumbnails[7439342] = new thumbnail(7439342,'403317','','folder4_thumb.jpg',160, 160,15,'																			photo_7439342.html');
												thumbnails[7432154] = new thumbnail(7432154,'402873','','dictionary512_thumb.jpg',160, 124,15,'																			photo_7432154.html');
												thumbnails[7432233] = new thumbnail(7432233,'402852','','Font_612_thumb.jpg',160, 124,15,'																			photo_7432233.html');
												thumbnails[7432261] = new thumbnail(7432261,'402853','','Lenicafont_61_thumb.jpg',113, 160,15,'																			photo_7432261.html');
												thumbnails[7439341] = new thumbnail(7439341,'403317','','folder3_thumb.jpg',160, 160,15,'																			photo_7439341.html');
												thumbnails[7432157] = new thumbnail(7432157,'402873','','dictionary712_thumb.jpg',160, 160,15,'																			photo_7432157.html');
												thumbnails[7432262] = new thumbnail(7432262,'402853','','Lenicafont_71_thumb.jpg',113, 160,15,'																			photo_7432262.html');
												thumbnails[7439336] = new thumbnail(7439336,'403317','','folder11_thumb.jpg',160, 160,15,'																			photo_7439336.html');
												thumbnails[7431878] = new thumbnail(7431878,'402853','','Lenicafont_8_thumb.jpg',160, 160,15,'																			photo_7431878.html');
												thumbnails[7432155] = new thumbnail(7432155,'402873','','dictionary612_thumb.jpg',160, 124,15,'																			photo_7432155.html');
												thumbnails[7439340] = new thumbnail(7439340,'403317','','folder2_thumb.jpg',160, 160,15,'																			photo_7439340.html');
												thumbnails[7431882] = new thumbnail(7431882,'402853','','Lenicafont_9_thumb.jpg',160, 124,15,'																			photo_7431882.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[403082] = new gallery(403082,'7434787','Collages','section291109',[7434787,7434788,7434790,7434791,7434792],0, 0, '', '																																																																																																							section291109_403082.html',0,0);
				  					galleries[402873] = new gallery(402873,'7432150','Dictionary','section480377',[7432150,7432151,7432160,7432152,7432153,7432154,7432157,7432155],0, 0, '', '																																																																																																							section480377_402873.html',0,0);
				  					galleries[287184] = new gallery(287184,'5076302','Untitled','gallery',[5076302,5076294,5076252,5076260],0, 0, '', '																																																																																																							gallery_287184.html',0,0);
				  					galleries[402891] = new gallery(402891,'7432300','Logo','section480377',[7432363,7432364,7432300],0, 0, '', '																																																																																																							section480377_402891.html',0,0);
				  					galleries[238822] = new gallery(238822,'3937372','Lolita','gallery',[3937368,3937372,3937376,3937434],0, 0, '', '																																																																																																							gallery_238822.html',0,0);
				  					galleries[240341] = new gallery(240341,'7438507,7438506,7438504','Lolita (drawings)','section291109',[7438504,7438506,7438507],0, 0, '', '																																																																																																							section291109_240341.html',0,0);
				  					galleries[402890] = new gallery(402890,'7432353,7432350','Pictogram','section480377',[7432350,7432353],0, 0, '', '																																																																																																							section480377_402890.html',0,0);
				  					galleries[287186] = new gallery(287186,'7437579','Portraits','section291109',[7437579,7437581,7437587,7437583,7437577,7437572],0, 0, '', '																																																																																																							section291109_287186.html',0,0);
				  					galleries[402445] = new gallery(402445,'7437569','Animals','section291109',[7424860,7437569,7437571],0, 0, '', '																																																																																																							section291109_402445.html',0,0);
				  					galleries[238823] = new gallery(238823,'3937438','Foible','gallery',[3937438,3937439],0, 0, '', '																																																																																																							gallery_238823.html',0,0);
				  					galleries[403317] = new gallery(403317,'7439349,7439346,7439345,7439343,7439342,7439341,7439340,7439336','Folder','section480377',[7439346,7439345,7439343,7439349,7439342,7439341,7439336,7439340],0, 0, '', '																																																																																																							section480377_403317.html',0,0);
				  					galleries[222263] = new gallery(222263,'4016683','Embrace of the Poetical Moment','gallery',[3937442,4016683,4016682,4016769,4016854,4016851,4016796,4016808],0, 0, '', '																																																																																																							gallery_222263.html',0,0);
				  					galleries[402852] = new gallery(402852,'7432178','Font #1','section480377',[7432178,7432180,7432182,7432183,7432229,7432233],0, 0, '', '																																																																																																							section480377_402852.html',0,0);
				  					galleries[238825] = new gallery(238825,'4016762','Apathy','gallery',[4016762,4016651],0, 0, '', '																																																																																																							gallery_238825.html',0,0);
				  					galleries[402853] = new gallery(402853,'7431878','Font #2','section480377',[7432248,7432252,7432254,7432258,7432259,7432261,7432262,7431878,7431882],0, 0, '', '																																																																																																							section480377_402853.html',0,0);
				  					galleries[403252] = new gallery(403252,'7437588','Posters','section480377',[7437588,7437589,7437592],0, 0, '', '																																																																																																							section480377_403252.html',0,0);
				  					galleries[402896] = new gallery(402896,'7432383,7432381','Calendars','section480377',[7432381,7432383],0, 0, '', '																																																																																																							section480377_402896.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '3937438';
imageSets[2] = '7437588,7437579,7437569,7434787,7432300,7432178,7432150,7431878,5076302,4016762,4016683,3937438,3937372';
imageSets[3] = '7439349,7439346,7439345,7439343,7439342,7439341,7439340,7439336,7438507,7438506,7438504,7437592,7437589,7437588,7437587,7437583,7437581,7437579,7437577,7437572,7437571,7437569,7434792,7434791,7434790,7434788,7434787,7432383,7432381,7432364,7432363,7432353,7432350,7432300,7432262,7432261,7432259,7432258,7432254,7432252,7432248,7432233,7432229,7432183,7432182,7432180,7432178,7432160,7432157,7432155';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/johanne21/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/johanne21/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/johanne21/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/johanne21/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/johanne21/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/johanne21/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/johanne21/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/johanne21/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/johanne21/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/johanne21/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/johanne21/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/johanne21/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/johanne21/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/johanne21/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/johanne21/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/johanne21/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/johanne21/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/johanne21/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/johanne21/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/johanne21/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/johanne21/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/johanne21/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 = 'JOHANNE LIAN OLSEN';
			    }
        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;
	}
}

			

