var timerInpGoalKeypress = 0;

jQuery(document).ready(
		function()
		{
			var height = 0;
			
			setTimeout(function(){
				if (height < parseInt(jQuery('.intab-block:first').height()))
					height = parseInt(jQuery('.intab-block:first').height()); 
				if (height < parseInt(jQuery('.intab-block.intab-noborder').height()))
					height = parseInt(jQuery('.intab-block.intab-noborder').height()); 
				
				jQuery('.intab-block').height(height); 
				
			},100);
			
			initGameProcess();
		}
);

function initGameProcess()
{
	if (jQuery("#tabs").length == 0)
		return false;
	
  jQuery("#tabs").tabs({fxSlide:true});
  
  jQuery('.button-make-query').click(
    function()
    {
      var goal1 = parseInt(jQuery('.inp_goal_1').val());
      var goal2 = parseInt(jQuery('.inp_goal_2').val());
      
      if (goal1 >= 0 && goal2 >= 0 && goal1 < 100 && goal2 < 100)
      {
        jQuery.get('/index.php', {
          'game_query' : '1',
          'goal_1' : goal1, 
          'goal_2' : goal2 
        });                
        jQuery('.you-query').fadeOut('fast');
        setTimeout(function(){jQuery('.query-accepted').fadeIn('fast')},300);
      }
      else 
      {
        alert('Не правильный формат прогноза.');
        return true; 
      }
    }
  );            
}

