window.addEvent('domready', function() {
	var status = {
		'true': 'open',
		'false': 'close'
	};

	//--horizontal
	var otherDateSlide = new Fx.Slide('ajaxdates', {mode: 'horizontal'});

	$('h_slidelast').addEvent('click', function(e){
		e.stop();
		iMonth = iMonth - 1;
		if (iMonth < 1) { 
			iMonth = 12;
			iYear = iYear - 1;
		}
		otherDateSlide.hide();
		MakeRequest();
		otherDateSlide.slideIn();
	});

	$('h_slidenext').addEvent('click', function(e){
		e.stop();
		iMonth = iMonth + 1;
		if (iMonth > 12) {
			iMonth = 1;
			iYear = iYear + 1;
		}					
		otherDateSlide.hide();
		MakeRequest();
		otherDateSlide.slideIn()	
	});
	
	// When Horizontal Slide ends its transition, we check for its status
	// note that complete will not affect 'hide' and 'show' methods
	myHorizontalSlide.addEvent('complete', function() {
		$('horizontal_status').set('html', status[myHorizontalSlide.open]);
	});
});