window.thumbnails = new Object();
												thumbnails[3135745] = new thumbnail(3135745,'192488','','Wedkn01_thumb.jpg',130, 195,5,'photo_3135745.html');
												thumbnails[3135746] = new thumbnail(3135746,'192488','','Wedkn02_thumb.jpg',130, 195,5,'photo_3135746.html');
												thumbnails[3135747] = new thumbnail(3135747,'192488','','Wedkn03_thumb.jpg',130, 87,5,'photo_3135747.html');
												thumbnails[3135748] = new thumbnail(3135748,'192488','','Wedkn04_thumb.jpg',130, 195,5,'photo_3135748.html');
												thumbnails[3135749] = new thumbnail(3135749,'192488','','Wedkn05_thumb.jpg',130, 195,5,'photo_3135749.html');
												thumbnails[3135750] = new thumbnail(3135750,'192488','','Wedkn06_thumb.jpg',130, 195,5,'photo_3135750.html');
												thumbnails[3135751] = new thumbnail(3135751,'192488','','Wedkn07_thumb.jpg',130, 195,5,'photo_3135751.html');
												thumbnails[3135752] = new thumbnail(3135752,'192488','','Wedkn08_thumb.jpg',130, 195,5,'photo_3135752.html');
												thumbnails[3135755] = new thumbnail(3135755,'192488','','Wedkn09_thumb.jpg',130, 195,5,'photo_3135755.html');
												thumbnails[3135756] = new thumbnail(3135756,'192488','','Wedkn10_thumb.jpg',130, 195,5,'photo_3135756.html');
												thumbnails[3138846] = new thumbnail(3138846,'191840','','Wedw2_thumb.jpg',130, 180,5,'photo_3138846.html');
												thumbnails[3138847] = new thumbnail(3138847,'191840','','Wedw3_thumb.jpg',130, 185,5,'photo_3138847.html');
												thumbnails[3138848] = new thumbnail(3138848,'191840','','Wed031_thumb.jpg',130, 195,5,'photo_3138848.html');
												thumbnails[3138849] = new thumbnail(3138849,'191840','','Wed041_thumb.jpg',130, 171,5,'photo_3138849.html');
												thumbnails[3138850] = new thumbnail(3138850,'191840','','Wed051_thumb.jpg',130, 195,5,'photo_3138850.html');
												thumbnails[3138854] = new thumbnail(3138854,'191840','','Wed071_thumb.jpg',130, 87,5,'photo_3138854.html');
												thumbnails[3138855] = new thumbnail(3138855,'191840','','Wedw1_thumb.jpg',130, 76,5,'photo_3138855.html');
												thumbnails[3138856] = new thumbnail(3138856,'191840','','Wedw4_thumb.jpg',130, 195,5,'photo_3138856.html');
												thumbnails[3138857] = new thumbnail(3138857,'191840','','Wed10_thumb.jpg',130, 87,5,'photo_3138857.html');
												thumbnails[3138858] = new thumbnail(3138858,'191840','','Wed062_thumb.jpg',130, 195,5,'photo_3138858.html');
												thumbnails[3165971] = new thumbnail(3165971,'192487','','wed2 - 1_thumb.jpg',130, 195,5,'photo_3165971.html');
												thumbnails[3165974] = new thumbnail(3165974,'192487','','wed2 - 2_thumb.jpg',130, 195,5,'photo_3165974.html');
												thumbnails[3165975] = new thumbnail(3165975,'192487','','wed2 - 3_thumb.jpg',130, 195,5,'photo_3165975.html');
												thumbnails[3165977] = new thumbnail(3165977,'192487','','wed2 - 4_thumb.jpg',130, 195,5,'photo_3165977.html');
												thumbnails[3165979] = new thumbnail(3165979,'192487','','wed2 - 5_thumb.jpg',130, 195,5,'photo_3165979.html');
												thumbnails[3165980] = new thumbnail(3165980,'192487','','wed2 - 6_thumb.jpg',130, 195,5,'photo_3165980.html');
												thumbnails[3165981] = new thumbnail(3165981,'192487','','wed2 - 7_thumb.jpg',130, 195,5,'photo_3165981.html');
												thumbnails[3165982] = new thumbnail(3165982,'192487','','wed2 - 8_thumb.jpg',130, 195,5,'photo_3165982.html');
												thumbnails[3165984] = new thumbnail(3165984,'192487','','wed2 - 9_thumb.jpg',130, 195,5,'photo_3165984.html');
												thumbnails[3165987] = new thumbnail(3165987,'192487','','wed2 - 10_thumb.jpg',130, 195,5,'photo_3165987.html');
												thumbnails[6936122] = new thumbnail(6936122,'191841','Sydney Design Connection','SDC_thumb.jpg',130, 79,5,'photo_6936122.html');
												thumbnails[3366014] = new thumbnail(3366014,'191841','Mark & Fiona Scognamiglio','wed2 - 61_thumb.jpg',130, 195,5,'photo_3366014.html');
												thumbnails[3382876] = new thumbnail(3382876,'206544','','Wed3 - 1_thumb.jpg',130, 195,5,'photo_3382876.html');
												thumbnails[3382887] = new thumbnail(3382887,'206545','','Wed4 - 1_thumb.jpg',130, 195,5,'photo_3382887.html');
												thumbnails[5172908] = new thumbnail(5172908,'292069','','Trevor_Martin_Wedding_album_sample_-_00_Album_Cover_thumb.jpg',130, 181,5,'photo_5172908.html');
												thumbnails[5172909] = new thumbnail(5172909,'292069','','Trevor_Martin_Wedding_album_sample_-_1_thumb.jpg',130, 89,5,'photo_5172909.html');
												thumbnails[5172910] = new thumbnail(5172910,'292069','','Trevor_Martin_Wedding_album_sample_-_2_thumb.jpg',130, 89,5,'photo_5172910.html');
												thumbnails[5172911] = new thumbnail(5172911,'292069','','Trevor_Martin_Wedding_album_sample_-_3_thumb.jpg',130, 89,5,'photo_5172911.html');
												thumbnails[5172912] = new thumbnail(5172912,'292069','','Trevor_Martin_Wedding_album_sample_-_4_thumb.jpg',130, 89,5,'photo_5172912.html');
												thumbnails[5172913] = new thumbnail(5172913,'292069','','Trevor_Martin_Wedding_album_sample_-_5_thumb.jpg',130, 89,5,'photo_5172913.html');
												thumbnails[5172914] = new thumbnail(5172914,'292069','','Trevor_Martin_Wedding_album_sample_-_6_thumb.jpg',130, 89,5,'photo_5172914.html');
												thumbnails[5172915] = new thumbnail(5172915,'292069','','Trevor_Martin_Wedding_album_sample_-_7_thumb.jpg',130, 89,5,'photo_5172915.html');
												thumbnails[5172916] = new thumbnail(5172916,'292069','','Trevor_Martin_Wedding_album_sample_-_8_thumb.jpg',130, 89,5,'photo_5172916.html');
												thumbnails[5172917] = new thumbnail(5172917,'292069','','Trevor_Martin_Wedding_album_sample_-_9_thumb.jpg',130, 89,5,'photo_5172917.html');
												thumbnails[3138834] = new thumbnail(3138834,'191841','John and Heidi Oh','johnheidi_thumb.jpg',130, 195,5,'photo_3138834.html');
												thumbnails[3382877] = new thumbnail(3382877,'206544','','Wed3 - 2_thumb.jpg',130, 195,5,'photo_3382877.html');
												thumbnails[3382888] = new thumbnail(3382888,'206545','','Wed4 - 2_thumb.jpg',130, 195,5,'photo_3382888.html');
												thumbnails[5172953] = new thumbnail(5172953,'292069','','Trevor_Martin_Wedding_album_sample_-_10_thumb.jpg',130, 89,5,'photo_5172953.html');
												thumbnails[5172956] = new thumbnail(5172956,'292069','','Trevor_Martin_Wedding_album_sample_-_11_thumb.jpg',130, 89,5,'photo_5172956.html');
												thumbnails[5172957] = new thumbnail(5172957,'292069','','Trevor_Martin_Wedding_album_sample_-_12_thumb.jpg',130, 89,5,'photo_5172957.html');
												thumbnails[5172958] = new thumbnail(5172958,'292069','','Trevor_Martin_Wedding_album_sample_-_13_thumb.jpg',130, 89,5,'photo_5172958.html');
												thumbnails[5172959] = new thumbnail(5172959,'292069','','Trevor_Martin_Wedding_album_sample_-_14_thumb.jpg',130, 89,5,'photo_5172959.html');
												thumbnails[3138821] = new thumbnail(3138821,'191841','Natavia Fashion','natavia_thumb.jpg',130, 195,5,'photo_3138821.html');
												thumbnails[3382878] = new thumbnail(3382878,'206544','','Wed3 - 3_thumb.jpg',130, 195,5,'photo_3382878.html');
												thumbnails[3382889] = new thumbnail(3382889,'206545','','Wed4 - 3_thumb.jpg',130, 87,5,'photo_3382889.html');
												thumbnails[3138811] = new thumbnail(3138811,'191841','Aussie Born&Bred Surfwear','aussieb&b_thumb.jpg',130, 181,5,'photo_3138811.html');
												thumbnails[3382879] = new thumbnail(3382879,'206544','','Wed3 - 4_thumb.jpg',130, 195,5,'photo_3382879.html');
												thumbnails[3382890] = new thumbnail(3382890,'206545','','Wed4 - 4_thumb.jpg',130, 87,5,'photo_3382890.html');
												thumbnails[5658861] = new thumbnail(5658861,'191842','','C_-_Piper_-_Moth_collage_Web1_thumb.jpg',130, 190,5,'photo_5658861.html');
												thumbnails[3138808] = new thumbnail(3138808,'191841','Alchemy Media','alchemy_thumb.jpg',130, 195,5,'photo_3138808.html');
												thumbnails[3382893] = new thumbnail(3382893,'206545','','Wed4 - 7_thumb.jpg',130, 87,5,'photo_3382893.html');
												thumbnails[3138822] = new thumbnail(3138822,'191841','Skarr Bridal','skarr_thumb.jpg',130, 108,5,'photo_3138822.html');
												thumbnails[3382880] = new thumbnail(3382880,'206544','','Wed3 - 5_thumb.jpg',130, 195,5,'photo_3382880.html');
												thumbnails[3382891] = new thumbnail(3382891,'206545','','Wed4 - 5_thumb.jpg',130, 195,5,'photo_3382891.html');
												thumbnails[3382881] = new thumbnail(3382881,'206544','','Wed3 - 6_thumb.jpg',130, 195,5,'photo_3382881.html');
												thumbnails[3382892] = new thumbnail(3382892,'206545','','Wed4 - 6_thumb.jpg',130, 195,5,'photo_3382892.html');
												thumbnails[5652895] = new thumbnail(5652895,'191842','','C_-_Irina_collage_Web_thumb.jpg',130, 191,5,'photo_5652895.html');
												thumbnails[3382882] = new thumbnail(3382882,'206544','','Wed3 - 7_thumb.jpg',130, 87,5,'photo_3382882.html');
												thumbnails[5652896] = new thumbnail(5652896,'191842','','C_-_Irinia_Water_collage_Web_thumb.jpg',130, 182,5,'photo_5652896.html');
												thumbnails[3382884] = new thumbnail(3382884,'206544','','Wed3 - 8_thumb.jpg',130, 195,5,'photo_3382884.html');
												thumbnails[3382894] = new thumbnail(3382894,'206545','','Wed4 - 8_thumb.jpg',130, 195,5,'photo_3382894.html');
												thumbnails[5652897] = new thumbnail(5652897,'191842','','C_-_Kate_McCracken_Collage02_Web_thumb.jpg',130, 188,5,'photo_5652897.html');
												thumbnails[3138820] = new thumbnail(3138820,'191841','MK Design','mkdesign_thumb.jpg',130, 195,5,'photo_3138820.html');
												thumbnails[3382885] = new thumbnail(3382885,'206544','','Wed3 - 9_thumb.jpg',130, 195,5,'photo_3382885.html');
												thumbnails[3382895] = new thumbnail(3382895,'206545','','Wed4 - 9_thumb.jpg',130, 195,5,'photo_3382895.html');
												thumbnails[5652899] = new thumbnail(5652899,'191842','','C_-_Natascha_Collage_Web_thumb.jpg',130, 190,5,'photo_5652899.html');
												thumbnails[3138812] = new thumbnail(3138812,'191841','Beachley Athletic','beachley_thumb.jpg',130, 154,5,'photo_3138812.html');
												thumbnails[3382886] = new thumbnail(3382886,'206544','','Wed3 - 10_thumb.jpg',130, 87,5,'photo_3382886.html');
												thumbnails[3382896] = new thumbnail(3382896,'206545','','Wed4 - 10_thumb.jpg',130, 87,5,'photo_3382896.html');
												thumbnails[5658809] = new thumbnail(5658809,'191842','','C_-_Piper_collage_Pyrmont_Web_thumb.jpg',130, 192,5,'photo_5658809.html');
												thumbnails[3138823] = new thumbnail(3138823,'191841','Layne Beachley','layne_thumb.jpg',130, 195,5,'photo_3138823.html');
												thumbnails[3138818] = new thumbnail(3138818,'191841','pro make up by Heidi','heidi_thumb.jpg',130, 200,5,'photo_3138818.html');
												thumbnails[3138816] = new thumbnail(3138816,'191841','Caveman Fitness','Caveman_thumb.jpg',130, 169,5,'photo_3138816.html');
												thumbnails[3247863] = new thumbnail(3247863,'191841','Underwear of Sweden','UOSw_thumb.jpg',130, 160,5,'photo_3247863.html');
												thumbnails[4754093] = new thumbnail(4754093,'191842','','Hannah_Collage_thumb.jpg',130, 195,5,'photo_4754093.html');
												thumbnails[4754097] = new thumbnail(4754097,'191842','','Danyelle_collageweb_thumb.jpg',130, 191,5,'photo_4754097.html');
												thumbnails[4754098] = new thumbnail(4754098,'191842','','Marta_Collage1web_thumb.jpg',130, 193,5,'photo_4754098.html');
												thumbnails[4754095] = new thumbnail(4754095,'191842','','Rebecca_Montage_web_thumb.jpg',130, 176,5,'photo_4754095.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[191840] = new gallery(191840,'3138858','Wedding 1','gallery',[3138846,3138847,3138848,3138849,3138850,3138854,3138855,3138856,3138857,3138858],0, 0, '', 'gallery_191840.html',0,0);
				  					galleries[192487] = new gallery(192487,'3165982','Wedding 2','gallery',[3165971,3165974,3165975,3165977,3165979,3165980,3165981,3165982,3165984,3165987],0, 0, '', 'gallery_192487.html',0,0);
				  					galleries[192488] = new gallery(192488,'3135745','Wedding 3','gallery',[3135745,3135746,3135747,3135748,3135749,3135750,3135751,3135752,3135755,3135756],0, 0, '', 'gallery_192488.html',0,0);
				  					galleries[206544] = new gallery(206544,'3382881','Wedding 4','gallery',[3382876,3382877,3382878,3382879,3382880,3382881,3382882,3382884,3382885,3382886],0, 0, '', 'gallery_206544.html',0,0);
				  					galleries[191841] = new gallery(191841,'6936122,3366014,3138822','Testimonials','gallery',[6936122,3366014,3138834,3138821,3138811,3138808,3138822,3138820,3138812,3138823,3138818,3138816,3247863],0, 0, '', 'gallery_191841.html',0,0);
				  					galleries[191842] = new gallery(191842,'5658861','Model Portfolios','gallery',[5658861,5652895,5652896,5652897,5652899,5658809,4754093,4754097,4754098,4754095],0, 0, '', 'gallery_191842.html',0,0);
				  					galleries[206545] = new gallery(206545,'3382894','Wedding 5','gallery',[3382887,3382888,3382889,3382890,3382893,3382891,3382892,3382894,3382895,3382896],0, 0, '', 'gallery_206545.html',0,0);
				  					galleries[292069] = new gallery(292069,'5172959,5172958,5172957,5172956,5172953,5172917,5172916,5172915,5172914,5172913','Wedding Album Sample','gallery',[5172908,5172909,5172910,5172911,5172912,5172913,5172914,5172915,5172916,5172917,5172953,5172956,5172957,5172958,5172959],0, 0, '', 'gallery_292069.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '6936122,3138857';
imageSets[2] = '6936122,5658861,3382894,3382881,3366014,3165982,3138858,3138822,3135745';
imageSets[3] = '3366014';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/trevormartin/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/trevormartin/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {

	imageID = randomListVal('');
		if (!basic) {
	img.src = photos[imageID].src;
	img.width = photos[imageID].width;
	img.height = photos[imageID].height;
  img.parentNode.title = img.alt = photos[imageID].caption;
	}
	else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
				
	}
			}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}
