Event.observe(window, 'load', function() {
$$('.gantt').first().style.backgroundImage = 'url(' + imageLocation + '/gantt-vertline' + gantt_grid_width + 'x' + gantt_grid_height + '.gif)';
$$('.gantt').first().style.backgroundPosition = gantt_label_width + 'px top';
$$('.gantt').first().style.width = (gantt_label_width + (gantt_size * gantt_grid_width)) + 'px';

$$('.gantt .label').each(function (e) {
  e.style.width = gantt_label_width + 'px';
  e.style.height = gantt_grid_height + 'px';
  e.style.lineHeight = gantt_grid_height + 'px';
});

$$('.gantt .head div').each(function (e) {
  e.style.width = gantt_grid_width + 'px';
  e.style.height = gantt_grid_height + 'px';
  e.style.lineHeight = gantt_grid_height + 'px';
});

$$('.scope_day .head div').each(function (e) {
  e.style.width = (gantt_grid_width * 2) + 'px';
});

$$('.gantt .head').first().style.height = gantt_grid_height + 'px';

$$('.gantt .head').first().style.paddingLeft = gantt_label_width + 'px';

if ($$('.scope_month .head').first()) {
  $$('.scope_month .head').first().style.paddingTop = gantt_grid_height + 'px';
  $$('.bookings').first().style.marginTop = gantt_grid_height + 'px';
  $$('.scope_month .head div').each(function (e) {
    e.style.lineHeight = (gantt_grid_height / 2) + 'px';
  });
}

if ($$('.scope_week').length > 0) {
  $$('.scope_week').first().style.backgroundImage = 'url(' + imageLocation + '/gantt-vert-week' + gantt_grid_width + 'x' + gantt_grid_height + '.gif)';
  $$('div .scope_week .head div').each(function (e) {
    e.style.width = (gantt_grid_width * 4) + 'px';
  });
  $$('.scope_week').first().style.backgroundPosition = (gantt_label_width + (gantt_bg_offset * gantt_grid_width * 4)) + 'px top';
}

if ($$('.scope_month').length > 0) {
  $$('.scope_month').first().style.backgroundImage = 'url(' + imageLocation + '/gantt-vert-month' + gantt_grid_width + 'x' + gantt_grid_height + '.gif)';
  // $$('.scope_month .head').first().style.paddingLeft = (gantt_label_width - (gantt_grid_width / 2)) + 'px';
  $$('.scope_month').first().style.backgroundPosition = (gantt_label_width + (gantt_bg_offset * gantt_grid_width)) + 'px top';
}

$$('.gantt .bookings').first().style.top = gantt_grid_height + 'px';
$$('.gantt .bookings').first().style.left = gantt_label_width + 'px';
$$('.gantt .bookings').first().style.width = (gantt_grid_width * gantt_size) + 'px';
$$('.gantt .bookings').first().style.height = ($$('.gantt').first().getDimensions().height - gantt_grid_height) + 'px';

if ($$('.scope_month .head').first()) {
  $$('.gantt .bookings').first().style.height = ($$('.gantt').first().getDimensions().height - (gantt_grid_height * 2)) + 'px';
}
});

Event.observe(window, 'load', function() {
  if (indicatorPos != null) {
    $('indicator').style.left = ((gantt_size * gantt_grid_width) * indicatorPos / ((gantt_size * gantt_grid_width) + gantt_label_width)) + '%';
    $('indicator').style.top = ((gantt_grid_height * 2) + 1) + 'px';
    $('indicator').style.marginLeft = (gantt_label_width + 1) + 'px';
    $('indicator').style.width = (gantt_grid_width - 1) + 'px';
    $('indicator').style.display = 'block';
  }
});
