jQuery(document).ready(function($){$('a.Bookmark').live('click',function(){var btn=this;var parent=$(this).parents('.Bookmarks');var oldClass=$(btn).attr('class');$(btn).addClass('Bookmarking');$.ajax({type:"POST",url:btn.href,data:'DeliveryType=BOOL&DeliveryMethod=JSON',dataType:'json',error:function(XMLHttpRequest,textStatus,errorThrown){$(btn).attr('class',oldClass);$.popup({},XMLHttpRequest.responseText);},success:function(json){if($(parent).children().length==1){$(parent).slideUp('fast',function(){$(this).remove();});}else if($(parent).length>0){$(btn).parents('li.Item').slideUp('fast',function(){$(this).remove();});}else{$(btn).attr('title',json.AnchorTitle);$(btn).attr('class','Bookmark');if(json.State=='1')
$(btn).addClass('Bookmarked');$('.CountBookmarks',$(btn)).text(json.CountDiscussionBookmarks);}
$('a.MyBookmarks').html(json.MenuText+'<span>'+json.CountBookmarks+'</span>');gdn.processTargets(json.Targets);}});return false;});});;jQuery(document).ready(function($){$('li.Item').livequery(function(){var btn=$(this).find('a.Delete');$(btn).hide();$(this).hover(function(){$(btn).show();},function(){$(btn).hide();});});if($.morepager)
$('.MorePager').livequery(function(){$(this).morepager({pageContainerSelector:'ul.Discussions:last, ul.Drafts:last',afterPageLoaded:function(){$(document).trigger('DiscussionPagingComplete');}});});$('.DiscussionsTabs .AdminCheck :checkbox').click(function(){if($(this).attr('checked'))
$('.DataList .AdminCheck :checkbox').attr('checked','checked');else
$('.DataList .AdminCheck :checkbox').removeAttr('checked');});$('.AdminCheck :checkbox').click(function(){var checkIDs=$('.DataList .AdminCheck :checkbox');var aCheckIDs=new Array();checkIDs.each(function(){checkID=$(this);aCheckIDs[aCheckIDs.length]={'checkId':checkID.val(),'checked':checkID.attr('checked')};});$.ajax({type:"POST",url:gdn.url('/moderation/checkeddiscussions'),data:{'CheckIDs':aCheckIDs,'DeliveryMethod':'JSON','TransientKey':gdn.definition('TransientKey')},dataType:"json",error:function(XMLHttpRequest,textStatus,errorThrown){gdn.informMessage(XMLHttpRequest.responseText,{'CssClass':'Dismissable'});},success:function(json){gdn.inform(json);}});});});;jQuery(document).ready(function($){$('a.DismissAnnouncement').click(function(){var btn=this;var parent=$(this).parents('.Announcements');$.ajax({type:"POST",url:$(btn).attr('href'),data:'DeliveryType=BOOL&DeliveryMethod=JSON',dataType:'json',error:function(XMLHttpRequest,textStatus,errorThrown){$.popup({},XMLHttpRequest.responseText);},success:function(json){if($(parent).children().length==1){$(parent).slideUp('fast',function(){$(this).remove();});$(parent).prev().slideUp('fast',function(){$(this).remove();});}else{$(btn).parents('.Announcement').slideUp('fast',function(){$(this).remove();});}}});return false;});$('a.AnnounceDiscussion').livequery('click',function(){var btn=this;var row=$(btn).parents('li.Item');$.ajax({type:"POST",url:$(btn).attr('href'),data:'DeliveryType=BOOL&DeliveryMethod=JSON',dataType:'json',error:function(XMLHttpRequest,textStatus,errorThrown){$.popup({},XMLHttpRequest.responseText);},success:function(json){gdn.inform(json);if(json.RedirectUrl)
setTimeout("document.location='"+json.RedirectUrl+"';",300);}});return false;});$('a.SinkDiscussion').popup({confirm:true,followConfirm:false,afterConfirm:function(json,sender){var row=$(sender).parents('li.Item');if(json.State)
$(row).addClass('Sink');else
$(row).removeClass('Sink');if(json.LinkText)
$(sender).text(json.LinkText);}});$('a.CloseDiscussion').popup({confirm:true,followConfirm:false,afterConfirm:function(json,sender){var row=$(sender).parents('li.Item');if(json.State)
$(row).addClass('Close');else
$(row).removeClass('Close');if(json.LinkText)
$(sender).text(json.LinkText);}});$('a.DeleteDiscussion, a.DeleteDraft').popup({confirm:true,followConfirm:false,deliveryType:'BOOL',afterConfirm:function(json,sender){var row=$(sender).parents('li.Item');if(json.ErrorMessage){$.popup({},json.ErrorMessage);}else{$(row).slideUp('fast',function(){$(this).remove();});}}});});;(function(jQuery){var self=null;jQuery.fn.morepager=function(o)
{return this.each(function(){new jQuery.morepager(this,o);});};jQuery.morepager=function(e,o){this.options=o||{};this.pager_loading_class=this.options.pagerLoadingClass||'Loading';this.page_container_selector=this.options.pageContainerSelector||'undefined';this.pager_in_container=this.options.pagerInContainer||false;this.page_container=jQuery(this.page_container_selector);this.pager_row=jQuery(e);this.pager_row_id=this.pager_row.attr('id');this.extra_pager_data=this.options.extraPagerData||'';this.after_page_loaded=this.options.afterPageLoaded;this.init();};jQuery.morepager.fn=jQuery.morepager.prototype={morepager:'1.0.0'};jQuery.morepager.fn.extend=jQuery.morepager.extend=jQuery.extend;jQuery.morepager.fn.extend({init:function(){var self=this;$('#'+this.pager_row_id+' a').live('click',function(){var anchor=this;self.page_source=self.options.pageSource||$(anchor).attr('href');self.page(anchor);return false;});},page:function(anchor){var self=this;$(anchor).html('&#160;').addClass(self.pager_loading_class);var type=self.pager_row_id.substr(self.pager_row_id.length-4,self.pager_row_id.length).toLowerCase()=='more'?'more':'less';$.ajax({type:"POST",url:self.page_source,data:'DeliveryType=VIEW&DeliveryMethod=JSON&Form/TransientKey='+gdn.definition('TransientKey','')+self.extra_pager_data,dataType:'json',error:function(XMLHttpRequest,textStatus,errorThrown){$.popup({},XMLHttpRequest.responseText);},success:function(json){json=$.postParseJson(json);if(self.pager_in_container==true){if(type=='more'){self.pager_row.before(json.Data);self.pager_row.before(json.MoreRow);}else{self.pager_row.after(json.Data);self.pager_row.after(json.LessRow);}}else{if(type=='more'){self.page_container.append(json.Data);self.pager_row.before(json.MoreRow);}else{self.page_container.prepend(json.Data);self.pager_row.after(json.LessRow);}}
self.pager_row.remove();self.pager_row=$('#'+self.pager_row_id);if(self.after_page_loaded!=null)
self.after_page_loaded();}});}});})(jQuery);;jQuery(document).ready(function($){$('div.VotesBox a').live('click',function(){var btn=this;var parent=$(this).parents('.Bookmarks');var oldClass=$(btn).attr('class');$.ajax({type:"POST",url:btn.href,data:'DeliveryType=BOOL&DeliveryMethod=JSON',dataType:'json',error:function(XMLHttpRequest,textStatus,errorThrown){$(btn).attr('class',oldClass);$.popup({},definition('TransportError').replace('%s',textStatus));},success:function(json){if($(parent).children().length==1){$(parent).slideUp('fast',function(){$(this).remove();});}else if($(parent).length>0){$(btn).parents('.DiscussionRow').slideUp('fast',function(){$(this).remove();});}else{$(btn).attr('title',json.AnchorTitle);txt=$(btn).find('span').text();$(btn).html('<span>'+txt+'</span>'+json.TotalScore);$(btn).blur();}}});return false;});$('div.FollowsBox a').live('click',function(){var btn=this;var parent=$(this).parents('.Bookmarks');var oldClass=$(btn).attr('class');$.ajax({type:"POST",url:btn.href,data:'DeliveryType=BOOL&DeliveryMethod=JSON',dataType:'json',error:function(XMLHttpRequest,textStatus,errorThrown){$(btn).attr('class',oldClass);$.popup({},definition('TransportError').replace('%s',textStatus));},success:function(json){if($(parent).children().length==1){$(parent).slideUp('fast',function(){$(this).remove();});}else if($(parent).length>0){$(btn).parents('li.Item').slideUp('fast',function(){$(this).remove();});}else{$(btn).attr('title',json.AnchorTitle);if($(btn).hasClass('Bookmark')){$(btn).attr('class','Bookmark');$(btn).attr('title','Follow');if(json.State=='1'){$(btn).attr('title','Unfollow');$(btn).addClass('Bookmarked');}}else{count=$(btn).html();count=count.substr(count.lastIndexOf('>')+1);count=json.State?++count:--count;txt=$(btn).find('span').text();$(btn).html('<span>'+txt+'</span>'+count);$(btn).blur();}}
$('a.MyBookmarks span').text(json.CountBookmarks);gdn.processTargets(json.Targets);}});return false;});$('.Votes a').live('click',function(){if(!$(this).hasClass('SignInPopup')){var btn=this;var parent=$(this).parents('.Votes');var votes=$(parent).find('span');$.ajax({type:"POST",url:btn.href,data:'DeliveryType=BOOL&DeliveryMethod=JSON',dataType:'json',error:function(XMLHttpRequest,textStatus,errorThrown){$(btn).attr('class',oldClass);$.popup({},definition('TransportError').replace('%s',textStatus));},success:function(json){$(votes).text(json.TotalScore);gdn.inform(json);}});return false;}});});
