function fakeRadio(){ $$('a[inputId="'+this.readAttribute('inputId')+'"]').each(function (e){e.removeClassName('radioFocus')}); if($(this.readAttribute('inputId')).value != this.readAttribute('value')){ this.addClassName('radioFocus'); $(this.readAttribute('inputId')).value = this.readAttribute('value'); }else{ this.removeClassName('radioFocus'); $(this.readAttribute('inputId')).value = ''; } } var fotoAtual = ''; preloadImage = new Image(); function popImagem( _ele ){ if( !_ele ){ $('emailContentInner').update(''); new Effect.Morph('emailContent',{ style:'width:100px; height:102px; left:-65px;', duration:0.3, afterFinish: function(){ $('emailContent').hide(); } }); }else{ new Effect.Appear($('emailContent')); $('emailContentInner').update('Carregando...').show(); preloadImage.src = _ele.href; preloadImage.onload = function(){ new Effect.Morph('emailContent',{ style:'width:'+preloadImage.width+'px; height:'+preloadImage.height+'px; left:-'+ (preloadImage.width+20)/2 +'px; ', duration:0.3, afterFinish: function(){ var imagem = document.createElement("img"); imagem.setAttribute('src', preloadImage.src); $('emailContentInner').update(imagem); } }); }; } } function flashPutHref( _v ){ } function imprimir( ){ window.print(); } function adicionarFavorito( _id ){ new Ajax.Request('http://www.oralimplante.com.br/_ajax.php?acao=adicionarFavorito&id='+_id, { onComplete: function(transport) { var notice = $('marker_'+_id); if (transport.responseText == 'ok'){ notice.removeClassName("desmarcado"); notice.addClassName("marcado"); } } }); } function cadastraNewsletter(){ var email = $('newsletterEmail').value; $('newsLetterResponse').update("Carregando..."); new Ajax.Updater($('newsLetterResponse'),'http://www.oralimplante.com.br/_ajax.php?acao=cadastraNewsletter&email='+email); } function confirmaSenha(){ if($F('senha') != $F('confirmacao')){ alert('A senha deve ser digitada igualmente no campo de confirmação'); $('confirmacao').value = ''; $('senha').focus(); } } var valid; var imgC = 0; function sendWindowForm(){ //if(valid.validate()){ new Ajax.Request('http://www.oralimplante.com.br/_ajax.php?acao=validaFormCadastro&convite='+$F('convite')+'&captcha='+$F('captcha'),{ onComplete: function( resposta ){ if(resposta.responseText.isJSON()){ var res = resposta.responseText.evalJSON(); if(res.convite != 'ok'){ alert('O convite que você informou não é válido ou já foi usado por outra pessoa. Confirme se você digitou corretamente ou entre em contato para obter um novo convite'); $('confirmacao').value = ''; return false; }else{ if(res.captcha != 'ok'){ alert('O código de segurança não foi digitando corretamente. Tente com este novo código. O certo era: ' + res.captcha); $('imgauth').src = 'http://www.oralimplante.com.br//_shared/_php/imgauth.php?' + ( imgC++ ) ; return false; }else{ if($F('senha') != $F('confirmacao')){ alert('A senha deve ser digitada igualmente no campo de confirmação'); $('confirmacao').value = ''; $('senha').focus(); return false; }else{ $('formularioForm').submit() //return true; } } } }else{ alert('Não foi possível validar os dados do cadastro neste momento. Tente novamente'); return false; } } }); return false; //return true; //} //return false; } function blog_focus(){ this.addClassName('inputFocus'); this.previous('label').addClassName('labelFocus'); } function blog_blur(){ this.removeClassName('inputFocus'); this.previous('label').removeClassName('labelFocus'); } function showH3(){ this.descendants()[1].appear() } function hideH3(){ this.descendants()[1].fade() } function init() { $$(".inputField").each(function(_ele){ Event.observe(_ele, 'focus', blog_focus.bindAsEventListener(_ele)); Event.observe(_ele, 'blur', blog_blur.bindAsEventListener(_ele)); }); $$('a.radio').each(function (_ele){ Event.observe(_ele, 'click', fakeRadio.bindAsEventListener(_ele)); }); /* $$('._itemListaBloco').each( function(_ele){ Event.observe(_ele,"mouseover",showH3.bindAsEventListener(_ele)); Event.observe(_ele,"mouseout",hideH3.bindAsEventListener(_ele)); }); */ } document.observe("dom:loaded",init);