
var LastPosY = 0;

function move_DIV() {
	
	var y = (ns_pos)? window.pageYOffset :
		(ie_std && ie_pos) ? Math.max(document.documentElement.scrollTop, document.body.scrollTop) :
		ie_std ? document.documentElement.scrollTop : document.body.scrollTop;
	y+=10;
	var winHeight=window.opera ? window.innerHeight: (ie_std ? document.documentElement.clientHeight : document.body.clientHeight);
	
	if (y!=LastPosY || lastHeight!=winHeight) {
		lastHeight=winHeight;
		if (window.opera) {
			document.getElementById('myfooter').style.pixelTop=(y+winHeight-40);
		}
		else if (document.layers) {
			document.layers['myfooter'].top=(y+winHeight-40);
		}
		else if (document.getElementById) {
		
			
			document.getElementById('myfooter').style.top=(y+winHeight-40)+'px';
		}
		else if (document.all) {
			document.all['myfooter'].style.pixelTop=(y+winHeight-40);
		}
		LastPosY=y;
	}
	if (TimeScroll)	window.setTimeout('move_DIV()',100);
}

var TimeScroll = true;

function InitFixed() {
	ns_pos = (typeof window.pageYOffset!='undefined');
	ie_std = (document.documentElement && typeof document.documentElement.scrollTop!='undefined');
	ie_pos = (document.body && typeof document.body.scrollTop!='undefined');
	window.onscroll=function(){window.onscroll=move_DIV;TimeScroll=false;};
	window.onresize=function(){window.onresize=move_DIV;TimeScroll=false;};
	if (ns_pos||ie_std||ie_pos) move_DIV();
}
