window.thumbnails = new Object();
												thumbnails[7786828] = new thumbnail(7786828,'420719','','jonasemil_thumb.jpg',130, 184,32,'photo_7786828.html');
												thumbnails[7786844] = new thumbnail(7786844,'311721','','02_E3D41650-24E8-5EC4-4F7A4D7F058FBE20_thumb.jpg',130, 87,32,'photo_7786844.html');
												thumbnails[7786859] = new thumbnail(7786859,'311721','','4_thumb.jpg',130, 87,32,'photo_7786859.html');
												thumbnails[7786877] = new thumbnail(7786877,'190791','','09_E3E1BE9B-24E8-5EC4-4FE4D0B0EE9DE4D9_thumb.jpg',130, 195,32,'photo_7786877.html');
												thumbnails[7786879] = new thumbnail(7786879,'190791','','14_E3E24D50-24E8-5EC4-4FF82B95DD5790E3_thumb.jpg',130, 195,32,'photo_7786879.html');
												thumbnails[7786880] = new thumbnail(7786880,'190791','','18_thumb.jpg',130, 195,32,'photo_7786880.html');
												thumbnails[7786883] = new thumbnail(7786883,'199436','','20_thumb.jpg',130, 195,32,'photo_7786883.html');
												thumbnails[7786894] = new thumbnail(7786894,'199436','','playingdead_thumb.jpg',130, 195,32,'photo_7786894.html');
												thumbnails[7786904] = new thumbnail(7786904,'151048','','02_E3EAF29F-24E8-5EC4-4FC929B243C8113C_thumb.jpg',130, 195,32,'photo_7786904.html');
												thumbnails[7786913] = new thumbnail(7786913,'151048','','09_E3EDB676-24E8-5EC4-4FACA89708F784B8_thumb.jpg',130, 184,32,'photo_7786913.html');
												thumbnails[7786923] = new thumbnail(7786923,'151048','','08_E3F3D999-24E8-5EC4-4F48CC26612CA7F7_thumb.jpg',130, 87,32,'photo_7786923.html');
												thumbnails[7786925] = new thumbnail(7786925,'199436','','12_E3F4AD07-24E8-5EC4-4F4B8DAB17F1777F_thumb.jpg',130, 195,32,'photo_7786925.html');
												thumbnails[7729098] = new thumbnail(7729098,'418147','','04_thumb.jpg',130, 195,32,'photo_7729098.html');
												thumbnails[7729108] = new thumbnail(7729108,'418147','','02_thumb.jpg',130, 195,32,'photo_7729108.html');
												thumbnails[7729131] = new thumbnail(7729131,'418147','','01_AD36C9EC-1E4F-37DC-7171D883CD405D2B_thumb.jpg',130, 195,32,'photo_7729131.html');
												thumbnails[7729149] = new thumbnail(7729149,'418147','','05_thumb.jpg',130, 87,32,'photo_7729149.html');
												thumbnails[7729155] = new thumbnail(7729155,'418147','','06_thumb.jpg',130, 87,32,'photo_7729155.html');
												thumbnails[7729180] = new thumbnail(7729180,'418147','','07_thumb.jpg',130, 87,32,'photo_7729180.html');
												thumbnails[7729402] = new thumbnail(7729402,'418147','','03_thumb.jpg',130, 87,32,'photo_7729402.html');
												thumbnails[3271708] = new thumbnail(3271708,'199436','\"dining with death\"','dining-with-death_thumb.jpg',130, 184,32,'photo_3271708.html');
												thumbnails[3108194] = new thumbnail(3108194,'151185','\"light\"','015_thumb.jpg',130, 92,32,'photo_3108194.html');
												thumbnails[3108209] = new thumbnail(3108209,'151185','\"the bridge\"','025_thumb.jpg',130, 92,32,'photo_3108209.html');
												thumbnails[3108214] = new thumbnail(3108214,'151185','\"style confusion\"<br>\r\n','035_thumb.jpg',130, 92,32,'photo_3108214.html');
												thumbnails[3108234] = new thumbnail(3108234,'151185','\"back in the days\"','045_thumb.jpg',130, 92,32,'photo_3108234.html');
												thumbnails[3108238] = new thumbnail(3108238,'151185','\"Solitude\"','055_thumb.jpg',130, 92,32,'photo_3108238.html');
												thumbnails[3108241] = new thumbnail(3108241,'151185','\"Dark world\"','064_thumb.jpg',130, 92,32,'photo_3108241.html');
												thumbnails[3108336] = new thumbnail(3108336,'162587','\"roomservice\"<br>\r\n','016_thumb.jpg',130, 92,32,'photo_3108336.html');
												thumbnails[3108341] = new thumbnail(3108341,'162587','\"green walls\"<br>\r\n','026_thumb.jpg',130, 92,32,'photo_3108341.html');
												thumbnails[3108348] = new thumbnail(3108348,'162587','\"the blue door\"<br>\r\n','036_thumb.jpg',130, 92,32,'photo_3108348.html');
												thumbnails[3108351] = new thumbnail(3108351,'162587','\"yellow\"<br>\r\n','046_thumb.jpg',130, 92,32,'photo_3108351.html');
												thumbnails[3108355] = new thumbnail(3108355,'162587','\"bricks and bones\"<br>\r\n<br>\r\n','056_thumb.jpg',130, 92,32,'photo_3108355.html');
												thumbnails[3108357] = new thumbnail(3108357,'162587','\"rust in pieces\"<br>\r\n','065_thumb.jpg',130, 92,32,'photo_3108357.html');
												thumbnails[3108358] = new thumbnail(3108358,'162587','\"the heat is on\"<br>\r\n','073_thumb.jpg',130, 92,32,'photo_3108358.html');
												thumbnails[3108362] = new thumbnail(3108362,'162587','\"broken light\"<br>\r\n','08_thumb.jpg',130, 92,32,'photo_3108362.html');
												thumbnails[3108364] = new thumbnail(3108364,'162587','\"room service II\"<br>\r\n','091_thumb.jpg',130, 92,32,'photo_3108364.html');
												thumbnails[3108367] = new thumbnail(3108367,'162587','\"behind closed doors\"<br>\r\n','101_thumb.jpg',130, 184,32,'photo_3108367.html');
												thumbnails[3108372] = new thumbnail(3108372,'162587','\"house by the beach\"<br>\r\n','11_thumb.jpg',130, 184,32,'photo_3108372.html');
												thumbnails[3108375] = new thumbnail(3108375,'162587','\"stairway to ruin\"<br>\r\n','121_thumb.jpg',130, 184,32,'photo_3108375.html');
												thumbnails[3108390] = new thumbnail(3108390,'162587','\"corrosion in 3d\"<br>\r\n','13_thumb.jpg',130, 184,32,'photo_3108390.html');
												thumbnails[3108393] = new thumbnail(3108393,'162587','\"scratch the surface\"<br>\r\n','14_thumb.jpg',130, 184,32,'photo_3108393.html');
												thumbnails[3108399] = new thumbnail(3108399,'162587','\"old fishing hut\"<br>\r\n','15_thumb.jpg',130, 184,32,'photo_3108399.html');
												thumbnails[3108611] = new thumbnail(3108611,'190791','\"Camilla III\"','066_thumb.jpg',130, 184,32,'photo_3108611.html');
												thumbnails[2311778] = new thumbnail(2311778,'151184','\"Room with a view\"','012_thumb.jpg',130, 92,32,'photo_2311778.html');
												thumbnails[2311781] = new thumbnail(2311781,'151184','\"Please enter\"','022_thumb.jpg',130, 92,32,'photo_2311781.html');
												thumbnails[2311786] = new thumbnail(2311786,'151184','\"Lights out\"','032_thumb.jpg',130, 92,32,'photo_2311786.html');
												thumbnails[2311793] = new thumbnail(2311793,'151184','\"captivity\"','051_thumb.jpg',130, 92,32,'photo_2311793.html');
												thumbnails[2311794] = new thumbnail(2311794,'151184','\"looking in - looking out\"','061_thumb.jpg',130, 92,32,'photo_2311794.html');
												thumbnails[2311797] = new thumbnail(2311797,'151184','\"the ribcage\"','12_thumb.jpg',130, 92,32,'photo_2311797.html');
												thumbnails[2311804] = new thumbnail(2311804,'151048','\"The man and the sea\"','013_thumb.jpg',130, 92,32,'photo_2311804.html');
												thumbnails[2311805] = new thumbnail(2311805,'151048','\"before the storm\"','023_thumb.jpg',130, 92,32,'photo_2311805.html');
												thumbnails[2311817] = new thumbnail(2311817,'151048','\"on the rocks\"','042_thumb.jpg',130, 92,32,'photo_2311817.html');
												thumbnails[2311818] = new thumbnail(2311818,'151048','\"Rocks\"','052_thumb.jpg',130, 92,32,'photo_2311818.html');
												thumbnails[2311877] = new thumbnail(2311877,'151048','\"road to ruin\"','211_thumb.jpg',130, 184,32,'photo_2311877.html');
												thumbnails[2311878] = new thumbnail(2311878,'151048','\"back in the days\"','201_thumb.jpg',130, 184,32,'photo_2311878.html');
												thumbnails[2311882] = new thumbnail(2311882,'151048','\"three of a kind\"','221_thumb.jpg',130, 184,32,'photo_2311882.html');
												thumbnails[2666690] = new thumbnail(2666690,'168707','art by definition 1','art-of-destuction-1_thumb.jpg',130, 184,32,'photo_2666690.html');
												thumbnails[2666691] = new thumbnail(2666691,'168707','break my face!','broken-face_thumb.jpg',130, 184,32,'photo_2666691.html');
												thumbnails[2666695] = new thumbnail(2666695,'168707','art by definition 2','art-of-destuction-2_thumb.jpg',130, 184,32,'photo_2666695.html');
												thumbnails[2666899] = new thumbnail(2666899,'151184','\"house by the railway\"','vojenshus_thumb.jpg',130, 92,32,'photo_2666899.html');
												thumbnails[2666941] = new thumbnail(2666941,'168707','\"art by definition 3\"','art-of-destuction-3_thumb.jpg',130, 92,32,'photo_2666941.html');
												thumbnails[3861577] = new thumbnail(3861577,'168707','\"crop the crap\"','cropthecrap_thumb.jpg',130, 92,32,'photo_3861577.html');
												thumbnails[3861602] = new thumbnail(3861602,'168707','\"3 stooges\"','3stooges_thumb.jpg',130, 92,32,'photo_3861602.html');
												thumbnails[3861614] = new thumbnail(3861614,'168707','\"emptiness is a clichee\"','emptiness_thumb.jpg',130, 184,32,'photo_3861614.html');
												thumbnails[3862260] = new thumbnail(3862260,'199436','\"life is pain\"','lifeispain_thumb.jpg',130, 184,32,'photo_3862260.html');
												thumbnails[4614656] = new thumbnail(4614656,'190791','Mirja','10_thumb.jpg',130, 184,32,'photo_4614656.html');
												thumbnails[5505123] = new thumbnail(5505123,'311721','Frieda','01_thumb.jpg',130, 184,32,'photo_5505123.html');
												thumbnails[5505165] = new thumbnail(5505165,'420719','\"vintage\"','06_CDC86315-1EC9-D45B-1C02185B95443D9D_thumb.jpg',130, 184,32,'photo_5505165.html');
												thumbnails[5505234] = new thumbnail(5505234,'311721','\"angel\"','09_CDD2C0E2-1EC9-D45B-1C268CC4C1F365D7_thumb.jpg',130, 92,32,'photo_5505234.html');
												thumbnails[5505239] = new thumbnail(5505239,'311721','\"Frieda\"','07_CDD3D000-1EC9-D45B-1CA4EC03BFDAFC9B_thumb.jpg',130, 92,32,'photo_5505239.html');
												thumbnails[5505331] = new thumbnail(5505331,'199436','\"Jeallousy is a bitch\", Mirja','JEALOUSY-IS-A-BITCH_thumb.jpg',130, 184,32,'photo_5505331.html');
												thumbnails[6012905] = new thumbnail(6012905,'199436','Mirja ','10_C56A1211-1D09-001F-99B00EE287A97DCC_thumb.jpg',130, 184,32,'photo_6012905.html');
												thumbnails[6012917] = new thumbnail(6012917,'190791','MIRJA','12_C56D4A98-1D09-001F-99F5D470D1F89519_thumb.jpg',130, 184,32,'photo_6012917.html');
												thumbnails[6012967] = new thumbnail(6012967,'199436','MIRJA','14_C58198D6-1D09-001F-99C870B9DA53197A_thumb.jpg',130, 184,32,'photo_6012967.html');
												thumbnails[6012977] = new thumbnail(6012977,'199436','HENRIETTE','15_C5866EA1-1D09-001F-999989EA1CFE8225_thumb.jpg',130, 184,32,'photo_6012977.html');
												thumbnails[6211299] = new thumbnail(6211299,'190791','Sarah Simone ','17_thumb.jpg',130, 195,32,'photo_6211299.html');
												thumbnails[6211306] = new thumbnail(6211306,'311721','\"Thilde\"','10_66286CA8-24E8-5EC4-4F4BF1B8268B80F5_thumb.jpg',130, 130,32,'photo_6211306.html');
												thumbnails[7224657] = new thumbnail(7224657,'190791','','25_thumb.jpg',130, 184,32,'photo_7224657.html');
												thumbnails[7443040] = new thumbnail(7443040,'311721','','09_thumb.jpg',130, 92,32,'photo_7443040.html');
												thumbnails[7443044] = new thumbnail(7443044,'311721','','10_4EBFB54D-1E4F-37DC-71424B097ED1B425_thumb.jpg',130, 92,32,'photo_7443044.html');
												thumbnails[7443048] = new thumbnail(7443048,'420719','','12_4EC05547-1E4F-37DC-71B0CD30EB3F2681_thumb.jpg',130, 92,32,'photo_7443048.html');
												thumbnails[7443058] = new thumbnail(7443058,'311721','','11_4EC0F1E9-1E4F-37DC-71CD2AA31BC3C880_thumb.jpg',130, 184,32,'photo_7443058.html');
												thumbnails[7443062] = new thumbnail(7443062,'311721','','08_4EC163A5-1E4F-37DC-71F6CD7DDDB88C45_thumb.jpg',130, 184,32,'photo_7443062.html');
												thumbnails[7443144] = new thumbnail(7443144,'311721','','13_4ECE18B6-1E4F-37DC-712EC13DE37F1EA7_thumb.jpg',130, 184,32,'photo_7443144.html');
												thumbnails[7443149] = new thumbnail(7443149,'311721','','14_4ECE8976-1E4F-37DC-71647E7536B87A54_thumb.jpg',130, 184,32,'photo_7443149.html');
												thumbnails[7443151] = new thumbnail(7443151,'420719','','15_4ECEE2D1-1E4F-37DC-71BC4F6CA3860EEA_thumb.jpg',130, 184,32,'photo_7443151.html');
												thumbnails[7443189] = new thumbnail(7443189,'311721','','16_thumb.jpg',130, 92,32,'photo_7443189.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[199436] = new gallery(199436,'7786925,7786894,6012977,6012967','arty','section193163',[7786883,7786894,7786925,3271708,3862260,5505331,6012905,6012967,6012977],0, 0, '', 'section193163_199436.html',0,0);
				  					galleries[420719] = new gallery(420719,'7786828,5505165','chairsessions','section193163',[7786828,5505165,7443048,7443151],0, 0, '', 'section193163_420719.html',0,0);
				  					galleries[162587] = new gallery(162587,'3108390,3108367','house','section193163',[3108336,3108341,3108348,3108351,3108355,3108357,3108358,3108362,3108364,3108367,3108372,3108375,3108390,3108393,3108399],0, 0, '', 'section193163_162587.html',0,0);
				  					galleries[311721] = new gallery(311721,'7786859,7443040','kids','section193163',[7786844,7786859,5505123,5505234,5505239,6211306,7443040,7443044,7443058,7443062,7443144,7443149,7443189],0, 0, '', 'section193163_311721.html',0,0);
				  					galleries[151185] = new gallery(151185,'3108209,3108194','landscapes','section193163',[3108194,3108209,3108214,3108234,3108238,3108241],0, 0, '', 'section193163_151185.html',0,0);
				  					galleries[190791] = new gallery(190791,'7786879,7224657','Model work','section193163',[7786877,7786879,7786880,3108611,4614656,6012917,6211299,7224657],0, 0, '', 'section193163_190791.html',0,0);
				  					galleries[418147] = new gallery(418147,'7729155','modelwork2','section193163',[7729098,7729108,7729131,7729149,7729155,7729180,7729402],0, 0, '', 'section193163_418147.html',0,0);
				  					galleries[151048] = new gallery(151048,'7786923,7786904,2311804','nature','section193163',[7786904,7786913,7786923,2311804,2311805,2311817,2311818,2311877,2311878,2311882],0, 0, '', 'section193163_151048.html',0,0);
				  					galleries[151184] = new gallery(151184,'2666899,2311781','textures','section193163',[2311778,2311781,2311786,2311793,2311794,2311797,2666899],0, 0, '', 'section193163_151184.html',0,0);
				  					galleries[168707] = new gallery(168707,'3861602,2666941','urban art','section193163',[2666690,2666691,2666695,2666941,3861577,3861602,3861614],0, 0, '', 'section193163_168707.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7786913,7786859,7443048,3861602,3861577,3108357,3108351,3108348,3108214,2666941';
imageSets[2] = '7786925,7786923,7786904,7786894,7786879,7786859,7786828,7729155,7443040,7224657,6012977,6012967,5505165,3861602,3108390,3108367,3108209,3108194,2666941,2666899,2311804,2311781';
imageSets[3] = '7786925,7786923,7786913,7786904,7786894,7786883,7786880,7786879,7786877,7786859,7786844,7786828,7729402,7729180,7729155,7729149,7729131,7729108,7729098,7443189,7443151,7443149,7443144,7443062,7443058,7443048,7443044,7443040,7224657,6211306,6211299,6012977,6012967,6012917,6012905,5505331,5505239,5505234,5505165,5505123,4614656,3862260,3861614,3861602,3861577,3271708,3108611,3108399,3108393,3108390';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/bloodduster/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/bloodduster/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 += 'section193163.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 && 'section193163' != '') {
					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 = 'visby: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));      $('body').trigger('clikUpdate');    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object') {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp = temp + '<p>Order this print:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (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;
	}
}

			

