window.addEvent('domready', function() {

	$$('form').each(function(item) {
		new Form.Validator.Inline(item, {
			'scrollToErrorsOnSubmit': false,
			'scrollToErrorsOnBlur': false,
			'scrollToErrorsOnChange': false			
		});
	});

	$$('.overtext').each(function(item) {
		new OverText(item);
	});
	
	$$('.gallery_wrapper').each(function(item) {
		new Fx.Animate.Scroll(item, 'ul', {
			perStep: 1,
			autoplay: false
		});
	});
	
	$$('.block-sponsors ul').each(function(item) {
		new Fx.Animate.Fade(item, 'li', {
		});
	});
	
	$$('.block-brandbox ul.news').each(function(item) {
		new Fx.Animate.Fade(item, 'li', {
			autoplay: true,
			onNavigate: function(from, to) {
				document.id('brandbox_paging_'+from).removeClass('active');
				document.id('brandbox_paging_'+to).addClass('active');
			}
		});
	});
	
	$$('.block-artists ul.news').each(function(item, index) {
		new Fx.Animate.Scroll(item, 'li', {
			autoplay: false,
			direction: 'top',
			onNavigate: function(from, to) {
				document.id('artists_paging_'+from).removeClass('active');
				document.id('artists_paging_'+to).addClass('active');
			}
		});
	});
	
	$$('.news .share').addEvent('click', function(e) {
		if(e) e.stop();
		var a = this.getParent('.article');
		if(!a) return;
		var b = a.getElement('.share-buttons');
		if(!b) return;
		b.toggleClass('hidden');
	});
});
