var Caron = {
	cumulativeOffsetTop: function(element) {
    var valueT = 0;
    do {
      valueT += element.offsetTop || 0;
			element = element.offsetParent;
    } while (element);
    return valueT;
  }
}

Event.observe(window, 'load', function() {
		var sidebar = document.getElementById('SideBar');
		var sidebarHeight = sidebar.offsetHeight;
		var content = document.getElementById('Content') || document.getElementById('HomeContent');
		var contentHeight = content.offsetHeight;
		
		if(sidebarHeight < contentHeight)
		{
			var makeADonationButton = document.getElementById('makeADonation');
			var locations = document.getElementById('Locations');
			if( locations == null ) { 
				locations = document.getElementById('Locations-update'); 
			}
			var buttonOffsetTop = Caron.cumulativeOffsetTop(locations);
			locations.style.position = "relative";
			makeADonationButton.style.position = "absolute";
			makeADonationButton.style.top = buttonOffsetTop+"px";
			makeADonationButton.style.display = "block";
		}
});
