function popProduto(pid){ w = window.open("http://www.capriturismo.com.br/produtos.php?id="+pid,"produto","top=0,scrollbars=yes,left=0,resizable=yes"); w.focus(); } function solicitarDadosPedido( id ){ $('emailResponse').update('').setStyle({ background: '#fff' }); if($('emailContent').visible()){ $('emailContent').hide(); }else{ var arrayPageSize = getPageSize(); $('emailContent').setStyle({'left': ((arrayPageSize[2]/2)-250)+"px"}); var arrayPageScroll = getPageScroll(); var lightboxTop = arrayPageScroll[1] + (arrayPageSize[3] / 10); $('emailContent').setStyle({'top': lightboxTop+"px"}); $('emailContent').toggle(); $('emailContentInner').show(); new Ajax.Updater($('emailContentInner'),'http://www.capriturismo.com.br/_ajax.php?acao=solicitarDadosPedido&id='+id,{evalScripts:true}); } } function enviarDadosPedido(){ new Effect.Appear($('emailResponse'),{duration: 1}); $('emailResponse').update('Enviando...').setStyle({ background: '#FFFF99' }); new Ajax.Request('http://www.capriturismo.com.br/_ajax.php?'+$('formularioForm').serialize(),{ onComplete: function(transport) { if(transport.responseText == 'ok'){ $('emailResponse').update('Seus dados foram enviados com sucesso para nossos agentes, em breve entraremos em contato para formalização da compra de pacotes online').setStyle({ background: '#dfd' }); new Effect.Fade($('emailContentInner'),{duration: 1}); new Effect.Fade($('emailContent'),{duration: 0.2}); new Effect.Fade($('productCompListDiv'),{duration: 1}); }else{ Effect.Queues.interval = 300; $('emailResponse').update('Não foi possível enviar seu pedido de compra de pacote turístico neste momento, tente novamente.').setStyle({ background: '#fdd' }); new Effect.Fade($('emailResponse'),{duration: 1, queue: 'end'}); } } }); return false; } function recomendarPacote(id){ $('emailResponse').update('').setStyle({ background: '#fff' }); if($('emailContent').visible()){ $('emailContent').hide(); }else{ var arrayPageSize = getPageSize(); $('emailContent').setStyle({'left': ((arrayPageSize[2]/2)-250)+"px"}); var arrayPageScroll = getPageScroll(); var lightboxTop = arrayPageScroll[1] + (arrayPageSize[3] / 10); $('emailContent').setStyle({'top': lightboxTop+"px"}); $('emailContent').toggle(); $('emailContentInner').show(); new Ajax.Updater($('emailContentInner'),'http://www.capriturismo.com.br/_ajax.php?acao=recomendarPacote&idpacotes='+id,{evalScripts:true}); } } function enviarRecomendacao(){ new Effect.Appear($('emailResponse'),{duration: 1}); $('emailResponse').update('Enviando...').setStyle({ background: '#FFFF99' }); new Ajax.Request('http://www.capriturismo.com.br/_ajax.php?'+$('formularioForm').serialize(),{ onComplete: function(transport) { if(transport.responseText == 'ok'){ $('emailResponse').update('Seus dados foram enviados com sucesso para nossos agentes, em breve entraremos em contato para formalização da compra de pacotes online').setStyle({ background: '#dfd' }); new Effect.Fade($('emailContentInner'),{duration: 1}); new Effect.Fade($('emailContent'),{duration: 0.2}); }else{ $('emailResponse').update('Não foi possível enviar seu pedido de compra de pacote turístico neste momento, tente novamente.').setStyle({ background: '#fdd' }); new Effect.Fade($('emailResponse'),{duration: 1, queue: 'end'}); } } }); return false; } function popPacote(url){ var arrayPageSize = getPageSize(); l = (arrayPageSize[2]/2)-400; t = 300; w = window.open(url,"produto","top=0,scrollbars=yes,left=0,resizable=yes, width=800, height=500, top="+t+", left="+l+""); w.focus(); } function popComparacao(){ w = window.open("http://www.capriturismo.com.br/comparacao.php","comparacao","top=0,scrollbars=yes,left=0,resizable=yes"); w.focus(); } function popAtendimento(){ w = window.open('http://www.capriturismo.com.br/online/request_email.php?l=admin&x=1&deptid=0',"atendimetno","width=500,height=450,scrollbars=yes,left=0,resizable=yes"); w.focus(); } function marcarComparacao(pid){ new Ajax.Updater($('productCompListUl'),'http://www.capriturismo.com.br/_ajax.php?acao=marcarComparacao&id='+pid, { onComplete: function(transport) { $$('.marker').each(function(n) { n.setStyle({ background: 'url(http://www.capriturismo.com.br/_shared/images/star_on.gif) no-repeat left' }); }); if( ! $('productCompListDiv').visible()) $('productCompListDiv').show(); } }); } function marcarComparacaoExterna(pid){ alert($('frameLink').contentDocument.title); return; new Ajax.Updater($('productCompListUl'),'http://www.capriturismo.com.br/_ajax.php?acao=marcarComparacao&title='+$('frameLink').contentDocument.title+'&location='+$('frameLink').contentDocument.location, { onComplete: function(transport) { $$('.marker').each(function(n) { n.setStyle({ background: 'url(http://www.capriturismo.com.br/_shared/images/star_on.gif) no-repeat left' }); }); if( ! $('productCompListDiv').visible()) $('productCompListDiv').show(); } }); } function selecionaPaises(pais){ $('divporCidades').show(); new Ajax.Updater($('divporCidades'),'http://www.capriturismo.com.br/_ajax.php?acao=selecionaCidades&pais='+pais); } function selecionaCidades(cidade){ $('divporHoteis').update("Carregando..."); $('divporPacotes').update("Carregando..."); $('divporHoteis').show(); $('divporPacotes').show(); new Ajax.Updater($('divporHoteis'),'http://www.capriturismo.com.br/_ajax.php?acao=selecionaHoteis&cidade='+cidade); new Ajax.Updater($('divporPacotes'),'http://www.capriturismo.com.br/_ajax.php?acao=selecionaPacotes&cidade='+cidade); } function cadastraNewsletter(){ var email = $('baseNewsEmail').value; $('newsLetterResponse').update("Carregando..."); new Ajax.Updater($('newsLetterResponse'),'http://www.capriturismo.com.br/_ajax.php?acao=cadastraNewsletter&email='+email); } function getPageSize(){ var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = document.body.scrollWidth; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (self.innerHeight) { // all except Explorer windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other Explorers windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } // for small pages with total height less then height of the viewport if(yScroll < windowHeight){ pageHeight = windowHeight; } else { pageHeight = yScroll; } // for small pages with total width less then width of the viewport if(xScroll < windowWidth){ pageWidth = windowWidth; } else { pageWidth = xScroll; } arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) return arrayPageSize; } function getPageScroll(){ var yScroll; if (self.pageYOffset) { yScroll = self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict yScroll = document.documentElement.scrollTop; } else if (document.body) {// all other Explorers yScroll = document.body.scrollTop; } arrayPageScroll = new Array('',yScroll) return arrayPageScroll; } function flashPutHref(){ } var aeroportos = ["Alta Floresta(AFL)" , "Altamira(ATM)" , "Aracaju(AJU)" , "Araguaína(AUX)" , "Araraquara(AQA)" , "Araxá(AAX)" , "Araçatuba(ARU)" , "Belo Horizonte, Confins(CNF)" , "Belo Horizonte, Pampulha(PLU)" , "Barreiras(BRA)" , "Barretos(BAT)" , "Bauru(BAU)" , "Belém(BEL)" , "Boa Vista(BVB)" , "Bonito(BYO)" , "Brasília(BSB)" , "Campinas(CPQ)" , "Campo Grande(CGR)" , "Campos(CAW)" , "Caracas(CCS)" , "Carajás(CKS)" , "Cascavel(CAC)" , "Caxias do Sul(CXJ)" , "Chapecó(XAP)" , "Comandatuba(UNA)" , "Corumbá(CMG)" , "Criciúma(CCM)" , "Cuiabá(CGB)" , "Curitiba(CWB)" , "Dourados(DOU)" ,"Fer. Noronha(FEN)" ,"Florianópolis(FLN)" ,"Fortaleza(FOR)" ,"Foz do Iguaçu(IGU)" ,"Franca(FRC)" , "Goiânia(GYN)" ,"Gov. Valadares(GVR)" ,"Ilhéus(IOS)" ,"Imperatriz(IMP)" ,"Ipatinga(IPN)" ,"Itaituba(ITB)" ,"Ji-Paraná(JPR)" ,"Joinville(JOI)" ,"João Pessoa(JPA)" , "Juazeiro do Norte(JDO)" ,"Lençóis(LEC)" ,"Lima(LIM)" ,"Lisboa(LIS)" ,"Londrina(LDB)" ,"Macapá(MCP)" ,"Macaé(MEA)" ,"Maceió(MCZ)" ,"Manaus(MAO)" ,"Marabá(MAB)" , "Maringá(MGF)" ,"Marília(MII)" ,"Montes Claros(MOC)" ,"Natal(NAT)" ,"Navegantes(NVT)" ,"Palmas(PMW)" ,"Parintins(PIN)" ,"Paulo Afonso(PAV)" ,"Pelotas(PET)" , "Petrolina(PNZ)" ,"Porto(OPO)" ,"Porto Alegre(POA)" ,"Porto Santo(PXO)" ,"Porto Seguro(BPS)" ,"Porto Velho(PVH)" ,"Pres. Prudente(PPB)" ,"Rio de Janeiro, Galeão(GIG)" , "Rio de Janeiro, S.Dumont(SDU)" ,"Recife(REC)" ,"Ribeirão Preto(RAO)" ,"Rio Branco(RBR)" ,"Rio Grande(RIG)" ,"Rondonópolis(ROO)" ,"S.J.Rio Preto(SJP)" ,"São Paulo, Congonhas(CGH)" , "São Paulo, Guarulhos(GRU)" ,"Salvador(SSA)" ,"San Jose(SJC)" ,"Santa Maria(RIA)" ,"Santa Rosa(SRA)" ,"Santana do Livramento(LVB)" ,"Santarém(STM)" ,"Santo Angelo(GEL)", "São Luis(SLZ)" ,"Sinop(OPS)" ,"Sorocaba(SOD)" , "Teresina(THE)" , "Trombetas(TMT)" , "Tucuruí(TUR)" , "Uberaba(UBA)" , "Uberlândia(UDI)" , "Uruguaiana(URG)" , "Vilhena(BVH)" , "Vitória(VIX)" , "Vitória Conquista(VDC)","Asuncion(ASU)", "Atlanta(ATL)", "Borba(RBB)", "Bordeaux(BOD)", "Boston(BOS)", "Buenos Aires(BUE)", "Cayena(CAY)", "Chicago(CHI)", "Ciudad del Este(PDP)", "Cleveland(CLE)", "Coarí(CIZ)", "Cochabamba(CBB)", "Córdoba(COR)", "Dallas(DFW)", "Denver(DEN)", "Detroit(DTT)", "Houston(HOU)", "Indianápolis(IND)", "Jacksonville(JAX)", "Las Vegas(LAS()", "Lima(LIM)", "Londres-Heathrow(LHR)", "Los Angeles(LAX)", "Lyon(LYS)", "Manicoré(MNX)", "Maoéz(MBZ)", "Marseille(MRS)", "Miami(MIA)", "Milão -Malpensa(MXP)", "Minneapolis(MSP)", "Montevidéo(MVD)", "Montpelier(MPV)", "Nantes(NTE)", "New Orleans(MSY)", "Nice NCE()", "NYC - Kennedy(JFK)", "NYC - La Guardia(LGA)", "NYC - Newark(EWR)", "Orlando(COM)", "Panamá City(PTY)", "Paris(PAR)", "Philadelphia(PHL)", "Phoenix(PHX)", "Portland(PDX)", "Rosário(ROS)", "Saint Louis(STL)", "Salt Lake City(SLC)", "San Francisco(SFO)", "San Jose(SJO)", "Santa Cruz de la Sie(SRZ)", "Santarém(STM)", "Santiago(SCL)", "Santo Angelo(GEL)", "Seattle(SEA)", "Strasbourg(SXB)", "Tefé(TFF)", "Toulouse(TLS)", "Washington(WAS)"]; function listaAeroportos(ele){ if(ele.value.length > 1){ $(ele.name+'Select').show().update(); aeroportos.each(function( _a ){ if(_a.toLowerCase().startsWith(ele.value.toLowerCase())){ $(ele.name+'Select').insert(''); } }); } }; function setaAero(_ele){ $(_ele.name.replace("Select","")).value = _ele.value; _ele.value.sub(/\((.*?)\)/,function(match){ $("aeroporto"+_ele.name.replace("Select","")).value = match[1]; }); $(_ele).hide(); } function blog_focus(){ this.addClassName('inputFocus'); this.previous('label').addClassName('labelFocus'); } function blog_blur(){ this.removeClassName('inputFocus'); this.previous('label').removeClassName('labelFocus'); } 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)); }); } window.onload = init;