var ROOT = "http://www.forumweb.com.br"; function trim(str){return str.replace(/^\s+|\s+$/g,"");} /* -- DOM */ jQuery(document).ready(function(){ /* -- Index - Menu */ jQuery("#navigation ul li a:eq(0)").css("background-color","#11569B"); jQuery("#navigation ul li a:eq(0)").css("color","#ffffff"); jQuery("#navigation ul li a").mouseover(function(){ jQuery("#navigation ul li a").css("color","#000000"); jQuery("#navigation ul li a").css("background-color",""); jQuery(this).css("background-color","#11569B"); jQuery(this).css("color","#ffffff"); }); /* -- Index - Tabs */ jQuery(".tabs").tabs(); /* -- Index - Slider / Salas do Fórum */ var scrollPane = jQuery('.scroll-pane'); var scrollContent = jQuery('.scroll-content'); var scrollbar = jQuery(".scroll-bar").slider({ slide:function(e, ui){ if( scrollContent.width() > scrollPane.width() ){ scrollContent.css('margin-left', Math.round( ui.value / 100 * ( scrollPane.width() - scrollContent.width() )) + 'px'); } else { scrollContent.css('margin-left', 0); } } }); scrollPane.css('overflow','hidden'); /* -- Index - Eventos TI */ jQuery('#calendar').fullCalendar({ theme: true, header: { left: 'prev,next', center: 'title', right: '' }, events: "js/return-DiasEventos.php" }); /* -- Index - Barra HostNet */ var htmlBarra = ""; jQuery("#barra-hostnet").html(htmlBarra); /* -- Interna - ler-artigo - compartilhe */ jQuery(".tab-compartilhe span:eq(0) a").click(function(){ jQuery(".tab-compartilhe #msg-compartilhe").hide(); jQuery(".tab-compartilhe span:eq(1)").show(); }); jQuery(".tab-compartilhe span:eq(1) a").click(function(){ jQuery(".tab-compartilhe #msg-compartilhe").show(); jQuery(this).parent().hide(); }); /* -- Implementacão - sub-menu jQuery */ jQuery("#sublinks ul li a[class!=sub-a]").mouseover(function(){ jQuery("#sublinks ul li").find(".sub").hide(); var submenu = jQuery(this).parents("li").find(".sub"); if( submenu.length == 1 ){ jQuery(submenu).show(); jQuery(submenu).css("left",jQuery(this).offset().left-8); } jQuery(submenu).mouseleave(function(){ jQuery(this).hide(); }); }); jQuery("#mymenu").mouseover(function(){ jQuery("#sublinks ul li").find(".sub").hide(); }); jQuery("#topo-menu").mouseleave(function(){ jQuery("#sublinks ul li").find(".sub").hide(); }); /* -- selectcode - artigo */ jQuery(".selectcode .tab2").click(function(){ if( jQuery(this).parent().next().css("height")!="100%" ){ jQuery(this).parent().next().css("height","100%"); jQuery(this).text("Minimizar"); }else{ jQuery(this).parent().next().css("height","130px"); jQuery(this).text("Expandir"); } }); /* -- coment-artigo - artigo */ function postComent(){ jQuery.post( ROOT + "/post_comentario.php", { nome: jQuery("#p_nome").val(), email: jQuery("#p_email").val(), site: jQuery("#p_site").val(), mensagem: jQuery("#p_msg").val(), codigo: jQuery("#p_codigo").val(), resposta: jQuery("#p_resposta").val(), artigo: jQuery("#p_artigo").val(), titulo: jQuery("#p_titulo").val() }, function(data){ if(trim(data)=="ok"){ Sexy.info("Comentário enviado com sucesso! Em breve a equipe de moderação irá verificar e liberar seu comentário.", {onComplete: function() { jQuery("#postar input,textarea").val(""); document.location.href=document.location.href; } }); }else{ Sexy.error(data); jQuery("#captcha_coment").click(); jQuery("#p_codigo").val(""); } }); } jQuery("#coment-artigo").click(function(){ postComent(); }); jQuery("#indicar-artigo").click(function(){ jQuery.post( ROOT + "/post_email_indique.php", { para: jQuery("#ind_para").val(), de: jQuery("#ind_de").val(), msg: jQuery("#ind_msg").val(), codigo: jQuery("#ind_codigo").val(), titulo: jQuery("#ind_titulo").val() }, function(data){ if(trim(data)=="ok"){ Sexy.info("O seu amigo(a) foi indicado(a) a ler este artigo. Obrigado por compartilhar."); jQuery(".tab-compartilhe input,textarea").val(""); }else{ Sexy.error(data); jQuery("#captcha_indique").click(); jQuery("#ind_codigo").val(""); } }); }); jQuery(".coment .button-small").click(function(){ jQuery(".comentarios").appendTo( jQuery(this).parents(".coment").next() ); jQuery(".comentarios").find("#comente").hide(); jQuery(".comentario-resposta-alerta").remove(); jQuery("#postar").append("
Resposta para: "+jQuery(this).parents(".coment").find("small.nome").text()+"
"); jQuery(".comentarios #p_resposta").val( jQuery(this).parents(".coment").find(".coment_id").val() ); jQuery("#coment-artigo").remove(); jQuery(".estrutura-postar").css("background-color","#E8F3FF"); jQuery(".estrutura-postar").css("padding","0.5em"); jQuery("#postar #coment-artigo").click(function(){ postComent(); }); jQuery(".coment").find(".operacoes").show(); jQuery(this).parents(".coment").find(".operacoes").hide(); /* @ Cancelar resposta */ jQuery("#postar #cancelar-resposta").click(function(){ document.location.href=document.location.href; }); }); /* -- Busca */ jQuery(".busca-interna button").click(function(){ if( jQuery(".busca-interna").find("#categoria").val()=="" ){ var url = jQuery(".busca-interna #root").val() + "/" + jQuery(".busca-interna #pg").val() + "/all/1/0/" + jQuery(".busca-interna").find("#q").val(); }else{ var val = jQuery(".busca-interna #categoria").val(); var acategoria = val.split('_'); var url = jQuery(".busca-interna #root").val() + "/" + jQuery(".busca-interna #pg").val() + "/" + acategoria[1] + "/1/" + acategoria[0] + "/" + jQuery(".busca-interna").find("#q").val(); } document.location.href=url; }); /* -- enviar email - colunista */ jQuery(".colunista-contato button").click(function(){ jQuery.post( ROOT + "/post_email_colunista.php", { nome: jQuery("#ce_nome").val(), email: jQuery("#ce_email").val(), data: jQuery("#ce_data").val(), msg: jQuery("#ce_msg").val(), codigo: jQuery("#ce_codigo").val() }, function(data){ if(trim(data)=="ok"){ Sexy.info("O seu amigo(a) foi indicado(a) a ler este artigo. Obrigado por compartilhar."); jQuery(".colunista-contato input,textarea").val(""); }else{ Sexy.error(data); } }); }); /* -- Obter PR */ jQuery("#obter-pr").click(function(){ jQuery(".resultado-pr img").show().attr("src",ROOT + "/images/loading1.gif"); jQuery(this).parent().parent().find(".seo-desc").hide(); jQuery.get(ROOT + "/seotools.php", { site: jQuery("#pr_url").val(), tipo: 1 },function(data){ if( data!="erro" ){ jQuery(".resultado-pr").show(); jQuery(".resultado-pr img").attr("src",ROOT + "/seotools.php?site=" + jQuery("#pr_url").val()); jQuery(".resultado-pr textarea").val(data); }else{ jQuery(".resultado-pr").hide(); jQuery("#obter-pr").parent().parent().find(".seo-desc").show(); } }); }); /* -- Obter Backlinks */ jQuery("#obter-bc").click(function(){ jQuery(".resultado-bc img").show().attr("src",ROOT + "/images/loading1.gif"); jQuery(this).parent().parent().find(".seo-desc").hide(); jQuery.get(ROOT + "/seotools.php", { site: jQuery("#bc_url").val(), tipo: 2 },function(data){ if( data!="erro" ){ jQuery(".resultado-bc").show(); jQuery(".resultado-bc span").html(data); jQuery(".resultado-bc img").hide(); }else{ jQuery(".resultado-bc").hide(); jQuery("#obter-bc").parent().parent().find(".seo-desc").show(); } }); }); /* -- busca index */ jQuery(".div-search img").click(function(){ jQuery(".search-opcoes").css("left",jQuery(".div-search").offset().left+38); jQuery(".search-opcoes").css("top",jQuery(".div-search").offset().top+38); jQuery(".search-opcoes").slideToggle(); }); jQuery(".div-search input").click(function(){ jQuery(".search-opcoes").hide(); }); jQuery(".search-opcoes button").click(function(){ var url = ROOT + "/" + jQuery(".search-opcoes input[name=stipo]:checked").val() + "/all/1/0/" + jQuery(".div-search input").val(); document.location.href=url; }); /* -- truncate */ jQuery(".topo-interna div h1").truncate(61); /* -- Analise SEO */ jQuery("#obter-relatorio").click(function(){ if( jQuery("#re_url").val().length>4 ){ var url = ROOT + "/analise-seo/" + jQuery("#re_url").val(); document.location.href=url; } }); /* -- Cursos */ jQuery(".boxx .top").mousemove(function(e){ jQuery(".cursos-desc").html( jQuery(this).parent().find(".BoxEst").html() ); jQuery(".cursos-desc").show(); jQuery(".cursos-desc").css("left",e.pageX+20); jQuery(".cursos-desc").css("top",e.pageY+20); }); jQuery(".boxx .top").mouseleave(function(e){ jQuery(".cursos-desc").hide(); }); });