//jquery goodness 9 feb 2009
jQuery(document).ready(function() {
	jQuery("#archiveresults").html("");
	
	jQuery("#archivebutton").click(function(event) {
		var year = jQuery('#archiveyear').val();
		var month = jQuery('#archivemonth').val();
		var url = "http://www.greendale.tk/wp-content/plugins/GreendaleArchive/ajax.php?action=1&year=" + year + "&month=" + month ;
		
		jQuery("#archiveresults").html("<i>Loading archive...</i>");
		jQuery("#archiveresults").addClass("ajax-loading");
		
		//Do a simple Get result of the above url
		
		jQuery.get(url,function(result) {
			jQuery("#archiveresults").html(result);
			jQuery("#archiveresults").removeClass("ajax-loading");			
		}) 
		
	}) 	
});
