var trailimage=["images/imagemVertical.png", 70, 301]; //image path, plus width and height
var limiteSuperior=200; //define o limite superior
var displayduration=0; //duration in seconds image should remain visible. 0 for always.
var ns = (navigator.appName.indexOf("Netscape") != -1) ; //verifica se é netscape


function gettrailobj()
{
	if (document.getElementById)
		return document.getElementById("trailimageid").style;
	if (document.all)
		return document.all["trailimageid"].style;
}

function truebody()
{
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function hidetrail()
{
	gettrailobj().visibility="hidden"
	document.onmousemove=""
}

var posY = 0;
function movimentarBanner()
{
	var pY;
	if (self.pageYOffset) 
	{
		pY = self.pageYOffset ;
	} else if (document.documentElement && document.documentElement.scrollTop) { // IE6
		pY = document.documentElement.scrollTop;
	} else if (document.body) {
		pY = ns ? pageYOffset : document.body.scrollTop ;
	}
	
	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)

	posY += (pY - posY)/10 + 1;
	gettrailobj().top =(posY < limiteSuperior ? limiteSuperior : posY)+"px";
}

function iniciarMovimento(){
	setInterval('movimentarBanner()', 10);
}
//Inicia o movimento
setTimeout("iniciarMovimento()", 2000);

if (displayduration>0)
	setTimeout("hidetrail()", displayduration*1000)
