/*
 *  (c) 2000-2013 deviantART, Inc. All rights reserved.
 */
DWait.ready(["jms/lib/gmi.js","jms/lib/browser.js","jms/lib/popup2.js"],function(){window.GroupList=GMIBase.extend({gmiConstructor:function(){},gmiDestructor:function(){this.popup&&delete this.popup},doPopup:function(){console.log(this.gmi_node);var i=$(this.gmi_node).find(".gm-chaos");return GroupList.popup=new Popup2("GroupListManage","body",{classes:"grouplist-manage",content:"<div class='blockmenu'><div style='position:relative'>"+(this.gmi_args.allowremove?"<a class='f' href='#' onclick='GMI.up(this).removeClick();Popup2.hideAll(); return GMI.evCancel();'>Remove Deviation From This Group</a>":"")+"</div></div>",destroy:!0,created:function(i){$(".modal-wrapper .modal").length&&i.$node.css("z-index",$(".modal-wrapper .modal").css("z-index")+1),i.$node.attr("gmi-redirect",this.gmi_node.getAttribute("gmindex"))}.bindTo(this),hidden:function(){i.find(".gmbutton2").removeClass("active")},shown:function(){i.find(".gmbutton2").addClass("active")}}),GroupList.popup.show(GroupList.popup.position(i,{align:"right"})),!1},scrollableParent:function(){if(!this.$scrollableParent){var i=$([1]);this.$scrollableParent=$(this.gmi_node).parents().filter(function(){i[0]=this;var e="visible"!==i.css("overflow");return delete i[0],e})}return this.$scrollableParent},removeClick:function(){confirm("Are you sure you want to remove your deviation from "+this.gmi_args.groupname+"?")&&(DiFi.pushPost("Deviation","RemoveFromGroup",[deviantART.pageData.deviationid,this.gmi_args.groupid],function(i,e){if(i){if($.each(GMI.query($(".group_featured_list.details-section").get(0),"GroupList",{match:{groupid:this.gmi_args.groupid}}),function(){$(this.gmi_node).remove()}),$(this.gmi_node).remove(),0==$(".group_featured_list > span.grp").length){var o=$(".group_featured_list")[0];$(o.firstChild).before('<span style="color: rgb(89, 116, 101); font-size: 9pt;">Not currently featured in any groups.</span>')}}else alert(e.response.content.error)}.bindTo(this)),DiFi.send())}}),window.DWait&&DWait.run("jms/pages/art/deviation.groupmenu.js")});if(window.DWait){DWait.count()}