window.thumbnails = new Object();
												thumbnails[3284582] = new thumbnail(3284582,'','','img_5123 aJPG_thumb.jpg',130, 87,15,'#');
												thumbnails[8183842] = new thumbnail(8183842,'','www.boisestyle.com','cardigan_over_a_tee_4x6_8494a_web_thumb.jpg',130, 195,15,'#');
												thumbnails[3284589] = new thumbnail(3284589,'','','img_5958aJPG_thumb.jpg',130, 87,15,'#');
												thumbnails[3284593] = new thumbnail(3284593,'','','arches valley 1528a horizonalJPG_thumb.jpg',130, 65,15,'#');
												thumbnails[8180986] = new thumbnail(8180986,'436819','www.boisestyle.com','cool_caps_4x6_9118_web_thumb.jpg',130, 195,15,'photo_8180986.html');
												thumbnails[8180989] = new thumbnail(8180989,'436819','www.boisestyle.com','stretchy_silver_4x6_9926_web_thumb.jpg',130, 195,15,'photo_8180989.html');
												thumbnails[8180990] = new thumbnail(8180990,'436819','www.boisestyle.com','Mom_shorts_8370_web_thumb.jpg',130, 195,15,'photo_8180990.html');
												thumbnails[8180991] = new thumbnail(8180991,'436819','www.boisestyle.com','Justinian_4x6_9631_web_thumb.jpg',130, 195,15,'photo_8180991.html');
												thumbnails[8180992] = new thumbnail(8180992,'436819','www.boisestyle.com','Emilys_argyle_style_4x6_0989_web_thumb.jpg',130, 195,15,'photo_8180992.html');
												thumbnails[8180994] = new thumbnail(8180994,'436819','www.boisestyle.com','cool_couple_4x6_4314_web_thumb.jpg',130, 195,15,'photo_8180994.html');
												thumbnails[8180997] = new thumbnail(8180997,'436819','www.boisestyle.com','cold_weather_color_4x6_9445_web_thumb.jpg',130, 195,15,'photo_8180997.html');
												thumbnails[8180999] = new thumbnail(8180999,'436819','www.boisestyle.com','camo_button_pants_4x6_8644_web_thumb.jpg',130, 195,15,'photo_8180999.html');
												thumbnails[8181000] = new thumbnail(8181000,'436819','www.boisestyle.com','Big_necklace_4x6_5268_web_thumb.jpg',130, 195,15,'photo_8181000.html');
												thumbnails[8181002] = new thumbnail(8181002,'436819','www.boisestyle.com','100_degree_8535_web_thumb.jpg',130, 195,15,'photo_8181002.html');
												thumbnails[8183836] = new thumbnail(8183836,'436819','www.boisestyle.com','winter_yellow_4x6_0624a_web_thumb.jpg',130, 195,15,'photo_8183836.html');
												thumbnails[8183837] = new thumbnail(8183837,'436819','www.boisestyle.com','wavy_brim_4x6_2807a_web_thumb.jpg',130, 195,15,'photo_8183837.html');
												thumbnails[8183838] = new thumbnail(8183838,'436819','www.boisestyle.com','stripes_4x6_2133a_web_thumb.jpg',130, 195,15,'photo_8183838.html');
												thumbnails[8183839] = new thumbnail(8183839,'436819','www.boisestyle.com','spring_scarves_4x6_2831_web_thumb.jpg',130, 195,15,'photo_8183839.html');
												thumbnails[8183840] = new thumbnail(8183840,'436819','www.boisestyle.com','short_cut_4x6_5752_web_thumb.jpg',130, 195,15,'photo_8183840.html');
												thumbnails[8183841] = new thumbnail(8183841,'436819','www.boisestyle.com','long_red_hair_4x6_1465_web_thumb.jpg',130, 195,15,'photo_8183841.html');
												thumbnails[3275395] = new thumbnail(3275395,'199720','SP\'s #4449 crossing the San Francisco Bay','4449 on bridge color editJPG_thumb.jpg',130, 196,15,'photo_3275395.html');
												thumbnails[3275436] = new thumbnail(3275436,'199719','','hulah inside cropJPG_thumb.jpg',130, 89,15,'photo_3275436.html');
												thumbnails[3276202] = new thumbnail(3276202,'199541','','market people 11JPG_thumb.jpg',130, 193,15,'photo_3276202.html');
												thumbnails[3474683] = new thumbnail(3474683,'212516','','Sam and Girl Friend web_thumb.jpg',130, 197,15,'photo_3474683.html');
												thumbnails[3275442] = new thumbnail(3275442,'199719','','green hose yellow bowl aJPG_thumb.jpg',130, 89,15,'photo_3275442.html');
												thumbnails[3276207] = new thumbnail(3276207,'199541','','market people 04JPG_thumb.jpg',130, 195,15,'photo_3276207.html');
												thumbnails[3275420] = new thumbnail(3275420,'199720','Pushing pipe on an oil rig in Texas','pushing pipeJPG_thumb.jpg',130, 195,15,'photo_3275420.html');
												thumbnails[3275466] = new thumbnail(3275466,'199719','','bville kmart carts aJPG_thumb.jpg',130, 89,15,'photo_3275466.html');
												thumbnails[3276208] = new thumbnail(3276208,'199541','','market people 06JPG_thumb.jpg',130, 193,15,'photo_3276208.html');
												thumbnails[3276262] = new thumbnail(3276262,'199718','','black man and blond boy tl78 16-16a clean cropJPG_thumb.jpg',130, 195,15,'photo_3276262.html');
												thumbnails[3284584] = new thumbnail(3284584,'200291','','img_5041JPG_thumb.jpg',130, 87,15,'photo_3284584.html');
												thumbnails[3474684] = new thumbnail(3474684,'212516','','Quittman web_thumb.jpg',130, 195,15,'photo_3474684.html');
												thumbnails[3276265] = new thumbnail(3276265,'199718','','black santa tl51 5a editJPG_thumb.jpg',130, 195,15,'photo_3276265.html');
												thumbnails[3276266] = new thumbnail(3276266,'199718','','bruce conner tl880 16 cropJPG_thumb.jpg',130, 195,15,'photo_3276266.html');
												thumbnails[3276267] = new thumbnail(3276267,'199718','','castr faggots are fantastic tl171 23 editJPG_thumb.jpg',130, 195,15,'photo_3276267.html');
												thumbnails[3275469] = new thumbnail(3275469,'199719','','club schmitz allen aJPG_thumb.jpg',130, 89,15,'photo_3275469.html');
												thumbnails[3276209] = new thumbnail(3276209,'199541','','market people 12JPG_thumb.jpg',130, 195,15,'photo_3276209.html');
												thumbnails[3276283] = new thumbnail(3276283,'199718','','entering woolworth tl275 35 testJPG_thumb.jpg',130, 195,15,'photo_3276283.html');
												thumbnails[3276290] = new thumbnail(3276290,'199718','','funky drummer man tl275 11 clean aJPG_thumb.jpg',130, 197,15,'photo_3276290.html');
												thumbnails[3276295] = new thumbnail(3276295,'199718','','girl guitar powell market tl275 5 cleanJPG_thumb.jpg',130, 195,15,'photo_3276295.html');
												thumbnails[3276563] = new thumbnail(3276563,'199718','','grant st fair dancer tl138 24a-25 editJPG1_thumb.jpg',130, 196,15,'photo_3276563.html');
												thumbnails[3275400] = new thumbnail(3275400,'199720','An APL container ship under construction','apl in dry dock bJPG_thumb.jpg',130, 197,15,'photo_3275400.html');
												thumbnails[3275475] = new thumbnail(3275475,'199719','','after valentines dayJPG_thumb.jpg',130, 86,15,'photo_3275475.html');
												thumbnails[3276210] = new thumbnail(3276210,'199541','','market people 08JPG_thumb.jpg',130, 193,15,'photo_3276210.html');
												thumbnails[3284587] = new thumbnail(3284587,'200291','','img_1625JPG_thumb.jpg',130, 87,15,'photo_3284587.html');
												thumbnails[3474686] = new thumbnail(3474686,'212516','','Mena Mary web_thumb.jpg',130, 194,15,'photo_3474686.html');
												thumbnails[3276312] = new thumbnail(3276312,'199718','','jagganath man reading tl160 33JPG_thumb.jpg',130, 195,15,'photo_3276312.html');
												thumbnails[3276323] = new thumbnail(3276323,'199718','','lia belli tl1052 25a editJPG_thumb.jpg',130, 195,15,'photo_3276323.html');
												thumbnails[3276332] = new thumbnail(3276332,'199718','','mayor moscone tl765 12JPG_thumb.jpg',130, 195,15,'photo_3276332.html');
												thumbnails[3276547] = new thumbnail(3276547,'199718','','older guitar player powell st tl231 17JPG1_thumb.jpg',130, 195,15,'photo_3276547.html');
												thumbnails[3276212] = new thumbnail(3276212,'199541','','market people 09JPG_thumb.jpg',130, 195,15,'photo_3276212.html');
												thumbnails[3276338] = new thumbnail(3276338,'199718','','sacramento st fair dancing tl50 16a edit aJPG_thumb.jpg',130, 195,15,'photo_3276338.html');
												thumbnails[3276799] = new thumbnail(3276799,'199719','','jim at table a1JPG_thumb.jpg',130, 88,15,'photo_3276799.html');
												thumbnails[3276347] = new thumbnail(3276347,'199718','','starship couple tl135 37 editJPG_thumb.jpg',130, 195,15,'photo_3276347.html');
												thumbnails[3284601] = new thumbnail(3284601,'199719','','windmill and linesJPG_thumb.jpg',130, 89,15,'photo_3284601.html');
												thumbnails[3276213] = new thumbnail(3276213,'199541','','market people 05JPG_thumb.jpg',130, 192,15,'photo_3276213.html');
												thumbnails[3276370] = new thumbnail(3276370,'199718','','waiting for the n judah tl427 4JPG_thumb.jpg',130, 195,15,'photo_3276370.html');
												thumbnails[3276638] = new thumbnail(3276638,'199719','','Lucky 13 2530A1JPG_thumb.jpg',130, 87,15,'photo_3276638.html');
												thumbnails[3288978] = new thumbnail(3288978,'199720','Embarcadero Center.   San Francisco','embarcadero center cropJPG_thumb.jpg',130, 190,15,'photo_3288978.html');
												thumbnails[3474688] = new thumbnail(3474688,'212516','','Mt View Seth web_thumb.jpg',130, 185,15,'photo_3474688.html');
												thumbnails[3276366] = new thumbnail(3276366,'199718','','street artist arrest in van tl127 19-19a editJPG_thumb.jpg',130, 196,15,'photo_3276366.html');
												thumbnails[3276275] = new thumbnail(3276275,'199718','','castro lesbian topless tl169 27a cropJPG_thumb.jpg',130, 87,15,'photo_3276275.html');
												thumbnails[3297763] = new thumbnail(3297763,'199719','','lubbock garage a1JPG_thumb.jpg',130, 90,15,'photo_3297763.html');
												thumbnails[3276280] = new thumbnail(3276280,'199718','','castro umbrella man tl172 10JPG_thumb.jpg',130, 85,15,'photo_3276280.html');
												thumbnails[3276305] = new thumbnail(3276305,'199718','','jagganath crowd tl163 11a-12 editJPG_thumb.jpg',130, 87,15,'photo_3276305.html');
												thumbnails[3276215] = new thumbnail(3276215,'199541','','market people 03JPG_thumb.jpg',130, 193,15,'photo_3276215.html');
												thumbnails[3276602] = new thumbnail(3276602,'199718','','starship crowd sunglasses tl132 28a-29 editJPG1_thumb.jpg',130, 87,15,'photo_3276602.html');
												thumbnails[3276337] = new thumbnail(3276337,'199718','','party pacific heights tl483 32JPG_thumb.jpg',130, 87,15,'photo_3276337.html');
												thumbnails[3276559] = new thumbnail(3276559,'199718','','jagganath sequin dress tl160 25 cropJPG1_thumb.jpg',130, 212,15,'photo_3276559.html');
												thumbnails[3276216] = new thumbnail(3276216,'199541','','market people 10JPG_thumb.jpg',130, 195,15,'photo_3276216.html');
												thumbnails[3276801] = new thumbnail(3276801,'200291','','IMG_1854JPG_thumb.jpg',130, 87,15,'photo_3276801.html');
												thumbnails[3288982] = new thumbnail(3288982,'199720','Teamwork on the PC','working  at a pc cropJPG_thumb.jpg',130, 89,15,'photo_3288982.html');
												thumbnails[3474694] = new thumbnail(3474694,'212516','','Bunch web_thumb.jpg',130, 136,15,'photo_3474694.html');
												thumbnails[3272551] = new thumbnail(3272551,'199541','','market people 01JPG_thumb.jpg',130, 195,15,'photo_3272551.html');
												thumbnails[3276810] = new thumbnail(3276810,'199719','','Luxembourg chair 01_edited-1AJPG crop_thumb.jpg',130, 89,15,'photo_3276810.html');
												thumbnails[3280102] = new thumbnail(3280102,'199719','','Carols back stairsJPG_thumb.jpg',130, 87,15,'photo_3280102.html');
												thumbnails[3276803] = new thumbnail(3276803,'199719','','IMG_1421AJPG_thumb.jpg',130, 87,15,'photo_3276803.html');
												thumbnails[3297781] = new thumbnail(3297781,'199719','','yellow blanket aJPG_thumb.jpg',130, 87,15,'photo_3297781.html');
												thumbnails[3276802] = new thumbnail(3276802,'199719','','IMG_1521AJPG_thumb.jpg',130, 98,15,'photo_3276802.html');
												thumbnails[3297765] = new thumbnail(3297765,'199719','','mary lea rice aJPG_thumb.jpg',130, 196,15,'photo_3297765.html');
												thumbnails[3284592] = new thumbnail(3284592,'200291','','img_1594 horizonalJPG_thumb.jpg',130, 65,15,'photo_3284592.html');
												thumbnails[3289006] = new thumbnail(3289006,'199720','Container ship under the Golden Gate Bridge','ship under golden gate cropJPG_thumb.jpg',130, 89,15,'photo_3289006.html');
												thumbnails[3297766] = new thumbnail(3297766,'199719','','kitty in black aJPG_thumb.jpg',130, 195,15,'photo_3297766.html');
												thumbnails[3474698] = new thumbnail(3474698,'212516','','Sam Chatman web_thumb.jpg',130, 87,15,'photo_3474698.html');
												thumbnails[3289011] = new thumbnail(3289011,'199720','Oil tank farm.  Quebec,  Canada','oil tank farm cropJPG_thumb.jpg',130, 89,15,'photo_3289011.html');
												thumbnails[3284594] = new thumbnail(3284594,'200291','','canyonlands horiz 1551JPG_thumb.jpg',130, 65,15,'photo_3284594.html');
												thumbnails[3292472] = new thumbnail(3292472,'199720','Chappellett Vineyards.  Napa Valley','don chappellet crop adjustJPG_thumb.jpg',130, 89,15,'photo_3292472.html');
												thumbnails[3474702] = new thumbnail(3474702,'212516','','Steam Tractor web_thumb.jpg',130, 87,15,'photo_3474702.html');
												thumbnails[3474705] = new thumbnail(3474705,'212516','','New Orleans Funeral_thumb.jpg',130, 85,15,'photo_3474705.html');
												thumbnails[3474708] = new thumbnail(3474708,'212516','','New Years Eve web_thumb.jpg',130, 103,15,'photo_3474708.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[199720] = new gallery(199720,'3275395','BUSINESS & INDUSTRY','gallery',[3275395,3275420,3275400,3288978,3288982,3289006,3289011,3292472],0, 0, '', 'gallery_199720.html',0,0);
				  					galleries[199541] = new gallery(199541,'3276207','Market People','gallery',[3276202,3276207,3276208,3276209,3276210,3276212,3276213,3276215,3276216,3272551],0, 0, '199540', 'gallery_199541.html',0,0);
				  					galleries[199718] = new gallery(199718,'3276262','San Francisco in the 70s','gallery',[3276262,3276265,3276266,3276267,3276283,3276290,3276295,3276563,3276312,3276323,3276332,3276547,3276338,3276347,3276370,3276366,3276275,3276280,3276305,3276602,3276337,3276559],0, 0, '199540', 'gallery_199718.html',0,0);
				  					galleries[436819] = new gallery(436819,'8183839,8180991','Street Style','gallery',[8180986,8180989,8180990,8180991,8180992,8180994,8180997,8180999,8181000,8181002,8183836,8183837,8183838,8183839,8183840,8183841],0, 0, '199540', 'gallery_436819.html',0,0);
				  					galleries[212516] = new gallery(212516,'3474684','The South','gallery',[3474683,3474684,3474686,3474688,3474694,3474698,3474702,3474705,3474708],0, 0, '199540', 'gallery_212516.html',0,0);
				  					galleries[199540] = new gallery(199540,'8183839,8180991,3474684,3276262,3276207','DOCUMENTARY','gallery',[],0, 0, '', 'gallery_199540.html',0,0);
				  					galleries[199719] = new gallery(199719,'3276802,3275436','FINE ART','gallery',[3275436,3275442,3275466,3275469,3275475,3276799,3284601,3276638,3297763,3276810,3280102,3276803,3297781,3276802,3297765,3297766],0, 0, '', 'gallery_199719.html',0,0);
				  					galleries[200291] = new gallery(200291,'3284584','LANDSCAPE','gallery',[3284584,3284587,3276801,3284592,3284594],0, 0, '', 'gallery_200291.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '3276803,3276801,3276638,3275469';
imageSets[2] = '8183839,8180991,3474684,3284584,3276802,3276262,3276207,3275436,3275395';
imageSets[3] = '8183842,8183841,8183840,8183839,8183838,8183837,8183836,8181002,8181000,8180999,8180997,8180994,8180992,8180991,8180990,8180989,8180986,3474708,3474705,3474702,3474698,3474694,3474688,3474686,3474684,3474683,3297781,3297766,3297765,3297763,3292472,3289011,3289006,3288982,3288978,3284601,3284594,3284593,3284592,3284589,3284587,3284584,3284582,3280102,3276810,3276803,3276802,3276801,3276799,3276638';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/willlea/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/willlea/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/willlea/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/willlea/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/willlea/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/willlea/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/willlea/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/willlea/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/willlea/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/willlea/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/willlea/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/willlea/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/willlea/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/willlea/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/willlea/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/willlea/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/willlea/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/willlea/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/willlea/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/willlea/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/willlea/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/willlea/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 = 'Thomas Lea 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 == undefined) {
    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;
	}
}

			

