var fixupLayers=new Array();
for(key in document.all)
{
	fixupitem=document.all[key];
	if(fixupitem.nodeName && fixupitem.getAttribute("fixuptype"))
	{
		fixupitem.style.visibility="hidden";
		fixupitem.style.zIndex=999;
		fixupLayers.push(fixupitem);
	}
}
function fixup()
{
	var ph=document.documentElement.offsetHeight;
	var pw=document.documentElement.offsetWidth;
	var st=document.body.scrollTop;
	if(st==0)
		st=document.documentElement.scrollTop;
	var fw,fixupLayer,fixuptype,lw,lh,mr=5;
	for(key in fixupLayers)
	{
		fixupLayer=fixupLayers[key];
		fw=parseInt(fixupLayer.getAttribute("fixupwidth"));
		lw=fixupLayer.offsetWidth;
		lh=fixupLayer.offsetHeight;
		
		fixuptype=fixupLayer.getAttribute("fixuptype");
		if(fixuptype=="top")
			fixupLayer.style.pixelTop=st+fw;
		else if(fixuptype=="bottom")				
			fixupLayer.style.pixelTop=st+ph-fw-lh-mr;
		else if(fixuptype=="float" && fixupLayer.getAttribute("ismove") && fixupLayer.getAttribute("ismove")=="true")
		{
			ms=5;
			if(fixupLayer.getAttribute("movespeed"))
				ms=parseInt(fixupLayer.getAttribute("movespeed"));
			if(!fixupLayer.lastX)
			{
				fixupLayer.lastX=fw;
				fixupLayer.moveX=ms;
			}
			if(!fixupLayer.lastY)
			{
				fixupLayer.lastY=fw;
				fixupLayer.moveY=ms;
			}
			fixupLayer.lastX+=fixupLayer.moveX-ms*Math.random();
			fixupLayer.lastY+=fixupLayer.moveY-ms*Math.random();
			if(fixupLayer.lastX>pw-mr-lw-fw)
			{
				fixupLayer.lastX=pw-mr-lw-fw;
				fixupLayer.moveX=0;
			}
			else if(fixupLayer.lastX<mr+fw)
			{
				fixupLayer.lastX=mr+fw;
				fixupLayer.moveX=ms;
			}
			if(fixupLayer.lastY>ph-mr-lh-fw)
			{
				fixupLayer.lastY=ph-mr-lh-fw;
				fixupLayer.moveY=0;
			}
			else if(fixupLayer.lastY<mr+fw)
			{
				fixupLayer.lastY=mr+fw;
				fixupLayer.moveY=ms;
			}
			fixupLayer.style.pixelTop=fixupLayer.lastY+st;
			fixupLayer.style.pixelLeft=fixupLayer.lastX;
		}
	}
}
function setff()
{
	for(key in fixupLayers)
	{
		fixupLayer=fixupLayers[key];
		fixupLayer.style.visibility="visible";
		fixupLayer.style.position="absolute";
	}
	window.setInterval("fixup()",100);
}
setTimeout("setff()",0);