window.thumbnails = new Object();
												thumbnails[3952022] = new thumbnail(3952022,'149141','Heron_River_Dee','heron_dee_web_thumb.jpg',130, 173,32,'							photo_3952022.html');
												thumbnails[3952035] = new thumbnail(3952035,'149141','River_Dee','dee_1_thumb.jpg',130, 173,32,'							photo_3952035.html');
												thumbnails[3952036] = new thumbnail(3952036,'149141','River_Dee','dee_2_thumb.jpg',130, 88,32,'							photo_3952036.html');
												thumbnails[3952037] = new thumbnail(3952037,'149141','River_Dee','Dee_3_thumb.jpg',130, 162,32,'							photo_3952037.html');
												thumbnails[3952038] = new thumbnail(3952038,'149141','River_Dee','dee_4_thumb.jpg',130, 173,32,'							photo_3952038.html');
												thumbnails[3952043] = new thumbnail(3952043,'149141','River_Dee','dee_51_thumb.jpg',130, 98,32,'							photo_3952043.html');
												thumbnails[3952044] = new thumbnail(3952044,'149141','River_Dee','dee_6_thumb.jpg',130, 98,32,'							photo_3952044.html');
												thumbnails[3952045] = new thumbnail(3952045,'149141','River_Dee','dee_8_thumb.jpg',130, 98,32,'							photo_3952045.html');
												thumbnails[3952047] = new thumbnail(3952047,'149141','River_Dee','dee_9_thumb.jpg',130, 98,32,'							photo_3952047.html');
												thumbnails[3952048] = new thumbnail(3952048,'149141','River_Dee','dee_10_thumb.jpg',130, 173,32,'							photo_3952048.html');
												thumbnails[3952049] = new thumbnail(3952049,'149141','River_Dee','dee_11_thumb.jpg',130, 98,32,'							photo_3952049.html');
												thumbnails[3952052] = new thumbnail(3952052,'149141','River_Dee','dee_12_thumb.jpg',130, 173,32,'							photo_3952052.html');
												thumbnails[3952053] = new thumbnail(3952053,'149719','Liverpool','pan_thumb.jpg',130, 98,32,'							photo_3952053.html');
												thumbnails[3952054] = new thumbnail(3952054,'149719','Liverpool','pan_1_thumb.jpg',130, 98,32,'							photo_3952054.html');
												thumbnails[3952055] = new thumbnail(3952055,'149719','Liverpool','pan_2_thumb.jpg',130, 98,32,'							photo_3952055.html');
												thumbnails[3952058] = new thumbnail(3952058,'149719','Liverpool','pan_3_thumb.jpg',130, 98,32,'							photo_3952058.html');
												thumbnails[3952060] = new thumbnail(3952060,'149719','Liverpool','panoramic_hdr_thumb.jpg',130, 98,32,'							photo_3952060.html');
												thumbnails[2794488] = new thumbnail(2794488,'149141','Chardonnay on the Dee.','lady without bag b& w_thumb.jpg',130, 130,32,'							photo_2794488.html');
												thumbnails[2507344] = new thumbnail(2507344,'149719','Tall Ship_Liverpool','sratsraad lehmkuhl 1_thumb.jpg',130, 98,32,'							photo_2507344.html');
												thumbnails[2507338] = new thumbnail(2507338,'149719','Tall Ship_Liverpool','ejmboldt_thumb.jpg',130, 98,32,'							photo_2507338.html');
												thumbnails[2507396] = new thumbnail(2507396,'149719','Tall Ship_Liverpool','statsraad lehmkuhl 2_thumb.jpg',130, 98,32,'							photo_2507396.html');
												thumbnails[2270859] = new thumbnail(2270859,'149141','Bandstand','P5100196_thumb.JPG',130, 173,32,'							photo_2270859.html');
												thumbnails[2270869] = new thumbnail(2270869,'149141','River_Dee','P5100198_thumb.JPG',130, 98,32,'							photo_2270869.html');
												thumbnails[2270873] = new thumbnail(2270873,'149141','River_Dee','P5100209_thumb.JPG',130, 98,32,'							photo_2270873.html');
												thumbnails[2270879] = new thumbnail(2270879,'149141','River_Dee','P5110256_thumb.JPG',130, 98,32,'							photo_2270879.html');
												thumbnails[2270885] = new thumbnail(2270885,'149141','River_Dee','P5110258_thumb.JPG',130, 98,32,'							photo_2270885.html');
												thumbnails[2270891] = new thumbnail(2270891,'149141','Heron','P5180366_thumb.JPG',130, 98,32,'							photo_2270891.html');
												thumbnails[2270894] = new thumbnail(2270894,'149743','Leopard_Chester','P5210459_thumb.JPG',130, 98,32,'							photo_2270894.html');
												thumbnails[2270934] = new thumbnail(2270934,'149743','Leopard_Chester','P5210460_thumb.JPG',130, 98,32,'							photo_2270934.html');
												thumbnails[2270939] = new thumbnail(2270939,'149742','The_Cross','P5240522_thumb.JPG',130, 173,32,'							photo_2270939.html');
												thumbnails[2271009] = new thumbnail(2271009,'149742','Eastgate_Clock','P5240524_thumb.JPG',130, 173,32,'							photo_2271009.html');
												thumbnails[2271023] = new thumbnail(2271023,'149742','Eastgate_Clock','P52405261_thumb.JPG',130, 173,32,'							photo_2271023.html');
												thumbnails[2271048] = new thumbnail(2271048,'149742','Eastgate','P52405282_thumb.JPG',130, 98,32,'							photo_2271048.html');
												thumbnails[2271058] = new thumbnail(2271058,'149742','Eastgate_Clock','P5240530_thumb.JPG',130, 173,32,'							photo_2271058.html');
												thumbnails[2271061] = new thumbnail(2271061,'149742','The_Cross','P5240543_thumb.JPG',130, 173,32,'							photo_2271061.html');
												thumbnails[2271064] = new thumbnail(2271064,'149141','River Dee','P5240551_thumb.JPG',130, 98,32,'							photo_2271064.html');
												thumbnails[2271067] = new thumbnail(2271067,'149141','River_Dee','P5240564_thumb.JPG',130, 98,32,'							photo_2271067.html');
												thumbnails[2271073] = new thumbnail(2271073,'149141','River_Dee','P5240568_thumb.JPG',130, 98,32,'							photo_2271073.html');
												thumbnails[2271077] = new thumbnail(2271077,'149141','River_Dee','P5240571_thumb.JPG',130, 98,32,'							photo_2271077.html');
												thumbnails[2271081] = new thumbnail(2271081,'149141','River_Dee','P5310611_thumb.JPG',130, 173,32,'							photo_2271081.html');
												thumbnails[2271090] = new thumbnail(2271090,'149141','River_Dee','P5310617_thumb.JPG',130, 98,32,'							photo_2271090.html');
												thumbnails[2271096] = new thumbnail(2271096,'149141','River_Dee','P5310621_thumb.JPG',130, 98,32,'							photo_2271096.html');
												thumbnails[2271214] = new thumbnail(2271214,'149141','River_Dee','P5310629_thumb.JPG',130, 98,32,'							photo_2271214.html');
												thumbnails[2271225] = new thumbnail(2271225,'149141','River_Dee','P5310643_thumb.JPG',130, 98,32,'							photo_2271225.html');
												thumbnails[2271236] = new thumbnail(2271236,'149141','Heron','P5310686_thumb.JPG',130, 98,32,'							photo_2271236.html');
												thumbnails[2271260] = new thumbnail(2271260,'149141','Heron','P5310698_thumb.JPG',130, 98,32,'							photo_2271260.html');
												thumbnails[2271271] = new thumbnail(2271271,'149141','Heron','P5310702_thumb.JPG',130, 98,32,'							photo_2271271.html');
												thumbnails[2278182] = new thumbnail(2278182,'149742','Eastgate_Clock','Chester Clock1_thumb.jpg',130, 173,32,'							photo_2278182.html');
												thumbnails[2278185] = new thumbnail(2278185,'149742','Eastgate_Clock','Chester Clock2_thumb.jpg',130, 173,32,'							photo_2278185.html');
												thumbnails[2278192] = new thumbnail(2278192,'149742','Eastgate_Clock','Chester clock4_thumb.jpg',130, 98,32,'							photo_2278192.html');
												thumbnails[2278195] = new thumbnail(2278195,'149742','Eastgate_Clock','Chester Clockbw5_thumb.jpg',130, 173,32,'							photo_2278195.html');
												thumbnails[2278217] = new thumbnail(2278217,'149719','Waterfront','Lpool1_thumb.jpg',130, 98,32,'							photo_2278217.html');
												thumbnails[2278220] = new thumbnail(2278220,'149719','Waterfront','Lpool2_thumb.jpg',130, 98,32,'							photo_2278220.html');
												thumbnails[2278222] = new thumbnail(2278222,'149719','Waterfront','Lppol3_thumb.jpg',130, 98,32,'							photo_2278222.html');
												thumbnails[2278224] = new thumbnail(2278224,'149719','Liver_Building','Church41_thumb.jpg',130, 98,32,'							photo_2278224.html');
												thumbnails[2278235] = new thumbnail(2278235,'149719','Christ_The_King','Church1_thumb.jpg',130, 98,32,'							photo_2278235.html');
												thumbnails[2278244] = new thumbnail(2278244,'149719','Anglican_Cathedral','Church2_thumb.jpg',130, 173,32,'							photo_2278244.html');
												thumbnails[2278255] = new thumbnail(2278255,'149719','Anglican_Cathedral','Church3_thumb.jpg',130, 98,32,'							photo_2278255.html');
												thumbnails[2278264] = new thumbnail(2278264,'149742','Town_Hall','Town hall1_thumb.jpg',130, 98,32,'							photo_2278264.html');
												thumbnails[2278266] = new thumbnail(2278266,'149742','Town_Hall','Town Hall2_thumb.jpg',130, 173,32,'							photo_2278266.html');
												thumbnails[2285132] = new thumbnail(2285132,'149719','Ferry_Liverpool','liver ferry_thumb.jpg',130, 98,32,'							photo_2285132.html');
												thumbnails[2285190] = new thumbnail(2285190,'149719','Liverpool_Ark_Royal','liver ferry2_thumb.jpg',130, 71,32,'							photo_2285190.html');
												thumbnails[2297087] = new thumbnail(2297087,'149719','Liverpool_Grand_Princess','carnival lpool_thumb.jpg',130, 98,32,'							photo_2297087.html');
												thumbnails[2309371] = new thumbnail(2309371,'149141','River_Dee','Dee 1406081_thumb.jpg',130, 98,32,'							photo_2309371.html');
												thumbnails[5271661] = new thumbnail(5271661,'149742','The_Cross','chester_snow_amm_6_thumb.jpg',130, 98,32,'							photo_5271661.html');
												thumbnails[5271684] = new thumbnail(5271684,'149742','The Cross_Chester','chester_snow_amm_7_thumb.jpg',130, 98,32,'							photo_5271684.html');
												thumbnails[5271690] = new thumbnail(5271690,'149141','River Dee_Chester','chester_snow_amm_8_thumb.jpg',130, 98,32,'							photo_5271690.html');
												thumbnails[5271694] = new thumbnail(5271694,'149141','River_Dee,Chester','chester_snow_amm_9_thumb.jpg',130, 98,32,'							photo_5271694.html');
												thumbnails[5271697] = new thumbnail(5271697,'149141','River_Dee,Chester','chester_snow_amm_10_thumb.jpg',130, 173,32,'							photo_5271697.html');
												thumbnails[2378648] = new thumbnail(2378648,'149139','Birkenhead_Park','bhead park swiss bridge_thumb.jpg',130, 98,32,'							photo_2378648.html');
												thumbnails[2278202] = new thumbnail(2278202,'149139','Kites_New_Brighton','Kite2_thumb.jpg',130, 98,32,'							photo_2278202.html');
												thumbnails[2278213] = new thumbnail(2278213,'149139','Kites_New_Brighton','Kite11_thumb.jpg',130, 173,32,'							photo_2278213.html');
												thumbnails[2278259] = new thumbnail(2278259,'149139','Kites_New_Brighton','Panda_thumb.jpg',130, 173,32,'							photo_2278259.html');
												thumbnails[2288527] = new thumbnail(2288527,'149139','New_Brighton','Nbrig1_thumb.jpg',130, 98,32,'							photo_2288527.html');
												thumbnails[2288528] = new thumbnail(2288528,'149139','New_Brighton','Nbrig2_thumb.jpg',130, 98,32,'							photo_2288528.html');
												thumbnails[2288529] = new thumbnail(2288529,'149139','Hamilton_Square','Hamsq1_thumb.jpg',130, 98,32,'							photo_2288529.html');
												thumbnails[2288530] = new thumbnail(2288530,'149139','Hamilton_Square','hamsq2_thumb.jpg',130, 98,32,'							photo_2288530.html');
												thumbnails[2288531] = new thumbnail(2288531,'149139','Hamilton_Square','hamsq3_thumb.jpg',130, 98,32,'							photo_2288531.html');
												thumbnails[2288532] = new thumbnail(2288532,'149139','Hamilton_Square','hamsq4_thumb.jpg',130, 173,32,'							photo_2288532.html');
												thumbnails[2288534] = new thumbnail(2288534,'149139','Port_Sunlight','psun1_thumb.jpg',130, 98,32,'							photo_2288534.html');
												thumbnails[2288540] = new thumbnail(2288540,'149139','Port_Sunlight','psun2_thumb.jpg',130, 98,32,'							photo_2288540.html');
												thumbnails[2309362] = new thumbnail(2309362,'149139','Birkenhead_Priory','Bheadpriory3_thumb.jpg',130, 98,32,'							photo_2309362.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[149742] = new gallery(149742,'5271684,5271661,2278266,2278264,2278195,2278192,2278185,2278182,2271061,2271058','Chester','gallery',[2270939,2271009,2271023,2271048,2271058,2271061,2278182,2278185,2278192,2278195,2278264,2278266,5271661,5271684],0, 0, '', '																																																																																																							gallery_149742.html',0,0);
				  					galleries[149743] = new gallery(149743,'2270934,2270894','Chester Zoo','gallery',[2270894,2270934],0, 0, '', '																																																																																																							gallery_149743.html',0,0);
				  					galleries[149719] = new gallery(149719,'3952060,3952058,3952055,3952054,3952053,2507396,2507344,2507338,2297087,2285190','Liverpool','gallery',[3952053,3952054,3952055,3952058,3952060,2507344,2507338,2507396,2278217,2278220,2278222,2278224,2278235,2278244,2278255,2285132,2285190,2297087],0, 0, '', '																																																																																																							gallery_149719.html',0,0);
				  					galleries[149141] = new gallery(149141,'5271697,5271694,5271690,3952052,3952049,3952048,3952047,3952045,3952044,3952043','River Dee,Chester','gallery',[3952022,3952035,3952036,3952037,3952038,3952043,3952044,3952045,3952047,3952048,3952049,3952052,2794488,2270859,2270869,2270873,2270879,2270885,2270891,2271064,2271067,2271073,2271077,2271081,2271090,2271096,2271214,2271225,2271236,2271260,2271271,2309371,5271690,5271694,5271697],0, 0, '', '																																																																																																							gallery_149141.html',0,0);
				  					galleries[149139] = new gallery(149139,'2378648,2309362,2288540,2288534,2288532,2288531,2288530,2288529,2288528,2288527','Wirral','gallery',[2378648,2278202,2278213,2278259,2288527,2288528,2288529,2288530,2288531,2288532,2288534,2288540,2309362],0, 0, '', '																																																																																																							gallery_149139.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '5271697,5271694,5271690,5271684,5271661,3952060,3952058,3952055,3952054,3952053,3952052,3952049,3952048,3952047,3952045,3952044,3952043,3952038,3952037,3952036,3952035,3952022,2794488,2507396,2507344,2507338,2378648,2309371,2309362,2297087,2288540,2288534,2288532,2288531,2288530,2288529,2288528,2288527,2285190,2285132,2278266,2278264,2278259,2278255,2278244,2278235,2278224,2278222,2278220,2278217';
imageSets[3] = '5271697,5271694,5271690,5271684,5271661,3952060,3952058,3952055,3952054,3952053,3952052,3952049,3952048,3952047,3952045,3952044,3952043,3952038,3952037,3952036,3952035,3952022,2794488,2507396,2507344,2507338,2378648,2309371,2309362,2297087,2288540,2288534,2288532,2288531,2288530,2288529,2288528,2288527,2285190,2285132,2278266,2278264,2278259,2278255,2278244,2278235,2278224,2278222,2278220,2278217';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://www.clikchurch.com/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/cokguzel/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/cokguzel/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 = 'Northwestern Images: ' + 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="COKGUZEL">';
		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;
	}
}

		

