$(document).ready(function(){
	$.ifixpng('i/blank.gif');
	$('.iePNG').ifixpng();
	$("#voting").click(function(){
		$(".voting").each(function(){
			if($(this).is(":checked"))
			{
				$.get("poll/vote/"+$(this).val());
				$("#vote_block").text(lang.thanks_for_voting);
			}
		});
	});

	$("#doregister").click(function(){
		if($("input#acception").is(":checked"))
		{
			return true;
		}
		else
		{
			alert(lang.should_accept_agreement);
			return false;
		}

	});
	
	$(".showlucky").click(function(){
		$(".luckytable").hide();
		$(this).next().show();
	});
	

});
$(document).ready(function() {
	$('#main_desk').toggle(function() {
		$('#main_desk_menu').show('fast');
	}, function() {
		$('#main_desk_menu').hide('fast');
	});
	$('#main_play').toggle(function() {
		$('#main_play_menu').show('fast');
	}, function() {
		$('#main_play_menu').hide('fast');
	});

	$('#rules_toggle').toggle(function() {
		$('#rules_menu').show('fast');
	}, function() {
		$('#rules_menu').hide('fast');
	});

	$('#compet_toggle').toggle(function() {
		$('#compet_menu').show('fast');
	}, function() {
		$('#compet_menu').hide('fast');
	});

//	$('.open_chat').click(function(){
//		if (username)
//		var url = 'http://demo.ip4.ru/chat/flashchat.php?username=' + username ;
//		else
//		var url = 'http://demo.ip4.ru/chat/flashchat.php' ;
//		$(this).attr("href",url);
//	});

	$("#histcont").hide();
	$("#exhist").toggle(function(){$("#histcont").show("fast")},function(){$("#histcont").hide("fast")});
});

