window.addEvent('domready', function(){
	
	if($('snapshot-container')) {
	
		new SimpleGallery('snapshot-container', 'snapshot-prev', 'snapshot-next');
	}
	
	if($('top-story')) {
		
		new ArticlePreview('top-story', 'ts-content', 'hidden', 5000);
	}
	
	if($('photo-block')) {
		
		new ArticlePreview('photo-block', 'ph-content', 'hidden', 5000);
	}
	
	if($('inner-quote') && $('inner-quote-expander')) {
		
		new Expander('inner-quote', 'inner-quote-expander');
	}
	
	$$('a.js-popup').each(function(link){
		new Popup(link, 'hidden');
	});
	
	if($('phg-items')) {
		new Gallery('phg-items', 'phg-prev', 'phg-next', 'phg-counter', 'hidden', 'phg-sketch');
	}
	
	if($('br-stories')) {
		new BreakingStories('br-stories', 60000);
	}
	
	new Clicable('clicable', 'filled');
	
	if($('password') && $('password-txt')) {
		new PwdSwitcher('password', 'password-txt', 'hidden', 'filled');
	}
	
	if($('reg-conf-password') && $('reg-conf-password-txt')) {
		new PwdSwitcher('reg-conf-password', 'reg-conf-password-txt', 'hidden', 'filled');
	}
	
	if($('reg-password') && $('reg-password-txt')) {
		new PwdSwitcher('reg-password', 'reg-password-txt', 'hidden', 'filled');
	}
	
	if($('pr-conf-password') && $('pr-conf-password-txt')) {
		new PwdSwitcher('pr-conf-password', 'pr-conf-password-txt', 'hidden', 'filled');
	}
	
	if($('pr-password') && $('pr-password-txt')) { 
		new PwdSwitcher('pr-password', 'pr-password-txt', 'hidden', 'filled');
	}
	
	new CustomCheckbox('checkbox', 'checked');
	
	if($$('.radio').length && $$('.radio-group').length) { 
		new CustomRadio('radio', 'radio-checked');
	}
	
});
