var leftDiv = document.getElementById("leftDiv");
var headHeight = 373 - 12;
var footHeight = 110;

if( leftDiv )
{
	window.onscroll=function(){
		var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
	
		if(scrollTop >= headHeight)
		{
			if( (scrollTop + leftDiv.offsetHeight) > document.body.offsetHeight - footHeight )
			{	
				if( leftDiv.style.position != "absolute" )
				{
					leftDiv.style.position = "absolute";	
					leftDiv.style.top = (document.body.offsetHeight - footHeight - leftDiv.offsetHeight + 10) + "px";
				}
			}
			else
			{
				leftDiv.style.position = "fixed";
				leftDiv.style.top = "12px";
			}
		}
		else
		{
			leftDiv.style.position = "absolute";	
			leftDiv.style.top = "373px";
		}
	}
}
