window.thumbnails = new Object();
												thumbnails[7518614] = new thumbnail(7518614,'365786','','cafe_thumb.jpg',130, 205,5,'photo_7518614.html');
												thumbnails[7518624] = new thumbnail(7518624,'365786','','burano1_thumb.jpg',130, 95,5,'photo_7518624.html');
												thumbnails[7518627] = new thumbnail(7518627,'365786','','campanile_thumb.jpg',130, 130,5,'photo_7518627.html');
												thumbnails[7518628] = new thumbnail(7518628,'365786','','cemetary_thumb.jpg',130, 95,5,'photo_7518628.html');
												thumbnails[7518631] = new thumbnail(7518631,'365786','','couple_thumb.jpg',130, 130,5,'photo_7518631.html');
												thumbnails[7518633] = new thumbnail(7518633,'365786','','gondolas_thumb.jpg',130, 100,5,'photo_7518633.html');
												thumbnails[7518634] = new thumbnail(7518634,'365786','','gondoliere_thumb.jpg',130, 112,5,'photo_7518634.html');
												thumbnails[7518635] = new thumbnail(7518635,'365786','','oldmen_thumb.jpg',130, 196,5,'photo_7518635.html');
												thumbnails[7518636] = new thumbnail(7518636,'365786','','rialto_thumb.jpg',130, 93,5,'photo_7518636.html');
												thumbnails[7518637] = new thumbnail(7518637,'365786','','rivadisciavoni_thumb.jpg',130, 105,5,'photo_7518637.html');
												thumbnails[7521792] = new thumbnail(7521792,'407777','','16p_phiole_p-Bearbeitet_thumb.jpg',130, 132,5,'photo_7521792.html');
												thumbnails[7526335] = new thumbnail(7526335,'407777','','17p_roterStuhl_p-Bearbeitet_thumb.jpg',130, 131,5,'photo_7526335.html');
												thumbnails[7526336] = new thumbnail(7526336,'407777','','18p_sitzgruppe_p_thumb.jpg',130, 130,5,'photo_7526336.html');
												thumbnails[7526339] = new thumbnail(7526339,'407777','','palazzo1_thumb.jpg',130, 132,5,'photo_7526339.html');
												thumbnails[7526373] = new thumbnail(7526373,'365787','','aldo_totale-Bearbeitet_thumb.jpg',130, 129,5,'photo_7526373.html');
												thumbnails[7526394] = new thumbnail(7526394,'365787','','iv02cellist-Bearbeitet_thumb.jpg',130, 97,5,'photo_7526394.html');
												thumbnails[7526396] = new thumbnail(7526396,'365787','','olbi_portrait_b_thumb.jpg',130, 162,5,'photo_7526396.html');
												thumbnails[7526397] = new thumbnail(7526397,'365787','','portr_gond-Bearbeitet_thumb.jpg',130, 132,5,'photo_7526397.html');
												thumbnails[7526399] = new thumbnail(7526399,'365787','','portrait-silber-Bearbeitet_thumb.jpg',130, 132,5,'photo_7526399.html');
												thumbnails[7526411] = new thumbnail(7526411,'365787','','silvio_4-6b_thumb.jpg',130, 173,5,'photo_7526411.html');
												thumbnails[7526437] = new thumbnail(7526437,'365787','','V012f_B-Bearbeitet_thumb.jpg',130, 206,5,'photo_7526437.html');
												thumbnails[7526439] = new thumbnail(7526439,'365787','','V062_B-Bearbeitet_thumb.jpg',130, 99,5,'photo_7526439.html');
												thumbnails[7526444] = new thumbnail(7526444,'407874','','_EPS0536_thumb.jpg',130, 101,5,'photo_7526444.html');
												thumbnails[7526448] = new thumbnail(7526448,'407874','','_EPS0560_thumb.jpg',130, 86,5,'photo_7526448.html');
												thumbnails[7526449] = new thumbnail(7526449,'407874','','_EPS0579_thumb.jpg',130, 86,5,'photo_7526449.html');
												thumbnails[7526468] = new thumbnail(7526468,'407874','','_EPS0580_thumb.jpg',130, 86,5,'photo_7526468.html');
												thumbnails[7526470] = new thumbnail(7526470,'407874','','bac3_thumb.jpg',130, 87,5,'photo_7526470.html');
												thumbnails[7526473] = new thumbnail(7526473,'407874','','ipse_thumb.jpg',130, 168,5,'photo_7526473.html');
												thumbnails[7526482] = new thumbnail(7526482,'407871','','seite10_thumb.jpg',130, 131,5,'photo_7526482.html');
												thumbnails[7526485] = new thumbnail(7526485,'407871','','seite11-Bearbeitet_thumb.jpg',130, 132,5,'photo_7526485.html');
												thumbnails[7526488] = new thumbnail(7526488,'407871','','seite17-Bearbeitet_thumb.jpg',130, 132,5,'photo_7526488.html');
												thumbnails[7526491] = new thumbnail(7526491,'407871','','seite27-Bearbeitet_thumb.jpg',130, 131,5,'photo_7526491.html');
												thumbnails[7526494] = new thumbnail(7526494,'407871','','seite30-Bearbeitet_thumb.jpg',130, 131,5,'photo_7526494.html');
												thumbnails[7526495] = new thumbnail(7526495,'407871','','seite38-Bearbeitet_thumb.jpg',130, 132,5,'photo_7526495.html');
												thumbnails[7526501] = new thumbnail(7526501,'407871','','seite46-Bearbeitet_thumb.jpg',130, 134,5,'photo_7526501.html');
												thumbnails[7526504] = new thumbnail(7526504,'407871','','seite51-Bearbeitet_thumb.jpg',130, 132,5,'photo_7526504.html');
												thumbnails[7526535] = new thumbnail(7526535,'407871','','seite54-Bearbeitet_thumb.jpg',130, 132,5,'photo_7526535.html');
												thumbnails[7526562] = new thumbnail(7526562,'407871','','seite62-Bearbeitet_thumb.jpg',130, 132,5,'photo_7526562.html');
												thumbnails[7526564] = new thumbnail(7526564,'407871','','seite64-Bearbeitet_thumb.jpg',130, 132,5,'photo_7526564.html');
												thumbnails[7526566] = new thumbnail(7526566,'407863','','__3_0106-Kopie_thumb.jpg',130, 195,5,'photo_7526566.html');
												thumbnails[7526567] = new thumbnail(7526567,'407863','','_--_0082-Kopie_thumb.jpg',130, 87,5,'photo_7526567.html');
												thumbnails[7526569] = new thumbnail(7526569,'407863','','_17_0333_thumb.jpg',130, 87,5,'photo_7526569.html');
												thumbnails[7526571] = new thumbnail(7526571,'407863','','0105-Kopie_thumb.jpg',130, 130,5,'photo_7526571.html');
												thumbnails[7526573] = new thumbnail(7526573,'407863','','c2-Kopie_thumb.jpg',130, 77,5,'photo_7526573.html');
												thumbnails[7527234] = new thumbnail(7527234,'407868','','10_strech_thumb.jpg',130, 86,5,'photo_7527234.html');
												thumbnails[7527236] = new thumbnail(7527236,'407868','','18-schattenbeine_thumb.jpg',130, 85,5,'photo_7527236.html');
												thumbnails[7527238] = new thumbnail(7527238,'407868','','b08_thumb.jpg',130, 130,5,'photo_7527238.html');
												thumbnails[7527240] = new thumbnail(7527240,'407868','','ballettfüsse_thumb.jpg',130, 130,5,'photo_7527240.html');
												thumbnails[7527242] = new thumbnail(7527242,'407868','','budapest_2-Bearbeitet_thumb.jpg',130, 201,5,'photo_7527242.html');
												thumbnails[7527243] = new thumbnail(7527243,'407868','','degas-Bearbeitet_thumb.jpg',130, 130,5,'photo_7527243.html');
												thumbnails[7527245] = new thumbnail(7527245,'407868','','gebogene-dame_thumb.jpg',130, 130,5,'photo_7527245.html');
												thumbnails[7527246] = new thumbnail(7527246,'407868','','marie_beach_thumb.jpg',130, 182,5,'photo_7527246.html');
												thumbnails[7527250] = new thumbnail(7527250,'407868','','spitzenschuhe-Kopie_thumb.jpg',130, 130,5,'photo_7527250.html');
												thumbnails[7527252] = new thumbnail(7527252,'407868','','the-excercise-Bearbeitet_thumb.jpg',130, 93,5,'photo_7527252.html');
												thumbnails[7527294] = new thumbnail(7527294,'407865','','_EPS0512_thumb.jpg',130, 166,5,'photo_7527294.html');
												thumbnails[7527296] = new thumbnail(7527296,'407865','','_EPS0524_thumb.jpg',130, 86,5,'photo_7527296.html');
												thumbnails[7527297] = new thumbnail(7527297,'407865','','_EPS0525_thumb.jpg',130, 162,5,'photo_7527297.html');
												thumbnails[7527298] = new thumbnail(7527298,'407865','','_EPS0526_thumb.jpg',130, 77,5,'photo_7527298.html');
												thumbnails[7527300] = new thumbnail(7527300,'407865','','_EPS0542_thumb.jpg',130, 86,5,'photo_7527300.html');
												thumbnails[7527301] = new thumbnail(7527301,'407865','','_EPS0576_thumb.jpg',130, 86,5,'photo_7527301.html');
												thumbnails[7527327] = new thumbnail(7527327,'407865','','_EPS0578_thumb.jpg',130, 86,5,'photo_7527327.html');
												thumbnails[7527330] = new thumbnail(7527330,'407866','','1_ba_20A_59-Bearbeitet_thumb.jpg',130, 188,5,'photo_7527330.html');
												thumbnails[7527331] = new thumbnail(7527331,'407866','','1_ka_30A_60-Bearbeitet_thumb.jpg',130, 199,5,'photo_7527331.html');
												thumbnails[7527334] = new thumbnail(7527334,'407866','','1_na_37A_50-sw-Bearbeitet_thumb.jpg',130, 195,5,'photo_7527334.html');
												thumbnails[7527349] = new thumbnail(7527349,'407866','','2_bb_20A_52-Bearbeitet_thumb.jpg',130, 189,5,'photo_7527349.html');
												thumbnails[7527377] = new thumbnail(7527377,'407866','','2_bb_29A_52-Bearbeitet_thumb.jpg',130, 90,5,'photo_7527377.html');
												thumbnails[7527379] = new thumbnail(7527379,'407866','','2_bb_30A_50-Bearbeitet_thumb.jpg',130, 89,5,'photo_7527379.html');
												thumbnails[7527381] = new thumbnail(7527381,'407866','','2_nb_4A_51-Bearbeitet_thumb.jpg',130, 87,5,'photo_7527381.html');
												thumbnails[7527387] = new thumbnail(7527387,'407866','','2_nb_12_53-Bearbeitet_thumb.jpg',130, 180,5,'photo_7527387.html');
												thumbnails[7527390] = new thumbnail(7527390,'407866','','travest-Bearbeitet_thumb.jpg',130, 186,5,'photo_7527390.html');
												thumbnails[7527440] = new thumbnail(7527440,'407860','','4-25_thumb.jpg',130, 90,5,'photo_7527440.html');
												thumbnails[7527443] = new thumbnail(7527443,'407860','','12A_0048_thumb.jpg',130, 122,5,'photo_7527443.html');
												thumbnails[7527445] = new thumbnail(7527445,'407860','','29A_0065_thumb.jpg',130, 198,5,'photo_7527445.html');
												thumbnails[7527447] = new thumbnail(7527447,'407860','','grand-dame_thumb.jpg',130, 186,5,'photo_7527447.html');
												thumbnails[7527456] = new thumbnail(7527456,'407860','','laechelnde-Kopie_thumb.jpg',130, 173,5,'photo_7527456.html');
												thumbnails[7527458] = new thumbnail(7527458,'407860','','pianist_thumb.jpg',130, 130,5,'photo_7527458.html');
												thumbnails[7527497] = new thumbnail(7527497,'407860','','roterMantel_thumb.jpg',130, 171,5,'photo_7527497.html');
												thumbnails[7527499] = new thumbnail(7527499,'407860','','schatulle_thumb.jpg',130, 133,5,'photo_7527499.html');
												thumbnails[7527502] = new thumbnail(7527502,'407860','','sitting-ballerina-Bearbeitet_thumb.jpg',130, 96,5,'photo_7527502.html');
												thumbnails[7527503] = new thumbnail(7527503,'407860','','the-hug-Bearbeitet_thumb.jpg',130, 93,5,'photo_7527503.html');
												thumbnails[7527506] = new thumbnail(7527506,'407860','','unscharf_gelbgrau_thumb.jpg',130, 95,5,'photo_7527506.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[365786] = new gallery(365786,'7518637,7518636,7518635,7518634,7518633,7518631,7518628,7518627,7518624,7518614','Venice_The_City','gallery',[7518614,7518624,7518627,7518628,7518631,7518633,7518634,7518635,7518636,7518637],0, 0, '', 'gallery_365786.html',0,0);
				  					galleries[365787] = new gallery(365787,'7526439,7526437,7526411,7526399,7526397,7526396,7526394,7526373','Venice_Portraits','gallery',[7526373,7526394,7526396,7526397,7526399,7526411,7526437,7526439],0, 0, '', 'gallery_365787.html',0,0);
				  					galleries[407777] = new gallery(407777,'7526336,7526335,7521792','Venice_Polaroids','gallery',[7521792,7526335,7526336,7526339],0, 0, '', 'gallery_407777.html',0,0);
				  					galleries[407860] = new gallery(407860,'7527506,7527503,7527502,7527499,7527497,7527458,7527456,7527447,7527445,7527443,7527440','Opera_Europe','gallery',[7527440,7527443,7527445,7527447,7527456,7527458,7527497,7527499,7527502,7527503,7527506],0, 0, '', 'gallery_407860.html',0,0);
				  					galleries[407863] = new gallery(407863,'7526573,7526571,7526569,7526567,7526566','Opera_China','gallery',[7526566,7526567,7526569,7526571,7526573],0, 0, '', 'gallery_407863.html',0,0);
				  					galleries[407865] = new gallery(407865,'7527327,7527301,7527300,7527298,7527297,7527296,7527294','Slavas_Snow_Show','gallery',[7527294,7527296,7527297,7527298,7527300,7527301,7527327],0, 0, '', 'gallery_407865.html',0,0);
				  					galleries[407866] = new gallery(407866,'7527390,7527387,7527381,7527379,7527377,7527349,7527334,7527331,7527330','Cabaret','gallery',[7527330,7527331,7527334,7527349,7527377,7527379,7527381,7527387,7527390],0, 0, '', 'gallery_407866.html',0,0);
				  					galleries[407868] = new gallery(407868,'7527252,7527250,7527246,7527245,7527243,7527242,7527240,7527238,7527236,7527234','Ballet','gallery',[7527234,7527236,7527238,7527240,7527242,7527243,7527245,7527246,7527250,7527252],0, 0, '', 'gallery_407868.html',0,0);
				  					galleries[407871] = new gallery(407871,'7526564,7526562,7526535,7526504,7526501,7526495,7526494,7526491,7526485,7526482','Nô-Theatre','gallery',[7526482,7526485,7526488,7526491,7526494,7526495,7526501,7526504,7526535,7526562,7526564],0, 0, '', 'gallery_407871.html',0,0);
				  					galleries[407874] = new gallery(407874,'7526473,7526470,7526468,7526449,7526448,7526444','The_Art_of_the_Spectator','gallery',[7526444,7526448,7526449,7526468,7526470,7526473],0, 0, '', 'gallery_407874.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7527506,7527503,7527502,7527499,7527497,7527458,7527456,7527447,7527445,7527443,7527440,7527390,7527387,7527381,7527379,7527377,7527349,7527334,7527331,7527330,7527327,7527301,7527300,7527298,7527297,7527296,7527294,7527252,7527250,7527246,7527245,7527243,7527242,7527240,7527238,7527236,7527234,7526573,7526571,7526569,7526567,7526566,7526564,7526562,7526535,7526504,7526501,7526495,7526494,7526491,7526485,7526482,7526473,7526470,7526468,7526449,7526448,7526444,7526439,7526437,7526411,7526399,7526397,7526396,7526394,7526373,7526336,7526335,7521792,7518637,7518636,7518635,7518634,7518633,7518631,7518628,7518627,7518624,7518614';
imageSets[2] = '7527506,7527503,7527502,7527499,7527497,7527458,7527456,7527447,7527445,7527443,7527440,7527390,7527387,7527381,7527379,7527377,7527349,7527334,7527331,7527330,7527327,7527301,7527300,7527298,7527297,7527296,7527294,7527252,7527250,7527246,7527245,7527243,7527242,7527240,7527238,7527236,7527234,7526573,7526571,7526569,7526567,7526566,7526564,7526562,7526535,7526504,7526501,7526495,7526494,7526491,7526485,7526482,7526473,7526470,7526468,7526449,7526448,7526444,7526439,7526437,7526411,7526399,7526397,7526396,7526394,7526373,7526336,7526335,7521792,7518637,7518636,7518635,7518634,7518633,7518631,7518628,7518627,7518624,7518614';
imageSets[3] = '7527506,7527503,7527502,7527499,7527497,7527458,7527456,7527447,7527445,7527443,7527440,7527390,7527387,7527381,7527379,7527377,7527349,7527334,7527331,7527330,7527327,7527301,7527300,7527298,7527297,7527296,7527294,7527252,7527250,7527246,7527245,7527243,7527242,7527240,7527238,7527236,7527234,7526573,7526571,7526569,7526567,7526566,7526564,7526562,7526535,7526504,7526501,7526495,7526494,7526491';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/karlmaria/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/karlmaria/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));		  $('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 = 'Udo Remmes Artistic Photography: ' + 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>';
	}
					
	temp = temp + this.fnGetPaymentInfo();
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
																		temp = temp + '<p>Buy now using PayPal:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &euro;' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
		 									temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = temp + '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
				
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
									temp = temp + '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
	temp = temp + '	<input type="hidden" name="item_option" value="' + item_option + '">';
	temp = temp + '	<input type="hidden" name="site" value="KARLMARIA">';
		temp = temp + '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp = temp + '	<input type="hidden" name="quantity" value="1">';
								temp = temp + '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
			temp = temp + '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
	temp = temp + '</form>';
		temp = temp + '<div class="clearing">&nbsp;</div>';
	temp = temp + '<div id="confirmContainer">';
	temp = temp + '<div id="paymentConfirm">Item added to cart</div>';
	temp = temp + '</div>';
			temp = temp + '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
		
	if(img){
	      if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
        imageID = imageID[1];
      } else {
			  imageID = randomListVal(galleries[gallery_id].featured_images);
      }
							
			if (imageID != 0) {
				img.src = thumbnails[imageID].src;
				img.width = thumbnails[imageID].width;
				img.height = thumbnails[imageID].height;
				img.alt = galleries[gallery_id].title;
        if (updateLink) {
          $(img).parent().attr({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp = temp + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

