
/* TL switch */

com._startup_items.push(function(){
	if(location.href.indexOf("/timeline/") == -1) return;
	var btn = com.E("div.timeline-2 h3 img");
	btn[0].onclick = function(){
		var target = document.getElementById("TL");
		if(target.style.display != "none"){
			target.style.display = "none";
			this.src = this.src.replace("_f1","_f2");
		}
		else{
			target.style.display = "block";
			this.src = this.src.replace("_f2","_f1");
		}
	}
	
});




/* timeline-index profile resize */

com._startup_items.push(function(){
	if(location.href.indexOf("/timeline/") == -1) return;
	var obj = com.E("div.timeline-index div.profile div.article");
	for(var i = 0 , l = obj.length ; i < l ; i++){
		var left = obj[i];
		var right = (i == obj.length - 1) ? obj[i] : obj[(i + 1)];
		if(com._browser.nav == "MSIE"){
			left.height = left.offsetHeight;
			right.height = right.offsetHeight;
		}
		else{
			left.height = left.clientHeight;
			right.height = right.clientHeight;
		}
		var H = (left.height > right.height) ? left.height : right.height ;
		left.style.height = H + "px";
		right.style.height = H + "px";
		i++;
	}
});





/*
var tl;
function TL() {
  var now=new Date();
  var eventSource = new Timeline.DefaultEventSource();
  var bandInfos = [
    Timeline.createBandInfo({
	eventSource:    eventSource,
	timeZone:       +9,
	date:           "Oct 14 2009 00:00:00 GMT",
	width:          "83%", 
	intervalUnit:   Timeline.DateTime.MONTH, 
	intervalPixels: 100
    }),
    Timeline.createBandInfo({
	eventSource:    eventSource,
	timeZone:       +9,
	date:           "Oct 14 2009 00:00:00 GMT",
	width:          "17%", 
	intervalUnit:   Timeline.DateTime.YEAR, 
	intervalPixels: 200,
  overview: true
    })
  ];
  bandInfos[1].syncWith = 0;
  bandInfos[1].highlight = true;
  
  tl = Timeline.create(document.getElementById("TL"), bandInfos);
  Timeline.loadXML("/shared/timeline/tl_nt.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);
    }
}
com._startup_items.push(TL);
com._onresize_items.push(TL);

*/