window.thumbnails = new Object();
												thumbnails[3755050] = new thumbnail(3755050,'','','Title-Background_thumb.jpg',130, 78,15,'							photo_3755050.html');
												thumbnails[3718240] = new thumbnail(3718240,'','','FP01_thumb.jpg',130, 130,15,'							photo_3718240.html');
												thumbnails[3718241] = new thumbnail(3718241,'','','FP02_thumb.jpg',130, 130,15,'							photo_3718241.html');
												thumbnails[3718242] = new thumbnail(3718242,'','','FP03_thumb.jpg',130, 130,15,'							photo_3718242.html');
												thumbnails[3718243] = new thumbnail(3718243,'','','FP04_thumb.jpg',130, 130,15,'							photo_3718243.html');
												thumbnails[3718248] = new thumbnail(3718248,'','','FP05_thumb.jpg',130, 130,15,'							photo_3718248.html');
												thumbnails[3718244] = new thumbnail(3718244,'','','FP06_thumb.jpg',130, 130,15,'							photo_3718244.html');
												thumbnails[3718245] = new thumbnail(3718245,'','','FP072_thumb.jpg',130, 130,15,'							photo_3718245.html');
												thumbnails[3718246] = new thumbnail(3718246,'','','FP08_thumb.jpg',130, 130,15,'							photo_3718246.html');
												thumbnails[3718247] = new thumbnail(3718247,'','','FP09_thumb.jpg',130, 130,15,'							photo_3718247.html');
												thumbnails[3699746] = new thumbnail(3699746,'223568','Shimmer','XN01_AC12_thumb.jpg',130, 130,15,'							photo_3699746.html');
												thumbnails[3699747] = new thumbnail(3699747,'223568','Shine','XN02__thumb.jpg',130, 130,15,'							photo_3699747.html');
												thumbnails[3699748] = new thumbnail(3699748,'223568','Zig-Zag','XN03_ZigZag_thumb.jpg',130, 130,15,'							photo_3699748.html');
												thumbnails[3699750] = new thumbnail(3699750,'223568','Beauty','XN04__thumb.jpg',130, 130,15,'							photo_3699750.html');
												thumbnails[3699759] = new thumbnail(3699759,'223568','Crystal Ball','XN05__thumb.jpg',130, 130,15,'							photo_3699759.html');
												thumbnails[3699766] = new thumbnail(3699766,'223568','Glamour','XN06_Classic_thumb.jpg',130, 130,15,'							photo_3699766.html');
												thumbnails[3699769] = new thumbnail(3699769,'223568','Spiky','XN07_Spiky_thumb.jpg',130, 130,15,'							photo_3699769.html');
												thumbnails[3699770] = new thumbnail(3699770,'223568','Elegance','XN08_Elegance_thumb.jpg',130, 130,15,'							photo_3699770.html');
												thumbnails[3699772] = new thumbnail(3699772,'223568','Crystal rondelle choker','XN09_CrystalRondelle_thumb.jpg',130, 130,15,'							photo_3699772.html');
												thumbnails[3699773] = new thumbnail(3699773,'223568','Pearl & crystal rondelle','XN10_PearlRondelle_thumb.jpg',130, 130,15,'							photo_3699773.html');
												thumbnails[3699774] = new thumbnail(3699774,'223568','Multi-drop','XN11_Multidrop_thumb.jpg',130, 130,15,'							photo_3699774.html');
												thumbnails[3699776] = new thumbnail(3699776,'223568','Chic','XN12_Chic_thumb.jpg',130, 130,15,'							photo_3699776.html');
												thumbnails[3699778] = new thumbnail(3699778,'223568','Dazzle','XN13_Dazzle_thumb.jpg',130, 130,15,'							photo_3699778.html');
												thumbnails[3699780] = new thumbnail(3699780,'223568','Crystal weave','XN14_CrystalWeave_thumb.jpg',130, 130,15,'							photo_3699780.html');
												thumbnails[3699781] = new thumbnail(3699781,'223568','Crystal and seed bead','XN15_RoseAndCrystal_thumb.jpg',130, 130,15,'							photo_3699781.html');
												thumbnails[3699783] = new thumbnail(3699783,'223568','Sparkle','XN16_Sparkle_thumb.jpg',130, 130,15,'							photo_3699783.html');
												thumbnails[3709889] = new thumbnail(3709889,'223569','Crystal Rondelle','B06_CrystalRondelle_thumb.jpg',130, 130,15,'							photo_3709889.html');
												thumbnails[3711367] = new thumbnail(3711367,'223569','Stretchy Charm','B02_StretchyCharm_thumb.jpg',130, 130,15,'							photo_3711367.html');
												thumbnails[3711957] = new thumbnail(3711957,'223569','Elegance','B07_Elegance_thumb.jpg',130, 130,15,'							photo_3711957.html');
												thumbnails[3716767] = new thumbnail(3716767,'223569','Pearl & crystal rondelle','B04__thumb.jpg',130, 130,15,'							photo_3716767.html');
												thumbnails[3718060] = new thumbnail(3718060,'223569','Sparkle','B01_Sparkler_thumb.jpg',130, 130,15,'							photo_3718060.html');
												thumbnails[3718062] = new thumbnail(3718062,'223569','Shine','B03__thumb.jpg',130, 130,15,'							photo_3718062.html');
												thumbnails[3718065] = new thumbnail(3718065,'223569','Chic','B05_Chic_thumb.jpg',130, 130,15,'							photo_3718065.html');
												thumbnails[3709895] = new thumbnail(3709895,'226515','Sparkle','E09_Sparkle_thumb.jpg',130, 130,15,'							photo_3709895.html');
												thumbnails[3709958] = new thumbnail(3709958,'226515','Chic','E13_Chic_thumb.jpg',130, 130,15,'							photo_3709958.html');
												thumbnails[3711919] = new thumbnail(3711919,'226515','Dazzle','E07_Dazzle_thumb.jpg',130, 130,15,'							photo_3711919.html');
												thumbnails[3711923] = new thumbnail(3711923,'226515','Crystal & seed bead','E06_RoseAndCrystal_thumb.jpg',130, 130,15,'							photo_3711923.html');
												thumbnails[3712010] = new thumbnail(3712010,'226515','Elegance','E15_Elegance_thumb.jpg',130, 130,15,'							photo_3712010.html');
												thumbnails[3712033] = new thumbnail(3712033,'226515','Glamour','E08_Classic_thumb.jpg',130, 130,15,'							photo_3712033.html');
												thumbnails[3718027] = new thumbnail(3718027,'226515','Small butterfly','E01_SmallButterfly_thumb.jpg',130, 130,15,'							photo_3718027.html');
												thumbnails[3718029] = new thumbnail(3718029,'226515','Small heart','E02_Heart_thumb.jpg',130, 130,15,'							photo_3718029.html');
												thumbnails[3718030] = new thumbnail(3718030,'226515','Large butterfly','E03_LargeButterfly_thumb.jpg',130, 130,15,'							photo_3718030.html');
												thumbnails[3718031] = new thumbnail(3718031,'226515','Chandelier single colour','E04_Glamour_thumb.jpg',130, 130,15,'							photo_3718031.html');
												thumbnails[3718033] = new thumbnail(3718033,'226515','Chandelier bicoloured','E05_Glitz_thumb.jpg',130, 130,15,'							photo_3718033.html');
												thumbnails[3718035] = new thumbnail(3718035,'226515','Shine','E10_thumb.jpg',130, 130,15,'							photo_3718035.html');
												thumbnails[3718036] = new thumbnail(3718036,'226515','Crystal ball','E11_CrystalRondelleBall_thumb.jpg',130, 130,15,'							photo_3718036.html');
												thumbnails[3718038] = new thumbnail(3718038,'226515','Multi-drop','E12_Multidrop_thumb.jpg',130, 130,15,'							photo_3718038.html');
												thumbnails[3718040] = new thumbnail(3718040,'226515','Shimmer','E14_AC_thumb.jpg',130, 130,15,'							photo_3718040.html');
												thumbnails[3709852] = new thumbnail(3709852,'223555','Ruth','T03_Ruth_thumb.jpg',130, 130,15,'							photo_3709852.html');
												thumbnails[3711387] = new thumbnail(3711387,'223555','Kayleigh','T02_Kayleigh_thumb.jpg',130, 130,15,'							photo_3711387.html');
												thumbnails[3711733] = new thumbnail(3711733,'223555','Lisa','T09_Lisa_thumb.jpg',130, 130,15,'							photo_3711733.html');
												thumbnails[3711740] = new thumbnail(3711740,'223555','Tiffany','T08_Tiffany_thumb.jpg',130, 130,15,'							photo_3711740.html');
												thumbnails[3711753] = new thumbnail(3711753,'223555','Marie','T07_Marie_thumb.jpg',130, 130,15,'							photo_3711753.html');
												thumbnails[3711863] = new thumbnail(3711863,'223555','Amy','T01_Amy_thumb.jpg',130, 130,15,'							photo_3711863.html');
												thumbnails[3711877] = new thumbnail(3711877,'223555','Roxy','T11_Roxy_thumb.jpg',130, 130,15,'							photo_3711877.html');
												thumbnails[3711900] = new thumbnail(3711900,'223555','Lauren','T05_Lauren_thumb.jpg',130, 130,15,'							photo_3711900.html');
												thumbnails[3716629] = new thumbnail(3716629,'223555','Emma','T10_Emma_thumb.jpg',130, 130,15,'							photo_3716629.html');
												thumbnails[3716707] = new thumbnail(3716707,'223555','Carly','T06_Carly_thumb.jpg',130, 130,15,'							photo_3716707.html');
												thumbnails[3718127] = new thumbnail(3718127,'223555','Pricilla','T04_Priscilla_thumb.jpg',130, 130,15,'							photo_3718127.html');
												thumbnails[3707843] = new thumbnail(3707843,'226779','Phoebe','ST02_Phoebe_thumb.jpg',130, 130,15,'							photo_3707843.html');
												thumbnails[3709563] = new thumbnail(3709563,'226779','Kelly','ST01_Kelly_thumb.jpg',130, 130,15,'							photo_3709563.html');
												thumbnails[3709590] = new thumbnail(3709590,'226779','Isobel','ST04_Isobel_thumb.jpg',130, 130,15,'							photo_3709590.html');
												thumbnails[3709745] = new thumbnail(3709745,'226779','Letitia','ST03_Letitia_thumb.jpg',130, 130,15,'							photo_3709745.html');
												thumbnails[3707837] = new thumbnail(3707837,'226514','Rainbow Hair band','HB03_Rainbow_thumb.jpg',130, 130,15,'							photo_3707837.html');
												thumbnails[3711359] = new thumbnail(3711359,'226514','Pricilla','HB01_Priscella_thumb.jpg',130, 130,15,'							photo_3711359.html');
												thumbnails[3716474] = new thumbnail(3716474,'226514','Crystal','HB02_Crystal_thumb.jpg',130, 130,15,'							photo_3716474.html');
												thumbnails[3711369] = new thumbnail(3711369,'226778','Tara','HP07_Tara_thumb.jpg',130, 130,15,'							photo_3711369.html');
												thumbnails[3711378] = new thumbnail(3711378,'226778','Spiral','HP02_Spiral_thumb.jpg',130, 130,15,'							photo_3711378.html');
												thumbnails[3711380] = new thumbnail(3711380,'226778','Crystal flower','HP06_Crystal_thumb.jpg',130, 130,15,'							photo_3711380.html');
												thumbnails[3711382] = new thumbnail(3711382,'226778','Butterfly','HP01_Butterfly_thumb.jpg',130, 130,15,'							photo_3711382.html');
												thumbnails[3711677] = new thumbnail(3711677,'226778','Pearl flower','HP11_Pearl_thumb.jpg',130, 130,15,'							photo_3711677.html');
												thumbnails[3716481] = new thumbnail(3716481,'226778','Pearl','HP13_PearlPins_thumb.jpg',130, 130,15,'							photo_3716481.html');
												thumbnails[3716572] = new thumbnail(3716572,'226778','Crystal','HP12_CrystalPins_thumb.jpg',130, 130,15,'							photo_3716572.html');
												thumbnails[3716584] = new thumbnail(3716584,'226778','Emma','HP10_Emma_thumb.jpg',130, 130,15,'							photo_3716584.html');
												thumbnails[3716586] = new thumbnail(3716586,'226778','Pricilla','HP09_Pricilla_thumb.jpg',130, 130,15,'							photo_3716586.html');
												thumbnails[3716592] = new thumbnail(3716592,'226778','Tasha','HP08_Tasha_thumb.jpg',130, 130,15,'							photo_3716592.html');
												thumbnails[3716601] = new thumbnail(3716601,'226778','Amy','HP03_Amy_thumb.jpg',130, 130,15,'							photo_3716601.html');
												thumbnails[3709764] = new thumbnail(3709764,'223570','Tasha','C04_Tasha_thumb.jpg',130, 130,15,'							photo_3709764.html');
												thumbnails[3709798] = new thumbnail(3709798,'223570','Melissa','C02_Melissa_thumb.jpg',130, 130,15,'							photo_3709798.html');
												thumbnails[3711331] = new thumbnail(3711331,'223570','Emma','C03_Emma_thumb.jpg',130, 130,15,'							photo_3711331.html');
												thumbnails[3711336] = new thumbnail(3711336,'223570','Tara','C01_Tara_thumb.jpg',130, 130,15,'							photo_3711336.html');
												thumbnails[3711348] = new thumbnail(3711348,'223570','Pricilla','C05_Pricilla_thumb.jpg',130, 130,15,'							photo_3711348.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[223568] = new gallery(223568,'3699783,3699781,3699780,3699778,3699776,3699774,3699773,3699772,3699770,3699769','Necklaces','gallery',[3699746,3699747,3699748,3699750,3699759,3699766,3699769,3699770,3699772,3699773,3699774,3699776,3699778,3699780,3699781,3699783],0, 0, '', '																																																																																																							gallery_223568.html',0,0);
				  					galleries[223569] = new gallery(223569,'3718065,3718062,3718060,3716767,3711957,3711367,3709889','Bracelets','gallery',[3709889,3711367,3711957,3716767,3718060,3718062,3718065],0, 0, '', '																																																																																																							gallery_223569.html',0,0);
				  					galleries[226515] = new gallery(226515,'3718040,3718038,3718036,3718035,3718033,3718031,3718030,3718029,3718027,3712033','Earrings','gallery',[3709895,3709958,3711919,3711923,3712010,3712033,3718027,3718029,3718030,3718031,3718033,3718035,3718036,3718038,3718040],0, 0, '', '																																																																																																							gallery_226515.html',0,0);
				  					galleries[223555] = new gallery(223555,'3718127,3716707,3716629,3711900,3711877,3711863,3711753,3711740,3711733,3711387','Tiaras','gallery',[3709852,3711387,3711733,3711740,3711753,3711863,3711877,3711900,3716629,3716707,3718127],0, 0, '', '																																																																																																							gallery_223555.html',0,0);
				  					galleries[226779] = new gallery(226779,'3709745,3709590,3709563,3707843','Side tiaras','gallery',[3707843,3709563,3709590,3709745],0, 0, '', '																																																																																																							gallery_226779.html',0,0);
				  					galleries[226514] = new gallery(226514,'3716474,3711359,3707837','Hair bands','gallery',[3707837,3711359,3716474],0, 0, '', '																																																																																																							gallery_226514.html',0,0);
				  					galleries[226778] = new gallery(226778,'3716601,3716592,3716586,3716584,3716572,3716481,3711677,3711382,3711380,3711378','Hair pins','gallery',[3711369,3711378,3711380,3711382,3711677,3716481,3716572,3716584,3716586,3716592,3716601],0, 0, '', '																																																																																																							gallery_226778.html',0,0);
				  					galleries[223570] = new gallery(223570,'3711348,3711336,3711331,3709798,3709764','Combs','gallery',[3709764,3709798,3711331,3711336,3711348],0, 0, '', '																																																																																																							gallery_223570.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '3718248,3718247,3718246,3718245,3718244,3718243,3718242,3718241,3718240';
imageSets[3] = '3755050,3718248,3718247,3718246,3718245,3718244,3718243,3718242,3718241,3718240,3718127,3718065,3718062,3718060,3718040,3718038,3718036,3718035,3718033,3718031,3718030,3718029,3718027,3716767,3716707,3716629,3716601,3716592,3716586,3716584,3716572,3716481,3716474,3712033,3712010,3711957,3711923,3711919,3711900,3711877,3711863,3711753,3711740,3711733,3711677,3711387,3711382,3711380,3711378,3711369';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://www.clikchurch.com/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/marionmeek/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/marionmeek/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 = 'Marion Meek Jewellery: ' + 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));    }        
    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>Item 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 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="MARIONMEEK">';
		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;
	}
}

			

