	function lang_down()
	{
		$('.lang').animate({marginTop: "-13px"}, 300);
	}

	function lang_up()
	{
		$('.lang').animate({marginTop: "-44px"}, 300);
	}

    function init()
    {
		$('.lang').hover(lang_down, lang_up);
	}

	function set_language(language)
	{
		$.ajax
		({
			type: 'POST',
			url: '/ajax/set_language.php',
			data: 'language=' + language,
			success: function(data)
			{
				location.reload();
			}
		});	}

	function login()
	{	    $.ajax
		({
			type: 'POST',
			url: '/ajax/login.php',
			data: 'login=' + $('#auth_login').val() + '&password=' + $('#auth_password').val(),
			success: function(data)
			{
				if (data == 'ok')
					location.reload();
				else
					$('#auth_error').html('Неверный логин либо пароль');

			}
		});	}

	function remove_point(prefix, id)
	{
       	document.getElementById(prefix + '_h' + id).parentNode.removeChild(document.getElementById(prefix + '_h' + id));
       	document.getElementById(prefix + '_d' + id).parentNode.removeChild(document.getElementById(prefix + '_d' + id));
	}


	function clear_box(id)
	{
		$('#' + id).html('');
		$('#' + id + '_txt').slideUp(300, function() { $('#' + id + '_txt').html(''); $('#' + id + '_txt').slideDown(); });
	}

    $(document).ready(init);


