nnn
n
n
n
n
n
n
n
n
n
n
n
n
nn'};this.popupLargeGallery=function(){var g,window_name,width,height,tmp={};if((gallery.config.gallery.large.size.width",serialize(tmp)));g.document.title=gallery.config.service_name;g.document.close()};this.initGallery=function(){var lis,thumbs="";new ImagePreloader(gallery.config.pictures.small,function(){gallery.config.pictures.small.each(function(x,i){gallery.cache.small[i]=true})});if(gallery.images_count>1){gallery.config.pictures.small.each(function(pic){thumbs+='
n'})}if(gallery.config.type=="small"){if(gallery.images_count>1){$(gallery.config.target_div).innerHTML=html.small.replace("",thumbs)}else{$(gallery.config.target_div).innerHTML=html.small_single}if(gallery.images_count>1){$("gallery-photo").onclick=function(){gallery.popupLargeGallery()}}if($("gallery-trigger")){$("gallery-trigger").onclick=function(){gallery.popupLargeGallery();return false}}if($("next-photo")){$("next-photo").onclick=function(){if(gallery.config.active0){gallery.config.active--}return false}}}else{$("gallery-thumbs").innerHTML=thumbs;$("gallery-photo").onclick=function(){window.close()}}if(gallery.images_count>1){getElements($("gallery-thumbs").getElementsByTagName("li")).each(function(li,i){if(i==gallery.config.active){addClass(li,"active")}li.onclick=function(){gallery.config.active=i;return false}});this.watchOutFor("gallery.config.active",function(){var lis=$("gallery-thumbs").getElementsByTagName("li");removeClass(lis[arguments[0]],"active");addClass(lis[arguments[1]],"active");if($("prev-photo")&&$("prev-photo")){if(arguments[1]==gallery.images_count-1){$("next-photo").style.visibility="hidden";$("prev-photo").style.visibility="visible"}else{if(arguments[1]==0){$("prev-photo").style.visibility="hidden";$("next-photo").style.visibility="visible"}else{$("next-photo").style.visibility="visible";$("prev-photo").style.visibility="visible"}}}gallery.showPhoto(arguments[1])})}gallery.showPhoto(gallery.config.active)};this.showPhoto=function(id){if(gallery.config.pictures.medium&&gallery.config.pictures.medium.length>0&&gallery.config.type=="small"){gallery.showImage("medium",id,$("gallery-photo"),function(){if(gallery.images_count>1){resizePhoto($("gallery-photo"),gallery.config.gallery.small.image_size.width,gallery.config.gallery.small.image_size.height)}})}else{gallery.showImage("large",id,$("gallery-photo"),function(){resizePhoto($("gallery-photo"),gallery.config.gallery.large.image_size.width,gallery.config.gallery.large.image_size.height)})}gallery.config.active=id};this.showImage=function(size,img_no,el){var funkcja;(arguments.length==4&&typeof(arguments[3])=="function")?funkcja=arguments[3]:funkcja=false;if(gallery.cache[size][img_no]){if(el){el.removeAttribute("height");el.removeAttribute("width");el.src=gallery.config.pictures[size][img_no]}if(funkcja){funkcja()}}else{if(gallery.config.type=="large"){if(gallery.config.gallery.large.overlay){$("gallery-overlay").style.visibility="visible"}}new ImagePreloader([gallery.config.pictures[size][img_no]],function(){var i;gallery.cache[size][img_no]=true;if(el){el.removeAttribute("height");el.removeAttribute("width");el.src=gallery.config.pictures[size][img_no]}if(funkcja){funkcja()}if(gallery.config.type=="large"){if(gallery.config.gallery.large.overlay){$("gallery-overlay").style.visibility="hidden"}}})}};this.watchOutFor=function(prop,func){var old_value=eval(prop),new_value;setInterval(function(){new_value=eval(prop);if(new_value!=old_value)
{func(old_value,new_value);old_value=new_value}},50)};gallery.initGallery()};
//-->