var GalleryThumbsHolder=null;function GalleryHideLoader(){var a=document.getElementById("fsimagediv").getElementsByTagName("img")[1];a.style.display="none"}function GalleryShowLoader(){var a=document.getElementById("fsimagediv").getElementsByTagName("img")[1];a.style.display="block"}function f_scrollTop(){return f_filterResults(window.pageYOffset?window.pageYOffset:0,document.documentElement?document.documentElement.scrollTop:0,document.body?document.body.scrollTop:0)}function f_filterResults(d,b,a){var c=d?d:0;if(b&&(!c||(c>b))){c=b}return a&&(!c||(c>a))?a:c}function GalleryFSFixedIE6FixScrool(){var a=f_scrollTop();document.getElementById("fsimagediv").style.top=(a+10)+"px"}function GalleryOpenFSImage(g){GalleryThumbsHolder=g.parentNode.parentNode;var a=document.getElementById("pageblenddiv");if(a==null){a=document.createElement("div");a.className="pageblend";a.id="pageblenddiv";if(!IsIE78Moz()){a.style.position="absolute";if(parseInt(document.body.clientHeight)>parseInt(document.documentElement.clientHeight)){a.style.height=parseInt(document.body.clientHeight)+"px"}else{a.style.height=parseInt(document.documentElement.clientHeight)+"px"}}a.onclick=function(){GalleryCloseFSImage(null)};document.body.appendChild(a)}if(IsIE78Moz()){if(typeof Animator=="function"){var h=null;a.style.filter="alpha(opacity=0)";a.style.opacity="0";a.style.MozOpacity="0";a.style.display="block";h=new Animator({duration:500});h.addSubject(new NumericalStyleSubject(a,"opacity",0,0.7));h.seekTo(1)}else{a.style.display="block"}}else{a.style.display="block"}var c=g.getAttribute("href");var f=g.getAttribute("alt");var d=document.getElementById("fsimagediv");if(d==null){if(typeof(window.innerWidth)=="number"){winheight=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){winheight=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){winheight=document.body.clientHeight}}}settoppos=Math.round((parseInt(winheight)/2)-240);maxwinheight=parseInt(winheight);if(settoppos<5){settoppos=5}var b=GalleryThumbsHolder.getAttribute("fswindowclosecaption");if(b==null){b="zapri"}maxwinheight=maxwinheight-(settoppos*2)-60;c=c.slice(0,c.indexOf("imgheight=")+10)+maxwinheight+c.slice(c.indexOf("&",c.indexOf("imgheight=")));d=document.createElement("div");d.className="cili_fsimagediv";d.id="fsimagediv";d.style.top=settoppos+"px";d.setAttribute("maxwinheight",maxwinheight);if(!IsIE78Moz()){d.style.position="absolute";var j=f_scrollTop();d.style.top=(j+settoppos)+"px";window.onscroll=function(){GalleryFSFixedIE6FixScrool()}}d.innerHTML='<a href="#" class="prevlink" onclick="GalleryPrevNext(this,\'prev\'); return false;">&#171;</a><a href="#" class="nextlink" onclick="GalleryPrevNext(this,\'next\'); return false;">&#187;</a><img src="'+c+'" onload="GalleryHideLoader();" onclick="GalleryCloseFSImage(this);" /><img src="design/ajax-loader.gif" class="imgloader" /><div class="cili_fsimagediv_imgdescription">'+f+'</div><div class="cili_fsimagediv_imgfb"><a href="#" class="closelink" onclick="GalleryCloseFSImage(this); return false;">['+b+"]</a></div>";document.body.appendChild(d)}else{var k=d.getElementsByTagName("img")[0];GalleryShowLoader();maxwinheight=parseInt(d.getAttribute("maxwinheight"));c=c.slice(0,c.indexOf("imgheight=")+10)+maxwinheight+c.slice(c.indexOf("&",c.indexOf("imgheight=")));k.src=c;var e=d.getElementsByTagName("div")[0];e.innerHTML=f}var i=parseInt(g.getAttribute("imageindex"));GalleryThumbsHolder.setAttribute("currentimageindex",i);GalleryNavRefresh();d.style.display="block"}function GalleryNavRefresh(){var e=document.getElementById("fsimagediv");var h=parseInt(GalleryThumbsHolder.getAttribute("currentimageindex"));var a=GalleryThumbsHolder.getElementsByTagName("a");var g=0;for(var f=0;f<a.length;f++){var b=a[f];if(b.getAttribute("imageindex")!=null){g=g+1}}var d=e.getElementsByTagName("a")[0];var c=e.getElementsByTagName("a")[1];if(h>1){d.style.display="block"}else{d.style.display=""}if(h<g){c.style.display="block"}else{c.style.display=""}}function GalleryPrevNext(j,i){var k=parseInt(GalleryThumbsHolder.getAttribute("currentimageindex"));var h=null;var e=GalleryThumbsHolder.getElementsByTagName("a");for(var a=0;a<e.length;a++){var f=e[a];if(i=="next"){if(parseInt(f.getAttribute("imageindex"))==parseInt(k+1)){h=f;break}}if(i=="prev"){if(parseInt(f.getAttribute("imageindex"))==parseInt(k-1)){h=f;break}}}if(h!=null){var c=document.getElementById("fsimagediv");var b=h.getAttribute("href");var g=h.getAttribute("alt");var l=c.getElementsByTagName("img")[0];GalleryShowLoader();maxwinheight=parseInt(c.getAttribute("maxwinheight"));b=b.slice(0,b.indexOf("imgheight=")+10)+maxwinheight+b.slice(b.indexOf("&",b.indexOf("imgheight=")));l.src=b;var d=c.getElementsByTagName("div")[0];d.innerHTML=g;var k=parseInt(h.getAttribute("imageindex"));GalleryThumbsHolder.setAttribute("currentimageindex",k);GalleryNavRefresh()}}function GalleryCloseFSImage(b){document.getElementById("fsimagediv").style.display="none";if(IsIE78Moz()){if(typeof Animator=="function"){var a=null;a=new Animator({duration:500,onComplete:function(){document.getElementById("pageblenddiv").style.display="none"}});a.addSubject(new NumericalStyleSubject(document.getElementById("pageblenddiv"),"opacity",0.7,0));a.seekTo(1)}else{document.getElementById("pageblenddiv").style.display="none"}}else{document.getElementById("pageblenddiv").style.display="none"}};