function go(selector, feeds, charts) {

	var feed, name, i, firstTime, lastYear, thisYear, ticks, monthNames, previousPoint;

	function showTooltip(x, y, contents, color) {
		$('<div id="tooltip">' + contents + '<\/div>').css( {
			width: '100px',
			position: 'absolute',
			top: y - 50,
			left: x - 100,
			border: '1px solid ' + color,
			color: '#FFFFFF',
			padding: '2px',
			backgroundColor: color,
			font: 'bold 10px Verdana, sans-serif',
			textAlign: 'center'
		}).appendTo("body");
	}

	monthNames = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ');
	
	
	ticks = [];
	lastYear = 0;
	thisYear = 0;
	firstYear = 2002; // ignore data before this year (a hack for bad data)

	// process each data point...
	for (name in feeds) {
		if (feeds.hasOwnProperty(name)) {
			
			// shortcut
			feed = feeds[name];
			
			for (i = 0; i < feed.length; i += 1) {
			
				// convert timestamp from seconds to milliseconds
				feed[i][0] *= 1000;

				// get the year of the current data point
				thisYear = new Date(feed[i][0]).getFullYear();
				
				if (thisYear < firstYear) {
					// remove the ones that are out of range
					feed.splice(i, 1);
					i -= 1;
				} else if (lastYear !== thisYear) {
					// add a tick wherever the year changes
					ticks.push(feed[i][0]);
					lastYear = thisYear;
				}
			}
		}
	}
	
	// get all the ticks in order...
	ticks.sort();
	
	// ...then remove the ones that are the same
	for (i = 1; i < ticks.length; i += 1) {
		while (i < ticks.length && 
			new Date(ticks[i]).getFullYear() === 
			new Date(ticks[i - 1]).getFullYear()) {
			ticks.splice(i, 1);
		}
	}
	

	$.plot(
		$(selector),
		charts,
		{
			grid: {
				hoverable: true
			},
			legend: {
				position: 'nw'
			},
			xaxis: {
				ticks: ticks,
				mode: "time"
			},
			yaxis: {
				tickFormatter: function (v, axis) {
					return '$'+Math.round(v);
				}
			}
		}
	);
	
	previousPoint = null;
	
	$(selector).bind('plothover', function (event, pos, item) {
		if (item) {
			if (previousPoint != item.datapoint) {
				previousPoint = item.datapoint;
				
				$("#tooltip").remove();
				var date = new Date(item.datapoint[0]),
					value = item.datapoint[1].toFixed(2);
				
				date = monthNames[date.getMonth()] + ' ' + date.getDate() + ', ' + date.getFullYear();
//					date = monthNames[date.getMonth()] + ' ' + date.getFullYear();
				
				showTooltip(item.pageX, item.pageY, date + ':<br />$' + value, item.series.color);
			}
		}
		else {
			$("#tooltip").remove();
			previousPoint = null;            
		}
	});	
}