var cs;if(cs){if(typeof cs!=object)throw Error('The object "cs" is already defined!');}else cs={};(function(){cs.test=function(){alert("Everything is working.")}})();if(cs.photo){if(typeof cs.photo!=object)throw Error('The object "cs.diaporama" is already defined!');}else cs.photo={};
(function(){cs.photo.makeDiaporama=function(){return{data:null,size:0,showTime:3E3,fadeInTime:1E3,fadeOutTime:1E3,nextImgToCache:2,getPeriod:function(){return this.showTime+this.fadeInTime+this.fadeOutTime},startEndlessSlideShow:function(d){$("#cs_gallery").hide();var a=this;$.get(d,function(b){a.data=b;a.size=parseInt(b.documentElement.attributes[0].value);a.showTime=parseInt(b.documentElement.attributes[1].value);a.fadeInTime=parseInt(b.documentElement.attributes[2].value);a.fadeOutTime=parseInt(b.documentElement.attributes[3].value);
$("#cs_gallery").fadeIn(a.fadeInTime);setInterval(function(){$("#cs_gallery").fadeOut(a.fadeOutTime,function(){var c=$("#cs_gallery").attr("current_img");c++;c>a.size-1&&(c=0);var b=a.data.getElementsByTagName("src"),d=b[c].childNodes[0].nodeValue;$("#cs_gallery").attr("current_img",c);$("div#cs_gallery > img#cs_screen").attr("src",d);if(a.nextImgToCache<a.size-1)a.nextImgToCache++,c=b.item(a.nextImgToCache).textContent,$("div#cs_gallery > img#cs_cache").attr("src",c)});$("#cs_gallery").fadeIn(a.fadeInTime)},
a.getPeriod())},"xml")}}}})();
