Element.implement({sep_nfa_show:function(){this.setStyle("display","")},sep_nfa_hide:function(){this.setStyle("display","none")},sep_nfa_visible:function(){if(this.getStyle("display")=="none"){return false}else{return true}},sep_nfa_toggle:function(){if(this.getStyle("display")=="none"){this.sep_nfa_show()}else{this.sep_nfa_hide()}},sep_nfa_update:function(a){this.innerHTML=a}});function SEP_NewsfeedAdvanced_post(a,b){data_string="";if(b==3){data_string=$("comment_post_form_"+a).toQueryString()}myreq2=new Request({method:"post",url:"./user_newsfeed_advanced_ajax.php",data:"_ajaxReq=1&task=post&type="+b+"&action_id="+a+"&"+data_string,onSuccess:function(c){$("ajax_inject_new_post_"+a).clone().injectBefore("ajax_inject_new_post_"+a).sep_nfa_update(c.replace(/\\n/g,"<br>"));$("comment_post_form_"+a).reset();if(b==1||b==2){$("IlikeUnlike_"+a).sep_nfa_hide();$("IlikeUnlikeCancel_"+a).sep_nfa_show()}},onFailure:function(){alert("Could not save your comment! Please try again!")}}).send()}function SEP_NewsfeedAdvanced_show_edit_form(a){if($("SEP_NewsfeedAdvanced_Edit_"+a).sep_nfa_visible()){SEP_NewsfeedAdvanced_hide_edit_form(a)}else{$("SEP_NewsfeedAdvanced_Text_"+a).sep_nfa_hide();$("SEP_NewsfeedAdvanced_Edit_"+a).sep_nfa_show();$("SEP_NewsfeedAdvanced_Textarea_Edit_"+a).focus()}}function SEP_NewsfeedAdvanced_hide_edit_form(a){$("SEP_NewsfeedAdvanced_Edit_"+a).sep_nfa_hide();$("SEP_NewsfeedAdvanced_Text_"+a).sep_nfa_show()}function SEP_NewsfeedAdvanced_edit(b,a){data_string="";if(a==3){data_string=$("comment_edit_form_"+b).toQueryString()}myreq2=new Request({method:"post",url:"./user_newsfeed_advanced_ajax.php",data:"_ajaxReq=1&task=edit&type="+a+"&id="+b+"&"+data_string,onSuccess:function(c){$("SEP_NewsfeedAdvanced_Text_"+b).sep_nfa_update(c.replace(/\\n/g,"<br>"));$("SEP_NewsfeedAdvanced_Edit_"+b).sep_nfa_hide();$("SEP_NewsfeedAdvanced_Text_"+b).sep_nfa_show()},onFailure:function(){alert("Could not save your changes! Please try again!")}}).send()}function SEP_NewsfeedAdvanced_delete(b,a){myreq2=new Request({method:"post",url:"./user_newsfeed_advanced_ajax.php",data:"_ajaxReq=1&task=delete&user_id="+b+"&action_id="+a,onSuccess:function(c){$("SEP_NewsfeedAdvanced_BoxItem_"+c).destroy();$("IlikeUnlike_"+a).sep_nfa_show();$("IlikeUnlikeCancel_"+a).sep_nfa_hide()},onFailure:function(){alert("Failed to remove!")}}).send()}function SEP_NewsfeedAdvanced_report(a){myreq2=new Request({method:"post",url:"./user_newsfeed_advanced_ajax.php",data:"_ajaxReq=1&task=report&id="+a,onSuccess:function(){$("SEP_NewsfeedAdvanced_ReportButton_"+a).destroy();alert("Thank you for reporting this comment!")},onFailure:function(){alert("Could not send your report! Please try again!")}}).send()}function SEP_NewsfeedAdvanced_toggle_box(a,b){if(b=="preview"){$("SEP_NewsfeedAdvanced_Box_Final_"+a).sep_nfa_hide();if(SEP_NewsfeedAdvanced_AutoGrow_Instance){$("SEP_NewsfeedAdvanced_Textarea_"+a).setStyle("height",SEP_NewsfeedAdvanced_AutoGrow_Instance.textarea_old_height)}$("SEP_NewsfeedAdvanced_Box_Preview_"+a).sep_nfa_show()}else{$("SEP_NewsfeedAdvanced_Box_Preview_"+a).sep_nfa_hide();$("SEP_NewsfeedAdvanced_Box_Final_"+a).sep_nfa_show();$("SEP_NewsfeedAdvanced_Textarea_"+a).focus()}}function SEP_NewsfeedAdvanced_ScrollTo(a){offset=300;div_position_y=$("SEP_NewsfeedAdvanced_Box_Final_"+a).getPosition().y;window.scrollTo(0,div_position_y-offset)}function SEP_NewsfeedAdvanced_Show_Hidden_Boxes(a){$("SEP_NewsfeedAdvanced_ShowMoreButton_"+a).sep_nfa_hide();$$("div.SEP_NewsfeedAdvanced_Box_Hidden_"+a).each(function(b){b.sep_nfa_show()})}function SEP_NewsfeedAdvanced_Check_MaxLength(a,b){if($(a).value.length>b){alert("Your comment is too long!");return false}return true}function SEP_NewsfeedAdvanced_ItemOptions(a,b){if(a=="show"){$("SEP_NewsfeedAdvanced_Box_Header_Right_Inactive_"+b).sep_nfa_hide();$("SEP_NewsfeedAdvanced_Box_Header_Right_Active_"+b).sep_nfa_show()}else{}}var SEP_NewsfeedAdvanced_AutoGrow_Instance=null;var AutoGrow=new Class({Implements:[Options,Events],options:{interval:333,margin:30,minHeight:20},periodical_timer:null,textarea_old_height:0,initialize:function(a,b){this.textarea=$(a);this.options.minHeight=a.clientHeight;this.setOptions(b);this.dummy=new Element("div",{styles:{"overflow-x":"hidden",position:"absolute",top:0,left:"-9999px"}}).setStyles(this.textarea.getStyles("font-size","font-family","width","line-height","padding")).inject(document.body);this.textarea_old_height=this.textarea.getStyle("height");this.resize();this.start()},resize:function(){var c=this.textarea.get("value").replace(/\n|\r\n/g,"<br>X");if(this.dummy.get("html").toLowerCase()!=c.toLowerCase()){this.dummy.set("html",c);var b=this.dummy.getSize().y+this.options.margin;if(this.textarea.clientHeight!=b){var a=Math.max(this.options.minHeight,b);this.textarea.tween("height",a)}}},start:function(){this.periodical_timer=this.resize.periodical(this.options.interval,this)},stop:function(){$clear(this.periodical_timer)}});