jQuery.fn.archiverollup = function(){
	
	var $theTable = $(this),
		$postFirst,
		$rows,
		re = /\d{1,2}\/\d{1,2}\/(\d{2,4})/i,
		date = new Date(),
		currentYear = date.getFullYear(),
		oldestYear = $("td.articledate:last", $theTable).text().match(re)[1],
		rollupRow,
		bttnYear,
		i;
	
	for(i = oldestYear; i < currentYear; i++){
		/*
		// find the parent TR of TD.articledate
		// and hide them
		------------------------------------------*/
		$("td.articledate:contains('" + i + "')", $theTable).parent("tr").hide();
		// find the first .articledate position
		$posFirst = $("td.articledate:contains('" + i + "'):eq(0)", $theTable).parent("tr");
		// build the rollup row
		rollupRow = "<tr class=\"rollup\"><th colspan=\"2\"><button>" +  i  + "</button></th></tr>";
		// insert it before the first .articledate row		
		$posFirst.before( rollupRow );
	};
	
	// set the behavior of our roll up button
	// some CSS will be needed to make it pretty
	$("tr.rollup button").bind("click", function(e){
		// get the year based on teh button's text
		bttnYear = $(this).text();
		// toggle all hidden .articledate rows based on the year
		$rows = $("td.articledate:contains('" + bttnYear + "')", $theTable).parent("tr");
		$rows.toggle();
		// toggles the class on the button to show
		// this allows us to change the graphic applied
		$(this).toggleClass("close");
	});

};