
Shadowbox.init({
	language: 'ru',
	adapter: 'mootools',
	skipSetup: true,
	players:  ['img', 'html', 'iframe']
});
window.addEvent('domready', function() {



	// включаем shadowbox
  var Shadowbox_options = {
    resizeDuration: 0.2,
    fadeDuration: 0.2,
    viewportPadding: 10,
    handleOversize: 'drag',
    overlayOpacity: 0.5,
    viewportPadding: 5,
    autoDimensions: true,
		animate: false
  };

      
	list = $$(document.links);
  list = list.filter(function(item){
  	//if (item.hasClass('no')) return false;
    return item.href.test(/\.(jpe?g|png|gif)$/)
  });
  if (list && list.length) {
		Shadowbox.setup(list, Shadowbox_options);
  }
  
  new SmoothScroll({
  	onStart: function() {
  		if (this.oldanchor) {
  			this.oldanchor.removeClass('anchored');
  		}
  		this.oldanchor = $(this.anchor).addClass('anchored');
  		try {
  			var testh2 = $(this.anchor).getParent().getParent().getParent().getPrevious();
  			if (testh2.hasClass('shownext') && testh2.closd) {
  				testh2.fireEvent('click', {'stop': function(){} });
  				this.cancel();
  				this.toElement(this.anchor);
  			}
  		} catch(ex) {}

  	}
  });

  



});
