var tl;
function onLoad() {
var eventSource = new Timeline.DefaultEventSource(0);

var theme = Timeline.ClassicTheme.create();
            theme.event.bubble.width = 300;
            theme.event.bubble.height = 150;
            theme.ether.backgroundColors[1] = theme.ether.backgroundColors[0];
            var d = Timeline.DateTime.parseGregorianDateTime("1998")
            var bandInfos = [
                Timeline.createBandInfo({
                    width:          "10%", 
                    intervalUnit:   Timeline.DateTime.YEAR, 
                    intervalPixels: 150,
                    date:           d,
                    showEventText:  false,
                    theme:          theme
                }),

			    Timeline.createBandInfo({
					eventSource:    eventSource,
       				date:           "Jan 1 1987 00:00:00 GMT",
        			width:          "90%", 
        			intervalUnit:   Timeline.DateTime.YEAR, 
        			intervalPixels: 150,
					date:			d,
					theme:			theme
    })
  ];
  
  bandInfos[0].etherPainter = new Timeline.YearCountEtherPainter({
                startDate:  "Aug 1 1977 00:00:00 GMT",
                multiple:   5,
                theme:      theme
            });
            bandInfos[0].syncWith = 1;
            bandInfos[0].highlight = false;
            bandInfos[0].decorators = [
                new Timeline.SpanHighlightDecorator({
                    startDate:  "Aug 1 1977 00:00:00 GMT",
                    endDate:    "Dec 31 2009 00:00:00 GMT",
                    startLabel: "start",
                    endLabel:   "future",
                    color:      "#FFC080",
                    opacity:    50,
                    theme:      theme
                })
            ];
  
  tl = Timeline.create(document.getElementById("ksc-timeline"), bandInfos);
  Timeline.loadXML("/fileadmin/user_upload/timeline/ksc_200805.xml", function(xml, url) { eventSource.loadXML(xml, url); });
}

var resizeTimerID = null;
function onResize() {
    if (resizeTimerID == null) {
        resizeTimerID = window.setTimeout(function() {
            resizeTimerID = null;
            tl.layout();
        }, 500);
    }
}
