$().ready(function(){AddFeedClickHandlers();});function AddFeedClickHandlers(){if(typeof showJGrowlLoadingIndicator!='function'){function showJGrowlLoadingIndicator(){if(window.loadingIndicatorCount==0)
{var loadingText='';var rand_no=Math.ceil(3*Math.random());if(rand_no==1)
loadingText='Loading';else if(rand_no==2)
loadingText='Ignighting';else if(rand_no==3)
loadingText='Processing';var baseurl=$("link[rel='baseurl']").attr('href');var url=baseurl+'Images/misc/AnimatedLogo.gif';$.jGrowl("<img src='"+url+"'><p class='loadingText'>"+loadingText+"..</p>",{theme:'loading',life:1000000});}}}
if(typeof hideJGrowlLoadingIndicator!='function'){function hideJGrowlLoadingIndicator(){$("div.loading div.close").each(function(){$(this).click();});}}
$(".activity").live('mouseover',function(){$(this).find('.trashcan, .moreless').removeClass('invisible');});$('.activity').live('mouseout',function(){$(this).find('.trashcan, .moreless').addClass('invisible');});$(".trashcan").live('click',function(){$(this).closest(".activity").slideUp('fast');showJGrowlLoadingIndicator();$.get($(this).attr('ajaxHref'),function(result){$('body').append(result);hideJGrowlLoadingIndicator();});return false;});$(".moreless").live('click',function(){var otherFeedItemsForThisGroupID=$(this).attr('rel');var url=$(this).attr('ajaxHref');var $parentActivity=$(this).closest('.activity');showJGrowlLoadingIndicator();$.get(url,function(response){$(response).appendTo('body');hideJGrowlLoadingIndicator();if($(response).is(':contains("Success")')){$('.'+otherFeedItemsForThisGroupID).slideUp('normal',function(){$(this).remove();});}});return false;});$('.AddCommentFormClick').live('click',function(){$parent=$(this).parents('.add_comment');$activity=$parent.closest('.activity');$commentWrapper=$activity.find('.CommentWrapper');$animatedLogo=$activity.find('.animatedSmallLogoWrapper');$commentForm=$parent;$animatedLogo.fadeIn('fast');$commentWrapper.slideUp('fast');showJGrowlLoadingIndicator();$FormSubmit=$('<input/>').attr('name','FormSubmit').attr('value','1');var currentURL=$("link[rel='canonical']").attr('href');$currentPageURLSubmit=$('<input/>').attr('name','currentURL').attr('value',currentURL);$commentForm.append($FormSubmit);$commentForm.append($currentPageURLSubmit);$commentWrapper.load($commentForm.attr('action'),$commentForm.serialize(),function(){hideJGrowlLoadingIndicator();$animatedLogo.fadeOut('fast');$commentWrapper.slideDown('fast');var commentCount=$commentWrapper.find(".comment").length;if(commentCount>0){$activity.find('.ClickToComment').text("Comments ("+commentCount+")");}});return false;});$(".ClickToComment").live('click',function(){$commentWrapper=$(this).closest('.activity').find('.CommentWrapper');if($commentWrapper.is(':visible')){$commentWrapper.slideUp(function(){$commentWrapper.addClass('hidden').show();});}else{showJGrowlLoadingIndicator();var currentURL=$("link[rel='canonical']").attr('href');$commentWrapper.load($(this).attr('ajaxHref'),{'currentURL':currentURL},function(){hideJGrowlLoadingIndicator();$commentWrapper.hide().removeClass('hidden').slideDown('normal');addClickHandlers();});}
return false;});$(".delete_comment").live('click',function(){var deleteURL=$(this).attr('ajaxHref');var currentURL=$("link[rel='canonical']").attr('href');var $commentContainer=$(this).parent();var originalComment=$commentContainer.html();var $commentWrapper=$commentContainer.closest('.CommentWrapper');var $activity=$commentWrapper.closest('.activity');$commentContainer.slideUp('slow');showJGrowlLoadingIndicator();$commentContainer.load(deleteURL,{'currentURL':currentURL},function(responseText){if(responseText.indexOf("success")==-1){$commentContainer.html(originalComment);$commentContainer.slideDown('slow');}else{$commentContainer.remove();var commentCount=$commentWrapper.find(".comment").length;if(commentCount>0){$activity.find('.ClickToComment').text("Comments ("+commentCount+")");}
else{$activity.find('.ClickToComment').text("Comment");}}
hideJGrowlLoadingIndicator();addClickHandlers();return false;});return false;});$(".MoreTextLink").live('click',function(){$(this).closest('.feed_text').find('.shortText, .fullText').toggleClass('hidden');return false;});$(".more_feed").live('click',function(){$(this).slideUp('fast');showJGrowlLoadingIndicator();$.get($(this).attr('ajaxHref'),function(response){hideJGrowlLoadingIndicator();$(this).remove();$(response).insertAfter('.activity:last');});return false;});$(".more_charm_activities").live('click',function(){$(this).fadeOut();showJGrowlLoadingIndicator();$.get($(this).attr('ajaxHref'),function(response){hideJGrowlLoadingIndicator();$(this).remove();$(response).appendTo('#activity_table');});return false;});$("#UpdateGroupStatus input").live('click',function(){$parent=$("#UpdateGroupStatus");$animatedLogo=$parent.siblings(".animatedSmallLogoWrapper");$statusBox=$('#status_box');$statusBox.slideUp();showJGrowlLoadingIndicator();$.get($parent.attr('ajaxAction'),$parent.serialize(),function(response){$(response).find('script').appendTo('body');$newStatusBox=$(response).find('#status_box').hide();if($newStatusBox.length){$statusBox.replaceWith($newStatusBox);}
hideJGrowlLoadingIndicator();$newStatusBox.slideDown();$newStatusBox.find('textarea').autogrow();if($('#nextFeedItemSuccess').val()==1){$.get($("#nextFeedItemAjaxURL").val(),function(feedResponse){$(feedResponse).find('.activity').insertBefore('.activity:first').hide().slideDown();});}});return false;});}