var index = 0;
var menu_time = 6000;
var anterior = 4;
var timer = setTimeout("trocaMsg()",10); 

function trocaMsg()
{ 
	index = index%4 +1;
	change_noticia(index);
	tempo();
}          
function tempo()
{                    
	clearTimeout(timer);
	timer = setTimeout("trocaMsg()",menu_time);        
}  

function change_noticia(id)
{
	index = id;
	document.getElementById("vitrinenum"+anterior).style.background="#E7E7F3";
	document.getElementById("vitrinenum"+index).style.background="#FFFFFF";
	document.getElementById("vitrine"+anterior).style.display="none";
	document.getElementById("vitrine"+index).style.display="block";
	anterior = id;
}

function change_img(id, out)
{
	if (out == 1)
	{		
		clearTimeout(timer);
		change_noticia(id);
	}
	else
	{
		tempo();
	}
}


function restante(obj)
{
	total=9;
	qtde=obj.value.length;
	if (qtde>total)
	{obj.value=obj.value.substring(0,total)}
	qtde=obj.value.length;
	restam.innerHTML=total-qtde;
}


function bookm()
{
	if(window.sidebar){window.sidebar.addPanel(document.title, location.href, "");}
	else if(document.all){window.external.AddFavorite(location.href, document.title);}
	else{return true;}
}