var tl;
function onLoad(userName,filterAuthorshipRating) {
  var eventSource = new Timeline.DefaultEventSource();
  var bandInfos = [
    Timeline.createBandInfo({
	  eventSource:    eventSource,
        width:          "80%", 
        intervalUnit:   Timeline.DateTime.MONTH, 
        intervalPixels: 100,
	theme: Timeline.AuthoratiTheme.create()
    }),
    Timeline.createBandInfo({
	  showEventText:  false,
	  eventSource:    eventSource,
        width:          "20%", 
        intervalUnit:   Timeline.DateTime.YEAR, 
        intervalPixels: 200,
	  theme: Timeline.AuthoratiTheme.create()
    })
  ];

  bandInfos[1].syncWith = 0;
  bandInfos[1].highlight = true;
  tl = Timeline.create(document.getElementById("my-timeline"), bandInfos);
  tl.loadXML("Timeline.aspx?UserName=" + userName + "&AuthorshipRating=" + filterAuthorshipRating, function(xml, url) { eventSource.loadXML(xml, url); });
// theme: Timeline.AuthoratiTheme.create()
  //Timeline.DurationEventPainter.prototype._showBubble = function(x, y, evt) {
  //alert (evt.getDescription ());
  //}
}

var resizeTimerID = null;
function onResize() {
    if (resizeTimerID == null) {
        resizeTimerID = window.setTimeout(function() {
            resizeTimerID = null;
            tl.layout();
        }, 500);
    }
}