window.thumbnails = new Object();
												thumbnails[1878076] = new thumbnail(1878076,'126210','Warners Bay','Warners Bay Sunset 1 signed_thumb.jpg',130, 87,1,'photo_1878076.html');
												thumbnails[2202845] = new thumbnail(2202845,'126210','Newcastle Harbour 1','Breakwater Location Shot 2_thumb.jpg',130, 87,1,'photo_2202845.html');
												thumbnails[4097070] = new thumbnail(4097070,'126204','Living Room','Living_Room_211_thumb.jpg',130, 87,1,'photo_4097070.html');
												thumbnails[4784639] = new thumbnail(4784639,'273832','Pool 1','Pool_2_thumb.jpg',130, 87,1,'photo_4784639.html');
												thumbnails[1944549] = new thumbnail(1944549,'126204','Living Area 2','Living_Room_1_thumb.jpg',130, 87,1,'photo_1944549.html');
												thumbnails[4097072] = new thumbnail(4097072,'126204','Dining','Upstairs_Unit_Dining_thumb.jpg',130, 87,1,'photo_4097072.html');
												thumbnails[1877901] = new thumbnail(1877901,'126204','Living Area 3','Living_Room_2112_thumb.jpg',130, 87,1,'photo_1877901.html');
												thumbnails[1877903] = new thumbnail(1877903,'126205','Commercial exterior 1','Commercial Exterior_thumb.jpg',130, 87,1,'photo_1877903.html');
												thumbnails[2698168] = new thumbnail(2698168,'126202','Twilight Exterior 1','Twilight_Sample_2_2_thumb.jpg',130, 87,1,'photo_2698168.html');
												thumbnails[4784642] = new thumbnail(4784642,'273832','Pool 2','Pool_thumb.jpg',130, 87,1,'photo_4784642.html');
												thumbnails[7170647] = new thumbnail(7170647,'387443','','Elevated_Sample_21_thumb.jpg',130, 87,1,'photo_7170647.html');
												thumbnails[7170649] = new thumbnail(7170649,'126199','','Exterior_Rear_sample_thumb.jpg',130, 87,1,'photo_7170649.html');
												thumbnails[1898181] = new thumbnail(1898181,'126204','Kitchen and Living Area','Kitchen_Plus_Living_thumb.jpg',130, 87,1,'photo_1898181.html');
												thumbnails[4784645] = new thumbnail(4784645,'273832','Pool 3','Pool_3_edit_2_thumb.jpg',130, 87,1,'photo_4784645.html');
												thumbnails[2680218] = new thumbnail(2680218,'126204','Living plus Kitchen','Living_plus_Kitchen1_thumb.jpg',130, 87,1,'photo_2680218.html');
												thumbnails[4097073] = new thumbnail(4097073,'126204','Living Area','Living_Area_11_thumb.jpg',130, 87,1,'photo_4097073.html');
												thumbnails[1898183] = new thumbnail(1898183,'126204','Balcony','Balcony_thumb.jpg',130, 87,1,'photo_1898183.html');
												thumbnails[1898385] = new thumbnail(1898385,'126210','Merewether 1','Merewether Baths at Dusk 5_thumb.jpg',130, 87,1,'photo_1898385.html');
												thumbnails[1899639] = new thumbnail(1899639,'126205','Commercial Exterior 2','Price Waterhouse_adjusted_thumb.jpg',130, 87,1,'photo_1899639.html');
												thumbnails[2001991] = new thumbnail(2001991,'126202','Twilight Exterior 2','Twilight_Sample_3_2_thumb.jpg',130, 87,1,'photo_2001991.html');
												thumbnails[4784649] = new thumbnail(4784649,'273832','Outdoor Entertaining 1','Outdoor_Entertaining_thumb.jpg',130, 87,1,'photo_4784649.html');
												thumbnails[7170648] = new thumbnail(7170648,'387443','','Elevated_Sample_1_thumb.jpg',130, 87,1,'photo_7170648.html');
												thumbnails[7170657] = new thumbnail(7170657,'126199','','Kemp_St_Exterior_thumb.jpg',130, 87,1,'photo_7170657.html');
												thumbnails[1944550] = new thumbnail(1944550,'126202','Twilight Exterior 3','Pool 1_thumb.jpg',130, 87,1,'photo_1944550.html');
												thumbnails[4784654] = new thumbnail(4784654,'273832','Outdoor Entertaining 2','Monte_Carlo_Alfresco_3_thumb.jpg',130, 87,1,'photo_4784654.html');
												thumbnails[7898046] = new thumbnail(7898046,'387443','','Elevated_sample_3_thumb.jpg',130, 87,1,'photo_7898046.html');
												thumbnails[1898388] = new thumbnail(1898388,'126210','Belmont','Belmont at Dusk 3_thumb.jpg',130, 87,1,'photo_1898388.html');
												thumbnails[2680214] = new thumbnail(2680214,'126205','Commercial Exterior 3','Great Northern Hotel Exterior 1_thumb.jpg',130, 87,1,'photo_2680214.html');
												thumbnails[4784657] = new thumbnail(4784657,'273832','Outdoor Entertaining 3','Sorrento_Alfresco_9_thumb.jpg',130, 87,1,'photo_4784657.html');
												thumbnails[7170658] = new thumbnail(7170658,'126199','','Exterior_1_thumb.jpg',130, 87,1,'photo_7170658.html');
												thumbnails[1898324] = new thumbnail(1898324,'126199','Exterior 3','Townhouse_Exterior_thumb.jpg',130, 87,1,'photo_1898324.html');
												thumbnails[1944559] = new thumbnail(1944559,'126204','Dining Room','Dining_Living_thumb.jpg',130, 87,1,'photo_1944559.html');
												thumbnails[1889514] = new thumbnail(1889514,'126202','Twilight Exterior 4','House_2_Exterior_3_thumb.jpg',130, 87,1,'photo_1889514.html');
												thumbnails[1898391] = new thumbnail(1898391,'126210','Nobby\'s Beach','Nobby\'s Beach 2_thumb.jpg',130, 87,1,'photo_1898391.html');
												thumbnails[1975401] = new thumbnail(1975401,'126199','Exterior 2','Holiday_Rental_exterior_thumb.jpg',130, 87,1,'photo_1975401.html');
												thumbnails[2680245] = new thumbnail(2680245,'126202','Twilight Exterior 5','Unit_5_Exterior_Twilight_thumb.jpg',130, 87,1,'photo_2680245.html');
												thumbnails[2680247] = new thumbnail(2680247,'126202','Twilight Exterior 6','Exterior 1a (fake sky)_thumb.jpg',130, 87,1,'photo_2680247.html');
												thumbnails[1877898] = new thumbnail(1877898,'126199','Exterior 1','Exterior Front 2_thumb.jpg',130, 87,1,'photo_1877898.html');
												thumbnails[1898393] = new thumbnail(1898393,'126210','Caves Beach','Caves Beach 2_thumb.jpg',130, 87,1,'photo_1898393.html');
												thumbnails[1944558] = new thumbnail(1944558,'126204','Kitchen 3','Kitchen 1 TV_thumb.jpg',130, 87,1,'photo_1944558.html');
												thumbnails[2680258] = new thumbnail(2680258,'126204','Master Bedroom 3','Main_Bedroom_2_thumb.jpg',130, 87,1,'photo_2680258.html');
												thumbnails[1898180] = new thumbnail(1898180,'126204','Living Area 1','Living Room 2_thumb.jpg',130, 87,1,'photo_1898180.html');
												thumbnails[1898394] = new thumbnail(1898394,'126210','Bar Beach','Bar Beach Rock Platform 3_thumb.jpg',130, 87,1,'photo_1898394.html');
												thumbnails[2680260] = new thumbnail(2680260,'126204','Living Area with view','Living_Room_11_thumb.jpg',130, 87,1,'photo_2680260.html');
												thumbnails[1898302] = new thumbnail(1898302,'126202','Twilight Exterior 7','House_1_Exterior_3_thumb.jpg',130, 87,1,'photo_1898302.html');
												thumbnails[1898395] = new thumbnail(1898395,'126210','Merewether 2','10 to 2 (resized)_thumb.jpg',130, 87,1,'photo_1898395.html');
												thumbnails[2680262] = new thumbnail(2680262,'126204','Living Area 3','Curry St Rec Room 1_thumb.jpg',130, 87,1,'photo_2680262.html');
												thumbnails[1889513] = new thumbnail(1889513,'126202','Twilight Exterior 8','Outdoor Entertaining 2_thumb.jpg',130, 87,1,'photo_1889513.html');
												thumbnails[1898396] = new thumbnail(1898396,'126210','Bogey Hole','Bogey Hole at Dusk 10_thumb.jpg',130, 87,1,'photo_1898396.html');
												thumbnails[2542316] = new thumbnail(2542316,'126199','Apartment Complex 2','Pacific Blue Resort Pool_thumb.jpg',130, 87,1,'photo_2542316.html');
												thumbnails[2680270] = new thumbnail(2680270,'126204','Bathroom','Ensuite Bathroom 1_thumb.jpg',130, 87,1,'photo_2680270.html');
												thumbnails[1898397] = new thumbnail(1898397,'126210','Newcastle Beach','Newcastle Beach Childrens Pool 11_thumb.jpg',130, 87,1,'photo_1898397.html');
												thumbnails[2542342] = new thumbnail(2542342,'126199','Exterior 4','Exterior1_thumb.jpg',130, 87,1,'photo_2542342.html');
												thumbnails[2202847] = new thumbnail(2202847,'126210','Newcastle Harbour 2','Breakwater Location Shot 1_thumb.jpg',130, 87,1,'photo_2202847.html');
												thumbnails[2698169] = new thumbnail(2698169,'126202','Twilight Exterior 9','Twilight_Sample_1_2_thumb.jpg',130, 87,1,'photo_2698169.html');
												thumbnails[2202848] = new thumbnail(2202848,'126210','Toronto','Toronto at Dusk 1_thumb.jpg',130, 87,1,'photo_2202848.html');
												thumbnails[1899645] = new thumbnail(1899645,'126199','Apartments Exterior','Apartment Complex_thumb.jpg',130, 87,1,'photo_1899645.html');
												thumbnails[7656206] = new thumbnail(7656206,'126204','','Balcony_1_thumb.jpg',130, 87,1,'photo_7656206.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[126199] = new gallery(126199,'7170649,1898324','Exteriors','gallery',[7170649,7170657,7170658,1898324,1975401,1877898,2542316,2542342,1899645],0, 0, '', 'gallery_126199.html',0,0);
				  					galleries[126204] = new gallery(126204,'1877901','Interiors','gallery',[4097070,1944549,4097072,1877901,1898181,2680218,4097073,1898183,1944559,1944558,2680258,1898180,2680260,2680262,2680270,7656206],0, 0, '', 'gallery_126204.html',0,0);
				  					galleries[126202] = new gallery(126202,'2698169,2698168','Twilight','gallery',[2698168,2001991,1944550,1889514,2680245,2680247,1898302,1889513,2698169],0, 0, '', 'gallery_126202.html',0,0);
				  					galleries[273832] = new gallery(273832,'4784639','Pool & Outdoor','gallery',[4784639,4784642,4784645,4784649,4784654,4784657],0, 0, '', 'gallery_273832.html',0,0);
				  					galleries[387443] = new gallery(387443,'7170647','Elevated','gallery',[7170647,7170648,7898046],0, 0, '', 'gallery_387443.html',0,0);
				  					galleries[126205] = new gallery(126205,'1877903','Commercial','gallery',[1877903,1899639,2680214],0, 0, '', 'gallery_126205.html',0,0);
				  					galleries[126210] = new gallery(126210,'1878076','Locations','gallery',[1878076,2202845,1898385,1898388,1898391,1898393,1898394,1898395,1898396,1898397,2202847,2202848],0, 0, '', 'gallery_126210.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7656206,7170647,4784649,4784642,4097073,4097070,2698169,2680260,2680247,2680218,1944559,1944558,1944549,1898181,1889513';
imageSets[2] = '7170649,7170647,4784639,2698169,2698168,1898324,1878076,1877903,1877901';
imageSets[3] = '7898046,7656206,7170658,7170657,7170649,7170648,7170647,4784657,4784654,4784649,4784645,4784642,4784639,4097073,4097072,4097070,2698169,2698168,2680270,2680262,2680260,2680258,2680247,2680245,2680218,2680214,2542342,2542316,2202848,2202847,2202845,2001991,1975401,1944559,1944558,1944550,1944549,1899645,1899639,1898397,1898396,1898395,1898394,1898393,1898391,1898388,1898385,1898324,1898302,1898183';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/nrep/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/nrep/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/nrep/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/nrep/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/nrep/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/nrep/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/nrep/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/nrep/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/nrep/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/nrep/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/nrep/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/nrep/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/nrep/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/nrep/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/nrep/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/nrep/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/nrep/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/nrep/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/nrep/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/nrep/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/nrep/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/nrep/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 = 'NEWCASTLE   REAL   ESTATE   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));      $('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> AU$' + (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 + '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="item_name" value="'+item_name+'">';
								ref = '';
				if(this.photo_ref != ''){
					ref = this.photo_ref+' - '+this.caption;
				}
				else{
					ref = this.id+' - '+this.caption;
				}
				price = amount;					temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="mark@nrep.com.au">';
	temp = temp + '<input type="hidden" name="currency_code" value="AUD">';
	temp = temp + '<input type="hidden" name="add" value="1">';
					temp = temp + '<input type="hidden" name="amount" value="'+amount+'">';
	temp = temp + '<input type="hidden" name="item_number" value="'+ref+'">';
					temp = temp + '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
									temp = temp + '</form>';
								temp = temp + '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="mark@nrep.com.au">';
	temp = temp + '<input type="hidden" name="display" value="1">';
	temp = temp + '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
	temp = temp + '</form>';
							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;
	}
}

			

