window.thumbnails = new Object();
												thumbnails[3791300] = new thumbnail(3791300,'231073','Male nude  ','Crouchingmailnudegraphcopy_thumb.jpg',130, 175,15,'photo_3791300.html');
												thumbnails[3791305] = new thumbnail(3791305,'231073','Female Torso','FemaleTorsoinkcopy_thumb.jpg',130, 124,15,'photo_3791305.html');
												thumbnails[3791414] = new thumbnail(3791414,'231073','Figure study','FnudecrouchstoolinkcropBWcopy_thumb.jpg',130, 189,15,'photo_3791414.html');
												thumbnails[3791416] = new thumbnail(3791416,'231073','Reclining nude','largereclFnudepastelcopy_thumb.jpg',130, 94,15,'photo_3791416.html');
												thumbnails[3791483] = new thumbnail(3791483,'231073','Reclining nude','RecliningBluenudemixmedcopy_thumb.jpg',130, 93,15,'photo_3791483.html');
												thumbnails[3791484] = new thumbnail(3791484,'231073','Reclining nude','RecliningFnudecharcoalcopy_thumb.jpg',130, 92,15,'photo_3791484.html');
												thumbnails[3791487] = new thumbnail(3791487,'231073','Nude oil study','SeatedFnudeAoilscopy_thumb.jpg',130, 129,15,'photo_3791487.html');
												thumbnails[3791488] = new thumbnail(3791488,'231073','Life figure','SeatedFnude2inkcopy_thumb.jpg',130, 169,15,'photo_3791488.html');
												thumbnails[3791593] = new thumbnail(3791593,'231092','Untitled 2009, acrylic on 3-D canvas 30 x 30 cms','2008_thumb.jpg',130, 130,15,'photo_3791593.html');
												thumbnails[3791595] = new thumbnail(3791595,'231092','Untitled 2008-09, acrylic on linen. 40 x 28 ins','Large_Lick-1_thumb.jpg',130, 144,15,'photo_3791595.html');
												thumbnails[3791597] = new thumbnail(3791597,'231092','Untitled 2009-iii-2 ','20091_thumb.jpg',130, 128,15,'photo_3791597.html');
												thumbnails[6503122] = new thumbnail(6503122,'231092','Untitled 2009-iii-1','2009-iii-1_web_thumb.jpg',130, 126,15,'photo_6503122.html');
												thumbnails[6503176] = new thumbnail(6503176,'231092','Untitled colour study','Untitled_colour_study_acry-pap_thumb.jpg',130, 124,15,'photo_6503176.html');
												thumbnails[6503191] = new thumbnail(6503191,'231092','Untitled colour study 2','Untitled_colour_study_2_acry-pap_thumb.jpg',130, 126,15,'photo_6503191.html');
												thumbnails[6503247] = new thumbnail(6503247,'231092','Untitled','Untitled_acr-pap1_thumb.jpg',130, 176,15,'photo_6503247.html');
												thumbnails[7138076] = new thumbnail(7138076,'231092','Untitled 2009; acrylic on canvas','Small_lick-1_web_thumb.jpg',130, 131,15,'photo_7138076.html');
												thumbnails[7138082] = new thumbnail(7138082,'231092','Untitled 2009-10; acrylic on canvas','Lick-4_web_thumb.jpg',130, 140,15,'photo_7138082.html');
												thumbnails[3894854] = new thumbnail(3894854,'231091','Alfreda McHale Portrait I','Alfredaoil1_thumb.jpg',130, 166,15,'photo_3894854.html');
												thumbnails[3894873] = new thumbnail(3894873,'231091','Alfreda McHale Portrait II','AlfredaoilNo2_thumb.jpg',130, 153,15,'photo_3894873.html');
												thumbnails[3791601] = new thumbnail(3791601,'231091','Alfreda McHale, Portrait Study I','ASG1copy_thumb.jpg',130, 184,15,'photo_3791601.html');
												thumbnails[3894124] = new thumbnail(3894124,'231091','Alfreda McHale Portrait study II','Alfredagraphstudy2_thumb.jpg',130, 188,15,'photo_3894124.html');
												thumbnails[3791498] = new thumbnail(3791498,'231091',' Ebauche/lay-in stage of Alfreda McHale Portrait I','Alfreda1ebauchecopy_thumb.jpg',130, 163,15,'photo_3791498.html');
												thumbnails[6501511] = new thumbnail(6501511,'231074','Still life','apple_still_life_oil_2_08_web_thumb.jpg',130, 94,15,'photo_6501511.html');
												thumbnails[6501079] = new thumbnail(6501079,'231073','Untitled','Seated_nude_o-c_web_thumb.jpg',130, 129,15,'photo_6501079.html');
												thumbnails[7612199] = new thumbnail(7612199,'231092','Collage series I/1 2010','Collage1_web_thumb.jpg',130, 129,15,'photo_7612199.html');
												thumbnails[6501082] = new thumbnail(6501082,'231073','Untitled','Crouch_nude_on_stool_o-c_web_thumb.jpg',130, 123,15,'photo_6501082.html');
												thumbnails[7612251] = new thumbnail(7612251,'231092','Collage series I/2 2010','Collage2_web_thumb.jpg',130, 135,15,'photo_7612251.html');
												thumbnails[6501091] = new thumbnail(6501091,'231073','Untitled','Male_nude_o-c_web1_thumb.jpg',130, 87,15,'photo_6501091.html');
												thumbnails[3791598] = new thumbnail(3791598,'231074','Still Life three apples I (green ground)','Still_life_three_apples_green_gd_web_thumb.jpg',130, 128,15,'photo_3791598.html');
												thumbnails[6501340] = new thumbnail(6501340,'231073','Iconic female nude','iconic_seated_Fnude_pastel_detail1_thumb.jpg',130, 113,15,'photo_6501340.html');
												thumbnails[6501306] = new thumbnail(6501306,'231073','Woman on stool II','F_nude_on_stool_ink_thumb.jpg',130, 184,15,'photo_6501306.html');
												thumbnails[6520254] = new thumbnail(6520254,'231073','Seated Nude','Seated_F_nude_oils_2_web_thumb.jpg',130, 197,15,'photo_6520254.html');
												thumbnails[6502268] = new thumbnail(6502268,'231074','Still Life three apples (green ground), detail','Still_life_three_apples_II_detail2_web_thumb.jpg',130, 86,15,'photo_6502268.html');
												thumbnails[6501392] = new thumbnail(6501392,'231073','Male torso','twisted_male_nude_I_charcoal1_thumb.jpg',130, 187,15,'photo_6501392.html');
												thumbnails[6520283] = new thumbnail(6520283,'231073','Seated nude, after Bonnard','Seated_F_nude-Bonnard_oils_web_thumb.jpg',130, 151,15,'photo_6520283.html');
												thumbnails[6501356] = new thumbnail(6501356,'231073','Male back','Male_back_graphite_web_thumb.jpg',130, 180,15,'photo_6501356.html');
												thumbnails[6536134] = new thumbnail(6536134,'231073','Male nude, seated','Male_nude_seated_mix_med_web_thumb.jpg',130, 196,15,'photo_6536134.html');
												thumbnails[6503102] = new thumbnail(6503102,'231074','Still Life three apples (green ground), detail, 2008','Still_life_three_apples_green_gd_detail2_web_thumb.jpg',130, 86,15,'photo_6503102.html');
												thumbnails[6502232] = new thumbnail(6502232,'231074','Still life three apples II (blue ground)','Still_life_three_apples_II_web_thumb.jpg',130, 130,15,'photo_6502232.html');
												thumbnails[6502533] = new thumbnail(6502533,'231074','Still Life three apples II (blue ground), detail, 2008','Still_life_three_apples_II_detail3_web1_thumb.jpg',130, 86,15,'photo_6502533.html');
												thumbnails[6502587] = new thumbnail(6502587,'231074','Still Life three apples II (blue ground), detail, 2008','Still_life_three_apples_II_detail_web_thumb.jpg',130, 86,15,'photo_6502587.html');
												thumbnails[3908280] = new thumbnail(3908280,'237363','F Brauer & A Callen eds. 2008','Artsexeugen_cover12_thumb.jpg',130, 197,15,'photo_3908280.html');
												thumbnails[3919238] = new thumbnail(3919238,'237363','Callen, 2000','Impress_full_cover_thumb.jpg',130, 155,15,'photo_3919238.html');
												thumbnails[3908287] = new thumbnail(3908287,'237363','Callen, 1995','Spec_Body_cover1_thumb.jpg',130, 175,15,'photo_3908287.html');
												thumbnails[3993546] = new thumbnail(3993546,'237363','Courbet, 1980','Courbet-coverweb_thumb.jpg',130, 175,15,'photo_3993546.html');
												thumbnails[3993538] = new thumbnail(3993538,'237363','Angel in the Studio, 1979','Angel-cover_thumb.jpg',130, 185,15,'photo_3993538.html');
												thumbnails[3993632] = new thumbnail(3993632,'237363','\'Women Artists...\' US edition','Women-artists-coverweb_thumb.jpg',130, 184,15,'photo_3993632.html');
												thumbnails[3993601] = new thumbnail(3993601,'237363','CALLEN, 1978  ','Renoir-coverweb_thumb.jpg',130, 181,15,'photo_3993601.html');
												thumbnails[3993966] = new thumbnail(3993966,'237363','Techniques of the Impressionists','Tech-of-Imp-coverweb_thumb.jpg',130, 183,15,'photo_3993966.html');
												thumbnails[6056205] = new thumbnail(6056205,'237363','Anthea Callen, \'Les peintres impressionnistes et leurs techniques\'','Impressionist_Techniques_French_ed_cover_thumb.jpg',130, 130,15,'photo_6056205.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[231092] = new gallery(231092,'7612251,7612199,3791593','Abstracts','gallery',[3791593,3791595,3791597,6503122,6503176,6503191,6503247,7138076,7138082,7612199,7612251],0, 0, '', 'gallery_231092.html',0,0);
				  					galleries[231091] = new gallery(231091,'3894854,3791601','Portraits','gallery',[3894854,3894873,3791601,3894124,3791498],0, 0, '', 'gallery_231091.html',0,0);
				  					galleries[237363] = new gallery(237363,'3908280','BOOKS','section289126',[3908280,3919238,3908287,3993546,3993538,3993632,3993601,3993966,6056205],0, 0, '', 'section289126.html',0,1);
				  					galleries[231073] = new gallery(231073,'6536134,6520283,6520254,6501392,6501356,6501340,6501306,6501091,6501082,6501079','Nudes','gallery',[3791300,3791305,3791414,3791416,3791483,3791484,3791487,3791488,6501079,6501082,6501091,6501340,6501306,6520254,6501392,6520283,6501356,6536134],0, 0, '', 'gallery_231073.html',0,0);
				  					galleries[231074] = new gallery(231074,'6503102,6502587,6502533,6502268,6502232,6501511,3791598','Still Life','gallery',[6501511,3791598,6502268,6503102,6502232,6502533,6502587],0, 0, '', 'gallery_231074.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7612199,6536134,6503176,3894873';
imageSets[2] = '7612251,7612199,3908280,3894854,3791601,3791593';
imageSets[3] = '7612251,7612199,7138082,7138076,6536134,6520283,6520254,6503247,6503191,6503176,6503122,6503102,6502587,6502533,6502268,6502232,6501511,6501392,6501356,6501340,6501306,6501091,6501082,6501079,6056205,3993966,3993632,3993601,3993546,3993538,3919238,3908287,3908280,3894873,3894854,3894124,3791601,3791598,3791597,3791595,3791593,3791498,3791488,3791487,3791484,3791483,3791416,3791414,3791305,3791300';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/antheacallen/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/antheacallen/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 = 'Anthea Callen: ' + 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 = 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;
	}
}

			

