window.thumbnails = new Object();
												thumbnails[1471448] = new thumbnail(1471448,'','','329_thumb.jpg',130, 195,1,'															#');
												thumbnails[2751943] = new thumbnail(2751943,'','','Amy-Dursley-430_thumb.jpg',130, 166,1,'															#');
												thumbnails[2751949] = new thumbnail(2751949,'','','Amy-Dursley-607_thumb.jpg',130, 165,1,'															#');
												thumbnails[3744203] = new thumbnail(3744203,'228443','Fowey From Hall Walk ','Fowey_From_Hall_Walk_3156_thumb.jpg',130, 87,1,'																			photo_3744203.html');
												thumbnails[3744223] = new thumbnail(3744223,'228443','Town Quay From Hall Walk','Town_Quay_From_Hall_Walk_3155_thumb.jpg',130, 195,1,'																			photo_3744223.html');
												thumbnails[3744239] = new thumbnail(3744239,'228443','Polruan Blockhouse and Gribbin Head','Polruan_Blockhouse_and_Gribbin_Head_3182_Cleaned_thumb.jpg',130, 87,1,'																			photo_3744239.html');
												thumbnails[3744801] = new thumbnail(3744801,'40496','Troys and Fowey Blockhouse','Troys_and_Fowey_Blockhouse_3432_thumb.jpg',130, 87,1,'																			photo_3744801.html');
												thumbnails[3744320] = new thumbnail(3744320,'228443','View From Bodinnick','View_From_Bodinnick_2983_thumb.jpg',130, 87,1,'																			photo_3744320.html');
												thumbnails[3855912] = new thumbnail(3855912,'228443','Bodinnick','Bodinnick_Web_thumb.jpg',130, 87,1,'																			photo_3855912.html');
												thumbnails[3750089] = new thumbnail(3750089,'283601','Summer Moorings','Summer_Moorings_v1_thumb.jpg',130, 87,1,'																			photo_3750089.html');
												thumbnails[3768580] = new thumbnail(3768580,'283601','Fowey From Hall Walk - Digital Art Version','Fowey-From-Hall-Walk-Painti_thumb.jpg',130, 87,1,'																			photo_3768580.html');
												thumbnails[3744566] = new thumbnail(3744566,'228443','Polruan Ferry','Polruan_Ferry_and_Fowey_2678bw_thumb.jpg',130, 195,1,'																			photo_3744566.html');
												thumbnails[3744573] = new thumbnail(3744573,'228443','Polruan In Regatta Week','Polruan_In_Regatta_Week_3581_thumb.jpg',130, 195,1,'																			photo_3744573.html');
												thumbnails[3744575] = new thumbnail(3744575,'283601','Close Encounters','Close_Encounters_thumb.jpg',130, 188,1,'																			photo_3744575.html');
												thumbnails[5002700] = new thumbnail(5002700,'228443','Springtime Polruan','Springtime-Polruan-3161_thumb.jpg',130, 87,1,'																			photo_5002700.html');
												thumbnails[5002831] = new thumbnail(5002831,'228443','Polruan in Spring','Polruan-In-Spring-2974_thumb.jpg',130, 87,1,'																			photo_5002831.html');
												thumbnails[3744596] = new thumbnail(3744596,'283601','Evening Racing','Evening_Racing_v1_thumb.jpg',130, 87,1,'																			photo_3744596.html');
												thumbnails[5002974] = new thumbnail(5002974,'228443','Down To Hall Walk','Down-To-Hall-Walk-3035_thumb.jpg',130, 195,1,'																			photo_5002974.html');
												thumbnails[5002987] = new thumbnail(5002987,'228443','Looking Down On Polruan','Looking-Down-On-Polruan_thumb.jpg',130, 87,1,'																			photo_5002987.html');
												thumbnails[3744639] = new thumbnail(3744639,'283601','Tacking Towards Ferryside','Tacking_Towards_Ferryside_thumb.jpg',130, 87,1,'																			photo_3744639.html');
												thumbnails[5003102] = new thumbnail(5003102,'228443','St Catherines\'s Castle and Gribbin Head','St-Catherines-and-Gribbin-H1_thumb.jpg',130, 87,1,'																			photo_5003102.html');
												thumbnails[5003130] = new thumbnail(5003130,'228443','Bon Voyage','Bon-Voyage-3215_thumb.jpg',130, 195,1,'																			photo_5003130.html');
												thumbnails[5003158] = new thumbnail(5003158,'228443','Fowey In The Morning Sun','Fowey-In-The-Morning-Sun_thumb.jpg',130, 87,1,'																			photo_5003158.html');
												thumbnails[3744678] = new thumbnail(3744678,'40496','T1 and T11','T1_and_T11_3472_thumb.jpg',130, 188,1,'																			photo_3744678.html');
												thumbnails[5003190] = new thumbnail(5003190,'228443','Polruan Sunset','Polruan-Sunset_thumb.jpg',130, 98,1,'																			photo_5003190.html');
												thumbnails[5003205] = new thumbnail(5003205,'228443','Polruan Boatyard','Polruan-Boatyard-1776_thumb.jpg',130, 87,1,'																			photo_5003205.html');
												thumbnails[3744830] = new thumbnail(3744830,'40496','Troy and Ferryside','Troy_and_Ferryside_thumb.jpg',130, 87,1,'																			photo_3744830.html');
												thumbnails[3744990] = new thumbnail(3744990,'40537','Red 6 Over Polruan','Red_6_Over_Polruan_1137_thumb.jpg',130, 87,1,'																			photo_3744990.html');
												thumbnails[3745015] = new thumbnail(3745015,'40537','Red Arrows Over Fowey #3','Red_Arrows_2008-003_thumb.jpg',130, 87,1,'																			photo_3745015.html');
												thumbnails[5003249] = new thumbnail(5003249,'40496','Troys Racing Past RFYC','Racing-Past-RFYC-3422_thumb.jpg',130, 87,1,'																			photo_5003249.html');
												thumbnails[5003256] = new thumbnail(5003256,'40496','T17','T17-2422_thumb.jpg',130, 195,1,'																			photo_5003256.html');
												thumbnails[3745022] = new thumbnail(3745022,'40537','Red Arrows Over Fowey #5','Red_Arrows_2008-005_thumb.jpg',130, 79,1,'																			photo_3745022.html');
												thumbnails[3745026] = new thumbnail(3745026,'40537','Red Arrows Over Fowey #7','Red_Arrows_2008-007_thumb.jpg',130, 87,1,'																			photo_3745026.html');
												thumbnails[3745028] = new thumbnail(3745028,'40537','Red Arrows Over Fowey #9','Red_Arrows_2008-009_thumb.jpg',130, 87,1,'																			photo_3745028.html');
												thumbnails[3745031] = new thumbnail(3745031,'40537','Synchro Pair Meet!','Synchro_Pair_Meet_1138_thumb.jpg',130, 87,1,'																			photo_3745031.html');
												thumbnails[3745128] = new thumbnail(3745128,'292446','Under The Acacia Tortilis Tree','Under_The_Acacia_Tortilis_Tree_1012_thumb.jpg',130, 87,1,'																			photo_3745128.html');
												thumbnails[3745155] = new thumbnail(3745155,'292446','Kenyan Sunrise','Kenyan_Sunrise_1135_thumb.jpg',130, 87,1,'																			photo_3745155.html');
												thumbnails[3745182] = new thumbnail(3745182,'292446','Cheetah Playing','Cheetah_Playing_1359_thumb.jpg',130, 87,1,'																			photo_3745182.html');
												thumbnails[3745169] = new thumbnail(3745169,'292446','Majestic!','Majestic_1477c2_thumb.jpg',130, 195,1,'																			photo_3745169.html');
												thumbnails[3745184] = new thumbnail(3745184,'292446','Alert Cheetah','Alert_Cheetah_1366_thumb.jpg',130, 195,1,'																			photo_3745184.html');
												thumbnails[3745202] = new thumbnail(3745202,'292446','Young Lion Cub','Young_Lion_Cub_1318_thumb.jpg',130, 87,1,'																			photo_3745202.html');
												thumbnails[3745204] = new thumbnail(3745204,'292446','Honeymooning Couples','Honeymooning_Couples_1335_thumb.jpg',130, 87,1,'																			photo_3745204.html');
												thumbnails[3745207] = new thumbnail(3745207,'292446','Grazing Elephant','Grazing_0984_thumb.jpg',130, 87,1,'																			photo_3745207.html');
												thumbnails[3745235] = new thumbnail(3745235,'292446','Elephants In The Shadow Of Mt Kilimanjaro','Elephants_In_The_Shadow_Of_Mt_Kilimanjaro_1149_thumb.jpg',130, 87,1,'																			photo_3745235.html');
												thumbnails[3745238] = new thumbnail(3745238,'292446','Paradise Pride','Paradise_Pride_1574_thumb.jpg',130, 87,1,'																			photo_3745238.html');
												thumbnails[3853441] = new thumbnail(3853441,'228443','Fowey Triptych','Fowey-Triptych_thumb.jpg',130, 82,1,'																			photo_3853441.html');
												thumbnails[3853572] = new thumbnail(3853572,'228443','Polruan Triptych','Polruan-Triptych3_thumb.jpg',130, 76,1,'																			photo_3853572.html');
												thumbnails[3855901] = new thumbnail(3855901,'228443','Bodinnick Triptych','Bodinnick_Triptych_thumb.jpg',130, 83,1,'																			photo_3855901.html');
												thumbnails[5179732] = new thumbnail(5179732,'292446','Poppy','Poppy_thumb.jpg',130, 87,1,'																			photo_5179732.html');
												thumbnails[7070561] = new thumbnail(7070561,'228505','Fowey Panorama','Fowey_Panorama_60x10web1_thumb.jpg',130, 22,1,'																			photo_7070561.html');
												thumbnails[5179734] = new thumbnail(5179734,'292446','World Trade Centre Twin Towers','Twin-Towers_thumb.jpg',130, 90,1,'																			photo_5179734.html');
												thumbnails[5179735] = new thumbnail(5179735,'292446','Wast Water, Lake District, England','Wast-Water_thumb.jpg',130, 87,1,'																			photo_5179735.html');
												thumbnails[7070601] = new thumbnail(7070601,'228505','Approaching Rain - Stoer Head','Stoer_Head_60x16web1_thumb.jpg',130, 34,1,'																			photo_7070601.html');
												thumbnails[5179738] = new thumbnail(5179738,'292446','Hauling In The Nets','Hauling-In-The-Nets_thumb.jpg',130, 87,1,'																			photo_5179738.html');
												thumbnails[5179743] = new thumbnail(5179743,'292446','Global Challenge Start','Global-Challenge-Jockeying-_thumb.jpg',130, 94,1,'																			photo_5179743.html');
												thumbnails[5179747] = new thumbnail(5179747,'292446','Coconut Grove - Elmina, Ghana','Coconut-Grove_thumb.jpg',130, 195,1,'																			photo_5179747.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[228443] = new gallery(228443,'5003205,5003190,5003158,5003130,5003102,5002987,5002974,5002831,5002700,3855912,3855901,3853572,3853441,3744573,3744566,3744320,3744239,3744223,3744203','Fowey and Polruan','gallery',[3744203,3744223,3744239,3744320,3855912,3744566,3744573,5002700,5002831,5002974,5002987,5003102,5003130,5003158,5003190,5003205,3853441,3853572,3855901],0, 0, '', '																																																																																																							gallery_228443.html',0,0);
				  					galleries[228505] = new gallery(228505,'7070561','NEW - Panoramas','gallery',[7070561,7070601],0, 0, '', '																																																																																																							gallery_228505.html',0,0);
				  					galleries[40537] = new gallery(40537,'3745031,3745028,3745026,3745022,3745015,3744990','Red Arrows','gallery',[3744990,3745015,3745022,3745026,3745028,3745031],0, 0, '', '																																																																																																							gallery_40537.html',0,0);
				  					galleries[40496] = new gallery(40496,'5003256,5003249,3744830,3744801,3744678','Troy Class Boats','gallery',[3744801,3744678,3744830,5003249,5003256],0, 0, '', '																																																																																																							gallery_40496.html',0,0);
				  					galleries[283601] = new gallery(283601,'3768580,3750089,3744639,3744596,3744575','Digital Art','gallery',[3750089,3768580,3744575,3744596,3744639],0, 0, '', '																																																																																																							gallery_283601.html',0,0);
				  					galleries[292446] = new gallery(292446,'5179747,5179743,5179738,5179735,5179734,5179732,3745238,3745235,3745207,3745204,3745202,3745184,3745182,3745169,3745155,3745128','Miscellaneous','gallery',[3745128,3745155,3745182,3745169,3745184,3745202,3745204,3745207,3745235,3745238,5179732,5179734,5179735,5179738,5179743,5179747],0, 0, '', '																																																																																																							gallery_292446.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7070561,5002987,5002700,3855912,3745031,3745026,3745015,3744990,3744830,3744801,3744678,3744573,3744566,3744320,3744239,3744223,3744203';
imageSets[2] = '7070561,5179747,5179743,5179738,5179735,5179734,5179732,5003256,5003249,5003205,5003190,5003158,5003130,5003102,5002987,5002974,5002831,5002700,3855912,3855901,3853572,3853441,3768580,3750089,3745238,3745235,3745207,3745204,3745202,3745184,3745182,3745169,3745155,3745128,3745031,3745028,3745026,3745022,3745015,3744990,3744830,3744801,3744678,3744639,3744596,3744575,3744573,3744566,3744320,3744239,3744223,3744203';
imageSets[3] = '7070601,7070561,5179747,5179743,5179738,5179735,5179734,5179732,5003256,5003249,5003205,5003190,5003158,5003130,5003102,5002987,5002974,5002831,5002700,3855912,3855901,3853572,3853441,3768580,3750089,3745238,3745235,3745207,3745204,3745202,3745184,3745182,3745169,3745155,3745128,3745031,3745028,3745026,3745022,3745015,3744990,3744830,3744801,3744678,3744639,3744596,3744575,3744573,3744566,3744320';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/flyhelicopters/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/flyhelicopters/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 = 'Fowey and Polruan 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));    }        
    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 image on-line by selecting the product from the list below:-</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="FLYHELICOPTERS">';
		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;
	}
}

			

