// JavaScript animate_box.js 091108
/**
 * Animates a floated div to move up and down with the scrolling of the page.
 *
 * More details at http://www.finefrog.com/2007/12/14/animated-floating-sidebar/
 *
 * @author Jordon Mears <jordoncm at gmail dot com>
 */
function animate_box() {
    var offset = 0; /* set this to the starting margin-top in the css */
    var element = document.getElementById('animate_box');

    if(element) {
        var top = Number(String(element.style.marginTop).substring(0, String(element.style.marginTop).indexOf('px')));

        var difference = (document.documentElement.scrollTop + offset) - top;
				
					if(difference > 0) {
							element.style.marginTop = (top + Math.abs(Math.ceil(difference / 10))) + 'px';
					} else if(difference < 0) {
							element.style.marginTop = (top - Math.abs(Math.ceil(difference / 10))) + 'px';
					}
				
    }
}
window.setInterval(animate_box, 10);


