	jsRefresh = null;
  	setJsRefresh = function(){
  		jsRefresh = setTimeout(function(){window.location.href=window.location.href},250000);
  	};
    var d=document;
    $ = function(id) {
    	if(!arguments[1]) return document.getElementById(id);
    	else document.getElementById(id).style[arguments[1]]=arguments[2];
    }




	var BannerRotativo = window.BannerRotativo || {};
	BannerRotativo = {
		painel :null,
		itens :null,
		botoes :null,
		botoesTxts : {
			next :"proximo",
			prev :"anterior",
			stop :"parar",
			play :"executar"
		},
		botoesRefClick :"",
		ativado :0,
		anterior :0,
		proximo :0,
		navMSIE :!!navigator.userAgent.match(/MSIE/g),
		timeOut :null,
		timer :5,
		animando :false,
		banner :document.createElement("div"),
		showBanner :false,
		contaTrocas :0,
		init : function(a) {
			this.painel = document.getElementById(a.id);
			this.timer = a.timer || this.timer;
			this.botoesRefClick = a.botoesRefClick
					|| this.botoesRefClick;
			this.botoesTxts = a.botoesTxts || this.botoesTxts;
			if (typeof mostrabanner == "undefined") {
				mostrabanner = 0
			}
			this.showBanner = showBanner = (document.cookie
					.indexOf("rotativoDeChamadasNoBanner=1") == -1) ? true
					: false;
			this.itens = this.painel.getElementsByTagName("li");
			this.setNavegacao(this.ativado);
			this.aplicarSombras();
			if (this.itens.length == 1) {
				a.startOff = true
			} else {
				this.montarBotoes()
			}
			if (document.cookie.indexOf("rotativoDeChamadasStop=1") != -1) {
				a.startOff = true
			}
			if (!a.startOff) {
				this.stopPlay()
			} else {
				this.setBtStopPlay("play")
			}
		},
		events : {
			preventDefault : function(a) {
				if (a.preventDefault) {
					a.preventDefault()
				} else {
					a.returnValue = false
				}
			},
			add : function(c, b, a) {
				if (document.attachEvent) {
					c.attachEvent("on" + b, a)
				} else {
					if (document.addEventListener) {
						c.addEventListener(b, a, true)
					}
				}
			}
		},
		stopPlay : function(a) {
			if ((!a && this.timeOut == null) || (a && this.timeOut != null)) {
				clearInterval(this.timeOut);
				this.timeOut = setInterval( function() {
					BannerRotativo.navegar(1)
				}, BannerRotativo.timer * 1000);
				document.cookie = "rotativoDeChamadasStop=0; path=/";
				this.setBtStopPlay("stop")
			} else {
				document.cookie = "rotativoDeChamadasStop=1; path=/";
				clearInterval(this.timeOut);
				this.timeOut = null;
				this.setBtStopPlay("play")
			}
		},
		setBtStopPlay : function(a) {
			if (this.botoes != null) {
				var b = this.botoes.getElementsByTagName("a")[1];
				if (b){
          b.className = "bt" + a;
  				b.innerHTML = this.botoesTxts[a]
				}
			}
		},
		setNavegacao : function(a) {
			this.ativado = (parseInt(a) + (this.ativado || this.itens.length))
					% this.itens.length;
			this.anterior = ((this.ativado || this.itens.length) - 1)
					% this.itens.length;
			this.proximo = ((this.ativado || this.itens.length) + 1)
					% this.itens.length
		},
		fadeIO : function(b, d, c) {
			if (d) {
				b.style.opacity = 0;
				b.style.filter = "Alpha(Opacity=0)"
			} else {
				b.style.opacity = 1;
				b.style.filter = "Alpha(Opacity=100)"
			}
			BannerRotativo.animando = true;
			for ( var a = 1; a <= 10; a++) {
				setTimeout( function(e) {
					return function() {
						if (BannerRotativo.navMSIE) {
							b.style.filter = "Alpha(Opacity="
									+ (d ? 10 * e : 100 - 10 * e) + ")"
						} else {
							b.style.opacity = (d ? 0.1 * e : 1 - 0.1 * e)
						}
						if (e == 10) {
							BannerRotativo.animando = false;
							if (BannerRotativo.navMSIE) {
								b.style.filter = "none"
							}
							if (typeof c == "function") {
								c()
							}
						}
					}
				}(a), 75 * a)
			}
		},
		fecharBanner : function() {
			document.cookie = "rotativoDeChamadasNoBanner=1; path=/";
			this.showBanner = false;
			clearTimeout(BannerRotativo.bannerFadeOutTimer);
			this.bannerFadeOut()
		},
		bannerFadeOut : function() {
			this.fadeIO(this.banner, false, function() {
				BannerRotativo.banner.style.display = "none";
				BannerRotativo.botoes.style.display = "block"
			});
			this.fadeIO(this.botoes, true, null)
		},
		navegar : function(b) {
			var a = this.ativado;
			this.removerBanner = false;
			this.contaTrocas++;
			if (mostrabanner == 1 && this.showBanner && this.contaTrocas > 0
					&& this.contaTrocas % this.itens.length == 0) {
				this.banner.style.display = "block";
				this.banner.className = "banner";
				this.banner.innerHTML = '<a href="'
						+ mostrabannerLINK
						+ '" target="_blank"><img src="'
						+ mostrabannerIMG
						+ '" border="0" /></a><div class="rodape"><img src="http://home.img.uol.com.br/h3/pub_h_120_b.gif" class="txtPublicidade" border="0" /><a href="javascript:void(0)" onclick="BannerRotativo.fecharBanner()"><img src="http://home.img.uol.com.br/h3/banner-fechar.gif" border="0" /></div>';
				this.painel.appendChild(this.banner);
				this.fadeIO(this.banner, true, function() {
					BannerRotativo.botoes.style.display = "none"
				});
				this.fadeIO(this.botoes, false, null);
				if (this.timeOut != null) {
					BannerRotativo.bannerFadeOutTimer = setTimeout(
							function() {
								BannerRotativo.bannerFadeOut()
							}, BannerRotativo.timer * 1000)
				}
			} else {
				this.setNavegacao(b);
				this.itens[this.ativado].className = this.itens[this.ativado].className
						.replace(/desativado/g, "");
				this.itens[this.ativado].style.zIndex = 3;
				this.itens[a].style.zIndex = 4;
				this.itens[this.ativado].style.opacity = 1;
				this.itens[this.ativado].style.filter = "Alpha(Opacity=100)";
				this.fadeIO(
								this.itens[a],
								false,
								function() {
									BannerRotativo.itens[a].className = "desativado";
									BannerRotativo.itens[a].style.zIndex = 2
								}, true);
				
        //this.writeBotoesHTML();
				
        if (this.timeOut == null) {
					this.setBtStopPlay("play")
				} else {
					this.setBtStopPlay("stop")
				}
			}
		},
		montarBotoes : function() {
			this.botoes = document.createElement("div");
			this.botoes.className = "botoesNavegacao";
			//this.writeBotoesHTML();
			this.painel.appendChild(this.botoes)
		},
		aplicarSombras : function() {
			var b = document.createElement("div");
			b.className = "sombra";
			for ( var a = 0; a < this.itens.length; a++) {
				if (a > 0) {
					this.itens[a].className += " desativado"
				}
				this.itens[a].appendChild(b.cloneNode(true))
			}
		},
		writeBotoesHTML : function() {
			this.botoes.innerHTML = "<a rel='-1' href='"
					+ this.itens[this.anterior].getElementsByTagName("a")[0].href
					+ "' class='anterior' name='"
					+ this.botoesRefClick
					+ "'>"
					+ this.botoesTxts.prev
					+ "</a>      <a rel='0' href='"
					+ this.itens[this.ativado].getElementsByTagName("a")[0].href
					+ "' class='' name='"
					+ this.botoesRefClick
					+ "'></a>      <a rel='+1' href='"
					+ this.itens[this.proximo].getElementsByTagName("a")[0].href
					+ "' class='proximo' name='" + this.botoesRefClick
					+ "'>" + this.botoesTxts.next + "</a>";
			var b = this.botoes.getElementsByTagName("a");
			for ( var a = 0; a < b.length; a++) {
				this.events.add(b[a], "click", function(c) {
					BannerRotativo.btNavegacaoClick(c)
				})
			}
		},
		btNavegacaoClick : function(a) {
			BannerRotativo.events.preventDefault(a);
			if (a.srcElement) {
				a.target = a.srcElement
			}
			if (a.target.rel == 0) {
				BannerRotativo.stopPlay()
			} else {
				if (BannerRotativo.animando == false) {
					setTimeout( function() {
						BannerRotativo.navegar(a.target.rel);
						BannerRotativo.stopPlay(true)
					}, 30)
				}
			}
		}
	};
	