window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["blog_subscribers_list","blog_subscribers","unable_to_contact_server_please_try_again"]);(function(A){vBulletin=vBulletin||{};vBulletin.blog=vBulletin.blog||{};vBulletin.blog.initSeeAllSubscribers=function(){var B=A("#blogSubscribersSeeAll");if(B.length>0){B.click(function(C){vBulletin.blog.showSubscribers(A(this).attr("data-node-id"));C.stopPropagation();return false})}};vBulletin.blog.showSubscribers=function(D,C,B){if(!vBulletin.blog.blogSubscribersAllOverlay){vBulletin.blog.blogSubscribersAllOverlay=A("#blogSubscribersAll").dialog({title:vBulletin.phrase.get("blog_subscribers_list"),autoOpen:false,modal:true,resizable:false,closeOnEscape:false,showCloseButton:false,width:450,dialogClass:"dialog-container dialog-box blog-subscribers-dialog"});vBulletin.pagination({context:"#blogSubscribersAll",onPageChanged:function(E,F){vBulletin.blog.showSubscribers(D,E)}});A(".blog-subscribers-close").live("click",function(){vBulletin.blog.blogSubscribersAllOverlay.dialog("close")});A("#blogSubscribersAll .action_button").live("click",function(){if(!A(this).hasClass("subscribepending_button")){var E=A(this);var G=parseInt(E.attr("data-userid"));var F="";if(E.hasClass("subscribe_button")){F="add"}else{if(E.hasClass("unsubscribe_button")){F="delete"}}if((typeof (G)=="number")&&F){A.ajax({url:pageData.baseurl+"/profile/follow_button?do="+F+"&follower="+G+"&type=follow_members",dataType:"json",success:function(I){if(I==1||I==2){if(F=="add"){var H=(I==1)?"subscribed":"subscribepending";var J=(I==1)?"following":"following_pending";E.removeClass("subscribe_button special").addClass(H+"_button secondary").text(vBulletin.phrase.get(J))}else{if(F=="delete"){E.removeClass("subscribed_button unsubscribe_button special").addClass("subscribe_button secondary").text(vBulletin.phrase.get("follow"))}}}else{if(I.errors){openAlertDialog({title:vBulletin.phrase.get("profile_guser"),message:vBulletin.phrase.get("error_x",I.errors[0][0]),iconType:"error"})}}},error:function(){openAlertDialog({title:vBulletin.phrase.get("profile_guser"),message:vBulletin.phrase.get("unable_to_contact_server_please_try_again"),iconType:"error"})}})}}})}if(!C){C=1}if(!B){B=10}A.ajax({url:pageData.baseurl+"/index.php/ajax/render/subscribers_list",type:"POST",data:{nodeid:D,page:C,perpage:B},dataType:"json",success:function(E){if(E&&E.errors){openAlertDialog({title:vBulletin.phrase.get("blog_subscribers"),message:vBulletin.phrase.get(E.errors[0]),iconType:"error"})}else{A(".blog-subscribers-content",vBulletin.blog.blogSubscribersAllOverlay).html(E)}},error:function(){openAlertDialog({title:vBulletin.phrase.get("blog_subscribers"),message:vBulletin.phrase.get("unable_to_contact_server_please_try_again"),iconType:"error"})}});vBulletin.blog.blogSubscribersAllOverlay.dialog("open")};A(document).ready(function(){vBulletin.blog.initSeeAllSubscribers();A(".adminmenu_container .admin-mainmenu .mainmenu").unbind("mouseenter").bind("mouseenter",function(B){var C=A(this);hoverTimer=setTimeout(function(){C.removeClass("pos-top").addClass("hover").closest(".admin-mainmenu").find(".mainmenu .submenu").hide().css("top","");var H={},E=A(".submenu",C).show();if(!vBulletin.isScrolledIntoView(E,H)){var G=A(document).height()-A(window).height(),F=A(document).scrollTop(),D=Math.abs(H.bottom);if(D<=(G-F)){A("html,body").animate({scrollTop:"+="+(F+D)},"slow")}else{E.css("top",-(E.height()+1)).parent().addClass("pos-top");if(!vBulletin.isScrolledIntoView(E,H)){A("html,body").animate({scrollTop:"-="+Math.abs(H.top)},"slow")}}}},200)}).unbind("mouseleave").bind("mouseleave",function(B){clearTimeout(hoverTimer);A(".submenu",this).hide();A(this).removeClass("hover")})})})(jQuery);