	$(document).ready(function(){
			if (!$('#anketa').hasClass("errors"))
			{
				$('#anketa').hide()
				$('<div id="anketa-button"></div>').insertAfter('#intro').click(function(){
																						$(this).remove()
																						$('#anketa').slideToggle()
																						})
				$('.anketa-text-button').click(function(){
														$('#anketa-button').click()
														return false
														
														})
			}
	
	var sc = 0
	var scrolls = $('.blog-entry').length - 3
	$('#prev-blog').addClass('inactive')
	
	$('#next-blog').click(function(){
								   if (sc < scrolls) {
										sc++
										$('#blog-scroller').animate({left: "-=330px"}, 500 )
										$('#prev-blog').removeClass('inactive')
										if (sc == scrolls) {$(this).addClass('inactive')}
								   }
								   })
	
	$('#prev-blog').click(function(){
								   if (sc > 0) {
										sc--
										$('#blog-scroller').animate({left: "+=330px"}, 500 )
										$('#next-blog').removeClass('inactive')
										if (sc == 0) {$(this).addClass('inactive')}
								   }
								   })
	
	$('#all-blog').toggle(function(){
								   $('#blog-scroller').stop().css({ "width":"1020px", "left":"0"})
								   $('.blog-entry').css({ "height":"380px"})
								   $('#all-blog').addClass('collapsed').text('Скрыть')
								   $('#prev-blog, #next-blog').hide()
								   },function(){
									   sc = 0
									$('#blog-scroller').css({ "width":"10000px"})
								   $('.blog-entry').css({ "height":"auto"})
								   $('#all-blog').removeClass('collapsed').text('Все записи')
								   $('#prev-blog, #next-blog').show().removeClass('inactive')
								   $('#prev-blog').addClass('inactive')
									})
	
	
	
	var sc2 = 0
	var scrolls2 = $('.selection-entry').length - 3
	$('#prev-selection').addClass('inactive')
	
	$('#next-selection').click(function(){
								   if (sc2 < scrolls2) {
										sc2++
										$('#selection-scroller').animate({left: "-=330px"}, 500 )
										$('#prev-selection').removeClass('inactive')
										if (sc2 == scrolls2) {$(this).addClass('inactive')}
								   }
								   })
	
	$('#prev-selection').click(function(){
								   if (sc2 > 0) {
										sc2--
										$('#selection-scroller').animate({left: "+=330px"}, 500 )
										$('#next-selection').removeClass('inactive')
										if (sc2 == 0) {$(this).addClass('inactive')}
								   }
								   })
	
	$('#all-selection').toggle(function(){
								   $('#selection-scroller').stop().css({ "width":"1020px", "left":"0"})
								   $('.selection-entry').css({ "height":"300px"})
								   $('#all-selection').addClass('collapsed').text('Скрыть')
								   $('#prev-selection, #next-selection').hide()
								   },function(){
									   sc2 = 0
									$('#selection-scroller').css({ "width":"10000px"})
								   $('.selection-entry').css({ "height":"auto"})
								   $('#all-selection').removeClass('collapsed').text('Все записи')
								   $('#prev-selection, #next-selection').show().removeClass('inactive')
								   $('#prev-selection').addClass('inactive')
									})
	
	$('.votes-wrapper:gt(0)').hide().before('<span class="show-winners">Показать &darr;</span>')
		$('.show-winners').click(function(){
							$(this).hide().next('.votes-wrapper').slideDown('fast')
						})
	$('.winners h3').click(function(){$(this).next('.show-winners').click()})
	})
