window.thumbnails = {};
															thumbnails[6946156] = clik.newPhoto({"id":6946156,"src":"2010-09-04-09-46-52-227_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":124});
															thumbnails[6948131] = clik.newPhoto({"id":6948131,"src":"DSC00682_-_Copy_thumb.JPG","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":139});
															thumbnails[8523226] = clik.newPhoto({"id":8523226,"src":"Primal_Scream_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_8523226.html","width":130,"caption":"Primal Scream","height":80});
															thumbnails[8438671] = clik.newPhoto({"id":8438671,"src":"DSC_0378_thumb.JPG","galleries_id":216213,"server_id":15,"link":"photo_8438671.html","width":130,"caption":"","height":116});
															thumbnails[6802676] = clik.newPhoto({"id":6802676,"src":"DSC_0008_thumb.jpg","galleries_id":216213,"server_id":15,"link":"photo_6802676.html","width":130,"caption":"D1","height":98});
															thumbnails[4854383] = clik.newPhoto({"id":4854383,"src":"DSC_0012_thumb.JPG","galleries_id":216213,"server_id":15,"link":"photo_4854383.html","width":130,"caption":"Untitled","height":171});
															thumbnails[4801469] = clik.newPhoto({"id":4801469,"src":"P1_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_4801469.html","width":130,"caption":"P1","height":102});
															thumbnails[6802689] = clik.newPhoto({"id":6802689,"src":"Marker_drawing_1_thumb.JPG","galleries_id":216213,"server_id":15,"link":"photo_6802689.html","width":130,"caption":"D2","height":176});
															thumbnails[4715240] = clik.newPhoto({"id":4715240,"src":"P2_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_4715240.html","width":130,"caption":"P2","height":162});
															thumbnails[4715590] = clik.newPhoto({"id":4715590,"src":"Desire_drawing0062_thumb.jpg","galleries_id":216213,"server_id":15,"link":"photo_4715590.html","width":130,"caption":"DESIRE 62","height":110});
															thumbnails[5019113] = clik.newPhoto({"id":5019113,"src":"P32_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_5019113.html","width":130,"caption":"P32","height":97});
															thumbnails[4715239] = clik.newPhoto({"id":4715239,"src":"SEX_13_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_4715239.html","width":130,"caption":"P3","height":104});
															thumbnails[4568200] = clik.newPhoto({"id":4568200,"src":"Sculpture_1fin_15_thumb.JPG","galleries_id":264900,"server_id":15,"link":"photo_4568200.html","width":130,"caption":"WITHDRAWAL","height":173});
															thumbnails[4715600] = clik.newPhoto({"id":4715600,"src":"Desire_drawing0063_thumb.jpg","galleries_id":216213,"server_id":15,"link":"photo_4715600.html","width":130,"caption":"DESIRE 63","height":109});
															thumbnails[4715238] = clik.newPhoto({"id":4715238,"src":"SEX_12_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_4715238.html","width":130,"caption":"P4","height":104});
															thumbnails[5019108] = clik.newPhoto({"id":5019108,"src":"P31_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_5019108.html","width":130,"caption":"P31","height":97});
															thumbnails[5019103] = clik.newPhoto({"id":5019103,"src":"PRIMAL_3_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_5019103.html","width":130,"caption":"P30","height":153});
															thumbnails[5018979] = clik.newPhoto({"id":5018979,"src":"P29_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_5018979.html","width":130,"caption":"P29","height":108});
															thumbnails[4123017] = clik.newPhoto({"id":4123017,"src":"DESIRE_1_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_4123017.html","width":130,"caption":"P5","height":86});
															thumbnails[4715586] = clik.newPhoto({"id":4715586,"src":"Desire_drawing0061_thumb.jpg","galleries_id":216213,"server_id":15,"link":"photo_4715586.html","width":130,"caption":"DESIRE 61","height":136});
															thumbnails[3948977] = clik.newPhoto({"id":3948977,"src":"SEXUAL_FANTASY_2_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_3948977.html","width":130,"caption":"P6","height":131});
															thumbnails[3952804] = clik.newPhoto({"id":3952804,"src":"SEXUAL_FANTASY_1_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_3952804.html","width":130,"caption":"P7","height":174});
															thumbnails[3780780] = clik.newPhoto({"id":3780780,"src":"Abandonment_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_3780780.html","width":130,"caption":"P8","height":63});
															thumbnails[3780783] = clik.newPhoto({"id":3780783,"src":"DSC_00051_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_3780783.html","width":130,"caption":"P9","height":130});
															thumbnails[3539015] = clik.newPhoto({"id":3539015,"src":"SEX_CARTOON_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_3539015.html","width":130,"caption":"P10","height":131});
															thumbnails[3542009] = clik.newPhoto({"id":3542009,"src":"SEX_CARTOON_2_2_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_3542009.html","width":130,"caption":"P11","height":129});
															thumbnails[3542058] = clik.newPhoto({"id":3542058,"src":"sex_in_progress1_thumb.jpg","galleries_id":216212,"server_id":15,"link":"photo_3542058.html","width":130,"caption":"P12","height":64});
															thumbnails[3542068] = clik.newPhoto({"id":3542068,"src":"sex_in_progress2_thumb.jpg","galleries_id":216212,"server_id":15,"link":"photo_3542068.html","width":130,"caption":"P13","height":86});
															thumbnails[3542073] = clik.newPhoto({"id":3542073,"src":"sex_in_progress3_thumb.jpg","galleries_id":216212,"server_id":15,"link":"photo_3542073.html","width":130,"caption":"P14","height":104});
															thumbnails[3542080] = clik.newPhoto({"id":3542080,"src":"sex_in_progress4_thumb.jpg","galleries_id":216212,"server_id":15,"link":"photo_3542080.html","width":130,"caption":"P15","height":103});
															thumbnails[3556524] = clik.newPhoto({"id":3556524,"src":"Sex_1_thumb.jpg","galleries_id":216212,"server_id":15,"link":"photo_3556524.html","width":130,"caption":"P16","height":106});
															thumbnails[3556545] = clik.newPhoto({"id":3556545,"src":"ANIMAL_2__thumb.jpg","galleries_id":216212,"server_id":15,"link":"photo_3556545.html","width":130,"caption":"P17","height":129});
															thumbnails[3557182] = clik.newPhoto({"id":3557182,"src":"THE_MASTURBATOR_thumb.jpg","galleries_id":216212,"server_id":15,"link":"photo_3557182.html","width":130,"caption":"P18","height":132});
															thumbnails[3557190] = clik.newPhoto({"id":3557190,"src":"MASTURBATOR_STUDY_1_thumb.jpg","galleries_id":216212,"server_id":15,"link":"photo_3557190.html","width":130,"caption":"P19","height":129});
															thumbnails[3557197] = clik.newPhoto({"id":3557197,"src":"MASTURBATOR_STUDY_2_thumb.jpg","galleries_id":216212,"server_id":15,"link":"photo_3557197.html","width":130,"caption":"P20","height":133});
															thumbnails[3557220] = clik.newPhoto({"id":3557220,"src":"Sex_2_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_3557220.html","width":130,"caption":"P21","height":107});
															thumbnails[3557239] = clik.newPhoto({"id":3557239,"src":"P22_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_3557239.html","width":130,"caption":"P22","height":131});
															thumbnails[3557402] = clik.newPhoto({"id":3557402,"src":"Sex_11_thumb.jpg","galleries_id":216212,"server_id":15,"link":"photo_3557402.html","width":130,"caption":"P23","height":160});
															thumbnails[3557423] = clik.newPhoto({"id":3557423,"src":"SEX_3___195CM_X_39CM_-_Copy_thumb.jpg","galleries_id":216212,"server_id":15,"link":"photo_3557423.html","width":130,"caption":"P24","height":64});
															thumbnails[3557461] = clik.newPhoto({"id":3557461,"src":"Arousal_1_thumb.jpg","galleries_id":216212,"server_id":15,"link":"photo_3557461.html","width":130,"caption":"P25","height":130});
															thumbnails[3557465] = clik.newPhoto({"id":3557465,"src":"Sex_Act_1_thumb.jpg","galleries_id":216212,"server_id":15,"link":"photo_3557465.html","width":130,"caption":"P26","height":131});
															thumbnails[3557467] = clik.newPhoto({"id":3557467,"src":"Attainment__1_thumb.jpg","galleries_id":216212,"server_id":15,"link":"photo_3557467.html","width":130,"caption":"P27","height":129});
															thumbnails[3557482] = clik.newPhoto({"id":3557482,"src":"AROUSAL_STUDY_1_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_3557482.html","width":130,"caption":"P28","height":129});
															thumbnails[3692626] = clik.newPhoto({"id":3692626,"src":"DESIRE_DRAWING0024_thumb.jpg","galleries_id":216213,"server_id":15,"link":"photo_3692626.html","width":130,"caption":"DESIRE DRAWING 24","height":180});
															thumbnails[3692630] = clik.newPhoto({"id":3692630,"src":"DESIRE_DRAWING0016_thumb.jpg","galleries_id":216213,"server_id":15,"link":"photo_3692630.html","width":130,"caption":"DESIRE DRAWING 16","height":167});
															thumbnails[3692632] = clik.newPhoto({"id":3692632,"src":"DESIRE_DRAWING0017_thumb.jpg","galleries_id":216213,"server_id":15,"link":"photo_3692632.html","width":130,"caption":"DESIRE DRAWING 17","height":167});
															thumbnails[3692637] = clik.newPhoto({"id":3692637,"src":"DESIRE_DRAWING0019_thumb.jpg","galleries_id":216213,"server_id":15,"link":"photo_3692637.html","width":130,"caption":"DESIRE DRAWING 19","height":138});
															thumbnails[3692642] = clik.newPhoto({"id":3692642,"src":"DESIRE_DRAWING0022_thumb.jpg","galleries_id":216213,"server_id":15,"link":"photo_3692642.html","width":130,"caption":"DESIRE DRAWING 22","height":122});
															thumbnails[3692647] = clik.newPhoto({"id":3692647,"src":"DESIRE_DRAWING0023_thumb.jpg","galleries_id":216213,"server_id":15,"link":"photo_3692647.html","width":130,"caption":"DESIRE DRAWING 23","height":122});
															thumbnails[3692655] = clik.newPhoto({"id":3692655,"src":"DESIRE_DRAWING0027_thumb.jpg","galleries_id":216213,"server_id":15,"link":"photo_3692655.html","width":130,"caption":"DESIRE DRAWING 27","height":203});
															thumbnails[3692664] = clik.newPhoto({"id":3692664,"src":"DESIRE_DRAWING0028_thumb.jpg","galleries_id":216213,"server_id":15,"link":"photo_3692664.html","width":130,"caption":"DESIRE DRAWING 28","height":183});
															thumbnails[3692676] = clik.newPhoto({"id":3692676,"src":"DESIRE_DRAWING0029_thumb.jpg","galleries_id":216213,"server_id":15,"link":"photo_3692676.html","width":130,"caption":"DESIRE DRAWING 29","height":183});
															thumbnails[5376635] = clik.newPhoto({"id":5376635,"src":"P33_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_5376635.html","width":130,"caption":"P33","height":129});
															thumbnails[5376660] = clik.newPhoto({"id":5376660,"src":"P34_thumb.JPG","galleries_id":216212,"server_id":15,"link":"photo_5376660.html","width":130,"caption":"P34","height":131});
															thumbnails[3543857] = clik.newPhoto({"id":3543857,"src":"Art_and_Sex0042_thumb.jpg","galleries_id":216213,"server_id":15,"link":"photo_3543857.html","width":130,"caption":"Desire drawing 42","height":94});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[216212] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"PAINTINGS","link":"gallery_216212.html","maxRecords":0.0,"photoIDs":[8523226.0,4801469.0,4715240.0,5019113.0,4715239.0,4715238.0,5019108.0,5019103.0,5018979.0,4123017.0,3948977.0,3952804.0,3780780.0,3780783.0,3539015.0,3542009.0,3542058.0,3542068.0,3542073.0,3542080.0,3556524.0,3556545.0,3557182.0,3557190.0,3557197.0,3557220.0,3557239.0,3557402.0,3557423.0,3557461.0,3557465.0,3557467.0,3557482.0,5376635.0,5376660.0],"skipIndex":0,"section_code":"gallery","featured_images":4801469.0,"id":216212,"singleSection":false});				  						galleries[216213] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"DRAWINGS","link":"gallery_216213.html","maxRecords":0.0,"photoIDs":[8438671.0,6802676.0,4854383.0,6802689.0,4715590.0,4715600.0,4715586.0,3692626.0,3692630.0,3692632.0,3692637.0,3692642.0,3692647.0,3692655.0,3692664.0,3692676.0,3543857.0],"skipIndex":0,"section_code":"gallery","featured_images":3543857.0,"id":216213,"singleSection":false});				  						galleries[264900] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"SCULPTURE","link":"gallery_264900.html","maxRecords":0.0,"photoIDs":[4568200.0],"skipIndex":0,"section_code":"gallery","featured_images":4568200.0,"id":264900,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6948131,6946156';
imageSets[2] = '4801469,4568200,3543857';
imageSets[3] = '8523226,8438671,6948131,6946156,6802689,6802676,5376660,5376635,5019113,5019108,5019103,5018979,4854383,4801469,4715600,4715590,4715586,4715240,4715239,4715238,4568200,4123017,3952804,3948977,3780783,3780780,3692676,3692664,3692655,3692647,3692642,3692637,3692632,3692630,3692626,3557482,3557467,3557465,3557461,3557423,3557402,3557239,3557220,3557197,3557190,3557182,3556545,3556524,3543857,3542080';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/marknewton/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/marknewton/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/marknewton/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/marknewton/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/marknewton/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/marknewton/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/marknewton/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/marknewton/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 || photos || {})[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:'',$detailContainer:'',
                    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 (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'artofdesire: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		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.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			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', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Year created </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Medium </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Artist </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '') {
			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({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* 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 += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

