<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
//capture variables
var div=$("div[class^='ms-ganttDiv']:eq(0)");
var tlv=$("table.ms-listviewtable:eq(0)");
var w = $("#GanttTable").width();
var a = "img[src='/_layouts/images/EndNormal.gif']"
var b = "img[src='/_layouts/images/MileStone.gif']"
//build new html from header rows
var html="<table class='ms-ganttInnerTable' cellspacing='0' cellpadding='0' style='table-layout:fixed' width='"+w+"'>"+
"<col width='222px'></col>"+
"<tbody><tr>"+
$("#GanttTable tr:eq(0)").html()+
"</tr><tr class='ms-ganttDetailTimeUnitRow'>"+
$("#GanttTable tr:eq(1)").html()+
"</tr></tbody></table>";
//build toggle buttons
var bt1="<input id='tlv0' class='ms-ButtonHeightWidth' type='button' target='_self' value='Toggle List' name='togglelv'/>";
var bt2="<input id='div100' class='ms-ButtonHeightWidth' type='button' target='_self' value='Full Gantt' name='div100'/>";
var bt3="<input id='div272' class='ms-ButtonHeightWidth' type='button' target='_self' value='Min Gantt' name='div100'/>";
//DOM manipulation
$("#GanttTable").prepend("<col width='222px'></col>");
$("table.ms-menutoolbar:eq(0)").after(html); //insert html
$("td.ms-toolbar[width='99%']").append(bt1).append(bt2).append(bt3);//add buttons
$("#tlv0").click(function() {$(tlv).toggle()}); //add toggle fn
$("#div100").click(function() {
$(div).height("100%");
$(div).css({"overflow-y": "visible", position: "relative"});
}); //add 100% fn
$("#div272").click(function() {
$(div).height("272");
$(div).css({"overflow-y": "auto"});
}); //add 272 fn
$("#GanttTable tr:lt(2)").replaceWith("<th></th>"); //replace original rows
$(a+", "+b).each(function(i,e) { //add labels
var title = $(e).parent().siblings("th").text();
$(e).parent().next().html("<div style='position:relative;z-index:99;white-space: nowrap'>"+title+"</div>");
});
//css fixes
$("#GanttTable").css({"table-layout":"fixed","word-wrap":"normal",width:w});
$("table.ms-listviewtable > tbody > tr[class='']").css("background-color","#fff");
$(div).css({"overflow-y": "auto", "overflow-x": "hidden"});
});
</script>
<style type="text/css">
body {background-color:#83B0EC}
.ms-main {height:97%}
.ms-globalTitleArea {background-color:#fff}
.ms-bodyareapagemargin {border-top:1px solid #83B0EC}
.ms-bodyareaframe {background:none transparent}
.ms-ganttInnerTable {background-color:#fff}
.ms-bodyareacell {background-color:#83B0EC}
</style>