var move=0;
var inProgress=0;

function changeMonth(direction)
{
	if (direction=='next')
		move++;
	if (direction=='prev')
		move--;
	if (move>3)
		move=3;
	if (move<0)
		move=0;

	var url    = 'cal.php';
	var rand   = Math.random(9999);
	var pars   = 'move=' +move;
	var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, onComplete: showResponse } );
			

}

function showResponse (originalRequest) 
{
	document.getElementById('calendar').innerHTML = originalRequest.responseText;
}


function changeOut(show)
{
	if (inProgress==0)
	{
		inProgress=1;
		if (show=='discountSection')
		{
			Effect.Fade($('waysSection'));
			Effect.Appear($('discountSection'),{ afterFinish: function() { inProgress=0;}
            });
		}
		
		else
		{
			Effect.Appear($('waysSection'));
		
			Effect.Fade($('discountSection'),{ afterFinish: function() { inProgress=0;}
            });
		}
	}
}
