var tl;
function showBubble(xVar){tl.getBand(0).showBubbleForEvent(xVar);}

function timelineLoad() {
 
       var eventSource = new Timeline.DefaultEventSource();

       var theme = Timeline.ClassicTheme.create();
       theme.event.instant.icon = "/assets/images/SiteImages/ball-icon-16px.png";
       theme.event.instant.iconWidth = 33;
       theme.event.instant.iconHeight = 20;
       theme.event.bubble.width = 350;
       theme.event.bubble.height = 400;
       theme.event.track.height = 20;
       theme.event.tape.height = 10;


       Timeline.GregorianDateLabeller.dayNames["ru"] = ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"];
       Timeline.GregorianDateLabeller.getDayName = function(day, locale){return Timeline.GregorianDateLabeller.dayNames[locale][day];}
	   
	   var bandInfos = [
		Timeline.createBandInfo({
			width:          "95%", 
	        	intervalUnit:   Timeline.DateTime.DAY, 
		        intervalPixels: 500,
			eventSource:    eventSource,
			layout: 'original',
        	        theme: theme ,
	                eventPainter:   Timeline.CompactEventPainter,
        	        eventPainterParams: {
	                       iconLabelGap:     8,
        	               labelRightMargin: 10,                       
                	       iconWidth:        33, // These are for per-event custom icons
	                       iconHeight:       20,
        	               stackConcurrentPreciseInstantEvents: {
                	           limit: 20,
	                           moreMessageTemplate:    "Ещё матчей %0 ...",
        	                   icon: "/assets/images/SiteImages/ball-icon-16px.png",
                	           iconWidth:              33,
                        	   iconHeight:             20
	                       }
          	        }
		}),	     
		Timeline.createBandInfo({
		        width:          "5%", 
			intervalUnit:   Timeline.DateTime.MONTH, 		 
			intervalPixels: 150,
			eventSource:    eventSource,
        		showEventText:  false,			 
			overview: true			 
		})
	   ];
	bandInfos[1].syncWith = 0;
	bandInfos[1].highlight = true;

            for (var i = 0; i < bandInfos.length; i++) {
                bandInfos[i].decorators = [
                    new Timeline.SpanHighlightDecorator({
                       startDate:  "Wed Feb 08 2012 00:08:00 GMT",
                       endDate:    "Wed Feb 08 2012 23:54:00 GMT",
                       color:      "#339933",
                       opacity:    60,
                       cssClass: 'curDayHighlight'
                    })
                ];
            }

	   
	tl = Timeline.create(document.getElementById("gfbTimeline"), bandInfos);
        tl.loadXML("http://"+location.host+"/index-ajax.php?q=assets/snippets/timeline-output/data.php", function(xml, url) { eventSource.loadXML(xml, url); });

//

}


