var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); var x = 1; var scrollInterval; var scrollEnabled = false; function photoInfo(src, title, description) { this.src = src; this.description = description; this.title = title; } function scrollAlbumsLeft() { scrollEnabled = true; scrollInterval = setInterval("scrollAlbum(0)", 10); } function scrollAlbumsRight() { scrollEnabled = true; scrollInterval = setInterval("scrollAlbum(1)", 10); } function scrollAlbum(direction) { if ( !scrollEnabled ) { clearInterval(scrollInterval); return; } var obj = document.getElementById("albums-top"); var left = obj.scrollLeft; var width = obj.scrollWidth-obj.clientWidth; if ( direction ) { if ( left > 0 ) obj.scrollLeft -= 1; } else { if ( left < width ) obj.scrollLeft += 1; } } function stopScroll() { scrollEnabled = false; } // ------------------------------- var atrow = 6; var id = 0; var next_id = 0; var slideInterval; var slideron = false; var foto = new Array(); var cached = new Array(); var loaded = new Array(); function initAlbum() { var cnt = document.getElementById("counter"); if ( cnt ) { if ( cnt.childNodes.length > 0 ) cnt.removeChild(cnt.firstChild); cnt.appendChild( document.createTextNode("( " + (id+1) + " из " + + foto.length + " изображений )" ) ); } var bigp = document.getElementById("bigpic"); if ( cached[id] && loaded[id] == 1 ) { bigp.src = cached[id].src; bigp.alt = cached[id].alt; } else { bigp.src = foto[id][0].src; bigp.alt = foto[id][0].title; cached[id] = new Image(); cached[id].src = foto[id][0].src; cached[id].alt = foto[id][0].title; next_id = id; loaded[id] = 0; cached[id].onload = setLoaded; } var bigp_title = document.getElementById("bigpic_title"); if ( bigp_title ) { if ( bigp_title.childNodes.length > 0 ) bigp_title.removeChild(bigp_title.firstChild); bigp_title.appendChild( document.createTextNode(bigp.alt ) ); } if ( foto[id+1] && !cached[id+1] ) { cached[id+1] = new Image(); cached[id+1].src = foto[id+1][0].src; cached[id+1].alt = foto[id+1][0].title; next_id = id + 1; loaded[next_id] = 0; cached[id+1].onload = setLoaded; } var obj = document.getElementById("thumbs"); var max = (foto.length - id) < atrow ? foto.length : id + atrow; var x = 1; for( i = id; i < max; i++ ) setThumb(x++, i); max = atrow-x; if ( x <= atrow ) for( j = 0; j <= max; j++ ) setThumb(x++, j); } function setLoaded() { loaded[next_id] = 1; } function setThumb(i, j) { var _a = document.getElementById('a'+i); _a.setAttribute("href", 'javascript:switchFoto('+j+');' ); var _img = document.getElementById('img'+i); _img.setAttribute("src", foto[j][1].src ); _img.setAttribute("alt", foto[j][1].title ); _img.setAttribute("border", '0'); } function switchFoto(indx) { id = indx; initAlbum(); } function slideShow() { if ( slideron ) stepRight(); else clearInterval(slideInterval); } function slideSwitch() { slideron = !slideron; var obj = document.getElementById("slider"); if (obj ) { if ( obj.childNodes.length > 0 ) obj.removeChild(obj.firstChild); obj.appendChild( document.createTextNode(slideron ? 'выключить слайд-шоу' : 'включить слайд-шоу') ); } var obj = document.getElementById("slider2"); if (obj ) { if ( obj.childNodes.length > 0 ) obj.removeChild(obj.firstChild); obj.appendChild( document.createTextNode(slideron ? 'выключить слайд-шоу' : 'включить слайд-шоу') ); } if ( slideron ) slideInterval = setInterval("slideShow()", 5000); } function stepLeft() { if ( id == 0 ) { switchFoto(foto.length - 1); } else { switchFoto(id-1); } } function stepRight() { if ( id+1 == foto.length){ switchFoto(0); }else if ( loaded[id+1]==1) { switchFoto(id+1); } } }