window.thumbnails = new Object();
												thumbnails[3337449] = new thumbnail(3337449,'202136','','_MG_6936FX 30x801_thumb.jpg',130, 49,15,'							photo_3337449.html');
												thumbnails[7246084] = new thumbnail(7246084,'202136','','_MG_5985_BW_thumb.jpg',130, 195,15,'							photo_7246084.html');
												thumbnails[7246085] = new thumbnail(7246085,'202136','','_MG_6553_FX_thumb.jpg',130, 87,15,'							photo_7246085.html');
												thumbnails[7246080] = new thumbnail(7246080,'202136','','_DSC3460_thumb.jpg',130, 86,15,'							photo_7246080.html');
												thumbnails[7246086] = new thumbnail(7246086,'202136','','_MG_6717_BW_sf_thumb.jpg',130, 87,15,'							photo_7246086.html');
												thumbnails[7246087] = new thumbnail(7246087,'202136','','_MG_6260_FX_thumb.jpg',130, 195,15,'							photo_7246087.html');
												thumbnails[7246088] = new thumbnail(7246088,'202136','','_MG_6053_thumb.jpg',130, 87,15,'							photo_7246088.html');
												thumbnails[7246090] = new thumbnail(7246090,'202136','','_MG_6506_thumb.jpg',130, 195,15,'							photo_7246090.html');
												thumbnails[7246091] = new thumbnail(7246091,'202136','','_MG_6766_FX_thumb.jpg',130, 87,15,'							photo_7246091.html');
												thumbnails[3337403] = new thumbnail(3337403,'203566','','_MG_00081_thumb.jpg',130, 60,15,'							photo_3337403.html');
												thumbnails[3337416] = new thumbnail(3337416,'202136','','_MG_1879E2_thumb.jpg',130, 86,15,'							photo_3337416.html');
												thumbnails[3337418] = new thumbnail(3337418,'203567','','_MG_36521_thumb.jpg',130, 71,15,'							photo_3337418.html');
												thumbnails[3337419] = new thumbnail(3337419,'202136','','_MG_5976_thumb.jpg',130, 65,15,'							photo_3337419.html');
												thumbnails[3337420] = new thumbnail(3337420,'203567','','_MG_36571_thumb.jpg',130, 195,15,'							photo_3337420.html');
												thumbnails[7246106] = new thumbnail(7246106,'202136','','_MG_8729EL1_thumb.jpg',130, 260,15,'							photo_7246106.html');
												thumbnails[7246107] = new thumbnail(7246107,'202136','','_MG_8250EL1_thumb.jpg',130, 260,15,'							photo_7246107.html');
												thumbnails[7246105] = new thumbnail(7246105,'202136','','_MG_8364-FX_thumb.jpg',130, 65,15,'							photo_7246105.html');
												thumbnails[7246171] = new thumbnail(7246171,'202136','','_MG_5956_OK_thumb.jpg',130, 87,15,'							photo_7246171.html');
												thumbnails[7246172] = new thumbnail(7246172,'202136','','_MG_6730_OK_thumb.jpg',130, 87,15,'							photo_7246172.html');
												thumbnails[7246170] = new thumbnail(7246170,'203566','','_MG_5697_SF_thumb.jpg',130, 195,15,'							photo_7246170.html');
												thumbnails[3337424] = new thumbnail(3337424,'203566','','_MG_3393LS FX1_thumb.jpg',130, 150,15,'							photo_3337424.html');
												thumbnails[7246115] = new thumbnail(7246115,'203566','','Yong10DV00083OK_DIVA_thumb.jpg',130, 87,15,'							photo_7246115.html');
												thumbnails[7246117] = new thumbnail(7246117,'203566','','Kurniawan_Wigena__Mercedes_benz__addict_03_thumb.jpg',130, 82,15,'							photo_7246117.html');
												thumbnails[7246118] = new thumbnail(7246118,'203566','','Kurniawan_Wigena__Mercedes_benz__addict_02_thumb.jpg',130, 77,15,'							photo_7246118.html');
												thumbnails[7246119] = new thumbnail(7246119,'203566','','Kurniawan_Wigena__Mercedes_benz__addict_01_thumb.jpg',130, 78,15,'							photo_7246119.html');
												thumbnails[7246120] = new thumbnail(7246120,'203566','','Kurniawan_Wigena__Mercedes_benz__addict_04_thumb.jpg',130, 73,15,'							photo_7246120.html');
												thumbnails[7246121] = new thumbnail(7246121,'203566','','May_09_09_13_00402_thumb.jpg',130, 174,15,'							photo_7246121.html');
												thumbnails[3337425] = new thumbnail(3337425,'202136','','_MG_6385FX2_thumb.jpg',130, 86,15,'							photo_3337425.html');
												thumbnails[7246108] = new thumbnail(7246108,'203566','','_MG_4667E_SFX_thumb.jpg',130, 195,15,'							photo_7246108.html');
												thumbnails[7246109] = new thumbnail(7246109,'203566','','_MG_4742E_SFX_1_thumb.jpg',130, 184,15,'							photo_7246109.html');
												thumbnails[7246110] = new thumbnail(7246110,'203566','','_MG_4705_SFX_thumb.jpg',130, 87,15,'							photo_7246110.html');
												thumbnails[7246112] = new thumbnail(7246112,'203566','','_MG_4862E_SFW_thumb.jpg',130, 98,15,'							photo_7246112.html');
												thumbnails[3337426] = new thumbnail(3337426,'202136','','_MG_6779-OK_thumb.jpg',130, 52,15,'							photo_3337426.html');
												thumbnails[3337429] = new thumbnail(3337429,'202136','','_MG_6858P1_thumb.jpg',130, 49,15,'							photo_3337429.html');
												thumbnails[7246122] = new thumbnail(7246122,'202136','','nusa2_1_thumb.jpg',130, 94,15,'							photo_7246122.html');
												thumbnails[7246123] = new thumbnail(7246123,'202136','','_MG_7070_OK_thumb.jpg',130, 196,15,'							photo_7246123.html');
												thumbnails[7246124] = new thumbnail(7246124,'202136','','_MG_6708_thumb.jpg',130, 87,15,'							photo_7246124.html');
												thumbnails[7246125] = new thumbnail(7246125,'202136','','_MG_7170_OK_thumb.jpg',130, 87,15,'							photo_7246125.html');
												thumbnails[7246126] = new thumbnail(7246126,'202136','','_MG_7434_thumb.jpg',130, 87,15,'							photo_7246126.html');
												thumbnails[7246158] = new thumbnail(7246158,'202136','','_MG_6738-1_thumb.jpg',130, 86,15,'							photo_7246158.html');
												thumbnails[7246160] = new thumbnail(7246160,'202136','','_MG_8040_thumb.jpg',130, 86,15,'							photo_7246160.html');
												thumbnails[7246162] = new thumbnail(7246162,'202136','','_MG_7067FX_thumb.jpg',130, 87,15,'							photo_7246162.html');
												thumbnails[7246164] = new thumbnail(7246164,'202136','','_MG_7550FX1_thumb.jpg',130, 195,15,'							photo_7246164.html');
												thumbnails[3360332] = new thumbnail(3360332,'202136','','AltRed2_thumb.jpg',130, 87,15,'							photo_3360332.html');
												thumbnails[7246165] = new thumbnail(7246165,'202136','','_MG_5782FX_thumb.jpg',130, 195,15,'							photo_7246165.html');
												thumbnails[7246167] = new thumbnail(7246167,'202136','','_MG_6986BFX_thumb.jpg',130, 196,15,'							photo_7246167.html');
												thumbnails[7246166] = new thumbnail(7246166,'202136','','_MG_5383KE_thumb.jpg',130, 81,15,'							photo_7246166.html');
												thumbnails[3337430] = new thumbnail(3337430,'202136','','_MG_6936BW1_thumb.jpg',130, 86,15,'							photo_3337430.html');
												thumbnails[7246173] = new thumbnail(7246173,'202136','','_MG_0732Edit_Ads_thumb.jpg',130, 64,15,'							photo_7246173.html');
												thumbnails[7246174] = new thumbnail(7246174,'202136','','_MG_9219_thumb.jpg',130, 86,15,'							photo_7246174.html');
												thumbnails[7246175] = new thumbnail(7246175,'202136','','_MG_9538SQ_E_thumb.jpg',130, 173,15,'							photo_7246175.html');
												thumbnails[3337699] = new thumbnail(3337699,'202137','','Hand01_thumb.jpg',130, 194,15,'							photo_3337699.html');
												thumbnails[7246092] = new thumbnail(7246092,'202137','','_MG_8419e_FX_thumb.jpg',130, 163,15,'							photo_7246092.html');
												thumbnails[7246093] = new thumbnail(7246093,'202137','','_MG_9588e_FX_thumb.jpg',130, 87,15,'							photo_7246093.html');
												thumbnails[7246094] = new thumbnail(7246094,'202137','','_MG_8454e_FX_thumb.jpg',130, 69,15,'							photo_7246094.html');
												thumbnails[7246095] = new thumbnail(7246095,'202137','','_MG_8539e_FX_thumb.jpg',130, 195,15,'							photo_7246095.html');
												thumbnails[7246096] = new thumbnail(7246096,'202137','','_MG_8731e_thumb.jpg',130, 195,15,'							photo_7246096.html');
												thumbnails[7246097] = new thumbnail(7246097,'202137','','_MG_9078e_FX_thumb.jpg',130, 58,15,'							photo_7246097.html');
												thumbnails[7246098] = new thumbnail(7246098,'202137','','_MG_9105e_FX_thumb.jpg',130, 195,15,'							photo_7246098.html');
												thumbnails[7246099] = new thumbnail(7246099,'202137','','_MG_0200e_thumb.jpg',130, 63,15,'							photo_7246099.html');
												thumbnails[3360306] = new thumbnail(3360306,'202137','','_MG_9482E_thumb.jpg',130, 86,15,'							photo_3360306.html');
												thumbnails[7246100] = new thumbnail(7246100,'202137','','_MG_9188Blue_thumb.jpg',130, 213,15,'							photo_7246100.html');
												thumbnails[7246101] = new thumbnail(7246101,'202137','','_MG_4478_thumb.jpg',130, 86,15,'							photo_7246101.html');
												thumbnails[7246102] = new thumbnail(7246102,'202137','','_MG_9588e_thumb.jpg',130, 86,15,'							photo_7246102.html');
												thumbnails[7246128] = new thumbnail(7246128,'202137','','_MG_4796FX_thumb.jpg',130, 195,15,'							photo_7246128.html');
												thumbnails[7246129] = new thumbnail(7246129,'202137','','_MG_4139FX_thumb.jpg',130, 177,15,'							photo_7246129.html');
												thumbnails[7246130] = new thumbnail(7246130,'202137','','_MG_4135FX_thumb.jpg',130, 87,15,'							photo_7246130.html');
												thumbnails[7246131] = new thumbnail(7246131,'202137','','_MG_3945FX1_thumb.jpg',130, 91,15,'							photo_7246131.html');
												thumbnails[7246132] = new thumbnail(7246132,'202137','','_MG_3957FX_thumb.jpg',130, 88,15,'							photo_7246132.html');
												thumbnails[3360315] = new thumbnail(3360315,'202137','','Page-511_thumb.jpg',130, 130,15,'							photo_3360315.html');
												thumbnails[7246133] = new thumbnail(7246133,'202137','','_MG_6091E_thumb.jpg',130, 86,15,'							photo_7246133.html');
												thumbnails[3360309] = new thumbnail(3360309,'202137','','Page 04_MG_5480_thumb.jpg',130, 173,15,'							photo_3360309.html');
												thumbnails[3360310] = new thumbnail(3360310,'202137','','Page 16_MG_5993_thumb.jpg',130, 193,15,'							photo_3360310.html');
												thumbnails[3360318] = new thumbnail(3360318,'202137','','Pinky 1_thumb.jpg',130, 206,15,'							photo_3360318.html');
												thumbnails[7246163] = new thumbnail(7246163,'202137','','_MG_7279_FX1_thumb.jpg',130, 87,15,'							photo_7246163.html');
												thumbnails[7246127] = new thumbnail(7246127,'202137','','20_thumb.jpg',130, 78,15,'							photo_7246127.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[202136] = new gallery(202136,'3360332','Pre Wedding','gallery',[3337449,7246084,7246085,7246080,7246086,7246087,7246088,7246090,7246091,3337416,3337419,7246106,7246107,7246105,7246171,7246172,3337425,3337426,3337429,7246122,7246123,7246124,7246125,7246126,7246158,7246160,7246162,7246164,3360332,7246165,7246167,7246166,3337430,7246173,7246174,7246175],0, 0, '', '																																																																																																							gallery_202136.html',0,0);
				  					galleries[202137] = new gallery(202137,'3337699','Wedding','gallery',[3337699,7246092,7246093,7246094,7246095,7246096,7246097,7246098,7246099,3360306,7246100,7246101,7246102,7246128,7246129,7246130,7246131,7246132,3360315,7246133,3360309,3360310,3360318,7246163,7246127],0, 0, '', '																																																																																																							gallery_202137.html',0,0);
				  					galleries[203566] = new gallery(203566,'7246170,7246121,7246120,7246119,7246118,7246117,7246115,7246112,7246110,7246109','Studio Photography','gallery',[3337403,7246170,3337424,7246115,7246117,7246118,7246119,7246120,7246121,7246108,7246109,7246110,7246112],0, 0, '', '																																																																																																							gallery_203566.html',0,0);
				  					galleries[203567] = new gallery(203567,'3337420,3337418','Still Life & Art Works','gallery',[3337418,3337420],0, 0, '', '																																																																																																							gallery_203567.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '3360332,3337699,3337430,3337429,3337424,3337420,3337419,3337418';
imageSets[2] = '3360332,3337699,3337420,3337418';
imageSets[3] = '7246175,7246174,7246173,7246172,7246171,7246170,7246167,7246166,7246165,7246164,7246163,7246162,7246160,7246158,7246133,7246132,7246131,7246130,7246129,7246128,7246127,7246126,7246125,7246124,7246123,7246122,7246121,7246120,7246119,7246118,7246117,7246115,7246112,7246110,7246109,7246108,7246107,7246106,7246105,7246102,7246101,7246100,7246099,7246098,7246097,7246096,7246095,7246094,7246093,7246092';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://www.clikchurch.com/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/kurniawan/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/kurniawan/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 = 'Esthetique Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object') {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>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;
	}
}

			

