
var curTop = 0;
$(document).ready(function() {

	$(window).scroll(function () { 

		var scrollPos;
		if (typeof window.pageYOffset != 'undefined') {
		   scrollPos = window.pageYOffset;
		}
		else if (typeof document.compatMode != 'undefined' &&
		     document.compatMode != 'BackCompat') {
		   scrollPos = document.documentElement.scrollTop;
		}
		else if (typeof document.body != 'undefined') {
		   scrollPos = document.body.scrollTop;
		}
		
		$("#fixed").css("top", scrollPos + "px");
	});
	
});