function findPosY(obj) {
	var posTop = 0;
	while (obj.offsetParent) {posTop += obj.offsetTop; obj = obj.offsetParent;}
	return posTop;
}
function getCurrentYPos(){
	var _offset = 0;
	if (document.body && document.body.scrollTop) _offset =  document.body.scrollTop;
	if (document.documentElement && document.documentElement.scrollTop) _offset = document.documentElement.scrollTop;
	if (window.pageYOffset) _offset =  window.pageYOffset;
	return _offset;
}
function boxPos(){
	var t_list = document.getElementsByTagName('ul');
	var _list = [];
	for(var i = 0; i < t_list.length; i++){
		if(t_list[i].className.indexOf('share-box') != -1){
			t_list[i].deff = findPosY(t_list[i]);
			_list.push(t_list[i]);
			
		}
	}
	if(_list.length){
		function winScroll(){
			var _top = getCurrentYPos();
			for(var i = 0; i < _list.length; i++){
				if(_top > _list[i].deff-10) _list[i].style.top = _top - _list[i].deff + 70 + 'px';
				else _list[i].style.top = 60 + 'px'; 
			}
		}
		if (window.addEventListener) window.addEventListener("scroll", winScroll, false);
		else if (window.attachEvent && !window.opera) window.attachEvent("onscroll", winScroll);		
	}
}
if (window.addEventListener) window.addEventListener("load", boxPos, false);
else if (window.attachEvent && !window.opera) window.attachEvent("onload", boxPos);
