$(function(){
//	var a = $('#archive_go');
	
	$('#archive_year').click(function(){
//		a.css('display','none');
		var year = $(this).val();
		var month = $('#archive_month').val();
		if(year){
			$.ajax({
				type:	"GET",
				url:	"archive.month.php",
				data:	"year="+year+"&month="+month,
				success: function(msg){
					$('#archive_month').html(msg);
				}
			})
		}
	});
	$('#archive_month').click(function(){
		var month = $(this).val();
		var month_string = $('option:selected',this).html();
		var year = $('#archive_year').val();
		if(month){
			$.ajax({
				type:	"GET",
				url:	"archive.post.php",
				data:	"year="+year+"&month="+month,
				success: function(msg){
					$('#posts').html(msg);
					$('#content .pagetitle').html('Archive for '+month_string+', '+year);
				}
			})
		}
		
	});
})
