//actions


$(document).ready(function(){
	
	$('a.change_ban_ip').click(function(){
		var th = $(this);
		var url = $(this).attr('href');
		$.ajax({
			url: url,
			method: "GET",
			success: function(data){
				var dt = $('data', data);
				var msg = $('message', dt).text();
				alert(msg);
				var rep = $('replace_block', dt).text();
				$(th).html(rep);
			}
		});
		
		return false;
	});
	
	

	$('a.expand_solution').click(function(){
		if($(this).next('div').is(':hidden')){
			$(this).next('div').show();
		}else{
			$(this).next('div').hide();
		}
	});


	$('a.expand_solution3').click(function(){
		if($(this).parent().next('div').is(':hidden')){
			$(this).parent().next('div').show();
		}else{
			$(this).parent().next('div').hide();
		}
	});

	$('a.expand_solution2').click(function(){
		if($(this).parent().parent().next('tr').is(':hidden')){
			$(this).parent().parent().next('tr').show();
		}else{
			$(this).parent().parent().next('tr').hide();
		}
	});

	$('a.add_answer').click(function(){
		$('div.sh_bl').show();
	});

	$('a.close_answer').click(function(){
		$('div.sh_bl').hide();
	});


	$('a.spoiler_opener').click(function(){
		$(this).parent().siblings('div.spoiler_content').each(function(){$(this).find('div.spoiler_body:visible').slideUp('fast')});
		$(this).next('div.spoiler_body').slideDown('fast');
	});




});
