// JavaScript Document function rolarTopo(pos,px,div) { $('#' + div).animate({ scrollTop: '+=' + (px * pos) + 'px' }, 700); } $(document).ready(function(){ //////////////////////////////////// /////////// LAYOUT ///////////////// //////////////////////////////////// $('.menu li:last').css('borderRight' , 'none'); $('.simulator .target01 li:last').css('marginRight' , 0); $('.simulator .target02 li:last').css('marginRight' , 0); $('.simulator .target03 li:last').css('marginRight' , 0); $('.simulator .empresarial2 li:last').css('marginRight' , 0); /////////////////////////////////// ////// ABAS INFERIORES //////////// /////////////////////////////////// $('.buttons li').click(function(){ $(this).addClass('atv'); $(this).find('div').removeClass('view').addClass('close'); $('.lnk01').find('p').empty().append('0 a 18'); $('.lnk02').find('p').empty().append('24 a 28'); $('.lnk03').find('p').empty().append('29 a 33'); $('.lnk04').find('p').empty().append('44 a 48'); $(this).find('p').empty().append('Simulando agora'); $('.buttons li').not(this).removeClass('atv'); $('.buttons li').not(this).find('div').removeClass('close').addClass('view'); return false; }); ///////////////////////////////////// ////////// NAV. ABAS //////////////// ///////////////////////////////////// /* // Aba Individual $('.simulator #main .controls .ctrl01').click(function(){ $(this).removeClass('ctrl01').addClass('ctrl01act'); $('.simulator #main .controls li:eq(1)').removeClass('ctrl02act').addClass('ctrl02'); $('.simulator #main .controls li:eq(2)').removeClass('ctrl03act').addClass('ctrl03'); $('.target01').css('display' , 'block'); $('.target02').css('display' , 'none'); $('.target03').css('display' , 'none'); $('.empresarial2').css('display' , 'none'); }); // Aba Familiar $('.simulator #main .controls .ctrl02').click(function(){ $(this).removeClass('ctrl02').addClass('ctrl02act'); $('.simulator #main .controls li:eq(0)').removeClass('ctrl01act').addClass('ctrl01'); $('.simulator #main .controls li:eq(2)').removeClass('ctrl03act').addClass('ctrl03'); $('.target01').css('display' , 'none'); $('.target02').css('display' , 'block'); $('.target03').css('display' , 'none'); $('.empresarial2').css('display' , 'none'); }); // Aba Empresarial $('.simulator #main .controls .ctrl03').click(function(){ $(this).removeClass('ctrl03').addClass('ctrl03act'); $('.simulator #main .controls li:eq(0)').removeClass('ctrl01act').addClass('ctrl01'); $('.simulator #main .controls li:eq(1)').removeClass('ctrl02act').addClass('ctrl02'); $('.target01').css('display' , 'none'); $('.target02').css('display' , 'none'); $('.target03').css('display' , 'block'); $('.empresarial2').css('display' , 'block'); }); */ $('.target01').css('display' , 'none'); $('.target02').css('display' , 'none'); $('.target03').css('display' , 'none'); $('.empresarial2').css('display' , 'none'); //////////////////////////////////// //////// SHOW TOOLTIP ////////////// //////////////////////////////////// /* $(".simulator .stage li").hover(function(){ $(".simulator .empresarial2 li").hover(function(){ tip.hide(); }); }); $(".acomodacao #main .target01 li.area03").hover(function(){ $(".acomodacao #main .target01 li.area03").hover(function(){ tip.hide(); //Show tooltip }); }); $(".acomodacao #main .target01 .area03 li").hover(function(){ $(".acomodacao #main .target01 .area03 li").hover(function(){ tip.hide(); //Show tooltip }); }); $(".acomodacao #main .target01 li.area02").hover(function(){ $(".acomodacao #main .target01 li.area02").hover(function(){ tip.hide(); //Show tooltip }); }); $(".acomodacao #main .target01 .area02 li").hover(function(){ $(".acomodacao #main .target01 .area02 li").hover(function(){ tip.hide(); // }); }); $(".acomodacao #main .target01 li.area04").hover(function(){ $(".acomodacao #main .target01 li.area04").hover(function(){ tip.hide(); //Show tooltip }); }); $(".acomodacao #main .target01 .area04 li").hover(function(){ $(".acomodacao #main .target01 .area04 li").hover(function(){ tip.hide(); //Show tooltip }); }); $(".target01 .area01").hover(function(){ $(".target01 div").hover(function(){ tip.hide(); }); }); $(".target01 .area02").hover(function(){ $(".target01 div").hover(function(){ tip.hide(); }); }); $(".target01 .area03").hover(function(){ $(".target01 div").hover(function(){ tip.hide(); }); }); $(".target01 .area04").hover(function(){ $(".target01 div").hover(function(){ tip.hide(); }); }); $(".target01 .area05").hover(function(){ $(".target01 div").hover(function(){ tip.hide(); }); }); $(".target01 .area06").hover(function(){ $(".target01 div").hover(function(){ tip.hide(); }); }); $(".InformeFuncio").mouseover(function(){ tip.hide(); }); $("#dependentes01").mouseover(function(){ tip.show(); }); */ $("#dependentes01 a.idade").mouseover(function(){ tip.show(); }); $("#dependentes02 a.popup-open").mouseover(function(){ tip.show(); }); ///////////////////////////////////// /////////// TOOLTIP ///////////////// ///////////////////////////////////// $(".simulator .stage li a.label").hover(function(){ tip = $('body').find('.tip'); tip.show(); }, function() { tip.hide(); }).mousemove(function(e) { var mousex = e.pageX + -675; var mousey = e.pageY + -350; var tipWidth = tip.width(); var tipHeight = tip.height(); var tipVisX = $(window).width() - (mousex + tipWidth); var tipVisY = $(window).height() - (mousey + tipHeight); if ( tipVisX < 20 ) { mousex = e.pageX - tipWidth - 20; } if ( tipVisY < 20 ) { mousey = e.pageY - tipHeight - 20; } tip.css({ top: mousey, left: mousex }); }); ///////////////////////////////////// /////////// TOOLTIP ERROR /////////// ///////////////////////////////////// $(".acomodacao #main .target01 li.area04 a").hover(function(){ tiperror = $('body').find('.tiperror'); tiperror.show(); }, function() { tiperror.hide(); }).mousemove(function(e) { var mousex = e.pageX + -280; var mousey = e.pageY + -170; var tipWidth = tiperror.width(); var tipHeight = tiperror.height(); var tipVisX = $(window).width() - (mousex + tipWidth); var tipVisY = $(window).height() - (mousey + tipHeight); if ( tipVisX < 20 ) { mousex = e.pageX - tipWidth - 20; } if ( tipVisY < 20 ) { mousey = e.pageY - tipHeight - 20; } tiperror.css({ top: mousey, left: mousex }); }); var maskH = $(document).height(); var maskW = $(document).width(); $('.mask').css({'width' : maskW , 'height' : maskH , 'opacity' : '0.7'}); $('.close').click(function(){ $('.mask').hide(); $('.popup2').hide(); $('#dependentes02').show(); }); });