function ativa(aba){ document.getElementById('aba_1').className=''; document.getElementById('aba_2').className=''; document.getElementById('aba_3').className=''; document.getElementById('frm-ht').style.display='none'; document.getElementById('frm-sv').style.display='none'; document.getElementById('frm-ps').style.display='none'; switch (aba){ case 'aba_1': document.getElementById('frm-ht').style.display='block'; document.getElementById('aba_1').className='on'; break; case 'aba_2': document.getElementById('frm-sv').style.display='block'; document.getElementById('aba_2').className='on'; break; case 'aba_3': document.getElementById('frm-ps').style.display='block'; document.getElementById('aba_3').className='on'; break; } } var cicle = 4000; function rotateImage(imagens){ var timer = 0; imagens.each(function(image) { (function(){ image.effect('opacity').start(1); }).delay(timer); timer = timer + cicle; (function(){ image.effect('opacity').start(0); }).delay(timer); }); }; window.addEvent('domready',function(){ if( $('pai_imagens') ){ var loadedImages = []; var images = [ 'http://www.lairatours.com.br/imagens/princ_fotos/exportados/2.jpg', 'http://www.lairatours.com.br/imagens/princ_fotos/exportados/3.jpg' ]; new Asset.images(images, { onProgress:function(i){ loadedImages[i] = this; }, onComplete:function(){ loadedImages.each(function(image) { $$('#pai_imagens a').adopt(image.setStyle('opacity',0)); }); rotateImage( $$('#topo-img img') ); (function(){rotateImage($$('.fotos_rot img'));}).periodical( $$('.fotos_rot img').length * cicle ); } }); } }); // --- Passageiro function qtd_passageiros(o) { o2 = $('ps-qtd'); if (o.getValue() == '') { o2.setProperty('value', 0); } else { t = o.getValue().replace(/(\n|\r|,)/gm,';'); t = t.replace(/;{2,}/gm,';'); if( t.charAt(t.length - 1) ){ t = t.substr(0,(t.length - 1)); } t = t.split(/;/gm); if (t.length > 0) { o2.setProperty('value', t.length); } else { o2.setProperty('value', 0); } } } if ( $('ps-hospedes') ) { $('ps-hospedes').addEvents({ 'keyup':function(){qtd_passageiros(this)}, 'keydown':function(){qtd_passageiros(this)}, 'keypress':function(){qtd_passageiros(this)} }); qtd_passageiros($('ps-hospedes')); } // Passageiros