want to make the small div to move with the page while it is being scrolled.seems codes not working .please help me on this.
Code:





<!doctype html>
<html>
<head>
<meta charset="utf-8">

<title>Untitled Document</title>
<style>
.mid{
	height:2900px;
	width:400px;
	border:1px solid black;
	margin:0 auto;
}
#od{
	float:left;
	height:300px;
	width:150px;
	border:1px solid red;
	margin-left:143px;
	top:20px;
	position:relative;
}
</style>
<script>
window.onscroll=function(){setTimeout(movediv,300);}
</script>

</head>

<body style="position:relative;">


<div id="od"></div>
<div class="mid"></div>
<script>
function movediv(){
	var this_id=document.getElementById("od");
	var heights=this_id.style.height;
	var heights_num=heights.slice(0,-1);
	var h=parseInt( heights_num);
	var page_height=parseInt(window.pageYOffset);
	if(page_height>h){
		move();
	}
}
function move(){
	var m=document.getElementById("od");
	var tops=m.style.top;
	var d=parseInt(window.pageYOffset);
	var ts=tops.slice(0,-1);
	var t=parseInt(ts);
	t++;
	m.style.top = t +"px";
	
	var p = setTimeout(move,12);
	if(t>d+60){
		clearTimeout(p);
		m.style.top = t +"px";
	}
	
}

</script>
</body>
</html>