window.addEvent('domready', function() {

	var scroll = new SmoothScroll({ duration:700 }, window);

	var Tips1 = new Tips($$('.pagination-item'),{className: 'tool-tip',text: '',fixed: true,offset: {'x':-36,'y':-30} });


	var path = '/wp-content/themes/diner/ajax.month.php?year=';
		
	
	
	$$('.year-menu-option').addEvent('click', function(e) {
		//We can use one Request object many times.
		e.stop();
		var year = this.get('id');
		var url = path + year;
		
		//$('month-archive-container').set('text', url);



		
		var req = new Request.HTML({ url: url, 
			onSuccess: function(html) {
				//Clear the text currently inside the results div.
				$('month-archive-container').set('text', '');
				//Inject the new DOM elements into the results div.
				$('month-archive-container').adopt(html);
				$('current-year').set('text',year);
				scroll = new SmoothScroll({ duration:700 }, window);
			},
			//Our request will most likely succeed, but just in case, we'll add an
			//onFailure method which will let the user know what happened.
			onFailure: function() {
				$('month-archive-container').set('text', 'The request failed.');
				scroll = new SmoothScroll({ duration:700 }, window);
			}
		});
		req.send();
	});

});
