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("