
// WebTicker by Mioplanet
// www.mioplanet.com
function setTicker(){
/* Alimentação das notícias */
TICKER_CONTENT = replaceChars(arrayNoticias.toString());
TICKER_RIGHTTOLEFT = false;
TICKER_SPEED = 1;
TICKER_STYLE = "font: normal 11px Verdana, sans-serif";
TICKER_PAUSED = false;

ticker_start();
}

function replaceChars(entry) {
	out = ">,<"; // replace this
	add = "><"; // with this
	temp = "" + entry; // temporary holder

	while (temp.indexOf(out)>-1) {
		pos= temp.indexOf(out);
		temp = "" + (temp.substring(0, pos) + add + 
		temp.substring((pos + out.length), temp.length));
	}
	return replaceChars = temp;
}


function ticker_start() {
	var tickerSupported = false;
	TICKER_WIDTH = getElm("noticias").style.width;
	var img = "";

	// Firefox
	if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Safari")!=-1) {
		getElm("noticias").innerHTML = "<TABLE  cellspacing='0' cellpadding='0' width='100%'><TR><TD nowrap='nowrap'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'>&nbsp;</SPAN>"+img+"</TD></TR></TABLE>";
		tickerSupported = true;
	}
	// IE
	if (navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1) {
		getElm("noticias").innerHTML = "<DIV nowrap='nowrap' style='width:100%;'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'></SPAN>"+img+"</DIV>";
		tickerSupported = true;
	}
	if(!tickerSupported) getElm("noticias").outerHTML = ""; else {
		getElm("noticias").scrollLeft = TICKER_RIGHTTOLEFT ? getElm("noticias").scrollWidth - getElm("noticias").offsetWidth : 0;
		//alert(TICKER_CONTENT.toString().replace(", ","qaaaa"))
		document.getElementById("TICKER_BODY").innerHTML =TICKER_CONTENT.toString().replace(", ","qaaaa");
		getElm("noticias").style.display="block";
		TICKER_tick();
	}
}

function TICKER_tick() {
	if(!TICKER_PAUSED) getElm("noticias").scrollLeft += TICKER_SPEED * (TICKER_RIGHTTOLEFT ? -1 : 1);
	if(TICKER_RIGHTTOLEFT && getElm("noticias").scrollLeft <= 0) getElm("noticias").scrollLeft = getElm("noticias").scrollWidth - getElm("noticias").offsetWidth;
	if(!TICKER_RIGHTTOLEFT && getElm("noticias").scrollLeft >= getElm("noticias").scrollWidth - getElm("noticias").offsetWidth) getElm("noticias").scrollLeft = 0;
	window.setTimeout("TICKER_tick()", 30);
}

function lineResize() {
	var i,j,k,o,m;
	var n=new Array('colunaEsquerda','colunaMeio','colunaDireita');
	m=0;
	for(j=0;j<n.length;j++){m=Math.max(m,getElm(n[j]).clientHeight);}
	for(k=0;k<n.length;k++){getElm(n[k]).style.height = m+'px';}
}
function op(href){
	window.open(href);
	return false;
}