function sanitizeURL(s){if(!s||s==""){return s;}var _2=s.indexOf(":");if(_2!=-1){var st=s.substr(0,_2);if((st!=("http"))&&(st!=("https"))&&(st!=("ftp"))&&(st!="mailto")){s="http://"+s;}}else{s="http://"+s;}return s;}function sanitize(s){if(s==null||s==""){return s;}s=s.replace(/<!--(.|\n)*?-->/mg,"");s=s.replace(/<(title|script|style|meta|link)\b((.|\n)*?)<\/\1\b(.*?)>/gmi,"");s=s.replace(/<(title|script|style|meta|link)\b((.|\n)*?)>/gmi,"");s=s.replace(/<\/?(html|head|(x?meta)|title|script|style|link|noembed|bgsound|frame|frameset|noframes)((.|\n)*?)>\n*?/gmi,"");s=s.replace(/<\/?([a-z].*)\b[^>]*>/gmi,function(_1){_1=_1.replace(/\\0/gmi,"");_1=_1.replace(/<\/?body/gmi,function(_5){if(_5.toLowerCase()=="<body"){_5="<div";}else{_5="</div";}return _5;});_1=_1.replace(/\/\*[^*]+\*\//gmi,"");_1=_1.replace(/\Won[A-Z]*(\\s)*?=(\\s)*?(\'|\"|`)(.|\n)*?(\3)/gmi,"");_1=_1.replace(/\Wclass(\\s)*?=(\\s)*?(\'|\"|`)(.|\n)*?(\3)/gmi,"");_1=_1.replace(/\Wid(\\s)*?=(\\s)*?(\'|\"|`)(.|\n)*?(\3)/gmi,"");_1=_1.replace(/\Wdocument\.cookie/gmi,"");_1=_1.replace(/\.cookie/gmi,"");_1=_1.replace(/\Wwindow\.location/gmi,"");_1=_1.replace(/\.location/gmi,"");_1=_1.replace(/\Wjavascript(\\s|\n)*?:/gmi,"");_1=_1.replace(/(href|src)(\\s|\n)*?=(\\s|\n)*?(\'|\"|`)((.|\n)*?)[^\\](\4)/gmi,function(_2){var _8=_2.substr(0,3).toLowerCase();var _9=null;if(_8=="hre"){_9=new RegExp("('|\"|`)((https?|ftp)|(mailto)):","gmi");}else{if(_8=="src"){_9=new RegExp("('|\"|`)(https?):|(^/GetImage?imageName=)","gmi");}}_2=_2.replace(/(\'|\"|`)((.|\n)*?)[^\\](\1)/gmi,function(_3){if(!_9.test(_3)){_3="\"\"";}return _3;});return _2;});_1=_1.replace(/style(\\s|\n)*?=(\\s|\n)*?(\'|\"|`)((.|\n)*?)[^\\](\3)/gmi,function(_4){_4=_4.replace(/url\((.|\n)*?\)/gmi,"");_4=_4.replace(/expression\((.|\n)*?\)/gmi,"");return _4;});return _1;});s=s.replace(/<[a-z][a-z0-9]*\s?:\s?[a-z][a-z0-9]*[^>]*>/gmi,"");s=s.replace(/\s*?\n$/gmi,"");if(s.length>40000){alert(i18n["zohodiscussions.general.textExceedMaximumSizeMessage"]);s=s.substring(0,40000);}return s;}function validate(_c){var _d=$(":input",_c);var _e=true;var _f=/^[\-|\+]?\d+$/;var _10="Please enter a valid integer number";var _11=/^[\-|\+]?(?:\d*\.?\d+|\d+\.)$/;var _12="Please enter a valid number";var _13="^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[a-zA-Z]{2,6}$";var _14="Please enter a valid email";var _15=/^(?:[a-zA-Z0-9]([\w\-\.\+]*)@([\w\-\.]*)(\.[a-zA-Z]{2,4}(\.[a-zA-Z]{2}){0,2}),?\s*)+$/i;var _16="Please enter a valid email ids";var _17=/^([\w-]+(?:[\w-]+)*)$/i;var _18="Please enter a valid id. Spaces are not allowed";var _19=/^(?:(?:\w|\d)+\.)+[a-zA-Z0-9]{2,6}$/;var _1a="Please enter a valid URL";var _1b="Sorry. The entered value does not match the required pattern";var _1c=_c.attr("isTipper")=="true";_d.filter("[trim=\"true\"]").each(function(_1d,_1e){$(_1e).val($(_1e).val().replace(/^\s+/,"").replace(/\s+$/,""));}).end().filter("[mandatory=\"true\"]").each(function(_1f,_20){var _21=$(_20);if(_21.val()==""){message=getCustomMessage(_21,_21.attr("title")+" cannot be left blank! Please provide a value");showError(_21,message,_1c);_e=false;}}).end().filter("[dataType]").each(function(_22,_23){var _24=$(_23);var _25=_24.val();if(_25&&_25!=""){var _26=_24.attr("dataType");try{_26=_26.toLowerCase();var _27=eval(_26+"_pattern");var _28=eval(_26+"_message");if(_25.match(_27)==null){showError(_24,getCustomMessage(_24,_28),_1c);_e=false;}}catch(e){return;}}}).end().filter("[pattern]").each(function(_29,_2a){var _2b=$(_2a);if(!_2b.parents().is(":hidden")&&_2b.is(":visible")){var _2c=_2b.val();if(_2c&&_2c!=""){var _2d=eval(_2b.attr("pattern"));var _2e=_1b;if(_2c.match(_2d)==null){showError(_2b,getCustomMessage(_2b,_2e),_1c);_e=false;}}}});return _e;}function getCustomMessage(_2f,_30){try{customMessage=_2f.attr("message");if(!customMessage||customMessage==""){customMessage=_30;}return customMessage;}catch(e){return _30;}}function showError(_31,_32,_33){if(_33){showTipper(_32,"failure");return false;}else{var _34=_31.attr("name")+"_Error";$("#"+_34).html(_32).show();return false;}}function doAjaxAction(_35,_36,_37,_38){$.ajax({url:_35,type:"POST",data:_36,error:_38,success:_37});}function showLoadingImage(_39){_39=_39||i18n["zohodiscussions.general.loading"]+"...";$("#loadingImg").html(_39).show();}function hideLoadingImage(){$("#loadingImg:visible").hide();$("#ajaxLoaderSmall").remove();}function showSmallLoadingImage(_3a,_3b,_3c){_3b=(_3b!=undefined)?_3b:20;_3c=(_3c!=undefined)?_3c:0;var _3d={};_3d.top=_3a.pageY-_3b;_3d.left=_3a.pageX-_3c;var _3e=$("#ajaxLoaderSmallTemp").clone();_3e.attr("popoutPurpose","ajaxLoaderSmall");_3e.attr("id","ajaxLoaderSmall");_3e.css(_3d).show();_3e.appendTo("body");_3e.siblings("div[popoutPurpose=\"ajaxLoaderSmall\"]").remove();}function showSmallLoadingImageForCont(_3f,_40,_41){_40=(_40!=undefined)?_40:0;_40=_3f.offset().top+_40;_41=(_41!=undefined)?_41:0;_41=_3f.offset().left+_41;var _42={};_42.top=_40;_42.left=_41;var _43=$("#ajaxLoaderSmallTemp").clone();_43.attr("popoutPurpose","ajaxLoaderSmall");_43.attr("id","ajaxLoaderSmall");_43.css(_42).show();_43.appendTo("body");_43.siblings("div[popoutPurpose=\"ajaxLoaderSmall\"]").remove();}function goToTop(_44){if(_44&&_44==true){$("html,body").animate({scrollTop:0},1000);}else{if(IS_EMBEDDED){setZDIFrameTop(0);}else{$(window).scrollTop(0);}}return false;}function setFocusToContainer(_45,_46,_47,_48){var _49=_45.offset().top;var _4a=50;if(_48!=undefined){_4a=_48;}if(_46&&_46==true){_47=_47||1000;$("html,body").animate({scrollTop:_49-_4a},_47);}else{_47=(_47!=undefined)?_47:300;setTimeout(function(){if(IS_EMBEDDED){setZDIFrameTop(_49-_4a);}else{$(window).scrollTop(_49-_4a);}},_47);}return false;}function showMessage(_4b,_4c){_4c=_4c||"info";$("#messageContentCont").html(_4b);$("#messageContainer").attr("class",_4c).fadeIn(100,function(){setTimeout(function(){$("#messageContainer:visible").fadeOut(500);},6000);});$("#messageContainerClose").show();return false;}function hideMessage(){$("#messageContainer").fadeOut(100);}function showTipper(_4d,_4e,_4f){_4e=_4e||"info";_4f=_4f||4000;$("#messageContentCont").html(_4d);$("#messageContainerClose").hide();$("#messageContainer").attr("class",_4e).fadeIn(500,function(){setTimeout(function(){$("#messageContainer").fadeOut(500);},_4f);});}function setToHotkeys(){if($("#topicListMainContainer").is(":visible")){setupKbdShortcuts();}}function setHotkeysToSinglePost(){if($("#SinglePostContainer").is(":visible")){setupKbdShortcutsToSinglePost();}}function removeHotkeys(){$.hotkeys.remove("o");$.hotkeys.remove("esc");$.hotkeys.remove("j");$.hotkeys.remove("return");$.hotkeys.remove("space");$.hotkeys.remove("k");$.hotkeys.remove("shift+space");$.hotkeys.remove("n");$.hotkeys.remove("p");$.hotkeys.remove("v");}function findCurrentSinglePost(){var _50=$("#topicList");if(_50.length<1){_50=$("#topicsList");}$currentSelected=_50.data("currentFocusPost");if(!$currentSelected||$currentSelected.length<1){$currentSelected=_50.data("currentSelectedPost");}if(!$currentSelected||$currentSelected.length<1){$currentSelected=_50.find("div.singleTopicCont:first");}return $currentSelected;}function setupKbdShortcuts(){$.hotkeys.add("",{disableInInput:true});$.hotkeys.add("o",function(){var _51=findCurrentSinglePost();var _52=_51.attr("forumTopicId");handleTopicClick($("quickView_"+_52),_52,"topicList");});$.hotkeys.add("v",function(){showLoadingImage();if(isTopicQuickView=="false"){}else{var _53=findCurrentSinglePost();var _54=_53.attr("forumTopicId");processHash("Topic/"+_54);}});$.hotkeys.add("esc",function(){var _55=findCurrentSinglePost();var _56=_55.attr("forumTopicId");if($("#lastResponse_"+_56).is(":visible")){handleTopicClick($("quickView_"+_56),_56,"topicList");}});$.hotkeys.add("return",function(){var _57=findCurrentSinglePost();var _58=_57.attr("forumTopicId");window.open(serverURL+"?ftid="+_58);});$.hotkeys.add("space",function(){var _59=findCurrentSinglePost();if(_59.is("div.singleTopicContSel")){var _5a=$(window).height();var _5b=$(window).scrollTop();var _5c=_59.height();var _5d=_59.next().offset().top;var _5e=(_5a+_5b>_5d);if(_5e){_59=_59.next();if(_59.is(".singleTopicCont")){var _5f=_59.attr("forumTopicId");handleTopicClick($("quickView_"+_5f),_5f,"topicList");}}else{$(window).scrollTop(_5b+_5a-50);}}else{if(_59.is(".singleTopicCont")){var _5f=_59.attr("forumTopicId");handleTopicClick($("quickView_"+_5f),_5f,"topicList");}}});$.hotkeys.add("shift+space",function(){var _60=findCurrentSinglePost();if(_60.is("div.singleTopicContSel")){var _61=$(window).height();var _62=$(window).scrollTop();var _63=_60.prev().offset().top;var _64=(_62-_61<_63-50);if(_64){_60=_60.prev();if(_60.is(".singleTopicCont")){var _65=_60.attr("forumTopicId");handleTopicClick($("quickView_"+_65),_65,"topicList");}}else{$(window).scrollTop((_62-_61)+50);}}else{if(_60.is(".singleTopicCont")){var _65=_60.attr("forumTopicId");handleTopicClick($("quickView_"+_65),_65,"topicList");}}});$.hotkeys.add("j",function(){var _66=findCurrentSinglePost();if(_66.is("div.singleTopicContSel")){_66=_66.next();}if(_66.is("div.singleTopicCont")){var _67=_66.attr("forumTopicId");handleTopicClick($("quickView_"+_67),_67,"topicList");}});$.hotkeys.add("k",function(){var _68=findCurrentSinglePost();if(_68.is("div.singleTopicContSel")){_68=_68.prev();}if(_68.is("div.singleTopicCont")){var _69=_68.attr("forumTopicId");handleTopicClick($("quickView_"+_69),_69,"topicList");}});$.hotkeys.add("n",function(){var _6a=findCurrentSinglePost();var _6b=_6a.next();if(_6b.is("div.singleTopicCont")||_6b.is("div.singleTopicContSel")){_6a.removeClass("hotKeyTopicCont");_6b.addClass("hotKeyTopicCont");$("#topicList").data("currentFocusPost",_6b);toSetFocusOnCurrPost(_6b,"next");}});$.hotkeys.add("p",function(){var _6c=findCurrentSinglePost();var _6d=_6c.prev();if(_6d.is("div.singleTopicCont")||_6d.is("div.singleTopicContSel")){_6c.removeClass("hotKeyTopicCont");_6d.addClass("hotKeyTopicCont");$("#topicList").data("currentFocusPost",_6d);toSetFocusOnCurrPost(_6d,"prev");}});}function toSetFocusOnCurrPost(_6e,_6f){var _70=_6e.offset().top;var _71=$(window).height();var _72=$(window).scrollTop();if(_6f=="next"){if(_70-_72>_71-50){$(window).scrollTop((_70-_71)+80);}}else{if(_72>_70){$(window).scrollTop(_70);}}}function setupKbdShortcutsToSinglePost(){$.hotkeys.add("",{disableInInput:true});$.hotkeys.add("o",function(){return false;});$.hotkeys.add("v",function(){return false;});$.hotkeys.add("esc",function(){return false;});$.hotkeys.add("return",function(){var _73=$("#SinglePostContainer").attr("forumTopicId");window.open(serverURL+"?ftid="+_73);});$.hotkeys.add("space",function(){var _74=$(window).height();var _75=$(window).scrollTop();$(window).scrollTop(_75+_74);});$.hotkeys.add("shift+space",function(){var _76=$(window).height();var _77=$(window).scrollTop();$(window).scrollTop(_77-_76);});$.hotkeys.add("j",function(){$currentSelected=findCurrentSingleResponse();var _78=0;var _79=$currentSelected.attr("currkey");if(_79!=undefined){_78=_79;}_78++;toSetFocusOnCurrResponse($currentSelected,_78);});$.hotkeys.add("k",function(){$currentSelected=findCurrentSingleResponse();var _7a=0;var _7b=$currentSelected.attr("currkey");if(_7b!=undefined){_7a=_7b;}else{return false;}_7a--;toSetFocusOnCurrResponse($currentSelected,_7a);});$.hotkeys.add("n",function(){$currentSelected=findCurrentSingleResponse();var _7c=0;var _7d=$currentSelected.attr("currkey");if(_7d!=undefined){_7c=_7d;}_7c++;toSetFocusOnCurrResponse($currentSelected,_7c);});$.hotkeys.add("p",function(){$currentSelected=findCurrentSingleResponse();var _7e=0;var _7f=$currentSelected.attr("currkey");if(_7f!=undefined){_7e=_7f;}else{return false;}_7e--;toSetFocusOnCurrResponse($currentSelected,_7e);});}function findCurrentSingleResponse(){$currentSelected=$("#SinglePostContainer").data("currentFocusResponse");if(!$currentSelected||$currentSelected.length<1){var _80=$("#SinglePostContainer").attr("forumTopicId");$currentSelected=$("#SinglePostContainer_"+_80).find("div.postContainer");}return $currentSelected;}function toSetFocusOnCurrResponse(_81,_82){var _83=$("#SinglePostContainer").attr("forumTopicId");var _84="";if(_82=="0"){_84=$("#SinglePostContainer_"+_83).find("div.postContainer");_81.removeClass("HotKeysingleReplyContainer");}else{_84=$("#SinglePostContainer_"+_83).find("span.hotKey_"+_82);if(_84.length==0){return false;}_81.removeClass("HotKeysingleReplyContainer");_84.addClass("HotKeysingleReplyContainer");}var _85=_84.offset().top;$("html,body").animate({scrollTop:_85-10},500);$("#SinglePostContainer").data("currentFocusResponse",_84);}function resizeZDIFRAME(_86){if(IS_EMBEDDED==true){_86=(!_86)?$("#mainContent").height():_86;if(_86){DOC_HT=_86;document.cookie="zdHt="+_86+";path=/";SendMessageToParent("zdframeht:"+parseInt(_86+12));}}}function setZDIFrameTop(top){top=(!top)?0:top;SendMessageToParent("zdframetop:"+top);}function uploadShowMessage(_88){forHidingSmallLoadingImg();hideLoadingImage();showMessage(i18n[_88],"failure");}function newOpenEditor(_89,_8a,_8b,_8c,_8d,_8e,_8f){var _90=_89.show();var _91=_90.next();var $ta=$("<textArea name = \""+_8a+"\" id = \""+_8b+"\" style = \"display:none;\"></textarea>");var _93="";var _94=true;if(_8d=="Edit"||_8a=="privateMsgContent"){_94=false;}else{if($("#writeNewTopic").attr("isDraft")=="true"){_94=false;}}if(_90.is(":input")){_93=_90.val();}else{_93=_90.html();}_93=" "+_93;var _95=document.createElement("div");_95.innerHTML=_93;$(_95).find("div.__zd_findAndReplace").remove();$(_95).find("div.__zd_findAndReplaceParent").remove();_93=_95.innerHTML;if(_94==true){_93=_93+userSignature;}$ta.val($.trim(_93));var _96;var _97="";var _98;var _99="";var _9a=false;if(_8c){$("#editorHolder").remove();_96=$("<form id = \"editorHolder\" ></form>");$replyLinkLocation=$("#"+_8c);_97=$replyLinkLocation.attr("forumTopicId");_97=_97||$replyLinkLocation.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _9b=$replyLinkLocation.attr("responseId");var _9c=$replyLinkLocation.attr("isPrivate");var _9d=$replyLinkLocation.attr("isThread");var _9e=$replyLinkLocation.attr("forumId");var _9f=$replyLinkLocation.attr("categoryId");var _a0=$replyLinkLocation.attr("responseAuthorId");var _a1="";if(_8d=="TweetPost"){var _a2=$replyLinkLocation.attr("tweetBy");_99=$replyLinkLocation.attr("statusId");var _a3=$("#twitterCont_"+_99).text();var _a4=$("#twitterImg_"+_99).attr("src");_98=$("<div style=\"clear:both;\" class=\"replyContainer\" id=\"replyTweetContainer_"+_99+"\"></div>");var _a5=$("<div class=\"content\"></div>");_a5.append(_96);_98.append("<div class=\"boldText header\">Reply to @"+_a2+"</div>");_98.append(_a5);var _a6=$("<div class=\"ndSelectionCont\"</div>");_a6.html($("#twitterForumsOptions").html());_96.append(_a6);_96.append("<input type = \"hidden\" name = \"twitterAuthorId\" value = \""+_a2+"\">").append("<input type = \"hidden\" name = \"twitterAuthImg\" value = \""+_a4+"\">").append("<input type = \"hidden\" name = \"statusTwitterId\" value = \""+_99+"\">").append("<input type = \"hidden\" name = \"tweetContent\" value = \""+_a3+"\">").append("<input type = \"hidden\" name = \"twitterResponseContent\" value = \"\">").append("<input type = \"hidden\" name = \"topicStatus\" value = \"0\">");if(_9e!=-1){_96.append("<input type = \"hidden\" name = \"forumId\" value = \""+_9e+"\">");_9a="true";}if(_9f!=-1){_96.append("<input type = \"hidden\" name = \"categoryId\" value = \""+_9f+"\">");}}else{_a1=$replyLinkLocation.attr("postTitle");_96.append("<input type = \"hidden\" name = \"forumId\" value = \""+_9e+"\">").append("<input type = \"hidden\" name = \"categoryId\" value = \""+_9f+"\">");}_96.append("<input value=\""+_a1+"\" name = \"forumPostTitle\" class=\"normalText\" type=\"text\" style=\"width:98.5%;height:18px;padding:3px;margin:0px 0px 6px 0px;\"/>").append("<input type = \"hidden\" name = \"forumTopicId\" value = \""+_97+"\">").append("<input type = \"hidden\" name = \"responseId\" value = \""+_9b+"\">").append("<input type = \"hidden\" name = \"forumGroupId\" value = \""+forumGroupId+"\">").append("<input type = \"hidden\" name = \"isPrivate\" value = \""+_9c+"\">").append("<input type = \"hidden\" name = \"isThread\" value = \""+_9d+"\">").append("<input type = \"hidden\" name = \""+csrfParamName+"\" value = \""+csrfToken+"\">").append("<input type = \"hidden\" name = \"detectSpamPresence\" value = \""+1+"\">").append("<input type = \"hidden\" name = \"isFollowTopic\" value = \"false\">");if((_8d&&_8d=="Edit")&&_a0==ZUID){_96.append("<input type = \"hidden\" name = \"responseowner\" value = \"true\">");}}else{_96=$("<div id = \"editorHolder\"></div>");}_96.append($ta);if(_8d!="TweetPost"){_96.insertAfter(_90.hide()).show();}else{_98.insertAfter(_90.hide()).show();}createEditor();if(_8d){$replyLinkLocation=$("#"+_8c);var _97=$replyLinkLocation.attr("forumTopicId");var _9b=$replyLinkLocation.attr("responseId");var _a7=(_8d=="Write"||_8d=="TweetPost")?i18n["zohodiscussions.general.publish"]:i18n["zohodiscussions.general.update"];var _a8=$("<button id=\"publishResponse\" class=\"ashBtn normalText boldText\">"+_a7+"</button>");var _a9=$("<button id=\"previewResponse\" class=\"ashBtn normalText boldText\">"+i18n["zohodiscussions.writePost.preview"]+"</button>");var _aa=$("<button id='cancelResponse' class='ashBtn normalText boldText'>"+i18n["zohodiscussions.general.cancel"]+"</button>");var _ab="false";_a8.click(function(){addForumResponse(_97,_8d,_9b,_99);});_aa.click(function(){$("#editorHolder").remove();$("#responseAttachmentContActual").remove();$("#SinglePostContainer_"+_97).find("div[purpose=\"editorActionUtilCont\"]").remove();$("#postTextContent_"+_9b).find("div[purpose=\"editorActionUtilCont\"]").remove();$("#eachTopicReplyCont_"+_97).find("div[purpose=\"editorActionUtilCont\"]").remove();if($("#responsePreviewButtonInTopicList").length>0){$("#responsePreviewButtonInTopicList").remove();}_90.show();if(_8d=="TweetPost"){$("#replyTweetContainer_"+_99).remove();}$("#"+_8e).data("inEditMode",false);var _ac="";if($("#newThreadResponseCont_"+_9b).is(":visible")){_ac="#newThreadResponseCont_"+_9b;}else{if($("#newResponseCont_"+_97).is(":visible")){_ac="#newResponseCont_"+_97;}else{if($("#eachTopicReplyCont_"+_97).is(":visible")){_ac="#eachTopicReplyCont_"+_97;}}}if(_ac!=""){$(""+_ac+"").hide();}if(_8e=="privateMsgInboxContainer"){$("#privateMsgCont_"+_97).hide();}else{if(_8e=="privateMsgSentContainer"){$("#privateMsgCont_"+_97).hide();if($("#topicContent_"+_97).parent().find("div.bigMinusIcon").length>0){$("#topicContent_"+_97).show();}}else{if(_8e=="editorContainer_PM"){processHash("user/"+$("#UserPM").attr("authorName"));}else{if(_8e=="eachTopic_"+_9b){var _ad=$("#paginationContainer");_ad.data("inEditMode",false);$("#singlePostActions_"+_9b).show();$("#linkedTopic_"+_9b).show();$("#recent_ResPonse_"+_9b).find("div.navigationCont").show();}else{if(_8e=="topicContainer_"+_97){$("#postTypeActions_"+_9b).show();$("#linkTopicCont_"+_97).show();$("#statusContainer").show();}}}}}if(_91.is(".Attachments")){_91.show();}if($("#responsePreviewContainer").is(":visible")){if(($("#responsePreviewContainer").length>0)||($singleThreadPreviewCont.length>0)){$("#responsePreviewContainer").remove();$("#fullThreadResponseContainer").remove();}}if(($("#responseContentContainer_"+_9b).is(":visible"))==true){$("#fullResponseContainer_"+_9b).find("div.postTypeActions").show();var _ae=$("#responsePreviewButton");var _af=$("#fullResponseContainer_"+_9b);var _b0=$("#responseContentContainer_"+_9b);CancelPreview(_ae,_af,_b0);}if(($("#recentResponseContent_"+_9b).is(":visible"))==true){$("#postTextContent_"+_9b).find("ul.singlePostActions").show();$("#resposeVoteLink_"+_9b).show();$("#chooseBestResponse_"+_9b).show();var _ae=$("#responsePreviewButtonInTopicList");var _af=$("#postTextContent_"+_9b);var _b1=$("#recentResponseContent_"+_9b);CancelPreview(_ae,_af,_b1);}});if(_8d=="TweetPost"){var _b2=_a6.find("#forum_Twitter_SelectForum");_a6.find("#forum_Twitter_SelectSubForum").attr("id","forum_Twitter_SelectSubForum_"+_99);if(_9a!="true"){loadTweetCategories(_b2.val(),"twitter_SubForumList","forum_Twitter_SelectSubForum_"+_99);}_b2.change(function(){var _b3=$(this).val();loadTweetCategories(_b3,"twitter_SubForumList","forum_Twitter_SelectSubForum_"+_99);});}var _b4=$("#responseAttachmentContTemplate").clone();_b4.attr("id","responseAttachmentContActual");var _b5=_b4.find("div.whiteAttachmentBox").show();_b4.find("div[attachmentPurpose=\"browseBox\"]").attr("id","attachBrowseCont");var _b6=_b5.find("ul[purpose=\"responseAtatchmentsListCont\"]").attr("id","attachmentsListCont");if(_8d=="Edit"){if(_91.is(".Attachments")){_ab="true";var _b7=_91.find("div[purpose=\"attachmenUtilCont\"]");var _b8=_b7.attr("attachmentIds");var _b9=_b7.attr("attachmentNames");var _ba=_b7.attr("attachmentSizes");var _bb=_b8.split(",");var _bc=_b9.split(",");var _bd=_ba.split(",");for(index=0;index<_bb.length;index++){var _be=_bb[index];var _bf=_bc[index];var _c0=_bd[index];var _c1=_be+","+_bf+","+_c0;$currentAttachment=$("#responseEachAttachmentTemplate").clone();$currentAttachment.attr("id","newAttachment_"+_be).attr("attachmentDetails",_c1).show();$currentAttachment.find("[attachmentPurpose=\"attachmentName\"]").html(_bf);$currentAttachment.find("[attachmentPurpose=\"attachmentSize\"]").html(_c0);$currentAttachment.find("div.imgAshDelete").attr("thisAttachmentId",_be).attr("thisAttachmentName",_bf);$currentAttachment.find("div.imgAshDelete").click(function(_c2){if(confirm(i18n["zohodiscussions.generalmessage.deleteAttachmentConfirmMsg"])){showSmallLoadingImage(_c2);$this=$(this);var _c3=$this.attr("thisAttachmentId");var _c4={};_c4.forumGroupId=forumGroupId;_c4.forumTopicId=_97;_c4.fileName=$this.attr("thisAttachmentName");_c4.fileId=_c3;_c4[csrfParamName]=csrfToken;doAjaxAction("/deleteAttachment.do",_c4,function(_c5){hideLoadingImage();if(_c5=="SUCCESS"){$("#newAttachment_"+_c3).remove();$("#eachAttachmentForPreview_"+_c3).remove();$("#fullResponseContainer_"+_9b).find("li[attachmentId=\""+_c3+"\" ]").remove();showTipper(i18n["zohodiscussions.general.Deleted"],"info");loadUploadAttachmentsCont();_aa.attr("disabled",true);_aa.unbind("click");}});}});_b6.append($currentAttachment);}_91.hide();}$("#postTypeActions_"+_9b).hide();}if((maxAttachmentsPerPost>0||_ab=="true")&&_8f!="true"){var _c6=$("<div class=\"flRight btnContainer\" purpose=\"editorActionUtilCont\" style=\"margin-right:10px;\"></div>");_b4.insertAfter($("#editorHolder")).css("margin-top",4).show();}else{var _c6=$("<div class=\"flRight btnContainer\" purpose=\"editorActionUtilCont\" style=\"margin-top:25px;margin-right:10px;\"></div>");_b4.insertAfter($("#editorHolder")).css("margin-top",4);}_c6.append(_a8);if(_8e!="paginationContainer"&&_8d!="TweetPost"){_c6.append(_a9);}_b4.find("div.whiteAttachmentBox").css("border-width",1);_c6.append(_aa).insertAfter(_b4);loadUploadAttachmentsCont();_a9.click(function(){var _c7=$(this);var _c8=_c7.attr("location");var _c9=$("#editorHolder").find("input[name=forumPostTitle]").val();var _ca=_c9.replace(/^<+|<+$/g,"&lt;").replace(/<+/g,"&lt;").replace(/^>+|>+$/g,"&gt;").replace(/>+/g,"&gt;");var _cb=_c7.attr("forumTopicId");var _cc=_c7.attr("responseId");var _cd=editor.getContent();_cd=_cd.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_c8=="editResponse"||_c8=="editTopic"){var _cc=_c7.attr("responseId");var _ce=$("<div class=\" approveButton flRight\"> This is preview! </div>");if(_c8=="editTopic"){var _cf=$("#DocumentTitle");_cf.css("width","74%");_ce.insertAfter(_cf.parent());}else{$("#fullResponseContainer_"+_cc).find("div.sppostHeader").append(_ce);}if($("#responsePreviewButton").length==0){$responsePreviewButton=$("#previewButtonTemplate").clone();$responsePreviewButton.attr("id","responsePreviewButton");}else{$responsePreviewButton=$("#responsePreviewButton");}if(_c8=="editTopic"){$("#fullResponseContainer_"+_cc).find("div.postTypeActions").hide();$responsePreviewButton.insertAfter($("#fullResponseContainer_"+_cc).find("div.postTypeActions")).show();}var _d0=$("#fullResponseContainer_"+_cc);newEditorLocationHide(_cb,_d0);_d0.find("div.replyOutHeader").append("<div class=\"flRight statusMessage\"><span class=\"boldText moderation\">This is preview!</span></div>");_d0.find("h3.header").html(_ca);editAndPreviewPost($responsePreviewButton,$("#postTypeActions_"+_cc),_d0,_c8);_d1=$("#fullResponseContainer_"+_cc).find("div.attachmentListCont").hide();var _d2=$("#fullResponseContainer_"+_cc).find("div[purpose =\"attachmentListContForPreview\"]");var _d3=$("#responseContentContainer_"+_cc);attachmentPreview(_d3,_d1,_d0,_c7);if(($("#cancelResponse").attr("disabled"))==true){$("#responsePreviewButton").find("button[purpose=\"cancelPreviewResponse\"]").attr("disabled",true);}_d2.show();previewContentContainer($("#responseContentContainer_"+_cc),_cd);previewActions($("#fullResponseContainer_"+_cc),_cb,_cc,_aa,_a8,_ab);}else{if(_c8=="topicListEditResponse"){if($("#responsePreviewButtonInTopicList").length==0){$responsePreviewButton=$("#previewButtonTemplate").clone();$responsePreviewButton.attr("id","responsePreviewButtonInTopicList");}else{$responsePreviewButton=$("#responsePreviewButtonInTopicList");}var _d0=$("#postTextContent_"+_cc);newEditorLocationHide(_cb,_d0);var _d3=$("#recentResponseContent_"+_cc);var _d1=$("#postTextContent_"+_cc).find("div.attachmentListCont").hide();var _d2=$("#postTextContent_"+_cc).find("div[purpose =\"attachmentListContForPreview\"]");_d2.show();if(($("#cancelResponse").attr("disabled"))==true){$("#responsePreviewButtonInTopicList").find("button[purpose=\"cancelPreviewResponse\"]").attr("disabled",true);}attachmentPreview(_d3,_d1,_d0,_c7);previewContentContainer($("#recentResponseContent_"+_cc),_cd);editAndPreviewPost($responsePreviewButton,$("#postTextContent_"+_cc),_d0,_c8);previewActions($("#responsePreviewButtonInTopicList"),_cb,_cc,_aa,_a8,_ab);}else{if($("#responsePreviewContainer").length==0){$responsePreviewContainer=$("#responsePreviewContainerTemplate").clone();$responsePreviewContainer.attr("id","responsePreviewContainer");}else{$responsePreviewContainer=$("#responsePreviewContainer");}if(_8c=="newThreadReply_"+_cc){if($("#fullThreadResponseContainer").length==0){var _d4=$("");}else{var _d4=$("#topicContainer_"+_cb).find("div[purpose=\"threadResponseContainer\"]");}}$responsePreviewContainer.find("[purpose=\"previewResponseAttachment\"]").attr("id","attachmentForResponsePreview");if(_8c=="newThreadReply_"+_cc){$responsePreviewContainer.insertAfter("#newThreadResponseCont_"+_cc).show();$responsePreviewContainer.addClass("thread");$responsePreviewContainer.find("button[purpose=\"backToEditorResponse\"]").attr("location","threadResponse");$("#replyToTopicBtn_"+_cb).attr("location","threadResponse");}else{$responsePreviewContainer.insertAfter("#newResponseCont_"+_cb);$responsePreviewContainer.find("button[purpose=\"backToEditorResponse\"]").attr("location","topicResponse");$("#replyToTopicBtn_"+_cb).attr("location","topicResponse");}$responsePreviewContainer.find("[purpose=\"topicTitleOfResponse\"]").html(_ca);$responsePreviewContainer.find("div[purpose=\"responseContPreviewContainer\"]").html(_cd);if(_8c=="newThreadReply_"+_cc){$("#newThreadResponseCont_"+_cc).hide();_d4.show();_d4.find("div.singleReplyContainer").show();}else{$responsePreviewContainer.show();$("#newResponseCont_"+_cb).hide();}var _d5=_c7.find("input[name=\"attachmentId\"]");$.each(_d5,function(_d6,_d7){var _d8=$(_d7).attr("attachmentDetails").split(",");var _d9=$("<li id=\"eachAttachmentForPreview_"+_d8[0]+"\" ><div class=\"flLeft\"><b class=\"flLeft imgfile\"></b><a>"+_d8[1]+"</a><div class=\"spattachmentConent\"><span>Size : "+_d8[2]+" </span>&nbsp;&nbsp;</div></div></li>");$("#attachmentForResponsePreview").append(_d9);});if($("#attachmentForResponsePreview > li").length>0){$responsePreviewContainer.find("[purpose=\"attachmentResponsePreviewCont\"]").show();}else{$responsePreviewContainer.find("[purpose=\"attachmentResponsePreviewCont\"]").hide();}previewActions($responsePreviewContainer,_cb,_cc,_aa,_a8,_ab);}}});}$("#editorHolder iframe").attr("id","editorframecont");}function toggleSections(_da,_db){_da.find("div[purpose]").hide().end().find("div[purpose=\""+_db+"\"]").show().end().find("li[purpose]").removeClass("selectedMenu").end().find("li[purpose=\""+_db+"\"]").addClass("selectedMenu");}function uploadError(_dc){var _dd=$("#imageDialog");_dd.find("#image_error").hide().html(_dc).css("background","#FFF1A8").fadeIn();}function previewActions(_de,_df,_e0,_e1,_e2,_e3){_de.find("button[purpose=\"backToEditorResponse\"]").unbind("click").click(function(){var _e4=$(this);var _e5=_e4.attr("location");if(_e5=="topicResponse"){_de.hide();$("#newResponseCont_"+_df).show();}else{if(_e5=="editEachResponse"){$("#resposeVoteLink_"+_e0).show();$("#chooseBestResponse_"+_e0).show();backtoEditorWhilePreviewing($("#fullResponseContainer_"+_e0),$("#responseContentContainer_"+_e0),$("#responsePreviewButton"),_df,_e3);}else{if(_e5=="topicListEditResponse"){backtoEditorWhilePreviewing($("#postTextContent_"+_e0),$("#recentResponseContent_"+_e0),$("#responsePreviewButtonInTopicList"),_df,_e3);}else{$("#newThreadResponseCont_"+_e0).show();$("#fullThreadResponseContainer").hide();_de.remove();}}}$("#attachmentForResponsePreview").html(" ");});_de.find("button[purpose=\"publishPreviewResponse\"]").unbind("click").click(function(){_e2.trigger("click");});_de.find("button[purpose=\"cancelPreviewResponse\"]").unbind("click").click(function(){var _e6=$(this);var _e7=_e6.attr("location");if(_e7=="topicResponse"){}else{if(_e7=="editEachResponse"){var _e8=$("#fullResponseContainer_"+_e0).find("div[purpose =\"attachmentListContForPreview\"] > ul");_e8.html(" ");$("#fullResponseContainer_"+_e0).find("div.replyOutHeader > div.statusMessage").remove();}else{if(_e7=="topicListEditResponse"){var _e8=$("#postTextContent_"+_e0).find("div[purpose =\"attachmentListContForPreview\"] > ul");_e8.html(" ");$("#postTextContent_"+_e0).find("div.statusMessage").remove();}else{}}}$("#fullResponseContainer_"+_e0).find("div.approveButton").remove();_e1.trigger("click");});}function editAndPreviewPost(_e9,_ea,_eb,_ec){var _ec=(_ec=="editResponse"||_ec=="editTopic")?"editEachResponse":"topicListEditResponse";_e9.insertAfter(_ea).show();_eb.find("div[purpose=\"editorMainParentCont\"]").hide();_eb.find("div[purpose=\"editorActionUtilCont\"]").hide();_e9.find("button[purpose=\"publishPreviewResponse\"]").html(i18n["zohodiscussions.general.update"]);_e9.find("button[purpose=\"backToEditorResponse\"]").attr("location",_ec);_e9.find("button[purpose=\"publishPreviewResponse\"]").attr("location",_ec);_e9.find("button[purpose=\"cancelPreviewResponse\"]").attr("location",_ec);}function CancelPreview(_ed,_ee,_ef){_ed.remove();_ee.find("div.Attachments").show();_ee.find("div.attachmentListCont").show();_ee.find("div[purpose =\"attachmentListContForPreview\"]").hide();_ef.show();$("#previewContentContainer").remove();$("#newAttachmentForPreview").remove();}function previewContentContainer(_f0,_f1){_f0.hide();if($("#previewContentContainer").length==0){var _f2=$("<div id=\"previewContentContainer\" class=\"postContent\"> </div>");}else{_f2=$("#previewContentContainer");}_f2.insertAfter(_f0);_f2.html(_f1).show();}function backtoEditorWhilePreviewing(_f3,_f4,_f5,_f6,_f7){newEditorLocationShow(_f6,_f3,_f7);_f4.hide();_f3.find("div.Attachments").hide();$("#previewContentContainer").hide();var _f8=_f3.find("div[purpose =\"attachmentListContForPreview\"] > ul");_f8.html(" ");var _f9=$("#newAttachmentForPreview").find("ul[purpose=\"previewResponseAttachment\"]");_f9.html(" ");_f3.find("div.replyOutHeader > div.statusMessage").remove();_f5.hide();$("#responsePreviewContainer").remove();$("#SinglePostContainer_"+_f6).find("div.approveButton").remove();}function attachmentListPreview(_fa,_fb){$.each(_fb,function(_fc,_fd){var _fe=$(_fd).attr("attachmentDetails").split(",");var _ff=$("<li id=\"eachAttachmentForPreview_"+_fe[0]+"\" ><div class=\"flLeft\"><b class=\"flLeft imgfile\"></b><a>"+_fe[1]+"</a><div class=\"spattachmentConent\"><span>Size : "+_fe[2]+" </span>&nbsp;&nbsp;</div></div></li>");_fa.append(_ff).show();});}function attachmentPreview(_100,_101,_102,_103){var _104=_102.find("div[purpose =\"attachmentListContForPreview\"]");if(_104.length==0&&$("#newAttachmentForPreview").length==0){var _105=$("<div class=\"Attachments attachments\"><div class=\"attachmentListCont spattachmentList\" purpose =\"attachmentListContForPreview\"><h3><span class=\"imgAttach flLeft\"></span> Attachments </h3> <ul class=\"ulNoStyle\"> </ul></div>");_105.insertAfter(_101);}if($("#newAttachmentForPreview").length==0){if(($("#attachmentsListCont").find("li[purpose=\"attachmentDetails\"]")).length>0&&_101.length==0){$newAttachmentForPreview=$("#responsePreviewContainerTemplate").find("div[purpose =\"attachmentResponsePreviewCont\"]").clone();$newAttachmentForPreview.attr("id","newAttachmentForPreview");$newAttachmentForPreview.insertAfter(_100);$newAttachmentForPreview.find("div.attachmentListCont").show();}}if($("#newAttachmentForPreview").length>0){$("#newAttachmentForPreview").show();var _106=_103.find("input[name=\"attachmentId\"]");var _107=$("#newAttachmentForPreview").find("ul[purpose=\"previewResponseAttachment\"]");attachmentListPreview(_107,_106);$newAttachmentForPreview.find("div.attachmentListCont").show();}else{var _106=$("#attachmentsListCont").find("li[purpose=\"attachmentDetails\"]");var _107=_102.find("div[purpose =\"attachmentListContForPreview\"] > ul");attachmentListPreview(_107,_106);}if(_102.find("div[purpose =\"attachmentListContForPreview\"] > ul > li").length>0||$("#newAttachmentForPreview").find("ul[purpose =\"previewResponseAttachment\"] > li").length>0){_102.find("div.Attachments").show();}else{_102.find("div.Attachments").hide();}}function imageUploaded(_108,_109,_10a,_10b){$("#imagePreview").attr({src:_108,width:"100",height:"100"});var _10c=$("#imageDialog");_10c.find("#image_error").html("");_10c.find(":input[name=\"linkTo\"]").val(_10b);_10c.find(":button[action=\"insertImage\"]").attr("disabled","").end().find(":input[name=\"uploadedImageUrl\"]").val(_108);}function imageAdded(_10d,_10e){var _10f=$("#imageDialog");var _110={};_110.title=_10f.find("[name=\"title\"]").val();_110.altText=_10f.find("[name=\"altText\"]").val();_110.linkTo=_10f.find("[name=\"linkTo\"]").val();_110.imgSize=_10f.find("[name=\"imgSize\"]").filter(":checked").val();$("#"+_10e).data("editor").addImage(_10d,_110);$("#imageDialog").hide();}function toggleSections(_111,_112){_111.find("div[purpose]").hide().end().find("div[purpose=\""+_112+"\"]").show().end().find("span[purpose]").removeClass("select").addClass("default").end().find("span[purpose=\""+_112+"\"]").removeClass("default").addClass("select");}function fillImageUrl(){var _113=$("#imageDialog");if(_113.find("#urldiv").is(":visible")){var _114=_113.find(":input[name=\"url\"]").val();if(_114&&$.trim(_114)!=""){if($.trim(_114)!=""&&isValidUrl(_114)){_113.find(":input[name=\"linkTo\"]").val(_114).end().find("#imagePreview").attr({src:_114,width:"100",height:"100"}).end().find(":button[action=\"insertImage\"]").attr("disabled","");}else{alert(i18n["zohodiscussions.settings.PleaseEnteraValidurl"]);_113.find(":input[name=\"url\"]").focus();}}}else{var _114=_113.find(":input[name=\"uploadedImageUrl\"]").val();_113.find(":input[name=\"linkTo\"]").val(_114);}}function isValidUrl(url){if(url&&$.trim(url)!=""){url_pattern="^https?://[A-Za-z0-9-_]+(?:\\.[A-Za-z0-9-_%&?/.=]+)*$";if(url.match(url_pattern)!=null){return true;}else{return false;}}else{return false;}}function uploadImage(){var _116=$("#imageDialog");if($.trim(_116.find("[name='imageFileName']").val())!=""){var _117=_116.find("form");_116.find("#image_error").html("<em>Uploading .. <img src = '/images/progressbarsmall.gif' /></em>").end().find(":button[action=\"insertImage\"]").attr("disabled","true");_117.find(":hidden[name=\"responseId\"]").val($("#editorHolder :hidden[name=\"responseId\"]").val());_117.attr("action","/uploadImage.do");_117.attr("enctype","multipart/form-data").attr("encoding","multipart/form-data");_117.get(0).submit();}}function toggleImageSelection(curr){if($(curr).attr("id")=="uploadSection"){$(curr).addClass("select");$("#urlSection").removeClass("select");$("#uploaddiv").show();$("#urldiv").hide();}else{$(curr).addClass("select");$("#uploadSection").removeClass("select");$("#uploaddiv").hide();var _119=$("#urldiv");_119.show();_119.find(":inpur[name=\"url\"]").focus();}}function newEditorLocationHide(_11a,_11b){$("#editorHolder").hide();_11b.find("div[purpose=\"editorActionUtilCont\"]").hide();$("#responseAttachmentContActual").hide();}function newEditorLocationShow(_11c,_11d,_11e){$("#editorHolder").show();if(maxAttachmentsPerPost>0||_11e=="true"){$("#responseAttachmentContActual").show();}_11d.find("div[purpose=\"editorActionUtilCont\"]").show();}function initTabContClick(){$("#homeTab,#allforumsTab,#myareaTab,#SettingsTab,#NewTopicTab,#Search").click(function(){var _11f=$(this);var _120=_11f.attr("hashPurpose");processHash(_120,"",_11f);return false;});$("#searchComboDownArrow").parent().click(function(){displaySearchOption();});}function updateAwaitingApprovalCount(){var _121={};_121.forumGroupId=forumGroupId;doAjaxAction("/getAwaitingApprovalCount.do",_121,function(data){var _123=(data!="0")?" ("+data+")":"";$("#awaitingCountCont").html(_123);});}function processHash(hash,_125,_126){if(isTopicQuickView=="false"&&_125!="withHash"){if(hash.toLowerCase()=="home"){hash="recent";}else{if(hash.toLowerCase()=="search"||hash.toLowerCase()=="normalsearch"){var _127=$("#searchSelectedImage").attr("purpose");var _128=$("#searchInputBox");var _129="";var _12a=_128.val();var _12b=$("#forumComboCont");var _12c=$("#categoryComboCont");var _12d=_12b.attr("forNiceUrl");var _12e=_12c.attr("forNiceUrl");if(typeof _12e!="undefined"&&_12e!=""){_129=_12e;}else{_129=_12d;}if(typeof _129=="undefined"||_129==""){_129="";}if(hash.toLowerCase()=="normalsearch"){_12a=$("#normalSearchInputBox").val();}_12a=$.trim(_12a);_12a=encodeURIComponent(_12a);_12a=_12a.replace(/\*/g,"%2A").replace(/\~/g,"%7E").replace(/\!/g,"%21").replace(/\'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29");if(_12a==""){showMessage(i18n["zohodiscussions.searchList.noSearchString"],"failure");return;}var _12f="";if(typeof _127=="undefined"){_12f="";}else{if(_127!="all"){_12f=_127+"/";}}location.href=serverURL+_129+"/search/"+_12f+_12a;return false;}else{if(typeof _126!="undefined"&&_126.attr("id")=="NewTopicTab"){if(hash==""){return false;}var _130=hash.split("/");var _131=_130[0];var _132=_131.toLowerCase();var _133=_130[1];var _134=_130[2];discussionsFunctions["newtopic"](_132,_133,_134);return false;}}}location.href=serverURL+"/"+hash.toLowerCase();return false;}if(shouldReload==true&&hash!="Search"){window.location.href=serverURL+"#"+hash;return false;}showLoadingImage();if(hash==""){if(isTopicQuickView=="false"){window.location.href=serverURL+"/recent";return false;}discussionsFunctions["home"]("home",1);return false;}var _130=hash.split("/");var _131=_130[0];var _132=_131.toLowerCase();selectTab(_132);switch(_132){case "home":case "chome":var _135=1;if(parseInt(_130[1])>1){_135=_130[1];}discussionsFunctions[_132](_131,_135);break;case "alltags":discussionsFunctions[_132](_131);break;case "allforums":discussionsFunctions[_132](_131);break;case "stats":window.location.href=serverURL+"/stats";break;case "search":_12a=_130[1];discussionsFunctions[_132](_131,_12a);break;case "normalsearch":_12a=$("#normalSearchInputBox").val();discussionsFunctions["search"](_131,_12a);break;case "myarea":var _136=_130[1];var _137="";if(_136){_136=_136.toLowerCase();}if(_136=="watchlist"){_137=_130[2];if(_137){_137=_137.toLowerCase();}}else{if(_136=="friends"){_137=_130[2];if(_137){_137=_137.toLowerCase();}}}discussionsFunctions[_132](_131,_136,_137);break;case "moderation":window.location.href=serverURL+"/moderation";break;case "settings":discussionsFunctions[_132](_131);break;case "topic":var _138=_130[1];var _139=_130[2];discussionsFunctions[_132](_131,_138,_139);break;case "forum":var _13a=_130[1];var _135=1;if(_130[2]){var _13b="";var _13c=parseInt(2);if(_130[_13c]!="filter"&&_130[_13c].toLowerCase()!="all"){var temp=parseInt(_130[_13c]);if(temp>0){_135=temp;_13c=_13c+1;}else{_13b=_130[_13c];_13c=_13c+1;}}if(_130[_13c]){if(_130[_13c]=="filter"){_13c=_13c+1;var _13e=_130[_13c];var _13f="";_13e=_13e.toLowerCase();if(_13e=="twitter"){var _133=$("#searchTwitterTab").attr("forumId");getTwitterSearchList(_133,1);return;}else{if(_13e!="discussions"&&_13e!="questions"&&_13e!="ideas"&&_13e!="problems"&&_13e!="announcement"&&_13e!="sticky"&&_13e!="unrepliedposts"&&_13e!="postssincelastvisit"){_13e="all";if(isOneTopicType!="true"){_13c=_13c+1;}}else{_13c=_13c+1;if(_130[_13c]){_13f=_130[_13c];}}}if(isOneTopicType=="true"&&_13e=="all"){_13f=_130[_13c];}if(_130[_13c]){if(parseInt(_130[_13c])>0){_135=_130[_13c];}}getMoreTopics(_13a,_13b,_135,_13e,"",_13f,"reload");}else{if(_130[_13c]){if(parseInt(_130[_13c])>0){_135=_130[_13c];}}discussionsFunctions[_132](_131,_13a,_13b,_135);}}else{discussionsFunctions[_132](_131,_13a,_13b,_135);}}else{discussionsFunctions[_132](_131,_13a,"",_135);}break;case "filter":var _13e=_130[1];_13e=_13e.toLowerCase();var _13f="";var _135=1;if(_13e=="twitter"){getTwitterSearchList(-1,1);return;}if(_13e!="discussions"&&_13e!="questions"&&_13e!="ideas"&&_13e!="problems"&&_13e!="announcement"&&_13e!="sticky"&&_13e!="unrepliedposts"&&_13e!="postssincelastvisit"){_13e="all";if(parseInt(_130[2])>0){_135=_130[2];}}else{if(_130[3]){_13f=_130[2];if(parseInt(_130[3])>0){_135=_130[3];}}else{if(parseInt(_130[2])>0){_135=_130[2];}else{_13f=_130[2];}}}if(isOneTopicType=="true"&&_13e=="all"){_13f=_130[1];}getMoreTopics("","",_135,_13e,"",_13f,"reload");break;case "user":var _140=_130[1];discussionsFunctions[_132](_131,_140);break;case "tag":var _141=_130[1];discussionsFunctions[_132](_131,_141);break;case "newtopic":var _133=_130[1];var _134=_130[2];discussionsFunctions[_132](_131,_133,_134);break;case "newdiscussion"||"newquestion"||"newidea"||"newproblem":var _133=_130[1];var _134=_130[2];discussionsFunctions["newtopic"](_131,_133,_134);break;case "tpw":var _133=_130[1];var _134=_130[2];var _142=_130[3];var _143=_130[4];var ph=_130[5];var tps=_130[6];var _146=_130[7];var aj=_130[8];var stat=_130[9];var qstr=_130[10];var tgt=_130[11];discussionsFunctions["tphome"](_131,_133,_134,_142,_143,ph,tps,_146,aj,stat,qstr,tgt);break;default:hideLoadingImage();}return false;}var discussionsFunctions={};discussionsFunctions["tphome"]=function(_14b,_14c,_14d,_14e,_14f,ph,tps,_152,aj,stat,qstr,tgt){var _157=1;getForumTopics(_14c,_14d,_157,_14b,_14e,_14f,ph,tps,_152,aj,stat,qstr,tgt);};discussionsFunctions["home"]=function(_158,_159){var _15a=-1;var _15b=-1;var _159=_159;if(typeof _158=="undefined"){_158="home";_159=1;}getForumTopics(_15a,_15b,_159,_158);};discussionsFunctions["chome"]=function(_15c,_15d){var _15e=-1;var _15f=-1;var _15d=_15d;if(typeof _15c=="undefined"){_15c="chome";_15d=1;}getForumTopics(_15e,_15f,_15d,_15c);};discussionsFunctions["stats"]=function(_160){var _161=-1;var _162=-1;var _163=1;getTopicsReport(_161,_162,_163,_160);};discussionsFunctions["forum"]=function(_164,_165,_166,_167){document.title=forumGroupName;var _168=$("#topicListMainContainer");if(_168.length>0&&_168.is("[shouldReload=\"false\"]")){_168.show().attr("shouldReload","true").siblings().remove();hideLoadingImage();if(isMac=="false"){setToHotkeys();}}else{var _169={};_169.forumGroupId=forumGroupId;_169.forumURL=_165;_169.fetchPage=_167;if(_166){_169.categoryURL=_166;}doAjaxAction("/getSingleForumTopics.do",_169,function(data){hideLoadingImage();$("#mainContent").get(0).innerHTML=data;lightBox("#chartWidget");if(_166){if(parseInt(_167)>1){$.history.add(_164+"/"+_165+"/"+_166+"/"+_167);}else{$.history.add(_164+"/"+_165+"/"+_166);}}else{if(parseInt(_167)>1){$.history.add(_164+"/"+_165+"/"+_167);}else{$.history.add(_164+"/"+_165);}}goToTop();lightBox("#topicList");bindTopicClicks($("#topicList"));bindTopicClicks($("#topicsList"));bindTopicListHeaderClicks($("#topicListHeader"));bindWidgetsContClick($("#topicListWidgetsCont"));var _16b=$("#forumComboCont");var _16c=_16b.attr("forumId");var _16d=_16b.attr("categoryId");var _16e="NewTopic/"+_16c+"/"+_16d;if($("#allForumWidget").length>0){if($("#allForumWidget").find("li[purpose=\"forumList\"]").length<9){$("#moreForumView").hide();}}$("#NewTopicTab").attr("hashPurpose",_16e);if(typeof WmsContacts!="undefined"&&ch=="true"){var _16f=WmsContacts.getZohoContacts();setPresence(_16f,"moderatorsChatList_"+_16c);setPresenceInTopicList(_16f);}if(isMac=="false"){setToHotkeys();}return false;},function(_170){$("#mainContent").get(0).innerHTML=_170.responseText;hideLoadingImage();});}};discussionsFunctions["newtopic"]=function(_171,_172,_173){var zuid=ZUID;if(zuid==-1&&canThisUserPostATopic=="false"&&isCustomSSOPortal=="false"){initLoginFrame($("#NewTopicTab"));}else{if((zuid!=-1||canThisUserPostATopic=="true")&&isTopicQuickView=="false"){var _175=$("#NewTopicTab").attr("topicURL");window.location.href=serverURL+"/"+_175;}else{if(zuid!=-1&&typeof canThisUserPostATopic=="undefined"){window.location.href=serverURL;}else{if(typeof _172=="undefined"&&typeof _173=="undefined"){getWritePost("-1","-1",_171);}else{_172=(typeof _172=="undefined")?-1:_172;_173=(typeof _173=="undefined")?-1:_173;getWritePost(_172,_173,_171);}}}}};discussionsFunctions["search"]=function(_176,_177){var _178={};_178.forumGroupId=forumGroupId;if(!_177){_177=$("#searchInputBox").val();_177=$.trim(_177);}if(_177==""){showMessage(i18n["zohodiscussions.searchList.noSearchString"],"failure");hideLoadingImage();return;}var _179=$("#forumComboCont");var _17a=$("#categoryComboCont");var _17b=_179.attr("forumId");var _17c=_179.attr("categoryId");var _17d=_17a.attr("hashPurpose");_178.searchFor=_177;_178.forumId=_17b;_178.categoryId=_17c;var _17e=$("#searchSelectedImage").attr("purpose");_178.normalSearchType=_17e;if(typeof _17e=="undefined"){_17e="";}else{if(_17e!="all"){_17e="/"+_17e;}else{_17e="";}}if(typeof _17d!="undefined"&&_17d!=""){_176=_17d+"/"+_176;}else{_17d=_179.attr("hashPurpose");if(_17d=="Home"){_17d="";}if(typeof _17d!="undefined"&&_17d!=""){_176=_17d+"/"+_176;}}$.history.add(_176+_17e+"/"+_177);if($("#currSearchSortBy").attr("currSortBy")=="date"){_178.searchSortBy="date";}doAjaxAction("/getSearchResult.do",_178,function(data){hideLoadingImage();var _180=$("<div></div>");_180.get(0).innerHTML=data;$("#mainContent").get(0).innerHTML=data;bindSearchContentClick($("#mainContent"));showAuthorPopout(_180);$("#searchInputBox").val(_177);});};discussionsFunctions["topic"]=function(_181,_182,_183){if(_183!=undefined){openSinglePost(_182,_181,_183);}else{openSinglePost(_182,_181);}};discussionsFunctions["tag"]=function(_184,_185){$.history.add(_184+"/"+_185);$this=$(this);var _186={};_186.forumGroupId=forumGroupId;_186.tagName=_185;_186.fetchPage=1;doAjaxAction("/getTagRelatedPosts.do",_186,function(data){hideLoadingImage();$("#mainContent").get(0).innerHTML=data;goToTop();bindTopicClicks($("#topicList"));bindTopicClicks($("#topicsList"));bindTopicListHeaderClicks($("#topicListHeader"));bindWidgetsContClick($("#topicListWidgetsCont"));return false;},function(_188){hideLoadingImage();var _189=(_188.responseText);$("#mainContent").get(0).innerHTML=_189;});};discussionsFunctions["alltags"]=function(_18a){$.history.add(_18a);$this=$(this);var _18b={};_18b.forumGroupId=forumGroupId;doAjaxAction("/showAllTags.do",_18b,function(data){hideLoadingImage();$("#mainContent").get(0).innerHTML=data;bindTagsContClick($("#allTagsContainer"));bindWidgetsContClick($("#topicListWidgetsCont"));return false;},function(_18d){hideLoadingImage();var _18e=(_18d.responseText);$("#mainContent").get(0).innerHTML=_18e;});};discussionsFunctions["allforums"]=function(_18f){if($("#preloadedForumsCont").length>0){$("#preloadedForumsCont").show().siblings().remove();$.history.add(_18f);hideLoadingImage();return false;}var _190={};_190.purpose="AllForums";_190.forumGroupId=forumGroupId;_190[csrfParamName]=csrfToken;doAjaxAction("/AllForums.do",_190,function(data){hideLoadingImage();document.title=i18n["zohodiscussions.general.allForums"];$.history.add("AllForums");$("#mainContent").get(0).innerHTML=data;var _192=$("#iamLoginBox").find("iframe");var _193=_192.attr("src");_192.attr("src",_193);allForumsBindActions();return false;},function(_194){hideLoadingImage();var _195=(_194.responseText);$("#mainContent").get(0).innerHTML=_195;});};function allForumsBindActions(){lightBox("#chartWidget");bindAllForumsClick($("#allForums_MainContentCont"));bindWidgetsContClick($("#topicListWidgetsCont"));goToTop();var _196=$("#listof_FC_Counts");$("#countOfForum").html(_196.attr("forumCount"));$("#countOfCategory").html(_196.attr("categoryCount"));$("#countOfPosts").html(_196.attr("postCount"));$("#countOfResponses").html(_196.attr("responseCount"));if(typeof WmsContacts!="undefined"&&ch=="true"){var _197=WmsContacts.getZohoContacts();setPresenceInTopicList(_197);}}discussionsFunctions["myarea"]=function(_198,_199,_19a){document.title=i18n["zohodiscussions.general.myarea"];var _19b=$("#myAreaParentContainer");if(_19b.length>0&&_19b.is("[shouldReload=\"false\"]")){_19b.show().attr("shouldReload","true").siblings().remove();hideLoadingImage();}else{var _19c={};_19c.forumGroupId=forumGroupId;_19c[csrfParamName]=csrfToken;if(!_199){_199="dashboard";}if(_199!="dashboard"&&_199!="myposts"&&_199!="watchlist"&&_199!="friends"&&_199!="bookmark"&&_199!="privatemsg"&&_199!="preference"){hideLoadingImage();return;}_19c.myAreaAction=_199;_19c.ch=ch;doAjaxAction("/getMyArea.do",_19c,function(data){$("#authorPopout:visible").hide();hideLoadingImage();$("#mainContent").get(0).innerHTML=data;getMyAreaBindActions(_199,_198,"",_19a);return false;},function(_19e){hideLoadingImage();var _19f=(_19e.responseText);$("#mainContent").get(0).innerHTML=_19f;});}};discussionsFunctions["user"]=function(_1a0,_1a1){getAuthorProfile(_1a1);};discussionsFunctions["moderation"]=function(_1a2){document.title=i18n["zohodiscussions.moderationAction.moderation"];var _1a3={};_1a3.forumGroupId=forumGroupId;if(portalPlanIndex>4){_1a3.postFor="AllWaitingApproval";}else{_1a3[csrfParamName]=csrfToken;_1a3.postFor="AllReportedSpam";}ModerationLoadingPage(_1a3);};function ModerationLoadingPage(_1a4){var _1a5="";if(portalPlanIndex>4){_1a5="/getModerationPanel.do";}else{_1a5="/getReportedSpam.do";}doAjaxAction(_1a5,_1a4,function(data){hideLoadingImage();$("#mainContent").get(0).innerHTML=data;$.history.add("Moderation");getModerationPanelBindAction();return false;},function(_1a7){hideLoadingImage();var _1a8=(_1a7.responseText);$("#mainContent").get(0).innerHTML=_1a8;});}function getModerationPanelBindAction(){goToTop();bindModerationTabClick();if(portalPlanIndex>4){bindModerationActionClick("AllAwaiting");}else{bindModerationActionClick("AllReportedSpam");}ModerationAction($("#moderationRightCont"));initModerationPanel($("#moderationPanel"));}function getMyAreaBindActions(_1a9,_1aa,_1ab,_1ac){bindMyAreaClicks($("#myAreaContent"));$("#authorPopout_"+ZUID).hide();showAuthorPopout($("#myAreaInnerMainContent"));if(_1a9!="dashboard"){if(_1a9=="myposts"){_1a9="myjournals";}if(_1ac!=undefined){if(_1ac!="topic"&&_1ac!="user"&&_1ac!="forum"&&_1ac!="subforum"&&_1ac!="following"&&_1ac!="follower"){_1ac="topic";}}if(_1ab!="niceurl"){if($("#"+_1a9+"View").length>0){getMyAreaAction($("#"+_1a9+"View"),_1ac);}else{getMyAreaAction($("#dashboardView"));}}else{var _1ad=$("#"+_1a9+"View").attr("purpose");bindMyareaTabsActions(_1ad,_1ac);}}else{if(_1ab!="niceurl"){$.history.add(_1aa+"/"+_1a9);}if(typeof WmsContacts!="undefined"&&ch=="true"){var _1ae=WmsContacts.getZohoContacts();setPresence(_1ae,"followingUserDetails");setPresence(_1ae,"followersUserDetails");setPresenceInMyArea(_1ae,"current_recentActivity_List");}if(_1a9=="dashboard"){initialiseUserActivityChart();}}}function ModerationAction(_1af){_1af.unbind("click",bindModerationAction).click(bindModerationAction);showAuthorPopout(_1af);}function getTopicsReport(_1b0,_1b1,_1b2,_1b3){document.title=forumGroupName;var _1b4={};_1b4.forumGroupId=forumGroupId;_1b4.forumId=_1b0;_1b4.categoryId=_1b1;_1b4.fetchPage=_1b2;_1b4[csrfParamName]=csrfToken;doAjaxAction("/Reports.do",_1b4,function(data){hideLoadingImage();if(_1b3){$.history.add(_1b3);}$("#mainContent").get(0).innerHTML=data;lightBox("#chartWidget");bindReportsClicks($("#reportsLeftPanel"));});}function getForumTopics(_1b6,_1b7,_1b8,_1b9,_1ba,_1bb,ph,tps,_1be,aj,stat,qstr,tgt){document.title=forumGroupName;var _1c3=$("#topicListMainContainer");if(_1c3.length>0&&_1c3.is("[shouldReload=\"false\"]")){$.history.add(_1b9);setTimeout(function(){_1c3.show().attr("shouldReload","true").siblings().remove();},200);hideLoadingImage();if(isMac=="false"){setToHotkeys();}}else{var _1c4={};_1c4.forumGroupId=forumGroupId;_1c4.forumId=_1b6;_1c4.categoryId=_1b7;_1c4.fetchPage=_1b8;_1c4.givenkey=_1b9;if(_1b9=="tpw"){_1c4.limit=_1ba;_1c4.style=_1bb;_1c4.ph=ph;_1c4.tps=tps;_1c4.widget=_1be;_1c4.aj=aj;_1c4.stat=stat;_1c4.querystring=qstr;_1c4.tgt=tgt;}doAjaxAction("/getSingleForumTopics.do",_1c4,function(data){hideLoadingImage();if(_1b9){if(parseInt(_1b8)>1){$.history.add(_1b9+"/"+_1b8);}else{$.history.add(_1b9);}}$("#mainContent").get(0).innerHTML=data;var _1c6=$("#iamLoginBox").find("iframe");var _1c7=_1c6.attr("src");_1c6.attr("src",_1c7);lightBox("#chartWidget");lightBox("#topicList");bindTopicClicks($("#topicList"));bindTopicClicks($("#topicsList"));bindTopicListHeaderClicks($("#topicListHeader"));bindWidgetsContClick($("#topicListWidgetsCont"));var _1c8="NewTopic/"+_1b6+"/"+_1b7;$("#NewTopicTab").attr("hashPurpose",_1c8);if($("#allForumWidget").length>0){if($("#allForumWidget").find("li[purpose=\"forumList\"]").length<9){$("#moreForumView").hide();}}if(typeof WmsContacts!="undefined"&&ch=="true"){var _1c9=WmsContacts.getZohoContacts();setPresenceInTopicList(_1c9);}if(isMac=="false"){setToHotkeys();}return false;},function(_1ca){hideLoadingImage();var _1cb=(_1ca.responseText);$("#mainContent").get(0).innerHTML=_1cb;});}}function getWritePostCallBack(_1cc,_1cd){var _1ce=_1cc;var _1cf={};if(_1cd!="true"){$.history.add(_1cc);}$("#tabListCont li.selected").removeClass("selected");goToTop();var _1d0=$("#SelectForum > option");if((_1d0.length)==1){_1d0.attr("selected",true);}var _1d1=$("#SelectCategory > option");if((_1d1.length)==1){_1d1.attr("selected",true);}initWritePost();_1cc=_1cc.toLowerCase();if(_1cc!="newtopic"){if(_1cc=="newproblem"){_1cc="error";}else{if(_1cc=="newquestion"){_1cc="question";}else{if(_1cc=="newidea"){_1cc="idea";}else{if(_1cc=="newdiscussion"){_1cc="discuss";}}}}var _1d2=$("#writepostTabsCont").find("li[topiciconclass=\""+_1cc+"\"]");if(_1d2.length>0){selectTopicType(_1d2);}else{selectTopicType(_1d2,_1cc);}}hideLoadingImage();var _1d3="";$("#topicTitle").keydown(function(e){if(forumGroupId!=1000000000002001){return;}var _1d5=$("#listOfTitleAutoSugg");var _1d6=$(this).val();_1d6=_1d6.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ");if(_1d6==""||e.keyCode==27){_1d5.hide();return;}storedTitle=_1cf[_1d6];if(storedTitle!=undefined){if(storedTitle==""){_1d5.hide();return;}_1d5.html(storedTitle).show();return;}if(e.keyCode!=32){return;}if(_1d3!=""&&_1d6.indexOf(_1d3)==0){return;}else{_1d3="";}var _1d7={};_1d7.searchFor=_1d6;_1d7.forumGroupId=forumGroupId;_1d7[csrfParamName]=csrfToken;doAjaxAction("/getTopicTitleSearch.do",_1d7,function(data){_1d5.get(0).innerHTML=data;if(data==""){_1cf[_1d6]="";_1d3=_1d6;return;}var _1d9=$("#topicTitle").width();_1d5.width(_1d9-5);_1d5.show();_1cf[_1d6]=_1d5.html();},function(_1da){});});var _1db=$("#writepostCont");_1db.unbind("click",manageTopicTitle).click(manageTopicTitle);}function manageTopicTitle(_1dc){var _1dd=$(_1dc.target);var _1de=_1dd.parent();if($("#listOfTitleAutoSugg").is(":visible")){if(_1dd.parents("li").attr("eachTopic")=="autosugg"){if(!_1dd.is("a")){var _1df=_1dd.parents("li").find("a").attr("href");window.open(_1df);}return;}$("#listOfTitleAutoSugg").hide();return;}return;}function getWritePost(_1e0,_1e1,_1e2,_1e3){var _1e4={};_1e4.forumGroupId=forumGroupId;_1e4.forumId=_1e0;_1e4.categoryId=_1e1;if(isTopicQuickView!="false"){showLoadingImage();}doAjaxAction("/writePost.do",_1e4,function(data){document.title=i18n["zohodiscussions.writePost.documentTitle"]+" - "+forumGroupName;$("#mainContent").get(0).innerHTML=data;getWritePostCallBack(_1e2,_1e3);return false;},function(_1e6){hideLoadingImage();var _1e7=(_1e6.responseText);$("#mainContent").get(0).innerHTML=_1e7;});}function selectTab(_1e8){if(_1e8=="user"){$("#newtopicCont").siblings("li.selected").removeClass("selected");return;}else{if(_1e8=="newtopic"||_1e8=="search"){searchFor=$("#searchInputBox").val();searchFor=$.trim(searchFor);if(_1e8=="search"&&searchFor==""){return;}$("#"+_1e8+"Tab").siblings("li.selected").removeClass("selected");return;}else{if(_1e8=="forum"||_1e8=="topic"||_1e8=="chome"){_1e8="home";}}}$("#"+_1e8+"Tab").addClass("selected").siblings("li.selected").removeClass("selected");}function bindTopicListHeaderClicks(_1e9){_1e9.unbind("click",processTopicListHeaderClick).click(processTopicListHeaderClick);}function bindTopicClicks(_1ea){_1ea.unbind("click",processTopicListClick).click(processTopicListClick);var _1eb=_1ea.find("script").html();try{eval(_1eb);}catch(e){}}function showAuthorPopout(_1ec){var _1ed=_1ec.attr("authorPopout");if((typeof isTopicQuickView=="undefined"||isTopicQuickView=="false")&&(typeof _1ed=="undefined"||_1ed!="true")){return false;}_1ec.find("a[purpose=\"authorProfile\"],img[purpose=\"authorProfile\"]").hover(function(){var _1ee=$(this);if((typeof isTopicQuickView=="undefined"||isTopicQuickView=="false")&&_1ee.is("img[purpose=\"authorProfile\"]")&&_1ed=="true"&&_1ee.attr("authorPopout")!="true"){return;}var _1ef=_1ee.attr("authorId");if(_1ef==-1){return;}var _1f0=_1ee.attr("authorName");var _1f1=_1ee.attr("forumId");var _1f2=setTimeout(function(){var _1f3=_1ee.position();var _1f4=$("#mainContent").position();var _1f5=_1f4.left;_1f3.left=_1f3.left+parseInt(_1f5);if($("#SinglePostContainer").length>0){var _1f6=_1f4.top;_1f3.top=_1f3.top+parseInt(_1f6)+20;}if(_1f3.left>800){_1f3.left=_1f3.left-300;}$authorPopup=$("#authorPopout_"+_1ef);if($authorPopup.length>0){$authorPopup.css(_1f3).show();authorPopupHover($authorPopup);}else{$authorPopup=$("#authorPopoutTemplate").clone();$authorPopup.attr("popoutPurpose","authorDetailsPopout");$authorPopup.attr("id","authorPopout_"+_1ef);var _1f7={};_1f7.forumGroupId=forumGroupId;_1f7.authorId=_1ef;_1f7.forumId=_1f1;_1f7.ch=ch;doAjaxAction("/getAuthorPopup.do",_1f7,function(data){$thisAuthPopup=$("<div>"+data+"</div>");authorPopUpAction($thisAuthPopup,_1ef,_1f0,$authorPopup);});$authorPopup.css(_1f3).show();$authorPopup.appendTo("body");authorPopupHover($authorPopup);}},700);_1ee.data("destroyHandleAuthPopout",_1f2);},function(){var _1f9=$(this);var _1fa=_1f9.attr("authorId");var _1fb=_1f9.data("destroyHandleAuthPopout");if(_1fb){clearTimeout(_1fb);}var _1fc=$("#authorPopout_"+_1fa);_1fc.attr("hideAuhPopout","true");setTimeout(function(){var _1fd=_1fc.attr("hideAuhPopout");if(_1fd=="true"){_1fc.hide();}},500);});}function mouseOutAuthor(_1fe){var _1ff=_1fe;var _200=_1ff.attr("authorId");var _201=_1ff.data("destroyHandleAuthPopout");if(_201){clearTimeout(_201);}var _202=$("#authorPopout_"+_200);_202.attr("hideAuhPopout","true");setTimeout(function(){var _203=_202.attr("hideAuhPopout");if(_203=="true"){_202.hide();}},500);}function mouseOverAuthor(_204){if(isTopicQuickView=="false"){return false;}var _205=_204;var _206;var _207=_205.attr("authorId");if(_207==-1){return;}var _208=_205.attr("authorName");var _209=_205.parents("li[parentCont=\"actualParent\"]").attr("forumId");if(typeof _209=="undefined"){_209=_205.attr("forumId");}var _20a=setTimeout(function(){var _20b=_205.position();_206=$("#authorPopout_"+_207);if(_206.length>0){_206.css(_20b).show();authorPopupHover(_206);}else{_206=$("#authorPopoutTemplate").clone();_206.attr("popoutPurpose","authorDetailsPopout");_206.attr("id","authorPopout_"+_207);var _20c={};_20c.forumGroupId=forumGroupId;_20c.authorId=_207;_20c.forumId=_209;_20c.ch=ch;doAjaxAction("/getAuthorPopup.do",_20c,function(data){$thisAuthPopup=$("<div>"+data+"</div>");authorPopUpAction($thisAuthPopup,_207,_208,_206);});_206.css(_20b).show();_206.appendTo("body");authorPopupHover(_206);}},700);_205.data("destroyHandleAuthPopout",_20a);}function authorPopUpAction(_20e,_20f,_210,_211){_20e.find("li[purpose=\"watchUser\"]").click(function(){$thisWatchCont=$(this);var _212={};_212.forumGroupId=forumGroupId;_212.itemId=_20f;_212.itemType=3;_212[csrfParamName]=csrfToken;var _213=$thisWatchCont.attr("watchAction");var _214=(_213=="watch")?"/watchUser.do":"/unwatchUser.do";doAjaxAction(_214,_212,function(data){if(data=="SUCCESS"){$thisWatchCont.attr("watchAction",(_213=="watch")?"unwatch":"watch");var _216=((_213=="watch")?i18n["zohodiscussions.general.Unwatch"]:i18n["zohodiscussions.general.watch"])+" "+_210;$thisWatchCont.find("a[purpose=\"watchuserNameCont\"]").html(_216);if(_213=="watch"){showTipper(i18n["zohodiscussions.generalmessage.userAddedToWatchlist"],"success");}else{showTipper(i18n["zohodiscussions.generalmessage.userRemovedFromWatchlist"]);}}});});_20e.find("li[purpose=\"addAsFriend\"]").click(function(){$addFriendCont=$(this);var _217=$addFriendCont.attr("successMsg");var _218={};_218.forumGroupId=forumGroupId;_218.userId=_20f;_218[csrfParamName]=csrfToken;doAjaxAction("/addAsFriend.do",_218,function(data){hideLoadingImage();if(data=="SUCCESS"){$addFriendCont.attr("purpose","friendWaitingApproval");$addFriendCont.find("a[linkpurpose=\"addAsFriend\"]").attr("style","cursor:default;text-decoration:none;").html(i18n["zohodiscussions.friends.awaitingApproval"]);$addFriendCont.find("div.imgAddFriend").removeClass("imgAddFriend").addClass("imgWaitingFriend");showTipper(_217,"success");}});});_20e.find("li[purpose=\"authorProfile\"]").click(function(){if(_210==screenName||_210==encodedScreenName){processHash("MyArea");}else{processHash("User/"+_210);}});_211.html("").append(_20e);if(typeof WmsContacts!="undefined"&&ch=="true"){var _21a=WmsContacts.status(_20f);if(_21a===false){_21a=9;}manageUserChatStatus("authorPopup_"+_20f,_21a);}}function authorPopupHover(_21b){_21b.hover(function(){_21b.attr("hideAuhPopout","false");var _21c=_21b.data("destroyHandle");if(_21c){clearTimeout(_21c);}},function(){var _21d=setTimeout(function(){_21b.hide();_21b.unbind("mouseenter").unbind("mouseleave");},700);_21b.data("destroyHandle",_21d);});}function displaySearchOption(){var _21e=$("#listOfSearchOptions");_21e.show();_21e.find("li").unbind("click").click(function(){var _21f=$(this);var _220=_21f.find("div");var _221=_220.attr("class");var _222=_220.attr("purpose");if(!_220.is(".imgAdvanceSearch")){if(_220.is(".imgSearchBlack")){_221="imgSearchWhite flLeft";}$("#searchSelectedImage").attr("class",_221).attr("purpose",_222);$("#searchInputBox").focus();}else{if($("#advanceSearchContainerForm").is(":visible")){$("#listOfSearchOptions").hide();return;}if($("#searchMainContainer").is(":visible")){$("#normalSearchInSearchList").hide();$("#advanceSearchContainerForm").show();$("#advanceSearchInpurBox").focus();return;}showLoadingImage();var _223={};_223.forumGroupId=forumGroupId;doAjaxAction("/AdvanceSearchContainer.do",_223,function(data){hideLoadingImage();var _225=$("#mainContent > div:first");var _226=$("<div></div>");_226.get(0).innerHTML=data;_226.insertBefore(_225);_226.find("#advanceSearchContainerForm").show();_226.find("#advanceSearchInpurBox").focus();if($("#normalSearchInSearchList").is(":visible")){$("#normalSearchContainer").hide();}bindSearchContentClick(_226);},function(_227){hideLoadingImage();var _228=(_227.responseText);$("#mainContent").get(0).innerHTML=_228;});}_21e.hide();});var _229=_21e.parent("div");_229.hover(function(){var _22a=_229.data("destroyHandle");if(_22a){clearTimeout(_22a);}},function(){var _22b=setTimeout(function(){_21e.hide();_229.unbind("mouseenter").unbind("mouseleave");},500);_229.data("destroyHandle",_22b);});}function bindSearchContentClick(_22c){_22c.unbind("click",processSearchContClick).click(processSearchContClick);$("#SearchforumCategoryVice").change(function(){searchForumCatSelect($(this));});}function searchForumCatSelect(_22d){var _22e=_22d.val();var _22f=$("#searchCategoryList").val().split("$$");$.each(_22f,function(_230,item){if(item.indexOf(_22e+":")>-1){$("#SearchCategoryVice").html("<option selected value=\"-1\">"+i18n["zohodiscussions.myArea.all"]+"</option>"+item.split(":")[1]).show();$("#SelectCategory option:first").attr("selected","true");return false;}else{if(_22e==-1){$("#SearchCategoryVice").html("<option selected value=\"-1\">"+i18n["zohodiscussions.myArea.all"]+"</option>").show();}else{$("#SearchCategoryVice").html("<option selected value=\"-1\">Uncategorised</option>").show();}}});$("#SearchCategoryVice option:first").attr("selected","true");}function bindWidgetsContClick(_232){_232.unbind("click",processWidgetsContClick).click(processWidgetsContClick);showAuthorPopout(_232);bindSubscribeAction();var _233=$("#followAnnouncement a[purpose=\"watchAnnouncement\"]");_233.click(function(_234){watchThisItem(_233,"announcement",_234);});}function bindAllForumsClick(_235){_235.unbind("click",processAllForumsClick).click(processAllForumsClick);showAuthorPopout(_235);}function processTopicListHeaderClick(_236){var _237=$(_236.target);var _238=_237.parent();if(_237.is("#forumsFilter span, #categoriesFilter span, #forumsFilter li, #categoriesFilter li,#currentCategoryContext,#currentForumContext")){if(_237.is("#forumsFilter span,#categoriesFilter span")){_237=_238;}hashPurpose=_237.attr("hashPurpose");processHash(hashPurpose);return false;}else{if(_237.is("div[purpose=\"linkForDropDown\"]")){var _239=_237;var _23a=_239.attr("dropDownContLocation");var _23b=$(_239.attr("parentCont"));if(_23b.is(".newCombo")){_23b.addClass("newComboSelected").removeClass("newCombo");}else{_23b.addClass("newCombo").removeClass("newComboSelected");}var _23c=$("#"+_23a);_23c.toggle();}}if(_237.is("#topicListFilter li[purpose=\"filterLink\"]")){var _23d=_237.attr("topicFilter");$topicFilterParent=$("#topicListFilter");var _23e=$topicFilterParent.attr("forumURL");var _23f=$topicFilterParent.attr("subForumURL");var _240="";if($topicFilterParent.attr("isTypeURL")=="yes"){getMoreTopics(_23e,_23f,fetchPage,_23d,"",_240);$("#currentFilterContext").html(_237.text());}else{manageFilterHash(_23e,_23f,_23d,_240);}return false;}if(_237.is("#showAllTags")&&_237.attr("isNiceURL")!="Yes"){processHash("AllTags");}else{if(_237.attr("purpose")=="filterTab"||(_237.is("#innerTabFilter span")&&_238.parent().attr("purpose")=="filterTab")){if(!(_237.attr("purpose")=="filterTab")){_237=_238;}manageFilterTabList(_237);}else{if(_237.is("#innerTabFilter li[purpose=\"filterTabMenu\"]")||_238.attr("purpose")=="filterTabMenu"){if(_238.attr("purpose")=="filterTabMenu"){_237=_238;}manageFilterMenuList(_237.attr("filterParent"),_237);}else{if(_238.attr("id")=="searchTwitterTab"){manageFilterTabList(_238);}}}}var _241=$("#typeFilterOptions");}function getTwitterSearchList(_242,_243,_244){if(isTwitterPortal!="true"){return;}var _245=$("#tweetContainer");var _246=_245.attr("status_Id");var _247={};_247.forumGroupId=forumGroupId;_247.forumId=_242;_247[csrfParamName]=csrfToken;_247.fetchPage=_243;var _248=parseInt(_243)+1;if(typeof _244!="undefined"){_247.sinceId=_244;}else{if(_243>1){_247.maxId=_246;}else{showLoadingImage();}}doAjaxAction("/getTwitterSearchList.do",_247,function(data){var _24a=$("#topicList");if(_243>1){$("#searchMoreTweetsLoading").remove();var _24b=$("<div class=\"tFootCount\" id=\"searchMoreTweets\" forumId=\""+_242+"\" fetchPage=\""+_248+"\" loadCompleted=\"false\">Older Tweets</div>");$("#searchMoreTweetsParents").html(_24b);var _24c=$("<div></div>");_24c.html(data);var _24d=_24c.find("#tweetContainer li");_24d.each(function(){$(this).hide();_245.append($(this));});_24c.unbind("click",bindTwittReplyContent).click(bindTwittReplyContent);}else{if(typeof _244!="undefined"){var _24e=_245.find("li[isrecenttweets = \"true\"]").length;if(_24e>1){_24e=parseInt(_24e)-1;}var _24c=$("<div></div>");_24c.html(data);var _24f=_24c.find("li");_24f.hide();var _250=_24f.length;if(_250>0){var _251=_24c.find("#tweetContainer").attr("status_Id");_245.attr("status_Id",_251);$("#searchRecentTweet").remove();_24f.insertBefore(_245.find("li:first"));_250=parseInt(_250)+_24e;var _252=$("<li isrecenttweets=\"true\" id=\"searchRecentTweet\"><div id=\"searchRecentTweetsLink\" class=\"tCount\">You have "+_250+" new tweets</div></li>");_252.insertBefore(_245.find("li:first"));$("#searchRecentTweetsLink").unbind("click").click(function(){_245.find("li[isrecenttweets = \"true\"]").attr("isrecenttweets","false").show();$(this).parents("li").remove();});}manageRecentTweets();}else{var _253=$("#topicListMainContainer");if(_253.length>0&&_253.is("[shouldReload=\"false\"]")){_253.show().attr("shouldReload","true");}_24a.get(0).innerHTML=data;hideLoadingImage();if(_242==-1){var _254=-1;if($("#forum_Twitter_Default").length>0){_254=$("#forum_Twitter_Default").attr("forumId");}else{_254=$("#forum_Twitter_SelectForum").val();}loadTweetCategories(_254,"twitter_SubForumList","forum_Twitter_SelectSubForum");}}_24a.unbind("click",bindTwittReplyContent).click(bindTwittReplyContent);}if(_243==1&&typeof _244=="undefined"){manageRecentTweets();$.history.add("filter/twitter");getTwitterSearchList(_242,2);}});}function initTwitterPageActions(_255){var _256=$("#topicList");_256.unbind("click",bindTwittReplyContent).click(bindTwittReplyContent);bindTopicListHeaderClicks($("#topicListHeader"));bindWidgetsContClick($("#topicListWidgetsCont"));if(typeof _255=="undefined"||_255=="null"){_255=-1;}getTwitterSearchList(_255,2);manageRecentTweets();}function manageRecentTweets(){var _257=$("#tweetContainer");if(_257.is(":visible")){setTimeout(function(){if(_257.is(":visible")){var _258=_257.attr("forumId");var _259=_257.attr("status_Id");getTwitterSearchList(_258,1,_259);}},60000);}}function bindTwittReplyContent(_25a){var _25b=$(_25a.target);var _25c=_25b.parent();if(_25c.is(".ndTwitterBtnCont")&&_25c.attr("purpose")=="replyTweet"){addNewTweetPost(_25b);}else{if(_25b.is("#searchMoreTweets")){manageMoreTweets(_25b);}}}function manageMoreTweets(_25d){var _25e=_25d.attr("forumId");var _25f=_25d.attr("fetchPage");_25d.parents("li").remove();var _260=$("#tweetContainer");_260.find("li[isrecenttweets = \"false\"]").show();_25f=parseInt(_25f)+1;getTwitterSearchList(_25e,_25f);}function addNewTweetPost(_261){var _262=$("#tweetContainer");if(_262.data("inEditMode")==true){var _263=_262.data("currStatusId");$("#tweetReply_"+_263).focus();showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");return;}var _264=_261.attr("statusId");var _265=$("#eachTwittId_"+_264);var _266=$("#twitterCont_"+_264);var _267=$("#twitterImg_"+_264);var _268={};_268.forumGroupId=forumGroupId;_268.statusId=_264;_268.tweetBy=_265.attr("tweetBy");_268.tweetDate=_265.attr("tweetDate");_268.tweetAuthImg=_267.attr("src");_268.tweetCont=_266.html();_268[csrfParamName]=csrfToken;newOpenEditor($("#tweetReplyContainer_"+_264),"responseContent","postContentTA","tweetReply_"+_264,"TweetPost","tweetContainer");_262.data("inEditMode",true);_262.data("currStatusId",_264);}function loadTweetCategories(_269,_26a,_26b){var _26c=$("#"+_26a).val().split("$$");var _26d=$("#"+_26b);_26d.hide();_26d.html("");$.each(_26c,function(_26e,item){if(item.indexOf(_269+":")>-1){_26d.html(item.split(":")[1]).show();return false;}else{if(_269!=-1){_26d.html("<option selected value=\"-1\">Uncategorised</option>").show();}else{_26d.html("<option selected value=\"-1\">choose Subforum</option>").show();}}});}function manageFilterTabList(_270){var _271=$("#innerTabFilter");_271.find("li.selectedTab").removeClass("selectedTab");if(_270.attr("purpose")=="filterTab"){_270.addClass("selectedTab");}else{_270.parents("li").addClass("selectedTab");}var _272=_271.attr("forumURL");var _273=_271.attr("subForumURL");var _274=1;var _275=_270.attr("filterBy")||_270.find("a").attr("filterBy");var _276="";var _277=_271.attr("topicFilterType");var _278=_271.attr("postSinceLastVisitTime");if(_277!="All"){_276=_270.attr("filterLabelId")||_270.find("a").attr("filterLabelId");if(_276){_276=_275;_275=_277;}}if(_271.attr("isTypeURL")=="yes"){getMoreTopics(_272,_273,_274,_275,_278,_276);}else{manageFilterHash(_272,_273,_275,_276);}}function manageFilterHash(_279,_27a,_27b,_27c){var _27d="forum/";if(isTopicQuickView=="false"||_279==""){_27d="";}if(_279!=""&&typeof _279!="undefined"){_27d=_27d+_279+"/";}if(_27a!=""&&typeof _27a!="undefined"){_27d=_27d+_27a+"/";}if(_27c!=""){_27c="/"+_27c;}var _27e="filter/"+_27b+_27c+"/1";if(typeof _27b!="undefined"&&_27b.toLowerCase()=="all"){if(""!=_279){_27e="1";}else{if(isTopicQuickView=="false"){_27e="recent";}else{_27e="";}}}processHash(_27d+_27e);}function manageFilterMenuList(_27f,_280){var _281=$("#"+_27f);if($("#innerTabFilter div.forumOptions").is(":visible")){$(this).hide();}if(_280.attr("purpose")=="filterTabMenu"){var _282=$("#innerTabFilter");var _283=_282.attr("forumURL");var _284=_282.attr("subForumURL");var _285=_280.attr("labelName");var _286=_280.parent().attr("filterType");var _287=1;_282.find("li.selectedTab").removeClass("selectedTab");$("#"+_286+"FilterMenuList").addClass("selectedTab");var _288=_280.attr("filterBy");if(_288){_286=_288;}if(_282.attr("isTypeURL")=="yes"){getMoreTopics(_283,_284,_287,_286,"",_285);}else{manageFilterHash(_283,_284,_286,_285);}}}function bindTagsContClick(_289){_289.find("li[purpose =\"getTagPosts\"]").click(function(){$this=$(this);var _28a=$this.attr("hashPurpose");processHash(_28a);});}function processTopicListClick(_28b){var _28c=$(_28b.target);var _28d=_28c.parent();var _28e=$("#topicList");var _28f="topicList";var _290=_28c.parents("li[parentCont=\"actualParent\"]").attr("forumTopicId");if(_28c.is("span[defaultTopicView=\"true\"]")||_28c.is("a[purpose=\"postTitleQuickView\"]")){_290=_290||_28d.parents("li[parentCont=\"actualParent\"]").attr("forumTopicId");if(_28c.is("span.nddownArrow")){var _291=_28e.data("currentUpArrow");if(typeof _291!="undefined"){_291.removeClass("ndupArrow").addClass("nddownArrow");}_28c.removeClass("nddownArrow").addClass("ndupArrow");_28e.data("currentUpArrow",_28c);}else{if(_28c.is("span.ndupArrow")){_28c.removeClass("ndupArrow").addClass("nddownArrow");}}handleTopicClick(_28b,_290,_28f);}else{if(_28c.is("a[purpose=\"postTitle\"]")||_28c.is("a.orangeLink")||_28c.is("span[defaultTopicView=\"false\"]")){showLoadingImage();if(isTopicQuickView=="false"){}else{var _292=_28c.parents("li[parentCont=\"actualParent\"]").attr("recentResponseId");var _293=_28c.attr("isResponse");if(_292!=undefined&&_293=="true"){processHash("Topic/"+_290+"/"+_292);}else{processHash("Topic/"+_290);}return false;}}else{if(_28d.is("li[purpose=\"moreAction\"]")){manageMoreAction(_28d);}else{if(_28c.is("a[purpose=\"moreAction\"]")){var _294=_28c.parents("li");manageMoreAction(_294);}else{if(_28c.is("a[purpose=\"linkedTopicTitle\"]")){showLoadingImage();if(isTopicQuickView=="false"){}else{var _295=_28c.attr("linkToTopicId");processHash("Topic/"+_295);return false;}}else{if(_28c.is("li[linkPurpose=\"replyToTopic\"]")||_28d.is("li[linkPurpose=\"replyToTopic\"]")){_290=_290||_28d.parents("li[parentCont=\"actualParent\"]").attr("forumTopicId");if(_28e.data("inEditMode")==true){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");var _296=_28e.data("editorContLocation");var _297=_28e.data("eachTopicContainerId");var _298=_28e.data("forumTopicId");if(_298!=_290){handleTopicClick(_28b,_298,"editTopicList");}setFocusToContainer($(_296));return false;}$("#eachTopicReplyCont_"+_290).show();newOpenEditor($("#eachTopicReply_"+_290),"responseContent","postContentTA","replyToTopic_"+_290,"Write","paginationContainer");setFocusToContainer($("#eachTopicReplyCont_"+_290));_28e.data("inEditMode",true);_28e.data("editorContLocation","#eachTopicReplyCont_"+_290);_28e.data("eachTopicContainerId","#eachTopic_"+_290);_28e.data("forumTopicId",_290);return false;}else{if((_28c.is("#olderPostsLink")||_28c.is("#newerPostsLink"))&&_28c.is(".navBtnEnabled")){var _299=_28c.attr("forumURL");var _29a=_28c.attr("categoryURL");var _29b=_28c.attr("fetchPage");var _29c=_28c.attr("topicFilter");var _29d=_28c.attr("getPostFor");var _29e=_28c.attr("topicStatus");var _29f=_28c.attr("postSinceLastVisitTime");if(typeof _29d=="undefined"){getMoreTopics(_299,_29a,_29b,_29c,_29f,_29e,"true");}else{var _2a0=_28c.attr("tag_Name");getMoreTagRelatedPost(_29b,_2a0,_29d);}}else{if(_28c.is("a[purpose=\"forumPostsFilter\"]")){hashPurpose=_28c.attr("hashPurpose");processHash(hashPurpose);return false;}else{if((_28c.is("a[purpose=\"authorProfile\"]"))||_28c.is("img[purpose=\"authorProfile\"]")){var _2a1=_28c.attr("authorName");if(_2a1==screenName||_2a1==encodedScreenName){processHash("MyArea");}else{processHash("User/"+_2a1);}return;}else{if(_28c.is("div.imgSmallWatchSel")||_28c.is("div.imgSmallWatch")){watchThisItem(_28c,"singleTopicWatch",_28b);return;}else{if((_28c.is("li.ndtopicNavPrev")||_28c.is("li.ndtopicNavNext"))&&!_28d.is(".navLoading")){checkPrevNextResponse(_28c);return;}else{if((_28c.is("li.ndtopicNavFirst")||_28c.is("li.ndtopicNavLast"))&&!_28d.is(".navLoading")){firstOrLastResponse(_28c);return;}else{if(_28d.is("li[purpose=\"watchAction\"]")){_28f=(_28d.is("li[purpose=\"watchAction\"]"))?_28f:"";watchThisItem(_28d,_28f,_28b);return;}else{if(_28c.is("input[purpose=\"watchAction\"]")){var _290=_28c.attr("forumTopicId");var _2a2=$("#eachTopicReplyCont_"+_290).find("input[name=\"isFollowTopic\"]");if(_28c.attr("checked")==true){_2a2.attr("value","true");}else{_2a2.attr("value","false");}return;}else{if(_28d.is("li[purpose=\"emailThisTopic\"]")){openEmailTopicDialog(_28d);var _294=_28d.parents("li[purpose=\"moreAction\"]");manageMoreAction(_294);return;}else{if(_28d.is("li[purpose=\"moderateThisTopic\"]")){moderateAction(_28d,_28f,_28b);return;}else{if(_28d.is("li[actionPurpose=\"delete\"]")){singlePostDeleteAction(_28d,_28f);return;}else{if(_28d.is("#removeTopicLink")||_28d.is("li[purpose=\"removeTopicLink\"]")){deletelinkedTopic(_28d);}else{if(_28d.is("li[actionPurpose=\"edit\"]")){var _2a3=_28d.attr("responseId");var _2a4=_28d.parents("li[parentCont=\"actualParent\"]").attr("forumTopicId");var _2a5="#eachTopic_"+_2a4;if(_28e.data("inEditMode")){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");_296=_28e.data("editorContLocation");var _298=_28e.data("forumTopicId");if(_2a4!=_298){handleTopicClick(_28b,_298,_28f);}setFocusToContainer($(_296));return false;}newOpenEditor($("#recentResponseContent_"+_2a3),"responseContent","postContentTA",("editPostContent_"+_2a3),"Edit",("eachTopic_"+_2a3));setFocusToContainer($(_2a5));_28e.data("inEditMode",true);_28e.data("editorContLocation",_2a5);_28e.data("forumTopicId",_2a4);$("#postTextContent_"+_2a3).find("ul.singlePostActions").hide();$("#linkedTopic_"+_2a3).hide();$("#singlePostActions_"+_2a3).hide();$("#recent_ResPonse_"+_2a3).find("div.listOfResponseLink").hide();$("#previewResponse").attr("location","topicListEditResponse");$("#previewResponse").attr("responseId",_2a3);$("#previewResponse").attr("forumTopicId",_2a4);return false;}else{if(_28c.is("li[deletepurpose=\"deleteAttachment\"]")){deletePublishedAttachment(_28c,_28b);return;}else{if(_28d.is("li[bestResponse]")){var _2a6=_28d;var _2a3=_2a6.attr("responseId");var _290=_2a6.parents("li[parentCont=\"actualParent\"]").attr("forumTopicId");var _2a7=_2a6.attr("topicAuthorId");var _2a8=_2a6.attr("bestResponse");var _2a9={};_2a9.forumGroupId=forumGroupId;if(_2a8=="choose"){_2a9.responseId=_2a3;}_2a9.forumTopicId=_290;if(_2a7==ZUID){_2a9.topicowner="true";}_2a9[csrfParamName]=csrfToken;var _2aa=(_2a8=="choose")?"/bestResponse.do":"/removeBestResponse.do";showSmallLoadingImage(_28b);doAjaxAction(_2aa,_2a9,function(data){if(data=="SUCCESS"){var _2ac=(_2a8=="choose")?i18n["zohodiscussions.singlepost.bestResponseSuccessMsg"]:i18n["zohodiscussions.singlePost.removeBestResponseMsg"];var _2ad=(_2a8=="choose")?"success":"info";showTipper(_2ac,_2ad);refreshSingleTopic(_290);}else{hideLoadingImage();showMessage(i18n["zohodiscussions.generalmessage.noPermission"]);}});}else{if(_28c.is("input[followItem]")){var _2ae=_28c.attr("followItem");var _2af=_28c.attr("responseId");if(_2ae=="true"){watchItem(_28c);}$("#followTopicList_"+_2af).hide();}}}}}}}}}}}}}}}}}}}}}}}function manageMoreAction(_2b0){if(_2b0.is(".newComboSelectedNm")){_2b0.removeClass("newComboSelectedNm").addClass("newCombo");_2b0.find("div.forumOptins").hide();return;}_2b0.removeClass("newCombo").addClass("newComboSelectedNm");var _2b1=_2b0.find("div.forumOptins");_2b1.show();_2b0.hover(function(){_2b0.attr("hideAuhPopout","false");var _2b2=_2b0.data("destroyHandle");if(_2b2){clearTimeout(_2b2);}},function(){var _2b3=setTimeout(function(){_2b0.removeClass("newComboSelectedNm").addClass("newCombo");_2b1.hide();_2b0.unbind("mouseenter").unbind("mouseleave");},500);_2b0.data("destroyHandle",_2b3);});}function refreshResponseVoteContainer(_2b4){var _2b5={};_2b5.forumGroupId=forumGroupId;_2b5.responseId=_2b4;doAjaxAction("/refreshSingleResponse.do",_2b5,function(data){var _2b7=$(data).find("div[contPurpose=\"voteContainer\"]");$("#postTextContent_"+_2b4+" div[contPurpose=\"voteContainer\"]").html(_2b7.html());hideLoadingImage();});}function backtoEditor(){$("#addForumPostForm").show();$("#writeNewTopic").show();$("#publishPreviewedTopic").hide();$("#backToEditor").hide();$("#preview_Posts").hide();$("#writePostButtons").show();$("#writepostCont").show();$("#forumTagsPreview").html(" ");}function publishPreviewedTopic(){$("#publishTopic").trigger("click");}function writePostPreview(_2b8,_2b9,flag,_2bb){var _2bc=$("#topicTitle").val();var _2bd=_2bc.replace(/^<+|<+$/g,"&lt;").replace(/<+/g,"&lt;").replace(/^>+|>+$/g,"&gt;").replace(/>+/g,"&gt;");_2bd=_2bd.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ");if(_2bd==""){hideLoadingImage();setFocusToContainer(($("#topicTitle")).focus());enablePostButtons();showMessage(i18n["zohodiscussions.writePost.TopicTitleCannotbeEmptymessage"],"failure");return;}if(_2bd.length>200){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.TopicTitleLengthMsg"],"failure");enablePostButtons();return;}var _2be=editor.getContent();_2be=_2be.replace(/^\s+/g,"").replace(/\s+$/g,"");var _2bf=$("<div></div>").html(_2be);_2be=_2bf.text();if(_2be==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");enablePostButtons();return;}var _2c0=$("#SelectForum").val();var _2c1=$("#SelectCategory").val();if(_2c0==null){hideLoadingImage();$("#selectForumMessage").show();setFocusToContainer($("#SelectForum"));enablePostButtons();showMessage(i18n["zohodiscussions.writePost.selectAnyForum"],"failure");return;}else{if(_2c1=="0"){hideLoadingImage();$("#selectForumMessage").show();setFocusToContainer($("#SelectCategory"));enablePostButtons();showMessage(i18n["zohodiscussions.writePost.selectAnyCategory"],"failure");return;}else{$("#selectForumMessage").hide();}}var _2c2=$("#forumTags").val();if(_2c2!=""){_2c2=_2c2.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");if(_2c2.match(/[a-zA-Z0-9, ]+$/)==null){hideLoadingImage();showMessage(i18n["zohodiscussions.singlepost.specialCharacterNotAllowedMsg"],"failure");enablePostButtons();return;}}if(_2bb){$("#previewAttachment >li").html("");var _2c3=$("#attachmentsListCont").find("div[attachmentDetails]");var _2c4=$("#attachmentsListCont").find("div[attachmentDetails]").length;if(_2c4>0){var _2c5=$("#previewAttachment");attachmentListPreview(_2c5,_2c3);$("#AttachmentPreviewCont").show();}else{$("#AttachmentPreviewCont").hide();}}$("#addForumPostForm").hide();$("#writeNewTopic").hide();$("#publishPreviewedTopic").show();$("#backToEditor").show();$("#writepostCont").hide();var _2c6=$("#preview_Posts").show();$("#writePostButtons").hide();var _2c7=$("#TopicContentHolder").attr("imgAttrClass");var _2c8=$("#previewTopicTypeImg").attr("class");var _2c9=_2c8.split(" ");$("#previewTopicTypeImg").removeClass(_2c9[1]).addClass(_2c7);if(_2c6.is(":visible")){var _2ca=$("#preview_breadCrumb,#preview_postHeader");_2ca.find("a[purpose=\"authorProfile\"]").html(_2b8);$("#previewDocumentTitle").html(_2bd);_2ca.find("a[purpose=\"forum_Topic\"]").html($("#SelectForum option:selected").text());var _2cb=$("#SelectCategory option:selected").text();var _2cc=$("#SelectCategory option:selected").val();if(_2cc>0){_2ca.find("span[purpose=\"cateArrow\"]").show();_2ca.find("a[purpose=\"category_Topic\"]").html(_2cb);}else{_2ca.find("span[purpose=\"cateArrow\"]").hide();_2ca.find("a[purpose=\"category_Topic\"]").html("");}_2c2=_2c2.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");if(_2c2==""){$("#forumTagsPreview").html(i18n["zohodiscussions.singlepost.noTagsMsg"]);}var _2cd=_2c2.split(",");for(var _2ce=0;_2ce<_2cd.length;_2ce++){if(jQuery.trim(_2cd[_2ce])!=""){$("#forumTagsPreview").append("<li><a>"+_2cd[_2ce]+"</a></li>");}}var _2be=editor.getContent();_2be=_2be.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_2be==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");return;}_2c6.find("#responsePreviewContentContainer").html(_2be);}}function forHidingSmallLoadingImg(){var _2cf="";var cont="";if($("#newPostRightCont").length>0){_2cf=$("#newPostRightCont");}else{if($("#attachBrowseCont").length>0){_2cf=$("#attachBrowseCont");}}_2cf.find("[purpose='attachLoadingCont']").hide();}function processSearchContClick(_2d1){var _2d2=$(_2d1.target);var _2d3=_2d2.parent();if($("#loadingImg").is(":visible")){return;}if(_2d3.is("div[purpose=\"advanceSearch\"]")){$("#advanceSearchContainerForm").show();$("#normalSearchInSearchList").hide();}else{if(_2d2.is("button[purpose=\"advanceSearchCancel\"]")||_2d2.is("div[purpose=\"advanceSearchCancel\"]")){if($("#advancedSearchForm").is(":visible")){$("#advancedSearchForm").remove();}else{$("#advanceSearchContainerForm").hide();$("#normalSearchContainer").show();$("#normalSearchInSearchList").show();}}else{if(_2d2.is("button[purpose=\"normalSearch\"]")){var _2d4=$("#normalSearchInputBox").val();processHash("normalsearch");}else{if(_2d2.is("button[purpose=\"getAdvanceSearch\"]")){getAdvanceSearchResult();}else{if(_2d2.is("a[purpose=\"postTitle\"]")){var _2d5=_2d2.attr("forumTopicId");var _2d4=_2d2.attr("searchFor");openSinglePost(_2d5,"topic",_2d4);return;}else{if(_2d3.is("a[purpose=\"postTitle\"]")){var _2d5=_2d3.attr("forumTopicId");var _2d4=_2d3.attr("searchFor");openSinglePost(_2d5,"topic",_2d4);return;}else{if(_2d2.is("a[purpose=\"forumAction\"]")||_2d2.is("a[purpose=\"categoryAction\"]")){var _2d6=_2d2.attr("hashPurpose");processHash(_2d6);}else{if(_2d2.is("a[purpose=\"authorProfile\"]")||_2d3.is("a[purpose=\"authorProfile\"]")){var _2d7=_2d2.attr("authorName");if(!_2d7){_2d7=_2d3.attr("authorName");}var _2d8=_2d2.attr("singleClickflag");if(!_2d8){_2d8=_2d3.attr("singleClickflag");}if(_2d8=="0"){if(_2d7==screenName||_2d7==encodedScreenName){processHash("MyArea");_2d2.attr("singleClickflag","1");}else{processHash("User/"+_2d7);_2d2.attr("singleClickflag","1");}}return;}else{if(_2d2.is("li.navBtnEnabled")&&_2d2.is("[navType=\"searchNav\"]")){var _2d9=_2d2.attr("purpose");searchNavigation(_2d3,_2d9);return;}else{if(_2d2.is("a[purpose=\"relativeLinkSearch\"]")){searchNavigation(_2d2,"relativeLinkSearch");}else{if(_2d2.is("a[purpose=\"sortbyrelevance\"]")&&!_2d2.is(".boldText")){searchNavigation($("#breadCrumbForSearch span:last a"),"breadCrumbForSearch","relevance");}else{if(_2d2.is("a[purpose=\"sortbydate\"]")&&!_2d2.is(".boldText")){searchNavigation($("#breadCrumbForSearch span:last a"),"breadCrumbForSearch","date");}else{if(_2d2.is("a[purpose=\"breadCrumbForSearch\"]")){searchNavigation(_2d2,"breadCrumbForSearch");}else{if(_2d2.is("a[purpose=\"expandForumList\"]")){var _2da=_2d2.attr("status");if(_2da=="off"){_2d2.attr("status","on").html("&laquo; less");_2d2.parents("ul").find("li").show();}else{_2d2.attr("status","off").html("more &raquo;");var _2db=0;_2d2.parents("ul").children("li").each(function(){if(_2db>4){$(this).hide();}_2db++;});}}}}}}}}}}}}}}}}function searchNavigation(_2dc,_2dd,_2de){showLoadingImage();var _2df=parseInt(_2dc.attr("fetchPage"));var _2e0=_2dc.attr("fieldType");var _2e1=_2dc.attr("categId");var _2e2=_2dc.attr("pathTraverse");var _2e3=$("#breadCrumbForSearch");var _2e4=_2dc.attr("forumId");var _2e5=_2dc.attr("searchLevel");if(_2dd=="next"){_2df=_2df+1;}else{if(_2dd=="prev"){_2df=_2df-1;}else{_2df=1;}}if(_2e4=="undefined"){_2e4=-1;}if(_2e5=="forums"||_2e5=="all"){_2e1="";_2e2="";var _2e6=$("#SearchforumCategoryVice");var _2e7=$("#SearchCategoryVice");_2e7.find("option[value=\"-1\"]").attr("selected","true");if(_2e5=="all"){_2e6.find("option[value=\"-1\"]").attr("selected","true");}}var _2e8=_2de;if(_2e8!="relevance"&&_2e8!="date"){_2e8=$("#currSearchSortBy").attr("currSortBy");}if($("#searchListContainer").is(":visible")){doAjaxAction("/getMoreSearchResult.do?fetchPage="+_2df+"&searchSortBy="+_2e8+"&category_id="+_2e1+"&category_pathTraverse="+_2e2+"",$("#advanceSearchForm").serialize(),function(data){hideLoadingImage();reloadeSearchContainer(data,_2dd,_2e0,_2e4,_2e1,_2e2,_2e8);});}else{var _2ea={};_2ea.fetchPage=_2df;_2ea.searchSortBy=_2e8;if(_2dd=="breadCrumbForSearch"){_2ea.searchFor=_2e3.attr("searchFor");}else{_2ea.searchFor=_2dc.attr("searchFor");}_2ea.category_pathTraverse=_2e2;_2ea.category_id=_2e1;_2ea.forumGroupId=forumGroupId;_2ea.forumId=_2e4;_2ea.normalSearchType=$("#searchSelectedImage").attr("purpose");doAjaxAction("/getMoreSearchResult.do",_2ea,function(data){hideLoadingImage();reloadeSearchContainer(data,_2dd,_2e0,_2e4,_2e1,_2e2,_2e8);});}}function reloadeSearchContainer(data,_2ed,_2ee,_2ef,_2f0,_2f1,_2f2){var _2f3=$("#breadCrumbForSearch");var _2f4=$("<div></div>");_2f4.get(0).innerHTML=data;var _2f5=_2f4.find("#searchListContainer").html();$("#searchListContainer").html(_2f5);var _2f6=_2f4.find("#searchResultViewRange").html();$("#searchResultViewRange").html(_2f6);var _2f7=_2f4.find("#searchFilterArea").html();$("#searchFilterArea").html(_2f7);var _2f8=_2f4.find("#currSearchSortBy").html();$("#currSearchSortBy").html(_2f8).attr("currSortBy",_2f2);if(_2ed=="relativeLinkSearch"){var _2f9=$("<span> &raquo; <a class=underline href=javaScript:; purpose=breadCrumbForSearch fieldType="+_2ee+" forumId="+_2ef+" categId="+_2f0+" pathTraverse="+_2f1+">"+_2ee+"</a></span>");_2f9.insertAfter($("#breadCrumbForSearch").find("span:last"));}else{if(_2ed=="breadCrumbForSearch"){var _2fa=0;_2f3.children().each(function(){var _2fb=$(this);var _2fc=_2fb.find("a").attr("fieldType");if(_2fa==1){_2fb.remove();}if(_2fc==_2ee){_2fa=1;}});}}}function getAdvanceSearchResult(){showLoadingImage();var _2fd=$("#advanceSearchInpurBox").val();_2fd=$.trim(_2fd);if(_2fd==""){showMessage(i18n["zohodiscussions.searchList.noSearchString"],"failure");hideLoadingImage();return;}var _2fe=$("#SearchforumCategoryVice");var _2ff="forumId";var _300={};doAjaxAction("/getAdvanceSearchResult.do",$("#advanceSearchForm").serialize(),function(data){hideLoadingImage();var _302=$("<div></div>");_302.get(0).innerHTML=data;var _303=$("#searchContainer");if($("#searchListContainer").is(":visible")){var _304=_302.find("#searchResultFullContainer").html();$("#searchResultFullContainer").html(_304);}else{$("#mainContent").get(0).innerHTML=data;bindSearchContentClick($("#mainContent"));$("#advanceSearchContainerForm").show();$("#normalSearchInSearchList").hide();}},function(_305){hideLoadingImage();$("#mainContent").html(_305.responseText);});}function processWidgetsContClick(_306){var _307=$(_306.target);var _308=_307.parent();if(_307.is("a[hashPurpose]")&&_307.is("a[currpurpose=\"usingHash\"]")){var hash=_307.attr("hashPurpose");if(isTopicQuickView=="false"&&hash.indexOf("Topic/")==0){}else{processHash(hash);return false;}}else{if(_307.is("div.teeplus")){var _30a=_307.attr("forumId");var _30b=$("#allForumControl").find("div[purpose=\"subForumView_"+_30a+"\"]");_30b.removeClass("teeplus").addClass("teeminus");$("ul.eachCategoryContainer_"+_30a).show();}else{if(_307.is("div.teeminus")){var _30a=_307.attr("forumId");var _30b=$("#allForumControl").find("div[purpose=\"subForumView_"+_30a+"\"]");_30b.removeClass("teeminus").addClass("teeplus");$("ul.eachCategoryContainer_"+_30a).hide();}else{if(_308.is("#forumPermalink")){var _30c=_308.attr("thisForumPermalink");$("#PermalinkCont textarea").val(_30c);$("#permalink_Text").select();$("#PermalinkCont").show().parent().show();return;}else{if(_308.is("li.watchingForum")){watchThisItem(_308,"singleForumActions",_306);}else{if(_308.is("li.watchingCategory")){watchThisItem(_308,"singleCategoryActions",_306);}else{if(_307.is("a[purpose=\"newWatchedUser\"]")){processHash("myarea/dashboard");return;}else{if(_307.is("a[purpose=\"newPrivateMsg\"]")){processHash("myarea/privateMsg");return;}else{if(_307.is("a[purpose=\"newRecentActivity\"]")){var _30d=_307.attr("currStatus");if(_30d=="dashboard"){processHash("myarea/"+_30d);return;}processHash("myarea/watchList/"+_30d);return;}else{if(_307.is("a[purpose=\"authorProfile\"]")){var _30e=_307.attr("authorName");var _30f=_307.attr("singleClickflag");if(_30f=="0"){if(_30e==screenName||_30e==encodedScreenName){processHash("MyArea");_307.attr("singleClickflag","1");}else{processHash("User/"+_30e);_307.attr("singleClickflag","1");}}return;}else{if(_308.is("#loginToParticipate")){$("#signinwidgetBox").hide();$("#iamLoginBox").show();}else{if(_308.is("#chartMenu")){if(_307.is("li")){_307.siblings().removeClass("selected");_307.addClass("selected");var _310=_307.attr("assocImage");var _311=$(_310);if(_310=="#weekTrendChart"){var _312=_311.find("img[chart=\"true\"]");if(typeof _312.attr("src")=="undefined"){_312.attr("src",_312.attr("actualURL"));$("#weekTrendChartLoading").show().siblings("a").hide();_312.one("load",function(){_311.show();_311.prev("div[purpose=\"chartLoading\"]").hide();}).each(function(){if(this.complete){$(this).trigger("load");}});}else{_311.show().siblings().hide();}}else{_311.show().siblings().hide();}}}else{if(_307.is("li[assocDiv]")){_307.siblings().removeClass("selected");_307.addClass("selected");var _313=_307.attr("assocDiv");if(_313=="#topPublishers_Month"){if($(_313).find("li").length==0){var _30a=_307.attr("forumId");var _314=_307.attr("categoryId");var _315={};_315.forumGroupId=forumGroupId;_315.forumId=_30a;_315.categoryId=_314;doAjaxAction("/getLeaderboardTopics.do",_315,function(data){$(_313).get(0).innerHTML=data;});}$(_313).show();$("#topContributors_Month").hide();}else{$(_313).show().siblings("ul").hide();}}}}}}}}}}}}}}}function processAllForumsClick(_317){var _318=$(_317.target);var _319=_318.parent();if(_318.is("a[hashPurpose]")){var _31a=_318.attr("hashPurpose");if((isTopicQuickView=="false"&&_31a.indexOf("Topic/")==0)||_318.attr("isNiceUrl")=="Yes"){}else{processHash(_31a);return false;}}else{if(_319.is("li[purpose=\"eachForumPermalink\"]")){var _31b=_319.attr("thisForumPermalink");$("#PermalinkCont textarea").val(_31b);$("#permalink_Text").select();$("#PermalinkCont").show().parent().show();return;}else{if(_319.is("li.watchingForum")){watchThisItem(_319,"singleForumActions",_317);}else{if(_319.attr("itemType")==1){watchThisItem(_319,"singleCategoryActions",_317);}else{if(_319.is("div[purpose=\"moderator\"]")){var _31c=_319.attr("forumId");$forumCont=$("#forumId_"+_31c);if($forumCont.is(".singleForumSub")){$forumCont.removeClass("singleForumSub");}$forumCont.toggleClass("singleForumMod");}else{if(_319.is("div[purpose=\"subforums\"]")){var _31d=_319.attr("forumId");$forumCont=$("#forumId_"+_31d);if($forumCont.is(".singleForumMod")){$forumCont.removeClass("singleForumMod");}$forumCont.toggleClass("singleForumSub");}}}}}}}function handleTopicClick(_31e,_31f,_320){var _321=$("#eachTopic_"+_31f);var _322=$("#lastResponse_"+_31f);var _323=_322.parents("li[parentCont=\"actualParent\"]").attr("recentResponseId");var _324=$("#topicList");_324.data("currentSelectedPost",_321);var _325=_324.data("currentFocusPost");if(_325!=undefined){_325.removeClass("hotKeyTopicCont");}_324.data("currentFocusPost",_321);if(_322.is(":visible")==true){_321.removeClass("ndquickList").addClass("");}else{_321.siblings("li.ndquickList").removeClass("ndquickList").addClass(" ");_321.addClass("ndquickList");if(topicContent[_31f]){$("#recentResponseContent_"+_323).html(topicContent[_31f]);topicContent[_31f]=undefined;}setFocusToContainer($("#eachTopic_"+_31f),false,0);}if(_322.attr("navStatus")=="No"&&_320=="topicList"){_322.attr("navStatus","Yes");getprevAndFirstPost(_322);}}function getMoreTopics(_326,_327,_328,_329,_32a,_32b,_32c){showLoadingImage();var _32d={};var _32e="";var _32f=$("#topicListHeaderCont").attr("isTypeURL");var _330=$("#innerTabFilter");if($("#topicListFilter").is(":visible")){_330=$("#topicListFilter");}if(_326!=""){_32d.forumURL=_326;if(isTopicQuickView=="true"){_32e="forum/"+_326;}else{_32e=_326;}}if(_327!=""){_32d.categoryURL=_327;_32e=_32e+"/"+_327;}_32d.forumGroupId=forumGroupId;_32d.fetchPage=_328;var _331=0;if(_329&&_329.toLowerCase()!="all"&&(isOneTopicType!="true"||_329.toLowerCase()!="questions"&&_329.toLowerCase()!="ideas"&&_329.toLowerCase()!="problems")){if(_32e==""){_32e="filter";}else{_32e=_32e+"/filter";}_331=1;_32e=_32e+"/"+_329;}if(_329){if(_330.attr("isTypeURL")=="yes"){var _332=_330.attr("topicfiltertype");if(_329.toLowerCase()=="all"){_329=_332;}else{if(_329.toLowerCase()=="unrepliedposts"){_32d.unReplyWithType=_332;}}}_32d.topicFilter=_329;}if(_329=="postssincelastvisit"){var _333=_330.attr("postSinceLastVisitTime");if(_333!=null&&_333!="undefined"){_32d.postSinceLastVisitTime=_333;}}var _334="";if($("#topicList").length>0&&_32c!="reload"){_334="/getMoreTopics.do";$locadLocation=$("#topicList");}else{if($("#topicsList").length>0&&_32c!="reload"){_334="/getMoreTopicsTP.do";$locadLocation=$("#topicsList");}else{_334="/getSingleForumTopics.do";$locadLocation=$("#mainContent");}}if(_32b){_32b=_32b.toLowerCase();_32b=_32b.replace(/\s/ig,"").replace("-","");var _335=_32b;if(_329=="problems"&&_32b=="needmoreinfo"){_32b="moreinfo";_335="needmoreinfo";}if(_329=="questions"&&_32b=="workingonit"){_32b="working";_335="workingonit";}if(_32b=="we"){_32b="wewillthinkaboutit";_335=_32b;}if(i18n_Status_[_32b]){var _336=i18n_Status_[_32b];if(_336){if(_331==0&&_32e==""){_32e="filter";}else{if(_331==0){_32e=_32e+"/filter";}}_32e=_32e+"/"+_335;_32d.statusURL=_336;}}}doAjaxAction(_334,_32d,function(data){$locadLocation.get(0).innerHTML=data;bindTopicClicks($("#topicList"));bindTopicClicks($("#topicsList"));if(_334=="/getSingleForumTopics.do"){lightBox("#chartWidget");lightBox("#topicList");bindTopicListHeaderClicks($("#topicListHeader"));bindWidgetsContClick($("#topicListWidgetsCont"));}goToTop();hideLoadingImage();if(typeof WmsContacts!="undefined"&&ch=="true"){var _338=WmsContacts.getZohoContacts();setPresenceInTopicList(_338);}if(_329=="PostsSinceLastVisit"){var _339=$("#topicList").find("a.mediumUnderlineLink");_339.removeClass("mediumUnderlineLink").addClass("mediumUnderlineLinkNew");}if(_32f=="no"){if(isTopicQuickView=="true"){if(_32e!=""){if(parseInt(_328)>1){$.history.add(_32e+"/"+_328);}else{$.history.add(_32e);}}else{if(parseInt(_328)>1){$.history.add("home/"+_328);}else{$.history.add("home");}}}}},function(_33a){});return false;}function getMoreTagRelatedPost(_33b,_33c,_33d){showLoadingImage();var _33e={};_33e.fetchPage=_33b;_33e.tagName=_33c;_33e.forumGroupId=forumGroupId;_33e.getPostFor=_33d;doAjaxAction("/getMoreTagRelatedPosts.do",_33e,function(data){if($("#topicList").length>0){$("#topicList").get(0).innerHTML=data;bindTopicClicks($("#topicList"));}else{$("#topicsList").get(0).innerHTML=data;bindTopicClicks($("#topicsList"));}goToTop();hideLoadingImage();},function(_340){});return false;}function getSingleForumTopics(_341){showLoadingImage();var _342=_341;var _343={};_343.forumId=_342.attr("forumId");_343.categoryId=_342.attr("categoryId");_343.forumGroupId=forumGroupId;_343.fetchPage=_342.attr("fetchPage");_343.ch=ch;doAjaxAction("/getSingleForumTopics.do",_343,function(data){$("#mainContent").get(0).innerHTML=data;lightBox("#chartWidget");lightBox("#topicList");bindTopicClicks($("#topicList"));bindTopicClicks($("#topicsList"));bindTopicListHeaderClicks($("#topicListHeader"));bindWidgetsContClick($("#topicListWidgetsCont"));goToTop();hideLoadingImage();if($("#allForumWidget").length>0){if($("#allForumWidget").find("li[purpose=\"forumList\"]").length<9){$("#moreForumView").hide();}}},function(_345){$("#mainContent").get(0).innerHTML=_345.responseText;hideLoadingImage();});return false;}function selectTopicType(_346,_347){var _348="";if(typeof _347=="undefined"||_347==""){_346.addClass("selected").siblings("li[purpose=\"topicTypeTab\"]").removeClass("selected");_348=_346.attr("topicType");var _349=_346.attr("topicIconClass");}else{_349=_347;_348=$("#writepostCont").attr("topicType");}var _34a="";if(_348==1){_34a="imgAnnouncement";$("#announcementExpiryCont").show();}else{$("#announcementExpiryCont").hide();}$("#currentTopicType").val(_348);if(_349=="discuss"){_34a="imgDiscuss";$("#writeNewTopic").html(i18n["zohodiscussions.writePost.discussionTypeMessage"]);}else{if(_349=="question"){_34a="imgQuestion";$("#writeNewTopic").html(i18n["zohodiscussions.writePost.questionTypeMessage"]);}else{if(_349=="idea"){_34a="imgIdea";$("#writeNewTopic").html(i18n["zohodiscussions.writePost.ideaTypeMessage"]);}else{if(_349=="error"){_34a="imgError";$("#writeNewTopic").html(i18n["zohodiscussions.writePost.problemTypeMessage"]);}else{$("#writeNewTopic").html(i18n["zohodiscussions.writePost.announcementTypeMessage"]);}}}}$("#TopicContentHolder").attr("class",_349).attr("imgAttrClass",_34a);var _34b=$("#SelectForum").val();if(_34b==null){$("#selectForumMessage").show();}else{$("#selectForumMessage").hide();}}var createEditor=function(){try{editor=ZE.create({id:"editorHolder",content:$("#postContentTA").val()});}catch(ex){setTimeout("createEditor()",300);}};function initWritePost(){newOpenEditor($("#editorLocation"),"responseContent","postContentTA");loadCategories();$("#writepostTabsCont li[purpose=\"topicTypeTab\"]").click(function(){selectTopicType($(this));});$("#SelectForum").change(function(){loadCategories();});$("#publishTopic").click(function(){addForumPost(false);});$("#previewTopic").click(function(){var _34c=$(this);var _34d=_34c.attr("isDraft");var _34e=_34c.attr("userName");writePostPreview(_34e,"Preview","true",_34d);});$("#attachmentsListCont").find("div.imgAshDelete").click(function(_34f){$this=$(this);var _350=$this.attr("attachmentName");var _351=$this.attr("attachmentId");deleteUnpublishedAttachment(_350,_351,_34f);return;});$("#listOfMyDraftCont").click(function(){var _352=$(this).attr("draftsize");if(_352<1){return;}var _353=$(this);if(_353.is(".moreOptionsTop")){_353.removeClass("moreOptionsTop").addClass("moreOptionsTopSelected");}else{_353.removeClass("moreOptionsTopSelected").addClass("moreOptionsTop");}_353.hover(function(){var _354=_353.data("destroyHandle");if(_354){clearTimeout(_354);}},function(){var _355=setTimeout(function(){_353.removeClass("moreOptionsTopSelected").addClass("moreOptionsTop");},500);_353.data("destroyHandle",_355);});});$("#saveDraft").click(function(){addForumPost(true);});$("#cancelAddTopic").click(function(){$("#mainContent div.mainFullWrite").html("");processHash("Home");});loadUploadAttachmentsCont();}function closeGDocsAttachTemplate(_356){if(_356=="zdocs"){$("#zDocsTemplate").hide();}else{$("#gDocsTemplate").hide();}hideLoadingImage();}function loadUploadAttachmentsCont(docs,_358){var _359=($("#attachTemplate").length==1)?true:false;var _35a=(_359==true)?"attachTemplate":"responseAttachTemplate";var _35b=$("#attachmentsListCont");var _35c=_35b.find("div.singleElementBox,li.tinyText").length;if(_359==true){$("#newPostRightCont  div[purpose=\"attachmentTemplate\"]").remove();}else{$("#attachBrowseCont").html("");}if(_35c<maxAttachmentsPerPost){var _35d=maxAttachmentsPerPost-_35c;var _35e=_35c+1;var _35f=$("#"+_35a);var _360=_35f.clone();if(_359==true){_360.insertBefore(_35b).show();}else{$("#attachBrowseCont").append(_360.show()).show();}_360.attr("id",_35a+"_"+_35e);_360.attr("purpose","attachmentTemplate");_360.find("div.dataEncloser").wrap("<form action = \"/uploadFile.do\" target = \"fileUpdTgt\" method=\"post\" enctype=\"multipart/form-data\"></form>");_360.find("div.iFrameContainer").html("<iframe name = \"fileUpdTgt_"+_35e+"\"> </iframe>");_360.find("form").attr("target","fileUpdTgt_"+_35e);var _361=_360.find("form > div.dataEncloser");var _362=_361.find("a#zDocsAttachments");_362.click(function(){var _363=$("#zDocsTemplate");var _364=scheme+"://"+ZDOCS_URL+"/index.do?service=discussions&share=true";_363.html("<iframe height=\"500px;\" width=\"600px;\" style=\"margin-top:5%; margin-left:25%;\" src=\""+_364+"\"></iframe>");_363.show();});var _365=_361.find("a#gDocsAttachments");_365.click(function(){var _366=$("#gDocsTemplate");var _367=scheme+"://"+GADGET_URL+"/gdocs?serURL="+serverURL+"/jsp/AddGDocs.jsp&maxDocs="+_35d+"&id=1";_366.html("<iframe height=\"600px;\" width=\"800px;\" style=\"margin-top:5%; margin-left:17%\" src=\""+_367+"\"></iframe>");_366.show();});if(typeof docs=="undefined"){_360.find(":file").change(function(){_360.find("[purpose=\"attachLoadingCont\"]").show();_360.find(":input[name=\"attacher\"]").val("");_360.find("form").get(0).submit();});}else{showLoadingImage(i18n["zohodiscussions.settings.creating"]);var _368=docs.split(":");var _369="attachZDocs";if(_358=="gdocs"){_369="attachGDocs";}$.each(_368,function(_36a,item){_360.find("form div.dataEncloser").append("<input name=\""+_369+"\"  type=\"hidden\" value=\""+item+"\">");});_360.find("form").get(0).submit();}}}function uploadGDocsFileSuccess(_36c,_36d,_36e){var _36f=_36c.length;var _370=0;var _371="";var _372="";for(var i=0;i<_36f;i++){var _374=_36c[i];var _375=_374.result;var _376=_374.actualFileName;if(_375=="success"){var _377=_374.actualAttachId;var _378=_374.attachmentSize;var _379=_374.attachmentId;uploadFileSuccess(_379,_376,_36d,_377,_378);}else{_370=1;var _37a=_374.reason;_371=_371+_372+"<b>"+_376+"</b> : "+i18n[_37a];_372="<br><br>";}}if(_370==1){showMessage(i18n["zohodiscussions.popupContainers.failedattachmentMess"]+"<br>"+_371,"failure",5000);}closeGDocsAttachTemplate(_36e);}function uploadFileSuccess(_37b,_37c,_37d,_37e,_37f){var _380=$("#attachmentsListCont");var _381=($("#attachTemplate").length==1)?true:false;var _382;var _383=_37b+","+_37c+","+_37f;if(_381==true){_382=$("<div id=\"newAttachment_"+_37b+"\" class=\"singleElementBox\" attachmentDetails=\""+_383+"\"><div class=\"flLeft\">"+_37c+"</div><div class=\"flRight imgAshDelete bgBox\"></div></div>");var _384=$("#previewAttachment");$("#newAttachment_"+_37b).attr("attachmentDetails",_383);$("#AttachmentPreviewCont").show();}else{_382=$("#responseEachAttachmentTemplate").clone();_382.attr("id","newAttachment_"+_37b).attr("attachmentDetails",_383).show();_382.find("[attachmentPurpose=\"attachmentName\"]").html(_37c);_382.find("[attachmentPurpose=\"attachmentSize\"]").html(_37f);}$("#previewResponse").append("<input type = \"hidden\" name=\"attachmentId\" value = \""+_37b+"\"  attachmentDetails= \""+_383+"\">");if(_37e!=-1){_382.append("<input type = \"hidden\" name=\"attachmentId\" value = \""+_37e+"\">");}_382.find("div.imgAshDelete").click(function(_385){deleteUnpublishedAttachment(_37c,_37b,_385);});_380.append(_382);loadUploadAttachmentsCont();}function deleteUnpublishedAttachment(_386,_387,_388){if(confirm(i18n["zohodiscussions.generalmessage.deleteAttachmentConfirmMsg"])){showSmallLoadingImage(_388);var _389={};_389.forumGroupId=forumGroupId;_389.fileName=_386;_389.fileId=_387;_389[csrfParamName]=csrfToken;doAjaxAction("/deleteUnpublishedAttachment.do",_389,function(data){hideLoadingImage();if(data=="SUCCESS"){$("#newAttachment_"+_387).remove();if($("#previewAttachment").find("li.singleList").length==1){$("#AttachmentPreviewCont").hide();}$("#previewResponse").find("input[value= \""+_387+"\"]").remove();showTipper(i18n["zohodiscussions.general.Deleted"],"info");loadUploadAttachmentsCont();}});}}function loadCategories(){loadAdminActionsLinks();var _38b=$("#SelectForum");var _38c=_38b.val();var _38d=_38b.attr("selectedCategoryName");var _38e=_38b.attr("selectedCategoryId");var _38f=$("#categoryList").val();$("#SelectCategory").hide();$("#selectCategory").html("");if(typeof _38f!="undefined"){$.each(_38f.split("$$"),function(_390,item){if(item.indexOf(_38c+":")>-1){$("#SelectCategory").html(item.split(":")[1]).show();return false;}else{$("#SelectCategory").html("<option selected value=\"-1\">Uncategorised</option>").show();}});}var _392=$("#SelectCategory").find("option[value=\""+_38e+"\"]");if(_392.length==1){_392.attr("selected","true");}else{$("#SelectCategory option:first").attr("selected","true");}}function loadAdminActionsLinks(){var _393=$("#SelectForum option:selected").attr("isForumModerator");if(_393=="true"){$("#isStickyLinkCont,#announcementLinkCont").fadeIn();}else{$("#isStickyLinkCont,#announcementLinkCont").fadeOut();if($("#writepostTabsCont li.selected").attr("topicIconClass")=="announcement"){$("#writepostTabsCont li:first").trigger("click");}}}function addForumPost(_394){if($("#fileUploadStatus").val()!="uploading"){var _395=(_394==true)?i18n["zohodiscussions.general.saving"]:i18n["zohodiscussions.general.publishing"];disablePostButtons();var _396=$("#addForumPostForm");$topicTitle=$("#topicTitle");var _397=$topicTitle.val();_397=_397.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");_397=$.trim(_397);if(_397==""){hideLoadingImage();setFocusToContainer($("#topicTitle"));enablePostButtons();showMessage(i18n["zohodiscussions.writePost.TopicTitleCannotbeEmptymessage"],"failure");$("#topicTitle").focus();return;}$("#topicTitle").val(_397);if(_397.length>200){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.TopicTitleLengthMsg"],"failure");enablePostButtons();return;}var _398=$("#forumTags").val();_398=_398.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");if(_398!=""){if(_398.match(/^[^()~`!@#$%&:;\/?|<>{}[\]*-+=]+$/)==null){hideLoadingImage();showMessage(i18n["zohodiscussions.singlepost.specialCharacterNotAllowedMsg"],"failure");enablePostButtons();return;}}var tag=_398.split(",");for(var i=0;i<tag.length;i++){if(tag[i].length>50){showTipper(i18n["zohodiscussions.singlepost.TagexceedMessage"],"failure");enablePostButtons();return;}}var _39b=editor.getContent();_39b=_39b.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");$("#postContentTA").val(_39b);var _39c=$("<div></div>").html(_39b);_39b=_39c.text();_39b=$.trim(_39b);if(_39b==""){setFocusToContainer(($("#editorHolder")).focus());hideLoadingImage();enablePostButtons();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");return;}if(_394==true){$("#topicStatus").val(1);}else{$("#topicStatus").val(0);}var _39d=$("#SelectForum").val();var _39e=$("#SelectCategory").val();if(_39d==null){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.selectAnyForum"],"failure");enablePostButtons();return;}if(_39e=="0"){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.selectAnyCategory"],"failure");enablePostButtons();return;}var _39f="/addForumPost.do";if(ZUID==-1){_39f="/addGuestForumPost.do";}showLoadingImage(_395);doAjaxAction(_39f,$("#addForumPostForm").serialize(),function(data){hideLoadingImage();var _3a1=eval(data);if(_3a1.result=="success"){var _3a2=_3a1.value;if(_394==true){showTipper(i18n["zohodiscussions.writePost.saveDraftMsg"],"success",3000);enablePostButtons();$("#forumTopicId").val(_3a2);}else{if(_3a1.isApproved==0){$("#mainContent div.mainFullWrite").html("");showMessage(i18n["zohodiscussions.writePost.topicAwaitingModeration"],"info");if(isTopicQuickView=="false"){window.location.href=serverURL+"/topic/"+_3a1.topicPermaLink;}else{showLoadingImage();openSinglePost(_3a2);}return;}else{$("#mainContent div.mainFullWrite").html("");showTipper(i18n["zohodiscussions.writePost.publishMsg"],"success",4000);if(isTopicQuickView=="false"){window.location.href=serverURL+"/topic/"+_3a1.topicPermaLink;}else{showLoadingImage();openSinglePost(_3a1.value);}}}}else{showMessage(_3a1.reason,"failure");enablePostButtons();}},function(_3a3){hideLoadingImage();if(_3a3.responseText.indexOf("'result':'failure'")>0){var _3a4=eval(_3a3.responseText);if(_3a4.result=="failure"){if(_3a4.errorcode=="HIP_REQUIRED"){var _3a5=$("#writePostCaptcha");if(_3a5.attr("currCaptcha")=="new"){showMessage(i18n["zohodiscussions.writePost.captchaMsg"],"failure");}else{showMessage(i18n["zohodiscussions.writePost.captchaErrorMsg"],"failure");}_3a5.find("img[purpose=\"captchaImage\"]").replaceWith("<img purpose=captchaImage name=hipImg border=0 src=/showcaptcha?digest="+_3a4.reason+" align=absmiddle alt=HIP image>");$("#captchaCode").attr("name",_3a4.reason);_3a5.attr("currCaptcha","old");_3a5.show();}else{showMessage(_3a4.reason,"failure");}}}else{if(_3a3.responseText!=""){$("#writepostCont").get(0).innerHTML=_3a3.responseText;}}enablePostButtons();});}else{$("#submitStat").show();}}function singlePostDeleteAction(_3a6,_3a7){var _3a8=_3a6.attr("forumTopicId");_3a8=_3a8||_3a6.parents("li[parentCont=\"actualParent\"]").attr("forumTopicId");var _3a9=_3a6.attr("responseId");var _3aa=_3a6.attr("categoryId");_3aa=_3aa||_3a6.parents("li[parentCont=\"actualParent\"]").attr("categoryId");var _3ab=_3a6.parents("li[parentCont=\"actualParent\"]").attr("responseAuthorId");var _3ac=_3a6.attr("forumId");_3ac=_3ac||_3a6.parents("li[parentCont=\"actualParent\"]").attr("forumId");var _3ad=_3a6.attr("itemType");if(_3ad!="post"){if(confirm(i18n["zohodiscussions.singlePost.messagefordeletingResponse"])){var _3ae={};if(_3ab==ZUID){_3ae.responseowner="true";}_3ae.forumGroupId=forumGroupId;_3ae.forumTopicId=_3a8;_3ae.categoryId=_3aa;_3ae.forumId=_3ac;_3ae.responseId=_3a9;_3ae[csrfParamName]=csrfToken;doAjaxAction("/deleteForumResponse.do",_3ae,function(data){if((data)=="SUCCESS"){showTipper(i18n["zohodiscussions.generalmessage.responseMovedToTrash"],"info",2000);if(_3a7=="moderation"){var _3b0=$("#moderationTabCont").find("li.selected").attr("tabPurpose");refreshingPage(_3b0);}else{refreshSingleTopic(_3a8);}updateAwaitingApprovalCount();}});}}else{if(confirm(i18n["zohodiscussions.singlePost.messagefordeletingTopic"])){var _3b1={};if(_3ab==ZUID){_3b1.access="author";}_3b1.forumGroupId=forumGroupId;_3b1.forumTopicId=_3a8;_3b1.categoryId=_3aa;_3b1.forumId=_3ac;_3b1[csrfParamName]=csrfToken;doAjaxAction("/deleteTopic.do",_3b1,function(data){if((data)=="SUCCESS"){showTipper(i18n["zohodiscussions.generalmessage.topicMovedToTrash"],"info",2000);if(_3a7=="moderation"){var _3b3=$("#moderationTabCont").find("li.selected").attr("tabPurpose");refreshingPage(_3b3);}else{refreshSingleTopic(_3a8);}}});}}}function refreshSingleTopic(_3b4){var _3b5=$("#topicList");if(_3b5.length<1){_3b5=$("#topicsList");}var _3b6={};_3b6.forumTopicId=_3b4;_3b6.forumGroupId=forumGroupId;_3b6.singleTopicRefresh="singleTopicRefresh";var _3b7=$("#eachTopic_"+_3b4);doAjaxAction("/refreshSingleTopic.do",_3b6,function(data){hideLoadingImage();$data=$("<div></div>").html(data);if($data.find("li.singleList").length<1){_3b7.remove();return false;}var _3b9=$data.find("div.singleTopicCont").attr("modifiedtime");var _3ba=_3b5.find("div.singleTopicCont:last").attr("modifiedtime");var _3bb=_3b5.find("div.singleTopicCont:first");var _3bc=_3bb.attr("modifiedtime");var _3bd=false;if(_3b9<_3ba){_3b7.remove();}else{if(_3b9>_3bc){$data.insertBefore(_3bb);_3b7.remove();eval($data.find("script").html());_3bd=true;}else{$data.insertBefore(_3b7);_3b7.remove();eval($data.find("script").html());_3bd=true;}}if(_3bd==true){goToTop();}});}function disablePostButtons(){$("#publishTopic").attr("disabled",true);$("#saveDraft").attr("disabled",true);}function enablePostButtons(){$("#publishTopic").attr("disabled",false);$("#saveDraft").attr("disabled",false);}function getprevAndFirstPost(_3be){var _3bf=_3be.parents("li[parentCont=\"actualParent\"]").attr("forumTopicId");var _3c0={};_3c0.forumGroupId=forumGroupId;_3c0.forumTopicId=_3bf;var _3c1=_3be.attr("recentResponseId");if(typeof _3c1!="undefined"){_3c0.responseId=_3c1;_3c0.modifiedTime=_3be.attr("modifiedTime");_3c0.currResponseCount=_3be.attr("currResponseCount");}else{var _3c2=_3be.parents("div.listOfResponseLink");_3c0.responseId=_3c2.attr("responseId");_3c0.modifiedTime=_3c2.attr("modifiedTime");_3c0.currResponseCount=_3c2.attr("currResponseCount");}_3c0.toProvide="First";_3c0.currStage="1";doAjaxAction("/getResponse.do",_3c0,function(data){var _3c4=$(data);var _3c5=$("#recent_ResPonse_"+_3c1);if($("#lastResponse_"+_3bf).find("div.listOfResponseLink[prev=\"-1\"]").length<1){_3c4.insertAfter(_3c5);lightBox("#"+_3c4.get(0).id);_3c5.next("div.listOfResponseLink").attr("Prev","-1");}var _3c6=$("#navigationLoading_"+_3c1);if(_3c6.attr("currRequest")=="first"){_3c6.remove();_3c5.hide();$("#navCont_"+_3c1+",#navCont_1_"+_3c1).removeClass("navLoading");firstOrLastResponse($("#navCont_"+_3c1).find("li.ndtopicNavFirst"));}else{provideResponse(_3be);}return;});}function provideResponse(_3c7){var _3c8=_3c7.parents("li[parentCont=\"actualParent\"]").attr("forumTopicId");var _3c9=_3c7.attr("recentResponseId");var _3ca=_3c7.attr("toProvide");var _3cb={};_3cb.forumGroupId=forumGroupId;_3cb.forumTopicId=_3c8;_3cb.toProvide=_3ca;if(typeof _3c9!="undefined"){_3cb.modifiedTime=_3c7.attr("modifiedTime");_3cb.currResponseCount=_3c7.attr("currResponseCount");_3cb.currStage=_3c7.attr("currResponsestage");}else{var _3cc=_3c7.parents("div.listOfResponseLink");_3c9=_3cc.attr("responseId");_3cb.modifiedTime=_3cc.attr("modifiedTime");_3cb.currResponseCount=_3cc.attr("currResponseCount");_3cb.currStage=_3cc.attr("currResponsestage");}_3cb.responseId=_3c9;doAjaxAction("/getResponse.do",_3cb,function(data){var _3ce=$("#recent_ResPonse_"+_3c9);var _3cf=$("<div>"+data+"</div>");var _3d0=_3cf.find("div.listOfResponseLink").attr("responseId");var _3d1=$("#lastResponse_"+_3c8).find("div.listOfResponseLink[responseId = \""+_3d0+"\"]");if(_3d1.length>0){if(_3ca=="Prev"){_3ce.attr("Prev",_3d0);_3d1.attr("Next",_3c9);}else{if(_3ca=="Next"){_3ce.attr("Next",_3d0);_3d1.attr("Prev",_3c9);}}}else{var _3d2=$(_3cf.html());if(_3ca=="Prev"){_3d2.insertAfter(_3ce);lightBox("#"+_3d2.get(0).id);var _3d3=_3ce.next("div.listOfResponseLink");_3d3.attr("Next",_3c9);_3ce.attr("Prev",_3d0);}else{if(_3ca=="Next"){_3d2.insertBefore(_3ce);var _3d3=_3ce.prev("div.listOfResponseLink");_3d3.attr("Prev",_3c9);_3ce.attr("Next",_3d0);}}}var _3d4=$("#navigationLoading_"+_3c9);if(_3d4.attr("currRequest")=="Prev"){_3d4.remove();_3ce.hide();checkPrevNextResponse($("#navCont_"+_3c9).find("li.ndtopicNavPrev"));$("#navCont_"+_3c9+",#navCont_1_"+_3c9).removeClass("navLoading");}else{if(_3d4.attr("currRequest")=="Next"){_3d4.remove();_3ce.hide();checkPrevNextResponse($("#navCont_"+_3c9).find("li.ndtopicNavNext"));$("#navCont_"+_3c9+",#navCont_1_"+_3c9).removeClass("navLoading");}}});}function checkPrevNextResponse(_3d5){var _3d6=_3d5.parents("div.listOfResponseLink");var _3d7=_3d6.attr("responseId");var _3d8=_3d5.attr("toProvide");var _3d9=_3d6.attr(_3d8);if(_3d9=="0"){var _3da=$("#navigationLoading").clone();_3da.attr("id","navigationLoading_"+_3d7).attr("currRequest",_3d8);var _3db=$("#navCont_"+_3d7);_3da.insertAfter(_3db).show();$("#navCont_"+_3d7+",#navCont_1_"+_3d7).addClass("navLoading");provideResponse(_3d5);return;}else{var _3dc=$("#recent_ResPonse_"+_3d9);_3d6.hide();_3dc.show();setFocusToContainer(_3dc.parents(".ndquickList"),false,0);if($("#navCont_"+_3d9).is(".navLoading")){$("#navCont_"+_3d7+",#navCont_1_"+_3d7).removeClass("navLoading");}if(_3dc.attr(_3d8)=="0"){var _3dd=$("#navCont_"+_3d9).find("li[toProvide=\""+_3d8+"\"]");provideResponse(_3dd);}else{return;}}}function firstOrLastResponse(_3de){var _3df=_3de.parents("div.listOfResponseLink");var _3e0=_3de.attr("toProvide");var _3e1=_3df.attr("responseId");var _3e2=_3de.parents("li[parentCont=\"actualParent\"]").attr("forumTopicId");var _3e3=$("#lastResponse_"+_3e2);var _3e4=$("#recent_ResPonse_"+_3e1);if(_3e0=="First"){var _3e5=_3e3.find("div.listOfResponseLink[Prev=\"-1\"]");if(_3e5.length==0){var _3e6=$("#navigationLoading").clone();_3e6.attr("id","navigationLoading_"+_3e1).attr("currRequest","first");var _3e7=$("#navCont_"+_3e1);_3e6.insertAfter(_3e7).show();$("#navCont_"+_3e1+", #navCont_1_"+_3e1).addClass("navLoading");getprevAndFirstPost(_3de);return;}_3e4.hide();_3e5.show();setFocusToContainer($("#eachTopic_"+_3e2),false,0);if($("#navCont_"+_3e1).is(".navLoading")){$("#navCont_"+_3e1+",#navCont_1_"+_3e1).removeClass("navLoading");}var _3e8=_3e5.attr("responseId");if(_3e5.attr("Next")=="0"){var _3e9=$("#navCont_"+_3e8).find("li[toProvide=\"Next\"]");provideResponse(_3e9);}}else{if(_3e0=="Last"){_3e4.hide();_3e3.find("div.listOfResponseLink[Next=\"-1\"]").show();setFocusToContainer($("#eachTopic_"+_3e2),false,0);}}}function lightBox(_3ea){$(_3ea).find("a.lightbox").lightbox({"navbarOnTop":true,"resizeSpeed":150,"overlayOpacity":0.1});$(window.document).keydown(function(e){if(e.keyCode==27){if($("#lightbox").is(":visible")){$("#lightbox").hide();$("#overlay").hide();}return false;}});}function saveButtonClick(id){var _3ed=$("#"+id);var _3ee={};_3ee.forumGroupId=forumGroupId;_3ee.referrer=_3ed.attr("referrer");_3ee.customFieldValue=_3ed.prev().val();$.ajax({url:"/joinPortal.do",type:"POST",data:_3ee,error:function(err,desc,_3f1){showTipper(err.responseText);},success:function(data){if("success"==data){showTipper(i18n["zohodiscussions.widgetscontainer.subscribedSuccessfully"],"success",1000);$("#waitingforApproval,#portalWaitingforApproval").show();$("#joinPortalContent,#portaljoinContent").hide();}else{if("open"==data){window.location.reload();}else{if("customSignUp"==data){location.href=action;}}}}});}function bindSubscribeAction(){$("#joinThisPortal,#portalJoin").unbind("click").click(function(){var _3f3={};_3f3.forumGroupId=forumGroupId;_3f3.referrer="ajax";var _3f4=$(this).attr("isCustomFieldStatus");var _3f5="";if(_3f4=="1"){$("#customFieldDiv,#customFieldWidgetDiv").show();$("#portalJoin,#joinThisPortal").hide();}else{$.ajax({url:"/joinPortal.do",type:"POST",data:_3f3,error:function(err,desc,_3f8){showTipper(err.responseText,"failure",1000);},success:function(data){if("success"==data){showTipper(i18n["zohodiscussions.widgetscontainer.subscribedSuccessfully"],"success",1000);$("#waitingforApproval,#portalWaitingforApproval").show();$("#joinPortalContent,#portaljoinContent").hide();}else{if("open"==data){window.location.reload();}else{showTipper(i18n["zohodiscussions.widgetscontainer.failure"],"failure",1000);}}}});}});$("#joinButtonClick,#portalJoinButtonClick").click(function(){$("#signInorSignUp,#portalsignInorSignUp").toggle();$("#participateButtonClick,#portalparticipateButtonClick").toggle();});$("#signInClick,#participateButtonClick").click(function(){if("portalBut"==this.className){$("#portalSignUpClick").attr("action",$(this).attr("action"));}$("#iamLoginBox").show();$("#joinPortalWidget,#portaljoinContent").hide();var _3fa=$(this).attr("src");$("#iamLoginBox iframe,#portaliamLoginBox iframe").attr("src",_3fa);});$("#signUpClick,#portalSignUpClick,#portalSignUpClickPopup").click(function(){var _3fb=$(this).attr("action");location.href=_3fb;});}function showall(cont,_3fd){var mode=$("#showAll").attr("currentmode");if(mode=="show"){$("#"+cont).removeAttr("style");$("#showAll").text(i18n["zohodiscussions.general.less"]);$("#showAll").attr("currentmode","hide");}else{if(_3fd=="isCatg"){$("#"+cont).attr("style","min-height:40px;max-height:170px;overflow:hidden;");}else{$("#"+cont).attr("style","min-height:40px;max-height:230px;overflow:hidden;");}$("#showAll").text(i18n["zohodiscussions.general.more"]);$("#showAll").attr("currentmode","show");}return false;}$(window.document).click(function(_3ff){var _400=$("#switchToProductOptions,#changePortalOptions");var _401=$("#statusList,#typeFilterOptions");var _402=$(_3ff.target);var _403=_402.parent();if(_402.is("[purpose=\"linkForDropDown\"]")||_403.is("[purpose=\"linkForDropDown\"]")||_402.is("#statusInfo")||_403.is("#statusContainer")||_402.is("#statusContainer")){var _404=_402.attr("dropDownLinkPurpose");_404=_404||_403.attr("dropDownLinkPurpose");_401.each(function(_405,item){var _407=$(item);if(typeof _404=="undefined"&&_407.is("#statusList")){if(($("#statusInfo").find("div.statuschanges")).length>0||($("#statusContainer").find("b.imgdownArrow"))){if($("#statusList").is(":visible")){_407.hide();}else{_407.show();}}}else{if(_407.is("div[dropDownPurpose!=\""+_404+"\"]:visible")){_407.hide();_407.parent(".newComboSelected").addClass("newCombo").removeClass("newComboSelected");}}});return false;}else{_401.hide();_401.parent(".newComboSelected").addClass("newCombo").removeClass("newComboSelected");}});$(window.document).keypress(function(e){var _409=$("#statusList,#typeFilterOptions,#privateConversation");var _40a=$("#portalComboCont");if(e.keyCode==27){$("#messageContainer").hide();$("#authorPopout:visible").hide();$("#PopupContainer div.dimDiv:visible button:visible[purpose=\"closePopout\"]").trigger("click");if($("#PopupContainer div.dimDiv:visible div:visible[purpose=\"imgCancel\"]")){$("#imgCancel").trigger("click");}if(_409.is(":visible")){_409.hide();}if(_40a.is(".newComboSelected")){_40a.addClass("newCombo").removeClass("newComboSelected");}if($("#privateMsgPrompt").is(":visible")){$("#privateMsgPrompt").parent().hide();}if($("#inappropriateReason").is(":visible")){$("#inappropriateReason").hide();}return false;}});function initTopicsPageActions(){lightBox("#chartWidget");lightBox("#topicList");bindTopicClicks($("#topicList"));bindTopicClicks($("#topicsList"));bindTopicListHeaderClicks($("#topicListHeader"));bindWidgetsContClick($("#topicListWidgetsCont"));if(isMac=="false"){setToHotkeys();}}function newTopicCall(){initLoginFrame($("#NewTopicTab"));}function initLoginFrame(_40b){var _40c=$("#loginFrame");hideLoadingImage();var _40d=_40b.attr("iamURL");if(_40c.size()>0){_40c.show().find("div.iFrameContainer").show().html("<iframe scrolling=\"no\" frameborder=\"0\" height=\"192px\" src=\""+_40d+"\"></iframe>");$("#iamLoginBox").hide();}var _40e=$("#listof_FC_Counts");$("#countOfForum").html(_40e.attr("forumCount"));$("#countOfCategory").html(_40e.attr("categoryCount"));$("#countOfPosts").html(_40e.attr("postCount"));$("#countOfResponses").html(_40e.attr("responseCount"));return false;}function loginBoxClose(){$("#iamLoginBox").show();if($("#joinPortalWidget").size()>0){$("#joinPortalWidget").show();$("#iamLoginBox").hide();}$("#loginFrame").hide();initTopicsPageActions();}function signInViaGoogle(){$("#tploginforms").find("form[name=\"googleform\"]").submit();return false;}function signInViaYahoo(){$("#tploginforms").find("form[name=\"yahooform\"]").submit();return false;}function signInViaFacebook(){$("#tploginforms").find("form[name=\"fbform\"]").submit();return false;}function signInViaGoogleApps(){$("#tploginforms").find("form[name=\"gappsform\"]").submit();return false;}function openSinglePost(_40f,_410,_411){_410=_410||"Topic";if(_411!=undefined){loadSinglePost(_40f,"true",undefined,_411);}else{loadSinglePost(_40f);}$.history.add(_410+"/"+_40f);}function loadSinglePost(_412,_413,_414,_415){var _416={};_416.forumTopicId=_412;_416.forumGroupId=forumGroupId;if(typeof _413=="undefined"){_413=true;}doAjaxAction("/getSinglePost.do",_416,function(data){hideLoadingImage();if($("#topicListMainContainer").length>0||$("#userProfileMainContainer").length>0||$("#myAreaParentContainer").length>0){$("#topicListMainContainer").hide().attr("shouldReload","false");$("#userProfileMainContainer").hide().attr("shouldReload","false");$("#myAreaParentContainer").hide().attr("shouldReload","false");if($("#singlePostMainContainer").length>0){$("#mainContent").get(0).innerHTML=data;$(window).scrollTop(0);}else{var _418=document.createElement("div");_418.innerHTML=data;$("#mainContent").get(0).appendChild(_418);}}else{$("#mainContent").get(0).innerHTML=data;}if(_413&&_413==true){$(window).scrollTop(0);}else{if(_413&&_413=="showWatchOption"){$("#followTopic_"+_415).show();}}if(typeof _414!="undefined"){var _419=$(_414).offset().top;$("html,body").scrollTop(_419-100);}initSinglePost(_412);var _41a=$("#topicContainer_"+_412);var _41b=_41a.attr("forumId");var _41c=_41a.attr("categoryId");if(typeof _41b=="undefined"){_41b=-1;}if(typeof _41c=="undefined"){_41c=-1;}var _41d="NewTopic/"+_41b+"/"+_41c;$("#NewTopicTab").attr("hashPurpose",_41d);if(typeof WmsContacts!="undefined"&&ch=="true"){var _41e=WmsContacts.getZohoContacts();setPresenceInTopicList(_41e,_412);}if(_415!=undefined&&typeof _414=="undefined"){setFocusToContainer($("#fullResponseContainer_"+_415),false,100,0);$("#SinglePostContainer").data("currentFocusResponse",$("#"+_415));}if(isMac=="false"){setHotkeysToSinglePost();}},function(_41f){hideLoadingImage();var _420=(_41f.responseText);$("#mainContent").get(0).innerHTML=_420;});}function initSinglePost(_421){showAuthorPopout($("#SinglePostContainer"));var _422=$("#DocumentTitle");document.title=(_422.length>0)?_422.text()+" - "+forumGroupName:forumGroupName;bindSingleTopicClicks($("#SinglePostContainer"));lightBox("#SinglePostContainer");var _423=$("#topicContainer_"+_421);$("#SinglePostContainer").unbind("click",singlePostWidgetActions).click(singlePostWidgetActions);singlePostTagActions(_421);$("#mainContent").attr("process-pre-tags",_421);setTimeout(function(){processCodeTags($("#SinglePostContainer"),_421);},5);return false;}function showCode(_424){var _425=_424.parentNode.nextSibling.innerHTML;_425=_425.replace(/<\/li>/ig,"\n").replace(/<[^>]*>/ig,"").replace(/&nbsp;/ig," ").replace(/&lt;/ig,"<").replace(/&gt;/ig,">").replace(/&amp;/ig,"&");$("#CopyCodeCont").show().parent().show();$("#copycode_text").val(_425).select();}var codeForPreview="<div class=\"__zd_findAndReplaceParent\" style=\"height:11px\"></div><div class = \"__zd_findAndReplace\" style=\"text-align:right;float:right;background-color:#efefef;margin-right:30px;padding:0px 3px;\"><span onclick = \"javascript:showCode(this);return false;\" style=\"font:normal 10px trebuchet ms,arial;text-decoration:underline;color:blue;cursor:pointer\">Copy code</span></div>";function processCodeTags(_426,_427){if(!_427||!_426||_426.length<1){return;}var _428=$("#mainContent");var _429=_428.attr("process-pre-tags");if(_429!=_427){return;}var _42a=_426.find("ol.code");_42a.before(codeForPreview);}function bindSingleTopicClicks(_42b){_42b.unbind("click",processSingleTopicClicks).click(processSingleTopicClicks);var _42c=$("#SinglePostContainer").attr("forumTopicId");var _42d=$("#replyToTopicBtn_"+_42c);var _42e=_42d.attr("replyContainer");var _42f=_42d.attr("canUserReplyThis");if(_42f=="true"&&_42e=="true"){$("#replyToTopicBtn_"+_42c).find("div.imgReply").trigger("click");}}function processSingleTopicClicks(_430){var _431=$(_430.target);var _432=_431.parent();var _433="singlePost";var _434=$("#SinglePostContainer").attr("forumTopicId");var _435=$("#topicContainer_"+_434);var _436=$("#statusList");if($("#loadingImg").is(":visible")){return;}if(_431.is("a[purpose=\"authorProfile\"]")){var _437=_431.attr("authorName");var _438=_431.attr("singleClickflag");if(_438=="0"){var _439=(_437==ZU_Name)?"MyArea":"User/"+_437;processHash(_439);}return;}else{if(_431.is("#replyToTopicBtn_"+_434+",#replyToTopicBtnSec_"+_434)||(_432.is("#privateResponseThisTopic_"+_434))){var _43a=_431.attr("postauthor");var _43b=$("#paginationContainer");var _43c=_431.attr("canUserReplyThis");var _43d=_431.attr("replyContainer");if(_43c!="undefined"&&_43c=="false"){initLoginFrame(_431,_43d);return;}if($("#topicListMainContainer").length>0&&$("#singlePostMainContainer").length>0&&_43b.data("inEditMode")){removeTopicListCache();}if($("#responsePreviewContainer").is(":visible")){$("#responsePreviewContainer").find("button[purpose=\"backToEditorResponse\"]").trigger("click");showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");var _43e=_435.data("editorContLocation");setFocusToContainer($(_43e),false);return;}var _43f="replyToTopicBtn";var _440="false";if(_432.is("[purpose=\"privateResponse\"]")){_43f="privateResponseThisTopic";_440="true";}var _441="#newResponseCont_"+_434;if(_435.data("inEditMode")){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"]);$("#responsePreviewButton").find("button[purpose=\"backToEditorResponse\"]").trigger("click");var _43e=_435.data("editorContLocation");setFocusToContainer($(_43e),false);return false;}$(_441).show();newOpenEditor($("#newResponse_"+_434),"responseContent","postContentTA",_43f+"_"+_434,"Write","topicContainer_"+_434,_440);resizeZDIFRAME();setFocusToContainer($(_441),false);_435.data("inEditMode",true);_435.data("editorContLocation",_441);$("#previewResponse").attr("forumTopicId",_434);if($(this).is("[purpose=\"privateResponse\"]")){$("#newResponseCont_"+_434).find("div.header").html(i18n["zohodiscussions.singlePost.editorHeaderPrivateResponseTo"]+" "+_43a+"");}return false;}else{if(_431.is("#TopicListLink,#ForumTopicListLink,#CategoryTopicListLink")){_442=_431;hashPurpose=_442.attr("hashPurpose");$("#topicListMainContainer").attr("shouldReload","true");processHash(hashPurpose);return false;}else{if(_431.is("#topicVoteLink")||_432.is("#topicVoteLink")){var _442=(_431.is("#topicVoteLink"))?_431:_432;var _443=_442.attr("firstResponseId");if(ZUID==-1){showTipper(i18n["zohodiscussions.singlepost.logintovotetopic"],"failure");return;}var _444=_442.attr("isThisUserVoted");if(_444=="true"){showTipper(i18n["zohodiscussions.singlepost.alreadyVotedTopic"],"failure");return;}doAjaxAction("/voteTopic.do?forumGroupId="+forumGroupId+"&forumTopicId="+_434+"&responseId="+_443,csrfOptions,function(data){if(data=="SUCCESS"){removeTopicListCache();loadSinglePost(_434,"showWatchOption","#postTypeActions_"+_443,_443);hideLoadingImage();}else{hideLoadingImage();}});}else{if(_431.is("input[followItem]")){var _446=_431.attr("followItem");if(_446=="true"){watchThisItem(_431,"singlePost",_430);}}else{if(_432.is("#topicPermalink")){var _447=_432.attr("thisTopicPermalink");$("#PermalinkCont textarea").val(_447);$("#permalink_Text").select();$("#PermalinkCont").show().parent().show();return;}else{if(_432.is("#linkToTopic")){linkToTopic();}else{if(_431.is("#deleteLinkedTopic")){deletelinkedTopic(_431);}else{if(_431.is("a[purpose=\"linkedTopicTitle\"]")){if(isTopicQuickView=="false"){}else{var _434=_431.attr("forumTopicId");processHash("Topic/"+_434);return false;}}else{if(_431.is("input[purpose=\"watchAction\"]")){var _448=$("#editorHolder").find("input[name=\"isFollowTopic\"]");if(_431.attr("checked")==true){_448.attr("value","true");}else{_448.attr("value","false");}return;}else{if(_432.is("#emailThisTopic")){openEmailTopicDialog(_432);return false;}else{if(_432.is("li[actionPurpose=\"reportSpam\"],div[actionPurpose=\"reportSpam\"]")||_431.is("a[actionPurpose=\"reportSpam\"]")){var _449=(_431.is("a[actionPurpose=\"reportSpam\"]"))?_431:_432;singlePostSpamAction(_449,_433);return;}else{if(_432.is("div[buttonPurpose=\"approve\"]")||_432.is("li[buttonPurpose=\"approve\"]")||_431.is("a[buttonPurpose=\"approve\"]")){var _449=(_431.is("a[buttonPurpose=\"approve\"]"))?_431:_432;singlePostApproveAction(_449,"singlePostApprove");return;}else{if(_431.is("div[purpose=\"inappropriateReason\"]")||_431.is("span[purpose=\"inappropriateReason\"]")){getReasonForInapppropriate(_431);}else{if(_432.is("span[deletepurpose=\"deleteAttachment\"]")){deletePublishedAttachment(_432,_430);return;}else{if(_431.is("li[purpose=\"topicLabel\"]")){changeTopicLabel(_431);}else{var _44a=_435.attr("topicAuthorId");var _44b=_435.attr("forumId");var _44c=_435.attr("categoryId");var _44d=$("#singlePostUtilCont");var _44e=_44d.attr("newThreadReplyLinks");if(_431.is(_44e)){var _442=_431;var _434=_442.attr("forumTopicId");var _44f=_442.attr("responseId");var _450=_442.attr("isPrivate");var _451="#newThreadResponseCont_"+_44f;var _43b=$("#paginationContainer");if($("#topicListMainContainer").length>0&&$("#singlePostMainContainer").length>0&&_43b.data("inEditMode")){removeTopicListCache();}if($("#responsePreviewContainer").is(":visible")){$("#responsePreviewContainer").find("button[purpose=\"backToEditorResponse\"]").trigger("click");showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");var _43e=_435.data("editorContLocation");setFocusToContainer($(_43e),false);return;}if(_435.data("inEditMode")){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");$("#responsePreviewButton").find("button[purpose=\"backToEditorResponse\"]").trigger("click");var _43e=_435.data("editorContLocation");setFocusToContainer($(_43e),false);return false;}$(_451).show();newOpenEditor($("#newThreadResponse_"+_44f),"responseContent","postContentTA","newThreadReply_"+_44f,"Write","topicContainer_"+_434,_450);resizeZDIFRAME();setFocusToContainer($(_451),false);_435.data("inEditMode",true);_435.data("editorContLocation",_451);$("#previewResponse").attr("forumTopicId",_434);$("#previewResponse").attr("responseId",_44f);return false;}var _452=_44d.attr("responseVoteLinks");if(_431.is(_452)){var _442=_431;var _44f=_442.attr("responseId");var _453=_442.attr("votePurpose");if(_453=="removeVote"){showTipper(i18n["zohodiscussions.singlepost.alreadyVotedResponse"],"failure");return;}var _454=(_453=="removeVote")?"/removeResponseVote.do":"/voteResponse.do";doAjaxAction(_454+"?forumGroupId="+forumGroupId+"&responseId="+_44f+"&forumTopicId="+_434,csrfOptions,function(data){if(data=="SUCCESS"){removeTopicListCache();loadSinglePost(_434,false);}else{hideLoadingImage();}});return;}var _456=_44d.attr("chooseBestResponseLinks");if(_431.is(_456)){var _442=_431;var _44f=_442.attr("responseId");var _457={};_457.forumGroupId=forumGroupId;_457.responseId=_44f;_457.forumTopicId=_434;if(_44a==ZUID){_457.topicowner="true";}_457[csrfParamName]=csrfToken;doAjaxAction("/bestResponse.do",_457,function(data){if(data=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlepost.bestResponseSuccessMsg"],"success");loadSinglePost(_434,false,"#fullResponseContainer_"+_44f);_457={};_457.forumGroupId=forumGroupId;_457.forumTopicId=_434;doAjaxAction("/notifyForBestResponse.do",_457,function(){});}else{hideLoadingImage();showMessage(i18n["zohodiscussions.generalmessage.noPermission"]);}});return;}var _459=_44d.attr("responseEditLinks");if(_431.is(_459)){var _45a=_431.attr("id");var _442=_431;var _44f=_442.attr("responseId");var _450=_442.attr("isPrivate");var _45b="#fullResponseContainer_"+_44f;var _43b=$("#paginationContainer");if($("#topicListMainContainer").length>0&&$("#singlePostMainContainer").length>0&&_43b.data("inEditMode")){removeTopicListCache();}if($("#responsePreviewContainer").is(":visible")){$("#responsePreviewContainer").find("button[purpose=\"backToEditorResponse\"]").trigger("click");showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");var _43e=_435.data("editorContLocation");setFocusToContainer($(_43e),false);return;}if(_435.data("inEditMode")){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");var _43e=_435.data("editorContLocation");$("#responsePreviewButton").find("button[purpose=\"backToEditorResponse\"]").trigger("click");setFocusToContainer($(_43e),false);return false;}$(_45b).show();if(_45a=="editTopic"){$("#linkTopicCont_"+_434).hide();$("#statusContainer").hide();}newOpenEditor($("#responseContentContainer_"+_44f),"responseContent","postContentTA",_45a,"Edit","topicContainer_"+_434,_450);setFocusToContainer($(_45b),false);_435.data("inEditMode",true);_435.data("editorContLocation",_45b);$("#previewResponse").attr("responseId",_44f);if($(_45b).attr("class")=="postContent"||_45a=="editTopic"){$("#previewResponse").attr("location","editTopic");}else{$("#previewResponse").attr("location","editResponse");}$("#previewResponse").attr("forumTopicId",_434);resizeZDIFRAME();return false;}if(_431.is("#removeBestResponse")){var _457={};_457.forumGroupId=forumGroupId;_457.forumTopicId=_434;if(_44a==ZUID){_457.topicowner="true";}_457[csrfParamName]=csrfToken;doAjaxAction("/removeBestResponse.do",_457,function(data){if(data=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlePost.removeBestResponseMsg"],"info");loadSinglePost(_434);}else{hideLoadingImage();showMessage(i18n["zohodiscussions.generalmessage.noPermission"]);}});return;}if(_431.is("#deleteTopic")){if(confirm(i18n["zohodiscussions.singlePost.messagefordeletingTopic"])){var _45d={};if(_44a==ZUID){_45d.access="author";}_45d.forumGroupId=forumGroupId;_45d.forumTopicId=_434;_45d.categoryId=_44c;_45d.forumId=_44b;_45d[csrfParamName]=csrfToken;doAjaxAction("/deleteTopic.do",_45d,function(data){if(jQuery.trim(data)=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.generalmessage.topicMovedToTrash"],"info");processHash("Home");}},function(_45f){});}return;}var _460=_44d.attr("responseDeleteLinks");if(_431.is(_460)){var _442=_431;var _44f=_442.attr("responseId");var _461=_442.attr("responseAuthorId");if(confirm(i18n["zohodiscussions.singlePost.messagefordeletingResponse"])){var _462={};if(_461==ZUID){_462.responseowner="true";}_462.forumGroupId=forumGroupId;_462.forumTopicId=_434;_462.categoryId=_44c;_462.forumId=_44b;_462.responseId=_44f;_462[csrfParamName]=csrfToken;doAjaxAction("/deleteForumResponse.do",_462,function(data){if(data=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.generalmessage.responseMovedToTrash"],"info");loadSinglePost(_434);}},function(_464){});}return false;}}}}}}}}}}}}}}}}}_436.hover(function(){var _465=_436.data("destroyHandle");if(_465){clearTimeout(_465);}},function(){var _466=setTimeout(function(){_436.hide();},500);_436.data("destroyHandle",_466);});}function getReasonForInapppropriate(_467){if(moderatorForSpam!="true"){return;}showLoadingImage();var _468=_467.attr("responseId");var _469={};_469.forumGroupId=forumGroupId;_469.responseId=_468;_469[csrfParamName]=csrfToken;doAjaxAction("/getInappropriateReason.do",_469,function(data){hideLoadingImage();var _46b=$("<div></div>").html(data);if(_46b.is("#noInappropriateReason")){showMessage(i18n["zohodiscussions.inappropriate.NoReasonForInappropriate"],"failure");}var _46c=$("#inappropriateReason");_46c.html(data).show();$("#inappropriateReasonClose").click(function(){_46c.html("").hide();});});}function linkToTopic(){$("#linkToTopicTemplate").html($("#dimDivLinkTO").html());$("#dimDivLinkTO").html("");$("#linkToTopicTemplate").show();$("#linkTopicUrl").focus();$("#cancelLinkTo").click(function(){$this=$(this);$("#dimDivLinkTO").html($("#linkToTopicTemplate").html());$("#linkToTopicTemplate").hide();$("#linkToTopicTemplate").html("");});$("#saveLinkToTopic").click(function(){$this=$(this);var _46d=$this.attr("currentTopicId");var _46e="^(ht|f)tp(s?)://[0-9a-zA-Z]([-.w]*[0-9a-zA-Z])*(:(0-9)*)*(/?)([a-zA-Z0-9-.?,:'/\\+=&amp;%$#_]*)?$";var _46f="#Topic/";var _470="?ftid=";var _471="/topic/";var _472=$("#linkTopicUrl").val();if(jQuery.trim(_472)==""){showMessage(i18n["zohodiscussions.createforumgroup.LinkEmpty"],"failure");return;}_472=$.trim(_472);if((_472.match(_46e))){if(_472.indexOf(_46f)>-1||_472.indexOf(_470)>-1||_472.indexOf(_471)){var _473={};_473.forumGroupId=forumGroupId;_473.currentTopicId=_46d;_473.linkToTopicUrl=_472;_473[csrfParamName]=csrfToken;doAjaxAction("/addLinkToTopic.do",_473,function(data){if(data=="SUCCESS"){removeTopicListCache();loadSinglePost(_46d);showTipper(i18n["zohodiscussions.singlepost.topicLinkedSuccessMessage"],"success");$("#linkToTopicTemplate").hide();}else{if(data=="FAILURE"){showTipper(i18n["zohodiscussions.singlePost.requestedURLnotfoundMessage"],"failure");}else{if(eval(data).result=="failure"){var _475=eval(data).reason;showTipper(i18n[_475],"failure");}}}});}else{showTipper(i18n["zohodiscussions.settings.PleaseEnteraValidurl"],"failure");}}else{showTipper(i18n["zohodiscussions.settings.PleaseEnteraValidurl"],"failure");}});}function deletelinkedTopic(_476){var _477=_476.attr("currentTopicId");var _478=_476.attr("linkedTopicId");var _479=_476.attr("location");var _47a={};_47a.forumGroupId=forumGroupId;_47a.forumTopicId=_477;_47a.linkedTopicId=_478;_47a[csrfParamName]=csrfToken;if(confirm(i18n["zohodiscussions.singlepost.removeLinkConfirmationMess"])){doAjaxAction("/deleteLinkedTopic.do",_47a,function(data){if(data=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlePost.deleteLinkedTopicMessage"],"success");if(_479=="topicList"){getForumTopics(-1,-1,1,"Home");}else{if(_479=="singlepost"){loadSinglePost(_477);}}}else{if(data=="FAILURE"){showTipper(i18n["zohodiscussions.generalmessage.errorOccured"],"failure");}}});}}function deletePublishedAttachment(_47c,_47d){if(confirm(i18n["zohodiscussions.generalmessage.deleteAttachmentConfirmMsg"])){showSmallLoadingImage(_47d);$this=_47c;var _47e=$this.attr("attachmentId");var _47f=$this.attr("forumTopicId");var _480=$this.attr("responseId");var _481=(typeof _480!="undefined")?_480:_47f;var _482={};_482.forumGroupId=forumGroupId;_482.forumTopicId=_47f;_482.responseId=_480;_482.fileName=$this.attr("attachmentName");_482.fileId=_47e;_482.access="author";_482[csrfParamName]=csrfToken;doAjaxAction("/deleteAttachment.do",_482,function(data){if(data=="SUCCESS"){showTipper(i18n["zohodiscussions.general.Deleted"],"info");if($("#SinglePostContainer").length>0){hideLoadingImage();showLoadingImage();removeTopicListCache();loadSinglePost(_47f,false);}else{if($("#topicList").length>0||$("#topicsList").length>0){$("#topicListMainContainer").attr("shouldReload","true");if($("#currentCategoryContext").length>0){$("#currentCategoryContext").trigger("click");}else{$("#currentForumContext").trigger("click");}}else{if(($("#topicContent_"+_481).length>0)){$("#topicContent_"+_481).find("li[attachmentId ="+_47e+"]").remove();if(($("#topicContent_"+_481).find("li.singleList").length==0)){($("#topicContent_"+_481).find("div.Attachments")).remove();}}}}}});}}function openEmailTopicDialog(_484){var _485=_484;var _486=_485.attr("topicTitle");var _487=_485.attr("forumTopicId");_487=_487||_485.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _488=_488;var _489=$("#emailTopicPrompt");_489.find(":input[name=\"Subject\"]").val(_486);_489.find(":input[name=\"forumTopicId\"]").val(_487);_489.find(":input[name=\"topicTitle\"]").val(_486);_489.find(":input[name=\"emailIds\"]");_489.show().parent().show();_489.find(":input[name=\"emailIds\"]").focus();return false;}function emailTopic(_48a){var _48b=$(_48a.target);_48b.html(i18n["zohodiscussions.singlePost.sending"]);var _48c=$("#emailTopicPrompt");if(validate(_48c.find("form"))==true){doAjaxAction("/eMailTopic.do",_48c.find("form").serialize(),function(data){if(data=="SUCCESS"){showTipper(i18n["zohodiscussions.singlepost.mailsentmessage"],"success");_48b.html(i18n["zohodiscussions.general.send"]);cancelEmailTopic();}},function(err){if(err.responseText.indexOf("'result':'failure'")>0){var _48f=eval(err.responseText);showMessage(_48f.reason,"failure");_48b.html(i18n["zohodiscussions.general.send"]);}else{showTipper(i18n["zohodiscussions.errorpage.requestedURLisnotfoundMess"],"failure",1000);}});return false;}else{_48b.html(i18n["zohodiscussions.general.send"]);}return false;}function cancelEmailTopic(){var _490=$("#emailTopicPrompt");_490.hide().parent().hide();_490.find(":input[name=\"emailIds\"]").val("");_490.find(":input[name=\"Subject\"]").val("");$("#emailContentArea").val("");return false;}function singlePostApproveAction(_491){var _492=_491.attr("action");var _493=_491.attr("forumTopicId");var _494=_491.attr("forumId");var _495=_491.attr("categoryId");var _496=_491.attr("itemType");var _497={};_497.forumGroupId=forumGroupId;_497.forumTopicId=_493;_497.forumId=_494;_497.categoryId=_495;_497.authorId=_491.attr("authorId");_497[csrfParamName]=csrfToken;if(_496=="response"){var _498=_491.attr("responseId");_497.responseId=_498;}doAjaxAction(_492,_497,function(data){if(data=="SUCCESS"){removeTopicListCache();var _49a=i18n["zohodiscussions.moderationList.topicApprovedMess"];if(_496=="response"){_49a=i18n["zohodiscussions.moderationList.responseApprovedMess"];}showTipper(_49a,"info",4000);loadSinglePost(_493);updateAwaitingApprovalCount();}});}function singlePostSpamAction(_49b,_49c){var _49d=_49b.attr("postType");if(_49d=="topic"){_49d=i18n["zohodiscussions.moderationList.topic"];}else{if(_49d=="response"){_49d=i18n["zohodiscussions.moderationList.response"];}}var _49e=_49b.attr("spamValue");var _49f="";if(moderatorForSpam=="true"){if(_49e==1){_49f=i18n["zohodiscussions.singlepost.spamActionconfirmationmessage1"]+" "+_49d+" "+i18n["zohodiscussions.singlepost.inappropriateActionconfirmationmessage2"];}else{_49f=i18n["zohodiscussions.singlepost.spamActionconfirmationmessage3"]+" "+_49d+" "+i18n["zohodiscussions.singlepost.appropriateActionconfirmationmessage2"];}if(confirm(_49f)){spamAction(_49b,_49d,_49c);}}else{if(_49e==1){$("#spamStatusMsg").show();$("#spamDetails_Text").html("");$("#spamContentDetails").unbind("click").click(function(){var _4a0=$("#spamDetails_Text").val();_4a0=$.trim(_4a0);if(_4a0==""){showMessage(i18n["zohodiscussions.singlePost.EmptyMsgError"],"failure");return;}spamAction(_49b,_49d,_49c,"appropriate",_4a0);});}else{if(confirm(i18n["zohodiscussions.singlepost.spamActionconfirmationmessage3"]+" "+_49d+" "+i18n["zohodiscussions.singlepost.appropriateActionconfirmationmessage2"])){spamAction(_49b,_49d,_49c,"appropriate");}}}return;}function spamAction(_4a1,_4a2,_4a3,_4a4,_4a5){var _4a6=_4a1.attr("forumTopicId");_4a6=_4a6||_4a1.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _4a7=_4a1.attr("forumId");_4a7=_4a7||_4a1.parents("div[parentCont=\"actualParent\"]").attr("forumId");var _4a8=_4a1.attr("categoryId");_4a8=_4a8||_4a1.parents("div[parentCont=\"actualParent\"]").attr("categoryId");var _4a9={};var _4aa=_4a1.attr("spamValue");_4a9.forumTopicId=_4a6;_4a9.forumGroupId=forumGroupId;_4a9.action=_4aa;_4a9.postType=_4a2;_4a9.purpose=_4a4||_4a1.attr("purpose");_4a9.forumId=_4a7;_4a9.categoryId=_4a8;_4a9[csrfParamName]=csrfToken;if(typeof _4a5!="undefined"){_4a9.spamDetails=_4a5;}var _4ab=_4a1.attr("responseId");if(typeof _4ab!="undefined"){_4a9.responseId=_4ab;}doAjaxAction("/spamAction.do",_4a9,function(data){$("#spamStatusMsg").hide();if(data=="SUCCESS"){removeTopicListCache();if(_4aa=="1"){if(_4a4=="appropriate"){showTipper(i18n["zohodiscussions.statistics.this"]+" "+_4a2+" "+i18n["zohodiscussions.singlepost.Inappropriatemarkedmessage2"],"success",1000);}else{showTipper(i18n["zohodiscussions.statistics.this"]+" "+_4a2+" "+i18n["zohodiscussions.singlepost.spammarkedmessage2"],"success",1000);}}else{if(_4a4=="appropriate"){showTipper(i18n["zohodiscussions.statistics.this"]+" "+_4a2+" "+i18n["zohodiscussions.singlepost.InappropriateRemovedmessage"],"success",1000);}else{showTipper(i18n["zohodiscussions.statistics.this"]+" "+_4a2+" "+i18n["zohodiscussions.singlepost.spamRemovedmessage"],"success",1000);}}if(_4a3=="singlePost"){loadSinglePost(_4a6);}else{if(moderatorForSpam=="true"){if(_4aa==1){processHash("home");}else{_4a1.parent().remove();$("#reportInappropriate_"+_4ab).remove();}}else{if(_4aa==1){var _4ad=$("#reportInappropriate_"+_4ab);_4ad.attr("spamValue","2");_4ad.find("div.imgAshSpam").removeClass("imgAshSpam").addClass("imgNotSpamIcon");_4ad.find("a").html(i18n["zohodiscussions.singlePost.Appropriate"]);if($("#reasonInappropriate_"+_4ab).length>0){var _4ae=$("#reasonInappropriate_"+_4ab);var _4af=parseInt(_4ae.attr("reportCount"));_4af=_4af+1;_4ae.find("span[purpose=\"inappropriateReason\"]").html(i18n["zohodiscussions.singlePost.Inappropriate"]+" ("+_4af+")");_4ae.attr("reportCount",_4af);}}else{var _4ad=$("#reportInappropriate_"+_4ab);_4ad.attr("spamValue","1");_4ad.find("div.imgNotSpamIcon").removeClass("imgNotSpamIcon").addClass("imgAshSpam");_4ad.find("a").html(i18n["zohodiscussions.singlePost.Inappropriate"]);var _4ae=$("#reasonInappropriate_"+_4ab);var _4af=parseInt(_4ae.attr("reportCount"));_4af=_4af-1;if(_4af>0){_4ae.attr("reportCount",_4af);_4ae.find("span[purpose=\"inappropriateReason\"]").html(i18n["zohodiscussions.singlePost.Inappropriate"]+" ("+_4af+")");}else{_4ae.remove();}}}}}},function(_4b0){var _4b1=eval(_4b0.responseText);if(_4b1.result=="failure"){showMessage(_4b1.reason,"failure");}});}function singlePostWidgetActions(_4b2){var _4b3=$(_4b2.target);var _4b4=_4b3.parent();var _4b5="singlePost";if(_4b4.is("li[purpose=\"bookmark\"]")){bookMark(_4b4,_4b2);}else{if(_4b4.is("li[purpose=\"watchAction\"]")||_4b4.is("div[purpose=\"watchAction\"]")){watchThisItem(_4b4,_4b5,_4b2);}else{if((_4b4.is("li[purpose=\"lockTopic\"]"))||(_4b3.is("#unLockTopic"))){var _4b6=(_4b3.is("#unLockTopic"))?_4b3:_4b4;lockTopicLink(_4b6,_4b2);}else{if(_4b4.is("li[purpose=\"moveTopic\"]")){moveTopic(_4b4);}else{if(_4b4.is("li[purpose=\"stickyPost\"]")){stickyLink(_4b4,_4b2);}else{if(_4b4.is("li[purpose=\"moderateThisTopic\"]")){moderateAction(_4b4,_4b5,_4b2);}else{if(_4b4.is("li[purpose=\"changeTopicType\"]")){var _4b7=_4b4.attr("forumTopicId");changeTopicType(_4b7);}else{if(_4b3.is("input[purpose=\"notifyAuthor\"]")){var _4b7=_4b3.attr("forumTopicId");updateNotification(_4b3,_4b7,_4b2);}else{if(_4b3.is("a[purpose=\"forumPostsFilter\"]")){hashPurpose=_4b3.attr("hashPurpose");processHash(hashPurpose);return false;}else{if(_4b4.is("li[purpose=\"raiseZSupportRequest\"]")){raiseZSupportRequest(_4b4,_4b2);}}}}}}}}}}}function changeTopicType(_4b8){$("#changeTopicTypeTemplate").html($("#changeTopicType_"+_4b8).html());$("#changeTopicType_"+_4b8).html("");$("#changeTopicTypeTemplate").show();$("#cancelTopicChange,#cancelChangingTopicType").click(function(){$("#changeTopicType_"+_4b8).html($("#changeTopicTypeTemplate").html());$("#changeTopicTypeTemplate").hide();$("#changeTopicTypeTemplate").html("");});$("#topicTypeListForChange").change(function(){var _4b9=$(this);if(_4b9.val()==1){$("#postExpiryDays_"+_4b8).show();}else{$("#postExpiryDays_"+_4b8).hide();}});$("#doChange_"+_4b8).click(function(){var _4ba=$(this);var _4bb=$("#topicTypeListForChange").val();var _4bc=_4ba.attr("forumId");var _4bd=_4ba.attr("categoryId");var _4be=_4ba.attr("isTopicOwner");var _4bf={};if(_4be=="true"){_4bf.access="author";}if(_4bb==1){var _4c0=$("#announcementExpiryDays_"+_4b8).val();_4bf.expiryDay=_4c0;}_4bf.forumGroupId=forumGroupId;_4bf.forumTopicId=_4b8;_4bf.forumId=_4bc;_4bf.categoryId=_4bd;_4bf.postTopicType=_4bb;_4bf[csrfParamName]=csrfToken;doAjaxAction("/updateTopicType.do",_4bf,function(data){if(data=="success"){removeTopicListCache();loadSinglePost(_4b8);$("#changeTopicTypeTemplate").hide();showTipper(i18n["zohodiscussions.singlePost.updateTopicTypeSuccessMessage"],"success");}else{showTipper(i18n["zohodiscussions.singlePost.updateTopicTypeErrorMessage"],"failure");}});});}function updateNotification(_4c2,_4c3,_4c4){var _4c5={};_4c5.forumGroupId=forumGroupId;_4c5.forumTopicId=_4c3;_4c5.access="author";_4c5.currNotifyStatus=_4c2.attr("checked");_4c5[csrfParamName]=csrfToken;doAjaxAction("/updateNotify.do",_4c5,function(data){if(data="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlepost.Notificationsavedmessage"],"success",1000);loadSinglePost(_4c3);}else{showTipper(i18n["zohodiscussions.generalmessage.errorOccured"],"failure");}});}function moderateAction(_4c7,_4c8,_4c9){var _4ca=_4c7.attr("forumTopicId");_4ca=_4ca||_4c7.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _4cb=_4c7.attr("forumId");_4cb=_4cb||_4c7.parents("div[parentCont=\"actualParent\"]").attr("forumId");if(_4c7.attr("moderationStatus")=="moderate"){var _4cc={};_4cc.forumTopicId=_4ca;_4cc.forumGroupId=forumGroupId;_4cc.forumId=_4cb;_4cc[csrfParamName]=csrfToken;showSmallLoadingImage(_4c9);doAjaxAction("/moderateTopic.do",_4cc,function(data){if(data=="SUCCESS"){removeTopicListCache();_4c7.attr("moderationStatus","moderated");showTipper(i18n["zohodiscussions.singlepost.Now"]+i18n["zohodiscussions.singlepost.topicundermoderationmessage"],"success",2000);if(_4c8=="singlePost"){$("#moderateTopicText").html(i18n["zohodiscussions.singlepost.unmoderatethistopicmessage"]);}else{_4c7.find("a[purpose = \"moderateTopicText\"]").html(i18n["zohodiscussions.singlepost.unmoderatethistopicmessage"]);}}else{showTipper(i18n["zohodiscussions.singlepost.Moderationfailed"],"success",2000);}hideLoadingImage();});}else{if(_4c7.attr("moderationStatus")=="moderated"){var _4ce={};_4ce.forumTopicId=_4ca;_4ce.forumGroupId=forumGroupId;_4ce[csrfParamName]=csrfToken;doAjaxAction("/unModerateTopic.do",_4ce,function(data){if(data=="SUCCESS"){removeTopicListCache();_4c7.attr("moderationStatus","moderate");showTipper(i18n["zohodiscussions.singlepost.moderationtopicremoved"],"success",2000);if(_4c8=="singlePost"){$("#moderateTopicText").html(i18n["zohodiscussions.singlepost.moderatethistopicmessage"]);}else{_4c7.find("a[purpose = \"moderateTopicText\"]").html(i18n["zohodiscussions.singlepost.moderatethistopicmessage"]);}}else{showTipper(i18n["zohodiscussions.singlepost.Moderationfailed"],"success",2000);}});}}}function moveTopic(_4d0){var _4d1=_4d0.attr("forumTopicId");$("#moveTopicTemplate").html($("#moveTopic_"+_4d1).html());$("#moveTopic_"+_4d1).html("");loadCategoriesToMove($("#forumListForMove").val());$("#moveTopicTemplate").show();var _4d2=$("#forumListForMove");var _4d3=$("#forumListForModerator");if(_4d0.attr("moderatorUser")=="yes"){_4d3.hide();_4d2.show();_4d2.val(_4d0.attr("forumId"));loadCategoriesToMove(_4d0.attr("forumId"));$("#moveToCategory").val(_4d0.attr("categoryId"));}else{_4d2.hide();_4d3.show();loadCategoriesToMove(_4d3.val());}$("#cancelMove,#cancelMoveTopic").click(function(){$("#moveTopic_"+_4d1).html($("#moveTopicTemplate").html());$("#moveTopicTemplate").hide();$("#moveTopicTemplate").html("");$("#doMove").html(i18n["zohodiscussions.singlePost.Movetopic"]);});$("#forumListForMove,#forumListForModerator").change(function(){var _4d4=_4d0.attr("forumId");var _4d5=$(this).val();if(_4d4==_4d5){$("#doMove").attr("disabled",true);}else{$("#doMove").attr("disabled",false);}loadCategoriesToMove($(this).val());});$("#doMove").unbind("click").click(function(){var _4d6=$(this);_4d6.html(i18n["zohodiscussions.singlePost.Moving"]);var _4d7=0;if(_4d0.attr("moderatorUser")=="yes"){_4d7=1;}var _4d8=$(this).attr("isTopicOwner");var args={};args.forumTopicId=_4d1;args.forumId=$("#forumListForMove").val();if(_4d7==0){args.forumId=$("#forumListForModerator").val();}if(_4d8){args.topicowner="true";}var _4da=$("#moveToCategory");var _4db=_4da.is(":visible");args.categoryId=(_4db==true)?_4da.val():-1;args.forumGroupId=forumGroupId;args[csrfParamName]=csrfToken;if(!args.categoryId){args.categoryId="";}doAjaxAction("/moveTopic.do",args,function(data){var _4dd=eval(data);if(_4dd.result=="success"){removeTopicListCache();$("#moveTopicTemplate").hide();$("#moveTopicTemplate").html("");showTipper(i18n["zohodiscussions.generalmessage.moveTopicSuccessMsg"],"success",3000);loadSinglePost(_4d1);}else{_4d6.html(i18n["zohodiscussions.singlePost.Movetopic"]);showMessage(_4dd.reason,"failure");}});});}function loadCategoriesToMove(_4de){categoriesForForum=$("#categoryListFormove").val().split("$$");$("#moveToCategory").hide().parent().hide();$.each(categoriesForForum,function(_4df,item){if(item.indexOf(_4de+":")>-1){$("#moveToCategory").html(item.split(":")[1]).show().parent().show();return;}});}function singlePostTagActions(_4e1,_4e2){$("#forumTopicTags").find("b[purpose = \"deleteTag\"]").click(function(){if(confirm(i18n["zohodiscussions.singlepost.tagDeleteConfirmMsg"])){$this=$(this);var _4e3={};var _4e4=$this.attr("postTagId");var _4e5=$this.attr("eachTagName");var zuid=$this.attr("zuid");var _4e7=$this.attr("forumId");var _4e8=$this.attr("postAuthorId");if(_4e8==zuid){_4e3.access="author";}_4e3.forumGroupId=forumGroupId;_4e3.forumTopicId=_4e1;_4e3.forumId=_4e7;_4e3.postTagId=_4e4;_4e3[csrfParamName]=csrfToken;doAjaxAction("/deleteForumPostTags.do",_4e3,function(data){if(data=="SUCCESS"){removeTopicListCache();showTipper("<i>"+_4e5+" </i> "+i18n["zohodiscussions.singlepost.tagDeletedMsg"],"info",3000);loadSinglePost(_4e1);}});}return false;});$("#addTagsForPost,#addNewTag").click(function(){$("#addPostTags").show();$("#addPostTags").find(":input[name=\"postTags\"]").focus();});$("#cancelTags").click(function(){$("#addPostTags").hide();$("#addPostTags").find(":input[name=\"postTags\"]").attr("value"," ");});$("#savePostTags").click(function(){$this=$(this);var _4ea=$("#addPostTags");var _4eb=_4ea.find(":input[name=\"postTags\"]").val();_4eb=_4eb.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");var flag="false";if(_4eb!=""){if(_4eb.match(/^[^\^()~`!@#$%&:;\/?|<>{}[\]*-+=]+$/)==null){hideLoadingImage();showMessage(i18n["zohodiscussions.singlepost.specialCharacterNotAllowedMsg"],"failure");enablePostButtons();return;}}var _4ed=_4eb.split(",");for(var i=0;i<_4ed.length;i++){if(_4ed[i].length>50){showTipper(i18n["zohodiscussions.singlepost.TagexceedMessage"],"failure");return;}if(!((_4ed[i])=="")&&!(jQuery.trim(_4ed[i]))==""){flag="true";}}if(flag=="false"){showMessage(i18n["zohodiscussions.singlepost.tagNameEmptyMsg"],"failure");return;}if(_4eb.indexOf("-")<0){var _4ef=$this.attr("forumId");var _4f0=$this.attr("postAuthorId");var _4f1={};if(_4f0==ZUID){_4f1.access="author";}_4f1.forumId=_4ef;_4f1.postTags=_4eb;_4f1.forumGroupId=forumGroupId;_4f1.forumTopicId=_4e1;_4f1[csrfParamName]=csrfToken;if(jQuery.trim(_4eb)==""){showMessage(i18n["zohodiscussions.singlepost.tagNameEmptyMsg"],"failure");return;}doAjaxAction("/addNewTagsForPost.do",_4f1,function(data){var _4f3=eval(data);if(_4f3.result=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlepost.tagAddedMsg"],"success",2000);loadSinglePost(_4e1,false);}});}});$("#forumTopicTags").find("[purpose=\"getTagRelatedPosts\"]").unbind("click").click(function(){$this=$(this);_4e2=_4e2||"Tag";var _4f4=$this.attr("hashPurpose");processHash(_4f4);return false;});}function changeTopicLabel(_4f5){var _4f6=$("#statusList");var _4f7=_4f5.attr("topicLabelId");var _4f8=_4f6.attr("forumTopicId");var _4f9=_4f6.attr("forumId");var _4fa={};_4fa.forumGroupId=forumGroupId;_4fa.forumTopicId=_4f8;_4fa.forumId=_4f9;_4fa.topicLabelId=_4f7;_4fa[csrfParamName]=csrfToken;doAjaxAction("/updateTopicLabel.do",_4fa,function(data){if(data=="success"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlePost.updateTopicLabelSuccessMsg"],"success");loadSinglePost(_4f8);}else{showMessage(i18n["zohodiscussions.singlePost.updateTopicLabelErrorMessage"],"failure");}},function(_4fc){});}function watchThisItem(_4fd,_4fe,_4ff){var _500=_4fd.attr("hashPurpose");var _501=_4fd.attr("itemType");var _502=_4fd.attr("itemId");_502=_502||_4fd.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _503=_4fd.attr("status");var _504=_4fd.attr("watchStatus");var _505=_4fd.attr("itemName");var _506={};_506.itemType=_501;_506.itemId=_502;_506.forumGroupId=forumGroupId;_506[csrfParamName]=csrfToken;if(_503=="watch"||_504=="watch"){showSmallLoadingImage(_4ff);doAjaxAction("/watchItem.do",_506,function(data){if(data=="SUCCESS"){removeTopicListCache();if(_501==0){showTipper(i18n["zohodiscussions.singlepost.watchTopicSuccessMsg"],"success",3000);if(_4fe=="singlePost"){loadSinglePost(_502,false);}else{if(_4fe=="singleTopicWatch"){_4fd.attr("status","unwatch");var _508=_4fd.parent();_508.removeClass("smallAshBox").addClass("smallAshBoxShow");_4fd.removeClass("imgSmallWatch").addClass("imgSmallWatchSel");hideLoadingImage();}else{_4fd.attr("status","unwatch");_4fd.find("a[purpose = \"watchItemText\"]").html(i18n["zohodiscussions.singlePost.unwatchTopic"]);hideLoadingImage();}}}else{if(_501==2){showTipper(i18n["zohodiscussions.widgetscontainer.watchForumSuccessMsg"],"success",3000);_4fd.attr("status","unwatch");if(_500!="type"){processHash(_500);}else{_4fd.find("a").html(i18n["zohodiscussions.general.Unwatch"]+" "+_505);$("#ajaxLoaderSmall").hide();}return false;}else{if(_501==1){showTipper(i18n["zohodiscussions.widgetscontainer.watchCategorySuccessMsg"],"success",3000);_4fd.attr("status","unwatch");if(_500!="type"){processHash(_500);}else{_4fd.find("a").html(i18n["zohodiscussions.general.Unwatch"]+" "+_505);$("#ajaxLoaderSmall").hide();}return false;}else{if(_501==4||_501==5||_501==6){showTipper(i18n["zohodsicussions.watchlist.announcement.follow.success"],"success",3000);_4fd.attr("status","unwatch");_4fd.html(i18n["zohodiscussions.general.Unwatch"]+" "+_505);$("#ajaxLoaderSmall").hide();return false;}}}}}});}else{var _509="";if(_501==0){_509=i18n["zohodiscussions.singlepost.unwatchTopicConfirmMsg1"];}else{if(_501==1){_509=i18n["zohodiscussions.singlepost.unwatchCategoryConfirmMsg3"];}else{if(_501==2){_509=i18n["zohodiscussions.singlepost.unwatchForumConfirmMsg2"];}else{if(_501==4||_501==5||_501==6){_509=i18n["zohodsicussions.watchlist.announcement.unwatch.confirm"];}}}}if(confirm(_509)){var _50a={};_50a.itemId=_502;_50a.forumGroupId=forumGroupId;_50a[csrfParamName]=csrfToken;doAjaxAction("/unWatch.do",_50a,function(data){if(data=="SUCCESS"){removeTopicListCache();if(_501==0){showTipper(i18n["zohodiscussions.singlepost.unwatchTopicSuccessMsg"],"info",3000);if(_4fe=="singlePost"){loadSinglePost(_502,false);}else{if(_4fe=="singleTopicWatch"){_4fd.attr("status","watch");var _50c=_4fd.parent();_50c.removeClass("smallAshBoxShow").addClass("smallAshBox");_4fd.removeClass("imgSmallWatchSel").addClass("imgSmallWatch");hideLoadingImage();}else{_4fd.attr("status","watch");hideLoadingImage();}}}else{if(_501==2){showTipper(i18n["zohodiscussions.widgetscontainer.unwatchForumSuccessMsg"],"success",3000);_4fd.attr("status","watch");if(_500!="type"){processHash(_500);}else{_4fd.find("a").html(i18n["zohodiscussions.general.watch"]+" "+_505);$("#ajaxLoaderSmall").hide();}return false;}else{if(_501==1){showTipper(i18n["zohodiscussions.widgetscontainer.unwatchCategorySuccessMsg"],"success",3000);_4fd.attr("status","watch");if(_500!="type"){processHash(_500);}else{_4fd.find("a").html(i18n["zohodiscussions.general.watch"]+" "+_505);$("#ajaxLoaderSmall").hide();}return false;}else{if(_501==4||_501==5||_501==6){showTipper(i18n["zohodsicussions.watchlist.announcement.stop.success"],"success",3000);_4fd.attr("status","watch");_4fd.html(i18n["zohodiscussions.general.watch"]+" "+_505);$("#ajaxLoaderSmall").hide();return false;}}}}}});}}}function bookMark(_50d,_50e){var _50f=_50d.attr("status");var _510={};_510.forumGroupId=forumGroupId;_510.forumTopicId=_50d.attr("forumTopicId");_510[csrfParamName]=csrfToken;showSmallLoadingImage(_50e);if(_50f=="bookmark"){doAjaxAction("/addBookMark.do",_510,function(data){hideLoadingImage();if(data=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlepost.bookmarkTopicSuccessMsg"],"success",3000);_50d.attr("status","removeBookmark");_50d.find("a").html(i18n["zohodiscussions.singlePost.removeBookmark"]);}else{showTipper(i18n["zohodiscussions.singlePost.bookMarkErrorMessage"],"failure");}});}else{doAjaxAction("/removeBookMark.do",_510,function(data){hideLoadingImage();if(data=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlePost.removeBookmarkMsg"],"info",3000);_50d.attr("status","bookmark");_50d.find("a").html(i18n["zohodiscussions.singlePost.bookmarkTopic"]);}else{showTipper(i18n["zohodiscussions.singlePost.removeBookMarkErrorMessage"],"failure");}});}}function stickyLink(_513,_514){var _515=0;var _516=_513.attr("status");var _517=_513.attr("isSticky");if(_517=="true"){_515=1;}var _518={};_518.forumGroupId=forumGroupId;_518.forumTopicId=_513.attr("forumTopicId");_518.action=_515;_518[csrfParamName]=csrfToken;showSmallLoadingImage(_514);doAjaxAction("/stickyAction.do",_518,function(data){if(data=="SUCCESS"){removeTopicListCache();if(_516=="stickyPost"){showTipper(i18n["zohodiscussions.singlepost.stickyPostSuccessMsg"],"success",3000);_513.attr("status","normal");_513.attr("isSticky","true");$("#stickyPostText").html(i18n["zohodiscussions.singlePost.notStickyPost"]);}else{showTipper(i18n["zohodiscussions.singlePost.removeStickyPostMsg"],"info",3000);_513.attr("status","stickyPost");_513.attr("isSticky","false");$("#stickyPostText").html(i18n["zohodiscussions.singlePost.makeStickyPost"]);}hideLoadingImage();}});}function lockTopicLink(_51a,_51b){var _51c=0;var _51d=_51a.attr("status");var _51e=_51a.attr("isLocked");var _51f=_51a.attr("forumTopicId");if(_51e=="true"){_51c=1;}var _520=(_51d=="lockTopic")?i18n["zohodiscussions.singlepost.lockConfirmationMsg"]:i18n["zohodiscussions.singlepost.unlockConfirmationMsg"];if(confirm(_520)){var _521={};_521.forumGroupId=forumGroupId;_521.forumTopicId=_51f;_521.action=_51c;_521[csrfParamName]=csrfToken;doAjaxAction("/lockAction.do",_521,function(data){if(data=="SUCCESS"){removeTopicListCache();if(_51d=="lockTopic"){showTipper(i18n["zohodiscussions.singlepost.lockTopicSuccessMsg"],"info",3000);}else{showTipper(i18n["zohodiscussions.singlepost.unlockTopicSuccessMsg"],"info",3000);}loadSinglePost(_51f,false);}});}}function raiseZSupportRequest(_523,_524){var _525={};_525.forumGroupId=forumGroupId;_525.forumTopicId=_523.attr("forumTopicId");_525.forumId=_523.attr("forumId");_525[csrfParamName]=csrfToken;showSmallLoadingImage(_524);doAjaxAction("/raiseZSupportRequest.do",_525,function(data){var _527=eval(data);if(_527.result=="success"){showTipper("Support request added successfully","info",3000);_523.parents("[purpose=\"zsRequestLinkCont\"]").remove();hideLoadingImage();}else{showMessage(_527.reason,"failure");}});}function disablePostResponseButtons(){$("#publishResponse").attr("disabled",true);}function enablePostResponseButtons(){$("#publishResponse").attr("disabled",false);}function addForumResponse(_528,_529,_52a,_52b){showLoadingImage(i18n["zohodiscussions.general.publishing"]);var _52c=editor.getContent();_52c=_52c.replace(/^\s+/g,"").replace(/\s+$/g,"");var _52d=$("<div></div>").html(_52c);_52d=_52d.text();_52d=$.trim(_52d);if(_52d==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");return;}$("#postContentTA").val(_52c);$("#editorHolder").append($("#responseAttachmentContActual").clone().hide());var _52e=(_529&&_529=="Edit")?"/updateResponse.do":(ZUID==-1)?"/addGuestForumResponse.do":"/addForumResponse.do";if(_529=="TweetPost"){var _52f=$("#editorHolder").find("input[name=\"forumPostTitle\"]").val();_52f=_52f.replace(/^\s+/g,"").replace(/\s+$/g,"");var _530=$("<div></div>").html(_52f);_530=_530.text();_530=$.trim(_530);if(_530==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.TopicTitleCannotbeEmptymessage"],"failure");$("#editorHolder").find("input[name=\"forumPostTitle\"]").focus();return;}if($("#forum_Twitter_SelectForum").val()==-1){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.selectAnyForum"],"failure");return;}if($("#forum_Twitter_SelectSubForum_"+_52b).val()==-1){if($("#forum_Twitter_SelectSubForum_"+_52b).text()!="Uncategorised"){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.selectAnyCategory"],"failure");return;}}_52e="/addTweetPost.do";var _531=_52d;$("#editorHolder").find("input[name=\"twitterResponseContent\"]").val(_531);}disablePostResponseButtons();doAjaxAction(_52e,$("#editorHolder").serialize(),function(data){hideLoadingImage();if(data.indexOf("'result':'failure'")>0){var _533=eval(data);if(_533.errorcode=="SPAM_DETECTED"){if(confirm(_533.reason)){$("#editorHolder").find("input[name=\"detectSpamPresence\"]").val(0);$("#publishResponse").trigger("click");}}else{showMessage(_533.reason,"failure");}enablePostResponseButtons();}else{if(data.indexOf("'result':'success'")>0){var _533=eval(data);if($("#SinglePostContainer").length>0){removeTopicListCache();loadSinglePost(_528,false);}else{if($("#topicList").length>0||$("#topicsList").length>0){$("#topicListMainContainer").attr("shouldReload","true");if($("#currentCategoryContext").length>0){$("#currentCategoryContext").trigger("click");}else{if(_529=="TweetPost"){showTipper(i18n["zohodiscussions.writePost.publishMsg"],"success",4000);if(isTopicQuickView=="false"){window.location.href=serverURL+"/topic/"+_533.topicPermaLink;}else{showLoadingImage();loadSinglePost(_533.value);}}else{$("#currentForumContext").trigger("click");}}}}showTipper(i18n[_533.reason],"info",5000);return;}else{var _534=(_529&&_529=="Edit")?i18n["zohodiscussions.singlepost.ResponseUpdated"]:i18n["zohodiscussions.singlepost.ResponseAdded"];showTipper(_534,"success",3000);if($("#SinglePostContainer").length>0){removeTopicListCache();showLoadingImage();loadSinglePost(_528,false);}else{if($("#topicList").length>0||$("#topicsList").length>0){$("#topicListMainContainer").attr("shouldReload","true");if($("#currentCategoryContext").length>0){$("#currentCategoryContext").trigger("click");}else{$("#currentForumContext").trigger("click");}}else{if($("#myJournalsInnerContent").length>0){var _535=_528;if(_52a&&$("#topicContent_"+_535).length<1){_535=_52a;}$("#topicContent_"+_535).html(_52c);$("#editTopic_"+_535).html(_52c);$("#cancelResponse").trigger("click");}else{if($("#authorProfileInnerContent").length>0){var _535=_528;if(_52a&&$("#topicContent_"+_535).length<1){_535=_52a;}$("#topicContent_"+_535).html(_52c);$("#editTopic_"+_535).html(_52c);$("#cancelResponse").trigger("click");}}}}enablePostResponseButtons();}}},function(_536){hideLoadingImage();if(_536.responseText.indexOf("'result':'failure'")>0){var _537=eval(_536.responseText);if(_537.result=="failure"){if(_537.errorcode=="HIP_REQUIRED"){$("#editorHolder").find("div#responseAttachmentContActual").remove();var _538=$("#responseAttachmentContActual").find("div[purpose=\"responseCaptcha\"]");if(_538.attr("currCaptcha")=="new"){showMessage(i18n["zohodiscussions.writePost.captchaMsg"],"failure");}else{showMessage(i18n["zohodiscussions.writePost.captchaErrorMsg"],"failure");}_538.find("img[purpose=\"captchaImage\"]").replaceWith("<img purpose=captchaImage name=hipImg border=0 src=/showcaptcha?digest="+_537.reason+" align=absmiddle alt=HIP image>");_538.find(":input").attr("name",_537.reason);_538.attr("currCaptcha","old");_538.show();if(!$("#responseAttachmentContActual").is(":visible")){$("#responseAttachmentContActual").show();}}else{showMessage(_537.reason,"failure");}}}else{$("#SinglePostContainer").get(0).innerHTML=_536.responseText;}});return false;}function removeTopicListCache(){$("#topicListMainContainer:hidden").remove();$("#userProfileMainContainer:hidden").remove();$("#myAreaParentContainer:hidden").remove();}function bindMyAreaClicks(_539){_539.unbind("click",processMyAreaClick).click(processMyAreaClick);$("#recentActivityContent, #profileDetailCont").unbind("click",processAllMyAreaMainClick).click(processAllMyAreaMainClick);$("#mainContent").unbind("click",processAuthorProfileClick);$("#mainContent").unbind("click",processAllActionClick);}function processMyAreaClick(_53a){var _53b=$(_53a.target);var _53c=_53b.parent();if($("#loadingImg").is(":visible")){return;}if((_53c.is("[purpose=\"dashBoard\"]")||_53c.is("[purpose=\"myJournals\"]")||_53c.is("[purpose=\"watchList\"]")||_53c.is("[purpose=\"friends\"]")||_53c.is("[purpose=\"bookMark\"]")||_53c.is("[purpose=\"privateMsg\"]")||_53c.is("[purpose=\"preference\"]"))&&_53c.attr("isNiceUrl")!="Yes"){getMyAreaAction(_53c);return;}else{if((_53b.is("[purpose=\"dashBoard\"]")||_53b.is("[purpose=\"myJournals\"]")||_53b.is("[purpose=\"watchList\"]")||_53b.is("[purpose=\"friends\"]")||_53b.is("[purpose=\"bookMark\"]")||_53b.is("[purpose=\"privateMsg\"]")||_53b.is("[purpose=\"preference\"]"))&&_53b.attr("isNiceUrl")!="Yes"){getMyAreaAction(_53b);return;}}}function getMyAreaAction(_53d,_53e){showLoadingImage();_53d.parent("ul").find("li").removeClass("selected");_53d.addClass("selected");var _53f=_53d.attr("action");var _540={};_540.forumGroupId=forumGroupId;_540[csrfParamName]=csrfToken;_540.ch=ch;var _541=_53d.attr("purpose");if(_53e!=undefined&&_541=="watchList"){_53f="/myWatchListSubAction.do";_540.subAction=_53e;}$("#myAreaLists").attr("currView",_541);if(_541=="myJournals"){_540.userId=_53d.attr("userId");_540.viewType="myself";}doAjaxAction(_53f,_540,function(data){hideLoadingImage();$("#myAreaInnerMainContent").find("div.innerWrapper").get(0).innerHTML=data;if(_541=="myJournals"){$.history.add("MyArea/myPosts");}else{if(_541=="watchList"&&_53e!=undefined){$.history.add("MyArea/"+_541+"/"+_53e);}else{if(_541=="friends"&&_53e!=undefined){$.history.add("MyArea/"+_541+"/"+_53e);}else{$.history.add("MyArea/"+_541);}}}bindMyareaTabsActions(_541,_53e);return false;},function(err){var _544=eval(err.responseText);showMessage(_544.reason,"failure");hideLoadingImage();});}function bindMyareaTabsActions(_545,_546){var _547=$("#myAreaInnerMainContent").find("div.innerWrapper");if(_545=="preference"){_547.unbind("click",processPreferenceClick).click(processPreferenceClick);var _548=$("#user_AvatarImage");if(_548.find("li.selected").length>0){avatarImageFocus(_548);}var _549=$("#preferenceInnerContent").find("form").attr("userPhotoPref");var _54a=$("#preferenceInnerContent").find("form").attr("userUploadPhotoUrl");var _54b=$("#preferenceInnerContent").find("form").attr("userIAMphoto");var _54c="";if(_549=="IAM"){_54c=_54b;}else{if(_549=="userUpload"){_54c=_54a;}else{if(_549=="Avatar"){if($("#allAvatarList").find("li.selected").length==0){$("#allAvatarList").find("li[count=\"1\"]").addClass("selected");var src="../images/avatars/avatarn1.gif";$("#userSelectedAvatarImage").attr("value",src);$("#userSelectedProfileImage").attr("value",src);$("#userPreferencePhotoCont").find("img").attr("src",src);$("#user_Photo").attr("value","Avatar");}}}}insertBrowserOptionToUpload(_549,_54c);var _54e=$("#resetpassword");var _54f={};_54f[csrfParamName]=csrfToken;_54e.find("a").click(function(_550){showSmallLoadingImage(_550);_54e.hide();doAjaxAction("https://discussions.zoho.com/sendResetPassword.do",_54f,function(data){if(data=="success"){hideLoadingImage();_54e.html(i18n["zohodiscussions.reset.success"]);_54e.show();}else{hideLoadingImage();_54e.html(i18n["zohodiscussions.reset.failure"]);_54e.show();}});});}else{_547.unbind("click",processAllMyAreaMainClick).click(processAllMyAreaMainClick);_547.unbind("click",processAllActionClick).click(processAllActionClick);allFilterOption(_545);showAuthorPopout(_547);if(_546=="following"){setFocusToContainer(_547.find("#followingAuthors"),false,100,0);}}if(_545=="dashBoard"){if(typeof WmsContacts!="undefined"&&ch=="true"){var _552=WmsContacts.getZohoContacts();setPresence(_552,"followingUserDetails");setPresence(_552,"followersUserDetails");setPresence(_552,"friendsListContainer");setPresenceInMyArea(_552,"current_recentActivity_List");}initialiseUserActivityChart();}if(_545=="watchList"){if(typeof WmsContacts!="undefined"&&ch=="true"){var _552=WmsContacts.getZohoContacts();setPresenceInMyArea(_552,"userChat_watchTopics");}}if(_545=="privateMsg"){if(typeof WmsContacts!="undefined"&&ch=="true"){var _552=WmsContacts.getZohoContacts();setPresenceInMyArea(_552,"userChat_inbox");}}if(_545=="friends"){if(typeof WmsContacts!="undefined"&&ch=="true"){var _552=WmsContacts.getZohoContacts();setPresenceInMyArea(_552,"friendsDetailsInnerContent");}}}function avatarImageFocus(_553){var _554=_553.find("li.selected").attr("count");var _555=parseInt(_554/7);if(_554%7==0){_555=_555-1;}_553.scrollTop(_555*60);}function UserPhotoPreference(_556,_557){if(_557=="uploadUserPhoto"){$("#uploadPhotoCont").find("input[name=\"imageFileName\"]").val("");$("#uploadPhotoCont").find("img[purpose=\"uploadPhotoLoadingCont\"]").remove();$("#uploadPhotoPreference").attr("src",_556);$("#uploadPhotoCont").find("img[purpose=\"avat_Image\"]").attr("src",_556);$("#userSelectedAvatarImage").attr("value",_556);$("#userSelectedProfileImage").attr("value",_556);$("#preferenceInnerContent").find("form").attr("userUploadPhotoUrl",_556);$("#userPreferencePhotoCont").find("img").attr("src",_556);$("#user_Photo").attr("value","userUpload");$("#uploadPhotoCont").find("div.profilePhoto").removeClass("profilePhoto").addClass("profilePhotoSelected");$("#allAvatarList").find("li.selected").removeClass("selected");showTipper(i18n["zohodiscussions.userpreference.uploadsuccessMess"],"success",1000);}}function processAllMyAreaMainClick(_558){var _559=$(_558.target);var _55a=_559.parent();if($("#loadingImg").is(":visible")){return;}else{if(_559.is("a[purpose=\"postTitle\"]")){if(_559.attr("postType")=="draft"){editDraftPost(_559);return;}showLoadingImage();if(isTopicQuickView=="false"){}else{var _55b=_559.attr("forumTopicId");var _55c=_559.attr("recentResponseId");if(_55c!=undefined){processHash("Topic/"+_55b+"/"+_55c);}else{processHash("Topic/"+_55b);}return false;}}else{if((_559.is("a[purpose=\"forumAction\"]")||_559.is("a[purpose=\"categoryAction\"]"))&&_559.attr("isNiceUrl")!="Yes"){var _55d=_559.attr("hashPurpose");processHash(_55d);}else{if((_559.is("a[purpose=\"authorProfile\"],a[purpose=\"authorProfileMore\"]"))&&_559.attr("isNiceUrl")!="Yes"){var _55e=_559.attr("authorName");var _55f=_559.attr("singleClickflag");if(_55f=="0"){if(_55e==screenName||_55e==encodedScreenName){processHash("MyArea");_559.attr("singleClickflag","1");}else{processHash("User/"+_55e);_559.attr("singleClickflag","1");}}return;}else{if(_559.is("div[purpose=\"unWatch\"]")){unWatchItem(_559);return;}else{if(_559.is("a[purpose=\"moreFollowing\"]")&&_559.attr("isNiceUrl")!="Yes"){processHash("myarea/watchList/following");return;}else{if(_559.is("a[purpose=\"moreFollowers\"]")&&_559.attr("isNiceUrl")!="Yes"){processHash("myarea/watchList/follower");return;}else{if(_55a.is("li[deletepurpose=\"deleteAttachment\"]")){deletePublishedAttachment(_55a,_558);return;}else{if(_559.is("li.navBtnEnabled")&&_559.is("li[action=\"false\"]")){var type=_559.attr("purpose");fnPaginationProcess(_55a,type);return;}}}}}}}}}}function processAllActionClick(_561){var _562=$(_561.target);var _563=_562.parent();var _564=$("#myAreaLists").attr("currView");if(!_564){_564="authorProfile";}if($("#loadingImg").is(":visible")){return;}else{if(_562.is(".bigPlusIcon")){var _565=_562.parents("li.headerContent");if(!_565.find("div.expandTextContent").is(":visible")||_564=="privateMsg"){_565.find("div.textContent").addClass("expandTextContent").show();_565.parents("div.moderateSinglePost").find("div.lowerButton").show();}else{_565.find("div.textContent").addClass("expandTextContent");}_562.removeClass("bigPlusIcon").addClass("bigMinusIcon");setFocusToContainer(_562,true,200);return;}else{if(_562.is(".bigMinusIcon")){var _565=_562.parents("li.headerContent");_565.find("div.textContent").removeClass("expandTextContent").hide();_565.parents("div.moderateSinglePost").find("div.lowerButton").hide();_562.removeClass("bigMinusIcon").addClass("bigPlusIcon");return;}else{if(_563.is("li[purpose=\"expandedView\"]")||_563.is("li[purpose=\"listView\"]")){manageExpandOrCollapseType(_563,_564);return;}else{if(_562.is("li.navBtnEnabled")&&_562.is("li[action=\"true\"]")){var _566=_562.attr("purpose");if(_564=="authorProfile"){fnPagination(_563,_566,"true");}else{fnPagination(_563,_566);}return;}else{if(_562.is("li[purpose=\"removeBookMark\"]")){removeBookMarkAction(_562);return;}else{if(_563.is("li[purpose=\"removeBookMark\"]")){removeBookMarkAction(_563);return;}else{if(_562.is("li[purpose=\"postTitle\"]")){if(_562.attr("postType")=="draft"){editDraftPost(_562);return;}showLoadingImage();if(isTopicQuickView=="false"){}else{var _567=_562.attr("forumTopicId");processHash("Topic/"+_567);return false;}}else{if(_563.is("li[purpose=\"postTitle\"]")){if(_563.attr("postType")=="draft"){editDraftPost(_563);return;}showLoadingImage();if(isTopicQuickView=="false"){}else{var _567=_563.attr("forumTopicId");processHash("Topic/"+_567);return false;}}else{if(_563.is("li[purpose=\"delete\"]")){myJournalsDeletePost(_563,_564+"Tab");return;}else{if(_562.is("li[purpose=\"delete\"]")){myJournalsDeletePost(_562,_564+"Tab");return;}else{if(_562.is("li[purpose=\"resources\"]")||_562.is("li[purpose=\"topics\"]")||_562.is("li[purpose=\"drafts\"]")||_562.is("li[purpose=\"replies\"]")||_562.is("li[purpose=\"authorTopics\"]")||_562.is("li[purpose=\"authorReplies\"]")||_562.is("li[purpose=\"privateMsg\"]")){$("#"+_564+"Tab").find("li").removeClass("selected");myAreaAllTabClick(_562,_564);return;}else{if(_563.is("li[purpose=\"resources\"]")||_563.is("li[purpose=\"topics\"]")||_563.is("li[purpose=\"drafts\"]")||_563.is("li[purpose=\"replies\"]")||_563.is("li[purpose=\"authorTopics\"]")||_563.is("li[purpose=\"authorReplies\"]")||_563.is("li[purpose=\"privateMsg\"]")){$("#"+_564+"Tab").find("li").removeClass("selected");myAreaAllTabClick(_563,_564);return;}else{if(_562.attr("purpose")=="watchTopics"||_562.attr("purpose")=="watchUsers"||_562.attr("purpose")=="watchForums"||_562.attr("purpose")=="watchCategories"||_562.attr("purpose")=="simpleView"||_562.attr("purpose")=="followers"){$("#watchListTabs").find("li").removeClass("selected");myAreaAllTabClick(_562,"watchList");}else{if(_563.attr("purpose")=="watchTopics"||_563.attr("purpose")=="watchUsers"||_563.attr("purpose")=="watchForums"||_563.attr("purpose")=="watchCategories"||_563.attr("purpose")=="simpleView"||_563.attr("purpose")=="followers"){$("#watchListTabs").find("li").removeClass("selected");myAreaAllTabClick(_563,"watchList");}else{if(_562.attr("purpose")=="friendsActivities"||_562.attr("purpose")=="friendsList"||_562.attr("purpose")=="pendingFriendRequests"){$("#friendsDetailsTabs").find("li").removeClass("selected");friendsTabClick(_562,"friendsDetails");}else{if(_563.attr("purpose")=="friendsActivities"||_563.attr("purpose")=="friendsList"||_563.attr("purpose")=="pendingFriendRequests"){$("#friendsDetailsTabs").find("li").removeClass("selected");friendsTabClick(_563,"friendsDetails");}else{if(_563.is("li[purpose=\"removeFriend\"]")){removeFriend(_563);}else{if(_563.is("li[purpose=\"confirmFriend\"]")){confirmFriendRequest(_563);}else{if(_562.is("li[purpose=\"unWatch\"]")){unWatchItem(_562);return;}else{if(_563.is("li[purpose=\"unWatch\"]")){unWatchItem(_563);return;}else{if(_563.is("li[purpose=\"unWatchItem\"]")){unWatchItem(_563,"authorProfile");}else{if(_562.attr("purpose")=="inbox"||_562.attr("purpose")=="sent"){$("#privateMsgTab").find("li").removeClass("selected");var _568=$("#newReplyPrivateMsgCont");if(_568.is(":visible")){_568.parent().hide();_568.remove();}myAreaAllTabClick(_562,"privateMsg");return;}else{if(_563.attr("purpose")=="inbox"||_563.attr("purpose")=="sent"){$("#privateMsgTab").find("li").removeClass("selected");var _568=$("#newReplyPrivateMsgCont");if(_568.is(":visible")){_568.parent().hide();_568.remove();}myAreaAllTabClick(_563,"privateMsg");return;}else{if(_562.is("li[purpose=\"deleteThisPM\"]")){deletePrivateMsg(_562);}else{if(_563.is("li[purpose=\"deleteThisPM\"]")){deletePrivateMsg(_563);}else{if(_562.is("li[purpose=\"replyToThisPM\"]")||_562.is("li[purpose=\"editThisPM\"]")){replyToPrivateMsg(_562);}else{if(_563.is("li[purpose=\"replyToThisPM\"]")||_563.is("li[purpose=\"editThisPM\"]")){replyToPrivateMsg(_563);}else{if(_563.is("a[purpose=\"postConversation\"]")){privateConversation(_563);}else{if(_562.is("a[purpose=\"postConversation\"]")){privateConversation(_562);}else{if(_562.is("a[purpose=\"postConversationTitle\"]")){var _569=_562.parents("li.headerContent");var _56a=_569.find("div.textContent");if(_56a.is(":visible")){_569.find("div.bigMinusIcon").trigger("click");}else{_569.find("div.bigPlusIcon").trigger("click");}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}function allFilterOption(type){$("#"+type+"_Filter").change(function(){var _56c=$(this);var _56d=_56c.val();var _56e=$(this).find("option[filterType=\""+_56d+"\"]");if(_56c.attr("action")=="true"){myJournalsFilterAction(_56e,type);}else{myJournalsFilter(_56e,type);}});}function removeBookMarkAction(_56f){var _570=_56f.attr("forumTopicId");var _571={};_571.forumGroupId=forumGroupId;_571.forumTopicId=_570;_571[csrfParamName]=csrfToken;doAjaxAction("/removeBookMark.do",_571,function(data){hideLoadingImage();showTipper(i18n["zohodiscussions.bookMark.successfullyRemoveBookMark"],"success");$("#bookMark_"+_570).remove();},function(err){var _574=eval(err.responseText);showMessage(_574.reason,"failure");hideLoadingImage();});}function processPreferenceClick(_575){var _576=$(_575.target);var _577=_576.parent();var _578=$("#preferenceInnerContent").find("form").attr("userUploadPhotoUrl");var _579=$("#preferenceInnerContent").find("form").attr("userIAMphoto");if($("#loadingImg").is(":visible")){return;}if(_576.attr("purpose")=="profile"||_576.attr("purpose")=="notification"||_576.attr("purpose")=="privacy"){_577.find("li.selected").removeClass("selected");_576.addClass("selected");myAreaAllTabClick(_576,"preference");}else{if(_577.attr("purpose")=="profile"||_577.attr("purpose")=="notification"||_577.attr("purpose")=="privacy"){_577.parent("ul").find("li.selected").removeClass("selected");_577.addClass("selected");myAreaAllTabClick(_577,"preference");}else{if(_576.is("input[purpose=\"save\"]")||_577.is("input[purpose=\"save\"]")){updateUserPreference();}else{if(_577.is("li[purpose=\"avat_Image\"]")){$("#user_IamImage").find("div.profilePhotoSelected").removeClass("profilePhotoSelected").addClass("profilePhoto");$("#user_AvatarImage").find("li.selected").removeClass("selected");_577.addClass("selected");var src=_576.attr("src");$("#userPreferencePhotoCont").find("img").attr("src",src);$("#user_Photo").attr("value","Avatar");$("#userSelectedAvatarImage").val(src);$("#userSelectedProfileImage").val("");$("#zohoAccounts").removeAttr("purpose");$("#myComputer").removeAttr("purpose");}else{if(_576.is("#myComputer")){$("#zohoAccountMess").remove();$("#uploadPhotoCont").remove();$("#curr_UploadPhoto_Cont").remove();$("#fgid").remove();$("#allAvatarList").hide();$("#myComputer").addClass("selected").siblings("li.selected").removeClass("selected");insertBrowserOptionToUpload("userUpload",_578);}else{if(_576.is("#zohoAccounts")){$("#zohoAccountMess").remove();$("#curr_UploadPhoto_Cont").remove();$("#fgid").remove();$("#uploadPhotoCont").remove();$("#curr_UploadPhoto_Cont").remove();$("#allAvatarList").hide();$("#zohoAccounts").addClass("selected").siblings("li.selected").removeClass("selected");insertBrowserOptionToUpload("IAM",_579);}else{if(_576.is("#AvatarsList")){$("#zohoAccountMess").remove();$("#uploadPhotoCont").remove();$("#curr_UploadPhoto_Cont").remove();$("#AvatarsList").addClass("selected").siblings("li.selected").removeClass("selected");if($("#fgid").length==0){var _57b=$("<input type = \"hidden\" id=\"fgid\" name=\"forumGroupId\" value=\""+forumGroupId+"\"/>");_57b.insertAfter($("#preferenceInnerContent > form > input[name=\"avatar\"]")).show();}var _57c=$("#allAvatarList").find("li.selected").find("img").attr("src");$("#userSelectedAvatarImage").attr("value",_57c);$("#userSelectedProfileImage").attr("value",_57c);$("#allAvatarList").show();avatarImageFocus($("#user_AvatarImage"));}else{if(_577.is("div[purpose=\"avat_Image\"]")){$("#user_AvatarImage").find("li.selected").removeClass("selected");_577.removeClass("profilePhoto").addClass("profilePhotoSelected");$("#userSelectedProfileImage").val("yes");var src=_576.attr("src");$("#userPreferencePhotoCont").find("img").attr("src",src);$("#userSelectedAvatarImage").val(src);$("#zohoAccounts").removeAttr("purpose");$("#myComputer").removeAttr("purpose");}}}}}}}}$("#userNameChangePopUp").find("input[name=\"screenName\"]").unbind("focus").focus(function(){$("#userNameChangePopUp").find("a.greenLink").show();$("#userNameChangePopUp").find("span[purpose=\"showMsg\"]").hide();});}function insertBrowserOptionToUpload(_57d,_57e){var _57f=$("#preferenceInnerContent").find("form").attr("userUploadPhotoUrl");var _580=$("#preferenceInnerContent").find("form").attr("userIAMphoto");if(_57d=="IAM"){var _581=$("#uploadPhoto_Cont");var _582=_581.clone();_582.insertAfter($("#user_AvatarImage").find("ul")).show();_582.attr("id","curr_UploadPhoto_Cont");_582.attr("purpose","userPhotoTemplate");_582.find("div[purpose=\"uploadPhotoContent\"]").wrap("<form action = \"/uploadUserPhoto.do\" style=\"margin-left:230px;margin-top:-30px;margin-right:100px;\" target = \"fileUpdTgt_user\" method=\"post\" enctype=\"multipart/form-data\"></form>");_582.find("div.iFrameContainer").html("<iframe name = \"fileUpdTgt_user\"> </iframe>");_582.find("form").attr("target","fileUpdTgt_user");var _583=$("<input type = \"hidden\"  name=\"forumGroupId\" value=\""+forumGroupId+"\"/>");_583.insertAfter($("#curr_UploadPhoto_Cont").find("div[purpose=\"uploadPhotoContent\"]"));$("#curr_UploadPhoto_Cont").find("div[purpose=\"uploadName\"]").html(i18n["zohodiscussions.userProfile.zohoImage"]);_582.find(":file").change(function(){_582.find("[purpose=\"uploadPhotoLoadingCont\"]").show();_582.find(":input[name=\"attacher\"]").val("");_582.find("form").get(0).submit();});var _584=$("#zohoAccounts").attr("purpose");var _585="profilePhoto";if(typeof _584!="undefined"){_585="profilePhotoSelected";}var _586=$("<div class=\""+_585+"\"  imgpurpose=\"IAMPhotoSelected\"><img height=\"48\" width=\"48\" purpose=\"avat_Image\" src=\""+_580+"\"/></div>");_586.insertBefore($("#curr_UploadPhoto_Cont").find("form"));$("<div class=\"boldText\" style=\"margin-left:120px;margin-top:-45px;margin-right:100px;\">"+i18n["zohodiscussions.userpreference.changePhoto"]+":</div>").insertAfter($("#curr_UploadPhoto_Cont").find("div[imgpurpose=\"IAMPhotoSelected\"]"));$("#curr_UploadPhoto_Cont").find("div[imgpurpose=\"IAMPhotoSelected\"]").click(function(){var _587=$("#preferenceInnerContent").find("form").attr("userIAMphoto");$("#userPreferencePhotoCont").find("img").attr("src",_587);var _588=$("#userPreferencePhotoCont").attr("currentPref");if(_588="userUpload"){$("#myComputer").removeAttr("purpose");$("#zohoAccounts").attr("purpose","iamUploadselected");}$("#user_Photo").attr("value","IAM");$("#allAvatarList").find("li.selected").removeClass("selected");$("#curr_UploadPhoto_Cont").find("div.profilePhoto").removeClass("profilePhoto").addClass("profilePhotoSelected");});$("#iamImageSize").show().siblings().hide();$("<div id=\"zohoAccountMess\" style=\"padding:50px;margin-left:50px;\"><p class=\"innerInfo tinyText\"><span>"+i18n["zohodiscussions.userpreference.uploadzohoAccountMess"]+"</span></p></div>").insertAfter($("#curr_UploadPhoto_Cont"));}else{if(_57d=="userUpload"){var _581=$("#uploadPhoto_Cont");var _589=_581.clone();_589.insertAfter($("#user_AvatarImage").find("ul")).show();_589.attr("id","uploadPhotoCont");_589.attr("purpose","uploadUserPhotoTemplate");_589.find("div[purpose=\"uploadPhotoContent\"]").wrap("<form action = \"/uploadCustomFile.do\" style=\"margin-left:230px;margin-top:-30px;margin-right:100px;\" target = \"fileUpdTgt_user\" method=\"post\" enctype=\"multipart/form-data\"></form>");_589.find(":input[type=\"file\"]").attr("name","imageFileName");_589.find("div.iFrameContainer").html("<iframe name = \"fileUpdTgt_user\"> </iframe>");_589.find("form").attr("target","fileUpdTgt_user");var _583=$("<input type = \"hidden\"  name=\"forumGroupId\" value=\""+forumGroupId+"\"/>");var _58a=$(" <input type=\"hidden\" value=\"uploadUserPhoto\" name=\"purpose\"/>");_583.insertAfter($("#uploadPhotoCont").find("div[purpose=\"uploadPhotoContent\"]"));_58a.insertAfter($("#uploadPhotoCont").find("div[purpose=\"uploadPhotoContent\"]"));_589.find(":file").change(function(){_589.find("[purpose=\"uploadPhotoLoadingCont\"]").show();_589.find("form").get(0).submit();});var _584=$("#myComputer").attr("purpose");var _585="profilePhoto";if(typeof _584!="undefined"){_585="profilePhotoSelected";}var _586=$("<div class=\""+_585+"\" imgpurpose=\"userUploadedPhotoSelected\"><img height=\"48\" width=\"48\" purpose=\"avat_Image\" src=\""+_57f+"\"/></div>");_586.insertBefore($("#uploadPhotoCont").find("form"));$("<div class=\"boldText\" style=\"margin-left:120px;margin-top:-45px;margin-right:100px;\">"+i18n["zohodiscussions.userpreference.changePhoto"]+":</div>").insertAfter($("#uploadPhotoCont").find("div[imgpurpose=\"userUploadedPhotoSelected\"]"));$("#uploadPhotoCont").find("div[imgpurpose=\"userUploadedPhotoSelected\"]").click(function(){var _58b=$("#preferenceInnerContent").find("form").attr("userUploadPhotoUrl");$("#uploadPhotoCont").find("div.profilePhoto").removeClass("profilePhoto").addClass("profilePhotoSelected");$("#userPreferencePhotoCont").find("img").attr("src",_58b);$("#user_Photo").attr("value","userUpload");$("#allAvatarList").find("li.selected").removeClass("selected");var _58c=$("#userPreferencePhotoCont").attr("currentPref");if(_58c="IAM"){$("#zohoAccounts").removeAttr("purpose");$("#myComputer").attr("purpose","userUploadselected");}});$("#customImageSize").show().siblings().hide();}}}function uploadUserPhoto(_58d,_58e){$("#curr_UploadPhoto_Cont").find("img[purpose=\"uploadPhotoLoadingCont\"]").remove();if(_58d=="failure"){showMessage(_58e+" ,Please try again.","failure");}else{$("#curr_UploadPhoto_Cont").find("input[name=\"uploadPhotoFile\"]").val("");var _58f=$("#preferenceInnerContent").find("form").attr("photoUrl");var src=_58f+"/file?t=user&width=48&height=48&ID="+ZUID+"&nocache=1";$("#curr_UploadPhoto_Cont").find("img[purpose=\"avat_Image\"]").attr("src",src);$("#userSelectedAvatarImage").attr("value",src);$("#userSelectedProfileImage").attr("value",src);$("#preferenceInnerContent").find("form").attr("userIAMphoto",src);$("#userPreferencePhotoCont").find("img").attr("src",src);$("#curr_UploadPhoto_Cont").find("div.profilePhoto").removeClass("profilePhoto").addClass("profilePhotoSelected");$("#user_Photo").attr("value","IAM");$("#allAvatarList").find("li.selected").removeClass("selected");showTipper(i18n["zohodiscussions.userpreference.uploadsuccessMess"],"success",1000);processHash("myArea/preference");}}function updateUserScreenName(attr){var _592=$(attr);var _593={};_593.forumGroupId=forumGroupId;_593.zuid=_592.find(":input[name=\"zuid\"]").val();var _594=$.trim(_592.find(":input[name=\"screenName\"]").val());var _595="";if(_594==""||_594==null){_595="zohodiscussions.myArea.screenNameEmpty";displayScreenMessage(attr,_595);return;}if(!_594.match("^[A-Za-z0-9. _]{4,50}$")){_595="zohodiscussions.myArea.screenNameValid";displayScreenMessage(attr,_595,"failure");return;}_592.find(":input[name=\"update\"]").attr("disabled","true");_592.find(":input[name=\"update\"]").attr("value",i18n["zohodiscussions.myArea.screenName.Update"]);_593.screenName=_594;_593[csrfParamName]=csrfToken;doAjaxAction("/updateScreenName.do",_593,function(data){var _597=eval(data);_595=_597.reason;displayScreenMessage(attr,_595,_597.result);if(_597.result=="success"){location.reload();}else{_592.find(":input[name=\"update\"]").removeAttr("disabled");_592.find(":input[name=\"update\"]").attr("value",i18n["zohodiscussions.buttons.save"]);}return;},function(err){_592.find(":input[name=\"update\"]").removeAttr("disabled");_592.find(":input[name=\"update\"]").attr("value",i18n["zohodiscussions.buttons.save"]);var _599=eval(err.responseText);displayScreenMessage(attr,_599.reason);});}function checkScreenNameAvailablity(attr){var _59b=$(attr);var _59c={};_59c.forumGroupId=forumGroupId;_59c.zuid=_59b.find(":input[name=\"zuid\"]").val();var _59d=$.trim(_59b.find(":input[name=\"screenName\"]").val());var _59e="";if(_59d==""||_59d==null){_59e="zohodiscussions.myArea.screenNameEmpty";displayScreenMessage(attr,_59e,"failure");return;}if(!_59d.match("^[A-Za-z0-9. _]{4,50}$")){_59e="zohodiscussions.myArea.screenNameValid";displayScreenMessage(attr,_59e,"failure");return;}_59c.screenName=_59d;_59c[csrfParamName]=csrfToken;doAjaxAction("/screenNameAvailablity.do",_59c,function(data){var _5a0=eval(data);_59e=_5a0.reason;displayScreenMessage(attr,_59e,_5a0.result);return;},function(err){_59b.find(":input[name=\"update\"]").removeAttr("disabled");_59b.find(":input[name=\"update\"]").attr("value",i18n["zohodiscussions.buttons.save"]);var _5a2=eval(err.responseText);displayScreenMessage(attr,_5a2.reason);});}function displayScreenMessage(attr,_5a4,_5a5){var _5a6=$(attr);var _5a7,_5a8;_5a4=i18n[_5a4];_5a7=_5a6.find("span[purpose=\"showMsg\"]");if(_5a5!="success"){_5a5="failure";_5a7.removeClass("screenGreenMarkText").addClass("redMarText");}else{_5a7.removeClass("redMarText").addClass("screenGreenMarkText");}_5a8=_5a6.find("a.greenLink");_5a8.hide();_5a7.show();_5a7.text(_5a4);return;}function updateUserPreference(){if($("#userAvatarList").is(":focus")){var _5a9=$("#imgContUl");var _5aa=_5a9.find("li.listAvatarSelected");var src=_5aa.find("img").attr("src");_5a9.find("input[name=\"avatar\"]").val(src);}var _5ac=$("#wikiUrl");var _5ad=$("#blogUrl");var _5ae=$("#webSite");var _5af=sanitizeURL($.trim(""+_5ac.val()));var _5b0=sanitizeURL($.trim(""+_5ad.val()));var _5b1=sanitizeURL($.trim(""+_5ae.val()));_5ac.val(_5af);_5ad.val(_5b0);_5ae.val(_5b1);var _5b2=$("#twitterLink");var _5b3=$("#facebookLink");var _5b4=$("#linkedinLink");var _5b5=sanitizeURL($.trim(""+_5b2.val()));var _5b6=sanitizeURL($.trim(""+_5b3.val()));var _5b7=sanitizeURL($.trim(""+_5b4.val()));_5b2.val(_5b5);_5b3.val(_5b6);_5b4.val(_5b7);doAjaxAction("/updateUserSetting.do",$("#preferenceInnerContent").find("form").serialize(),function(data){if(data=="SUCCESS"){showTipper(i18n["zohodiscussions.userpreference.userprofileupdated"],"success");var _5b9=$("#userSelectedAvatarImage").val();$("#topContainerPhoto").find("img").attr("src",_5b9);processHash("myArea/preference");}},function(err){var _5bb=eval(err.responseText);showMessage(_5bb.reason,"failure");});}function editDraftPost(_5bc){showLoadingImage();var _5bd=_5bc.attr("authorId");var _5be=_5bc.attr("forumTopicId");var _5bf={};_5bf.forumGroupId=forumGroupId;_5bf.forumTopicId=_5be;_5bf[csrfParamName]=csrfToken;_5bf.editMode="true";var _5c0=_5bc.attr("forumId");var _5c1=_5bc.attr("categoryId");if(_5bd==ZUID){_5bf.access="author";}doAjaxAction("/editDraft.do",_5bf,function(data){hideLoadingImage();document.title=i18n["zohodiscussions.writePost.documentTitle"]+" - "+forumGroupName;$("#mainContent").get(0).innerHTML=data;$("#SelectForum").val(_5c0);initWritePost();$("#SelectCategory").val(_5c1);},function(_5c3){var _5c4=eval(_5c3.responseText);showMessage(_5c4.reason,"failure");hideLoadingImage();});}function myJournalsDeletePost(_5c5,_5c6){var _5c7=_5c5.attr("authorId");var _5c8=_5c5.attr("action");var _5c9={};_5c9.forumGroupId=forumGroupId;_5c9.forumId=_5c5.attr("forumId");_5c9.categoryId=_5c5.attr("categoryId");_5c9.forumTopicId=_5c5.attr("forumTopicId");_5c9[csrfParamName]=csrfToken;if(_5c8=="/deleteForumResponse.do"){_5c9.responseId=_5c5.attr("responseId");}if(_5c7==ZUID){_5c9.access="author";}doAjaxAction(_5c8,_5c9,function(data){hideLoadingImage();if(_5c8=="/deleteForumResponse.do"){showTipper(i18n["zohodiscussions.myJournals.successfullyTopicDeleted"],"success");}else{showTipper(i18n["zohodiscussions.myJournals.successfullyResponseDeleted"],"success");}_5c5.parents("div.moderateSinglePost").hide();},function(err){var _5cc=eval(err.responseText);showMessage(_5cc.reason,"failure");hideLoadingImage();});}function myJournalsFilter(_5cd,_5ce){var _5cf=_5cd.attr("purpose");var _5d0=$("#"+_5ce+"InnerContent").find("div[status=\"show\"]");_5d0.attr("currFilterType",_5cd.text());_5d0.attr("filterType",_5cf);_5d0.find("div.moderateSinglePost").hide();var _5d1=-1;if(_5cf=="all"){$listOfTypes=_5d0.find("div.moderateSinglePost");$listOfTypes.each(function(_5d2,item){if(_5d2<postPerPage){$(item).show();}_5d1=_5d2;});}else{$listOfTypes=_5d0.find("div."+_5cf);$listOfTypes.each(function(_5d4,item){if(_5d4<postPerPage){$(item).show();}_5d1=_5d4;});}if(_5ce=="watchList"){_5ce="watchTopic";}if(postPerPage>_5d1||_5d1==-1){$("#"+_5ce+"Next").removeClass("navBtnEnabled").addClass("navBtnDisabled");}else{$("#"+_5ce+"Next").removeClass("navBtnDisabled").addClass("navBtnEnabled");}var _5d6=$("#"+_5ce+"Prev");_5d6.removeClass("navBtnEnabled").addClass("navBtnDisabled");_5d6.parent("ul").attr("fetchPage",1);if(_5d1==-1){$("#"+_5ce+"FilterEmptyMsg").show();$("#"+_5ce+"_Nav").hide();}else{$("#"+_5ce+"FilterEmptyMsg").hide();$("#"+_5ce+"_Nav").show();}}function myJournalsFilterAction(_5d7,_5d8){var _5d9=_5d7.parent();var _5da=_5d7.attr("purpose");var _5db=$("#"+_5d8+"InnerContent").find("div[status=\"show\"]");var _5dc=_5d7.text();_5db.attr("currFilterType",_5dc);var _5dd=$("#"+_5d8+"Tab").find("li.selected").attr("purpose");showLoadingImage();var _5de=_5d9.attr(_5dd+"Action");var _5df={};_5df.forumGroupId=forumGroupId;_5df.userId=_5d9.attr("userId");_5df.filterType=_5dc;_5df[csrfParamName]=csrfToken;doAjaxAction(_5de,_5df,function(data){hideLoadingImage();_5db.get(0).innerHTML=data;if(_5d8=="myJournals"){var _5e1=$("#"+_5d8+"SelectAction");_5e1.find("li[purpose=\"expandedView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.expandView"]+"</a>");_5e1.find("li[purpose=\"listView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.listView"]+"</span>");}},function(err){var _5e3=eval(err.responseText);showMessage(_5e3.reason,"failure");hideLoadingImage();});}function replyToPrivateMsg(_5e4){var _5e5=$("#newReplyPrivateMsgCont");if(_5e5.is(":visible")){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");return;}var type=_5e4.attr("postType");var _5e7=_5e4.attr("forumTopicId");var _5e8=$("#privateMsgCont_"+_5e7);var _5e9=$("#privateMsg"+type+"Container");var _5ea="reply";var _5eb="Write";var _5ec=_5e4.attr("toMember");var _5ed=_5e4.attr("purpose");var _5ee=-1;var _5ef="";if(type=="Sent"){$("#topicContent_"+_5e7).hide();}_5e8.show();if(_5ed=="editThisPM"){$("#PrivateMsgReply").hide();$("#PrivateMsgEdit").show();}else{$("#PrivateMsgReply").show();$("#PrivateMsgEdit").hide();}var _5f0=$("#replyPrivateMsgContent");_5e5=_5f0.clone();_5e5.attr("id","newReplyPrivateMsgCont");_5e5.find("#PrivateMsgReply").attr("id","newPrivateMsgReply");_5e5.find("#PrivateMsgEdit").attr("id","newPrivateMsgEdit");_5e5.find("#cancelPrivateReplyButton").attr("id","newcancelPrivateReplyButton");var _5ea="";var _5f1=_5e5.find("textarea[name=\"privateMsgContent\"]");var _5f2=_5e5.find("input[name=\"toMemberName\"]");var _5f3=_5e5.find("input[name=\"forumPostTitle\"]");var _5f4="";var _5f5=$("#privateMsg_"+_5e7).html();if(_5ed=="editThisPM"){_5ee=_5e4.attr("responseId");_5f2.parent().hide();_5f4=_5e4.attr("postTitle");_5f3.val(_5f4);_5ea="/editPrivateMsg.do";$("#privateMsg_"+_5e7).hide();}else{_5ef=_5e4.attr("toMemberName");_5f2.val(_5ef);_5f3.parent().hide();_5ea="/replyToPM.do";}_5f1.val(_5f5);_5e5.find("input[name=\"toMember\"]").val(_5ec);_5e5.find("input[name=\"forumTopicId\"]").val(_5e7);_5e5.find("input[name=\"responseId\"]").val(_5ee);_5e8.append(_5e5.show());$("#newPrivateMsgReply, #newPrivateMsgEdit").unbind("click").click(function(){if(_5ed=="editThisPM"){var _5f6=$.trim(_5f3.val());if(_5f6==""){showMessage(i18n["zohodiscussions.writePost.noTitleInPost"],"failure");return;}}var _5f7=$.trim(_5f1.val());if(_5f7==""){showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");return;}doAjaxAction(_5ea,_5e5.find("form").serialize(),function(data){showTipper(i18n["zohodiscussions.privateMsg.successfullyPMAdded"],"success");if(_5ed=="editThisPM"){$("#privateMsg_"+_5e7).html(_5f1.val());$("#topicContent_"+_5e7).html(_5f1.val());$("#editPrivateMsg_"+_5e7).attr("postTitle",_5f3.val());$("#privateMsgPostTitle_"+_5e7).html(_5f3.val());$("#newcancelPrivateReplyButton").trigger("click");}else{processHash("myArea/privateMsg");}},function(err,desc,_5fb){_5e5.find("div#writePMCaptcha").attr("id","newWritePMCaptcha");var _5fc=eval(err.responseText);if(_5fc.errorcode=="HIP_REQUIRED"){var _5fd=$("#newWritePMCaptcha");_5fd.find("input#captchaCodePM").attr("id","newCaptchaCodePM");_5fd.show();if(_5fd.attr("currCaptcha")=="new"){showMessage(i18n["zohodiscussions.writePost.captchaMsg"],"failure");}else{showMessage(i18n["zohodiscussions.writePost.captchaErrorMsg"],"failure");}_5fd.find("img[purpose=\"captchaImage\"]").replaceWith("<img purpose=captchaImage name=hipImg border=0 src=/showcaptcha?digest="+_5fc.reason+" align=absmiddle alt=HIP image>");$("#newCaptchaCodePM").attr("name",_5fc.reason);_5fd.attr("currCaptcha","old");_5fd.show();}else{showMessage(_5fc.reason,"failure");}hideLoadingImage();});});$("#newcancelPrivateReplyButton").click(function(){$("#privateMsgCont_"+_5e7).hide();_5e5.remove();if(_5ed=="editThisPM"){$("#privateMsg_"+_5e7).show();}});return false;}function addPrivateMsg(_5fe,_5ff,_600,type){showLoadingImage();if(type=="UserPM"){var _602=$("#privateMsgTab").find("li.selected");_602.attr("isthere","false");}var _603=$("#postContentTA");var _604="";if(_5ff&&_5ff=="Edit"){_604=_603.parent().find("input[name=\"forumPostTitle\"]").val();_604=_604.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_604==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noTitleInPost"],"failure");return;}}var _605=_603.data("editor").val();_605=_605.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_605==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");return;}_603.val(_605);var _606=(_5ff&&_5ff=="Edit")?"/editPrivateMsg.do":(type=="UserPM")?"/addPrivateMsg.do":"/replyToPM.do";doAjaxAction(_606,$("#editorHolder").serialize(),function(data){hideLoadingImage();showTipper(i18n["zohodiscussions.privateMsg.successfullyPMAdded"],"success");if(_5ff=="Edit"){var _608=$("#privateMsgCont_"+_5fe).parent("li");_608.find("a[purpose=\"postConversationTitle\"]").html(_604);$("#cancelResponse").trigger("click");}else{if(type=="UserPM"){var _609=$("#UserPM").attr("authorName");processHash("user/"+_609);}else{processHash("myArea/privateMsg");}}},function(err,desc,_60c){var _60d=eval(err.responseText);if(_60d.errorcode=="HIP_REQUIRED"){var _60e=$("#replyPMContActual").show().find("div[purpose=\"responseCaptcha\"]");_60e.find(":input").val("");if(_60e.attr("currCaptcha")=="new"){showMessage(i18n["zohodiscussions.writePost.captchaMsg"],"failure");}else{showMessage(i18n["zohodiscussions.writePost.captchaErrorMsg"],"failure");}_60e.find("img[purpose=\"captchaImage\"]").replaceWith("<img purpose=captchaImage name=hipImg border=0 src=/showcaptcha?digest="+_60d.reason+" align=absmiddle alt=HIP image>");_60e.find(":input").attr("name",_60d.reason);_60e.attr("currCaptcha","old");_60e.show();}else{showMessage(_60d.reason,"failure");}hideLoadingImage();});return false;}function deletePrivateMsg(_60f){var _610=_60f.attr("forumTopicId");var _611={};_611.forumGroupId=forumGroupId;_611.forumTopicId=_610;_611[csrfParamName]=csrfToken;doAjaxAction("/deletePM.do",_611,function(data){hideLoadingImage();showTipper(i18n["zohodiscussions.privateMsg.successfullyPMDeleted"],"success");var _613=$("#privateMsgTab").find("li.selected");if(_613.attr("purpose")=="inbox"){processHash("myArea/privateMsg");}else{_613.attr("isthere","false").trigger("click");}},function(err){var _615=eval(err.responseText);showMessage(_615.reason,"failure");hideLoadingImage();});}function privateConversation(_616){var _617=_616.attr("forumTopicId");var _618=$("#privateConversation_"+_617).html();var _619=$("#privateConversation");_619.show();$("#privateConversationCont").get(0).innerHTML=_618;$("#privateConversationClose").unbind("click").click(function(){_619.hide();return;});$("#morePrivateConversation").unbind("click").click(function(){_619.hide();showLoadingImage();openSinglePost(_617);return;});}function friendsTabClick(_61a){_61a.addClass("selected");showLoadingImage();var _61b=_61a.attr("purpose");var _61c=_61a.attr("action");var _61d={};_61d.forumGroupId=forumGroupId;doAjaxAction(_61c,_61d,function(data){hideLoadingImage();$("#friendsInnerCont").get(0).innerHTML=data;setPresenceInMyArea(dataOb,"friendsDetailsInnerContent");});}function myAreaAllTabClick(_61f,_620){var _621=$("#"+_620+"InnerContent");var _622=_621.find("div[status=\"show\"]");_61f.addClass("selected");var _623=_61f.attr("purpose");if(_623=="resources"){$("#myAreaInnerMainContent").find("div.contentActionsCont").hide();}else{$("#myAreaInnerMainContent").find("div.contentActionsCont").show();}var _624=_61f.attr("isthere");var _625=_621.find("div[purpose=\"author_"+_623+"\"]");_622.attr("status","hide").hide();if(_620=="authorProfile"){if(_623=="privateMsg"){$("#authorProfileContentAction").hide();}else{$("#authorProfileContentAction").show();}}if(_620=="watchList"){if(_623!="watchTopics"){$("#"+_620+"_Filter").parent().hide();}else{$("#"+_620+"_Filter").parent().show();}}if(_620=="myJournals"||_620=="privateMsg"||_620=="authorProfile"){var _626=$("#"+_620+"SelectAction");if(_624=="true"){if(_620=="myJournals"||_620=="authorProfile"){var _627=$("#"+_620+"_Filter");if(_623=="replies"||_623=="authorReplies"){_627.parent().hide();}else{_627.parent().show();var _628=_625.attr("currFilterType");_627.val(_628);}}_625.attr("status","show").show();if(_625.find("div.collapse").length>0){_626.find("li[purpose=\"expandedView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.expandView"]+"</a>");_626.find("li[purpose=\"listView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.listView"]+"</span>");}else{if(_625.find("div.expand").length>0){_626.find("li[purpose=\"expandedView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.expandView"]+"</span>");_626.find("li[purpose=\"listView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.listView"]+"</a>");}}if(_620=="privateMsg"){if(typeof WmsContacts!="undefined"&&ch=="true"){var _629=WmsContacts.getZohoContacts();setPresenceInMyArea(_629,"userChat_"+_623);}}return;}}else{if(_624=="true"){_625.attr("status","show").show();if(_620=="watchList"){if(typeof WmsContacts!="undefined"&&ch=="true"){var _629=WmsContacts.getZohoContacts();setPresenceInMyArea(_629,"userChat_"+_623);}}return;}}showLoadingImage();var _623=_61f.attr("purpose");var _62a=_61f.attr("action");var _62b={};if(_623!="privateMsg"){_62b.forumGroupId=forumGroupId;_62b[csrfParamName]=csrfToken;if(_620=="myJournals"||_620=="authorProfile"){_62b.userId=_61f.attr("userId");}}if(_620=="myJournals"){_62b.viewType="myself";}doAjaxAction(_62a,_62b,function(data){hideLoadingImage();var _62d;if(_620=="myJournals"||_620=="authorProfile"){_62d=$("<div purpose=author_"+_623+" status=show currFilterType=all></div>").html(data);var _62e=$("#"+_620+"_Filter");if(_623=="replies"||_623=="authorReplies"){_62e.parent().hide();}else{_62e.parent().show();_62e.val("All");}}else{_62d=$("<div purpose=author_"+_623+" status=show id=userChat_"+_623+"></div>").html(data);}hideLoadingImage();showAuthorPopout(_62d);_62d.insertAfter(_622);_61f.attr("isthere","true");if(_623=="drafts"||_623=="inbox"||_623=="sent"||_623=="authorTopics"){_626.find("li[purpose=\"expandedView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.expandView"]+"</a>");_626.find("li[purpose=\"listView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.listView"]+"</span>");}else{if(_623=="replies"||_623=="authorReplies"){_626.find("li[purpose=\"expandedView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.expandView"]+"</span>");_626.find("li[purpose=\"listView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.listView"]+"</a>");}}if(_620=="privateMsg"||_620=="watchList"){if(typeof WmsContacts!="undefined"&&ch=="true"){var _62f=WmsContacts.getZohoContacts();setPresenceInMyArea(_62f,"userChat_"+_623);}}},function(err){var _631=eval(err.responseText);showMessage(_631.reason,"failure");hideLoadingImage();});}function manageExpandOrCollapseType(_632,_633){var _634=_632.attr("purpose");if(_632.find("a").length<1){return;}var _635=$("#"+_633+"InnerContent");var _636=$("#"+_633+"SelectAction");var _637=_635.find("div[status=\"show\"]");if(_634=="expandedView"){_637.find("div.collapse").attr("class","expand");_637.find("div.expand div.bigPlusIcon").removeClass("bigPlusIcon").addClass("bigMinusIcon");_637.find("div.textContent").addClass("expandTextContent").show();_637.find("div.moderateSinglePost div.lowerButton").show();_636.find("li[purpose=\"expandedView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.expandView"]+"</span>");_636.find("li[purpose=\"listView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.listView"]+"</a>");}else{if(_634=="listView"){_637.find("div.expand").attr("class","collapse");_637.find("div.collapse div.bigMinusIcon").removeClass("bigMinusIcon").addClass("bigPlusIcon");_637.find("div.textContent").addClass("expandTextContent").hide();_637.find("div.moderateSinglePost div.lowerButton").hide();_636.find("li[purpose=\"expandedView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.expandView"]+"</a>");_636.find("li[purpose=\"listView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.listView"]+"</span>");}}return;}function manageCountValue(_638){var _639=$("#"+_638).find("li.selected");var _63a=_639.attr("count");_63a=--_63a;var _63b=_639.attr("purpose");if(_63b=="watchTopics"){_639.find("a").html(i18n["zohodiscussions.myJournals.topics"]+"("+_63a+")");}else{if(_63b=="authorReplies"){_639.find("a").html(i18n["zohodiscussions.general.replies"]+"("+_63a+")");}else{if(_63b=="watchUsers"){_639.find("a").html(i18n["zohodiscussions.watchList.users"]+"("+_63a+")");}else{if(_63b=="inbox"){_639.find("a").html(i18n["zohodiscussions.privateMsg.inbox"]+"("+_63a+")");}else{if(_63b=="sent"){_639.find("a").html(i18n["zohodiscussions.privateMsg.sent"]+"("+_63a+")");}}}}}_639.attr("count",_63a);}function fnPagination(_63c,_63d,_63e){showLoadingImage();var _63f=_63c.attr("action");var _640=_63c.attr("currType");var _641={};if(_63e=="true"){_640="authorProfile";}var _642=$("#"+_640+"InnerContent").find("div[status=\"show\"]");_641.forumGroupId=forumGroupId;if(_640!="privateMsg"){_641.userId=_63c.attr("userId");var _643=$("#"+_640+"Tab").find("li.selected").attr("purpose");if(_643=="topics"||_643=="drafts"||_643=="authorTopics"){_641.filterType=_642.attr("currfiltertype");}}if(_640=="myJournals"){_641.viewType="myself";}var _644=parseInt(_63c.attr("fetchPage"));if(_63d=="next"){_641.fetchPage=_644+1;}else{_641.fetchPage=_644-1;}_641.getPostFor=_63c.attr("getPostFor");doAjaxAction(_63f,_641,function(data){hideLoadingImage();_642.get(0).innerHTML=data;var _646=$("#"+_640+"Tab").find("li.selected").attr("purpose");var _647=$("#"+_640+"SelectAction");if(_646=="replies"){_647.find("li[purpose=\"expandedView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.expandView"]+"</span>");_647.find("li[purpose=\"listView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.listView"]+"</a>");}else{_647.find("li[purpose=\"expandedView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.expandView"]+"</a>");_647.find("li[purpose=\"listView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.listView"]+"</span>");}},function(err){var _649=eval(err.responseText);showMessage(_649.reason,"failure");hideLoadingImage();});}function fnPaginationProcess(_64a,type){var _64c=parseInt(_64a.attr("fetchPage"));var _64d=_64a.attr("currType");var _64e=_64a.attr("postCount");if(type=="next"){_64c=_64c+1;}else{_64c=_64c-1;}_64a.attr("fetchPage",_64c);var _64f=$("#current_"+_64d+"_List");var _650=(_64c*postPerPage);var _651=(_650-postPerPage)+1;var _652=_651;if(_64e<=_650){_650=_64e;_64a.find("li[purpose=\"next\"]").removeClass("navBtnEnabled").addClass("navBtnDisabled");}else{_64a.find("li[purpose=\"next\"]").removeClass("navBtnDisabled").addClass("navBtnEnabled");}if(_651==1){_64a.find("li[purpose=\"prev\"]").removeClass("navBtnEnabled").addClass("navBtnDisabled");}else{_64a.find("li[purpose=\"prev\"]").removeClass("navBtnDisabled").addClass("navBtnEnabled");}if(_64d=="recentActivity"){_64f.find("li").hide();for(_652;_652<=_650;_652++){$("#recentActivity_"+_652).show();}}else{_64f.find("div.moderateSinglePost").hide();var _653=_64d;if(_64d=="watchTopic"){_64d="watchList";}var _654=$("#"+_64d+"InnerContent").find("div[status=\"show\"]").attr("filterType");if((_64d=="watchList"||_64d=="bookMark")&&_654!="all"){var _655;$listOfTypes=_64f.find("."+_654);_652--;$listOfTypes.each(function(_656,item){if(_656<_650&&_652<=_656){$(item).show();}_655=_656;});}else{for(_652;_652<=_650;_652++){_64f.find("div.moderateSinglePost[listStage=\""+_653+"_"+_652+"\"]").show();}}}}function getAuthorProfile(_658){showLoadingImage();var _659=$("#userProfileMainContainer");if(_659.length>0&&_659.is("[shouldReload=\"false\"]")){_659.show().attr("shouldReload","true").siblings().remove();hideLoadingImage();}else{var _65a={};_65a.forumGroupId=forumGroupId;_65a.authorName=_658;_65a[csrfParamName]=csrfToken;_65a.ch=ch;doAjaxAction("/getAuthorProfile.do",_65a,function(data){hideLoadingImage();$("#authorPopout:visible").hide();$("#mainContent").get(0).innerHTML=data;$.history.add("User/"+_658);bindAuthorProfileActions(_658);},function(err){var _65d=eval(err.responseText);showMessage(_65d.reason,"failure");hideLoadingImage();});}}function bindAuthorProfileActions(_65e){$("#mainContent").unbind("click",processAuthorProfileClick).click(processAuthorProfileClick);$("#mainContent").unbind("click",processAllMyAreaMainClick).click(processAllMyAreaMainClick);$("#mainContent").unbind("click",processAllActionClick).click(processAllActionClick);allFilterOption("authorProfile");var _65f=$("#mainContent > #userProfileMainContainer").attr("authorId");$("#authorPopout_"+_65f).hide();if(typeof WmsContacts!="undefined"&&ch=="true"){var _660=WmsContacts.status(_65f);if(_660===false){_660=9;}manageUserChatStatus("userOnlineStatus_"+_65f,_660);}initialiseUserActivityChart();}function processAuthorProfileClick(_661){var _662=$(_661.target);var _663=_662.parent();if($("#loadingImg").is(":visible")){return;}else{if(_663.is("li[purpose=\"sendPM\"]")){addPrivateMessage(_663);}else{if(_663.is("li[purpose=\"watchItem\"]")){watchItem(_663);}else{if(_663.is("li[purpose=\"addAsFriend\"]")){addAsFriend(_663);}else{if(_663.is("li[purpose=\"blockUser\"]")){blockUser(_663);}else{if(_663.is("li[purpose=\"unBlockUser\"]")){unBlockUser(_663);}else{if(_663.is("li[purpose=\"moderateUser\"]")){moderateUser();}else{if(_663.is("li[purpose=\"assignLabel\"]")){bindUserLabelsAction();}}}}}}}}}function writePrivateMsg(){var _664=$("#sentPrivateMsg");var _665=$("#editorContainer_PM");if(_665.data("inEditMode")){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"failure");return false;}_664.show();openEditor($("#editPM"),"privateMsgContent","postContentTA","UserPM","Write","editorContainer_PM");_665.data("inEditMode",true);}function watchItem(_666){showLoadingImage();var _667=_666.attr("itemType");var _668={};_668.forumGroupId=forumGroupId;_668.itemType=_667;_668.itemId=_666.attr("itemId");_668[csrfParamName]=csrfToken;doAjaxAction("/watchItem.do",_668,function(data){hideLoadingImage();var msg=(_667=="0")?"zohodiscussions.watchList.successfullyWatchTopic":"zohodiscussions.watchList.successfullyWatchUser";showTipper(i18n[msg],"success");_666.attr("purpose","unWatchItem");_666.find("a").html(i18n["zohodiscussions.userProfile.unwatchUser"]);},function(err){var _66c=eval(err.responseText);showMessage(_66c.reason,"failure");hideLoadingImage();});}function unWatchItem(_66d,type){showLoadingImage();var type=_66d.attr("unWatchType");var _66f=_66d.attr("itemId");var _670={};_670.forumGroupId=forumGroupId;_670.itemId=_66f;_670[csrfParamName]=csrfToken;doAjaxAction("/unWatch.do",_670,function(data){hideLoadingImage();if(type=="authorProfile"){showTipper(i18n["zohodiscussions.watchList.successfullyUnwatchUser"],"success");_66d.attr("purpose","watchItem");_66d.find("a").html(i18n["zohodiscussions.userProfile.watchUser"]);}else{if(type=="following"){showTipper(i18n["zohodiscussions.watchList.successfullyUnwatchUser"],"success");$("#watch_"+_66f).parents("li").remove();}else{showTipper(i18n["zohodiscussions.watchList.successfullyUnwatchTopic"],"success");_66d.parents("div#watch_"+_66f).remove();manageCountValue("watchListTabs");}}},function(err){var _673=eval(err.responseText);showMessage(_673.reason,"failure");hideLoadingImage();});}function addAsFriend(_674){showLoadingImage();var _675=_674.attr("successMsg");var _676={};_676.forumGroupId=forumGroupId;_676.userId=_674.attr("userId");_676[csrfParamName]=csrfToken;doAjaxAction("/addAsFriend.do",_676,function(data){hideLoadingImage();if(data=="SUCCESS"){_674.attr("purpose","friendWaitingApproval");$("#addAsFriendLink").attr("style","cursor:default;text-decoration:none;").html(i18n["zohodiscussions.friends.awaitingApproval"]).siblings("div.imgAddFriend").removeClass("imgAddFriend").addClass("imgWaitingFriend");showTipper(_675,"success");}},function(err){var _679=eval(err.responseText);showMessage(_679.reason,"failure");hideLoadingImage();});}function confirmFriendRequest(_67a){showLoadingImage();var _67b=_67a.attr("userId");var _67c=_67a.attr("successMsg");var _67d={};_67d.forumGroupId=forumGroupId;_67d.userId=_67b;_67d[csrfParamName]=csrfToken;doAjaxAction("/confirmFriendRequest.do",_67d,function(data){hideLoadingImage();showTipper(_67c,"info");var _67f=$("#friendId_"+_67b);if(_67f.length>0){var _680=_67f.siblings("div.moderateSinglePost");_67f.fadeOut().remove();$("#friendsDetailsTabs li.selected span[purpose=\"friendsCount\"]").html(_680.length);var _681=$("#friendsDetailsTabs li span[mainPurpose=\"approvedFriends\"]").text();_681=parseInt(_681);_681++;$("#friendsDetailsTabs li span[mainPurpose=\"approvedFriends\"]").html(_681);}else{location.reload();}},function(err){var _683=eval(err.responseText);showMessage(_683.reason,"failure");hideLoadingImage();});}function removeFriend(_684){var _685=_684.attr("confirmMsg");if(confirm(_685)){showLoadingImage();var _686=_684.attr("userId");var _687=_684.attr("successMsg");var _688={};_688.forumGroupId=forumGroupId;_688.userId=_686;_688[csrfParamName]=csrfToken;doAjaxAction("/removeFriend.do",_688,function(data){hideLoadingImage();showTipper(_687,"info");var _68a=$("#friendId_"+_686);if(_68a.length>0){var _68b=_68a.siblings("div.moderateSinglePost");_68a.fadeOut().remove();$("#friendsDetailsTabs li.selected span[purpose=\"friendsCount\"]").html(_68b.length);}else{location.reload();}},function(err){var _68d=eval(err.responseText);showMessage(_68d.reason,"failure");hideLoadingImage();});}}function blockUser(_68e){showLoadingImage();var _68f={};_68f.forumGroupId=forumGroupId;_68f.authorId=_68e.attr("authorId");_68f[csrfParamName]=csrfToken;doAjaxAction("/blockUser.do",_68f,function(data){hideLoadingImage();showTipper(i18n["zohodiscussions.userProfile.successfullyBlockUser"],"success");_68e.attr("purpose","unBlockUser");_68e.find("a").html(i18n["zohodiscussions.userProfile.unblockUser"]);},function(err){var _692=eval(err.responseText);showMessage(_692.reason,"failure");hideLoadingImage();});}function unBlockUser(_693){showLoadingImage();var _694={};_694.forumGroupId=forumGroupId;_694.authorId=_693.attr("authorId");_694[csrfParamName]=csrfToken;doAjaxAction("/unBlockUser.do",_694,function(data){hideLoadingImage();showTipper(i18n["zohodiscussions.userProfile.successfullyUnBlockUser"],"success");_693.attr("purpose","blockUser");_693.find("a").html(i18n["zohodiscussions.userProfile.blockUser"]);},function(err){var _697=eval(err.responseText);showMessage(_697.reason,"failure");hideLoadingImage();});}function moderateUser(){$("#moderateUserTemplate").html($("#dimDivModerateUser").html());$("#dimDivModerateUser").html("");$("#moderateUserTemplate").show();var _698=$("#eachForumListForModeration").find(":input[name='forumLevelModeration']");var _699=$("#moderateUserPopOutForm").find(":input[name='portalLevelModeration']");if(_698.length==0){$("#forumLabel").hide();}if(_699.attr("checked")){_698.attr("disabled",true);}$("#imgCancel").click(function(){$this=$(this);$("#dimDivModerateUser").html($("#moderateUserTemplate").html());$("#moderateUserTemplate").hide();$("#moderateUserTemplate").html("");var _69a=$("#moderateUserCont");if(_69a.attr("status")=="changed"){var _69b=$("#userProfileMainContainer");_69b.show().attr("shouldReload","true");getAuthorProfile($this.attr("authorName"));}});_699.click(function(){$this=$(this);if($this.attr("checked")){_698.attr("disabled",true);}else{_698.attr("disabled",false);}moderateUserAction($this);});_698.click(function(){$this=$(this);moderateUserAction($this);});}function moderateUserAction(_69c){var _69d=$("#moderateUserCont");_69d.attr("status","changed");var _69e=_69c.attr("authorId");var _69f=_69c.attr("userName");var _6a0=_69c.attr("moderationStatus");var _6a1=_69c.attr("isAdmin");var _6a2=_69c.attr("isPortal");var _6a3=0;var _6a4=false;var _6a5="";var _6a6="";var _6a7={};_6a7.authorId=_69e;_6a7.forumGroupId=forumGroupId;_6a7[csrfParamName]=csrfToken;_6a7.adminUser=_6a1;if(_6a2){_6a7.moderateType=1;if(_6a0=="unmoderated"){_6a5=i18n["zohodiscussions.userProfile.moderateUserConfirmMess"]+" "+_69f+" "+i18n["zohodiscussions.userProfile.moderateUserPortalLevel"];_6a6=i18n["zohodiscussions.userProfile.usermoderatedSuccessMess"];}else{_6a5=i18n["zohodiscussions.userProfile.unmoderateUserConfirmMess"]+" "+_69f+" "+i18n["zohodiscussions.userProfile.moderateUserPortalLevel"];_6a6=i18n["zohodiscussions.userProfile.userUnmoderatedSuccessMess"];}}else{_6a7.moderateType=0;var _6a8=_69c.attr("forumId");_6a7.forumId=_6a8;var _6a9=_69c.attr("forumName");if(_6a0=="unmoderated"){_6a5=i18n["zohodiscussions.userProfile.moderateUserConfirmMess"]+" "+_69f+" "+i18n["zohodiscussions.general.in"]+" "+_6a9+" "+i18n["zohodiscussions.userProfile.moderateUserForumLevel"];_6a6=" "+i18n["zohodiscussions.userProfile.usermoderatedSuccessMess"];}else{_6a5=i18n["zohodiscussions.userProfile.unmoderateUserConfirmMess"]+" "+_69f+" "+i18n["zohodiscussions.general.in"]+" "+_6a9+" "+i18n["zohodiscussions.userProfile.moderateUserForumLevel"];_6a6=i18n["zohodiscussions.userProfile.userUnmoderatedSuccessMess"];}}if(_6a0=="unmoderated"){if(confirm(_6a5)){doAjaxAction("/moderateUser.do",_6a7,function(data){if(data=="SUCCESS"){showTipper(_69f+" "+_6a6,"success",1000);_69c.attr("moderationStatus","moderated");if(!_6a2){$("#itemListCont_"+_6a8).find("span.italicText").html(i18n["zohodiscussions.moderationLeftContainer.moderated"]);}}else{showMessage(i18n["zohodiscussions.moderationAction.errormessage"],"failure");}});}else{var _69d=$("#moderateUserCont");_69d.attr("status","");if(_6a2){$("#moderateUserPopOutForm").find(":input[isPortal='true']").attr("checked",false);$("#eachForumListForModeration").find(":input[name='forumLevelModeration']").attr("disabled",false);}else{$("#moderateUserPopOutForm").find(":input[forumId='"+_6a8+"']").attr("checked",false);}}}else{if(confirm(_6a5)){doAjaxAction("/unModerateUser.do",_6a7,function(data){if(data=="SUCCESS"){showTipper(_69f+" "+_6a6,"success",1000);_69c.attr("moderationStatus","unmoderated");if(!_6a2){$("#itemListCont_"+_6a8).find("span.italicText").html(i18n["zohodiscussions.ModerateUsers.ModerateUsers"]);}}else{showMessage(i18n["zohodiscussions.moderationAction.errormessage"],"failure");}});}else{var _69d=$("#moderateUserCont");_69d.attr("status","");if(_6a2){$("#moderateUserPopOutForm").find(":input[isPortal='true']").attr("checked",true);$("#eachForumListForModeration").find(":input[name='forumLevelModeration']").attr("disabled",true);}else{$("#moderateUserPopOutForm").find(":input[forumId='"+_6a8+"']").attr("checked",true);}}}}function bindUserLabelsAction(){$("#userLabelsTemplate").html($("#dimDivUserLabels").html());$("#dimDivUserLabels").html("");$("#userLabelsTemplate").show();$("#closeUserLabelsDialog").click(function(){$("#dimDivUserLabels").html($("#userLabelsTemplate").html());$("#userLabelsTemplate").hide();$("#userLabelsTemplate").html("");});$("#userLabelsCont select[purpose=\"userLabelBox\"]").change(function(){var _6ac=$(this);var _6ad=_6ac.attr("forumId");var _6ae=_6ac.attr("userId");var _6af=_6ac.val();var _6b0={};_6b0.forumGroupId=forumGroupId;_6b0.forumId=_6ac.attr("forumId");_6b0.userId=_6ac.attr("userId");_6b0.labelId=_6ac.val();_6b0[csrfParamName]=csrfToken;doAjaxAction("/mapLabelToUser.do",_6b0,function(data){if(data=="SUCCESS"){_6ac.find("option[selected]").removeAttr("selected");var _6b2=_6ac.find("option[value='"+_6af+"']");var _6b3=_6b2.text();_6b2.replaceWith("<option value='"+_6af+"' selected>"+_6b3+"</option>");if(_6af=="-1"){showTipper(i18n["zohodiscussions.UserDetails.labelRemovedMsg"],"info");}else{showTipper(i18n["zohodiscussions.UserDetails.labelAddedMsg"],"success");}}});});}function setPresenceInTopicList(dObj,_6b5){if(!dObj){return;}var _6b6="";if(!_6b5){if($("#topicList").length>0){_6b6=$("#topicList > div.ndtopicsItemsContainer > div.ndwrapperIn > ul.ndtopicsList > li.ndsingleList > div.ndhideOverflow > p.ndPostMeta > img.authorChatPresence");}else{_6b6=$("#topicsList > div.ndtopicsItemsContainer > div.ndwrapperIn > ul.ndtopicsList > li.ndsingleList > div.ndhideOverflow > p.ndPostMeta > img.authorChatPresence");}$stickyPostAuthors=$("#recentStickyPosts >li  >div.ashColorText >div.authorChatPresence");$announcementPostAuthors=$("#recentAnnouncementPosts >li  >div.ashColorText >div.authorChatPresence");_6b6.each(function(_6b7,item){var _6b9=$(item);var _6ba=_6b9.attr("authorId");if(_6ba==ZUID){return;}var _6bb=_6b9.attr("userChatId");var _6bc="";_6bc=$("#uc_"+_6bb+"_"+_6ba);try{var _6bd=dObj[_6ba]["STATUS"];manageUserChatStatusInTopicList(_6bc,_6bd,"topicList");}catch(ex){}});$stickyPostAuthors.each(function(_6be,item){var _6c0=$(item);var _6c1=_6c0.attr("authorId");if(_6c1==ZUID){return;}try{var _6c2=dObj[_6c1]["STATUS"];manageUserChatStatusInTopicList(_6c0,_6c2);}catch(ex){}});$announcementPostAuthors.each(function(_6c3,item){var _6c5=$(item);var _6c6=_6c5.attr("authorId");if(_6c6==ZUID){return;}try{var _6c7=dObj[_6c6]["STATUS"];manageUserChatStatusInTopicList(_6c5,_6c7);}catch(ex){}});}else{_6b6=$("#SinglePostContainer_"+_6b5+" div.sppostAuthor div.authorChatPresence");_6b6.each(function(_6c8,item){var _6ca=$(item);var _6cb=_6ca.attr("authorId");if(_6cb==ZUID){return;}var _6cc=_6ca.attr("responseId");var _6cd="";_6cd=$("#uc_"+_6b5+"_"+_6cc+"_"+_6cb+",#ucReply_"+_6b5+"_"+_6cc+"_"+_6cb);try{var _6ce=dObj[_6cb]["STATUS"];manageUserChatStatusInTopicList(_6cd,_6ce,"IS_SINGLE_POST");}catch(ex){}});}}function setPresenceInMyArea(dObj,_6d0){if(!dObj){return;}var _6d1="";if(_6d0=="current_recentActivity_List"){_6d1=$("#"+_6d0+" >li >div.authorChatPresence");}else{if(_6d0=="userChat_inbox"||_6d0=="userChat_sent"){_6d1=$("#"+_6d0+" div.moderateSinglePost ul li img.authorChatPresence");}else{_6d1=$("#"+_6d0+" div.moderateSinglePost ul li div.authorChatPresence");}}_6d1.each(function(_6d2,item){var _6d4=$(item);var _6d5=_6d4.attr("authorId");if(_6d5==ZUID){return;}try{var _6d6=dObj[_6d5]["STATUS"];manageUserChatStatusInTopicList(_6d4,_6d6);}catch(ex){}});}function setPresence(dObj,_6d8){if(!dObj){return;}var _6d9=$("#"+_6d8+" > li > div.userChatPresence");_6d9.each(function(_6da,item){var _6dc=$(item);var _6dd=_6dc.attr("authorId");if(_6dd==ZUID){return;}var _6de=_6dc.attr("id");try{var _6df=dObj[_6dd]["STATUS"];manageUserChatStatus(_6de,_6df);}catch(ex){}});}function manageUserChatStatus(_6e0,_6e1){var _6e2=$("#"+_6e0);var _6e3=_6e2.attr("authorName");if(_6e1=="4"){_6e2.find("div").attr("class","wms-4 chatOverride flLeft").unbind("click",chatInvoker).click(chatInvoker);_6e2.find("a").html(i18n["zohodiscussions.chat.idleForChat"]);_6e2.attr("title",_6e3+" "+i18n["zohodiscussions.chat.isNowIdle"]).unbind("click",chatInvoker).click(chatInvoker);}else{if(_6e1=="3"){_6e2.find("div").attr("class","wms-3 chatOverride flLeft").unbind("click",chatInvoker).click(chatInvoker);_6e2.find("a").html(i18n["zohodiscussions.chat.busyforchat"]);_6e2.attr("title",_6e3+" "+i18n["zohodiscussions.chat.isBusyToChat"]).unbind("click",chatInvoker).click(chatInvoker);}else{if(_6e1=="1"){_6e2.find("div").attr("class","wms-1 chatOverride flLeft");_6e2.find("a").html(i18n["zohodiscussions.chat.availableforchatmessage"]);_6e2.attr("title",_6e3+" "+i18n["zohodiscussions.chat.isAvailableToChat"]).unbind("click",chatInvoker).click(chatInvoker);}else{if(_6e1=="0"){_6e2.find("div").attr("class","wms-0 chatOverride flLeft");_6e2.find("a").html(i18n["zohodiscussions.chat.offlineforchat"]).unbind("click",chatInvoker).click(chatInvoker);_6e2.attr("title",i18n["zohodiscussions.chat.offlineforchat"]).unbind("click",chatInvoker).click(chatInvoker);}else{if(_6e1=="-1"){_6e2.find("div").attr("class","imgAddContact flLeft");_6e2.find("a").html(i18n["zohodiscussions.chat.invitedforchat"]);_6e2.attr("title",i18n["zohodiscussions.chat.youHaveInvited"]+" "+_6e3+" "+i18n["zohodiscussions.chat.toChat"]).unbind("click",chatInvoker);}else{if(_6e1=="-3"){_6e2.find("div").attr("class","imgAddContact flLeft");_6e2.find("a").html(i18n["zohodiscussions.chat.acceptinvitationforchat"]);_6e2.attr("title",_6e3+" "+i18n["zohodiscussions.chat.youHaveInvited"]).unbind("click",chatInvoker);}}}}}}_6e2.find("div").unbind("click",chatInvoker).click(chatInvoker);_6e2.find("a").unbind("click",chatInvoker).click(chatInvoker);}function manageUserChatStatusInTopicList(_6e4,_6e5,_6e6){var flag=0;if(_6e5=="4"){flag=1;_6e4.attr("class","wms-4 flLeft").unbind("click",chatInvoker).click(chatInvoker);if(_6e6=="IS_SINGLE_POST"){_6e4.find("div[purpose=\"chatStatus\"]").html(i18n["zohodiscussions.chat.busy"]);}}else{if(_6e5=="3"){flag=1;_6e4.attr("class","wms-3 flLeft").unbind("click",chatInvoker).click(chatInvoker);if(_6e6=="IS_SINGLE_POST"){_6e4.find("div[purpose=\"chatStatus\"]").html(i18n["zohodiscussions.chat.idle"]);}}else{if(_6e5=="1"){flag=1;_6e4.attr("class","wms-1 flLeft").unbind("click",chatInvoker).click(chatInvoker);if(_6e6=="IS_SINGLE_POST"){_6e4.find("div[purpose=\"chatStatus\"]").html(i18n["zohodiscussions.chat.available"]);}}else{if(_6e5=="0"){flag=1;_6e4.attr("class","wms-0 flLeft").unbind("click",chatInvoker).click(chatInvoker);if(_6e6=="IS_SINGLE_POST"){_6e4.find("div[purpose=\"chatStatus\"]").html(i18n["zohodiscussions.chat.offline"]);}}else{if(_6e5=="-4"){_6e4.attr("class","flLeft").unbind("click",chatInvoker);}else{if(_6e5=="-5"){_6e4.attr("class","flLeft").unbind("click",chatInvoker);}}}}}}if(_6e6=="topicList"){if(flag==1){_6e4.addClass("authorChatPresence chatStyleOverride");}else{_6e4.remove();}}else{_6e4.addClass("authorChatPresence chatOverride");}}function chatInvoker(){var _6e8=$(this);var name=_6e8.attr("authorName");var _6ea=_6e8.attr("authorId");if(_6ea==undefined){_6ea=_6e8.parent().attr("authorId");name=_6e8.parent().attr("authorName");}var _6eb=WmsContacts.status(_6ea);if(_6eb>-1&&_6eb!==false){WebMessanger.chat(_6ea);return;}if(_6eb==-1){if(confirm(name+" "+i18n["zohodiscussions.chat.reminder"])){WmsContacts.add("zoho",name,ZUID);}}else{if(_6eb==-3){WmsContacts.accept("zoho",name,ZUID);}else{WmsContacts.add("zoho",name,ZUID);}}}function updatePresence(usid,_6ed,_6ee){if(ch!="true"){return;}if($("#recentStickyPosts").is(":visible")){var _6ef=$("#recentStickyPosts >li >div.ashColorText >div.authorChatPresence");_6ef.each(function(_6f0,item){var _6f2=$(item);var _6f3=_6f2.attr("authorId");if(_6f3==usid){manageUserChatStatusInTopicList(_6f2,_6ee);}});}if($("#recentAnnouncementPosts").is(":visible")){var _6ef=$("#recentAnnouncementPosts >li >div.ashColorText >div.authorChatPresence");_6ef.each(function(_6f4,item){var _6f6=$(item);var _6f7=_6f6.attr("authorId");if(_6f7==usid){manageUserChatStatusInTopicList(_6f6,_6ee);}});}if($("#topicListMainContainer").is(":visible")){var _6f8=eval("("+$("#uListForStatusUpdate").html()+")");var zuid="z"+usid;if(typeof _6f8[zuid]!="undefined"){for(i=0;i<_6f8[zuid].length;i++){var _6fa=$("#uc_"+_6f8[zuid][i]+"_"+usid);manageUserChatStatusInTopicList(_6fa,_6ee,"topicList");}}if($("#singleForumHeaderView").is(":visible")){var _6fb=$("#singleForumHeaderView").attr("forumId");manageUserChatStatus("moderatorOnlineStatus_"+_6fb+"_"+usid,_6ee);}}else{if($("#SinglePostContainer").is(":visible")){var _6fc=$("#SinglePostContainer").attr("forumTopicId");var _6f8=eval("("+$("#uListForStatusUpdateInSP").html()+")");var zuid="z"+usid;if(typeof _6f8[zuid]!="undefined"){for(i=0;i<_6f8[zuid].length;i++){var _6fa=$("#uc_"+_6fc+"_"+_6f8[zuid][i]+"_"+usid);manageUserChatStatusInTopicList(_6fa,_6ee,"IS_SINGLE_POST");}}}else{if($("#userProfileMainContainer").is(":visible")){manageUserChatStatus("userOnlineStatus_"+usid,_6ee);}else{if($("#myAreaInnerMainContent").is(":visible")){if($("#profileDetailCont").is(":visible")){manageUserChatStatus("followersOnlineStatus_"+usid,_6ee);manageUserChatStatus("followingOnlineStatus_"+usid,_6ee);var _6fd=$("#current_recentActivity_List >li >div.authorChatPresence");_6fd.each(function(_6fe,item){var _700=$(item);var _701=_700.attr("authorId");if(_701==usid){manageUserChatStatusInTopicList(_700,_6ee);}});}else{var _702="";if($("#watchListInnerContent").is(":visible")){var _703=$("#watchListInnerContent").find("div[status=\"show\"]");_702=_703.attr("id");}else{if($("#privateMsgInnerContentent").is(":visible")){var _703=$("#privateMsgInnerContent").find("div[status=\"show\"]");_702=_703.attr("id");}}if(_702!=""){var _6fd="";if(_702=="privateMsgInnerContent"){_6fd=$("#"+_702+" div.moderateSinglePost ul li img.authorChatPresence");}else{_6fd=$("#"+_702+" div.moderateSinglePost ul li div.authorChatPresence");}_6fd.each(function(_704,item){var _706=$(item);var _707=_706.attr("authorId");if(_707==usid){manageUserChatStatusInTopicList(_706,_6ee);}});}}manageUserChatStatus("authorPopup_"+usid,_6ee);}}}}}function addPrivateMessage(_708){var _709=_708.attr("toMember");var _70a=_708.attr("authorname");var _70b=$("#privateMsgPrompt");var _70c=$("#privateMsgToMemberArea");var _70d=$("#privateMsgTitleArea");var _70e=$("#privateMsgContentArea");var _70f=$("#privateMsgToMemberId");_70f.val("");_70c.val("");_70d.val("");_70e.val("");_70f.val(_709);_70c.val(_70a);_70b.show().parent().show();$("#cancelPrivateMsgButton, #cancelPrivateMsg").unbind("click").click(function(){_70c.val("");_70d.val("");_70e.val("");var _710=$("#writePMCaptcha");_710.find("img").attr("src","/images/spacer.gif");_710.find(":input").val("");_710.hide();_70b.hide().parent().hide();});$("#addNewPrivateMsg").unbind("click").click(function(){showLoadingImage();var _711=_70e.val();_711=_711.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_711==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");return;}var _712=_70d.val();_712=_712.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_712==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noTitleInPost"],"failure");return;}doAjaxAction("/addPrivateMsg.do",_70b.find("form").serialize(),function(data){var _714=$("#writePMCaptcha");_714.find("img").attr("src","/images/spacer.gif");_714.find(":input").val("");_714.hide();hideLoadingImage();if(data=="SUCCESS"){showTipper(i18n["zohodiscussions.privateMsg.successfullyPMAdded"],"success");}else{var _715=eval(data);showMessage(_715.reason,"failure");hideLoadingImage();}_70b.hide().parent().hide();},function(err){var _717=eval(err.responseText);if(_717.errorcode=="HIP_REQUIRED"){var _718=$("#writePMCaptcha");if(_718.attr("currCaptcha")=="new"){showMessage(i18n["zohodiscussions.writePost.captchaMsg"],"failure");}else{showMessage(i18n["zohodiscussions.writePost.captchaErrorMsg"],"failure");}_718.find("img[purpose=\"captchaImage\"]").replaceWith("<img purpose=captchaImage name=hipImg border=0 src=/showcaptcha?digest="+_717.reason+" align=absmiddle alt=HIP image>");$("#captchaCodePM").attr("name",_717.reason);_718.attr("currCaptcha","old");_718.show();}else{showMessage(_717.reason,"failure");}hideLoadingImage();});});_70d.focus();}function Collaboration(){}Collaboration.handleUserList=function(chid,list){};Collaboration.handleMessage=function(chid,_71c,zuid,_71e,msg){};Collaboration.handlePresence=function(chid,_721,zuid,_723,_724){};Collaboration.join=function(chid){WebMessanger.joinCollab(chid);};Collaboration.quit=function(chid){WebMessanger.quit(chid);};Collaboration.serverup=function(){};Collaboration.serverdown=function(){};Collaboration.handleZohoMessage=function(prd,msg,url,_72a,_72b,_72c,att,_72e,id,_730,orgs,_732){if(prd=="FM"){setTimeout(function(){showBubble(msg,_72b);},2);return true;}else{return false;}};Collaboration.handleCustomMessage=function(msg){};Collaboration.handleCrossProductMessage=function(prd,msg){};Collaboration.onConnect=function(){};Collaboration.openURL=function(url,_737,_738,prd){return true;};Collaboration.handleCollabAdd=function(_73a,_73b,zuid,time,chid){};Collaboration.handleCollabDelete=function(_73f,_740,zuid,time,chid){};Collaboration.handleUserAdd=function(chid,_745){};Collaboration.handleUserDeleted=function(chid,_747){};Collaboration.handleIsOnline=function(_748){updateStatus(_748);};Collaboration.handleLogout=function(_749){setTimeout(function(){$.get("/cleardomain.do","",function(){window.location.href=window.location.href;});},5);};Collaboration.goOffline=function(){};Collaboration.handleChatNotifyMessage=function(chid,_74b,_74c){};Collaboration.getPageTitle=function(){return false;};Collaboration.handleWmsDisable=function(_74d){setTimeout(function(){$.get("/cleardomain.do","",function(){window.location.href=window.location.href;});},5);};Collaboration.handleServiceMessage=function(_74e){};Collaboration.handleComposeMail=function(_74f,_750){return false;};Collaboration.handleLanguageChange=function(_751){};function WmsContactImpl(){}WmsContactImpl.handlePresence=function(zuid,_753,_754,_755,_756){setTimeout(function(){updatePresence(zuid,_753,_755);},2);};WmsContactImpl.handleAddressBook=function(){};WmsContactImpl.handleInvite=function(zuid,_758,_759){};WmsContactImpl.notifyInvite=function(zuid,_75b,_75c){};WmsContactImpl.handleAccept=function(zuid,_75e,_75f,_760,_761){};WmsContactImpl.notifyAccept=function(zuid,_763,_764,_765,_766){};WmsContactImpl.handleReject=function(zuid,_768,_769){};WmsContactImpl.notifyRemove=function(zuid,_76b,_76c){};WmsContactImpl.handleDelete=function(zuid,_76e,_76f){};WmsContactImpl.handleContactUpdated=function(){};WmsContactImpl.handleStatusMessage=function(_770,_771){};WmsContactImpl.handeAllStatusMessages=function(){};WmsContactImpl.handleHideContactsUI=function(){};WmsContactImpl.handleShowContactsUI=function(){};WmsContactImpl.handleGetContacts=function(){var _772=WmsContacts.getZohoContacts();if($("#topicListMainContainer").is(":visible")||$("#allForums_MainContentCont").is(":visible")){setPresenceInTopicList(_772);if($("#singleForumHeaderView").is(":visible")){var _773=$("#singleForumHeaderView").attr("forumId");setPresence(_772,"moderatorsChatList_"+_773);}}else{if($("#SinglePostContainer").is(":visible")){var _774=$("#SinglePostContainer").attr("forumtopicid");setPresenceInTopicList(_772,_774);}else{if($("#myAreaParentContainer").is(":visible")){if($("#recentActivityContent").is(":visible")){setPresenceInMyArea(_772,"current_recentActivity_List");setPresence(_772,"followingUserDetails");setPresence(_772,"followersUserDetails");}else{if($("#watchListInnerContent").is(":visible")){setPresenceInMyArea(_772,"userChat_watchTopics");}else{if($("#privateMsgInnerContent").is(":visible")){setPresenceInMyArea(_772,"userChat_inbox");}}}}else{if($("#userProfileMainContainer").is(":visible")){var _775=$("#userProfileMainContainer");var _776=_775.attr("authorId");if(typeof WmsContacts!="undefined"&&ch=="true"){var _777=WmsContacts.status(_776);if(_777===false){_777=9;}manageUserChatStatus("userOnlineStatus_"+_776,_777);}}}}}};WmsContactImpl.handleMPReject=function(_778,_779,_77a){};WmsContactImpl.handleMPAccept=function(_77b,_77c,_77d){};WmsContactImpl.handleMPDelete=function(_77e,_77f,_780){};WmsContactImpl.handleMPAdd=function(_781,_782,_783){};WmsContactImpl.handleMPInvite=function(_784,_785,_786){};WmsContactImpl.handleLogin=function(_787,_788,_789,_78a){};WmsContactImpl.handleLogout=function(_78b,_78c,_78d,_78e){};WmsContactImpl.handleGetAccounts=function(_78f){};WmsContactImpl.handleInvitations=function(_790){};function WmsliteImpl(){}WmsliteImpl.serverdown=function(){};WmsliteImpl.serverup=function(){};WmsliteImpl.handleMessage=function(_791,_792){};WmsliteImpl.handleAccountDisabled=function(_793){};WmsliteImpl.handleServiceMessage=function(msg){};WmsliteImpl.handleLogout=function(_795){setTimeout(function(){$.get("/cleardomain.do","",function(){var url=window.location.href;if(url.indexOf("#")>-1){window.location.reload();}window.location.href=url;});},5);};var op=(((navigator.userAgent).indexOf("Opera")!=-1));var ie=!op&&/msie/i.test(navigator.userAgent);if(!op&&!ie){var curdomain=document.domain;var _WMSDOMAIN=curdomain.substring(curdomain.indexOf(".")+1);document.domain=_WMSDOMAIN;}function bindReportsClicks(_797){var _797=$("#reportsLeftPanel");_797.unbind("click",processReportClick).click(processReportClick);$("#reportsDateFilterArrow,#allTypeTrendDateFilter,#postResponseDateFilter,#repUnrepDateFilter,#topicStatusDateFilter,#mostVotedTopicsArrow,#userParticipationDateFilter").click(function(){displayStatisticsArrowClick($(this));});$("#forumDropDownArrow").unbind("click",processForumArrowClick).click(processForumArrowClick);bindDateFilterClick($("#dateFilterCont").find("button"));avtivateReportsCalendar();showOverallUsageCharts();}function avtivateReportsCalendar(){if($("#dateFilterCont").length<=0){return;}setDate("#fromDate");setDate("#toDate");}function setDate(id){$(id).datepicker({changeMonth:true,changeYear:true,dateFormat:"yy-mm-dd",gotoCurrent:true,onChangeMonthYear:function(year,_79a,inst){_79a=(_79a.toString().length<2)?("0"+_79a):_79a;$this=$(this);var date=$.trim($this.val());if(""!=date){$this.val(year+"-"+_79a+"-"+date.substring(date.length-2));}}});}function processReportClick(_79d){var _79e=$(_79d.target);var _79f=_79e.parent();if(_79f.is("[topicType=\"-1\"]")||_79f.is("[topicType=\"0\"]")||_79f.is("[topicType=\"1\"]")||_79f.is("[topicType=\"2\"]")||_79f.is("[topicType=\"3\"]")||_79f.is("[topicType=\"4\"]")||_79f.is("[purpose=\"fbReports\"]")){bindReportsAction(_79f);}else{if(_79e.is("[topicType=\"-1\"]")||_79e.is("[topicType=\"0\"]")||_79e.is("[topicType=\"1\"]")||_79e.is("[topicType=\"2\"]")||_79e.is("[topicType=\"3\"]")||_79e.is("[topicType=\"4\"]")||_79e.is("[purpose=\"fbReports\"]")){bindReportsAction(_79e);}}}function bindReportsAction(_7a0){showLoadingImage();$("#dateFilter").text($("#reportsDateFilterArrow .forumOptions ul").find("li[dateFilter=\"1\"]").text());$("#forumDropDownArrow div").text($("#reportsForumFilter").find("li[forumId=\"-1\"]").text()).attr("forumId","-1");$("#dateFilterCont").hide();_7a0.parent("ul").find("li").removeClass("selected");_7a0.addClass("selected");var _7a1={};_7a1.forumGroupId=forumGroupId;_7a1[csrfParamName]=csrfToken;_7a1.ch=ch;var _7a2=_7a0.attr("purpose");var _7a3=_7a0.attr("categoryId");var _7a4=_7a0.attr("topicType");if(_7a3){_7a1.categoryId=_7a3;}var _7a5=_7a0.find("a").text();if(_7a4){_7a1.topicType=_7a4;}var _7a6=$("#reportsLeftPanel li.selected").attr("action");if(_7a6=="/topicTypeReports.do"){$("#topicTypesFilterCont").show();}else{$("#topicTypesFilterCont").hide();}if(_7a2&&_7a2=="fbReports"){$("#reportsForumFilterCont").hide();}else{$("#reportsForumFilterCont").show();}doAjaxAction(_7a6,_7a1,function(data){$("#reportsInnerContent").get(0).innerHTML=data;$("#reportsTitle").text(_7a5);bindReportsClicks();hideLoadingImage();});}function displayStatisticsArrowClick(_7a8){var _7a9=_7a8.find("div.forumOptions");_7a9.show();_7a9.find("li").unbind("click").click(function(){var _7aa=$(this);var _7ab=_7aa.attr("dateFilter");$("#postRespDateFilterText,#dateFilter").attr("dateFilter",_7ab).text(_7aa.text());_7a9.mouseout();if(_7ab=="2"){$("#dateFilterCont").show();return;}$("#dateFilterCont").hide();doDateFilterAction(_7aa);});_7a8.hover(function(){var _7ac=_7a8.data("destroyHandle");_7a8.data("destroyHandle",false);if(_7ac){clearTimeout(_7ac);}},function(){var _7ad=setTimeout(function(){_7a9.hide();_7a8.unbind("mouseenter").unbind("mouseleave");},500);_7a8.data("destroyHandle",_7ad);});}function bindDateFilterClick(_7ae){_7ae.unbind("click").click(function(){doDateFilterAction($(this));});}function doDateFilterAction(_7af){var _7b0=_7af;var _7b1={};var _7b2=_7b0.attr("dateFilter");if(_7b2=="2"){var _7b3=_7af.parents().find("input[name=\"startDate\"]").val();var _7b4=_7af.parents().find("input[name=\"endDate\"]").val();if(!_7b3||""==_7b3){showMessage(i18n["zohodiscussions.statistics.provideStartDateMsg"],"failure");return;}_7b1.startDate=_7b3;if(_7b4&&!(""==_7b4)){_7b1.endDate=_7b4;}}var _7b5=((_7b0.attr("topFilter")=="true"))?true:false;_7b1.dateFilter=_7b2;_7b1.forumGroupId=forumGroupId;var _7b6=$("#forumDropDownArrow div").attr("forumId");if(_7b6){_7b1.forumId=_7b6;}var _7b7=_7b0.attr("authorId");if(_7b7&&_7b7>0){_7b1.userId=_7b7;}_7b1[csrfParamName]=csrfToken;var _7b8=(_7b5)?$("#reportsLeftPanel li.selected").attr("action"):_7b0.attr("action");var _7b9=$("#reportsLeftPanel li.selected").attr("topicType");if(_7b9){_7b1.topicType=_7b9;}var _7ba=_7b0.attr("chartFor");if(_7ba){_7b1.chartFor=_7ba;}showLoadingImage();doAjaxAction(_7b8,_7b1,function(data){hideLoadingImage();var _7bc;if(_7b5){_7bc=$("#reportsInnerContent");}else{_7bc=_7b0.parents("#allTypeTrendChartCont,#postRespTrendChartCont,#repUnrepChartCont,#topicStatusPieChartCont,#mostVotedTopicsChartCont,#userParticipationChartCont");}_7bc.get(0).innerHTML=data;bindReportsClicks();},function(err,desc,_7bf){var _7c0=eval(err.responseText);showMessage(_7c0.reason,"failure");hideLoadingImage();});}function processForumArrowClick(_7c1){var _7c2=$(_7c1.target);var _7c3=$("#reportsForumFilterCont div.moreOptions");_7c3.show();_7c3.find("ul").find("li").unbind("click").click(function(){var _7c4=$(this);var _7c5={};_7c3.hide();_7c5.forumGroupId=forumGroupId;_7c5[csrfParamName]=csrfToken;var _7c6=_7c4.attr("forumId");_7c5.forumId=_7c6;var _7c7=$("#dateFilter").attr("dateFilter");_7c5.dateFilter=_7c7;if(_7c7=="2"){var _7c8=$("#dateFilterCont");var _7c9=_7c8.find("input[name=\"startDate\"]").val();var _7ca=_7c8.find("input[name=\"endDate\"]").val();if(!_7c9||""==_7c9){showMessage(i18n["zohodiscussions.statistics.provideStartDateMsg"],"failure");return;}_7c5.startDate=_7c9;if(_7ca&&!(""==_7ca)){_7c5.endDate=_7ca;}}var _7cb=$("#reportsLeftPanel li.selected").attr("topicType");if(_7cb){_7c5.topicType=_7cb;}showLoadingImage();var _7cc=$("#reportsLeftPanel li.selected").attr("action");doAjaxAction(_7cc,_7c5,function(data){hideLoadingImage();var _7ce=$("#reportsInnerContent");_7ce.get(0).innerHTML=data;$("#forumDropDownArrow div").text(_7c4.text()).attr("forumId",_7c6);bindReportsClicks();},function(err,desc,_7d1){var _7d2=eval(err.responseText);showMessage(_7d2.reason,"failure");hideLoadingImage();});});_7c3.hover(function(){var _7d3=_7c3.data("destroyHandle");if(_7d3){clearTimeout(_7d3);}},function(){var _7d4=setTimeout(function(){_7c3.hide();_7c3.unbind("mouseenter").unbind("mouseleave");},500);_7c3.data("destroyHandle",_7d4);});}function showOverallUsageCharts(){isImageLoaded("topicTypeTrendImgCont");var _7d5=[0,1,2,3,4];for(var idx=0;idx<_7d5.length;idx++){isImageLoaded("postRespTrendImgCont_"+_7d5[idx]);}isImageLoaded("statusPieChartImgCont");isImageLoaded("statusMeterPlotImgCont");isImageLoaded("repUnrepPieChartImgCont");isImageLoaded("repUnrepMeterImgCont");isImageLoaded("userParticipationImgCont");}function isImageLoaded(_7d7){var _7d8=$("#"+_7d7);if(_7d8.length>0){var _7d9=_7d8.find("img").length;var _7da=0;_7d8.find("img").one("load",function(){_7da++;if(_7da==_7d9){_7d8.show();_7d8.prev("div[purpose=\"chartLoading\"]").hide();}lightBox("#"+_7d7);}).each(function(){if(this.complete){$(this).trigger("load");}});}}function initialiseUserActivityChart(){$("#postResponseDateFilter").click(function(){displayStatisticsArrowClick($(this));});isImageLoaded("postRespTrendImgCont_2");bindDateFilterClick($("#dateFilterCont").find("button"));avtivateReportsCalendar();}function triggerTopicType(_7db){$("#reportsLeftPanel").find("li[topicType=\""+_7db+"\"]").trigger("click");}
