$(document).ready(function() {
	$('.widget_select #image').live('click', function(){
		$('.widget_list').slideDown('slow', function(){
		});
	});
	
	$('#club_choose #image').live('click', function(){
		$.post("club/list-widget", {}, function(data){
			$('.widget_club_list').html(data);
			$('.widget_club_list').slideDown('slow');
		});
	});
	
	$('.widget_href').click(function(){
		$('#text_widget').val($(this).html());
		$('#text_widget').attr('widget', $(this).attr('widget'));
		$('.widget_list').fadeOut();
		if ($(this).html()=='Информация о клубе'){
			$('#club_choose').fadeIn();
		}
		else
		{
			$('#club_choose').hide();
		}
	});
	
	$('.widget_club_href').live('click', function(){
		$('#text_club_widget').val($(this).html());
		$('#text_club_widget').attr('number', $(this).attr('number'));
		$('.widget_club_list').fadeOut();
	});
	
	$('.widget_list, .widget_club_list').mouseleave(function(){
		$(this).fadeOut();
	});
	
	$('.edit_panel').click(function(){
		if ($(this).find('#image_slide_re').css('display')=='none') 
		{
			$(this).find('.edit_menu').slideDown();
			$(this).find('#image_slide').hide();
			$(this).find('#image_slide_re').show();
		}
		else
		{
			$(this).find('.edit_menu').slideUp();
			$(this).find('#image_slide').show();
			$(this).find('#image_slide_re').hide();
		}
	});
	
	$('#registr_href a').click(function(){
		$.post('http://smartgames.kkr.ru/index/reg', function(data){
			$('#reg').html(data);
			$('#reg').fadeIn();
		});
	});
	
	$('.meeple_more').hover(
	function(){
		$(this).siblings('#meeple_calc').show();
	},
	function(){
		$(this).siblings('#meeple_calc').hide();
	});
});

