	var timeplot;

	function onLoad() {
	  var eventSource = new Timeplot.DefaultEventSource();
	  
	  var trace1 = new Timeplot.ColumnSource(eventSource,4);
	  var Yaxis1 = new Timeplot.DefaultValueGeometry({
	        gridColor: "#000000",
	        axisLabelsPlacement: "left"});
			
	  var Xaxis1 = new Timeplot.DefaultTimeGeometry({
	        gridColor: "#000000",
	        axisLabelsPlacement: "top"
	      }); 
		  
      var eventSource3 = new Timeplot.DefaultEventSource();


	  

	  var plotInfo = [
	    Timeplot.createPlotInfo({
	      id: "plot1",
		  dataSource: trace1,
	      valueGeometry: Yaxis1,
	      timeGeometry: Xaxis1,
		  showValues:true,
		  lineColor: "#1D2639",
		  fillColor: "#7498C9" 
	    }),

		Timeplot.createPlotInfo({
			id: "Events",
			eventSource: eventSource3,
			timeGeometry: Xaxis1,
			lineColor: "#8F151B"
		})

	/*	
		*/
		
	  ];
	            
	  timeplot = Timeplot.create(document.getElementById("my-timeplot"), plotInfo);
	  
	  var now = new Date();
	  var yr = (now.getYear()-100+2000);
	  //load data
	  timeplot.loadText("rd.aspx?url=http://ichart.finance.yahoo.com/table.csv?s=^DJI&a=00&b=1&c=2007&d="+now.getMonth()+"&e="+now.getDate()+"&f="+yr+"&g=d&ignore=.csv", ",", eventSource);
	  timeplot.loadXML("events.xml", eventSource3);

	}

	var resizeTimerID = null;
	function onResize() {
	    if (resizeTimerID == null) {
	        resizeTimerID = window.setTimeout(function() {
	            resizeTimerID = null;
	            timeplot.repaint();
	        }, 100);
	    }
	}
