slide_noticia = { // vetor com os slides _imagens_noticia : [ ["imagemdim.php?img_larg=526&img_alt=268&imagem=..//ftdestaquehome/13232806504edfa90aaa60b.JPG","REFLEXOLOGIA PODAL E ÓLEOS ESSENCIAIS","","http://www.firval.com.br/v3/index.php?pagina=cursos&idcurso=169"],["imagemdim.php?img_larg=526&img_alt=268&imagem=..//ftdestaquehome/13235378984ee395ea60464.jpg","ESPECIALIZAÇÃO LATO SENSU EM ACUPUNTURA","","http://www.firval.com.br/v3/index.php?pagina=cursos&idcurso=182"],["imagemdim.php?img_larg=526&img_alt=268&imagem=..//ftdestaquehome/13220759134ecd4709c7a20.JPG","PILATES NO SOLO","","http://www.firval.com.br/v3/index.php?pagina=cursos&idcurso=177"],["imagemdim.php?img_larg=526&img_alt=268&imagem=..//ftdestaquehome/13220758564ecd46d04d12c.JPG","ACUPUNTURA ESTÉTICA FACIAL","","http://www.firval.com.br/v3/index.php?pagina=cursos&idcurso=170"],["imagemdim.php?img_larg=526&img_alt=268&imagem=..//ftdestaquehome/13232806024edfa8daee853.JPG","PILATES NA BOLA (OVERBALL, THERABAND E FLEXRING)","","http://www.firval.com.br/v3/index.php?pagina=cursos&idcurso=178"],["imagemdim.php?img_larg=526&img_alt=268&imagem=..//ftdestaquehome/13232806714edfa91fed0c7.JPG","SHIATSU PRÁTICO","","http://www.firval.com.br/v3/index.php?pagina=cursos&idcurso=173"],["imagemdim.php?img_larg=526&img_alt=268&imagem=..//ftdestaquehome/13221564684ece81b417ef9.jpg","ACUPUNTURA AURICULAR","","http://www.firval.com.br/v3/index.php?pagina=cursos&idcurso=168"],["imagemdim.php?img_larg=526&img_alt=268&imagem=..//ftdestaquehome/13232813584edfabced326f.JPG","POS GRADUAÇÃO LATO SENSU EM GERONTOLOGIA","","http://www.firval.com.br/v3/index.php?pagina=cursos&idcurso=158"],["imagemdim.php?img_larg=526&img_alt=268&imagem=..//ftdestaquehome/13232807684edfa9803a511.JPG","PÓS-GRADUAÇÃO EM GESTÃO DA SAÚDE, SEGURANÇA DO TRABALHO E ERGONOMIA (ESPECIALIZAÇÃO EM FISIOTERAPIA DO TRABALHO)","","http://www.firval.com.br/v3/index.php?pagina=cursos&idcurso=134"],["imagemdim.php?img_larg=526&img_alt=268&imagem=..//ftdestaquehome/13232814954edfac5776196.JPG","PÓS GRADUAÇÃO NAS DISFUNÇÕES NEUROLÓGICAS ","","http://www.firval.com.br/v3/index.php?pagina=cursos&idcurso=27"],["imagemdim.php?img_larg=526&img_alt=268&imagem=..//ftdestaquehome/13232815414edfac851eb4b.JPG","PÓS GRADUAÇÃO EM FISIOLOGIA DO ESFORÇO E REABILITAÇÃO CARDIOVASCULAR","","http://www.firval.com.br/v3/index.php?pagina=cursos&idcurso=149"],["imagemdim.php?img_larg=526&img_alt=268&imagem=..//ftdestaquehome/13232816554edfacf7f0e9b.JPG","PÓS GRADUAÇÃO EM FISIOTERAPIA DERMATO FUNCIONAL","","http://www.firval.com.br/v3/index.php?pagina=cursos&idcurso=29"],["imagemdim.php?img_larg=526&img_alt=268&imagem=..//ftdestaquehome/13232817714edfad6bc0d63.JPG","PÓS-GRADUAÇÃO EM EDUCAÇÃO POSTURAL","","http://www.firval.com.br/v3/index.php?pagina=cursos&idcurso=100"] ], // ID dos elementos que o sistema modifica // ID da imagem do slide _slideImg_noticia : 'slideImg_noticia', // ID do link do slide, ou seja, um elemento A _linkSlide_noticia : 'linkSlide_noticia', // ID do título do slide, uma div ou span por exemplo _titleSlide_noticia: 'titleSlide_noticia', // ID do título do slide, idêntico ao de cima _textSlide_noticia : 'textSlide_noticia', // ID da imagem de play|pause _playPause_noticia : 'playpause_noticia', // ID da div que mostra ou esconde as opções de customização de tempo // essa opção pode ser omitida do usuário, basta retirar o botão // settings da página, e como a div já vem com o display:none por // padrão o usuário não terá acesso a essas opções. _showTimer_noticia : 'showTimer_noticia', // variáveis do sistema // Daqui para baixo não é necessário alterar mais nada, aqui o sistema // cuidará de tudo _count_noticia : 0, _length_noticia : null, _timeOutID_noticia : null, _pause_noticia : false, _timer_noticia : 10, // função que inicia o slide e seta todas os parâmetros necessários start_noticia : function(){ with(this){ _preLoader_noticia(); _length_noticia = _imagens_noticia.length; _work_noticia(); } }, // faz o pré-carregamento das imagens _preLoader_noticia : function(){ for(x in this._imagens_noticia){ var image_noticia = new Image(); image_noticia.src = this._imagens_noticia[x][0]; } }, // função principal que faz as checagens necessárias _work_noticia : function(){ with(this){ (_count_noticia == _length_noticia) ? _count_noticia = 0 : (_count_noticia < 0) ? _count_noticia = _length_noticia-1 : void(0); var current_noticia = _imagens_noticia[_count_noticia]; _exchange_noticia(current_noticia); if(!_pause_noticia){ (typeof(_timeOutID_noticia) == 'number') ? clearTimeout(_timeOutID_noticia) : void(0); _timeOutID_noticia = setTimeout( function(){ slide_noticia.next_noticia(); fade_noticia(0,0,$(_slideImg_noticia)); }, (Number(_timer_noticia)*1000) ); } } }, // função que altera os elementos da página, altere os IDs se necessário _exchange_noticia : function(img){ this.$(this._slideImg_noticia).src = img[0]; this.$(this._titleSlide_noticia).innerHTML = img[1]; this.$(this._textSlide_noticia).innerHTML = img[2]; this.$(this._linkSlide_noticia).href = img[3]; this.fade_noticia(0,100,this.$(this._slideImg_noticia)); }, // altera para o próximo slide ao clicar no botão Próximo next_noticia : function(){ with(this){ _count_noticia++; _work_noticia(); } }, // altera para o slide anterior ao clicar no botão correspondente previous_noticia : function(){ with(this){ _count_noticia--; _work_noticia(); } }, // pausa e continua a apresentação pause_noticia : function(){ var img = this.$(this._playPause_noticia); if(this._pause_noticia){ this._pause_noticia = false; img.src = 'img_destaque/pause.gif'; img.title_noticia = 'Parar'; } else{ this._pause_noticia = true; img.src = 'img_destaque/play.gif'; img.title_noticia = 'Continuar'; } with(this){(typeof(_timeOutID_noticia) == 'number') ? clearTimeout(_timeOutID_noticia) : void(0); _work_noticia();} }, // controla o tempo de troca de cada slide tControl_noticia : function(act){ with(this){ (act=='m')?((_timer_noticia==4)?void(0):_timer_noticia=_timer_noticia-1):((_timer_noticia==9)?void(0):_timer_noticia= _timer_noticia +1); this.$(this._showTimer_noticia).innerHTML = _timer_noticia+'s'; } }, // altera a opacidade do elemento e suaviza a transição entre os slides fade_noticia : function (){ var type_noticia,signal_noticia; var from_noticia = arguments[0]; var to_noticia = arguments[1]; var el_noticia = arguments[2]; (document.all) ? type_noticia = 'filter' : type_noticia = 'opacity'; (from_noticia>to_noticia) ? signal_noticia = '-' : signal_noticia= '+'; if(from_noticia >= to_noticia/2){ from = eval(from_noticia+signal_noticia+10); }else{ from = eval(from_noticia+signal_noticia+5); } if(type_noticia=='opacity'){ try{el.style[type_noticia] = Number(from_noticia*0.01); }catch(e){} }else{ try{el.style[type_noticia] = 'alpha(opacity='+from_noticia+')'; }catch(e){} } if(from_noticia != to_noticia){ setTimeout( function(){ slide_noticia.fade_noticia(from_noticia,to_noticia,slide_noticia.$(slide_noticia._slideImg_noticia)); } ,50); } }, // retorna o elemento solicitado através de seu ID $ : function(){ return document.getElementById(arguments[0]); } }