window.thumbnails = new Object();
												thumbnails[4454220] = new thumbnail(4454220,'','Mira Bogicevic','mira_01_thumb.jpg',130, 131,18,'							photo_4454220.html');
												thumbnails[4487719] = new thumbnail(4487719,'','Daddy\'s Girl','A-Daddys_Girl_CC500_thumb.jpg',130, 130,18,'							photo_4487719.html');
												thumbnails[4452094] = new thumbnail(4452094,'','Rabbit and Mask','Mira_0132_thumb.jpg',130, 131,18,'							photo_4452094.html');
												thumbnails[4791735] = new thumbnail(4791735,'','Still Life with Figs','Still_Life_with_FigsCC4001_thumb.jpg',130, 113,18,'							photo_4791735.html');
												thumbnails[4791711] = new thumbnail(4791711,'','Three Pears','Three_Pears_CC4001_thumb.jpg',130, 77,18,'							photo_4791711.html');
												thumbnails[4791726] = new thumbnail(4791726,'','Yellow Frenzy','yellow_frenzy_cc4001_thumb.jpg',130, 111,18,'							photo_4791726.html');
												thumbnails[4468505] = new thumbnail(4468505,'260352','New Mothers','New_Mothers_CC550_thumb.jpg',130, 91,18,'							photo_4468505.html');
												thumbnails[4484238] = new thumbnail(4484238,'260352','Dressing Table with Serbian Doll','Dressing_Table_CC600_thumb.jpg',130, 224,18,'							photo_4484238.html');
												thumbnails[4591847] = new thumbnail(4591847,'260352','Drawer','Drawer_CC600_thumb.jpg',130, 97,18,'							photo_4591847.html');
												thumbnails[4591866] = new thumbnail(4591866,'260352','Dressing Table with Gnasher Snapper','Dressing_Table_2_CC600_thumb.jpg',130, 178,18,'							photo_4591866.html');
												thumbnails[4612850] = new thumbnail(4612850,'260352','Rabbit','Rabbit_CC600_thumb.jpg',130, 107,18,'							photo_4612850.html');
												thumbnails[4612864] = new thumbnail(4612864,'260352','Father Christmas','Father_Christmas_CC600_thumb.jpg',130, 143,18,'							photo_4612864.html');
												thumbnails[4612867] = new thumbnail(4612867,'260352','Mechanical Horse','Mechanical_Horse_CC600_thumb.jpg',130, 93,18,'							photo_4612867.html');
												thumbnails[4838966] = new thumbnail(4838966,'260352','Bird','Bird_2_CC600_thumb.jpg',130, 110,18,'							photo_4838966.html');
												thumbnails[4838980] = new thumbnail(4838980,'260245','Rabbit','Rabbit_CC6001_thumb.jpg',130, 107,18,'							photo_4838980.html');
												thumbnails[4838991] = new thumbnail(4838991,'260352','Grotesques ','Majolica_CC600_thumb.jpg',130, 93,18,'							photo_4838991.html');
												thumbnails[4839226] = new thumbnail(4839226,'260352','Camel Studies','Camel_CC6001_thumb.jpg',130, 130,18,'							photo_4839226.html');
												thumbnails[4468155] = new thumbnail(4468155,'260244','Rabbit and Mask','Rabbit_and_Mask_CC600_thumb.jpg',130, 131,18,'							photo_4468155.html');
												thumbnails[5384155] = new thumbnail(5384155,'260244','Pumpkin Parade','Pumpkins_cc600_thumb.jpg',130, 82,18,'							photo_5384155.html');
												thumbnails[5384160] = new thumbnail(5384160,'260244','Geometric Shapes','Still_Life_with_Mug_cc600_thumb.jpg',130, 112,18,'							photo_5384160.html');
												thumbnails[5384161] = new thumbnail(5384161,'260244','Wooden Toys','Wooden_Toys_cc500_thumb.jpg',130, 175,18,'							photo_5384161.html');
												thumbnails[4495348] = new thumbnail(4495348,'260244','Three Figs','three_figs_cc600_thumb.jpg',130, 78,18,'							photo_4495348.html');
												thumbnails[4495206] = new thumbnail(4495206,'260244','Kohlrabi and Elastic Band','kohlrabi_and_elastic_band_cc600_thumb.jpg',130, 174,18,'							photo_4495206.html');
												thumbnails[4483282] = new thumbnail(4483282,'260244','Still Life with Pomegranates','Still_Life_with_Pomegranates_CC600_thumb.jpg',130, 112,18,'							photo_4483282.html');
												thumbnails[4474811] = new thumbnail(4474811,'260244','Asparagus & Egg<br>\r\n','Asparagus_and_Egg_CC600_thumb.jpg',130, 142,18,'							photo_4474811.html');
												thumbnails[4490760] = new thumbnail(4490760,'260244','Fennel and Book<br>\r\n','fennel_and_book_cc475_thumb.jpg',130, 126,18,'							photo_4490760.html');
												thumbnails[4495330] = new thumbnail(4495330,'260244','Farmyard','farmyard_cc600_thumb.jpg',130, 87,18,'							photo_4495330.html');
												thumbnails[4483266] = new thumbnail(4483266,'260244','Dragon Fruit','Dragon_Fruit_CC600_thumb.jpg',130, 111,18,'							photo_4483266.html');
												thumbnails[4495324] = new thumbnail(4495324,'260244','Elizabethan Gourd','elizabethan_gourd_cc600_thumb.jpg',130, 129,18,'							photo_4495324.html');
												thumbnails[4495210] = new thumbnail(4495210,'260244','Group of Toys','group_of_toys_cc600_thumb.jpg',130, 108,18,'							photo_4495210.html');
												thumbnails[4483277] = new thumbnail(4483277,'260244','Golden Mask','Golden_Mask_CC600_thumb.jpg',130, 204,18,'							photo_4483277.html');
												thumbnails[4483270] = new thumbnail(4483270,'260244','Still Life with Figs<br>\r\n<br>\r\n','Still_Life_with_FigsCC600_thumb.jpg',130, 113,18,'							photo_4483270.html');
												thumbnails[4483285] = new thumbnail(4483285,'260244','Red Shoes','Red_Shoes_CC600_thumb.jpg',130, 150,18,'							photo_4483285.html');
												thumbnails[4483274] = new thumbnail(4483274,'260244','Still Life with Melon<br>\r\n','Still_Life_with_Melon_CC600_thumb.jpg',130, 98,18,'							photo_4483274.html');
												thumbnails[4499871] = new thumbnail(4499871,'260244','Skull','skull_cc600_thumb.jpg',130, 114,18,'							photo_4499871.html');
												thumbnails[4495337] = new thumbnail(4495337,'260244','Shrine','shrine_cc600_thumb.jpg',130, 106,18,'							photo_4495337.html');
												thumbnails[4483291] = new thumbnail(4483291,'260244','Three Pears','Three_Pears_CC600_thumb.jpg',130, 77,18,'							photo_4483291.html');
												thumbnails[4495276] = new thumbnail(4495276,'260244','Chocolate Fish','chocolate_fish_cc600_thumb.jpg',130, 124,18,'							photo_4495276.html');
												thumbnails[4495316] = new thumbnail(4495316,'260244','Egg Cups','Egg_Cups_CC600_thumb.jpg',130, 112,18,'							photo_4495316.html');
												thumbnails[4495214] = new thumbnail(4495214,'260244','On Reflection','dancing_shoe_cc600_thumb.jpg',130, 122,18,'							photo_4495214.html');
												thumbnails[4495200] = new thumbnail(4495200,'260244','Yellow Frenzy','yellow_frenzy_cc600_thumb.jpg',130, 111,18,'							photo_4495200.html');
												thumbnails[4495248] = new thumbnail(4495248,'260244','Artichoke and Paper Bag','artichoke_and_paper_bag_cc600_thumb.jpg',130, 128,18,'							photo_4495248.html');
												thumbnails[4495333] = new thumbnail(4495333,'260244','Quince','quince_cc600_thumb.jpg',130, 98,18,'							photo_4495333.html');
												thumbnails[4483267] = new thumbnail(4483267,'260244','Cascade','cascade_cc450_thumb.jpg',130, 239,18,'							photo_4483267.html');
												thumbnails[4499785] = new thumbnail(4499785,'260244','Orange Shoes','orange_shoes_cc600_thumb.jpg',130, 152,18,'							photo_4499785.html');
												thumbnails[4483288] = new thumbnail(4483288,'260244','Utility Shoe','Utility_Shoe_CC600_thumb.jpg',130, 111,18,'							photo_4483288.html');
												thumbnails[4495794] = new thumbnail(4495794,'260244','Egg Box','egg_box_cc500_thumb.jpg',130, 150,18,'							photo_4495794.html');
												thumbnails[4482945] = new thumbnail(4482945,'260244','Still Life with Brick<br>\r\n','Still_Life_with_Brick_CC600_thumb.jpg',130, 148,18,'							photo_4482945.html');
												thumbnails[4495353] = new thumbnail(4495353,'260244','Apples and Feather','apples_and_feather_cc600_thumb.jpg',130, 111,18,'							photo_4495353.html');
												thumbnails[4588812] = new thumbnail(4588812,'260244','Indian Elephant','Indian_Elephant_CC600_thumb.jpg',130, 113,18,'							photo_4588812.html');
												thumbnails[4589591] = new thumbnail(4589591,'260244','Scattered Pine Cones (detail)','Scattered_Quail_Eggs_Detail_CC500_thumb.jpg',130, 114,18,'							photo_4589591.html');
												thumbnails[4485166] = new thumbnail(4485166,'260245','Pat Asleep','Life_Model_c600_thumb.jpg',130, 164,18,'							photo_4485166.html');
												thumbnails[4832873] = new thumbnail(4832873,'260245','Tonal Still Life 1','Tonal-Still_Life_1_CC600_thumb.jpg',130, 92,18,'							photo_4832873.html');
												thumbnails[4832877] = new thumbnail(4832877,'260245','Dresser','Dresser_CC600_thumb.jpg',130, 188,18,'							photo_4832877.html');
												thumbnails[4832927] = new thumbnail(4832927,'260245','Tonal Still Life 3','Tonal_Still_Life_3_CC600_thumb.jpg',130, 141,18,'							photo_4832927.html');
												thumbnails[4832928] = new thumbnail(4832928,'260245','Stonecarving','Stonecarving_CC600_thumb.jpg',130, 180,18,'							photo_4832928.html');
												thumbnails[4833659] = new thumbnail(4833659,'260245','Indian Doll with Mona Lisa<br>\r\n','Indian_Doll_CC600_thumb.jpg',130, 173,18,'							photo_4833659.html');
												thumbnails[4833662] = new thumbnail(4833662,'260245','Indian Ducks','Indian_Ducks_CC600_thumb.jpg',130, 49,18,'							photo_4833662.html');
												thumbnails[4833669] = new thumbnail(4833669,'260245','Serbian Doll','Serbian_Doll_CC600_thumb.jpg',130, 178,18,'							photo_4833669.html');
												thumbnails[4833664] = new thumbnail(4833664,'260245','Mantelpiece Clock','Mantelpiece_Clock_CC600_thumb.jpg',130, 102,18,'							photo_4833664.html');
												thumbnails[4833655] = new thumbnail(4833655,'260245','Disney Curtain','Disney_Curtains_CC600_thumb.jpg',130, 170,18,'							photo_4833655.html');
												thumbnails[4832874] = new thumbnail(4832874,'260245','Tonal Still Life 2','Tonal_Still__Life_2_CC600_thumb.jpg',130, 94,18,'							photo_4832874.html');
												thumbnails[4630756] = new thumbnail(4630756,'260354','Parrot Tapestry','Parrot_CC450_thumb.jpg',130, 143,18,'							photo_4630756.html');
												thumbnails[4851132] = new thumbnail(4851132,'260354','Circus Elephants','Elephants_CC600_thumb.jpg',130, 87,18,'							photo_4851132.html');
												thumbnails[4851129] = new thumbnail(4851129,'260354','Ghost Riders','Long_Horses_CC600_thumb.jpg',130, 371,18,'							photo_4851129.html');
												thumbnails[4851139] = new thumbnail(4851139,'260354','Gothic Bird and Flower 1','Gothic_square_thumb.jpg',130, 126,18,'							photo_4851139.html');
												thumbnails[4851131] = new thumbnail(4851131,'260354','Mad March Hares','Hares_CC600_thumb.jpg',130, 104,18,'							photo_4851131.html');
												thumbnails[4851137] = new thumbnail(4851137,'260354','Head Border','Head_Border_CC600_thumb.jpg',130, 107,18,'							photo_4851137.html');
												thumbnails[4485173] = new thumbnail(4485173,'260354','Sun Face with Border','Sun_Head_CC6001_thumb.jpg',130, 139,18,'							photo_4485173.html');
												thumbnails[4851130] = new thumbnail(4851130,'260354','Angels','Angels_CC600_thumb.jpg',130, 87,18,'							photo_4851130.html');
												thumbnails[4857508] = new thumbnail(4857508,'260354','Puppets','Puppets_CC600_thumb.jpg',130, 113,18,'							photo_4857508.html');
												thumbnails[4887310] = new thumbnail(4887310,'260354','Wadsworth Mantle','AAA_CC600_thumb.jpg',130, 195,18,'							photo_4887310.html');
												thumbnails[4881893] = new thumbnail(4881893,'260353','Devouring Head','Mexican_CC600_thumb.jpg',130, 188,18,'							photo_4881893.html');
												thumbnails[4630828] = new thumbnail(4630828,'260353','Cuddling Cat (front view)','Cuddling_Cat_F_CC440_thumb.jpg',130, 141,18,'							photo_4630828.html');
												thumbnails[4630903] = new thumbnail(4630903,'260353','Cuddling Cat (rear view)','Cuddling_Cat_R_CC_490_thumb.jpg',130, 141,18,'							photo_4630903.html');
												thumbnails[4860183] = new thumbnail(4860183,'260353','Angel Clasp','Angel_Clasp_CC600_thumb.jpg',130, 160,18,'							photo_4860183.html');
												thumbnails[4860186] = new thumbnail(4860186,'260353','Mermaid','Mermaid_CC600_thumb.jpg',130, 207,18,'							photo_4860186.html');
												thumbnails[4860211] = new thumbnail(4860211,'260353','Angel Bust','Angel_Bust_CC600_thumb.jpg',130, 154,18,'							photo_4860211.html');
												thumbnails[4860212] = new thumbnail(4860212,'260353','Twin Bust','Twin_Bust_CC600_thumb.jpg',130, 184,18,'							photo_4860212.html');
												thumbnails[4468177] = new thumbnail(4468177,'260353','Green Man ','Mira_0191_thumb.jpg',130, 126,18,'							photo_4468177.html');
												thumbnails[4792198] = new thumbnail(4792198,'274194','Three Figs','three_figs_cc400_thumb.jpg',130, 78,18,'							photo_4792198.html');
												thumbnails[4792206] = new thumbnail(4792206,'274194','Kohlrabi and Elastic Band','kohlrabi_and_elastic_band_cc400_thumb.jpg',130, 175,18,'							photo_4792206.html');
												thumbnails[4792217] = new thumbnail(4792217,'274194','Utility Shoe','Utility__Shoe__CC400_thumb.jpg',130, 111,18,'							photo_4792217.html');
												thumbnails[4792228] = new thumbnail(4792228,'274194','Asparagus and Egg','Asparagus_and_Egg_CC400_thumb.jpg',130, 142,18,'							photo_4792228.html');
												thumbnails[4792238] = new thumbnail(4792238,'274194','Group of Toys','group_of_toys_cc400_thumb.jpg',130, 108,18,'							photo_4792238.html');
												thumbnails[4792248] = new thumbnail(4792248,'274194','Turk\'s Cap (Elizabethan) Gourd','elizabethan_gourd_cc400_thumb.jpg',130, 129,18,'							photo_4792248.html');
												thumbnails[4792255] = new thumbnail(4792255,'274194','Fennel and Book','fennel_and_book_cc400_thumb.jpg',130, 126,18,'							photo_4792255.html');
												thumbnails[4796641] = new thumbnail(4796641,'274195','Paintings','Postcards_thumb.jpg',130, 120,18,'							photo_4796641.html');
												thumbnails[4816769] = new thumbnail(4816769,'274195','Designs','postcardsTD_thumb.jpg',130, 116,18,'							photo_4816769.html');
												thumbnails[4821968] = new thumbnail(4821968,'274195','Textiles','postcardsT_thumb.jpg',130, 121,18,'							photo_4821968.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[260244] = new gallery(260244,'4468155','Paintings: Recent','gallery',[4468155,5384155,5384160,5384161,4495348,4495206,4483282,4474811,4490760,4495330,4483266,4495324,4495210,4483277,4483270,4483285,4483274,4499871,4495337,4483291,4495276,4495316,4495214,4495200,4495248,4495333,4483267,4499785,4483288,4495794,4482945,4495353,4588812,4589591],0, 0, '', '																																																																																																							gallery_260244.html',0,0);
				  					galleries[260245] = new gallery(260245,'4838980,4833669,4833664,4833662,4833659,4833655,4832928,4832927,4832877,4832874','Paintings: Archive','gallery',[4838980,4485166,4832873,4832877,4832927,4832928,4833659,4833662,4833669,4833664,4833655,4832874],0, 0, '', '																																																																																																							gallery_260245.html',0,0);
				  					galleries[260353] = new gallery(260353,'4881893,4860212,4860211,4860186,4860183,4630903,4630828,4468177','Sculpture','gallery',[4881893,4630828,4630903,4860183,4860186,4860211,4860212,4468177],0, 0, '', '																																																																																																							gallery_260353.html',0,0);
				  					galleries[260352] = new gallery(260352,'4839226,4838991,4838966,4612867,4612864,4612850,4591866,4591847,4484238,4468505','Sketchbook','gallery',[4468505,4484238,4591847,4591866,4612850,4612864,4612867,4838966,4838991,4839226],0, 0, '', '																																																																																																							gallery_260352.html',0,0);
				  					galleries[260354] = new gallery(260354,'4887310,4857508,4851139,4851137,4851132,4851131,4851130,4851129,4630756,4485173','Textiles','gallery',[4630756,4851132,4851129,4851139,4851131,4851137,4485173,4851130,4857508,4887310],0, 0, '', '																																																																																																							gallery_260354.html',0,0);
				  					galleries[260356] = new gallery(260356,'4821968,4816769,4796641,4792255,4792248,4792238,4792228,4792217,4792206,4792198','Reproductions','gallery',[],0, 0, '', '																																																																																																							gallery_260356.html',0,0);
				  					galleries[274194] = new gallery(274194,'4792255,4792248,4792238,4792228,4792217,4792206,4792198','Greeting Cards','gallery',[4792198,4792206,4792217,4792228,4792238,4792248,4792255],0, 0, '260356', '																																																																																																							gallery_274194.html',0,0);
				  					galleries[274195] = new gallery(274195,'4821968,4816769,4796641','Postcards','gallery',[4796641,4816769,4821968],0, 0, '260356', '																																																																																																							gallery_274195.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '4487719';
imageSets[2] = '4468155';
imageSets[3] = '5384161,5384160,5384155,4887310,4881893,4860212,4860211,4860186,4860183,4857508,4851139,4851137,4851132,4851131,4851130,4851129,4839226,4838991,4838980,4838966,4833669,4833664,4833662,4833659,4833655,4832928,4832927,4832877,4832874,4832873,4821968,4816769,4796641,4792255,4792248,4792238,4792228,4792217,4792206,4792198,4791735,4791726,4791711,4630903,4630828,4630756,4612867,4612864,4612850,4591866';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/miroslava/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/miroslava/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/miroslava/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/miroslava/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://www.clikchurch.com/miroslava/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/miroslava/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/miroslava/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/miroslava/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/miroslava/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/miroslava/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/miroslava/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/miroslava/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/miroslava/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/miroslava/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/miroslava/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/miroslava/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/miroslava/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/miroslava/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/miroslava/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/miroslava/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/miroslava/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/miroslava/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {

	imageID = randomListVal('');
		if (!basic) {
	img.src = photos[imageID].src;
	img.width = photos[imageID].width;
	img.height = photos[imageID].height;
  img.parentNode.title = img.alt = photos[imageID].caption;
	}
	else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
				
	}
			}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}
