/*==================================================
 *  TimeLine Information
 *==================================================
 */

var tl;
function onLoad() {
var eventSource = new Timeline.DefaultEventSource(0);

	
var theme = Timeline.ClassicTheme.create();
theme.event.label.width = 280; // px
theme.event.bubble.width = 300;
theme.event.bubble.height = 150;


Timeline.GregorianDateLabeller.prototype.labelPrecise = function(date) {
    return Timeline.DateTime.removeTimeZoneOffset(
        date, 
        this._timeZone //+ (new Date().getTimezoneOffset() / 60)
    ).toUTCString();

};
	
  var bandInfos = [
    Timeline.createBandInfo({

		eventSource:    eventSource,
		trackHeight:    1.7,
        trackGap:       0.8,
        date:           Date(),
        width:          "75%", 
        intervalUnit:   Timeline.DateTime.MONTH, 
        intervalPixels: 275,
		theme: theme
    }),

    Timeline.createBandInfo({
	    showEventText:  false,
        trackHeight:    0.8,
        trackGap:       0.6,
		eventSource:    eventSource,
        date:           Date(),
        width:          "25%", 
        intervalUnit:   Timeline.DateTime.YEAR, 
        intervalPixels: 275,
		theme: theme
    })
  ];
  


  
  bandInfos[1].syncWith = 0;
  bandInfos[1].highlight = true;

  
  

  
              
			
			  

  
  
  tl = Timeline.create(document.getElementById("tl"), bandInfos, Timeline.HORIZONTAL);
  tl.loadXML("events/comp_event_timeline.asp", function(xml, url) { eventSource.loadXML(xml, url); });
  
  
  
}

var resizeTimerID = null;
function onResize() {
    if (resizeTimerID == null) {
        resizeTimerID = window.setTimeout(function() {
            resizeTimerID = null;
            tl.layout();
        }, 500);
    }
}

function tardis( destination )
{
   tl.getBand( 0 ).setCenterVisibleDate( Timeline.DateTime.parseIso8601DateTime( destination ) );
}



/* Comment this out to disable bubbles and load a page instead
Timeline.DurationEventPainter.prototype._showBubble = function(x, y, evt) {
  document.location.href=evt.getLink();
 }*/

