<script type="text/javascript">
window.onload = function(){
var oMenu = document.getElementById('bar');
var aA = oMenu.getElementsByTagName('a');
var oUl = document.getElementsByTagName('ul')[0];
var aLi = oUl.getElementsByTagName('li');
var iNow = 0;
var iNow2 = 0;
change();
window.onscroll = function(){
change();
}
function change(){
oTop = document.body.scrollTop || document.documentElement.scrollTop ;
oMenu.style.top = 70 + oTop + 'px';
for(var i = 0; i<aA.length; i++){
if(oTop > aLi[i].offsetTop - 250){
iNow = i;
}else{
break;
}
}
if(iNow != iNow2){
for(var i = 0; i<aA.length; i++){
aA[i].className = '';
}
aA[iNow].className = 'active';
iNow2 = iNow;
}
}
};
</script>
666666666666666666