/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
  var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
		if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
    
  updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
  var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
      op = $.extend({},defaults,options),
      html = '', temp = '',
      photoId = op.nextPhoto.id,
      photoCaption = op.nextPhoto.caption,
      photoSrc = op.nextPhoto.src;
		
		if (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    if (op.$photo.length > 0) {
      html = $('<img/>',{
        'class': 'mainphoto photo',
        src: photoSrc,
        id: 'mainPic',
        name: 'mainPic',
        width: op.nextPhoto.width,
        height: op.nextPhoto.height,
        alt: photoCaption,
        css: op.css || {}
      });
      if (op.href) {
      	if (op.href.match(/<a/)) {
      	  html = $(op.href).append(html);
      	} else {
		  html = $('<a/>', {
			href: op.href,
			title: photoCaption
		  }).append(html);
	    }
      } else {
      	html = $('<a/>', {
			title: photoCaption
		  }).append(html);
      }
      if (op.speed == 0) {        op.$photo.html(html);        if (op.onBefore) {          op.onBefore.apply(op.$photo);        }        if (op.onAfter) {          op.onAfter.apply(op.$photo);        }      } else {        op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){            if (op.onAfter) {		    op.onAfter.apply(this);          }		  clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));		}, op.onBefore);
      }    }
    	if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Mira Bogicevic: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {photoinfominwidth:200};	    		options.photoinfoadjacent = true;			      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object') {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
	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> 				&pound;' + (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="MIROSLAVA">';
		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;
	}
}

			

