function showTooltip(x, y, contents) { 
            /*borrowed from Flot's examples. Thank you!*/
                $('<div id="tooltip">' + contents + '</div>').css( {
                    position: 'absolute',
                    display: 'none',
                    top: y + 5,
                    left: x + 5,
                    border: '1px solid #3CC6CC',
                    padding: '2px',
                    'background-color': '#C2EFF1',
                    opacity: 0.80
                }).appendTo("body").fadeIn(200);
}
/*just formats the time nicely for display in the tooltip*/
function MGhourstomins(x){
    hours = Math.floor(x/60);
    hourmins = hours * 60;
    minstr = (x - hourmins) + "";
    if (minstr.length == 1){
        minstr = 0 + minstr
        return minstr
    }
    else{
        return minstr
    }
}
var plot = function(data) {

    $.plot($("#placeholder"), [ data ], 
        {
            grid: {
                hoverable: true,
                backgroundColor: { colors: ["#829EB9", "#FFFFFF"] }
            },
            series: {
                lines: { show: true },
                points: { show: true }
            },
            xaxis: {
                ticks: [[0,"0:00"], [120, "2:00"], [240, "4:00"], [360, "6:00"],[480, "8:00"], [600,"10:00"], [720, "12:00 (noon)"], [840, "14:00"], [960, "16:00"], [1080, "18:00"], [1200, "20:00"], [1320, "22:00"],[1439, "23:59"]]
            },
            colors: ["#304B65"]
        }
    );
}