/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
  var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
		if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
    
  updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
  var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
      op = $.extend({},defaults,options),
      html = '', temp = '',
      photoId = op.nextPhoto.id,
      photoCaption = op.nextPhoto.caption,
      photoSrc = op.nextPhoto.src;
		
		if (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    if (op.$photo.length > 0) {
      html = $('<img/>',{
        'class': 'mainphoto photo',
        src: photoSrc,
        id: 'mainPic',
        name: 'mainPic',
        width: op.nextPhoto.width,
        height: op.nextPhoto.height,
        alt: photoCaption,
        css: op.css || {}
      });
      if (op.href) {
      	if (op.href.match(/<a/)) {
      	  html = $(op.href).append(html);
      	} else {
		  html = $('<a/>', {
			href: op.href,
			title: photoCaption
		  }).append(html);
	    }
      } else {
      	html = $('<a/>', {
			title: photoCaption
		  }).append(html);
      }
      if (op.speed == 0) {        op.$photo.html(html);        if (op.onBefore) {          op.onBefore.apply(op.$photo);        }        if (op.onAfter) {          op.onAfter.apply(op.$photo);        }      } else {        op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){            if (op.onAfter) {		    op.onAfter.apply(this);          }		  clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));		  $('body').trigger('clikUpdate');		}, op.onBefore);
      }    }
    	if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Art in Photography: ' + 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));      $('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;
	}
}

			

