window.thumbnails = new Object();
												thumbnails[2207274] = new thumbnail(2207274,'145796','','PICT0075 [800x600]_thumb.JPG',130, 286,32,'photo_2207274.html');
												thumbnails[2207292] = new thumbnail(2207292,'145796','','PICT0078 [800x600]_thumb.JPG',130, 175,32,'photo_2207292.html');
												thumbnails[2224288] = new thumbnail(2224288,'145796','','100_1877_thumb.jpg',130, 176,32,'photo_2224288.html');
												thumbnails[2224293] = new thumbnail(2224293,'145796','','100_2119_thumb.jpg',130, 178,32,'photo_2224293.html');
												thumbnails[2224298] = new thumbnail(2224298,'145796','','100_2193_thumb.jpg',130, 176,32,'photo_2224298.html');
												thumbnails[2224300] = new thumbnail(2224300,'145796','','100_2194_thumb.jpg',130, 102,32,'photo_2224300.html');
												thumbnails[2224305] = new thumbnail(2224305,'145796','','100_2205_thumb.jpg',130, 68,32,'photo_2224305.html');
												thumbnails[2224319] = new thumbnail(2224319,'145796','','100_2267_thumb.jpg',130, 185,32,'photo_2224319.html');
												thumbnails[2224327] = new thumbnail(2224327,'145796','','100_2269_thumb.jpg',130, 149,32,'photo_2224327.html');
												thumbnails[2224332] = new thumbnail(2224332,'145796','','100_2056 [800x600]_thumb.jpg',130, 99,32,'photo_2224332.html');
												thumbnails[2224334] = new thumbnail(2224334,'145796','','100_2073 [800x600]_thumb.jpg',130, 97,32,'photo_2224334.html');
												thumbnails[2224335] = new thumbnail(2224335,'145796','','100_2196 [800x600]_thumb.jpg',130, 93,32,'photo_2224335.html');
												thumbnails[2224336] = new thumbnail(2224336,'145796','','100_2310 [800x600]_thumb.jpg',130, 83,32,'photo_2224336.html');
												thumbnails[2224566] = new thumbnail(2224566,'145796','','DSCN1550_thumb.jpeg',130, 84,32,'photo_2224566.html');
												thumbnails[2224570] = new thumbnail(2224570,'145796','','DSCN1559_thumb.jpeg',130, 167,32,'photo_2224570.html');
												thumbnails[2224573] = new thumbnail(2224573,'145796','','Obraz 022_thumb.jpg',130, 107,32,'photo_2224573.html');
												thumbnails[2224576] = new thumbnail(2224576,'145796','','Obraz 066_thumb.jpg',130, 166,32,'photo_2224576.html');
												thumbnails[2224577] = new thumbnail(2224577,'145796','','PICT0029 [800x600]_thumb.JPG',130, 168,32,'photo_2224577.html');
												thumbnails[2258141] = new thumbnail(2258141,'145796','','DSCN1532 [800x600]_thumb.jpeg',130, 158,32,'photo_2258141.html');
												thumbnails[2258143] = new thumbnail(2258143,'145796','','DSCN1541 [800x600]_thumb.jpeg',130, 109,32,'photo_2258143.html');
												thumbnails[2258145] = new thumbnail(2258145,'145796','','DSCN1544 [800x600]_thumb.jpeg',130, 78,32,'photo_2258145.html');
												thumbnails[2258155] = new thumbnail(2258155,'145796','','DSCN1564 [800x600]_thumb.jpeg',130, 60,32,'photo_2258155.html');
												thumbnails[2305672] = new thumbnail(2305672,'145796','','IMG_6274 [800x600]_thumb.JPG',130, 191,32,'photo_2305672.html');
												thumbnails[2305674] = new thumbnail(2305674,'145796','','IMG_6275 [800x600]_thumb.JPG',130, 95,32,'photo_2305674.html');
												thumbnails[2305677] = new thumbnail(2305677,'145796','','IMG_6276 [800x600]_thumb.JPG',130, 191,32,'photo_2305677.html');
												thumbnails[2305678] = new thumbnail(2305678,'145796','','IMG_6277 [800x600]_thumb.JPG',130, 87,32,'photo_2305678.html');
												thumbnails[2305679] = new thumbnail(2305679,'145796','','IMG_6279 [800x600]_thumb.JPG',130, 160,32,'photo_2305679.html');
												thumbnails[2305682] = new thumbnail(2305682,'145796','','IMG_6280 [800x600]_thumb.JPG',130, 156,32,'photo_2305682.html');
												thumbnails[2305684] = new thumbnail(2305684,'145796','','IMG_6281 [800x600]_thumb.JPG',130, 178,32,'photo_2305684.html');
												thumbnails[2305686] = new thumbnail(2305686,'145796','','IMG_6282 [800x600]_thumb.JPG',130, 101,32,'photo_2305686.html');
												thumbnails[2305693] = new thumbnail(2305693,'145796','','IMG_6283 [800x600]_thumb.JPG',130, 87,32,'photo_2305693.html');
												thumbnails[2305695] = new thumbnail(2305695,'145796','','IMG_6284 [800x600]_thumb.JPG',130, 153,32,'photo_2305695.html');
												thumbnails[2305696] = new thumbnail(2305696,'145796','','IMG_6285 [800x600]_thumb.JPG',130, 107,32,'photo_2305696.html');
												thumbnails[2305697] = new thumbnail(2305697,'145796','','IMG_6287 [800x600]_thumb.JPG',130, 95,32,'photo_2305697.html');
												thumbnails[2305699] = new thumbnail(2305699,'145796','','IMG_6289 [800x600]_thumb.JPG',130, 195,32,'photo_2305699.html');
												thumbnails[2305701] = new thumbnail(2305701,'145796','','IMG_6294 [800x600]_thumb.JPG',130, 114,32,'photo_2305701.html');
												thumbnails[2326522] = new thumbnail(2326522,'145796','','IMG_5827 [800x600]_thumb.JPG',130, 191,32,'photo_2326522.html');
												thumbnails[2326523] = new thumbnail(2326523,'145796','','IMG_5828 [800x600]_thumb.JPG',130, 94,32,'photo_2326523.html');
												thumbnails[2326524] = new thumbnail(2326524,'145796','','IMG_5829 [800x600]_thumb.JPG',130, 168,32,'photo_2326524.html');
												thumbnails[2326526] = new thumbnail(2326526,'145796','','IMG_5830 [800x600]_thumb.JPG',130, 108,32,'photo_2326526.html');
												thumbnails[2326527] = new thumbnail(2326527,'145796','','IMG_5831 [800x600]_thumb.JPG',130, 104,32,'photo_2326527.html');
												thumbnails[2326531] = new thumbnail(2326531,'145796','','IMG_5833 [800x600]_thumb.JPG',130, 109,32,'photo_2326531.html');
												thumbnails[2612045] = new thumbnail(2612045,'145796','','IMG_6813 [800x600]1_thumb.JPG',130, 254,32,'photo_2612045.html');
												thumbnails[2612050] = new thumbnail(2612050,'145796','','IMG_6808 [800x600]1_thumb.JPG',130, 158,32,'photo_2612050.html');
												thumbnails[3237576] = new thumbnail(3237576,'145796','','100_2739_0222 [1024x768] [800x600]_thumb.jpg',130, 173,32,'photo_3237576.html');
												thumbnails[3237577] = new thumbnail(3237577,'145796','','100_2787_0182 [800x600]_thumb.jpg',130, 147,32,'photo_3237577.html');
												thumbnails[3237581] = new thumbnail(3237581,'145796','','100_2793_0184 [800x600]_thumb.jpg',130, 107,32,'photo_3237581.html');
												thumbnails[3257743] = new thumbnail(3257743,'145796','','1 [800x600]_thumb.jpg',130, 159,32,'photo_3257743.html');
												thumbnails[3257745] = new thumbnail(3257745,'145796','','3 [800x600]_thumb.jpg',130, 183,32,'photo_3257745.html');
												thumbnails[3257769] = new thumbnail(3257769,'145796','','4 [800x600]_thumb.jpg',130, 106,32,'photo_3257769.html');
												thumbnails[3257778] = new thumbnail(3257778,'145796','','5 [800x600]1_thumb.jpg',130, 109,32,'photo_3257778.html');
												thumbnails[3257781] = new thumbnail(3257781,'145796','','6 [800x600]_thumb.jpg',130, 107,32,'photo_3257781.html');
												thumbnails[3257785] = new thumbnail(3257785,'145796','','7 [800x600]_thumb.jpg',130, 158,32,'photo_3257785.html');
												thumbnails[3257789] = new thumbnail(3257789,'145796','','8 [800x600]_thumb.jpg',130, 178,32,'photo_3257789.html');
												thumbnails[3257796] = new thumbnail(3257796,'145796','','9 [800x600]_thumb.JPG',130, 107,32,'photo_3257796.html');
												thumbnails[3261158] = new thumbnail(3261158,'145796','','1 [800x600]1_thumb.jpg',130, 110,32,'photo_3261158.html');
												thumbnails[3261159] = new thumbnail(3261159,'145796','','2 [800x600]_thumb.jpg',130, 94,32,'photo_3261159.html');
												thumbnails[3261160] = new thumbnail(3261160,'145796','','3 [800x600]1_thumb.jpg',130, 195,32,'photo_3261160.html');
												thumbnails[3261162] = new thumbnail(3261162,'145796','','4 [800x600]1_thumb.jpg',130, 97,32,'photo_3261162.html');
												thumbnails[3261163] = new thumbnail(3261163,'145796','','5 [800x600]2_thumb.jpg',130, 182,32,'photo_3261163.html');
												thumbnails[3261164] = new thumbnail(3261164,'145796','','6 [800x600]1_thumb.jpg',130, 148,32,'photo_3261164.html');
												thumbnails[3261165] = new thumbnail(3261165,'145796','','7 [800x600]1_thumb.jpg',130, 164,32,'photo_3261165.html');
												thumbnails[3262358] = new thumbnail(3262358,'145796','','a [800x600]1_thumb.jpg',130, 97,32,'photo_3262358.html');
												thumbnails[3262360] = new thumbnail(3262360,'145796','','d [800x600]_thumb.jpg',130, 109,32,'photo_3262360.html');
												thumbnails[3262361] = new thumbnail(3262361,'145796','','b [800x600]_thumb.jpg',130, 196,32,'photo_3262361.html');
												thumbnails[3262362] = new thumbnail(3262362,'145796','','c [800x600]_thumb.jpg',130, 98,32,'photo_3262362.html');
												thumbnails[3507745] = new thumbnail(3507745,'145796','','IMG_9318 [800x600]_thumb.JPG',130, 107,32,'photo_3507745.html');
												thumbnails[3507751] = new thumbnail(3507751,'145796','','IMG_9319 [800x600]_thumb.JPG',130, 107,32,'photo_3507751.html');
												thumbnails[3507752] = new thumbnail(3507752,'145796','','IMG_9320 [800x600]_thumb.JPG',130, 104,32,'photo_3507752.html');
												thumbnails[3507753] = new thumbnail(3507753,'145796','','IMG_9321 [800x600]_thumb.JPG',130, 108,32,'photo_3507753.html');
												thumbnails[3507754] = new thumbnail(3507754,'145796','','IMG_9322 [800x600]_thumb.JPG',130, 182,32,'photo_3507754.html');
												thumbnails[3507756] = new thumbnail(3507756,'145796','','IMG_9323 [800x600]_thumb.JPG',130, 181,32,'photo_3507756.html');
												thumbnails[3507762] = new thumbnail(3507762,'145796','','IMG_9324 [800x600]_thumb.JPG',130, 154,32,'photo_3507762.html');
												thumbnails[3507764] = new thumbnail(3507764,'145796','','IMG_9328 [800x600]_thumb.JPG',130, 109,32,'photo_3507764.html');
												thumbnails[4353701] = new thumbnail(4353701,'145796','','Picture_110_800x600_thumb.jpg',130, 112,32,'photo_4353701.html');
												thumbnails[4353704] = new thumbnail(4353704,'145796','','Picture_112_800x600_thumb.jpg',130, 95,32,'photo_4353704.html');
												thumbnails[4353706] = new thumbnail(4353706,'145796','','Picture_113_800x600_thumb.jpg',130, 126,32,'photo_4353706.html');
												thumbnails[4353708] = new thumbnail(4353708,'145796','','Picture_115_800x600_thumb.jpg',130, 87,32,'photo_4353708.html');
												thumbnails[4353711] = new thumbnail(4353711,'145796','','Picture_116_800x600_thumb.jpg',130, 103,32,'photo_4353711.html');
												thumbnails[4353718] = new thumbnail(4353718,'145796','','Picture_118_800x600_thumb.jpg',130, 119,32,'photo_4353718.html');
												thumbnails[4353722] = new thumbnail(4353722,'145796','','Picture_120_800x600_thumb.jpg',130, 161,32,'photo_4353722.html');
												thumbnails[4353726] = new thumbnail(4353726,'145796','','Picture_124_800x600_thumb.jpg',130, 87,32,'photo_4353726.html');
												thumbnails[4353730] = new thumbnail(4353730,'145796','','Picture_125_800x600_thumb.jpg',130, 113,32,'photo_4353730.html');
												thumbnails[5418403] = new thumbnail(5418403,'145796','','100_0075_800x600_thumb.JPG',130, 173,32,'photo_5418403.html');
												thumbnails[5418406] = new thumbnail(5418406,'145796','','100_0079_800x600_thumb.JPG',130, 98,32,'photo_5418406.html');
												thumbnails[5418420] = new thumbnail(5418420,'145796','','100_0081_800x6001_thumb.JPG',130, 110,32,'photo_5418420.html');
												thumbnails[5418422] = new thumbnail(5418422,'145796','','100_0088_800x600_thumb.JPG',130, 92,32,'photo_5418422.html');
												thumbnails[5418424] = new thumbnail(5418424,'145796','','100_0089_800x600_thumb.JPG',130, 211,32,'photo_5418424.html');
												thumbnails[5418425] = new thumbnail(5418425,'145796','','100_0093_800x600_thumb.JPG',130, 114,32,'photo_5418425.html');
												thumbnails[5418426] = new thumbnail(5418426,'145796','','100_0096_800x600_thumb.JPG',130, 178,32,'photo_5418426.html');
												thumbnails[5418427] = new thumbnail(5418427,'145796','','100_0098_800x600_thumb.JPG',130, 101,32,'photo_5418427.html');
												thumbnails[2612068] = new thumbnail(2612068,'165821','','IMG_6253 [800x600]2_thumb.JPG',130, 195,32,'photo_2612068.html');
												thumbnails[2612162] = new thumbnail(2612162,'165821','','001_thumb.jpg',130, 86,32,'photo_2612162.html');
												thumbnails[3262363] = new thumbnail(3262363,'165821','','e [800x600]_thumb.jpg',130, 152,32,'photo_3262363.html');
												thumbnails[3262364] = new thumbnail(3262364,'165821','','h [800x600]_thumb.jpg',130, 209,32,'photo_3262364.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[165821] = new gallery(165821,'2612068','About Me','section208454',[2612068,2612162,3262363,3262364],0, 0, '', 'section208454.html',0,0);
				  					galleries[145796] = new gallery(145796,'3261164,2207274','Gallery ','gallery',[2207274,2207292,2224288,2224293,2224298,2224300,2224305,2224319,2224327,2224332,2224334,2224335,2224336,2224566,2224570,2224573,2224576,2224577,2258141,2258143,2258145,2258155,2305672,2305674,2305677,2305678,2305679,2305682,2305684,2305686,2305693,2305695,2305696,2305697,2305699,2305701,2326522,2326523,2326524,2326526,2326527,2326531,2612045,2612050,3237576,3237577,3237581,3257743,3257745,3257769,3257778,3257781,3257785,3257789,3257796,3261158,3261159,3261160,3261162,3261163,3261164,3261165,3262358,3262360,3262361,3262362,3507745,3507751,3507752,3507753,3507754,3507756,3507762,3507764,4353701,4353704,4353706,4353708,4353711,4353718,4353722,4353726,4353730,5418403,5418406,5418420,5418422,5418424,5418425,5418426,5418427],0, 0, '', 'gallery.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '3262364,3262361,2224577,2207292,2207274';
imageSets[2] = '3261164,2612068,2207274';
imageSets[3] = '5418427,5418426,5418425,5418424,5418422,5418420,5418406,5418403,4353730,4353726,4353722,4353718,4353711,4353708,4353706,4353704,4353701,3507764,3507762,3507756,3507754,3507753,3507752,3507751,3507745,3262364,3262363,3262362,3262361,3262360,3262358,3261165,3261164,3261163,3261162,3261160,3261159,3261158,3257796,3257789,3257785,3257781,3257778,3257769,3257745,3257743,3237581,3237577,3237576,2612162';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/artbyrafal/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/artbyrafal/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 = 'ART by Rafal: ' + 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;
	}
}

			

