basic=0;function photo(c,b,a,d,e,f,g,h,j,m,t,u,l,n,k,r,o,q,s){this.id=c;this.galleries_id=b;this.photo_ref=a;this.section_code=d;this.src=e;this.width=f;this.height=g;this.caption=h;this.home=j;this.gallery=m;this.description=t;this.takendate=u;this.photographer=l;this.location=n;this.item_price=k;this.purchase_instruction=r;this.payment_groups_id=o;this.server_id=q;this.link=s;this.src=getServerPath(this.server_id)+"/"+this.src}
function gallery(c,b,a,d,e,f,g,h,j,m,t){this.id=c;this.featured_images=b;this.title=a;this.section_code=d;this.photoIDs=e;this.skipIndex=f;this.usePopups=g;this.parentGallery=h;this.link=j;this.maxRecords=m;this.singleSection=t}function randomListVal(c){arrayVals=c.split(",");if(arrayVals.length){pos=Math.round(Math.random()*(arrayVals.length-1));val=arrayVals[pos]}else val=0;return val}
function getNextId(c,b,a){c=getArrayPos(b,c);nextImgPos=a?c==0?b.length-1:c-1:c==b.length-1?0:c+1;return nextImg=b[nextImgPos]}
function next(c,b,a){c=c||(document.location.href.match(/photo(s_id)?[=_](\d+)/)||["","",""])[2];var d=$("div.contentsection-photos[id^=gallery_others] div.gallery").data("clikCarouselArray")||galleries[photos[c].galleries_id].photoIDs;nextImg=getNextId(c,d);if(nextImg!=-1)updateImage({nextPhoto:photos[nextImg],img:b,$photo:$("#imagePhoto"),updateHash:true,$title:$("#"+(a||"imageTitle")),$detail:$("#imageDetails"),updateDocumentTitle:true})}
function previous(c,b,a){c=c||(document.location.href.match(/photo(s_id)?[=_](\d+)/)||["","",""])[2];var d=$("div.contentsection-photos[id^=gallery_others] div.gallery").data("clikCarouselArray")||galleries[photos[c].galleries_id].photoIDs;nextImg=getNextId(c,d,1);if(nextImg!=-1)updateImage({nextPhoto:photos[nextImg],img:b,$photo:$("#imagePhoto"),updateHash:true,$title:$("#"+(a||"imageTitle")),$detail:$("#imageDetails"),updateDocumentTitle:true})}
function resizePhotoInfo(c){c=$.extend({centre:false,photoinfominwidth:200,photoinfoadjacent:false},c||{});$("#photoPanelOuter").height("auto");$("#infoWrap").width(c.photoinfominwidth);$("#photoDetail").css("width","auto");var b=$("#maincolContent").width(),a=$("#photoWrap").outerWidth(true),d=Math.max($("#infoWrap").outerWidth(true),c.photoinfominwidth),e=$("#photoWrap").outerHeight(),f=$("#infoWrap").outerHeight(),g=!$("#infoWrap").length||$("#infoWrap").hasClass("empty");floatDrop=$("#photoDetail.layoutbelow").length;
var h=a;if(!g){if(b<a+d)floatDrop=1;if(floatDrop){var j=$("#photoWrap").outerWidth();if($("#imagePhoto").css("overflow")=="hidden"){j=Math.min(j,$("#photoDetail").width());$("#imagePhoto").width(function(m,t){return j-$(this).outerWidth(true)+t})}$("#infoWrap").width(function(m,t){return j-$(this).outerWidth(true)+t})}else{h=$("#infoWrap").innerWidth();c.photoinfoadjacent&&$("#infoWrap").width(h+(b-a-d-3));d=$("#infoWrap").outerWidth(true);h=a+d;if(e>f){b=$("#photoPanelOuter").height();$("#photoPanelOuter").height(b+
(e-f));f=$("#infoWrap").outerHeight()}}}if(c.centre){$("#photoDetail").width(h);$("#photoDetail").css("margin-left","auto");$("#photoDetail").css("margin-right","auto")}else{$("#photoDetail").css("margin-left","0");$("#photoDetail").css("margin-right","0")}}function getArrayPos(c,b){for(var a=0;a<c.length;a++)if(c[a]==b)return a;return-1}
function changeBgImg(c,b){var a=randomListVal(imageSets[b]);a=backgrounds[a].src;var d=$(c);if(d.size()>0)/\bimg$/.test(c)?d.attr({src:a}):d.css({"background-image":'url("'+a+'")'})}function thumbnail(c,b,a,d,e,f,g,h){this.id=c;this.galleries_id=b;this.caption=a;this.src=getServerPath(g)+"/"+d;this.width=e;this.height=f;this.link=h}
thumbnail.prototype.fnGetImgTag=function(c,b){var a="";a+='<img class="thumbnail" ';a+='src="'+this.src+'" ';a+='alt="'+this.caption+'" ';a+='style="'+(b||"")+'" ';a+='id="'+(c||"")+this.id+'">';return a};
thumbnail.prototype.fnGalleryLink=photo.prototype.fnGalleryLink=function(c){var b=galleries[this.galleries_id];if(c&&c!=this.galleries_id)return galleries[c].link;if(b.skipIndex)if(b.usePopups)if(b.singleSection&&b.maxRecords){c=Math.floor(getArrayPos(b.photoIDs,this.id)/b.maxRecords)+1;if(c==1)return b.link+"&photos_id="+this.id;return b.link.replace(".html","_"+c+".html").replace("?","?pageNum="+c+"&")+"&photos_id="+this.id}else return b.link+"&photos_id="+this.id;else return this.link;else return b.link};
