window.thumbnails = new Object();
												thumbnails[3088539] = new thumbnail(3088539,'','Sheltered Housing Development, Bethany Care Home, Tadley','Bethany Care Home 11_thumb.JPG',130, 98,5,'#');
												thumbnails[3088592] = new thumbnail(3088592,'','','Top Banner_thumb.JPG',130, 6,5,'#');
												thumbnails[3088603] = new thumbnail(3088603,'','Hyde Housing Association Regional Offices','Hyde Housing Association Offices_thumb.JPG',130, 117,5,'#');
												thumbnails[3088857] = new thumbnail(3088857,'','Holton Heath Industrial Estate, Wareham','Holton Heath Industrial Estate_thumb.jpg',130, 87,5,'#');
												thumbnails[3088944] = new thumbnail(3088944,'','Hopton Park, Devizes','Hopton Park, Devizes_thumb.jpg',130, 102,5,'#');
												thumbnails[3089000] = new thumbnail(3089000,'','Springhill Catholic Primary School','Springhill School Exterior_thumb.jpg',130, 104,5,'#');
												thumbnails[3102391] = new thumbnail(3102391,'','New Housing Development, Chatham Place, Curry Rivel','Chatham Place_thumb.JPG',130, 98,5,'#');
												thumbnails[3105805] = new thumbnail(3105805,'','New Pontoon, Trinity Landing, Cowes','Parade Landing 2_thumb.JPG',130, 98,5,'#');
												thumbnails[3105815] = new thumbnail(3105815,'','Shepards Wharf, Cowes','Shepards Wharf 3_thumb.JPG',130, 98,5,'#');
												thumbnails[3105816] = new thumbnail(3105816,'','Shepards Wharf, Cowes','Shepards Wharf 5_thumb.JPG',130, 98,5,'#');
												thumbnails[3105848] = new thumbnail(3105848,'','Venture Quays, East Cowes','Venture Quays 5_thumb.JPG',130, 98,5,'#');
												thumbnails[3106713] = new thumbnail(3106713,'','South Winchester Golf Club','Winchester Golf Club_thumb.jpg',130, 65,5,'#');
												thumbnails[3106714] = new thumbnail(3106714,'','Leigh Park Library, Havant','Leigh Park Library_thumb.jpg',130, 78,5,'#');
												thumbnails[3106718] = new thumbnail(3106718,'','Regents Park Girls School, Southampton','Regents Park Girls School_thumb.jpg',130, 81,5,'#');
												thumbnails[3109851] = new thumbnail(3109851,'','','ICE_thumb.jpg',130, 179,5,'#');
												thumbnails[3109852] = new thumbnail(3109852,'','','ICE 001_thumb.jpg',130, 179,5,'#');
												thumbnails[3111108] = new thumbnail(3111108,'','','Level_thumb.JPG',130, 183,5,'#');
												thumbnails[3193520] = new thumbnail(3193520,'','Office Development, Southwood Business Park, Farnborough','Southwood Bus Park 2_thumb.jpg',130, 86,5,'#');
												thumbnails[3193606] = new thumbnail(3193606,'','Private Housing, King James\' Quay, Portsmouth','King James Quay_thumb.jpg',130, 190,5,'#');
												thumbnails[3193609] = new thumbnail(3193609,'','Adult Mental Health Unit, Coldeast Hospital','Coldeast Hospital_thumb.jpg',130, 82,5,'#');
												thumbnails[7588358] = new thumbnail(7588358,'','','New_Office_Location_thumb.jpg',130, 118,5,'#');
												thumbnails[3088541] = new thumbnail(3088541,'190620','Sheltered Housing Development, Bethany Care Home, Tadley','Bethany Care Home 21_thumb.JPG',130, 98,5,'photo_3088541.html');
												thumbnails[3088555] = new thumbnail(3088555,'190620','The Foyer, Orchard House, Salisbury','Foyer Interior1_thumb.jpg',130, 151,5,'photo_3088555.html');
												thumbnails[3088557] = new thumbnail(3088557,'190620','Lockerley School','Lockerley School Exterior1_thumb.jpg',130, 98,5,'photo_3088557.html');
												thumbnails[3088565] = new thumbnail(3088565,'190620','Lockerley School Sports Hall','Lockerley School Interior1_thumb.jpg',130, 98,5,'photo_3088565.html');
												thumbnails[3088566] = new thumbnail(3088566,'190620','Alan Titchmarsh Opens the newly refurbished Yarmouth Pier','Opening Yarmouth Pier1_thumb.jpg',130, 98,5,'photo_3088566.html');
												thumbnails[3088977] = new thumbnail(3088977,'190620','Salisbury College, Student Accommodation','Salisbury College_thumb.JPG',130, 103,5,'photo_3088977.html');
												thumbnails[3089006] = new thumbnail(3089006,'190620','Springhill Catholic Primary School','Springhill School Interior_thumb.jpg',130, 104,5,'photo_3089006.html');
												thumbnails[3089104] = new thumbnail(3089104,'190620','Etap Hotel, West Quay, Southampton','Etap, Southampton_thumb.jpg',130, 98,5,'photo_3089104.html');
												thumbnails[3089133] = new thumbnail(3089133,'190620','Barton on Sea Golf Club','Barton on Sea Golf Club1_thumb.jpg',130, 97,5,'photo_3089133.html');
												thumbnails[3102387] = new thumbnail(3102387,'190620','Alterations and Extension to RNLI Boathouse, Hayling Island','RNLI Hayling Island_thumb.jpg',130, 98,5,'photo_3102387.html');
												thumbnails[3105646] = new thumbnail(3105646,'190620','Wightlink\'s new ferry \'Wight Light\' berthed<br>\r\nin Yarmouth (Photo courtesy of Wightlink)','Wight Light Yarmouth_thumb.jpg',130, 87,5,'photo_3105646.html');
												thumbnails[3105700] = new thumbnail(3105700,'190620','Dry Stack Boat Storage,<br>\r\nHamble Yacht Services','Dry Stack, Hamble_thumb.jpg',130, 98,5,'photo_3105700.html');
												thumbnails[3105808] = new thumbnail(3105808,'190620','Trinity Landing, Cowes','Parade Landing 3_thumb.JPG',130, 98,5,'photo_3105808.html');
												thumbnails[3105845] = new thumbnail(3105845,'190620','Venture Quays, East Cowes','Venture Quays 1_thumb.JPG',130, 98,5,'photo_3105845.html');
												thumbnails[3105846] = new thumbnail(3105846,'190620','Venture Quays, East Cowes','Venture Quays 3_thumb.JPG',130, 98,5,'photo_3105846.html');
												thumbnails[3106148] = new thumbnail(3106148,'190620','Shepards Wharf, Cowes','Shepards Wharf 21_thumb.JPG',130, 64,5,'photo_3106148.html');
												thumbnails[3106170] = new thumbnail(3106170,'190620','New Housing Development, Stoodham Lane, South Petherton','Stoodham, South Petherton1_thumb.JPG',130, 98,5,'photo_3106170.html');
												thumbnails[3106371] = new thumbnail(3106371,'190620','The Foyer, Orchard House, Salisbury','The Foyer_thumb.jpg',130, 75,5,'photo_3106371.html');
												thumbnails[3106717] = new thumbnail(3106717,'190620','Boundary Oak School, Fareham','Boundary Oak School_thumb.jpg',130, 83,5,'photo_3106717.html');
												thumbnails[7601048] = new thumbnail(7601048,'190620','New Atlantic 85 Floating Boathouse, Brighton & Burnham-on-Crouch','P3301273_thumb.JPG',130, 98,5,'photo_7601048.html');
												thumbnails[7601049] = new thumbnail(7601049,'190620','New Atlantic 85 Floating Boathouse, Brighton & Burnham-on-Crouch','P3301275_thumb.JPG',130, 98,5,'photo_7601049.html');
												thumbnails[7601056] = new thumbnail(7601056,'190620','New Atlantic 85 Floating Boathouse, Brighton & Burnham-on-Crouch','P3301278_thumb.JPG',130, 98,5,'photo_7601056.html');
												thumbnails[7753662] = new thumbnail(7753662,'190620','Venture Quays, East Cowes','P5051386_thumb.JPG',130, 98,5,'photo_7753662.html');
												thumbnails[7753666] = new thumbnail(7753666,'190620','View along West Cowes Waterfront showing Shepards Wharf, Cowes Yacht Haven, Red Jet Pontoon & Trinity Landing, all Mayhew Callum projects','P5051389_thumb.JPG',130, 98,5,'photo_7753666.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[190620] = new gallery(190620,'7753666,7753662,7601056,7601049,7601048,3106717,3106371,3106170,3106148,3105846','Examples of Work','section235804',[3088541,3088555,3088557,3088565,3088566,3088977,3089006,3089104,3089133,3102387,3105646,3105700,3105808,3105845,3105846,3106148,3106170,3106371,3106717,7601048,7601049,7601056,7753662,7753666],0, 0, '', 'section235804.html',0,1);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '3088592';
imageSets[3] = '7753666,7753662,7601056,7601049,7601048,7588358,3193609,3193606,3193520,3111108,3109852,3109851,3106718,3106717,3106714,3106713,3106371,3106170,3106148,3105848,3105846,3105845,3105816,3105815,3105808,3105805,3105700,3105646,3102391,3102387,3089133,3089104,3089006,3089000,3088977,3088944,3088857,3088603,3088592,3088566,3088565,3088557,3088555,3088541,3088539';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/mayhewcallum/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/mayhewcallum/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 += 'section235804.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 && 'section235804' != '') {
					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 = 'Mayhew Callum Limited: ' + 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> ' + (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;
	}
}

			

