function startPlot( address, small, title )
{
  if( small == undefined )
  {
        var small = false;
  }

  if( title == undefined )
  {
        var title = true;
  }

  $(function () {
    var type= {};
    if( small )
    {
        type = {type:"small"}
    }
    $.post( address, type,
          function( series )
          {
            $.jqplot.config.enablePlugins = true;
            $.jqplot('plot', [series.data], {
              legend:{
                      show:true
              },
              //series:[{label:series.label, lineWidth: 1, markerOptions: {size: 4}}],
              seriesColors: [ "#4a71a8" ],
              series:[{label:(title?series.label:' '), lineWidth: 1, markerOptions: {size: 3}}],
              axes:{
                  xaxis:{
                    ticks:series.labels
                  }
              },
              grid:{
                    background: '#f6f5f4',
                    borderColor: '#535c63',
                    gridLineColor: '#dde2e6'
              },
              highlighter: {sizeAdjust: 7.5,tooltipAxes: 'y'}
            });
          },"json");


    $("#controls a").click( function( ) {

        var classAtr = $(this).attr("class");
        $('ul.bar li').each(function(){
            $(this).removeClass('selected');
        });
        $(this).parent().addClass('selected');
        $.post( address, {type:classAtr},
          function( series )
          {
            $("#plot").html("").attr("class","");
            $.jqplot.config.enablePlugins = true;
            $.jqplot('plot', [series.data], {
              legend:{
                      show:true
              },
              //series:[{label:series.label, lineWidth: 1, markerOptions: {size: 4}}],
              seriesColors: [ "#4a71a8" ],
              series:[{label:(title?series.label:' '), lineWidth: 1, markerOptions: {size: 3}}],
              axes:{
                  xaxis:{
                    ticks:series.labels
                  }
              },
              grid:{
                    background: '#f6f5f4',
                    borderColor: '#535c63',
                    gridLineColor: '#dde2e6'
              },
              highlighter: {sizeAdjust: 7.5,tooltipAxes: 'y'}
            });
          }, "json");

        return false;
      } );

  });
}
