window.thumbnails = new Object();
												thumbnails[2611718] = new thumbnail(2611718,'','','Hauptbild1_thumb.jpg',130, 89,32,'#');
												thumbnails[6116471] = new thumbnail(6116471,'','','SKU_1_von_1_thumb.jpg',130, 87,32,'#');
												thumbnails[2613296] = new thumbnail(2613296,'165890','','Wildlive_thumb.jpg',130, 130,32,'photo_2613296.html');
												thumbnails[2613309] = new thumbnail(2613309,'164195','','Nature_thumb.jpg',130, 130,32,'photo_2613309.html');
												thumbnails[2613335] = new thumbnail(2613335,'164194','','People_thumb.jpg',130, 130,32,'photo_2613335.html');
												thumbnails[4608837] = new thumbnail(4608837,'164194','','11-9_thumb.jpg',130, 130,32,'photo_4608837.html');
												thumbnails[4608847] = new thumbnail(4608847,'164194','','20080127_Simone_Kühn_050_thumb.jpg',130, 130,32,'photo_4608847.html');
												thumbnails[4608848] = new thumbnail(4608848,'164194','','20080203_Maya_Lörtscher_280_Kopie_thumb.jpg',130, 130,32,'photo_4608848.html');
												thumbnails[4608856] = new thumbnail(4608856,'164195','','Gletscher1_thumb.jpg',130, 130,32,'photo_4608856.html');
												thumbnails[4608860] = new thumbnail(4608860,'164194','','Hunziker342008-2_thumb.jpg',130, 130,32,'photo_4608860.html');
												thumbnails[4608865] = new thumbnail(4608865,'164194','','Hunziker492008-2_thumb.jpg',130, 130,32,'photo_4608865.html');
												thumbnails[4616804] = new thumbnail(4616804,'164194','','_SKU0031_thumb.jpg',130, 130,32,'photo_4616804.html');
												thumbnails[4616806] = new thumbnail(4616806,'164194','','MUT3_thumb.jpg',130, 130,32,'photo_4616806.html');
												thumbnails[4616811] = new thumbnail(4616811,'165890','','_SKU1211_thumb.jpg',130, 130,32,'photo_4616811.html');
												thumbnails[4616812] = new thumbnail(4616812,'165890','','DSC_0944_thumb.jpg',130, 130,32,'photo_4616812.html');
												thumbnails[4616817] = new thumbnail(4616817,'165890','','DSC_1092_thumb.jpg',130, 130,32,'photo_4616817.html');
												thumbnails[4616820] = new thumbnail(4616820,'165890','','DSC_1143_thumb.jpg',130, 130,32,'photo_4616820.html');
												thumbnails[4616849] = new thumbnail(4616849,'165890','','DSC_1277_thumb.jpg',130, 130,32,'photo_4616849.html');
												thumbnails[4617419] = new thumbnail(4617419,'164194','','P2_thumb.jpg',130, 130,32,'photo_4617419.html');
												thumbnails[4635994] = new thumbnail(4635994,'164195','','_NAT2900_Kopie_thumb.jpg',130, 130,32,'photo_4635994.html');
												thumbnails[4635996] = new thumbnail(4635996,'164195','','_NAT2962_thumb.jpg',130, 130,32,'photo_4635996.html');
												thumbnails[4636641] = new thumbnail(4636641,'165890','','_SKU1303_thumb.jpg',130, 130,32,'photo_4636641.html');
												thumbnails[4641910] = new thumbnail(4641910,'165890','','_SKU1907_thumb.jpg',130, 130,32,'photo_4641910.html');
												thumbnails[4641916] = new thumbnail(4641916,'165890','','_SKU1881_thumb.jpg',130, 130,32,'photo_4641916.html');
												thumbnails[4641922] = new thumbnail(4641922,'164195','','_SKU1623_thumb.jpg',130, 130,32,'photo_4641922.html');
												thumbnails[4641933] = new thumbnail(4641933,'164195','','_SKU1620_thumb.jpg',130, 130,32,'photo_4641933.html');
												thumbnails[4642614] = new thumbnail(4642614,'164195','','_NAT3032_thumb.jpg',130, 130,32,'photo_4642614.html');
												thumbnails[4642618] = new thumbnail(4642618,'164195','','_NAT3243_thumb.jpg',130, 130,32,'photo_4642618.html');
												thumbnails[4642619] = new thumbnail(4642619,'164195','','_NAT3048_thumb.jpg',130, 130,32,'photo_4642619.html');
												thumbnails[6116034] = new thumbnail(6116034,'342814','','SKU1_8_von_11_thumb.jpg',130, 130,32,'photo_6116034.html');
												thumbnails[6116041] = new thumbnail(6116041,'342814','','SKU1_9_von_11_thumb.jpg',130, 130,32,'photo_6116041.html');
												thumbnails[6116045] = new thumbnail(6116045,'342814','','SKU1_3_von_11_thumb.jpg',130, 130,32,'photo_6116045.html');
												thumbnails[6116047] = new thumbnail(6116047,'342814','','SKU1_10_von_11_thumb.jpg',130, 130,32,'photo_6116047.html');
												thumbnails[6116052] = new thumbnail(6116052,'342814','','SKU1_5_von_11_thumb.jpg',130, 130,32,'photo_6116052.html');
												thumbnails[6116058] = new thumbnail(6116058,'342814','','SKU1_11_von_11_thumb.jpg',130, 130,32,'photo_6116058.html');
												thumbnails[6116062] = new thumbnail(6116062,'342814','','SKU1_6_von_11_thumb.jpg',130, 130,32,'photo_6116062.html');
												thumbnails[6116066] = new thumbnail(6116066,'342814','','SKU1_4_von_11_thumb.jpg',130, 130,32,'photo_6116066.html');
												thumbnails[6116072] = new thumbnail(6116072,'342814','','SKU1_1_von_11_thumb.jpg',130, 130,32,'photo_6116072.html');
												thumbnails[6116095] = new thumbnail(6116095,'342819','','SKU11_3_von_10_thumb.jpg',130, 130,32,'photo_6116095.html');
												thumbnails[6116098] = new thumbnail(6116098,'342819','','SKU11_1_von_10_thumb.jpg',130, 130,32,'photo_6116098.html');
												thumbnails[6116104] = new thumbnail(6116104,'342819','','SKU11_2_von_10_thumb.jpg',130, 130,32,'photo_6116104.html');
												thumbnails[6116109] = new thumbnail(6116109,'342819','','SKU11_5_von_10_thumb.jpg',130, 130,32,'photo_6116109.html');
												thumbnails[6116111] = new thumbnail(6116111,'342819','','SKU11_7_von_10_thumb.jpg',130, 130,32,'photo_6116111.html');
												thumbnails[6116115] = new thumbnail(6116115,'342819','','SKU11_8_von_10_thumb.jpg',130, 130,32,'photo_6116115.html');
												thumbnails[6116151] = new thumbnail(6116151,'342819','','SKU11_9_von_10_thumb.jpg',130, 130,32,'photo_6116151.html');
												thumbnails[6116336] = new thumbnail(6116336,'342819','','SKU11_6_von_101_thumb.jpg',130, 130,32,'photo_6116336.html');
												thumbnails[6116413] = new thumbnail(6116413,'342819','','SKU11_10_von_10_thumb.jpg',130, 130,32,'photo_6116413.html');
												thumbnails[2613326] = new thumbnail(2613326,'165891','','FineArt2_thumb.jpg',130, 130,32,'photo_2613326.html');
												thumbnails[4608834] = new thumbnail(4608834,'165891','','_SKU4130-Bearbeitet46_thumb.jpg',130, 130,32,'photo_4608834.html');
												thumbnails[4608843] = new thumbnail(4608843,'165891','','_SKU4318_thumb.jpg',130, 130,32,'photo_4608843.html');
												thumbnails[4608852] = new thumbnail(4608852,'165891','','-Bearbeitet_thumb.jpg',130, 130,32,'photo_4608852.html');
												thumbnails[4608869] = new thumbnail(4608869,'165891','','SKU_1877_thumb.jpg',130, 130,32,'photo_4608869.html');
												thumbnails[4608875] = new thumbnail(4608875,'165891','','SKU_4937_thumb.jpg',130, 130,32,'photo_4608875.html');
												thumbnails[4608876] = new thumbnail(4608876,'165891','','Tulpe_rot_thumb.jpg',130, 130,32,'photo_4608876.html');
												thumbnails[4616763] = new thumbnail(4616763,'266896','','_NAT3357Zebra1_thumb.jpg',130, 130,32,'photo_4616763.html');
												thumbnails[4616793] = new thumbnail(4616793,'165891','','_SKU3243_thumb.jpg',130, 130,32,'photo_4616793.html');
												thumbnails[4616802] = new thumbnail(4616802,'165891','','SKU_46091_thumb.jpg',130, 130,32,'photo_4616802.html');
												thumbnails[4627285] = new thumbnail(4627285,'267331','','Lageplan_thumb.JPG',130, 88,32,'photo_4627285.html');
												thumbnails[4627286] = new thumbnail(4627286,'267331','','Lageplan2_thumb.JPG',130, 89,32,'photo_4627286.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[164194] = new gallery(164194,'2613335','People','gallery',[2613335,4608837,4608847,4608848,4608860,4608865,4616804,4616806,4617419],0, 0, '', 'gallery_164194.html',0,0);
				  					galleries[342814] = new gallery(342814,'6116034','Ghana (Image Bilder für Oportunity International)','gallery',[6116034,6116041,6116045,6116047,6116052,6116058,6116062,6116066,6116072],0, 0, '', 'gallery_342814.html',0,0);
				  					galleries[164195] = new gallery(164195,'2613309','Nature','gallery',[2613309,4608856,4635994,4635996,4641922,4641933,4642614,4642618,4642619],0, 0, '', 'gallery_164195.html',0,0);
				  					galleries[342819] = new gallery(342819,'6116095','Mahouts & Elephants','gallery',[6116095,6116098,6116104,6116109,6116111,6116115,6116151,6116336,6116413],0, 0, '', 'gallery_342819.html',0,0);
				  					galleries[165890] = new gallery(165890,'2613296','Wild Life','gallery',[2613296,4616811,4616812,4616817,4616820,4616849,4636641,4641910,4641916],0, 0, '', 'gallery_165890.html',0,0);
				  					galleries[165891] = new gallery(165891,'2613326','Fine Art','section321073',[2613326,4608834,4608843,4608852,4608869,4608875,4608876,4616793,4616802],0, 0, '', 'section321073_165891.html',0,0);
				  					galleries[266896] = new gallery(266896,'4616763','Fine Art Projekt \"Botswana Ghosts\"','section321073',[4616763],0, 0, '', 'section321073_266896.html',0,0);
				  					galleries[267331] = new gallery(267331,'4627286,4627285','Studio Wegbeschreibung','section321790',[4627285,4627286],0, 0, '', 'section321790.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '2611718';
imageSets[2] = '6116095,6116034,4616763,2613335,2613326,2613309,2613296';
imageSets[3] = '6116471,6116413,6116336,6116151,6116115,6116111,6116109,6116104,6116098,6116095,6116072,6116066,6116062,6116058,6116052,6116047,6116045,6116041,6116034,4642619,4642618,4642614,4641933,4641922,4641916,4641910,4636641,4635996,4635994,4627286,4627285,4617419,4616849,4616820,4616817,4616812,4616811,4616806,4616804,4616802,4616793,4616763,4608876,4608875,4608869,4608865,4608860,4608856,4608852,4608848';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/simplysku/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/simplysku/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/simplysku/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/simplysku/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/simplysku/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/simplysku/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/simplysku/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/simplysku/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/simplysku/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/simplysku/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/simplysku/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/simplysku/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/simplysku/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/simplysku/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/simplysku/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/simplysku/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/simplysku/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/simplysku/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/simplysku/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/simplysku/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/simplysku/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/simplysku/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 = 'simplysku: ' + 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;
	}
}

			

