		function sendAnswer()
		{
			$.ajax({
				url:		'/game/checkproposals',
				type:		'post',
				dataType:	'json',
				data:		'action=refuse',
				success: 	function(answer)
				{
					setTimeout(checkProposals, 5000);
				}
			});
		}
	
		function checkProposals()
		{
			$.ajax({
				url:		'/game/checkproposals',
				type:		'post',
				dataType:	'json',
				success:	function(pr)
				{
					if (pr.proposal == 1) {					
							$("#proposal-div").html('<p>Тебя приглашает в бой ' + pr.name + '<br />(' + pr.stat + ')<br /><a href="' + pr.code + '">Принять бой</a> <a id="refuse" href="#">Отказаться</a></p>');
							$('#proposal-link').trigger('click');			
					}
					else{
						setTimeout(checkProposals, 5000);						
					}
				}
			});			
		}
		
		function getFirstTreatmentForm()
		{		
			$.ajax({
				url:		'/site/treatment/',
				type:		'post',
				dataType:	'html',			
				cache: 		false,			
				success:	function(html)
				{
					//$('#m4-popup').html(html);
					$('#treatment-div').html(html);
				}
			});									
		}		
