/* $BD:Slide - version 0.9.4$ $LastModified: 04/02/2006$ Sistema Free para uso pessoal ou comercial contanto que os créditos permaneçam intactos. Eu já nem estou colocando um monte de coisa pra não deixar o código pesado. ^^ Maiores Informações: http://my.opera.com/bimonti/ */ slide = { //vetor com os slides _imagens : [ ["includes/thumb.php?imagem=../upload/2e059a321a1418745e5b7874efe01850.jpg&x=270&y=210","Homem é pego no quintal de mulher e diz que pensa...","","noticia_ler.php?s=1&conteudo_id=5468"],["includes/thumb.php?imagem=../upload/dd3e7ef9d4123d9afe05d57ba102fe0b.jpg&x=270&y=210","Vagas de emprego para Santa Cruz do Rio Pardo e Ip...","","noticia_ler.php?s=7&conteudo_id=5467"],["includes/thumb.php?imagem=../upload/05a35b4bfab84c7a5b4746c6bd8f2f0a.jpg&x=270&y=210","1ª Vara-Gabinete do Juizado Especial Federal em O...","","noticia_ler.php?s=4&conteudo_id=5466"],["includes/thumb.php?imagem=../upload/3579b7609fab02cb091228a50139e034.jpg&x=270&y=210","Veja os lances da partida entre AES e Velo","","noticia_ler.php?s=3&conteudo_id=5465"],["includes/thumb.php?imagem=../upload/3eb4bebd2592ec5eba5fa4a0b4133b98.jpg&x=270&y=210","Unidade móvel do Sebrae atende em Espírito Santo...","","noticia_ler.php?s=4&conteudo_id=5464"] ], // variáveis do sistema _count : 0, _length : null, _timeOutID : null, _pause : false, _timer : 10, // função que inicia o slide e seta todas os parâmetros necessários start : function(){ with(this){ _preLoader(); _length = _imagens.length; _work(); } }, // faz o pré-carregamento das imagens _preLoader : function(){ for(x in this._imagens){ var image = new Image(); image.src = this._imagens[x][0]; } }, // função principal que faz as checagens necessárias _work : function(){ with(this){ (_count == _length) ? _count = 0 : (_count < 0) ? _count = _length-1 : void(0); var current = _imagens[_count]; _exchange(current); if(!_pause){ (typeof(_timeOutID) == "number") ? clearTimeout(_timeOutID) : void(0); _timeOutID = setTimeout(function(){ slide.next(); }, (Number(_timer)*1000)); } } }, // função que altera os elementos da página, altere os IDs se necessário _exchange : function(img){ document.getElementById("slideImg").src = img[0]; document.getElementById("linkSlide").innerHTML = img[1]; document.getElementById("textSlide").innerHTML = img[2]; document.getElementById("linkSlide").href = img[3]; document.getElementById("linkSlideImg").href = img[3]; }, // altera para o próximo slide ao clicar no botão Próximo next : function(){ with(this){ _count++; _work(); } }, // altera para o slide anterior ao clicar no botão correspondente previous : function(){ with(this){ _count--; _work(); } }, // pause e continua a apresentação pause : function(){ var img = document.getElementById("playpause"); if(this._pause){ this._pause = false; img.src = 'imagens/pause.jpg'; img.title = 'Parar'; } else{ this._pause = true; img.src = 'imagens/play.jpg'; img.title = 'Continuar'; } with(this){(typeof(_timeOutID) == "number") ? clearTimeout(_timeOutID) : void(0); _work();} } }