function ImageInfo(){this.Id="";this.Title="";this.Description="";this.ImageUrl="";this.ThumbnailUrl="";this.Author="";this.Source="";this.Rating="";this.VoteCount="";this.VoteSum=""}function GalleryInfo(){this.Id="";this.Title="";this.Description=""}function Lightbox(P){var B;var x;var v=false;P=jQuery.extend({overlayBgColor:"#000",overlayOpacity:0.8,imageLoading:galleryLightboxDefaults.WebResourcesFolder+"images/lightbox-ico-loading.gif",imageBtnPrev:galleryLightboxDefaults.WebResourcesFolder+"images/arrow-big-left.png",imageBtnNext:galleryLightboxDefaults.WebResourcesFolder+"images/arrow-big-right.png",imageBlank:galleryLightboxDefaults.WebResourcesFolder+"images/lightbox-blank.gif",imageClose:galleryLightboxDefaults.WebResourcesFolder+"images/close.png",imageThumbnailsOff:galleryLightboxDefaults.WebResourcesFolder+"images/icon-sakrij-thumbnailove.png",imageThumbnailsOn:galleryLightboxDefaults.WebResourcesFolder+"images/icon-prikazi-thumbnailove.png",imageSlideShowOn:galleryLightboxDefaults.WebResourcesFolder+"images/icon-stop-slideshow.png",imageSlideShowOff:galleryLightboxDefaults.WebResourcesFolder+"images/icon-play-slideshow.png",imageInfoOff:galleryLightboxDefaults.WebResourcesFolder+"images/icon-sakrij-info-o-slici.png",imageInfoOn:galleryLightboxDefaults.WebResourcesFolder+"images/icon-pokazi-info-o-slici.png",containerBorderSize:0,containerResizeSpeed:400,txtImage:galleryLightboxDefaults.TextImage,txtImageOf:galleryLightboxDefaults.TextImageOf,txtInfoOn:galleryLightboxDefaults.TextInfoOn,txtInfoOff:galleryLightboxDefaults.TextInfoOff,txtThumbnailsOff:galleryLightboxDefaults.TextThumbnailsOff,txtThumbnailsOn:galleryLightboxDefaults.TextThumbnailsOn,txtVotes:galleryLightboxDefaults.TextVotes,txtVoteForImage:galleryLightboxDefaults.TextVoteForImage,keyToClose:"c",keyToPrev:"p",keyToNext:"n",galleryInfo:GalleryInfo,activeImage:0,width:galleryLightboxDefaults.Width,height:galleryLightboxDefaults.Height,imageFormatId:galleryLightboxDefaults.ImageFormatId,thumbnailFormatId:galleryLightboxDefaults.ThumbnailFormatId,imageWidth:galleryLightboxDefaults.ImageWidth,imageHeight:galleryLightboxDefaults.ImageHeight,thumbnailPageUrl:galleryLightboxDefaults.ThumbnailPageUrl,thumbnailWidth:galleryLightboxDefaults.ThumbnailWidth,thumbnailHeight:galleryLightboxDefaults.ThumbnailHeight,showImageInfo:true,showThumbnails:galleryLightboxDefaults.ShowThumbnails,showGalleryInfo:galleryLightboxDefaults.ShowGalleryInfo,showVoting:galleryLightboxDefaults.ShowVoting,imageStar:galleryLightboxDefaults.WebResourcesFolder+"images/star.png",imageStarInactive:galleryLightboxDefaults.WebResourcesFolder+"images/star-blank.png",imageStarHover:galleryLightboxDefaults.WebResourcesFolder+"images/star-on.png",slideShowOn:galleryLightboxDefaults.SlideShowOn,slideShowDelay:galleryLightboxDefaults.SlideShowDelay,txtSlideShowTurnOn:galleryLightboxDefaults.TextSlideShowOn,txtSlideShowTurnOff:galleryLightboxDefaults.TextSlideShowOff,isInsideDiv:galleryLightboxDefaults.isInsideDiv,insideDivId:galleryLightboxDefaults.insideDivId,txtClose:galleryLightboxDefaults.TextClose,useIframeLoader:galleryLightboxDefaults.useIframeLoader,imageLoaderPage:galleryLightboxDefaults.ImageLoaderPage,textAuthorLabel:galleryLightboxDefaults.TextAuthorLabel,textOriginLabel:galleryLightboxDefaults.TextOriginLabel,removeBanners:galleryLightboxDefaults.RemoveBanners},P);function d(){if(jQuery("#gallerylightbox-lightbox-nav-btnPrev").css("display")=="none"||jQuery("#gallerylightbox-lightbox-nav-btnNext").css("display")=="none"){jQuery("#gallerylightbox-lightbox-nav-btnPrev").css({display:"block"});jQuery("#gallerylightbox-lightbox-nav-btnNext").css({display:"block"})}}function e(){if(jQuery("#gallerylightbox-lightbox-nav-btnPrev").css("display")=="block"||jQuery("#gallerylightbox-lightbox-nav-btnNext").css("display")=="block"){var U=jQuery("#gallerylightbox-lightbox-nav").height();jQuery("#gallerylightbox-lightbox-nav-btnPrev").css({display:"none"});jQuery("#gallerylightbox-lightbox-nav-btnNext").css({display:"none"});jQuery("#gallerylightbox-lightbox-nav").height(U)}}var l={sensitivity:3,interval:1,over:d,timeout:500,out:e};function m(){i();J();return false}function i(){if(P.isInsideDiv==true){jQuery("#"+P.insideDivId).html('<div id="gallerylightbox-jquery-lightbox" style="position: relative"><div id="gallerylightbox-jquery-lightbox-galleryinfo-box"><div id="gallerylightbox-jquery-lightbox-galleryinfo"></div><div id="gallerylightbox-jquery-lightbox-galleryinfo-close"></div></div><div id="gallerylightbox-lightbox-container-box"><div id="gallerylightbox-lightbox-loading"><a href="#" id="gallerylightbox-lightbox-loading-link"><img src="'+P.imageLoading+'"  style="visibility: visible" /></a></div><div id="gallerylightbox-gallerylightbox-lightbox-container-image-box"><div id="gallerylightbox-lightbox-container-image"></div></div><div id="gallerylightbox-lightbox-nav"><a href="#" id="gallerylightbox-lightbox-nav-btnPrev" style="display: none"></a><a href="#" id="gallerylightbox-lightbox-nav-btnNext" style="display: none"></a></div><div id="gallerylightbox-lightbox-container-image-data-box" style="display: none"></div></div><div id="gallerylightbox-jquery-lightbox-toolbox-box"></div><div id="gallerylightbox-jquery-lightbox-thumbnails-box" style="width: 0px;"></div></div><div id="divIframe" style="display: none"></div>')}else{jQuery("body").append('<div id="gallerylightbox-jquery-overlay"></div><div id="gallerylightbox-jquery-lightbox"><div id="gallerylightbox-jquery-lightbox-galleryinfo-box"><div id="gallerylightbox-jquery-lightbox-galleryinfo"></div><div id="gallerylightbox-jquery-lightbox-galleryinfo-close"></div></div><div id="gallerylightbox-lightbox-container-box"><div id="gallerylightbox-lightbox-loading"><a href="#" id="gallerylightbox-lightbox-loading-link"><img src="'+P.imageLoading+'" style="visibility: visible" /></a></div><div id="gallerylightbox-gallerylightbox-lightbox-container-image-box"><div id="gallerylightbox-lightbox-container-image"></div></div><div id="gallerylightbox-lightbox-nav"><a href="#" id="gallerylightbox-lightbox-nav-btnPrev" style="display: none"></a><a href="#" id="gallerylightbox-lightbox-nav-btnNext" style="display: none"></a></div><div id="gallerylightbox-lightbox-container-image-data-box" style="display: none"></div></div><div id="gallerylightbox-jquery-lightbox-toolbox-box"></div><div id="gallerylightbox-jquery-lightbox-thumbnails-box" style="width: 0px;"></div></div><div id="divIframe" style="display: none"></div>')}if(P.removeBanners==true){jQuery("embed, object, select, iframe, div[id^=banner], span[id^=banner]").css({visibility:"hidden"})}jQuery("#gallerylightbox-jquery-lightbox-galleryinfo-box").css({width:parseInt(P.width)});jQuery("#gallerylightbox-jquery-lightbox-galleryinfo-box").unbind().bind("click",function(){return false});if(P.isInsideDiv==true){jQuery("#gallerylightbox-jquery-lightbox-galleryinfo-close").html("")}else{jQuery("#gallerylightbox-jquery-lightbox-galleryinfo-close").html(P.txtClose+' <img src="'+P.imageClose+'"  style="visibility: visible" align="absmiddle" />').unbind().bind("click",function(){I();return false});jQuery("#gallerylightbox-jquery-lightbox-galleryinfo-box").height(jQuery("#gallerylightbox-jquery-lightbox-galleryinfo-close").height())}O();var V=y();jQuery("#gallerylightbox-jquery-overlay").css({backgroundColor:P.overlayBgColor,opacity:P.overlayOpacity,width:V[0],height:V[1]}).fadeIn();var U=parseInt(P.width)+parseInt(P.containerBorderSize*2);var Y=parseInt(P.height)+parseInt(P.containerBorderSize*2);jQuery("#gallerylightbox-lightbox-container-box").width(U);jQuery("#gallerylightbox-lightbox-container-box").height(Y);var W=q();if(P.isInsideDiv!=true){var X=W[1]+((jQuery(window).height()/2)-((jQuery("#gallerylightbox-jquery-lightbox").height()+jQuery("#gallerylightbox-jquery-lightbox-galleryinfo-box").height()+85)/2));if(X<0){X=0}jQuery("#gallerylightbox-jquery-lightbox").css({top:X,left:W[0]})}jQuery("#gallerylightbox-jquery-lightbox").show();jQuery("#gallerylightbox-jquery-overlay").unbind().click(function(){I();return false});jQuery("#gallerylightbox-jquery-lightbox").unbind().click(function(){I();return false});jQuery(window).resize(function(){var Z=y();jQuery("#gallerylightbox-jquery-overlay").css({width:Z[0],height:Z[1]});var aa=q();if(P.isInsideDiv!=true){var ab=aa[1]+((jQuery(window).height()/2)-((jQuery("#gallerylightbox-jquery-lightbox").height())/2));if(ab<0){ab=0}jQuery("#gallerylightbox-jquery-lightbox").css({top:ab,left:aa[0]})}});jQuery("#gallerylightbox-lightbox-nav-btnPrev").css({background:"transparent url("+P.imageBtnPrev+") left 15% no-repeat"});jQuery("#gallerylightbox-lightbox-nav-btnNext").css({background:"transparent url("+P.imageBtnNext+") right 15% no-repeat"});jQuery("#gallerylightbox-lightbox-nav-btnPrev").unbind().bind("click",function(){M();return false});jQuery("#gallerylightbox-lightbox-nav-btnNext").unbind().bind("click",function(){o();return false});g();jQuery("#gallerylightbox-lightbox-image,#gallerylightbox-lightbox-container-image-data-box").hide()}function O(){if(P.showGalleryInfo==true){if(P.galleryInfo.Title.length==0){P.galleryInfo.Title="&nbsp;"}var U='<span class="gallerylightbox-jquery-lightbox-galleryinfo-title">'+P.galleryInfo.Title+"</span>";if(P.galleryInfo.Description!=null&&P.galleryInfo.Description.length>0){U=U+' <span class="gallerylightbox-jquery-lightbox-galleryinfo-description">| '+P.galleryInfo.Description+"</span>"}jQuery("#gallerylightbox-jquery-lightbox-galleryinfo").html(U);jQuery("#gallerylightbox-jquery-lightbox-galleryinfo-box").height(jQuery("#gallerylightbox-jquery-lightbox-galleryinfo").height()+10)}else{jQuery("#gallerylightbox-jquery-lightbox-galleryinfo").html("")}}function g(){var Z;var W;if(P.showImageInfo==true){Z=P.txtInfoOff;W=P.imageInfoOn}else{Z=P.txtInfoOn;W=P.imageInfoOff}var U;var Y;if(P.showThumbnails==true){U=P.txtThumbnailsOff;Y=P.imageThumbnailsOn}else{U=P.txtThumbnailsOn;Y=P.imageThumbnailsOff}var X;var V;if(P.slideShowOn==true){X=P.txtSlideShowTurnOff;V=P.imageSlideShowOn}else{X=P.txtSlideShowTurnOn;V=P.imageSlideShowOff}jQuery("#gallerylightbox-jquery-lightbox-toolbox-box").html('<div id="gallerylightbox-jquery-lightbox-toolbox"><div id="gallerylightbox-lightbox-image-details-voting"></div><div id="gallerylightbox-lightbox-image-details-toolbox"><ul class="galleryButton"><li><a id="gallerylightbox-jquery-lightbox-toolbox-slideshowstatus" class="gallerylightbox-jquery-lightbox-toolbox-anchors"><span>'+X+'</span></a></li><li><a id="gallerylightbox-jquery-lightbox-toolbox-infostatus" class="gallerylightbox-jquery-lightbox-toolbox-anchors"><span>'+Z+'</span></a></li><li><a id="gallerylightbox-jquery-lightbox-toolbox-thumbnailstatus" class="gallerylightbox-jquery-lightbox-toolbox-anchors"><span>'+U+"</span></a></li></ul></div></div>");jQuery("#gallerylightbox-jquery-lightbox-toolbox-box").css({width:parseInt(P.width)});jQuery("#gallerylightbox-jquery-lightbox-toolbox-box").unbind().bind("click",function(){return false});jQuery("#gallerylightbox-jquery-lightbox-toolbox-infostatus").click(function(){if(P.showImageInfo==true){jQuery("#gallerylightbox-jquery-lightbox-toolbox-infostatus").html("<span>"+P.txtInfoOn+"</span>");P.showImageInfo=false}else{jQuery("#gallerylightbox-jquery-lightbox-toolbox-infostatus").html("<span>"+P.txtInfoOff+"</span>");P.showImageInfo=true}D();return false});jQuery("#gallerylightbox-jquery-lightbox-toolbox-thumbnailstatus").click(function(){if(P.showThumbnails==true){jQuery("#gallerylightbox-jquery-lightbox-toolbox-thumbnailstatus").html("<span>"+P.txtThumbnailsOn+"</span>");P.showThumbnails=false}else{jQuery("#gallerylightbox-jquery-lightbox-toolbox-thumbnailstatus").html("<span>"+P.txtThumbnailsOff+"</span>");P.showThumbnails=true}f();return false});jQuery("#gallerylightbox-jquery-lightbox-toolbox-slideshowstatus").click(function(){if(P.slideShowOn==true){jQuery("#gallerylightbox-jquery-lightbox-toolbox-slideshowstatus").html("<span>"+P.txtSlideShowTurnOn+"</span>");P.slideShowOn=false;a()}else{jQuery("#gallerylightbox-jquery-lightbox-toolbox-slideshowstatus").html("<span>"+P.txtSlideShowTurnOff+"</span>");P.slideShowOn=true;C()}return false})}function S(V){var U='<img class="gallerylightbox-jquery-lightbox-thumbnails-image" id="gallerylightbox-jquery-lightbox-thumbnails-image-'+V+'" style="visibility: visible" src="'+P.imageArray[V].ThumbnailUrl+'" />';return U}function A(){if(P.imageArray!=null&&P.imageArray.length>0){for(var V=0;V<P.imageArray.length;V++){var U="#gallerylightbox-jquery-lightbox-thumbnails-image-"+V;jQuery(U).data("index",V);jQuery(U).unbind().bind("click",function(W){F(jQuery(this).data("index"));return false})}}}function H(W,V){for(var U=W.first;U<=W.last;U++){if(W.has(U)){continue}if(U>P.imageArray.length){break}W.add(U,S(U-1))}A();B=W;j()}function s(V,U){jQuery(".jcarousel-clip-horizontal",jQuery("#gallerylightbox-jquery-lightbox")).css({width:parseInt(P.width)-50-50});V.next();B=V}function G(){jQuery("#gallerylightbox-jquery-lightbox-thumbnails").jcarousel({scroll:r(),initCallback:s,size:P.imageArray.length,itemLoadCallback:H})}function f(){if(P.imageArray.length>1&&P.showThumbnails==true){jQuery("#gallerylightbox-jquery-lightbox-thumbnails-box").html('<ul id="gallerylightbox-jquery-lightbox-thumbnails" class="jcarousel-skin-ie7"></ul>');jQuery("#gallerylightbox-jquery-lightbox-thumbnails-box").css({width:parseInt(P.width)});jQuery("#gallerylightbox-jquery-lightbox-thumbnails").css({width:parseInt(P.width)});G();A();j();jQuery(".jcarousel-next",jQuery("#gallerylightbox-jquery-lightbox")).unbind().bind("click",function(){return false});jQuery(".jcarousel-prev",jQuery("#gallerylightbox-jquery-lightbox")).unbind().bind("click",function(){return false});jQuery("#gallerylightbox-jquery-lightbox-thumbnails-box").unbind().bind("click",function(){return false})}else{jQuery("#gallerylightbox-jquery-lightbox-thumbnails-box").html("")}}function r(){var V=75;if(P.thumbnailWidth>=0){V=parseInt(P.thumbnailWidth)}var U=parseInt((parseInt(P.width)-50-50)/(V+7));return U}function J(){jQuery("#gallerylightbox-lightbox-loading").show();if(P.useIframeLoader==true){jQuery("#divIframe").html('<IFRAME id="iframePreloader" width="0" height="0" src="" border="0" />');jQuery("#gallerylightbox-lightbox-container-image").html('<img id="gallerylightbox-lightbox-image" src="" style="display: none" />');jQuery("iframe#iframePreloader").onload=function(){};jQuery("iframe#iframePreloader").load(function(){jQuery("#gallerylightbox-lightbox-image").onload=function(){};jQuery("#gallerylightbox-lightbox-image").load(function(){w(jQuery("#gallerylightbox-lightbox-image").width(),jQuery("#gallerylightbox-lightbox-image").height());if(v==false){f();v=true}jQuery("#gallerylightbox-lightbox-image").onload=function(){}});jQuery("#gallerylightbox-lightbox-image").attr("src",jQuery("iframe#iframePreloader").contents().find("#imageId").attr("href"));jQuery("iframe#iframePreloader").onload=function(){}});jQuery("iframe#iframePreloader").attr("src",P.imageArray[P.activeImage].ImageUrl)}else{jQuery("#gallerylightbox-lightbox-container-image").html('<img id="gallerylightbox-lightbox-image" src="" style="display: none" />');jQuery("#gallerylightbox-lightbox-image").onload=function(){};jQuery("#gallerylightbox-lightbox-image").load(function(){w(jQuery("#gallerylightbox-lightbox-image").width(),jQuery("#gallerylightbox-lightbox-image").height());if(v==false){f();v=true}jQuery("#gallerylightbox-lightbox-image").onload=function(){}});jQuery("#gallerylightbox-lightbox-image").attr("src",P.imageArray[P.activeImage].ImageUrl)}if(P.showThumbnails==true){n()}if(P.slideShowOn==true){C()}}function C(){clearInterval(x);x=setInterval(o,P.slideShowDelay*1000)}function a(){clearInterval(x)}function R(W){var V=(/MSIE ((5\.5)|6)/.test(navigator.userAgent)&&navigator.platform=="Win32");if(V){var X=new Image();X.src=P.imageBlank;var U=W.src;if(!W.style.width){W.style.width=$(W).width()}if(!W.style.height){W.style.height=$(W).height()}W.onload=function(){};W.src=X.src;W.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+U+"',sizingMethod='scale')"}}function N(){var U=(/MSIE ((5\.5)|6)/.test(navigator.userAgent)&&navigator.platform=="Win32");if(U){$("img[src$=.png]").each(function(){if(!this.complete){this.onload=function(){R(this)}}else{R(this)}});$("#gallerylightbox-lightbox-nav-btnPrev").each(function(){if(!this.complete){this.onload=function(){R(this)}}else{R(this)}})}}function c(){if((B.first-1)>P.activeImage){B.prev();setTimeout(c,100)}else{if(B.first+r()<=P.activeImage+1){B.next();setTimeout(c,100)}}}function j(){jQuery(".jcarousel-item",jQuery("#gallerylightbox-jquery-lightbox")).removeClass("jcarousel-itemselected");jQuery("#gallerylightbox-jquery-lightbox-thumbnails-image-"+P.activeImage).parent().addClass("jcarousel-itemselected")}function n(){if(B){c()}j()}function w(V,X){var W=V+(P.containerBorderSize*2);var U=X+(P.containerBorderSize*2);jQuery("#gallerylightbox-gallerylightbox-lightbox-container-image-box").css({width:W,height:U});jQuery("#gallerylightbox-lightbox-container-image").css({width:W,top:((jQuery("#gallerylightbox-lightbox-container-box").height()/2)-(X/2))});h()}function h(){jQuery("#gallerylightbox-lightbox-loading").hide();jQuery("#gallerylightbox-lightbox-image").show();T();D();b();N();if(P.useIframeLoader!=true){E()}}function D(){if(P.showImageInfo==true){jQuery("#gallerylightbox-lightbox-container-image-data-box").html('<div id="gallerylightbox-lightbox-container-image-data"><div id="gallerylightbox-lightbox-image-details" class="gallerylightbox-lightbox-image-details"><div id="gallerylightbox-lightbox-image-details-title"></div><div id="gallerylightbox-lightbox-image-details-description"></div></div><div id="gallerylightbox-lightbox-image-details2" class="gallerylightbox-lightbox-image-details"><div id="gallerylightbox-lightbox-image-details-author"></div><div id="gallerylightbox-lightbox-image-details-currentNumber"></div></div></div>');jQuery("#gallerylightbox-lightbox-image-details-title").html(P.imageArray[P.activeImage].Title);jQuery("#gallerylightbox-lightbox-image-details-description").html(P.imageArray[P.activeImage].Description);jQuery("#gallerylightbox-lightbox-container-image-data-box").show();jQuery("#gallerylightbox-lightbox-container-image-data-box").unbind().bind("click",function(){o();return false})}else{jQuery("#gallerylightbox-lightbox-container-image-data-box").html('<div id="gallerylightbox-lightbox-container-image-data"><div id="gallerylightbox-lightbox-image-details2" class="gallerylightbox-lightbox-image-details"><div id="gallerylightbox-lightbox-image-details-author"></div><div id="gallerylightbox-lightbox-image-details-currentNumber"></div></div></div>')}var V="-";if(P.imageArray[P.activeImage].Author!=null&&P.imageArray[P.activeImage].Author.length>0){V=P.imageArray[P.activeImage].Author}var U="-";if(P.imageArray[P.activeImage].Origin!=null&&P.imageArray[P.activeImage].Origin.length>0){U=P.imageArray[P.activeImage].Origin}jQuery("#gallerylightbox-lightbox-image-details-author").html('<span class="gallerylightbox-lightbox-image-details-author-label">'+P.textAuthorLabel+": </span>"+V+'&nbsp;&nbsp;|&nbsp;&nbsp;<span class="gallerylightbox-lightbox-image-details-author-label">'+P.textOriginLabel+": </span>"+U);if(P.imageArray.length>1){jQuery("#gallerylightbox-lightbox-image-details-currentNumber").html(P.txtImage+" "+(P.activeImage+1)+P.txtImageOf+P.imageArray.length).show()}}function b(){if(P.showVoting==true&&P.imageArray[P.activeImage].Id!=null&&parseInt(P.imageArray[P.activeImage].Id)>0){var V="";for(var U=1;U<=5;U++){var W=(P.imageArray[P.activeImage].Rating>=U)?P.imageStar:P.imageStarInactive;V=V+'<img id="gallerylightbox-lightbox-image-details-voting-star_'+U+"\" src='"+W+'\' class="gallerylightbox-lightbox-image-details-voting-star" style="visibility: visible" align="absmiddle" />'}jQuery("#gallerylightbox-lightbox-image-details-voting").html(P.txtVoteForImage+" "+V+" ("+P.imageArray[P.activeImage].VoteCount+" "+P.txtVotes+")");if(P.imageArray[P.activeImage].IsVoted!=true){jQuery(".gallerylightbox-lightbox-image-details-voting-star").hover(function(){var Z=jQuery(this);var X=parseInt(Z[0].id.substring(51));for(var Y=1;Y<=5;Y++){if(Y<=X){jQuery("#gallerylightbox-lightbox-image-details-voting-star_"+Y).attr("src",P.imageStarHover)}else{var aa=(P.imageArray[P.activeImage].Rating>=Y)?P.imageStar:P.imageStarInactive;jQuery("#gallerylightbox-lightbox-image-details-voting-star_"+Y).attr("src",aa)}N()}},function(){var Z=jQuery(this);var X=parseInt(Z[0].id.substring(51));for(var Y=1;Y<=5;Y++){var aa=(P.imageArray[P.activeImage].Rating>=Y)?P.imageStar:P.imageStarInactive;jQuery("#gallerylightbox-lightbox-image-details-voting-star_"+Y).attr("src",aa);N()}});jQuery(".gallerylightbox-lightbox-image-details-voting-star").click(function(){var Y=jQuery(this);var X=parseInt(Y[0].id.substring(51));p(P.imageArray[P.activeImage].Id,X);N();return false})}}}function p(U,V){SnT.Cms2.Modules.GalleryService.VoteForImage(U,V,P.activeImage,z,L,Q);return false}function z(U){if(U&&U.IsSaved==true){P.imageArray[U.FileIndex].VoteCount++;P.imageArray[U.FileIndex].VoteSum=P.imageArray[U.FileIndex].VoteSum+U.Grade;P.imageArray[U.FileIndex].Rating=parseInt(P.imageArray[U.FileIndex].VoteSum/P.imageArray[U.FileIndex].VoteCount);P.imageArray[U.FileIndex].IsVoted=true;b();N();return false}}function L(U){return false}function Q(U){return false}function T(){if(P.imageArray.length>1){jQuery("#gallerylightbox-lightbox-nav").unbind().bind("click",function(){o();return false}).show().hoverIntent(l);d()}else{jQuery("#gallerylightbox-lightbox-nav").hide()}u()}function F(U){if(P.activeImage!=U){P.activeImage=U;J()}}function M(){P.activeImage=P.activeImage-1;if(P.activeImage<0){P.activeImage=P.imageArray.length-1}J()}function o(){P.activeImage=P.activeImage+1;if(P.activeImage>(P.imageArray.length-1)){P.activeImage=0}J()}function u(){jQuery(document).unbind().keydown(function(U){k(U)})}function t(){jQuery(document).unbind().keydown(function(W){var U=W.keyCode;var V=String.fromCharCode(U).toLowerCase();if((V==P.keyToClose)||(V=="x")||(U==27)){I()}})}function k(W){var U=W.keyCode;var V=String.fromCharCode(U).toLowerCase();if((V==P.keyToClose)||(V=="x")||(U==27)){I()}if(P.imageArray.length>1){if((V==P.keyToPrev)||(U==37)){M();t()}if((V==P.keyToNext)||(U==39)){o();t()}}}function E(){if((P.imageArray.length-1)>P.activeImage){objNext=new Image();objNext.src=P.imageArray[P.activeImage+1].ImageUrl}if(P.activeImage>0){objPrev=new Image();objPrev.src=P.imageArray[P.activeImage-1].ImageUrl}}function I(){if(!P.isInsideDiv){a();jQuery("#gallerylightbox-jquery-lightbox").remove();jQuery("#gallerylightbox-jquery-overlay").fadeOut(function(){jQuery("#gallerylightbox-jquery-overlay").remove()});if(P.removeBanners==true){$("embed, object, select, iframe, div[id^=banner], span[id^=banner]").css({visibility:"visible"})}jQuery(document).onkeydown=function(){}}}function y(){var W,U;if(window.innerHeight&&window.scrollMaxY){W=window.innerWidth+window.scrollMaxX;U=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){W=document.body.scrollWidth;U=document.body.scrollHeight}else{W=document.body.offsetWidth;U=document.body.offsetHeight}}var V,X;if(self.innerHeight){if(document.documentElement.clientWidth){V=document.documentElement.clientWidth}else{V=self.innerWidth}X=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){V=document.documentElement.clientWidth;X=document.documentElement.clientHeight}else{if(document.body){V=document.body.clientWidth;X=document.body.clientHeight}}}if(U<X){pageHeight=X}else{pageHeight=U}if(W<V){pageWidth=W}else{pageWidth=V}arrayPageSize=new Array(pageWidth,pageHeight,V,X);return arrayPageSize}function q(){var V,U;if(self.pageYOffset){U=self.pageYOffset;V=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){U=document.documentElement.scrollTop;V=document.documentElement.scrollLeft}else{if(document.body){U=document.body.scrollTop;V=document.body.scrollLeft}}}arrayPageScroll=new Array(V,U);return arrayPageScroll}function K(W){var V=new Date();U=null;do{var U=new Date()}while(U-V<W)}m()}function ShowLightboxFromImages(e,a,c){var d=jQuery.extend({galleryInfo:a,imageArray:e},c);var b=false;jQuery(document).ready(function(){b=true});if(b==true){var f=new Lightbox(d)}}function ShowLightboxFromGalleryId(e,c){var d=jQuery.extend({galleryInfo:GalleryInfo,activeImage:0,imageFormatId:galleryLightboxDefaults.ImageFormatId,thumbnailFormatId:galleryLightboxDefaults.ThumbnailFormatId,imageWidth:galleryLightboxDefaults.ImageWidth,imageHeight:galleryLightboxDefaults.ImageHeight,thumbnailPageUrl:galleryLightboxDefaults.ThumbnailPageUrl,thumbnailWidth:galleryLightboxDefaults.ThumbnailWidth,thumbnailHeight:galleryLightboxDefaults.ThumbnailHeight,useIframeLoader:galleryLightboxDefaults.useIframeLoader,imageLoaderPage:galleryLightboxDefaults.ImageLoaderPage},c);f(e);function f(h){SnT.Cms2.Modules.GalleryService.GetList(h,g,a,b)}function g(r){var m=r;if(m){var q=new GalleryInfo();q.Id=m.Id;q.Title=m.Title;q.Description=m.Description;d.galleryInfo=q;var h=new Array();if(m.Items!=null&&m.Items.length>0){for(var n=0;n<m.Items.length;n++){var k=new ImageInfo();k.Id=m.Items[n]["Id"];k.Title=m.Items[n].Title;k.Description=m.Items[n]["Description"];k.Author=m.Items[n]["Author"];k.Origin=m.Items[n]["Origin"];k.Rating=m.Items[n]["Rating"];k.VoteCount=m.Items[n]["VoteCount"];k.VoteSum=m.Items[n]["VoteSum"];var p=d.thumbnailPageUrl;var j=d.thumbnailPageUrl;if(d.useIframeLoader==true){p=d.imageLoaderPage}p=p.replace("{0}",m.Items[n]["ResourceId"]);p=p.replace("{1}",d.imageFormatId);if(d.imageWidth>0){p+="&width="+d.imageWidth}if(d.imageHeight>0){p+="&height="+d.imageHeight}p+="&galleryId="+q.Id;k.ImageUrl=p;j=j.replace("{0}",m.Items[n]["ResourceId"]);j=j.replace("{1}",d.thumbnailFormatId);if(d.thumbnailWidth>0){j+="&width="+d.thumbnailWidth}if(d.thumbnailHeight>0){j+="&height="+d.thumbnailHeight}k.ThumbnailUrl=j;h[n]=k}d.imageArray=h;var o=false;jQuery(document).ready(function(){o=true});if(o==true){var l=new Lightbox(d)}}}}function a(h){return false}function b(h){return false}};
