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]([\w\-\.\+]*)@([\w\-\.]*)(\.[a-zA-Z]{2,4}(\.[a-zA-Z]{2}){0,2})$/i;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";_d.filter("[trim=\"true\"]").each(function(_1c,_1d){$(_1d).val($(_1d).val().replace(/^\s+/,"").replace(/\s+$/,""));}).end().filter("[mandatory=\"true\"]").each(function(_1e,_1f){var _20=$(_1f);if(_20.val()==""){message=getCustomMessage(_20,_20.attr("title")+" cannot be left blank! Please provide a value");showError(_20,message);_e=false;}}).end().filter("[dataType]").each(function(_21,_22){var _23=$(_22);var _24=_23.val();if(_24&&_24!=""){var _25=_23.attr("dataType");try{_25=_25.toLowerCase();var _26=eval(_25+"_pattern");var _27=eval(_25+"_message");if(_24.match(_26)==null){showError(_23,getCustomMessage(_23,_27));_e=false;}}catch(e){return;}}}).end().filter("[pattern]").each(function(_28,_29){var _2a=$(_29);var _2b=_2a.val();if(_2b&&_2b!=""){var _2c=eval(_2a.attr("pattern"));var _2d=eval("pattern_message");if(_2b.match(_2c)==null){showError(getCustomMessage(_2a,_2d));_e=false;}}});return _e;}function getCustomMessage(_2e,_2f){try{customMessage=_2e.attr("message");if(!customMessage||customMessage==""){customMessage=_2f;}return customMessage;}catch(e){return _2f;}}function showError(_30,_31){var _32=_30.attr("name")+"_Error";$("#"+_32).html(_31).show();return false;}function doAjaxAction(_33,_34,_35,_36){$.ajax({url:_33,type:"POST",data:_34,error:_36,success:_35});}function showLoadingImage(_37){_37=_37||i18n["zohodiscussions.general.loading"]+"...";$("#loadingText").html(_37);$("#loadingImg").show();}function hideLoadingImage(){$("#loadingImg:visible").hide();$("#ajaxLoaderSmall").remove();}function showSmallLoadingImage(_38,_39,_3a){_39=(_39!=undefined)?_39:20;_3a=(_3a!=undefined)?_3a:0;var _3b={};_3b.top=_38.pageY-_39;_3b.left=_38.pageX-_3a;var _3c=$("#ajaxLoaderSmallTemp").clone();_3c.attr("popoutPurpose","ajaxLoaderSmall");_3c.attr("id","ajaxLoaderSmall");_3c.css(_3b).show();_3c.appendTo("body");_3c.siblings("div[popoutPurpose=\"ajaxLoaderSmall\"]").remove();}function showSmallLoadingImageForCont(_3d,_3e,_3f){_3e=(_3e!=undefined)?_3e:0;_3e=_3d.offset().top+_3e;_3f=(_3f!=undefined)?_3f:0;_3f=_3d.offset().left+_3f;var _40={};_40.top=_3e;_40.left=_3f;var _41=$("#ajaxLoaderSmallTemp").clone();_41.attr("popoutPurpose","ajaxLoaderSmall");_41.attr("id","ajaxLoaderSmall");_41.css(_40).show();_41.appendTo("body");_41.siblings("div[popoutPurpose=\"ajaxLoaderSmall\"]").remove();}function goToTop(_42){if(_42&&_42==true){$("html,body").animate({scrollTop:0},1000);}else{$(window).scrollTop(0);}return false;}function setFocusToContainer(_43,_44,_45,_46){var _47=_43.offset().top;var _48=50;if(_46!=undefined){_48=_46;}if(_44&&_44==true){_45=_45||1000;$("html,body").animate({scrollTop:_47-_48},_45);}else{_45=(_45!=undefined)?_45:300;if(_45>0){setTimeout(function(){$(window).scrollTop(_47-_48);},_45);}else{$(window).scrollTop(_47-_48);}}return false;}function showMessage(_49,_4a){_4a=_4a||"info";$("#messageContentCont").html(_49);$("#messageContainer").attr("class",_4a).fadeIn(100,function(){setTimeout(function(){$("#messageContainer:visible").fadeOut(500);},6000);});$("#messageContainerClose").show();return false;}function hideMessage(){$("#messageContainer").fadeOut(100);}function showTipper(_4b,_4c,_4d){_4c=_4c||"info";_4d=_4d||4000;$("#messageContentCont").html(_4b);$("#messageContainerClose").hide();$("#messageContainer").attr("class",_4c).fadeIn(500,function(){setTimeout(function(){$("#messageContainer").fadeOut(500);},_4d);});}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 _4e=$("#topicList");if(_4e.length<1){_4e=$("#topicsList");}$currentSelected=_4e.data("currentFocusPost");if(!$currentSelected||$currentSelected.length<1){$currentSelected=_4e.data("currentSelectedPost");}if(!$currentSelected||$currentSelected.length<1){$currentSelected=_4e.find("div.singleTopicCont:first");}return $currentSelected;}function setupKbdShortcuts(){$.hotkeys.add("",{disableInInput:true});$.hotkeys.add("o",function(){var _4f=findCurrentSinglePost();var _50=_4f.attr("forumTopicId");handleTopicClick($("quickView_"+_50),_50,"topicList");});$.hotkeys.add("v",function(){showLoadingImage();if(isTopicQuickView=="false"){}else{var _51=findCurrentSinglePost();var _52=_51.attr("forumTopicId");processHash("Topic/"+_52);}});$.hotkeys.add("esc",function(){var _53=findCurrentSinglePost();var _54=_53.attr("forumTopicId");if($("#lastResponse_"+_54).is(":visible")){handleTopicClick($("quickView_"+_54),_54,"topicList");}});$.hotkeys.add("return",function(){var _55=findCurrentSinglePost();var _56=_55.attr("forumTopicId");window.open(serverURL+"?ftid="+_56);});$.hotkeys.add("space",function(){var _57=findCurrentSinglePost();if(_57.is("div.singleTopicContSel")){var _58=$(window).height();var _59=$(window).scrollTop();var _5a=_57.height();var _5b=_57.next().offset().top;var _5c=(_58+_59>_5b);if(_5c){_57=_57.next();if(_57.is(".singleTopicCont")){var _5d=_57.attr("forumTopicId");handleTopicClick($("quickView_"+_5d),_5d,"topicList");}}else{$(window).scrollTop(_59+_58-50);}}else{if(_57.is(".singleTopicCont")){var _5d=_57.attr("forumTopicId");handleTopicClick($("quickView_"+_5d),_5d,"topicList");}}});$.hotkeys.add("shift+space",function(){var _5e=findCurrentSinglePost();if(_5e.is("div.singleTopicContSel")){var _5f=$(window).height();var _60=$(window).scrollTop();var _61=_5e.prev().offset().top;var _62=(_60-_5f<_61-50);if(_62){_5e=_5e.prev();if(_5e.is(".singleTopicCont")){var _63=_5e.attr("forumTopicId");handleTopicClick($("quickView_"+_63),_63,"topicList");}}else{$(window).scrollTop((_60-_5f)+50);}}else{if(_5e.is(".singleTopicCont")){var _63=_5e.attr("forumTopicId");handleTopicClick($("quickView_"+_63),_63,"topicList");}}});$.hotkeys.add("j",function(){var _64=findCurrentSinglePost();if(_64.is("div.singleTopicContSel")){_64=_64.next();}if(_64.is("div.singleTopicCont")){var _65=_64.attr("forumTopicId");handleTopicClick($("quickView_"+_65),_65,"topicList");}});$.hotkeys.add("k",function(){var _66=findCurrentSinglePost();if(_66.is("div.singleTopicContSel")){_66=_66.prev();}if(_66.is("div.singleTopicCont")){var _67=_66.attr("forumTopicId");handleTopicClick($("quickView_"+_67),_67,"topicList");}});$.hotkeys.add("n",function(){var _68=findCurrentSinglePost();var _69=_68.next();if(_69.is("div.singleTopicCont")||_69.is("div.singleTopicContSel")){_68.removeClass("hotKeyTopicCont");_69.addClass("hotKeyTopicCont");$("#topicList").data("currentFocusPost",_69);toSetFocusOnCurrPost(_69,"next");}});$.hotkeys.add("p",function(){var _6a=findCurrentSinglePost();var _6b=_6a.prev();if(_6b.is("div.singleTopicCont")||_6b.is("div.singleTopicContSel")){_6a.removeClass("hotKeyTopicCont");_6b.addClass("hotKeyTopicCont");$("#topicList").data("currentFocusPost",_6b);toSetFocusOnCurrPost(_6b,"prev");}});}function toSetFocusOnCurrPost(_6c,_6d){var _6e=_6c.offset().top;var _6f=$(window).height();var _70=$(window).scrollTop();if(_6d=="next"){if(_6e-_70>_6f-50){$(window).scrollTop((_6e-_6f)+80);}}else{if(_70>_6e){$(window).scrollTop(_6e);}}}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 _71=$("#SinglePostContainer").attr("forumTopicId");window.open(serverURL+"?ftid="+_71);});$.hotkeys.add("space",function(){var _72=$(window).height();var _73=$(window).scrollTop();$(window).scrollTop(_73+_72);});$.hotkeys.add("shift+space",function(){var _74=$(window).height();var _75=$(window).scrollTop();$(window).scrollTop(_75-_74);});$.hotkeys.add("j",function(){$currentSelected=findCurrentSingleResponse();var _76=0;var _77=$currentSelected.attr("currkey");if(_77!=undefined){_76=_77;}_76++;toSetFocusOnCurrResponse($currentSelected,_76);});$.hotkeys.add("k",function(){$currentSelected=findCurrentSingleResponse();var _78=0;var _79=$currentSelected.attr("currkey");if(_79!=undefined){_78=_79;}else{return false;}_78--;toSetFocusOnCurrResponse($currentSelected,_78);});$.hotkeys.add("n",function(){$currentSelected=findCurrentSingleResponse();var _7a=0;var _7b=$currentSelected.attr("currkey");if(_7b!=undefined){_7a=_7b;}_7a++;toSetFocusOnCurrResponse($currentSelected,_7a);});$.hotkeys.add("p",function(){$currentSelected=findCurrentSingleResponse();var _7c=0;var _7d=$currentSelected.attr("currkey");if(_7d!=undefined){_7c=_7d;}else{return false;}_7c--;toSetFocusOnCurrResponse($currentSelected,_7c);});}function findCurrentSingleResponse(){$currentSelected=$("#SinglePostContainer").data("currentFocusResponse");if(!$currentSelected||$currentSelected.length<1){var _7e=$("#SinglePostContainer").attr("forumTopicId");$currentSelected=$("#SinglePostContainer_"+_7e).find("div.postContainer");}return $currentSelected;}function toSetFocusOnCurrResponse(_7f,_80){var _81=$("#SinglePostContainer").attr("forumTopicId");var _82="";if(_80=="0"){_82=$("#SinglePostContainer_"+_81).find("div.postContainer");_7f.removeClass("HotKeysingleReplyContainer");}else{_82=$("#SinglePostContainer_"+_81).find("span.hotKey_"+_80);if(_82.length==0){return false;}_7f.removeClass("HotKeysingleReplyContainer");_82.addClass("HotKeysingleReplyContainer");}var _83=_82.offset().top;$("html,body").animate({scrollTop:_83-10},500);$("#SinglePostContainer").data("currentFocusResponse",_82);}function newOpenEditor(_84,_85,_86,_87,_88,_89){var _8a=_84.show();var _8b=_8a.next();var $ta=$("<textArea name = \""+_85+"\" id = \""+_86+"\" style = \"display:none;\"></textarea>");var _8d="";var _8e=true;if(_88=="Edit"||_85=="privateMsgContent"){_8e=false;}else{if($("#writeNewTopic").attr("isDraft")=="true"){_8e=false;}}if(_8a.is(":input")){_8d=_8a.val();}else{_8d=_8a.html();}_8d=" "+_8d;var _8f=document.createElement("div");_8f.innerHTML=_8d;$(_8f).find("div.__zd_findAndReplace").remove();$(_8f).find("div.__zd_findAndReplaceParent").remove();_8d=_8f.innerHTML;if(_8e==true){_8d=_8d+userSignature;}$ta.val($.trim(_8d));var _90;var _91="";if(_87){_90=$("<form id = \"editorHolder\"></form>");$replyLinkLocation=$("#"+_87);_91=$replyLinkLocation.attr("forumTopicId");_91=_91||$replyLinkLocation.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _92=$replyLinkLocation.attr("responseId");var _93=$replyLinkLocation.attr("isPrivate");var _94=$replyLinkLocation.attr("isThread");var _95=$replyLinkLocation.attr("forumId");var _96=$replyLinkLocation.attr("categoryId");var _97=$replyLinkLocation.attr("postTitle");var _98=$replyLinkLocation.attr("responseAuthorId");_90.append("<input value=\""+_97+"\" 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 = \""+_91+"\">").append("<input type = \"hidden\" name = \"responseId\" value = \""+_92+"\">").append("<input type = \"hidden\" name = \"forumGroupId\" value = \""+forumGroupId+"\">").append("<input type = \"hidden\" name = \"isPrivate\" value = \""+_93+"\">").append("<input type = \"hidden\" name = \"isThread\" value = \""+_94+"\">").append("<input type = \"hidden\" name = \"forumId\" value = \""+_95+"\">").append("<input type = \"hidden\" name = \"categoryId\" value = \""+_96+"\">").append("<input type = \"hidden\" name = \""+csrfParamName+"\" value = \""+csrfToken+"\">").append("<input type = \"hidden\" name = \"detectSpamPresence\" value = \""+1+"\">");if((_88&&_88=="Edit")&&_98==ZUID){_90.append("<input type = \"hidden\" name = \"responseowner\" value = \"true\">");}}else{_90=$("<div id = \"editorHolder\"></div>");}_90.append($ta);_90.insertAfter(_8a.hide()).show();createEditor();if(_88){$replyLinkLocation=$("#"+_87);var _91=$replyLinkLocation.attr("forumTopicId");var _92=$replyLinkLocation.attr("responseId");var _99=(_88=="Write")?i18n["zohodiscussions.general.publish"]:i18n["zohodiscussions.general.update"];var _9a=$("<button id=\"publishResponse\" class=\"ashBtn normalText boldText\">"+_99+"</button>");var _9b=$("<button id=\"previewResponse\" class=\"ashBtn normalText boldText\">"+i18n["zohodiscussions.writePost.preview"]+"</button>");var _9c=$("<button id='cancelResponse' class='ashBtn normalText boldText'>"+i18n["zohodiscussions.general.cancel"]+"</button>");var _9d="false";_9a.click(function(){addForumResponse(_91,_88,_92);});_9c.click(function(){$("#editorHolder").remove();$("#responseAttachmentContActual").remove();$("#SinglePostContainer_"+_91).find("div[purpose=\"editorActionUtilCont\"]").remove();$("#postTextContent_"+_92).find("div[purpose=\"editorActionUtilCont\"]").remove();$("#eachTopicReplyCont_"+_91).find("div[purpose=\"editorActionUtilCont\"]").remove();if($("#responsePreviewButtonInTopicList").length>0){$("#responsePreviewButtonInTopicList").remove();}_8a.show();$("#"+_89).data("inEditMode",false);var _9e="";if($("#newThreadResponseCont_"+_92).is(":visible")){_9e="#newThreadResponseCont_"+_92;}else{if($("#newResponseCont_"+_91).is(":visible")){_9e="#newResponseCont_"+_91;}else{if($("#eachTopicReplyCont_"+_91).is(":visible")){_9e="#eachTopicReplyCont_"+_91;}}}if(_9e!=""){$(""+_9e+"").hide();}if(_89=="privateMsgInboxContainer"){$("#privateMsgCont_"+_91).hide();}else{if(_89=="privateMsgSentContainer"){$("#privateMsgCont_"+_91).hide();if($("#topicContent_"+_91).parent().find("div.bigMinusIcon").length>0){$("#topicContent_"+_91).show();}}else{if(_89=="editorContainer_PM"){processHash("user/"+$("#UserPM").attr("authorName"));}else{if(_89=="eachTopic_"+_92){var _9f=$("#paginationContainer");_9f.data("inEditMode",false);$("#singlePostActions_"+_92).show();$("#linkedTopic_"+_92).show();$("#recent_ResPonse_"+_92).find("div.navigationCont").show();}else{if(_89=="topicContainer_"+_91){$("#postTypeActions_"+_92).show();$("#linkTopicCont_"+_91).show();$("#statusContainer").show();}}}}}if(_8b.is(".Attachments")){_8b.show();}if($("#responsePreviewContainer").is(":visible")){if(($("#responsePreviewContainer").length>0)||($singleThreadPreviewCont.length>0)){$("#responsePreviewContainer").remove();$("#fullThreadResponseContainer").remove();}}if(($("#responseContentContainer_"+_92).is(":visible"))==true){$("#fullResponseContainer_"+_92).find("div.postTypeActions").show();var _a0=$("#responsePreviewButton");var _a1=$("#fullResponseContainer_"+_92);var _a2=$("#responseContentContainer_"+_92);CancelPreview(_a0,_a1,_a2);}if(($("#recentResponseContent_"+_92).is(":visible"))==true){$("#postTextContent_"+_92).find("ul.singlePostActions").show();$("#resposeVoteLink_"+_92).show();$("#chooseBestResponse_"+_92).show();var _a0=$("#responsePreviewButtonInTopicList");var _a1=$("#postTextContent_"+_92);var _a3=$("#recentResponseContent_"+_92);CancelPreview(_a0,_a1,_a3);}});var _a4=$("#responseAttachmentContTemplate").clone();_a4.attr("id","responseAttachmentContActual");var _a5=_a4.find("div.whiteAttachmentBox").show();_a4.find("div[attachmentPurpose=\"browseBox\"]").attr("id","attachBrowseCont");var _a6=_a5.find("ul[purpose=\"responseAtatchmentsListCont\"]").attr("id","attachmentsListCont");if(_88=="Edit"){if(_8b.is(".Attachments")){_9d="true";var _a7=_8b.find("div[purpose=\"attachmenUtilCont\"]");var _a8=_a7.attr("attachmentIds");var _a9=_a7.attr("attachmentNames");var _aa=_a7.attr("attachmentSizes");var _ab=_a8.split(",");var _ac=_a9.split(",");var _ad=_aa.split(",");for(index=0;index<_ab.length;index++){var _ae=_ab[index];var _af=_ac[index];var _b0=_ad[index];var _b1=_ae+","+_af+","+_b0;$currentAttachment=$("#responseEachAttachmentTemplate").clone();$currentAttachment.attr("id","newAttachment_"+_ae).attr("attachmentDetails",_b1).show();$currentAttachment.find("[attachmentPurpose=\"attachmentName\"]").html(_af);$currentAttachment.find("[attachmentPurpose=\"attachmentSize\"]").html(_b0);$currentAttachment.find("div.imgAshDelete").attr("thisAttachmentId",_ae).attr("thisAttachmentName",_af);$currentAttachment.find("div.imgAshDelete").click(function(_b2){if(confirm(i18n["zohodiscussions.generalmessage.deleteAttachmentConfirmMsg"])){showSmallLoadingImage(_b2);$this=$(this);var _b3=$this.attr("thisAttachmentId");var _b4={};_b4.forumGroupId=forumGroupId;_b4.forumTopicId=_91;_b4.fileName=$this.attr("thisAttachmentName");_b4.fileId=_b3;_b4[csrfParamName]=csrfToken;doAjaxAction("/deleteAttachment.do",_b4,function(_b5){hideLoadingImage();if(_b5=="SUCCESS"){$("#newAttachment_"+_b3).remove();$("#eachAttachmentForPreview_"+_b3).remove();$("#fullResponseContainer_"+_92).find("li[attachmentId=\""+_b3+"\" ]").remove();showTipper(i18n["zohodiscussions.generalmessage.deleteAttachmentSuccessMsg"],"info");loadUploadAttachmentsCont();_9c.attr("disabled",true);_9c.unbind("click");}});}});_a6.append($currentAttachment);}_8b.hide();}$("#postTypeActions_"+_92).hide();}if(maxAttachmentsPerPost>0||_9d=="true"){var _b6=$("<div class=\"flRight btnContainer\" purpose=\"editorActionUtilCont\" style=\"margin-right:10px;\"></div>");_a4.insertAfter($("#editorHolder")).css("margin-top",4).show();}else{var _b6=$("<div class=\"flRight btnContainer\" purpose=\"editorActionUtilCont\" style=\"margin-top:25px;margin-right:10px;\"></div>");_a4.insertAfter($("#editorHolder")).css("margin-top",4);}_b6.append(_9a);if(_89!="paginationContainer"){_b6.append(_9b);}_b6.append(_9c).insertAfter(_a4);loadUploadAttachmentsCont();_9b.click(function(){var _b7=$(this);var _b8=_b7.attr("location");var _b9=$("#editorHolder").find("input[name=forumPostTitle]").val();var _ba=_b9.replace(/^<+|<+$/g,"&lt;").replace(/<+/g,"&lt;").replace(/^>+|>+$/g,"&gt;").replace(/>+/g,"&gt;");var _bb=_b7.attr("forumTopicId");var _bc=_b7.attr("responseId");var _bd=editor.getContent();_bd=_bd.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_b8=="editResponse"||_b8=="editTopic"){var _bc=_b7.attr("responseId");if($("#responsePreviewButton").length==0){$responsePreviewButton=$("#previewButtonTemplate").clone();$responsePreviewButton.attr("id","responsePreviewButton");}else{$responsePreviewButton=$("#responsePreviewButton");}if(_b8=="editTopic"){$("#fullResponseContainer_"+_bc).find("div.postTypeActions").hide();$responsePreviewButton.insertAfter($("#fullResponseContainer_"+_bc).find("div.postTypeActions")).show();}var _be=$("#fullResponseContainer_"+_bc);newEditorLocationHide(_bb,_be);_be.find("div.replyOutHeader").append("<div class=\"flRight statusMessage\"><span class=\"boldText moderation\">This is preview!</span></div>");_be.find("h3.header").html(_ba);editAndPreviewPost($responsePreviewButton,$("#postTypeActions_"+_bc),_be,_b8);_bf=$("#fullResponseContainer_"+_bc).find("div.attachmentListCont").hide();var _c0=$("#fullResponseContainer_"+_bc).find("div[purpose =\"attachmentListContForPreview\"]");var _c1=$("#responseContentContainer_"+_bc);attachmentPreview(_c1,_bf,_be,_b7);if(($("#cancelResponse").attr("disabled"))==true){$("#responsePreviewButton").find("button[purpose=\"cancelPreviewResponse\"]").attr("disabled",true);}_c0.show();previewContentContainer($("#responseContentContainer_"+_bc),_bd);previewActions($("#fullResponseContainer_"+_bc),_bb,_bc,_9c,_9a,_9d);}else{if(_b8=="topicListEditResponse"){if($("#responsePreviewButtonInTopicList").length==0){$responsePreviewButton=$("#previewButtonTemplate").clone();$responsePreviewButton.attr("id","responsePreviewButtonInTopicList");}else{$responsePreviewButton=$("#responsePreviewButtonInTopicList");}var _be=$("#postTextContent_"+_bc);newEditorLocationHide(_bb,_be);var _c1=$("#recentResponseContent_"+_bc);var _bf=$("#postTextContent_"+_bc).find("div.attachmentListCont").hide();var _c0=$("#postTextContent_"+_bc).find("div[purpose =\"attachmentListContForPreview\"]");_c0.show();if(($("#cancelResponse").attr("disabled"))==true){$("#responsePreviewButtonInTopicList").find("button[purpose=\"cancelPreviewResponse\"]").attr("disabled",true);}attachmentPreview(_c1,_bf,_be,_b7);previewContentContainer($("#recentResponseContent_"+_bc),_bd);editAndPreviewPost($responsePreviewButton,$("#postTextContent_"+_bc),_be,_b8);previewActions($("#responsePreviewButtonInTopicList"),_bb,_bc,_9c,_9a,_9d);}else{if($("#responsePreviewContainer").length==0){$responsePreviewContainer=$("#responsePreviewContainerTemplate").clone();$responsePreviewContainer.attr("id","responsePreviewContainer");}else{$responsePreviewContainer=$("#responsePreviewContainer");}if(_87=="newThreadReply_"+_bc){if($("#fullThreadResponseContainer").length==0){var _c2=$("<div id=\"fullThreadResponseContainer\" purpose = \"threadResponseContainer\" class=\"threadContainer\"><div class=\"threadArrow\" purpose=\"threadArrow\"></div><div purpose =\"singleThreadPreview\"></div></div>");}else{var _c2=$("#topicContainer_"+_bb).find("div[purpose=\"threadResponseContainer\"]");}}$responsePreviewContainer.find("[purpose=\"previewResponseAttachment\"]").attr("id","attachmentForResponsePreview");if(_87=="newThreadReply_"+_bc){_c2.find("div[purpose=\"singleThreadPreview\"]").append($responsePreviewContainer);_c2.insertAfter("#newThreadResponseCont_"+_bc);$responsePreviewContainer.find("button[purpose=\"backToEditorResponse\"]").attr("location","threadResponse");$("#replyToTopicBtn_"+_bb).attr("location","threadResponse");}else{$responsePreviewContainer.insertAfter("#newResponseCont_"+_bb);$responsePreviewContainer.find("button[purpose=\"backToEditorResponse\"]").attr("location","topicResponse");$("#replyToTopicBtn_"+_bb).attr("location","topicResponse");}$responsePreviewContainer.find("h3[purpose=\"topicTitleOfResponse\"]").html(_ba);$responsePreviewContainer.find("div[purpose=\"responseContPreviewContainer\"]").html(_bd);if(_87=="newThreadReply_"+_bc){$("#newThreadResponseCont_"+_bc).hide();_c2.show();_c2.find("div.singleReplyContainer").show();}else{$responsePreviewContainer.show();$("#newResponseCont_"+_bb).hide();}var _c3=_b7.find("input[name=\"attachmentId\"]");$.each(_c3,function(_c4,_c5){var _c6=$(_c5).attr("attachmentDetails").split(",");var _c7=$("<li class=\"singleList\" id=\"eachAttachmentForPreview_"+_c6[0]+"\" ><div class=\"flLeft iconCont\"><div class=\"attachIcon imgAttachmentTh\"></div></div>  <ul class=\"ulNoStyle detailsListNew\"> <li class=\"header\"> <a>"+_c6[1]+"</a> </li> <li class=\"forumDetailsList\"> <span>Size:"+_c6[2]+"</span></li></ul></li>");$("#attachmentForResponsePreview").append(_c7);});if($("#attachmentForResponsePreview > li").length>0){$responsePreviewContainer.find("[purpose=\"attachmentResponsePreviewCont\"]").show();}else{$responsePreviewContainer.find("[purpose=\"attachmentResponsePreviewCont\"]").hide();}previewActions($responsePreviewContainer,_bb,_bc,_9c,_9a,_9d);}}});}}function toggleSections(_c8,_c9){_c8.find("div[purpose]").hide().end().find("div[purpose=\""+_c9+"\"]").show().end().find("li[purpose]").removeClass("selectedMenu").end().find("li[purpose=\""+_c9+"\"]").addClass("selectedMenu");}function uploadError(_ca){var _cb=$("#imageDialog");_cb.find("#image_error").hide().html(_ca).css("background","#FFF1A8").fadeIn();}function previewActions(_cc,_cd,_ce,_cf,_d0,_d1){_cc.find("button[purpose=\"backToEditorResponse\"]").unbind("click").click(function(){var _d2=$(this);var _d3=_d2.attr("location");if(_d3=="topicResponse"){_cc.hide();$("#newResponseCont_"+_cd).show();}else{if(_d3=="editEachResponse"){$("#resposeVoteLink_"+_ce).show();$("#chooseBestResponse_"+_ce).show();backtoEditorWhilePreviewing($("#fullResponseContainer_"+_ce),$("#responseContentContainer_"+_ce),$("#responsePreviewButton"),_cd,_d1);}else{if(_d3=="topicListEditResponse"){backtoEditorWhilePreviewing($("#postTextContent_"+_ce),$("#recentResponseContent_"+_ce),$("#responsePreviewButtonInTopicList"),_cd,_d1);}else{$("#newThreadResponseCont_"+_ce).show();$("#fullThreadResponseContainer").hide();}}}$("#attachmentForResponsePreview").html(" ");});_cc.find("button[purpose=\"publishPreviewResponse\"]").unbind("click").click(function(){_d0.trigger("click");});_cc.find("button[purpose=\"cancelPreviewResponse\"]").unbind("click").click(function(){var _d4=$(this);var _d5=_d4.attr("location");if(_d5=="topicResponse"){}else{if(_d5=="editEachResponse"){var _d6=$("#fullResponseContainer_"+_ce).find("div[purpose =\"attachmentListContForPreview\"] > ul");_d6.html(" ");$("#fullResponseContainer_"+_ce).find("div.replyOutHeader > div.statusMessage").remove();}else{if(_d5=="topicListEditResponse"){var _d6=$("#postTextContent_"+_ce).find("div[purpose =\"attachmentListContForPreview\"] > ul");_d6.html(" ");$("#postTextContent_"+_ce).find("div.statusMessage").remove();}else{}}}_cf.trigger("click");});}function editAndPreviewPost(_d7,_d8,_d9,_da){var _da=(_da=="editResponse"||_da=="editTopic")?"editEachResponse":"topicListEditResponse";_d7.insertAfter(_d8).show();_d9.find("div[purpose=\"editorMainParentCont\"]").hide();_d9.find("div[purpose=\"editorActionUtilCont\"]").hide();_d7.find("button[purpose=\"publishPreviewResponse\"]").html(i18n["zohodiscussions.general.update"]);_d7.find("button[purpose=\"backToEditorResponse\"]").attr("location",_da);_d7.find("button[purpose=\"publishPreviewResponse\"]").attr("location",_da);_d7.find("button[purpose=\"cancelPreviewResponse\"]").attr("location",_da);}function CancelPreview(_db,_dc,_dd){_db.remove();_dc.find("div.Attachments").show();_dc.find("div.attachmentListCont").show();_dc.find("div[purpose =\"attachmentListContForPreview\"]").hide();_dd.show();$("#previewContentContainer").remove();$("#newAttachmentForPreview").remove();}function previewContentContainer(_de,_df){_de.hide();if($("#previewContentContainer").length==0){var _e0=$("<div id=\"previewContentContainer\" class=\"postContent\"> </div>");}else{_e0=$("#previewContentContainer");}_e0.insertAfter(_de);_e0.html(_df).show();}function backtoEditorWhilePreviewing(_e1,_e2,_e3,_e4,_e5){newEditorLocationShow(_e4,_e1,_e5);_e2.hide();_e1.find("div.Attachments").hide();$("#previewContentContainer").hide();var _e6=_e1.find("div[purpose =\"attachmentListContForPreview\"] > ul");_e6.html(" ");var _e7=$("#newAttachmentForPreview").find("ul[purpose=\"previewResponseAttachment\"]");_e7.html(" ");_e1.find("div.replyOutHeader > div.statusMessage").remove();_e3.hide();}function attachmentListPreview(_e8,_e9){$.each(_e9,function(_ea,_eb){var _ec=$(_eb).attr("attachmentDetails").split(",");var _ed=$("<li class=\"singleList\" id=\"eachAttachmentForPreview_"+_ec[0]+"\" ><div class=\"flLeft iconCont\"><div class=\"attachIcon imgAttachmentTh\"></div></div>  <ul class=\"ulNoStyle detailsListNew\"> <li class=\"header\"> <a>"+_ec[1]+"</a> </li> <li class=\"forumDetailsList\"> <span>Size:"+_ec[2]+"</span></li></ul></li>");_e8.append(_ed).show();});}function attachmentPreview(_ee,_ef,_f0,_f1){var _f2=_f0.find("div[purpose =\"attachmentListContForPreview\"]");if(_f2.length==0&&$("#newAttachmentForPreview").length==0){var _f3=$("<div class=\"attachmentListCont\" purpose =\"attachmentListContForPreview\"> <ul class=\"ulNoStyle\"> </ul></div>");_f3.insertAfter(_ef);}if($("#newAttachmentForPreview").length==0){if(($("#attachmentsListCont").find("li[purpose=\"attachmentDetails\"]")).length>0&&_ef.length==0){$newAttachmentForPreview=$("#responsePreviewContainerTemplate").find("div[purpose =\"attachmentResponsePreviewCont\"]").clone();$newAttachmentForPreview.attr("id","newAttachmentForPreview");$newAttachmentForPreview.insertAfter(_ee);$newAttachmentForPreview.find("div.attachmentListCont").show();}}if($("#newAttachmentForPreview").length>0){$("#newAttachmentForPreview").show();var _f4=_f1.find("input[name=\"attachmentId\"]");var _f5=$("#newAttachmentForPreview").find("ul[purpose=\"previewResponseAttachment\"]");attachmentListPreview(_f5,_f4);$newAttachmentForPreview.find("div.attachmentListCont").show();}else{var _f4=$("#attachmentsListCont").find("li[purpose=\"attachmentDetails\"]");var _f5=_f0.find("div[purpose =\"attachmentListContForPreview\"] > ul");attachmentListPreview(_f5,_f4);}if(_f0.find("div[purpose =\"attachmentListContForPreview\"] > ul > li").length>0||$("#newAttachmentForPreview").find("ul[purpose =\"previewResponseAttachment\"] > li").length>0){_f0.find("div.Attachments").show();}else{_f0.find("div.Attachments").hide();}}function imageUploaded(_f6,_f7,_f8,_f9){$("#imagePreview").attr({src:_f6,width:"100",height:"100"});var _fa=$("#imageDialog");_fa.find("#image_error").html("");_fa.find(":input[name=\"linkTo\"]").val(_f9);_fa.find(":button[action=\"insertImage\"]").attr("disabled","").end().find(":input[name=\"uploadedImageUrl\"]").val(_f6);}function imageAdded(_fb,_fc){var _fd=$("#imageDialog");var _fe={};_fe.title=_fd.find("[name=\"title\"]").val();_fe.altText=_fd.find("[name=\"altText\"]").val();_fe.linkTo=_fd.find("[name=\"linkTo\"]").val();_fe.imgSize=_fd.find("[name=\"imgSize\"]").filter(":checked").val();$("#"+_fc).data("editor").addImage(_fb,_fe);$("#imageDialog").hide();}function toggleSections(_ff,_100){_ff.find("div[purpose]").hide().end().find("div[purpose=\""+_100+"\"]").show().end().find("span[purpose]").removeClass("select").addClass("default").end().find("span[purpose=\""+_100+"\"]").removeClass("default").addClass("select");}function fillImageUrl(){var _101=$("#imageDialog");if(_101.find("#urldiv").is(":visible")){var _102=_101.find(":input[name=\"url\"]").val();if(_102&&$.trim(_102)!=""){if($.trim(_102)!=""&&isValidUrl(_102)){_101.find(":input[name=\"linkTo\"]").val(_102).end().find("#imagePreview").attr({src:_102,width:"100",height:"100"}).end().find(":button[action=\"insertImage\"]").attr("disabled","");}else{alert(i18n["zohodiscussions.settings.PleaseEnteraValidurl"]);_101.find(":input[name=\"url\"]").focus();}}}else{var _102=_101.find(":input[name=\"uploadedImageUrl\"]").val();_101.find(":input[name=\"linkTo\"]").val(_102);}}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 _104=$("#imageDialog");if($.trim(_104.find("[name='imageFileName']").val())!=""){var _105=_104.find("form");_104.find("#image_error").html("<em>Uploading .. <img src = '/images/progressbarsmall.gif' /></em>").end().find(":button[action=\"insertImage\"]").attr("disabled","true");_105.find(":hidden[name=\"responseId\"]").val($("#editorHolder :hidden[name=\"responseId\"]").val());_105.attr("action","/uploadImage.do");_105.attr("enctype","multipart/form-data").attr("encoding","multipart/form-data");_105.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 _107=$("#urldiv");_107.show();_107.find(":inpur[name=\"url\"]").focus();}}function newEditorLocationHide(_108,_109){$("#editorHolder").hide();_109.find("div[purpose=\"editorActionUtilCont\"]").hide();$("#responseAttachmentContActual").hide();}function newEditorLocationShow(_10a,_10b,_10c){$("#editorHolder").show();if(maxAttachmentsPerPost>0||_10c=="true"){$("#responseAttachmentContActual").show();}_10b.find("div[purpose=\"editorActionUtilCont\"]").show();}function initTabContClick(){$("#homeTab,#allforumsTab,#myareaTab,#moderationTab,#SettingsTab,#NewTopicTab,#Search,#statsTab").click(function(){var _10d=$(this);var _10e=_10d.attr("hashPurpose");processHash(_10e);return false;});$("#searchComboDownArrow").parent().click(function(){displaySearchOption();});}function processHash(hash,_110){if(isTopicQuickView=="false"&&_110!="withHash"){if(hash.toLowerCase()=="home"){hash="recent";}else{if(hash.toLowerCase()=="search"){var _111=$("#searchInputBox").val();_111=$.trim(_111);_111=escape(_111);_111=_111.replace("*","%2A").replace("+","%2B").replace("@","%40").replace("/","%2F");if(_111==""){showMessage(i18n["zohodiscussions.searchList.noSearchString"],"failure");return;}location.href=serverURL+"/"+hash.toLowerCase()+"/"+_111;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 _112=hash.split("/");var _113=_112[0];var _114=_113.toLowerCase();selectTab(_114);switch(_114){case "home":case "chome":var _115=1;if(parseInt(_112[1])>1){_115=_112[1];}discussionsFunctions[_114](_113,_115);break;case "alltags":discussionsFunctions[_114](_113);break;case "allforums":discussionsFunctions[_114](_113);break;case "stats":discussionsFunctions[_114](_113);break;case "search":var _111=_112[1];discussionsFunctions[_114](_113,_111);break;case "myarea":var _116=_112[1];var _117="";if(_116){_116=_116.toLowerCase();}if(_116=="watchlist"){_117=_112[2];if(_117){_117=_117.toLowerCase();}}else{if(_116=="friends"){_117=_112[2];if(_117){_117=_117.toLowerCase();}}}discussionsFunctions[_114](_113,_116,_117);break;case "moderation":case "settings":discussionsFunctions[_114](_113);break;case "topic":var _118=_112[1];var _119=_112[2];discussionsFunctions[_114](_113,_118,_119);break;case "forum":var _11a=_112[1];var _115=1;if(_112[2]){var _11b="";var _11c=parseInt(2);if(_112[_11c]!="filter"&&_112[_11c].toLowerCase()!="all"){var temp=parseInt(_112[_11c]);if(temp>0){_115=temp;_11c=_11c+1;}else{_11b=_112[_11c];_11c=_11c+1;}}if(_112[_11c]){if(_112[_11c]=="filter"){_11c=_11c+1;var _11e=_112[_11c];var _11f="";_11e=_11e.toLowerCase();if(_11e!="discussions"&&_11e!="questions"&&_11e!="ideas"&&_11e!="problems"&&_11e!="announcement"&&_11e!="sticky"&&_11e!="unrepliedposts"&&_11e!="postssincelastvisit"){_11e="all";if(isOneTopicType!="true"){_11c=_11c+1;}}else{_11c=_11c+1;if(_112[_11c]){_11f=_112[_11c];}}if(isOneTopicType=="true"&&_11e=="all"){_11f=_112[_11c];}if(_112[_11c]){if(parseInt(_112[_11c])>0){_115=_112[_11c];}}getMoreTopics(_11a,_11b,_115,_11e,"",_11f,"reload");}else{if(_112[_11c]){if(parseInt(_112[_11c])>0){_115=_112[_11c];}}discussionsFunctions[_114](_113,_11a,_11b,_115);}}else{discussionsFunctions[_114](_113,_11a,_11b,_115);}}else{discussionsFunctions[_114](_113,_11a,"",_115);}break;case "filter":var _11e=_112[1];_11e=_11e.toLowerCase();var _11f="";var _115=1;if(_11e!="discussions"&&_11e!="questions"&&_11e!="ideas"&&_11e!="problems"&&_11e!="announcement"&&_11e!="sticky"&&_11e!="unrepliedposts"&&_11e!="postssincelastvisit"){_11e="all";if(parseInt(_112[2])>0){_115=_112[2];}}else{if(_112[3]){_11f=_112[2];if(parseInt(_112[3])>0){_115=_112[3];}}else{if(parseInt(_112[2])>0){_115=_112[2];}else{_11f=_112[2];}}}if(isOneTopicType=="true"&&_11e=="all"){_11f=_112[1];}getMoreTopics("","",_115,_11e,"",_11f,"reload");break;case "user":var _120=_112[1];discussionsFunctions[_114](_113,_120);break;case "tag":var _121=_112[1];discussionsFunctions[_114](_113,_121);break;case "newtopic":var _122=_112[1];var _123=_112[2];discussionsFunctions[_114](_113,_122,_123);break;case "newdiscussion":var _122=_112[1];var _123=_112[2];discussionsFunctions["newtopic"](_113,_122,_123);break;case "newquestion":var _122=_112[1];var _123=_112[2];discussionsFunctions["newtopic"](_113,_122,_123);break;case "newidea":var _122=_112[1];var _123=_112[2];discussionsFunctions["newtopic"](_113,_122,_123);break;case "newproblem":var _122=_112[1];var _123=_112[2];discussionsFunctions["newtopic"](_113,_122,_123);break;case "tpw":var _122=_112[1];var _123=_112[2];var _124=_112[3];var _125=_112[4];var ph=_112[5];var tps=_112[6];var _128=_112[7];var aj=_112[8];var stat=_112[9];var qstr=_112[10];var tgt=_112[11];discussionsFunctions["tphome"](_113,_122,_123,_124,_125,ph,tps,_128,aj,stat,qstr,tgt);break;default:hideLoadingImage();}return false;}var discussionsFunctions={};discussionsFunctions["tphome"]=function(_12d,_12e,_12f,_130,_131,ph,tps,_134,aj,stat,qstr,tgt){var _139=1;getForumTopics(_12e,_12f,_139,_12d,_130,_131,ph,tps,_134,aj,stat,qstr,tgt);};discussionsFunctions["home"]=function(_13a,_13b){var _13c=-1;var _13d=-1;var _13b=_13b;if(typeof _13a=="undefined"){_13a="home";_13b=1;}getForumTopics(_13c,_13d,_13b,_13a);};discussionsFunctions["chome"]=function(_13e,_13f){var _140=-1;var _141=-1;var _13f=_13f;if(typeof _13e=="undefined"){_13e="chome";_13f=1;}getForumTopics(_140,_141,_13f,_13e);};discussionsFunctions["stats"]=function(_142){var _143=-1;var _144=-1;var _145=1;getTopicsReport(_143,_144,_145,_142);};discussionsFunctions["forum"]=function(_146,_147,_148,_149){document.title=forumGroupName;var _14a=$("#topicListMainContainer");if(_14a.length>0&&_14a.is("[shouldReload=\"false\"]")){_14a.show().attr("shouldReload","true").siblings().remove();hideLoadingImage();if(isMac=="false"){setToHotkeys();}}else{var _14b={};_14b.forumGroupId=forumGroupId;_14b.forumURL=_147;_14b.fetchPage=_149;if(_148){_14b.categoryURL=_148;}doAjaxAction("/getSingleForumTopics.do",_14b,function(data){hideLoadingImage();$("#mainContent").get(0).innerHTML=data;lightBox("#chartWidget");if(_148){if(parseInt(_149)>1){$.history.add(_146+"/"+_147+"/"+_148+"/"+_149);}else{$.history.add(_146+"/"+_147+"/"+_148);}}else{if(parseInt(_149)>1){$.history.add(_146+"/"+_147+"/"+_149);}else{$.history.add(_146+"/"+_147);}}goToTop();bindTopicClicks($("#topicList"));bindTopicClicks($("#topicsList"));bindTopicListHeaderClicks($("#topicListHeader"));bindWidgetsContClick($("#topicListWidgetsCont"));var _14d=$("#forumComboCont");var _14e=_14d.attr("forumId");var _14f=_14d.attr("categoryId");var _150="NewTopic/"+_14e+"/"+_14f;if($("#allForumWidget").length>0){if($("#allForumWidget").find("li[purpose=\"forumList\"]").length<9){$("#moreForumView").hide();}}$("#NewTopicTab").attr("hashPurpose",_150);if(typeof WmsContacts!="undefined"&&ch==true){var _151=WmsContacts.getZohoContacts();setPresence(_151,"moderatorsChatList_"+_14e);setPresenceInTopicList(_151);}if(isMac=="false"){setToHotkeys();}return false;},function(_152){$("#mainContent").get(0).innerHTML=_152.responseText;hideLoadingImage();});}};discussionsFunctions["newtopic"]=function(_153,_154,_155){if(typeof _154=="undefined"&&typeof _155=="undefined"){getWritePost("-1","-1",_153);}else{_154=(typeof _154=="undefined")?-1:_154;_155=(typeof _155=="undefined")?-1:_155;getWritePost(_154,_155,_153);}};discussionsFunctions["search"]=function(_156,_157){var _158={};_158.forumGroupId=forumGroupId;if(!_157){_157=$("#searchInputBox").val();_157=$.trim(_157);}if(_157==""){showMessage(i18n["zohodiscussions.searchList.noSearchString"],"failure");hideLoadingImage();return;}_158.searchFor=_157;var _159=-1;_158.forumId=_159;_158.normalSearchType=$("#searchSelectedImage").attr("purpose");$.history.add(_156+"/"+_157);if($("#currSearchSortBy").attr("currSortBy")=="date"){_158.searchSortBy="date";}doAjaxAction("/getSearchResult.do",_158,function(data){hideLoadingImage();var _15b=$("<div></div>");_15b.get(0).innerHTML=data;$("#mainContent").get(0).innerHTML=data;bindSearchContentClick($("#mainContent"));showAuthorPopout(_15b);$("#searchInputBox").val(_157);});};discussionsFunctions["topic"]=function(_15c,_15d,_15e){if(_15e!=undefined){openSinglePost(_15d,_15c,_15e);}else{openSinglePost(_15d,_15c);}};discussionsFunctions["tag"]=function(_15f,_160){$.history.add(_15f+"/"+_160);$this=$(this);var _161={};_161.forumGroupId=forumGroupId;_161.tagName=_160;_161.fetchPage=1;doAjaxAction("/getTagRelatedPosts.do",_161,function(data){hideLoadingImage();$("#mainContent").get(0).innerHTML=data;goToTop();bindTopicClicks($("#topicList"));bindTopicClicks($("#topicsList"));bindTopicListHeaderClicks($("#topicListHeader"));bindWidgetsContClick($("#topicListWidgetsCont"));return false;},function(_163){hideLoadingImage();var _164=(_163.responseText);$("#mainContent").get(0).innerHTML=_164;});};discussionsFunctions["alltags"]=function(_165){$.history.add(_165);$this=$(this);var _166={};_166.forumGroupId=forumGroupId;doAjaxAction("/showAllTags.do",_166,function(data){hideLoadingImage();$("#mainContent").get(0).innerHTML=data;bindTagsContClick($("#allTagsContainer"));bindWidgetsContClick($("#topicListWidgetsCont"));return false;},function(_168){hideLoadingImage();var _169=(_168.responseText);$("#mainContent").get(0).innerHTML=_169;});};discussionsFunctions["allforums"]=function(_16a){var _16b={};_16b.purpose="AllForums";_16b.forumGroupId=forumGroupId;_16b[csrfParamName]=csrfToken;doAjaxAction("/AllForums.do",_16b,function(data){hideLoadingImage();document.title=i18n["zohodiscussions.general.allForums"];$.history.add("AllForums");$("#mainContent").get(0).innerHTML=data;allForumsBindActions();return false;},function(_16d){hideLoadingImage();var _16e=(_16d.responseText);$("#mainContent").get(0).innerHTML=_16e;});};function allForumsBindActions(){lightBox("#chartWidget");bindAllForumsClick($("#allForums_MainContentCont"));bindWidgetsContClick($("#topicListWidgetsCont"));goToTop();var _16f=$("#listof_FC_Counts");$("#countOfForum").html(_16f.attr("forumCount"));$("#countOfCategory").html(_16f.attr("categoryCount"));$("#countOfPosts").html(_16f.attr("postCount"));$("#countOfResponses").html(_16f.attr("responseCount"));if(typeof WmsContacts!="undefined"&&ch==true){var _170=WmsContacts.getZohoContacts();setPresenceInTopicList(_170);}}discussionsFunctions["settings"]=function(_171){var _172={};_172.forumGroupId=forumGroupId;doAjaxAction("/settings.do",_172,function(data){hideLoadingImage();$("#mainContent").get(0).innerHTML=data;$.history.add("Settings");initSettingTabClick();return false;},function(_174){});};discussionsFunctions["myarea"]=function(_175,_176,_177){document.title=i18n["zohodiscussions.general.myarea"];var _178=$("#myAreaParentContainer");if(_178.length>0&&_178.is("[shouldReload=\"false\"]")){_178.show().attr("shouldReload","true").siblings().remove();hideLoadingImage();}else{var _179={};_179.forumGroupId=forumGroupId;_179[csrfParamName]=csrfToken;if(!_176){_176="dashboard";}if(_176!="dashboard"&&_176!="myposts"&&_176!="watchlist"&&_176!="friends"&&_176!="bookmark"&&_176!="privatemsg"&&_176!="preference"){hideLoadingImage();return;}_179.myAreaAction=_176;_179.ch=ch;doAjaxAction("/getMyArea.do",_179,function(data){$("#authorPopout:visible").hide();hideLoadingImage();$("#mainContent").get(0).innerHTML=data;getMyAreaBindActions(_176,_175,"",_177);return false;},function(_17b){hideLoadingImage();var _17c=(_17b.responseText);$("#mainContent").get(0).innerHTML=_17c;});}};discussionsFunctions["user"]=function(_17d,_17e){getAuthorProfile(_17e);};discussionsFunctions["moderation"]=function(_17f){document.title=i18n["zohodiscussions.moderationAction.moderation"];var _180={};_180.forumGroupId=forumGroupId;if(portalPlanIndex>4){_180.postFor="AllWaitingApproval";}else{_180[csrfParamName]=csrfToken;_180.postFor="AllReportedSpam";}ModerationLoadingPage(_180);};function ModerationLoadingPage(_181){var _182="";if(portalPlanIndex>4){_182="/getModerationPanel.do";}else{_182="/getReportedSpam.do";}doAjaxAction(_182,_181,function(data){hideLoadingImage();$("#mainContent").get(0).innerHTML=data;$.history.add("Moderation");getModerationPanelBindAction();return false;},function(_184){hideLoadingImage();var _185=(_184.responseText);$("#mainContent").get(0).innerHTML=_185;});}function getModerationPanelBindAction(){goToTop();bindModerationTabClick();if(portalPlanIndex>4){bindModerationActionClick("AllAwaiting");}else{bindModerationActionClick("AllReportedSpam");}ModerationAction($("#moderationRightCont"));initModerationPanel($("#moderationPanel"));}function getMyAreaBindActions(_186,_187,_188,_189){bindMyAreaClicks($("#myAreaContent"));$("#authorPopout_"+ZUID).hide();showAuthorPopout($("#myAreaInnerMainContent"));if(_186!="dashboard"){if(_186=="myposts"){_186="myjournals";}if(_189!=undefined){if(_189!="topic"&&_189!="user"&&_189!="forum"&&_189!="subforum"&&_189!="following"&&_189!="follower"){_189="topic";}}if(_188!="niceurl"){if($("#"+_186+"View").length>0){getMyAreaAction($("#"+_186+"View"),_189);}else{getMyAreaAction($("#dashboardView"));}}else{var _18a=$("#"+_186+"View").attr("purpose");bindMyareaTabsActions(_18a,_189);}}else{if(_188!="niceurl"){$.history.add(_187+"/"+_186);}if(typeof WmsContacts!="undefined"&&ch==true){var _18b=WmsContacts.getZohoContacts();setPresence(_18b,"followingUserDetails");setPresence(_18b,"followersUserDetails");setPresenceInMyArea(_18b,"current_recentActivity_List");}}}function ModerationAction(_18c){_18c.unbind("click",bindModerationAction).click(bindModerationAction);showAuthorPopout(_18c);}function getTopicsReport(_18d,_18e,_18f,_190){document.title=forumGroupName;var _191={};_191.forumGroupId=forumGroupId;_191.forumId=_18d;_191.categoryId=_18e;_191.fetchPage=_18f;_191[csrfParamName]=csrfToken;doAjaxAction("/Reports.do",_191,function(data){hideLoadingImage();if(_190){$.history.add(_190);}$("#mainContent").get(0).innerHTML=data;lightBox("#chartWidget");bindReportsClicks($("#reportsLeftPanel"));});}function getForumTopics(_193,_194,_195,_196,_197,_198,ph,tps,_19b,aj,stat,qstr,tgt){document.title=forumGroupName;var _1a0=$("#topicListMainContainer");var _1a1={};_1a1.forumGroupId=forumGroupId;_1a1.forumId=_193;_1a1.categoryId=_194;_1a1.fetchPage=_195;_1a1.givenkey=_196;if(_196=="tpw"){_1a1.limit=_197;_1a1.style=_198;_1a1.ph=ph;_1a1.tps=tps;_1a1.widget=_19b;_1a1.aj=aj;_1a1.stat=stat;_1a1.querystring=qstr;_1a1.tgt=tgt;}if(_1a0.length>0&&_1a0.is("[shouldReload=\"false\"]")){_1a0.show().attr("shouldReload","true").siblings().remove();hideLoadingImage();if(isMac=="false"){setToHotkeys();}}else{doAjaxAction("/getSingleForumTopics.do",_1a1,function(data){hideLoadingImage();if(_196){if(parseInt(_195)>1){$.history.add(_196+"/"+_195);}else{$.history.add(_196);}}$("#mainContent").get(0).innerHTML=data;lightBox("#chartWidget");bindTopicClicks($("#topicList"));bindTopicClicks($("#topicsList"));bindTopicListHeaderClicks($("#topicListHeader"));bindWidgetsContClick($("#topicListWidgetsCont"));var _1a3="NewTopic/"+_193+"/"+_194;$("#NewTopicTab").attr("hashPurpose",_1a3);if($("#allForumWidget").length>0){if($("#allForumWidget").find("li[purpose=\"forumList\"]").length<9){$("#moreForumView").hide();}}if(typeof WmsContacts!="undefined"&&ch==true){var _1a4=WmsContacts.getZohoContacts();setPresenceInTopicList(_1a4);}if(isMac=="false"){setToHotkeys();}return false;},function(_1a5){hideLoadingImage();var _1a6=(_1a5.responseText);$("#mainContent").get(0).innerHTML=_1a6;});}}function getWritePost(_1a7,_1a8,_1a9,_1aa){var _1ab={};_1ab.forumGroupId=forumGroupId;_1ab.forumId=_1a7;_1ab.categoryId=_1a8;if(isTopicQuickView!="false"){showLoadingImage();}doAjaxAction("/writePost.do",_1ab,function(data){hideLoadingImage();document.title=i18n["zohodiscussions.writePost.documentTitle"]+" - "+forumGroupName;$("#mainContent").get(0).innerHTML=data;if(_1aa!="true"){$.history.add(_1a9);}$("#tabListCont li.selected").removeClass("selected");goToTop();var _1ad=$("#SelectForum > option");if((_1ad.length)==1){_1ad.attr("selected",true);}var _1ae=$("#SelectCategory > option");if((_1ae.length)==1){_1ae.attr("selected",true);}initWritePost();_1a9=_1a9.toLowerCase();if(_1a9!="newtopic"){if(_1a9=="newproblem"){_1a9="error";}else{if(_1a9=="newquestion"){_1a9="question";}else{if(_1a9=="newidea"){_1a9="idea";}else{if(_1a9=="newdiscussion"){_1a9="discuss";}}}}var _1af=$("#writepostTabsCont").find("li[topiciconclass=\""+_1a9+"\"]");selectTopicType(_1af);}hideLoadingImage();return false;},function(_1b0){hideLoadingImage();var _1b1=(_1b0.responseText);$("#mainContent").get(0).innerHTML=_1b1;});}function selectTab(_1b2){if(_1b2=="user"){$("#newtopicTab").siblings("li.selected").removeClass("selected");return;}else{if(_1b2=="newtopic"||_1b2=="search"){searchFor=$("#searchInputBox").val();searchFor=$.trim(searchFor);if(_1b2=="search"&&searchFor==""){return;}$("#"+_1b2+"Tab").siblings("li.selected").removeClass("selected");return;}else{if(_1b2=="forum"||_1b2=="topic"||_1b2=="chome"){_1b2="home";}}}$("#"+_1b2+"Tab").addClass("selected").siblings("li.selected").removeClass("selected");}function bindTopicListHeaderClicks(_1b3){_1b3.unbind("click",processTopicListHeaderClick).click(processTopicListHeaderClick);}function bindTopicClicks(_1b4){_1b4.unbind("click",processTopicListClick).click(processTopicListClick);var _1b5=_1b4.find("script").html();try{eval(_1b5);}catch(e){}}function showAuthorPopout(_1b6){if(isTopicQuickView=="false"){return false;}_1b6.find("a[purpose=\"authorProfile\"],img[purpose=\"authorProfile\"]").hover(function(){var _1b7=$(this);var _1b8=_1b7.attr("authorId");if(_1b8==-1){return;}var _1b9=_1b7.attr("authorName");var _1ba=_1b7.attr("forumId");var _1bb=setTimeout(function(){var _1bc=_1b7.position();if(_1bc.left>800){_1bc.left=_1bc.left-300;}$authorPopup=$("#authorPopout_"+_1b8);if($authorPopup.length>0){$authorPopup.css(_1bc).show();authorPopupHover($authorPopup);}else{$authorPopup=$("#authorPopoutTemplate").clone();$authorPopup.attr("popoutPurpose","authorDetailsPopout");$authorPopup.attr("id","authorPopout_"+_1b8);var _1bd={};_1bd.forumGroupId=forumGroupId;_1bd.authorId=_1b8;_1bd.forumId=_1ba;_1bd.ch=ch;doAjaxAction("/getAuthorPopup.do",_1bd,function(data){$thisAuthPopup=$("<div>"+data+"</div>");authorPopUpAction($thisAuthPopup,_1b8,_1b9,$authorPopup);});$authorPopup.css(_1bc).show();$authorPopup.appendTo("body");authorPopupHover($authorPopup);}},700);_1b7.data("destroyHandleAuthPopout",_1bb);},function(){var _1bf=$(this);var _1c0=_1bf.attr("authorId");var _1c1=_1bf.data("destroyHandleAuthPopout");if(_1c1){clearTimeout(_1c1);}var _1c2=$("#authorPopout_"+_1c0);_1c2.attr("hideAuhPopout","true");setTimeout(function(){var _1c3=_1c2.attr("hideAuhPopout");if(_1c3=="true"){_1c2.hide();}},500);});}function mouseOutAuthor(_1c4){var _1c5=_1c4;var _1c6=_1c5.attr("authorId");var _1c7=_1c5.data("destroyHandleAuthPopout");if(_1c7){clearTimeout(_1c7);}var _1c8=$("#authorPopout_"+_1c6);_1c8.attr("hideAuhPopout","true");setTimeout(function(){var _1c9=_1c8.attr("hideAuhPopout");if(_1c9=="true"){_1c8.hide();}},500);}function mouseOverAuthor(_1ca){if(isTopicQuickView=="false"){return false;}var _1cb=_1ca;var _1cc;var _1cd=_1cb.attr("authorId");if(_1cd==-1){return;}var _1ce=_1cb.attr("authorName");var _1cf=_1cb.parents("div[parentCont=\"actualParent\"]").attr("forumId");if(typeof _1cf=="undefined"){_1cf=_1cb.attr("forumId");}var _1d0=setTimeout(function(){var _1d1=_1cb.position();_1cc=$("#authorPopout_"+_1cd);if(_1cc.length>0){_1cc.css(_1d1).show();authorPopupHover(_1cc);}else{_1cc=$("#authorPopoutTemplate").clone();_1cc.attr("popoutPurpose","authorDetailsPopout");_1cc.attr("id","authorPopout_"+_1cd);var _1d2={};_1d2.forumGroupId=forumGroupId;_1d2.authorId=_1cd;_1d2.forumId=_1cf;_1d2.ch=ch;doAjaxAction("/getAuthorPopup.do",_1d2,function(data){$thisAuthPopup=$("<div>"+data+"</div>");authorPopUpAction($thisAuthPopup,_1cd,_1ce,_1cc);});_1cc.css(_1d1).show();_1cc.appendTo("body");authorPopupHover(_1cc);}},700);_1cb.data("destroyHandleAuthPopout",_1d0);}function authorPopUpAction(_1d4,_1d5,_1d6,_1d7){_1d4.find("li[purpose=\"watchUser\"]").click(function(){$thisWatchCont=$(this);var _1d8={};_1d8.forumGroupId=forumGroupId;_1d8.itemId=_1d5;_1d8.itemType=3;_1d8[csrfParamName]=csrfToken;var _1d9=$thisWatchCont.attr("watchAction");var _1da=(_1d9=="watch")?"/watchUser.do":"/unwatchUser.do";doAjaxAction(_1da,_1d8,function(data){if(data=="SUCCESS"){$thisWatchCont.attr("watchAction",(_1d9=="watch")?"unwatch":"watch");var _1dc=((_1d9=="watch")?i18n["zohodiscussions.general.Unwatch"]:i18n["zohodiscussions.general.watch"])+" "+_1d6;$thisWatchCont.find("a[purpose=\"watchuserNameCont\"]").html(_1dc);if(_1d9=="watch"){showTipper(i18n["zohodiscussions.generalmessage.userAddedToWatchlist"],"success");}else{showTipper(i18n["zohodiscussions.generalmessage.userRemovedFromWatchlist"]);}}});});_1d4.find("li[purpose=\"addAsFriend\"]").click(function(){$addFriendCont=$(this);var _1dd=$addFriendCont.attr("successMsg");var _1de={};_1de.forumGroupId=forumGroupId;_1de.userId=_1d5;_1de[csrfParamName]=csrfToken;doAjaxAction("/addAsFriend.do",_1de,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"]);showTipper(_1dd,"success");}});});_1d4.find("li[purpose=\"authorProfile\"]").click(function(){if(_1d6==ZU_Name){processHash("MyArea");}else{processHash("User/"+_1d6);}});_1d7.html("").append(_1d4);if(typeof WmsContacts!="undefined"&&ch==true){var _1e0=WmsContacts.status(_1d5);if(_1e0===false){_1e0=9;}manageUserChatStatus("authorPopup_"+_1d6,_1e0,_1d6);}}function authorPopupHover(_1e1){_1e1.hover(function(){_1e1.attr("hideAuhPopout","false");var _1e2=_1e1.data("destroyHandle");if(_1e2){clearTimeout(_1e2);}},function(){var _1e3=setTimeout(function(){_1e1.hide();_1e1.unbind("mouseenter").unbind("mouseleave");},700);_1e1.data("destroyHandle",_1e3);});}function displaySearchOption(){var _1e4=$("#listOfSearchOptions");_1e4.show();_1e4.find("li").unbind("click").click(function(){var _1e5=$(this);var _1e6=_1e5.find("div");var _1e7=_1e6.attr("class");var _1e8=_1e6.attr("purpose");if(!_1e6.is(".imgAdvanceSearch")){$("#searchSelectedImage").attr("class",_1e7).attr("purpose",_1e8);}else{if($("#advanceSearchContainerForm").is(":visible")){$("#listOfSearchOptions").hide();return;}if($("#searchMainContainer").is(":visible")){$("#normalSearchInSearchList").hide();$("#advanceSearchContainerForm").show();$("#advanceSearchInpurBox").focus();return;}showLoadingImage();var _1e9={};_1e9.forumGroupId=forumGroupId;doAjaxAction("/AdvanceSearchContainer.do",_1e9,function(data){hideLoadingImage();var _1eb=$("#mainContent > div:first");var _1ec=$("<div></div>");_1ec.get(0).innerHTML=data;_1ec.insertBefore(_1eb);_1ec.find("#advanceSearchContainerForm").show();_1ec.find("#advanceSearchInpurBox").focus();if($("#normalSearchInSearchList").is(":visible")){$("#normalSearchContainer").hide();}bindSearchContentClick(_1ec);},function(_1ed){hideLoadingImage();var _1ee=(_1ed.responseText);$("#mainContent").get(0).innerHTML=_1ee;});}_1e4.hide();});var _1ef=_1e4.parent("div.searchOpList");_1ef.hover(function(){var _1f0=_1ef.data("destroyHandle");if(_1f0){clearTimeout(_1f0);}},function(){var _1f1=setTimeout(function(){_1e4.hide();_1ef.unbind("mouseenter").unbind("mouseleave");},500);_1ef.data("destroyHandle",_1f1);});}function bindSearchContentClick(_1f2){_1f2.unbind("click",processSearchContClick).click(processSearchContClick);$("#SearchforumCategoryVice").change(function(){searchForumCatSelect($(this));});}function searchForumCatSelect(_1f3){var _1f4=_1f3.val();var _1f5=$("#searchCategoryList").val().split("$$");$.each(_1f5,function(_1f6,item){if(item.indexOf(_1f4+":")>-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(_1f4==-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(_1f8){_1f8.unbind("click",processWidgetsContClick).click(processWidgetsContClick);showAuthorPopout(_1f8);bindSubscribeAction();var _1f9=$("#followAnnouncement a[purpose=\"watchAnnouncement\"]");_1f9.click(function(_1fa){watchThisItem(_1f9,"announcement",_1fa);});}function bindAllForumsClick(_1fb){_1fb.unbind("click",processAllForumsClick).click(processAllForumsClick);showAuthorPopout(_1fb);}function processTopicListHeaderClick(_1fc){var _1fd=$(_1fc.target);var _1fe=_1fd.parent();if(_1fd.is("#forumsFilter li,#categoriesFilter li,#currentCategoryContext,#currentForumContext")){hashPurpose=_1fd.attr("hashPurpose");processHash(hashPurpose);return false;}else{if(_1fd.is("div[purpose=\"linkForDropDown\"]")){var _1ff=_1fd;var _200=_1ff.attr("dropDownContLocation");var _201=$(_1ff.attr("parentCont"));if(_201.is(".newCombo")){_201.addClass("newComboSelected").removeClass("newCombo");}else{_201.addClass("newCombo").removeClass("newComboSelected");}var _202=$("#"+_200);_202.toggle();}}if(_1fd.is("#topicListFilter li[purpose=\"filterLink\"]")){var _203=_1fd.attr("topicFilter");$topicFilterParent=$("#topicListFilter");var _204=$topicFilterParent.attr("forumURL");var _205=$topicFilterParent.attr("subForumURL");var _206=$topicFilterParent.attr("postSinceLastVisitTime");var _207="";if($topicFilterParent.attr("isTypeURL")=="yes"){getMoreTopics(_204,_205,fetchPage,_203,"",_207);$("#currentFilterContext").html(_1fd.text());}else{manageFilterHash(_204,_205,_203,_207);}return false;}if(_1fd.is("#showAllTags")&&_1fd.attr("isNiceURL")!="Yes"){processHash("AllTags");}if(_1fd.is("#innerTabFilter span")&&_1fe.attr("purpose")=="filterTab"){manageFilterTabList(_1fd);}if(_1fd.is("#innerTabFilter div[purpose=\"filterTabCombo\"]")){manageFilterMenuList(_1fd.attr("filterParent"));}var _208=$("#forumsListOptions,#categoriesListOptions,#typeFilterOptions");_208.hover(function(){var _209=_208.data("destroyHandle");if(_209){clearTimeout(_209);}},function(){var _20a=setTimeout(function(){_208.parent(".newComboSelected").addClass("newCombo").removeClass("newComboSelected");_208.hide();},500);_208.data("destroyHandle",_20a);});}function manageFilterTabList(_20b){var _20c=$("#innerTabFilter");_20c.find("li.selectedTab").removeClass("selectedTab");_20b.parents("li").addClass("selectedTab");var _20d=_20c.attr("forumURL");var _20e=_20c.attr("subForumURL");var _20f=1;var _210=_20b.attr("filterBy");var _211="";var _212=_20c.attr("topicFilterType");var _213=_20c.attr("postSinceLastVisitTime");if(_212!="All"){_211=_20b.attr("filterLabelId");if(_211){_211=_210;_210=_212;}}if(_20c.attr("isTypeURL")=="yes"){getMoreTopics(_20d,_20e,_20f,_210,_213,_211);}else{manageFilterHash(_20d,_20e,_210,_211);}}function manageFilterHash(_214,_215,_216,_217){if(_214==""&&_215==""){if(_217){processHash("filter/"+_216+"/"+_217+"/1");}else{processHash("filter/"+_216+"/1");}}else{if(_215==""){if(_217){processHash("forum/"+_214+"/filter/"+_216+"/"+_217+"/1");}else{processHash("forum/"+_214+"/filter/"+_216+"/1");}}else{if(_217){processHash("forum/"+_214+"/"+_215+"/filter/"+_216+"/"+_217);}else{processHash("forum/"+_214+"/"+_215+"/filter/"+_216);}}}}function manageFilterMenuList(_218){var _219=$("#"+_218);if($("#innerTabFilter div.forumOptions").is(":visible")){$(this).hide();}_219.removeClass("newCombo").addClass("newComboSelected");_219.hover(function(){var _21a=_219.data("destroyHandle");if(_21a){clearTimeout(_21a);}},function(){var _21b=setTimeout(function(){_219.removeClass("newComboSelected").addClass("newCombo");},500);_219.data("destroyHandle",_21b);});_219.find("li[purpose=\"filterTabMenu\"]").unbind("click").click(function(){var _21c=$(this);var _21d=$("#innerTabFilter");var _21e=_21d.attr("forumURL");var _21f=_21d.attr("subForumURL");var _220=_21c.attr("labelName");var _221=_21c.parent().attr("filterType");var _222=1;_21d.find("li.selectedTab").removeClass("selectedTab");$("#"+_221+"FilterMenuList").addClass("selectedTab");var _223=_21c.attr("filterBy");var _224="";if(_223){_221=_223;}if(_21d.attr("isTypeURL")=="yes"){getMoreTopics(_21e,_21f,_222,_221,"",_220);}else{manageFilterHash(_21e,_21f,_221,_220);}});}function bindTagsContClick(_225){_225.find("li[purpose =\"getTagPosts\"]").click(function(){$this=$(this);var _226=$this.attr("hashPurpose");processHash(_226);});}function processTopicListClick(_227){var _228=$(_227.target);var _229=_228.parent();var _22a=$("#paginationContainer");var _22b="topicList";var _22c=_228.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");if(_228.is("div.quickViewBtn")||_228.is("a[purpose=\"postTitleQuickView\"]")){_22c=_22c||_229.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");handleTopicClick(_227,_22c,_22b);}else{if(_228.is("a[purpose=\"postTitle\"]")||_228.is("div[purpose=\"postTitle\"]")){showLoadingImage();if(isTopicQuickView=="false"){}else{var _22d=_228.parents("div[parentCont=\"actualParent\"]").attr("recentResponseId");var _22e=_228.attr("isResponse");if(_22d!=undefined&&_22e=="true"){processHash("Topic/"+_22c+"/"+_22d);}else{processHash("Topic/"+_22c);}return false;}}else{if(_229.is("li[purpose=\"moreAction\"]")){manageMoreAction(_229);}else{if(_228.is("a[purpose=\"moreAction\"]")){var _22f=_228.parents("li");manageMoreAction(_22f);}else{if(_228.is("a[purpose=\"linkedTopicTitle\"]")){showLoadingImage();if(isTopicQuickView=="false"){}else{var _230=_228.attr("linkToTopicId");processHash("Topic/"+_230);return false;}}else{if(_228.is("li[linkPurpose=\"replyToTopic\"]")||_229.is("li[linkPurpose=\"replyToTopic\"]")){_22c=_22c||_229.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");if(_22a.data("inEditMode")==true){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");var _231=_22a.data("editorContLocation");var _232=_22a.data("eachTopicContainerId");var _233=_22a.data("forumTopicId");if(_233!=_22c){handleTopicClick(_227,_233,"editTopicList");}setFocusToContainer($(_231));return false;}$("#eachTopicReplyCont_"+_22c).show();newOpenEditor($("#eachTopicReply_"+_22c),"responseContent","postContentTA","replyToTopic_"+_22c,"Write","paginationContainer");setFocusToContainer($("#eachTopicReplyCont_"+_22c));_22a.data("inEditMode",true);_22a.data("editorContLocation","#eachTopicReplyCont_"+_22c);_22a.data("eachTopicContainerId","#eachTopic_"+_22c);_22a.data("forumTopicId",_22c);return false;}else{if((_228.is("#olderPostsLink")||_228.is("#newerPostsLink"))&&_228.is(".navBtnEnabled")){var _234=_228.attr("forumURL");var _235=_228.attr("categoryURL");var _236=_228.attr("fetchPage");var _237=_228.attr("topicFilter");var _238=_228.attr("getPostFor");var _239=_228.attr("topicStatus");var _23a=_228.attr("postSinceLastVisitTime");if(typeof _238=="undefined"){getMoreTopics(_234,_235,_236,_237,_23a,_239,"true");}else{var _23b=_228.attr("tag_Name");getMoreTagRelatedPost(_236,_23b,_238);}}else{if(_228.is("a[purpose=\"forumPostsFilter\"]")){hashPurpose=_228.attr("hashPurpose");processHash(hashPurpose);return false;}else{if((_228.is("a[purpose=\"authorProfile\"]"))||_228.is("img[purpose=\"authorProfile\"]")){var _23c=_228.attr("authorName");if(_23c==ZU_Name){processHash("MyArea");}else{processHash("User/"+_23c);}return;}else{if(_228.is("div.imgSmallWatchSel")||_228.is("div.imgSmallWatch")){watchThisItem(_228,"singleTopicWatch",_227);return;}else{if((_228.is("li.imgNavPrevious")||_228.is("li.imgNavNext"))&&!_229.is(".navLoading")){checkPrevNextResponse(_228);return;}else{if((_228.is("li.imgNavStart")||_228.is("li.imgNavEnd"))&&!_229.is(".navLoading")){firstOrLastResponse(_228);return;}}}}}}}}}}}}if(_229.is("li[purpose=\"watchAction\"]")){watchThisItem(_229,_22b,_227);return;}else{if(_229.is("li[purpose=\"emailThisTopic\"]")){openEmailTopicDialog(_229);var _22f=_229.parents("li[purpose=\"moreAction\"]");manageMoreAction(_22f);return;}else{if(_229.is("li[purpose=\"moderateThisTopic\"]")){moderateAction(_229,_22b,_227);return;}else{if(_229.is("li[actionPurpose=\"reportSpam\"],span[actionPurpose=\"reportSpam\"]")){singlePostSpamAction(_229,_22b);return;}else{if(_229.is("div[actionPurpose=\"reportInappropriate\"]")||_229.is("li[actionPurpose=\"reportInappropriate\"]")||_229.is("span[actionPurpose=\"reportInappropriate\"]")){singlePostSpamAction(_229,_22b);return;}else{if(_228.is("span[purpose=\"inappropriateReason\"]")){getReasonForInapppropriate(_228);}else{if(_229.is("li[actionPurpose=\"delete\"]")){singlePostDeleteAction(_229,_22b);return;}else{if(_229.is("#removeTopicLink")||_229.is("li[purpose=\"removeTopicLink\"]")){deletelinkedTopic(_229);}else{if(_229.is("li[actionPurpose=\"edit\"]")){var _23d=_229.attr("responseId");var _23e=_229.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _23f="#eachTopic_"+_23e;if(_22a.data("inEditMode")){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");_231=_22a.data("editorContLocation");var _233=_22a.data("forumTopicId");if(_23e!=_233){handleTopicClick(_227,_233,_22b);}setFocusToContainer($(_231));return false;}newOpenEditor($("#recentResponseContent_"+_23d),"responseContent","postContentTA",("editPostContent_"+_23d),"Edit",("eachTopic_"+_23d));setFocusToContainer($(_23f));_22a.data("inEditMode",true);_22a.data("editorContLocation",_23f);_22a.data("forumTopicId",_23e);$("#postTextContent_"+_23d).find("ul.singlePostActions").hide();$("#linkedTopic_"+_23d).hide();$("#singlePostActions_"+_23d).hide();$("#recent_ResPonse_"+_23d).find("div.navigationCont").hide();$("#previewResponse").attr("location","topicListEditResponse");$("#previewResponse").attr("responseId",_23d);$("#previewResponse").attr("forumTopicId",_23e);return false;}else{if(_229.is("li[deletepurpose=\"deleteAttachment\"]")){deletePublishedAttachment(_229,_227);return;}else{if(_229.is("li[votePurpose]")){var _240=_229;var _23d=_240.attr("responseId");_22c=_240.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _241=_240.attr("votePurpose");var _242=(_241=="removeVote")?"/removeResponseVote.do":"/voteResponse.do";showSmallLoadingImage(_227);var _243={};_243.forumGroupId=forumGroupId;_243.responseId=_23d;_243.forumTopicId=_22c;_243[csrfParamName]=csrfToken;doAjaxAction(_242,_243,function(data){if(data=="SUCCESS"){refreshResponseVoteContainer(_23d);}else{hideLoadingImage();}});}else{if(_229.is("li[bestResponse]")){var _240=_229;var _23d=_240.attr("responseId");var _22c=_240.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _245=_240.attr("topicAuthorId");var _246=_240.attr("bestResponse");var _243={};_243.forumGroupId=forumGroupId;if(_246=="choose"){_243.responseId=_23d;}_243.forumTopicId=_22c;if(_245==ZUID){_243.topicowner="true";}_243[csrfParamName]=csrfToken;var _247=(_246=="choose")?"/bestResponse.do":"/removeBestResponse.do";showSmallLoadingImage(_227);doAjaxAction(_247,_243,function(data){if(data=="SUCCESS"){var _249=(_246=="choose")?i18n["zohodiscussions.singlepost.bestResponseSuccessMsg"]:i18n["zohodiscussions.singlePost.removeBestResponseMsg"];var _24a=(_246=="choose")?"success":"info";showTipper(_249,_24a);refreshSingleTopic(_22c);}else{hideLoadingImage();showMessage(i18n["zohodiscussions.generalmessage.noPermission"]);}});}else{if(_229.is("div[voteTopic]")){var _240=_229;var _24b=_240.attr("firstResponseId");var _22c=_240.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");showSmallLoadingImage(_227);var _24c={};_24c.forumGroupId=forumGroupId;_24c.responseId=_24b;_24c.forumTopicId=_22c;_24c[csrfParamName]=csrfToken;doAjaxAction("/voteTopic.do",_24c,function(data){if(data=="SUCCESS"){refreshResponseVoteContainer(_24b);}else{hideLoadingImage();}});}}}}}}}}}}}}}}function manageMoreAction(_24e){if(_24e.is(".newComboSelectedNm")){_24e.removeClass("newComboSelectedNm").addClass("newCombo");_24e.find("div.forumOptins").hide();return;}_24e.removeClass("newCombo").addClass("newComboSelectedNm");var _24f=_24e.find("div.forumOptins");_24f.show();_24e.hover(function(){_24e.attr("hideAuhPopout","false");var _250=_24e.data("destroyHandle");if(_250){clearTimeout(_250);}},function(){var _251=setTimeout(function(){_24e.removeClass("newComboSelectedNm").addClass("newCombo");_24f.hide();_24e.unbind("mouseenter").unbind("mouseleave");},500);_24e.data("destroyHandle",_251);});}function refreshResponseVoteContainer(_252){var _253={};_253.forumGroupId=forumGroupId;_253.responseId=_252;doAjaxAction("/refreshSingleResponse.do",_253,function(data){var _255=$(data).find("div[contPurpose=\"voteContainer\"]");$("#postTextContent_"+_252+" div[contPurpose=\"voteContainer\"]").html(_255.html());hideLoadingImage();});}function backtoEditor(){$("#addForumPostForm").show();$("#writeNewTopic").show();$("#publishPreviewedTopic").hide();$("#backToEditor").hide();$("#preview_Posts").hide();$("#writePostButtons").show();$("#forumTagsPreview").html(" ");}function publishPreviewedTopic(){$("#publishTopic").trigger("click");}function writePostPreview(_256,_257,flag,_259){var _25a=$("#topicTitle").val();var _25b=_25a.replace(/^<+|<+$/g,"&lt;").replace(/<+/g,"&lt;").replace(/^>+|>+$/g,"&gt;").replace(/>+/g,"&gt;");_25b=_25b.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ");if(_25b==""){hideLoadingImage();setFocusToContainer(($("#topicTitle")).focus());enablePostButtons();showMessage(i18n["zohodiscussions.writePost.TopicTitleCannotbeEmptymessage"],"failure");return;}if(_25b.length>200){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.TopicTitleLengthMsg"],"failure");enablePostButtons();return;}var _25c=editor.getContent();_25c=_25c.replace(/^\s+/g,"").replace(/\s+$/g,"");var _25d=$("<div></div>").html(_25c);_25c=_25d.text();if(_25c==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");enablePostButtons();return;}var _25e=$("#SelectForum").val();if(_25e==null){hideLoadingImage();$("#selectForumMessage").show();setFocusToContainer($("#SelectForum"));enablePostButtons();showMessage(i18n["zohodiscussions.writePost.selectAnyForum"],"failure");return;}else{$("#selectForumMessage").hide();}var _25f=$("#forumTags").val();if(_25f!=""){_25f=_25f.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");if(_25f.match(/[a-zA-Z0-9, ]+$/)==null){hideLoadingImage();showMessage(i18n["zohodiscussions.singlepost.specialCharacterNotAllowedMsg"],"failure");enablePostButtons();return;}}if(_259){$("#previewAttachment >li").html("");var _260=$("#attachmentsListCont").find("div[attachmentDetails]");var _261=$("#attachmentsListCont").find("div[attachmentDetails]").length;if(_261>0){var _262=$("#previewAttachment");attachmentListPreview(_262,_260);$("#AttachmentPreviewCont").show();}else{$("#AttachmentPreviewCont").hide();}}$("#addForumPostForm").hide();$("#writeNewTopic").hide();$("#publishPreviewedTopic").show();$("#backToEditor").show();var _263=$("#preview_Posts").show();$("#writePostButtons").hide();var _264=$("#TopicContentHolder").attr("class");var _265=$("#topicTypePreview").attr("class");var _266=_265.split(" ");$("#topicTypePreview").removeClass(_266[1]).addClass(_264);if(_263.is(":visible")){$("#preview_postHeader").find("a[purpose=\"authorProfile\"]").html(_256);$("#previewDocumentTitle").html(_25b);$("#preview_postHeader").find("a[purpose=\"forum_Topic\"]").html($("#SelectForum option:selected").text());var _267=$("#SelectCategory option:selected").text();if(_267!="Uncategorised"){$("#preview_postHeader").find("a[purpose=\"category_Topic\"]").html("&nbsp;&raquo; "+_267+"");}_25f=_25f.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");if(_25f==""){$("#forumTagsPreview").append("No tags available for this topic.");}var _268=_25f.split(",");for(var _269=0;_269<_268.length;_269++){if(jQuery.trim(_268[_269])!=""){$("#forumTagsPreview").append("<li><div class=\"imgTag flLeft\"></div><div class=\"flLeft\">&nbsp;<a class=\"blueLink\" >"+_268[_269]+"</a>&nbsp;</div><div class=\"clearAll\"></div> </li>");}}var _25c=editor.getContent();_25c=_25c.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_25c==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");return;}_263.find("#responsePreviewContentContainer").html(_25c);}}function forHidingSmallLoadingImg(){var _26a="";var cont="";if($("#newPostRightCont").length>0){_26a=$("#newPostRightCont");}else{if($("#attachBrowseCont").length>0){_26a=$("#attachBrowseCont");}}_26a.find("[purpose='attachLoadingCont']").hide();}function processSearchContClick(_26c){var _26d=$(_26c.target);var _26e=_26d.parent();if($("#loadingImg").is(":visible")){return;}if(_26e.is("div[purpose=\"advanceSearch\"]")){$("#advanceSearchContainerForm").show();$("#normalSearchInSearchList").hide();}else{if(_26d.is("button[purpose=\"advanceSearchCancel\"]")||_26d.is("div[purpose=\"advanceSearchCancel\"]")){if($("#advancedSearchForm").is(":visible")){$("#advancedSearchForm").remove();}else{$("#advanceSearchContainerForm").hide();$("#normalSearchContainer").show();$("#normalSearchInSearchList").show();}}else{if(_26d.is("button[purpose=\"normalSearch\"]")){var _26f=$("#normalSearchInputBox").val();processHash("search/"+_26f);}else{if(_26d.is("button[purpose=\"getAdvanceSearch\"]")){getAdvanceSearchResult();}else{if(_26d.is("a[purpose=\"postTitle\"]")){var _270=_26d.attr("forumTopicId");var _26f=_26d.attr("searchFor");openSinglePost(_270,"topic",_26f);return;}else{if(_26e.is("a[purpose=\"postTitle\"]")){var _270=_26e.attr("forumTopicId");var _26f=_26e.attr("searchFor");openSinglePost(_270,"topic",_26f);return;}else{if(_26d.is("a[purpose=\"forumAction\"]")||_26d.is("a[purpose=\"categoryAction\"]")){var _271=_26d.attr("hashPurpose");processHash(_271);}else{if(_26d.is("a[purpose=\"authorProfile\"]")||_26e.is("a[purpose=\"authorProfile\"]")){var _272=_26d.attr("authorName");if(!_272){_272=_26e.attr("authorName");}var _273=_26d.attr("singleClickflag");if(!_273){_273=_26e.attr("singleClickflag");}if(_273=="0"){if(_272==ZU_Name){processHash("MyArea");_26d.attr("singleClickflag","1");}else{processHash("User/"+_272);_26d.attr("singleClickflag","1");}}return;}else{if(_26d.is("li.navBtnEnabled")&&_26d.is("[navType=\"searchNav\"]")){var _274=_26d.attr("purpose");searchNavigation(_26e,_274);return;}else{if(_26d.is("a[purpose=\"relativeLinkSearch\"]")){searchNavigation(_26d,"relativeLinkSearch");}else{if(_26d.is("a[purpose=\"sortbyrelevance\"]")&&!_26d.is(".boldText")){searchNavigation($("#breadCrumbForSearch a[fieldType=\"All\"]"),"breadCrumbForSearch","relevance");}else{if(_26d.is("a[purpose=\"sortbydate\"]")&&!_26d.is(".boldText")){searchNavigation($("#breadCrumbForSearch a[fieldType=\"All\"]"),"breadCrumbForSearch","date");}else{if(_26d.is("a[purpose=\"breadCrumbForSearch\"]")){searchNavigation(_26d,"breadCrumbForSearch");}else{if(_26d.is("a[purpose=\"expandForumList\"]")){var _275=_26d.attr("status");if(_275=="off"){_26d.attr("status","on").html("&laquo; less");_26d.parents("ul").find("li").show();}else{_26d.attr("status","off").html("more &raquo;");var _276=0;_26d.parents("ul").children("li").each(function(){if(_276>4){$(this).hide();}_276++;});}}}}}}}}}}}}}}}}function searchNavigation(_277,_278,_279){showLoadingImage();var _27a=parseInt(_277.attr("fetchPage"));var _27b=_277.attr("fieldType");var _27c=_277.attr("categId");var _27d=_277.attr("pathTraverse");var _27e=$("#breadCrumbForSearch");if(_278=="next"){_27a=_27a+1;}else{if(_278=="prev"){_27a=_27a-1;}else{_27a=1;}}var _27f=_279;if(_27f!="relevance"&&_27f!="date"){_27f=$("#currSearchSortBy").attr("currSortBy");}if($("#searchListContainer").is(".selected")){doAjaxAction("/getMoreSearchResult.do?fetchPage="+_27a+"&searchSortBy="+_27f+"&category_id="+_27c+"&category_pathTraverse="+_27d+"",$("#advanceSearchForm").serialize(),function(data){hideLoadingImage();reloadeSearchContainer(data,_278,_27b,_281,_27c,_27d,_27f);});}else{var _282={};_282.fetchPage=_27a;_282.category_id=_27c;_282.category_pathTraverse=_27d;_282.searchSortBy=_27f;var _281=_277.attr("forumId");if(!_281){_281=-1;}if(_278=="breadCrumbForSearch"){_282.searchFor=_27e.attr("searchFor");}else{_282.searchFor=_277.attr("searchFor");}_282.forumGroupId=forumGroupId;_282.forumId=_281;_282.normalSearchType=$("#searchSelectedImage").attr("purpose");doAjaxAction("/getMoreSearchResult.do",_282,function(data){hideLoadingImage();reloadeSearchContainer(data,_278,_27b,_281,_27c,_27d,_27f);});}}function reloadeSearchContainer(data,_285,_286,_287,_288,_289,_28a){var _28b=$("#breadCrumbForSearch");var _28c=$("<div></div>");_28c.get(0).innerHTML=data;var _28d=_28c.find("#searchListContainer").html();$("#searchListContainer").html(_28d);var _28e=_28c.find("#searchResultViewRange").html();$("#searchResultViewRange").html(_28e);var _28f=_28c.find("#searchFilterArea").html();$("#searchFilterArea").html(_28f);var _290=_28c.find("#currSearchSortBy").html();$("#currSearchSortBy").html(_290).attr("currSortBy",_28a);if(_285=="relativeLinkSearch"){var _291=$("<span> &raquo; <a class=underline href=javaScript:; purpose=breadCrumbForSearch fieldType="+_286+" forumId="+_287+" categId="+_288+" pathTraverse="+_289+">"+_286+"</a></span>");_291.insertAfter($("#breadCrumbForSearch").find("span:last"));}else{if(_285=="breadCrumbForSearch"){var _292=0;_28b.children().each(function(){var _293=$(this);var _294=_293.find("a").attr("fieldType");if(_292==1){_293.remove();}if(_294==_286){_292=1;}});}}}function getAdvanceSearchResult(){showLoadingImage();var _295=$("#advanceSearchInpurBox").val();_295=$.trim(_295);if(_295==""){showMessage(i18n["zohodiscussions.searchList.noSearchString"],"failure");hideLoadingImage();return;}var _296=$("#SearchforumCategoryVice");var _297="forumId";var _298={};doAjaxAction("/getAdvanceSearchResult.do",$("#advanceSearchForm").serialize(),function(data){hideLoadingImage();var _29a=$("<div></div>");_29a.get(0).innerHTML=data;var _29b=$("#searchContainer");if($("#searchListContainer").is(":visible")){var _29c=_29a.find("#searchResultFullContainer").html();$("#searchResultFullContainer").html(_29c);$("#searchListContainer").addClass("selected");}else{$("#mainContent").get(0).innerHTML=data;bindSearchContentClick($("#mainContent"));$("#advanceSearchContainerForm").show();$("#normalSearchInSearchList").hide();}},function(_29d){hideLoadingImage();$("#mainContent").html(_29d.responseText);});}function processWidgetsContClick(_29e){var _29f=$(_29e.target);var _2a0=_29f.parent();if(_29f.is("a[hashPurpose]")&&_29f.is("a[currpurpose=\"usingHash\"]")){var hash=_29f.attr("hashPurpose");if(isTopicQuickView=="false"&&hash.indexOf("Topic/")==0){}else{processHash(hash);return false;}}else{if(_29f.is("div.teeplus")){var _2a2=_29f.attr("forumId");var _2a3=$("#allForumControl").find("div[purpose=\"subForumView_"+_2a2+"\"]");_2a3.removeClass("teeplus").addClass("teeminus");$("ul.eachCategoryContainer_"+_2a2).show();}else{if(_29f.is("div.teeminus")){var _2a2=_29f.attr("forumId");var _2a3=$("#allForumControl").find("div[purpose=\"subForumView_"+_2a2+"\"]");_2a3.removeClass("teeminus").addClass("teeplus");$("ul.eachCategoryContainer_"+_2a2).hide();}else{if(_2a0.is("#forumPermalink")){var _2a4=_2a0.attr("thisForumPermalink");$("#PermalinkCont textarea").val(_2a4);$("#permalink_Text").select();$("#PermalinkCont").show().parent().show();return;}else{if(_2a0.is("li.watchingForum")){watchThisItem(_2a0,"singleForumActions",_29e);}else{if(_2a0.is("li.watchingCategory")){watchThisItem(_2a0,"singleCategoryActions",_29e);}else{if(_29f.is("a[purpose=\"newWatchedUser\"]")){processHash("myarea/dashboard");return;}else{if(_29f.is("a[purpose=\"newPrivateMsg\"]")){processHash("myarea/privateMsg");return;}else{if(_29f.is("a[purpose=\"newRecentActivity\"]")){var _2a5=_29f.attr("currStatus");if(_2a5=="dashboard"){processHash("myarea/"+_2a5);return;}processHash("myarea/watchList/"+_2a5);return;}else{if(_29f.is("a[purpose=\"authorProfile\"]")){var _2a6=_29f.attr("authorName");var _2a7=_29f.attr("singleClickflag");if(_2a7=="0"){if(_2a6==ZU_Name){processHash("MyArea");_29f.attr("singleClickflag","1");}else{processHash("User/"+_2a6);_29f.attr("singleClickflag","1");}}return;}else{if(_2a0.is("#loginToParticipate")){$("#signinwidgetBox").hide();$("#iamLoginBox").show();}else{if(_2a0.is("#chartMenu")){if(_29f.is("li")){_29f.siblings().removeClass("selected");_29f.addClass("selected");var _2a8=_29f.attr("assocImage");$(_2a8).show().siblings().hide();}}else{if(_2a0.is("#topContributorsMenu")){if(_29f.is("li")){_29f.siblings().removeClass("selected");_29f.addClass("selected");var _2a8=_29f.attr("assocDiv");$(_2a8).show().siblings("ul").hide();}}}}}}}}}}}}}}}function processAllForumsClick(_2a9){var _2aa=$(_2a9.target);var _2ab=_2aa.parent();if(_2aa.is("a[hashPurpose]")){var _2ac=_2aa.attr("hashPurpose");if((isTopicQuickView=="false"&&_2ac.indexOf("Topic/")==0)||_2aa.attr("isNiceUrl")=="Yes"){}else{processHash(_2ac);return false;}}else{if(_2ab.is("li[purpose=\"eachForumPermalink\"]")){var _2ad=_2ab.attr("thisForumPermalink");$("#PermalinkCont textarea").val(_2ad);$("#permalink_Text").select();$("#PermalinkCont").show().parent().show();return;}else{if(_2ab.is("li.watchingForum")){watchThisItem(_2ab,"singleForumActions",_2a9);}}}}function handleTopicClick(_2ae,_2af,_2b0){var _2b1=$("#eachTopic_"+_2af);var _2b2=$("#lastResponse_"+_2af);var _2b3=_2b2.parents("div[parentCont=\"actualParent\"]").attr("recentResponseId");var _2b4=$("#topicList");_2b4.data("currentSelectedPost",_2b1);var _2b5=_2b4.data("currentFocusPost");if(_2b5!=undefined){_2b5.removeClass("hotKeyTopicCont");}_2b4.data("currentFocusPost",_2b1);if(_2b2.is(":visible")==true){_2b1.removeClass("singleTopicContSel").addClass("singleTopicCont");}else{_2b1.siblings("div.singleTopicContSel").removeClass("singleTopicContSel").addClass("singleTopicCont");_2b1.removeClass("singleTopicCont").addClass("singleTopicContSel");if(topicContent[_2af]){$("#recentResponseContent_"+_2b3).html(topicContent[_2af]);topicContent[_2af]=undefined;}setFocusToContainer($("#eachTopic_"+_2af),false,0);}if(_2b2.attr("navStatus")=="No"&&_2b0=="topicList"){_2b2.attr("navStatus","Yes");getprevAndFirstPost(_2b2);}}function getMoreTopics(_2b6,_2b7,_2b8,_2b9,_2ba,_2bb,_2bc){showLoadingImage();var _2bd={};var _2be="";var _2bf=$("#innerTabFilter");if($("#topicListFilter").is(":visible")){_2bf=$("#topicListFilter");}if(_2b6!=""){_2bd.forumURL=_2b6;_2be="forum/"+_2b6;}if(_2b7!=""){_2bd.categoryURL=_2b7;_2be=_2be+"/"+_2b7;}_2bd.forumGroupId=forumGroupId;_2bd.fetchPage=_2b8;var _2c0=0;if(_2b9&&_2b9.toLowerCase()!="all"&&(isOneTopicType!="true"||_2b9.toLowerCase()!="questions"&&_2b9.toLowerCase()!="ideas"&&_2b9.toLowerCase()!="problems")){if(_2be==""){_2be="filter";}else{_2be=_2be+"/filter";}_2c0=1;_2be=_2be+"/"+_2b9;}if(_2b9){if(_2bf.attr("isTypeURL")=="yes"){var _2c1=_2bf.attr("topicfiltertype");if(_2b9.toLowerCase()=="all"){_2b9=_2c1;}else{if(_2b9.toLowerCase()=="unrepliedposts"){_2bd.unReplyWithType=_2c1;}}}_2bd.topicFilter=_2b9;}if(_2b9=="postssincelastvisit"){var _2c2=_2bf.attr("postSinceLastVisitTime");if(_2c2!=null&&_2c2!="undefined"){_2bd.postSinceLastVisitTime=_2c2;}}var _2c3="";var _2c4="";if($("#topicList").length>0&&_2bc!="reload"){_2c3="/getMoreTopics.do";$locadLocation=$("#topicList");}else{if($("#topicsList").length>0&&_2bc!="reload"){_2c3="/getMoreTopicsTP.do";$locadLocation=$("#topicsList");}else{_2c3="/getSingleForumTopics.do";$locadLocation=$("#mainContent");}}if(_2bb){_2bb=_2bb.toLowerCase();_2bb=_2bb.replace(/\s/ig,"").replace("-","");var _2c5=_2bb;if(_2b9=="problems"&&_2bb=="needmoreinfo"){_2bb="moreinfo";_2c5="needmoreinfo";}if(_2b9=="questions"&&_2bb=="workingonit"){_2bb="working";_2c5="workingonit";}if(_2bb=="we"){_2bb="wewillthinkaboutit";_2c5=_2bb;}if(i18n_Status_[_2bb]){var _2c6=i18n_Status_[_2bb];if(_2c6){if(_2c0==0&&_2be==""){_2be="filter";}else{if(_2c0==0){_2be=_2be+"/filter";}}_2be=_2be+"/"+_2c5;_2bd.statusURL=_2c6;}}}doAjaxAction(_2c3,_2bd,function(data){$locadLocation.get(0).innerHTML=data;bindTopicClicks($("#topicList"));bindTopicClicks($("#topicsList"));if(_2c3="/getSingleForumTopics.do"){lightBox("#chartWidget");bindTopicListHeaderClicks($("#topicListHeader"));bindWidgetsContClick($("#topicListWidgetsCont"));}goToTop();hideLoadingImage();if(typeof WmsContacts!="undefined"&&ch==true){var _2c8=WmsContacts.getZohoContacts();setPresenceInTopicList(_2c8);}if(_2b9=="PostsSinceLastVisit"){var _2c9=$("#topicList").find("a.mediumUnderlineLink");_2c9.removeClass("mediumUnderlineLink").addClass("mediumUnderlineLinkNew");}if(_2bf.attr("isTypeURL")=="no"){if(_2be!=""){if(parseInt(_2b8)>1){$.history.add(_2be+"/"+_2b8);}else{$.history.add(_2be);}}else{if(parseInt(_2b8)>1){$.history.add("home/"+_2b8);}else{$.history.add("home");}}}},function(_2ca){});return false;}function getMoreTagRelatedPost(_2cb,_2cc,_2cd){showLoadingImage();var _2ce={};_2ce.fetchPage=_2cb;_2ce.tagName=_2cc;_2ce.forumGroupId=forumGroupId;_2ce.getPostFor=_2cd;doAjaxAction("/getMoreTagRelatedPosts.do",_2ce,function(data){if($("#topicList").length>0){$("#topicList").get(0).innerHTML=data;bindTopicClicks($("#topicList"));}else{$("#topicsList").get(0).innerHTML=data;bindTopicClicks($("#topicsList"));}goToTop();hideLoadingImage();},function(_2d0){});return false;}function getSingleForumTopics(_2d1){showLoadingImage();var _2d2=_2d1;var _2d3={};_2d3.forumId=_2d2.attr("forumId");_2d3.categoryId=_2d2.attr("categoryId");_2d3.forumGroupId=forumGroupId;_2d3.fetchPage=_2d2.attr("fetchPage");_2d3.ch=ch;doAjaxAction("/getSingleForumTopics.do",_2d3,function(data){$("#mainContent").get(0).innerHTML=data;lightBox("#chartWidget");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(_2d5){$("#mainContent").get(0).innerHTML=_2d5.responseText;hideLoadingImage();});return false;}function bindTopContainerClick(){var _2d6=$("#switchPortalLink");var _2d7=$("#portalsDropDown,#borderPortal");var _2d8=$("#portalComboCont");_2d6.click(function(){if(_2d7.is(":visible")){_2d7.hide();_2d8.removeClass("newComboSelected").addClass("newCombo");}else{_2d7.show();_2d8.removeClass("newCombo").addClass("newComboSelected");}});_2d7.hover(function(){var _2d9=_2d7.data("destroyHandle");if(_2d9){clearTimeout(_2d9);}},function(){var _2da=setTimeout(function(){_2d7.hide();_2d8.removeClass("newComboSelected").addClass("newCombo");},500);_2d7.data("destroyHandle",_2da);});$("#portalsDropDown li").click(function(){$("#portalsDropDown").hide();var _2db=$(this);var _2dc=_2db.attr("thisPoratlUrl");if(_2dc!=currentForumGroupURL){$("#dimDivContainer").show();location.href=defaultDomain+"/"+_2dc;return false;}});}function selectTopicType(_2dd){_2dd.addClass("selected").siblings("li[purpose=\"topicTypeTab\"]").removeClass("selected");var _2de=_2dd.attr("topicType");if(_2de==1){$("#announcementExpiryCont").show();}else{$("#announcementExpiryCont").hide();}$("#currentTopicType").val(_2de);var _2df=_2dd.attr("topicIconClass");if(_2df=="discuss"){$("#writeNewTopic").html(i18n["zohodiscussions.writePost.discussionTypeMessage"]);}else{if(_2df=="question"){$("#writeNewTopic").html(i18n["zohodiscussions.writePost.questionTypeMessage"]);}else{if(_2df=="idea"){$("#writeNewTopic").html(i18n["zohodiscussions.writePost.ideaTypeMessage"]);}else{if(_2df=="error"){$("#writeNewTopic").html(i18n["zohodiscussions.writePost.problemTypeMessage"]);}else{$("#writeNewTopic").html(i18n["zohodiscussions.writePost.announcementTypeMessage"]);}}}}$("#TopicContentHolder").attr("class",_2df);var _2e0=$("#SelectForum").val();if(_2e0==null){$("#selectForumMessage").show();}else{$("#selectForumMessage").hide();}}var createEditor=function(){editor=ZE.create({id:"editorHolder",content:$("#postContentTA").val()});};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 _2e1=$(this);var _2e2=_2e1.attr("isDraft");var _2e3=_2e1.attr("userName");writePostPreview(_2e3,"Preview","true",_2e2);});$("#attachmentsListCont").find("div.imgAshDelete").click(function(_2e4){$this=$(this);var _2e5=$this.attr("attachmentName");var _2e6=$this.attr("attachmentId");deleteUnpublishedAttachment(_2e5,_2e6,_2e4);return;});$("#listOfMyDraftCont").click(function(){var _2e7=$(this).attr("draftsize");if(_2e7<1){return;}var _2e8=$(this);if(_2e8.is(".moreOptionsTop")){_2e8.removeClass("moreOptionsTop").addClass("moreOptionsTopSelected");}else{_2e8.removeClass("moreOptionsTopSelected").addClass("moreOptionsTop");}_2e8.hover(function(){var _2e9=_2e8.data("destroyHandle");if(_2e9){clearTimeout(_2e9);}},function(){var _2ea=setTimeout(function(){_2e8.removeClass("moreOptionsTopSelected").addClass("moreOptionsTop");},500);_2e8.data("destroyHandle",_2ea);});});$("#saveDraft").click(function(){addForumPost(true);});$("#cancelAddTopic").click(function(){$("#mainContent div.mainFullWrite").html("");processHash("Home");});loadUploadAttachmentsCont();}function loadUploadAttachmentsCont(){var _2eb=($("#attachTemplate").length==1)?true:false;var _2ec=(_2eb==true)?"attachTemplate":"responseAttachTemplate";var _2ed=$("#attachmentsListCont");var _2ee=_2ed.find("div.singleElementBox,li.tinyText").length;if(_2eb==true){$("#newPostRightCont  div[purpose=\"attachmentTemplate\"]").remove();}else{$("#attachBrowseCont").html("");}if(_2ee<maxAttachmentsPerPost){var _2ef=_2ee+1;var _2f0=$("#"+_2ec);var _2f1=_2f0.clone();if(_2eb==true){_2f1.insertBefore(_2ed).show();}else{$("#attachBrowseCont").append(_2f1.show()).show();}_2f1.attr("id",_2ec+"_"+_2ef);_2f1.attr("purpose","attachmentTemplate");_2f1.find("div.dataEncloser").wrap("<form action = \"/uploadFile.do\" target = \"fileUpdTgt\" method=\"post\" enctype=\"multipart/form-data\"></form>");_2f1.find("div.iFrameContainer").html("<iframe name = \"fileUpdTgt_"+_2ef+"\"> </iframe>");_2f1.find("form").attr("target","fileUpdTgt_"+_2ef);_2f1.find(":file").change(function(){_2f1.find("[purpose=\"attachLoadingCont\"]").show();_2f1.find(":input[name=\"attacher\"]").val("");_2f1.find("form").get(0).submit();});}}function uploadFileSuccess(_2f2,_2f3,_2f4,_2f5,_2f6){var _2f7=$("#attachmentsListCont");var _2f8=($("#attachTemplate").length==1)?true:false;var _2f9;var _2fa=_2f2+","+_2f3+","+_2f6;if(_2f8==true){_2f9=$("<div id=\"newAttachment_"+_2f2+"\" class=\"singleElementBox\" attachmentDetails=\""+_2fa+"\"><div class=\"flLeft\">"+_2f3+"</div><div class=\"flRight imgAshDelete bgBox\"></div></div>");var _2fb=$("#previewAttachment");var _2fc=$("<li class=\"singleList\" id=\"eachAttachmentForPreview_"+_2f2+"\"  attachmentDetails=\""+_2fa+"\"><div class=\"flLeft iconCont\"><div class=\"attachIcon imgAttachmentTh\"></div></div>  <ul class=\"ulNoStyle detailsListNew\"> <li class=\"header\"> <a>"+_2f3+"</a> </li> <li class=\"forumDetailsList\"> <span>Size:"+_2f6+"</span></li></ul></li>");_2fb.append(_2fc);$("#newAttachment_"+_2f2).attr("attachmentDetails",_2fa);$("#AttachmentPreviewCont").show();}else{_2f9=$("#responseEachAttachmentTemplate").clone();_2f9.attr("id","newAttachment_"+_2f2).attr("attachmentDetails",_2fa).show();_2f9.find("[attachmentPurpose=\"attachmentName\"]").html(_2f3);_2f9.find("[attachmentPurpose=\"attachmentSize\"]").html(_2f6);}$("#previewResponse").append("<input type = \"hidden\" name=\"attachmentId\" value = \""+_2f2+"\"  attachmentDetails= \""+_2fa+"\">");if(_2f5!=-1){_2f9.append("<input type = \"hidden\" name=\"attachmentId\" value = \""+_2f5+"\">");}_2f9.find("div.imgAshDelete").click(function(_2fd){deleteUnpublishedAttachment(_2f3,_2f2,_2fd);});_2f7.append(_2f9);loadUploadAttachmentsCont();}function deleteUnpublishedAttachment(_2fe,_2ff,_300){if(confirm(i18n["zohodiscussions.generalmessage.deleteAttachmentConfirmMsg"])){showSmallLoadingImage(_300);var _301={};_301.forumGroupId=forumGroupId;_301.fileName=_2fe;_301.fileId=_2ff;_301[csrfParamName]=csrfToken;doAjaxAction("/deleteUnpublishedAttachment.do",_301,function(data){hideLoadingImage();if(data=="SUCCESS"){$("#newAttachment_"+_2ff).remove();if($("#previewAttachment").find("li.singleList").length==1){$("#AttachmentPreviewCont").hide();}$("#previewResponse").find("input[value= \""+_2ff+"\"]").remove();showTipper(i18n["zohodiscussions.generalmessage.deleteAttachmentSuccessMsg"],"info");loadUploadAttachmentsCont();}});}}function loadCategories(){loadAdminActionsLinks();var _303=$("#SelectForum");var _304=_303.val();var _305=_303.attr("selectedCategoryName");var _306=_303.attr("selectedCategoryId");var _307=$("#categoryList").val().split("$$");$("#SelectCategory").hide();$("#selectCategory").html("");$.each(_307,function(_308,item){if(item.indexOf(_304+":")>-1){$("#SelectCategory").html(item.split(":")[1]).show();return false;}else{$("#SelectCategory").html("<option selected value=\"-1\">Uncategorised</option>").show();}});var _30a=$("#SelectCategory").find("option[value=\""+_306+"\"]");if(_30a.length==1){_30a.attr("selected","true");}else{$("#SelectCategory option:first").attr("selected","true");}}function loadAdminActionsLinks(){var _30b=$("#SelectForum option:selected").attr("isForumModerator");if(_30b=="true"){$("#isStickyLinkCont,#announcementLinkCont").fadeIn();}else{$("#isStickyLinkCont,#announcementLinkCont").fadeOut();if($("#writepostTabsCont li.selected").attr("topicIconClass")=="announcement"){$("#writepostTabsCont li:first").trigger("click");}}}function addForumPost(_30c){if($("#fileUploadStatus").val()!="uploading"){var _30d=(_30c==true)?i18n["zohodiscussions.general.saving"]:i18n["zohodiscussions.general.publishing"];disablePostButtons();var _30e=$("#addForumPostForm");$topicTitle=$("#topicTitle");var _30f=$topicTitle.val();_30f=_30f.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");_30f=$.trim(_30f);if(_30f==""){hideLoadingImage();setFocusToContainer($("#topicTitle"));enablePostButtons();showMessage(i18n["zohodiscussions.writePost.TopicTitleCannotbeEmptymessage"],"failure");$("#topicTitle").focus();return;}$("#topicTitle").val(_30f);if(_30f.length>200){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.TopicTitleLengthMsg"],"failure");enablePostButtons();return;}var _310=$("#forumTags").val();_310=_310.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");if(_310!=""){if(_310.match(/^[^()~`!@#$%&:;\/?|<>{}[\]*-+=]+$/)==null){hideLoadingImage();showMessage(i18n["zohodiscussions.singlepost.specialCharacterNotAllowedMsg"],"failure");enablePostButtons();return;}}var tag=_310.split(",");for(var i=0;i<tag.length;i++){if(tag[i].length>50){showTipper(i18n["zohodiscussions.singlepost.TagexceedMessage"],"failure");enablePostButtons();return;}}var _313=editor.getContent();_313=_313.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");$("#postContentTA").val(_313);var _314=$("<div></div>").html(_313);_313=_314.text();_313=$.trim(_313);if(_313==""){setFocusToContainer(($("#editorHolder")).focus());hideLoadingImage();enablePostButtons();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");return;}if(_30c==true){$("#topicStatus").val(1);}else{$("#topicStatus").val(0);}var _315=$("#SelectForum").val();if(_315==null){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.selectAnyForum"],"failure");enablePostButtons();return;}var _316="/addForumPost.do";if(ZUID==-1){_316="/addGuestForumPost.do";}showLoadingImage(_30d);doAjaxAction(_316,$("#addForumPostForm").serialize(),function(data){hideLoadingImage();var _318=eval(data);if(_318.result=="success"){var _319=_318.value;if(_30c==true){showTipper(i18n["zohodiscussions.writePost.saveDraftMsg"],"success",3000);enablePostButtons();$("#forumTopicId").val(_319);}else{if(_318.isApproved==0){$("#mainContent div.mainFullWrite").html("");showMessage(i18n["zohodiscussions.writePost.topicAwaitingModeration"],"info");if(isTopicQuickView=="false"){window.location.href=serverURL+"/topic/"+_318.topicPermaLink;}else{showLoadingImage();openSinglePost(_319);}return;}else{$("#mainContent div.mainFullWrite").html("");showTipper(i18n["zohodiscussions.writePost.publishMsg"],"success",4000);if(isTopicQuickView=="false"){window.location.href=serverURL+"/topic/"+_318.topicPermaLink;}else{showLoadingImage();openSinglePost(_318.value);}}}}else{showMessage(_318.reason,"failure");if(_318.errorcode=="IMAGE_CODE_MANDATORY"||_318.errorcode=="INVALID_IMAGE_CODE"){var _31a=new Date();}enablePostButtons();}},function(_31b){hideLoadingImage();if(_31b.responseText.indexOf("'result':'failure'")>0){var _31c=eval(_31b.responseText);if(_31c.result=="failure"){if(_31c.errorcode=="HIP_REQUIRED"){var _31d=$("#writePostCaptcha");if(_31d.attr("currCaptcha")=="new"){showMessage(i18n["zohodiscussions.writePost.captchaMsg"],"failure");}else{showMessage(i18n["zohodiscussions.writePost.captchaErrorMsg"],"failure");}_31d.find("img[purpose=\"captchaImage\"]").replaceWith("<img purpose=captchaImage name=hipImg border=0 src=/showcaptcha?digest="+_31c.reason+" align=absmiddle alt=HIP image>");$("#captchaCode").attr("name",_31c.reason);_31d.attr("currCaptcha","old");_31d.show();}else{showMessage(_31c.reason,"failure");}}}else{$("#writepostCont").get(0).innerHTML=_31b.responseText;}enablePostButtons();});}else{$("#submitStat").show();}}function singlePostDeleteAction(_31e,_31f){var _320=_31e.attr("forumTopicId");_320=_320||_31e.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _321=_31e.attr("responseId");var _322=_31e.attr("categoryId");_322=_322||_31e.parents("div[parentCont=\"actualParent\"]").attr("categoryId");var _323=_31e.parents("div[parentCont=\"actualParent\"]").attr("responseAuthorId");var _324=_31e.attr("forumId");_324=_324||_31e.parents("div[parentCont=\"actualParent\"]").attr("forumId");var _325=_31e.attr("itemType");if(_325!="post"){if(confirm(i18n["zohodiscussions.singlePost.messagefordeletingResponse"])){var _326={};if(_323==ZUID){_326.responseowner="true";}_326.forumGroupId=forumGroupId;_326.forumTopicId=_320;_326.categoryId=_322;_326.forumId=_324;_326.responseId=_321;_326[csrfParamName]=csrfToken;doAjaxAction("/deleteForumResponse.do",_326,function(data){if((data)=="SUCCESS"){showTipper(i18n["zohodiscussions.generalmessage.responseMovedToTrash"],"info",2000);if(_31f=="moderation"){var _328=$("#moderationTabCont").find("li.selected").attr("tabPurpose");refreshingPage(_328);}else{refreshSingleTopic(_320);}}});}}else{if(confirm(i18n["zohodiscussions.singlePost.messagefordeletingTopic"])){var _329={};if(_323==ZUID){_329.access="author";}_329.forumGroupId=forumGroupId;_329.forumTopicId=_320;_329.categoryId=_322;_329.forumId=_324;_329[csrfParamName]=csrfToken;doAjaxAction("/deleteTopic.do",_329,function(data){if((data)=="SUCCESS"){showTipper(i18n["zohodiscussions.generalmessage.topicMovedToTrash"],"info",2000);if(_31f=="moderation"){var _32b=$("#moderationTabCont").find("li.selected").attr("tabPurpose");refreshingPage(_32b);}else{refreshSingleTopic(_320);}}});}}}function refreshSingleTopic(_32c){var _32d=$("#topicList");if(_32d.length<1){_32d=$("#topicsList");}var _32e={};_32e.forumTopicId=_32c;_32e.forumGroupId=forumGroupId;_32e.singleTopicRefresh="singleTopicRefresh";var _32f=$("#eachTopic_"+_32c);doAjaxAction("/refreshSingleTopic.do",_32e,function(data){hideLoadingImage();$data=$("<div></div>").html(data);if($data.find("div.singleTopicCont").length<1){_32f.remove();return false;}var _331=$data.find("div.singleTopicCont").attr("modifiedtime");var _332=_32d.find("div.singleTopicCont:last").attr("modifiedtime");var _333=_32d.find("div.singleTopicCont:first");var _334=_333.attr("modifiedtime");var _335=false;if(_331<_332){_32f.remove();}else{if(_331>_334){$data.insertBefore(_333);_32f.remove();eval($data.find("script").html());_335=true;}else{$data.insertBefore(_32f);_32f.remove();eval($data.find("script").html());_335=true;}}if(_335==true){goToTop();}});}function disablePostButtons(){$("#publishTopic").attr("disabled",true);$("#saveDraft").attr("disabled",true);}function enablePostButtons(){$("#publishTopic").attr("disabled",false);$("#saveDraft").attr("disabled",false);}function getprevAndFirstPost(_336){var _337=_336.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _338={};_338.forumGroupId=forumGroupId;_338.forumTopicId=_337;var _339=_336.attr("recentResponseId");if(typeof _339!="undefined"){_338.responseId=_339;_338.modifiedTime=_336.attr("modifiedTime");_338.currResponseCount=_336.attr("currResponseCount");}else{var _33a=_336.parents("div.listOfResponseLink");_338.responseId=_33a.attr("responseId");_338.modifiedTime=_33a.attr("modifiedTime");_338.currResponseCount=_33a.attr("currResponseCount");}_338.toProvide="First";_338.currStage="1";doAjaxAction("/getResponse.do",_338,function(data){var _33c=$(data);var _33d=$("#recent_ResPonse_"+_339);if($("#lastResponse_"+_337).find("div.listOfResponseLink[prev=\"-1\"]").length<1){_33c.insertAfter(_33d);_33d.next("div.listOfResponseLink").attr("Prev","-1");}var _33e=$("#navigationLoading_"+_339);if(_33e.attr("currRequest")=="first"){_33e.remove();_33d.hide();$("#navCont_"+_339+",#navCont_1_"+_339).removeClass("navLoading");firstOrLastResponse($("#navCont_"+_339).find("li.imgNavStart"));}else{provideResponse(_336);}return;});}function provideResponse(_33f){var _340=_33f.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _341=_33f.attr("recentResponseId");var _342=_33f.attr("toProvide");var _343={};_343.forumGroupId=forumGroupId;_343.forumTopicId=_340;_343.toProvide=_342;if(typeof _341!="undefined"){_343.modifiedTime=_33f.attr("modifiedTime");_343.currResponseCount=_33f.attr("currResponseCount");_343.currStage=_33f.attr("currResponsestage");}else{var _344=_33f.parents("div.listOfResponseLink");_341=_344.attr("responseId");_343.modifiedTime=_344.attr("modifiedTime");_343.currResponseCount=_344.attr("currResponseCount");_343.currStage=_344.attr("currResponsestage");}_343.responseId=_341;doAjaxAction("/getResponse.do",_343,function(data){var _346=$("#recent_ResPonse_"+_341);var _347=$("<div>"+data+"</div>");var _348=_347.find("div.listOfResponseLink").attr("responseId");var _349=$("#lastResponse_"+_340).find("div.listOfResponseLink[responseId = \""+_348+"\"]");if(_349.length>0){if(_342=="Prev"){_346.attr("Prev",_348);_349.attr("Next",_341);}else{if(_342=="Next"){_346.attr("Next",_348);_349.attr("Prev",_341);}}}else{var _34a=$(_347.html());if(_342=="Prev"){_34a.insertAfter(_346);var _34b=_346.next("div.listOfResponseLink");_34b.attr("Next",_341);_346.attr("Prev",_348);}else{if(_342=="Next"){_34a.insertBefore(_346);var _34b=_346.prev("div.listOfResponseLink");_34b.attr("Prev",_341);_346.attr("Next",_348);}}}var _34c=$("#navigationLoading_"+_341);if(_34c.attr("currRequest")=="Prev"){_34c.remove();_346.hide();checkPrevNextResponse($("#navCont_"+_341).find("li.imgNavPrevious"));$("#navCont_"+_341+",#navCont_1_"+_341).removeClass("navLoading");}else{if(_34c.attr("currRequest")=="Next"){_34c.remove();_346.hide();checkPrevNextResponse($("#navCont_"+_341).find("li.imgNavNext"));$("#navCont_"+_341+",#navCont_1_"+_341).removeClass("navLoading");}}});}function checkPrevNextResponse(_34d){var _34e=_34d.parents("div.listOfResponseLink");var _34f=_34e.attr("responseId");var _350=_34d.attr("toProvide");var _351=_34e.attr(_350);if(_351=="0"){var _352=$("#navigationLoading").clone();_352.attr("id","navigationLoading_"+_34f).attr("currRequest",_350);var _353=$("#navCont_"+_34f);_352.insertAfter(_353).show();$("#navCont_"+_34f+",#navCont_1_"+_34f).addClass("navLoading");provideResponse(_34d);return;}else{var _354=$("#recent_ResPonse_"+_351);_34e.hide();_354.show();setFocusToContainer(_354.parents(".singleTopicContSel"),false,0);if($("#navCont_"+_351).is(".navLoading")){$("#navCont_"+_34f+",#navCont_1_"+_34f).removeClass("navLoading");}if(_354.attr(_350)=="0"){var _355=$("#navCont_"+_351).find("li[toProvide=\""+_350+"\"]");provideResponse(_355);}else{return;}}}function firstOrLastResponse(_356){var _357=_356.parents("div.listOfResponseLink");var _358=_356.attr("toProvide");var _359=_357.attr("responseId");var _35a=_356.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _35b=$("#lastResponse_"+_35a);var _35c=$("#recent_ResPonse_"+_359);if(_358=="First"){var _35d=_35b.find("div.listOfResponseLink[Prev=\"-1\"]");if(_35d.length==0){var _35e=$("#navigationLoading").clone();_35e.attr("id","navigationLoading_"+_359).attr("currRequest","first");var _35f=$("#navCont_"+_359);_35e.insertAfter(_35f).show();$("#navCont_"+_359+", #navCont_1_"+_359).addClass("navLoading");getprevAndFirstPost(_356);return;}_35c.hide();_35d.show();setFocusToContainer($("#eachTopic_"+_35a),false,0);if($("#navCont_"+_359).is(".navLoading")){$("#navCont_"+_359+",#navCont_1_"+_359).removeClass("navLoading");}var _360=_35d.attr("responseId");if(_35d.attr("Next")=="0"){var _361=$("#navCont_"+_360).find("li[toProvide=\"Next\"]");provideResponse(_361);}}else{if(_358=="Last"){_35c.hide();_35b.find("div.listOfResponseLink[Next=\"-1\"]").show();setFocusToContainer($("#eachTopic_"+_35a),false,0);}}}function lightBox(_362){$(_362+" 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 bindSubscribeAction(){$("#joinThisPortal,#portalJoin").unbind("click").click(function(){var _364={};_364.forumGroupId=forumGroupId;_364.referrer="ajax";$.ajax({url:"/joinPortal.do",type:"POST",data:_364,error:function(err,desc,_367){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 _369=$(this).attr("src");$("#iamLoginBox iframe,#portaliamLoginBox iframe").attr("src",_369);});$("#signUpClick,#portalSignUpClick").click(function(){var _36a=$(this).attr("action");location.href=_36a;});}function openSinglePost(_36b,_36c,_36d){_36c=_36c||"Topic";if(_36d!=undefined){loadSinglePost(_36b,"true",undefined,_36d);}else{loadSinglePost(_36b);}$.history.add(_36c+"/"+_36b);}function loadSinglePost(_36e,_36f,_370,_371){var _372={};_372.forumTopicId=_36e;_372.forumGroupId=forumGroupId;if(typeof _36f=="undefined"){_36f=true;}doAjaxAction("/getSinglePost.do",_372,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 _374=document.createElement("div");_374.innerHTML=data;$("#mainContent").get(0).appendChild(_374);}}else{$("#mainContent").get(0).innerHTML=data;}if(_36f&&_36f==true){$(window).scrollTop(0);}if(typeof _370!="undefined"){var _375=$(_370).offset().top;$("html,body").scrollTop(_375-100);}initSinglePost(_36e);var _376=$("#topicContainer_"+_36e);var _377=_376.attr("forumId");var _378=_376.attr("categoryId");if(typeof _377=="undefined"){_377=-1;}if(typeof _378=="undefined"){_378=-1;}var _379="NewTopic/"+_377+"/"+_378;$("#NewTopicTab").attr("hashPurpose",_379);if(typeof WmsContacts!="undefined"&&ch==true){var _37a=WmsContacts.getZohoContacts();setPresenceInTopicList(_37a,_36e);}if(_371!=undefined){setFocusToContainer($("#fullResponseContainer_"+_371),false,100,0);$("#SinglePostContainer").data("currentFocusResponse",$("#"+_371));}if(isMac=="false"){setHotkeysToSinglePost();}},function(_37b){hideLoadingImage();var _37c=(_37b.responseText);$("#mainContent").get(0).innerHTML=_37c;});}function initSinglePost(_37d){showAuthorPopout($("#SinglePostContainer"));var _37e=$("#DocumentTitle");document.title=(_37e.length>0)?_37e.text()+" - "+forumGroupName:forumGroupName;bindSingleTopicClicks($("#SinglePostContainer"));var _37f=$("#topicContainer_"+_37d);$("#topicContainer_"+_37d).unbind("click",singlePostWidgetActions).click(singlePostWidgetActions);singlePostTagActions(_37d);$("#mainContent").attr("process-pre-tags",_37d);setTimeout(function(){processCodeTags($("#SinglePostContainer"),_37d);},5);return false;}function showCode(_380){var _381=_380.parentNode.nextSibling.innerHTML;_381=_381.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(_381).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(_382,_383){if(!_383||!_382||_382.length<1){return;}var _384=$("#mainContent");var _385=_384.attr("process-pre-tags");if(_385!=_383){return;}var _386=_382.find("ol.code");_386.before(codeForPreview);}function bindSingleTopicClicks(_387){_387.unbind("click",processSingleTopicClicks).click(processSingleTopicClicks);}function processSingleTopicClicks(_388){var _389=$(_388.target);var _38a=_389.parent();var _38b="singlePost";var _38c=$("#SinglePostContainer").attr("forumTopicId");var _38d=$("#topicContainer_"+_38c);var _38e=$("#statusList");if($("#loadingImg").is(":visible")){return;}if(_389.is("a[purpose=\"authorProfile\"]")){var _38f=_389.attr("authorName");var _390=_389.attr("singleClickflag");if(_390=="0"){var _391=(_38f==ZU_Name)?"MyArea":"User/"+_38f;processHash(_391);}return;}else{if(_38a.is("#replyToTopicBtn_"+_38c+",#replyToTopicBtnSec_"+_38c+",#privateResponseThisTopic_"+_38c)){_392=_38a;var _393=_392.attr("location");var _394=_392.attr("postauthor");var _395=_392.attr("topicTypeString");var _396=$("#paginationContainer");if($("#topicListMainContainer").length>0&&$("#singlePostMainContainer").length>0&&_396.data("inEditMode")){removeTopicListCache();}if($("#responsePreviewContainer").is(":visible")){$("#responsePreviewContainer").find("button[purpose=\"backToEditorResponse\"]").trigger("click");showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");var _397=_38d.data("editorContLocation");setFocusToContainer($(_397),false);return;}var _398="replyToTopicBtn";if(_38a.is("[purpose=\"privateResponse\"]")){_398="privateResponseThisTopic";}var _399="#newResponseCont_"+_38c;if(_38d.data("inEditMode")){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"]);$("#responsePreviewButton").find("button[purpose=\"backToEditorResponse\"]").trigger("click");var _397=_38d.data("editorContLocation");setFocusToContainer($(_397),false);return false;}$(_399).show();newOpenEditor($("#newResponse_"+_38c),"responseContent","postContentTA",_398+"_"+_38c,"Write","topicContainer_"+_38c);setFocusToContainer($(_399),false);_38d.data("inEditMode",true);_38d.data("editorContLocation",_399);$("#previewResponse").attr("forumTopicId",_38c);if($(this).is("[purpose=\"privateResponse\"]")){$("#newResponseCont_"+_38c).find("div.header").html(i18n["zohodiscussions.singlePost.editorHeaderPrivateResponseTo"]+" "+_394+"");}return false;}else{if(_389.is("#TopicListLink,#ForumTopicListLink,#CategoryTopicListLink")){_392=_389;hashPurpose=_392.attr("hashPurpose");$("#topicListMainContainer").attr("shouldReload","true");processHash(hashPurpose);return false;}else{if(_38a.is("#topicVoteLink")){var _392=_38a;var _39a=_392.attr("firstResponseId");showSmallLoadingImage(_388);doAjaxAction("/voteTopic.do?forumGroupId="+forumGroupId+"&forumTopicId="+_38c+"&responseId="+_39a,csrfOptions,function(data){if(data=="SUCCESS"){removeTopicListCache();loadSinglePost(_38c,false);}else{hideLoadingImage();}});}else{if(_38a.is("#topicPermalink")){var _39c=_38a.attr("thisTopicPermalink");$("#PermalinkCont textarea").val(_39c);$("#permalink_Text").select();$("#PermalinkCont").show().parent().show();return;}else{if(_38a.is("#linkToTopic")){linkToTopic();}else{if(_38a.is("#deleteLinkedTopic")){deletelinkedTopic(_38a);}else{if(_389.is("a[purpose=\"linkedTopicTitle\"]")){if(isTopicQuickView=="false"){}else{var _38c=_389.attr("forumTopicId");processHash("Topic/"+_38c);return false;}}else{if(_38a.is("#emailThisTopic")){openEmailTopicDialog(_38a);return false;}else{if(_38a.is("li[actionPurpose=\"reportSpam\"],div[actionPurpose=\"reportSpam\"]")){singlePostSpamAction(_38a,_38b);return;}else{if(_38a.is("div[buttonPurpose=\"approve\"]")||_38a.is("li[buttonPurpose=\"approve\"]")){singlePostApproveAction(_38a,"singlePostApprove");return;}else{if(_389.is("div[purpose=\"inappropriateReason\"]")||_389.is("span[purpose=\"inappropriateReason\"]")){getReasonForInapppropriate(_389);}else{if(_38a.is("li[deletepurpose=\"deleteAttachment\"]")){deletePublishedAttachment(_38a,_388);return;}else{if(_389.is("li[purpose=\"topicLabel\"]")){changeTopicLabel(_389);}else{var _39d=_38d.attr("topicAuthorId");var _39e=_38d.attr("forumId");var _39f=_38d.attr("categoryId");var _3a0=$("#singlePostUtilCont");var _3a1=_3a0.attr("newThreadReplyLinks");if(_38a.is(_3a1)){var _392=_38a;var _38c=_392.attr("forumTopicId");var _3a2=_392.attr("responseId");var _3a3="#newThreadResponseCont_"+_3a2;var _396=$("#paginationContainer");if($("#topicListMainContainer").length>0&&$("#singlePostMainContainer").length>0&&_396.data("inEditMode")){removeTopicListCache();}if($("#responsePreviewContainer").is(":visible")){$("#responsePreviewContainer").find("button[purpose=\"backToEditorResponse\"]").trigger("click");showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");var _397=_38d.data("editorContLocation");setFocusToContainer($(_397),false);return;}if(_38d.data("inEditMode")){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");$("#responsePreviewButton").find("button[purpose=\"backToEditorResponse\"]").trigger("click");var _397=_38d.data("editorContLocation");setFocusToContainer($(_397),false);return false;}$(_3a3).show();newOpenEditor($("#newThreadResponse_"+_3a2),"responseContent","postContentTA","newThreadReply_"+_3a2,"Write","topicContainer_"+_38c);setFocusToContainer($(_3a3),false);_38d.data("inEditMode",true);_38d.data("editorContLocation",_3a3);$("#previewResponse").attr("forumTopicId",_38c);$("#previewResponse").attr("responseId",_3a2);return false;}var _3a4=_3a0.attr("responseVoteLinks");if(_38a.is(_3a4)){var _392=_38a;var _3a2=_392.attr("responseId");var _3a5=_392.attr("votePurpose");var _3a6=(_3a5=="removeVote")?"/removeResponseVote.do":"/voteResponse.do";showSmallLoadingImage(_388);doAjaxAction(_3a6+"?forumGroupId="+forumGroupId+"&responseId="+_3a2+"&forumTopicId="+_38c,csrfOptions,function(data){if(data=="SUCCESS"){removeTopicListCache();loadSinglePost(_38c,false);}else{hideLoadingImage();}});return;}var _3a8=_3a0.attr("chooseBestResponseLinks");if(_38a.is(_3a8)){var _392=_38a;var _3a2=_392.attr("responseId");var _3a9={};_3a9.forumGroupId=forumGroupId;_3a9.responseId=_3a2;_3a9.forumTopicId=_38c;if(_39d==ZUID){_3a9.topicowner="true";}_3a9[csrfParamName]=csrfToken;showSmallLoadingImage(_388);doAjaxAction("/bestResponse.do",_3a9,function(data){if(data=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlepost.bestResponseSuccessMsg"],"success");loadSinglePost(_38c,false,"#bestResponseContainer_"+_3a2);_3a9={};_3a9.forumGroupId=forumGroupId;_3a9.forumTopicId=_38c;doAjaxAction("/notifyForBestResponse.do",_3a9,function(){});}else{hideLoadingImage();showMessage(i18n["zohodiscussions.generalmessage.noPermission"]);}});return;}var _3ab=_3a0.attr("responseEditLinks");if(_38a.is(_3ab)){var _3ac=_38a.attr("id");var _392=_38a;var _3a2=_392.attr("responseId");var _3ad="#fullResponseContainer_"+_3a2;var _396=$("#paginationContainer");if($("#topicListMainContainer").length>0&&$("#singlePostMainContainer").length>0&&_396.data("inEditMode")){removeTopicListCache();}if($("#responsePreviewContainer").is(":visible")){$("#responsePreviewContainer").find("button[purpose=\"backToEditorResponse\"]").trigger("click");showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");var _397=_38d.data("editorContLocation");setFocusToContainer($(_397),false);return;}if(_38d.data("inEditMode")){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");var _397=_38d.data("editorContLocation");$("#responsePreviewButton").find("button[purpose=\"backToEditorResponse\"]").trigger("click");setFocusToContainer($(_397),false);return false;}$(_3ad).show();if(_3ac=="editTopic"){$("#linkTopicCont_"+_38c).hide();$("#statusContainer").hide();}newOpenEditor($("#responseContentContainer_"+_3a2),"responseContent","postContentTA",_3ac,"Edit","topicContainer_"+_38c);setFocusToContainer($(_3ad),false);_38d.data("inEditMode",true);_38d.data("editorContLocation",_3ad);$("#previewResponse").attr("responseId",_3a2);if($(_3ad).attr("class")=="postContent"){$("#previewResponse").attr("location","editTopic");}else{$("#previewResponse").attr("location","editResponse");}$("#previewResponse").attr("forumTopicId",_38c);return false;}if(_38a.is("#removeBestResponse")){var _3a9={};_3a9.forumGroupId=forumGroupId;_3a9.forumTopicId=_38c;if(_39d==ZUID){_3a9.topicowner="true";}_3a9[csrfParamName]=csrfToken;showSmallLoadingImage(_388);doAjaxAction("/removeBestResponse.do",_3a9,function(data){if(data=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlePost.removeBestResponseMsg"],"info");loadSinglePost(_38c);}else{hideLoadingImage();showMessage(i18n["zohodiscussions.generalmessage.noPermission"]);}});return;}if(_38a.is("#deleteTopic")){if(confirm(i18n["zohodiscussions.singlePost.messagefordeletingTopic"])){var _3af={};if(_39d==ZUID){_3af.access="author";}_3af.forumGroupId=forumGroupId;_3af.forumTopicId=_38c;_3af.categoryId=_39f;_3af.forumId=_39e;_3af[csrfParamName]=csrfToken;doAjaxAction("/deleteTopic.do",_3af,function(data){if(jQuery.trim(data)=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.generalmessage.topicMovedToTrash"],"info");processHash("Home");}},function(_3b1){});}return;}var _3b2=_3a0.attr("responseDeleteLinks");if(_38a.is(_3b2)){var _392=_38a;var _3a2=_392.attr("responseId");var _3b3=_392.attr("responseAuthorId");if(confirm(i18n["zohodiscussions.singlePost.messagefordeletingResponse"])){var _3b4={};if(_3b3==ZUID){_3b4.responseowner="true";}_3b4.forumGroupId=forumGroupId;_3b4.forumTopicId=_38c;_3b4.categoryId=_39f;_3b4.forumId=_39e;_3b4.responseId=_3a2;_3b4[csrfParamName]=csrfToken;doAjaxAction("/deleteForumResponse.do",_3b4,function(data){if(data=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.generalmessage.responseMovedToTrash"],"info");loadSinglePost(_38c);}},function(_3b6){});}return false;}}}}}}}}}}}}}}}_38e.hover(function(){var _3b7=_38e.data("destroyHandle");if(_3b7){clearTimeout(_3b7);}},function(){var _3b8=setTimeout(function(){_38e.hide();},500);_38e.data("destroyHandle",_3b8);});}function getReasonForInapppropriate(_3b9){if(moderatorForSpam!="true"){return;}showLoadingImage();var _3ba=_3b9.attr("responseId");var _3bb={};_3bb.forumGroupId=forumGroupId;_3bb.responseId=_3ba;_3bb[csrfParamName]=csrfToken;doAjaxAction("/getInappropriateReason.do",_3bb,function(data){hideLoadingImage();var _3bd=$("<div></div>").html(data);if(_3bd.is("#noInappropriateReason")){showMessage(i18n["zohodiscussions.inappropriate.NoReasonForInappropriate"],"failure");}var _3be=$("#inappropriateReason");_3be.html(data).show();$("#inappropriateReasonClose").click(function(){_3be.html("").hide();});});}function editTopicTitle(_3bf,_3c0,_3c1,_3c2,_3c3){var _3c4=_3c3.val();if(jQuery.trim(_3c4)==""){showMessage(i18n["zohodiscussions.writePost.TopicTitleCannotbeEmptymessage"],"failure");return;}if(_3c4.length>200){showMessage(i18n["zohodiscussions.writePost.TopicTitleLengthMsg"],"failure");return;}var _3c5=_3bf.attr("authorId");var _3c6={};if(ZUID==_3c5){_3c6.access="author";}_3c6.forumGroupId=forumGroupId;_3c6.forumTopicId=_3c0;_3c6.forumId=_3c1;_3c6.categoryId=_3c2;_3c6.topicTitle=_3c4;_3c6[csrfParamName]=csrfToken;doAjaxAction("/editTopicTitle.do",_3c6,function(data){var _3c8=eval(data);if(_3c8.result=="failure"){showTipper(i18n["zohodiscussions.singlepost.topicTitleUpdateErrordMsg"],"failure");}else{removeTopicListCache();showTipper(i18n["zohodiscussions.singlepost.topicTitleUpdatedMsg"],"success");loadSinglePost(_3c0);}});}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 _3c9=$this.attr("currentTopicId");var _3ca="^(ht|f)tp(s?)://[0-9a-zA-Z]([-.w]*[0-9a-zA-Z])*(:(0-9)*)*(/?)([a-zA-Z0-9-.?,:'/\\+=&amp;%$#_]*)?$";var _3cb="#Topic/";var _3cc="?ftid=";var _3cd="/topic/";var _3ce=$("#linkTopicUrl").val();if(jQuery.trim(_3ce)==""){showMessage(i18n["zohodiscussions.createforumgroup.LinkEmpty"],"failure");return;}_3ce=$.trim(_3ce);if((_3ce.match(_3ca))){if(_3ce.indexOf(_3cb)>-1||_3ce.indexOf(_3cc)>-1||_3ce.indexOf(_3cd)){var _3cf={};_3cf.forumGroupId=forumGroupId;_3cf.currentTopicId=_3c9;_3cf.linkToTopicUrl=_3ce;_3cf[csrfParamName]=csrfToken;doAjaxAction("/addLinkToTopic.do",_3cf,function(data){if(data=="SUCCESS"){removeTopicListCache();loadSinglePost(_3c9);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 _3d1=eval(data).reason;showTipper(i18n[_3d1],"failure");}}}});}else{showTipper(i18n["zohodiscussions.settings.PleaseEnteraValidurl"],"failure");}}else{showTipper(i18n["zohodiscussions.settings.PleaseEnteraValidurl"],"failure");}});}function deletelinkedTopic(_3d2){var _3d3=_3d2.attr("currentTopicId");var _3d4=_3d2.attr("linkedTopicId");var _3d5=_3d2.attr("location");var _3d6={};_3d6.forumGroupId=forumGroupId;_3d6.forumTopicId=_3d3;_3d6.linkedTopicId=_3d4;_3d6[csrfParamName]=csrfToken;if(confirm(i18n["zohodiscussions.singlepost.removeLinkConfirmationMess"])){doAjaxAction("/deleteLinkedTopic.do",_3d6,function(data){if(data=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlePost.deleteLinkedTopicMessage"],"success");if(_3d5=="topicList"){getForumTopics(-1,-1,1,"Home");}else{if(_3d5=="singlepost"){loadSinglePost(_3d3);}}}else{if(data=="FAILURE"){showTipper(i18n["zohodiscussions.generalmessage.errorOccured"],"failure");}}});}}function deletePublishedAttachment(_3d8,_3d9){if(confirm(i18n["zohodiscussions.generalmessage.deleteAttachmentConfirmMsg"])){showSmallLoadingImage(_3d9);$this=_3d8;var _3da=$this.attr("attachmentId");var _3db=$this.attr("forumTopicId");var _3dc=$this.attr("responseId");var _3dd=(typeof _3dc!="undefined")?_3dc:_3db;var _3de={};_3de.forumGroupId=forumGroupId;_3de.forumTopicId=$this.attr("forumTopicId");_3de.fileName=$this.attr("attachmentName");_3de.fileId=_3da;_3de[csrfParamName]=csrfToken;doAjaxAction("/deleteAttachment.do",_3de,function(data){if(data=="SUCCESS"){showTipper(i18n["zohodiscussions.generalmessage.deleteAttachmentSuccessMsg"],"info");if($("#SinglePostContainer").length>0){hideLoadingImage();showLoadingImage();removeTopicListCache();loadSinglePost(_3db,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_"+_3dd).length>0)){$("#topicContent_"+_3dd).find("li[attachmentId ="+_3da+"]").remove();if(($("#topicContent_"+_3dd).find("li.singleList").length==0)){($("#topicContent_"+_3dd).find("div.Attachments")).remove();}}}}}});}}function openEmailTopicDialog(_3e0){var _3e1=_3e0;var _3e2=_3e1.attr("topicTitle");var _3e3=_3e1.attr("forumTopicId");_3e3=_3e3||_3e1.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _3e4=_3e4;var _3e5=$("#emailTopicPrompt");_3e5.find(":input[name=\"Subject\"]").val(_3e2);_3e5.find(":input[name=\"forumTopicId\"]").val(_3e3);_3e5.find(":input[name=\"topicTitle\"]").val(_3e2);_3e5.find(":input[name=\"emailIds\"]");_3e5.show().parent().show();_3e5.find(":input[name=\"emailIds\"]").focus();return false;}function emailTopic(_3e6){var _3e7=$(_3e6.target);_3e7.html(i18n["zohodiscussions.singlePost.sending"]);var _3e8=$("#emailTopicPrompt");if(validate(_3e8.find("form"))==true){doAjaxAction("/eMailTopic.do",_3e8.find("form").serialize(),function(data){if(data=="SUCCESS"){showTipper(i18n["zohodiscussions.singlepost.mailsentmessage"],"success");_3e7.html(i18n["zohodiscussions.general.send"]);cancelEmailTopic();}},function(err){if(err.responseText.indexOf("'result':'failure'")>0){var _3eb=eval(err.responseText);showMessage(_3eb.reason,"failure");_3e7.html(i18n["zohodiscussions.general.send"]);}else{showTipper(i18n["zohodiscussions.errorpage.requestedURLisnotfoundMess"],"failure",1000);}});return false;}else{_3e7.html(i18n["zohodiscussions.general.send"]);}return false;}function cancelEmailTopic(){var _3ec=$("#emailTopicPrompt");_3ec.hide().parent().hide();_3ec.find(":input[name=\"emailIds\"]").val("");_3ec.find(":input[name=\"Subject\"]").val("");$("#emailContentArea").val("");return false;}function singlePostApproveAction(_3ed){var _3ee=_3ed.attr("action");var _3ef=_3ed.attr("forumTopicId");var _3f0=_3ed.attr("forumId");var _3f1=_3ed.attr("categoryId");var _3f2=_3ed.attr("itemType");var _3f3={};_3f3.forumGroupId=forumGroupId;_3f3.forumTopicId=_3ef;_3f3.forumId=_3f0;_3f3.categoryId=_3f1;_3f3.authorId=_3ed.attr("authorId");_3f3[csrfParamName]=csrfToken;if(_3f2=="response"){var _3f4=_3ed.attr("responseId");_3f3.responseId=_3f4;}doAjaxAction(_3ee,_3f3,function(data){if(data=="SUCCESS"){removeTopicListCache();var _3f6=i18n["zohodiscussions.moderationList.topicApprovedMess"];if(_3f2=="response"){_3f6=i18n["zohodiscussions.moderationList.responseApprovedMess"];}showTipper(_3f6,"info",4000);loadSinglePost(_3ef);}});}function singlePostSpamAction(_3f7,_3f8){var _3f9=_3f7.attr("postType");if(_3f9=="topic"){_3f9=i18n["zohodiscussions.moderationList.topic"];}else{if(_3f9=="response"){_3f9=i18n["zohodiscussions.moderationList.response"];}}var _3fa=_3f7.attr("spamValue");var _3fb="";if(moderatorForSpam=="true"){if(_3fa==1){_3fb=i18n["zohodiscussions.singlepost.spamActionconfirmationmessage1"]+" "+_3f9+" "+i18n["zohodiscussions.singlepost.inappropriateActionconfirmationmessage2"];}else{_3fb=i18n["zohodiscussions.singlepost.spamActionconfirmationmessage3"]+" "+_3f9+" "+i18n["zohodiscussions.singlepost.appropriateActionconfirmationmessage2"];}if(confirm(_3fb)){spamAction(_3f7,_3f9,_3f8);}}else{if(_3fa==1){$("#spamStatusMsg").show();$("#spamDetails_Text").html("");$("#spamContentDetails").unbind("click").click(function(){var _3fc=$("#spamDetails_Text").val();_3fc=$.trim(_3fc);if(_3fc==""){showMessage(i18n["zohodiscussions.singlePost.EmptyMsgError"],"failure");return;}spamAction(_3f7,_3f9,_3f8,"appropriate",_3fc);});}else{if(confirm(i18n["zohodiscussions.singlepost.spamActionconfirmationmessage3"]+" "+_3f9+" "+i18n["zohodiscussions.singlepost.appropriateActionconfirmationmessage2"])){spamAction(_3f7,_3f9,_3f8,"appropriate");}}}return;}function spamAction(_3fd,_3fe,_3ff,_400,_401){var _402=_3fd.attr("forumTopicId");_402=_402||_3fd.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _403=_3fd.attr("forumId");_403=_403||_3fd.parents("div[parentCont=\"actualParent\"]").attr("forumId");var _404=_3fd.attr("categoryId");_404=_404||_3fd.parents("div[parentCont=\"actualParent\"]").attr("categoryId");var _405={};var _406=_3fd.attr("spamValue");_405.forumTopicId=_402;_405.forumGroupId=forumGroupId;_405.action=_406;_405.postType=_3fe;_405.purpose=_400;_405.forumId=_403;_405.categoryId=_404;_405[csrfParamName]=csrfToken;if(typeof _401!="undefined"){_405.spamDetails=_401;}var _407=_3fd.attr("responseId");if(typeof _407!="undefined"){_405.responseId=_407;}doAjaxAction("/spamAction.do",_405,function(data){$("#spamStatusMsg").hide();if(data=="SUCCESS"){removeTopicListCache();if(_406=="1"){if(_400=="appropriate"){showTipper(i18n["zohodiscussions.statistics.this"]+" "+_3fe+" "+i18n["zohodiscussions.singlepost.Inappropriatemarkedmessage2"],"success",1000);}else{showTipper(i18n["zohodiscussions.statistics.this"]+" "+_3fe+" "+i18n["zohodiscussions.singlepost.spammarkedmessage2"],"success",1000);}}else{if(_400=="appropriate"){showTipper(i18n["zohodiscussions.statistics.this"]+" "+_3fe+" "+i18n["zohodiscussions.singlepost.InappropriateRemovedmessage"],"success",1000);}else{showTipper(i18n["zohodiscussions.statistics.this"]+" "+_3fe+" "+i18n["zohodiscussions.singlepost.spamRemovedmessage"],"success",1000);}}if(_3ff=="singlePost"){loadSinglePost(_402);}else{if(moderatorForSpam=="true"){if(_406==1){processHash("home");}else{_3fd.parent().remove();$("#reportInappropriate_"+_407).remove();}}else{if(_406==1){var _409=$("#reportInappropriate_"+_407);_409.attr("spamValue","2");_409.find("div.imgAshSpam").removeClass("imgAshSpam").addClass("imgNotSpamIcon");_409.find("a").html(i18n["zohodiscussions.singlePost.Appropriate"]);if($("#reasonInappropriate_"+_407).length>0){var _40a=$("#reasonInappropriate_"+_407);var _40b=parseInt(_40a.attr("reportCount"));_40b=_40b+1;_40a.find("span[purpose=\"inappropriateReason\"]").html(i18n["zohodiscussions.singlePost.Inappropriate"]+" ("+_40b+")");_40a.attr("reportCount",_40b);}}else{var _409=$("#reportInappropriate_"+_407);_409.attr("spamValue","1");_409.find("div.imgNotSpamIcon").removeClass("imgNotSpamIcon").addClass("imgAshSpam");_409.find("a").html(i18n["zohodiscussions.singlePost.Inappropriate"]);var _40a=$("#reasonInappropriate_"+_407);var _40b=parseInt(_40a.attr("reportCount"));_40b=_40b-1;if(_40b>0){_40a.attr("reportCount",_40b);_40a.find("span[purpose=\"inappropriateReason\"]").html(i18n["zohodiscussions.singlePost.Inappropriate"]+" ("+_40b+")");}else{_40a.remove();}}}}}},function(_40c){var _40d=eval(_40c.responseText);if(_40d.result=="failure"){showMessage(_40d.reason,"failure");}});}function singlePostWidgetActions(_40e){var _40f=$(_40e.target);var _410=_40f.parent();var _411="singlePost";if(_410.is("div[purpose=\"bookmark\"]")){bookMark(_410,_40e);}else{if(_410.is("div[purpose=\"watchAction\"]")){watchThisItem(_410,_411,_40e);}else{if((_410.is("div[purpose=\"lockTopic\"]"))||(_410.is("#unLockTopic"))){lockTopicLink(_410,_40e);}else{if(_410.is("div[purpose=\"moveTopic\"]")){moveTopic(_410);}else{if(_410.is("div[purpose=\"stickyPost\"]")){stickyLink(_410,_40e);}else{if(_410.is("div[purpose=\"moderateThisTopic\"]")){moderateAction(_410,_411,_40e);}else{if(_410.is("div[purpose=\"changeTopicType\"]")){var _412=_410.attr("forumTopicId");changeTopicType(_412);}else{if(_40f.is("input[purpose=\"notifyAuthor\"]")){var _412=_40f.attr("forumTopicId");updateNotification(_40f,_412,_40e);}else{if(_40f.is("a[purpose=\"forumPostsFilter\"]")){hashPurpose=_40f.attr("hashPurpose");processHash(hashPurpose);return false;}}}}}}}}}}function changeTopicType(_413){$("#changeTopicTypeTemplate").html($("#changeTopicType_"+_413).html());$("#changeTopicType_"+_413).html("");$("#changeTopicTypeTemplate").show();$("#cancelTopicChange,#cancelChangingTopicType").click(function(){$("#changeTopicType_"+_413).html($("#changeTopicTypeTemplate").html());$("#changeTopicTypeTemplate").hide();$("#changeTopicTypeTemplate").html("");});$("#topicTypeListForChange").change(function(){var _414=$(this);if(_414.val()==1){$("#postExpiryDays_"+_413).show();}else{$("#postExpiryDays_"+_413).hide();}});$("#doChange_"+_413).click(function(){var _415=$(this);var _416=$("#topicTypeListForChange").val();var _417=_415.attr("forumId");var _418=_415.attr("categoryId");var _419=_415.attr("isTopicOwner");var _41a=_415.attr("postAuthorId");var _41b={};if(_419=="true"){_41b.access="author";}if(_416==1){var _41c=$("#announcementExpiryDays_"+_413).val();_41b.expiryDay=_41c;}_41b.authorId=_41a;_41b.forumGroupId=forumGroupId;_41b.forumTopicId=_413;_41b.forumId=_417;_41b.categoryId=_418;_41b.postTopicType=_416;_41b[csrfParamName]=csrfToken;doAjaxAction("/updateTopicType.do",_41b,function(data){if(data=="failure"){showTipper(i18n["zohodiscussions.singlePost.updateTopicTypeErrorMessage"],"failure");}else{removeTopicListCache();loadSinglePost(_413);$("#changeTopicTypeTemplate").hide();}});});}function updateNotification(_41e,_41f,_420){var _421={};_421.forumGroupId=forumGroupId;_421.forumTopicId=_41f;_421.access="author";_421.currNotifyStatus=_41e.attr("checked");_421[csrfParamName]=csrfToken;showSmallLoadingImage(_420);doAjaxAction("/updateNotify.do",_421,function(data){removeTopicListCache();showTipper(i18n["zohodiscussions.singlepost.Notificationsavedmessage"],"success",1000);loadSinglePost(_41f);});}function moderateAction(_423,_424,_425){var _426=_423.attr("forumTopicId");_426=_426||_423.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _427=_423.attr("forumId");_427=_427||_423.parents("div[parentCont=\"actualParent\"]").attr("forumId");if(_423.attr("moderationStatus")=="moderate"){var _428={};_428.forumTopicId=_426;_428.forumGroupId=forumGroupId;_428.forumId=_427;_428[csrfParamName]=csrfToken;showSmallLoadingImage(_425);doAjaxAction("/moderateTopic.do",_428,function(data){if(data=="SUCCESS"){removeTopicListCache();_423.attr("moderationStatus","moderated");showTipper(i18n["zohodiscussions.singlepost.Now"]+i18n["zohodiscussions.singlepost.topicundermoderationmessage"],"success",2000);if(_424=="singlePost"){$("#moderateTopicText").html(i18n["zohodiscussions.singlepost.unmoderatethistopicmessage"]);}else{_423.find("a[purpose = \"moderateTopicText\"]").html(i18n["zohodiscussions.singlepost.unmoderatethistopicmessage"]);}}else{showTipper(i18n["zohodiscussions.singlepost.Moderationfailed"],"success",2000);}hideLoadingImage();});}else{if(_423.attr("moderationStatus")=="moderated"){var _42a={};_42a.forumTopicId=_426;_42a.forumGroupId=forumGroupId;_42a[csrfParamName]=csrfToken;doAjaxAction("/unModerateTopic.do",_42a,function(data){if(data=="SUCCESS"){removeTopicListCache();_423.attr("moderationStatus","moderate");showTipper(i18n["zohodiscussions.singlepost.moderationtopicremoved"],"success",2000);if(_424=="singlePost"){$("#moderateTopicText").html(i18n["zohodiscussions.singlepost.moderatethistopicmessage"]);}else{_423.find("a[purpose = \"moderateTopicText\"]").html(i18n["zohodiscussions.singlepost.moderatethistopicmessage"]);}}else{showTipper(i18n["zohodiscussions.singlepost.Moderationfailed"],"success",2000);}});}}}function moveTopic(_42c){var _42d=_42c.attr("forumTopicId");$("#moveTopicTemplate").html($("#moveTopic_"+_42d).html());$("#moveTopic_"+_42d).html("");loadCategoriesToMove($("#forumListForMove").val());$("#moveTopicTemplate").show();var _42e=$("#forumListForMove");var _42f=$("#forumListForModerator");if(_42c.attr("moderatorUser")=="yes"){_42f.hide();_42e.show();_42e.val(_42c.attr("forumId"));loadCategoriesToMove(_42c.attr("forumId"));$("#moveToCategory").val(_42c.attr("categoryId"));}else{_42e.hide();_42f.show();loadCategoriesToMove(_42f.val());}$("#cancelMove,#cancelMoveTopic").click(function(){$("#moveTopic_"+_42d).html($("#moveTopicTemplate").html());$("#moveTopicTemplate").hide();$("#moveTopicTemplate").html("");$("#doMove").html(i18n["zohodiscussions.singlePost.Movetopic"]);});$("#forumListForMove,#forumListForModerator").change(function(){var _430=_42c.attr("forumId");var _431=$(this).val();if(_430==_431){$("#doMove").attr("disabled",true);}else{$("#doMove").attr("disabled",false);}loadCategoriesToMove($(this).val());});$("#doMove").unbind("click").click(function(){var _432=$(this);_432.html(i18n["zohodiscussions.singlePost.Moving"]);var _433=0;if(_42c.attr("moderatorUser")=="yes"){_433=1;}var _434=$(this).attr("isTopicOwner");var args={};args.forumTopicId=_42d;args.forumId=$("#forumListForMove").val();if(_433==0){args.forumId=$("#forumListForModerator").val();}if(_434){args.topicowner="true";}var _436=$("#moveToCategory");var _437=_436.is(":visible");args.categoryId=(_437==true)?_436.val():-1;args.forumGroupId=forumGroupId;args[csrfParamName]=csrfToken;if(!args.categoryId){args.categoryId="";}doAjaxAction("/moveTopic.do",args,function(data){var _439=eval(data);if(_439.result=="success"){removeTopicListCache();$("#moveTopicTemplate").hide();$("#moveTopicTemplate").html("");showTipper(i18n["zohodiscussions.generalmessage.moveTopicSuccessMsg"],"success",3000);loadSinglePost(_42d);}else{_432.html(i18n["zohodiscussions.singlePost.Movetopic"]);showMessage(_439.reason,"failure");}});});}function loadCategoriesToMove(_43a){categoriesForForum=$("#categoryListFormove").val().split("$$");$("#moveToCategory").hide().parent().hide();$.each(categoriesForForum,function(_43b,item){if(item.indexOf(_43a+":")>-1){$("#moveToCategory").html(item.split(":")[1]).show().parent().show();return;}});}function singlePostTagActions(_43d,_43e){$("#forumTopicTags").find("div[purpose = \"deleteTag\"]").click(function(){if(confirm(i18n["zohodiscussions.singlepost.tagDeleteConfirmMsg"])){$this=$(this);var _43f={};var _440=$this.attr("postTagId");var _441=$this.attr("eachTagName");var zuid=$this.attr("zuid");var _443=$this.attr("forumId");var _444=$this.attr("postAuthorId");if(_444==zuid){_43f.access="author";}_43f.forumGroupId=forumGroupId;_43f.forumTopicId=_43d;_43f.forumId=_443;_43f.postTagId=_440;_43f[csrfParamName]=csrfToken;doAjaxAction("/deleteForumPostTags.do",_43f,function(data){if(data=="SUCCESS"){removeTopicListCache();showTipper("<i>"+_441+" </i> "+i18n["zohodiscussions.singlepost.tagDeletedMsg"],"info",3000);loadSinglePost(_43d);}});}});$("#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 _446=$("#addPostTags");var _447=_446.find(":input[name=\"postTags\"]").val();_447=_447.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");var flag="false";if(_447!=""){if(_447.match(/^[^\^()~`!@#$%&:;\/?|<>{}[\]*-+=]+$/)==null){hideLoadingImage();showMessage(i18n["zohodiscussions.singlepost.specialCharacterNotAllowedMsg"],"failure");enablePostButtons();return;}}var _449=_447.split(",");for(var i=0;i<_449.length;i++){if(_449[i].length>50){showTipper(i18n["zohodiscussions.singlepost.TagexceedMessage"],"failure");return;}if(!((_449[i])=="")&&!(jQuery.trim(_449[i]))==""){flag="true";}}if(flag=="false"){showMessage(i18n["zohodiscussions.singlepost.tagNameEmptyMsg"],"failure");return;}if(_447.indexOf("-")<0){var _44b=$this.attr("forumId");var _44c=$this.attr("postAuthorId");var _44d={};if(_44c==ZUID){_44d.access="author";}_44d.forumId=_44b;_44d.postTags=_447;_44d.forumGroupId=forumGroupId;_44d.forumTopicId=_43d;_44d[csrfParamName]=csrfToken;if(jQuery.trim(_447)==""){showMessage(i18n["zohodiscussions.singlepost.tagNameEmptyMsg"],"failure");return;}doAjaxAction("/addNewTagsForPost.do",_44d,function(data){var _44f=eval(data);if(_44f.result=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlepost.tagAddedMsg"],"success",2000);loadSinglePost(_43d,false);}});}});$("#forumTopicTags").find("[purpose=\"getTagRelatedPosts\"]").unbind("click").click(function(){$this=$(this);_43e=_43e||"Tag";var _450=$this.attr("hashPurpose");processHash(_450);});}function changeTopicLabel(_451){var _452=$("#statusList");var _453=_451.attr("topicLabelId");var _454=_452.attr("forumTopicId");var _455=_452.attr("forumId");showSmallLoadingImageForCont($("#statusContainer"),0,130);var _456={};_456.forumGroupId=forumGroupId;_456.forumTopicId=_454;_456.forumId=_455;_456.topicLabelId=_453;_456[csrfParamName]=csrfToken;doAjaxAction("/updateTopicLabel.do",_456,function(data){if(data=="success"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlePost.updateTopicLabelSuccessMsg"],"success");loadSinglePost(_454);}else{showMessage(i18n["zohodiscussions.singlePost.updateTopicLabelErrorMessage"],"failure");}},function(_458){});}function watchThisItem(_459,_45a,_45b){var _45c=_459.attr("hashPurpose");var _45d=_459.attr("itemType");var _45e=_459.attr("itemId");_45e=_45e||_459.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _45f=_459.attr("status");var _460=_459.attr("itemName");var _461={};_461.itemType=_45d;_461.itemId=_45e;_461.forumGroupId=forumGroupId;_461[csrfParamName]=csrfToken;if(_45f=="watch"){showSmallLoadingImage(_45b);doAjaxAction("/watchItem.do",_461,function(data){if(data=="SUCCESS"){removeTopicListCache();if(_45d==0){showTipper(i18n["zohodiscussions.singlepost.watchTopicSuccessMsg"],"success",3000);if(_45a=="singlePost"){loadSinglePost(_45e,false);}else{if(_45a=="singleTopicWatch"){_459.attr("status","unwatch");var _463=_459.parent();_463.removeClass("smallAshBox").addClass("smallAshBoxShow");_459.removeClass("imgSmallWatch").addClass("imgSmallWatchSel");hideLoadingImage();}else{_459.attr("status","unwatch");_459.find("a[purpose = \"watchItemText\"]").html(i18n["zohodiscussions.singlePost.unwatchTopic"]);hideLoadingImage();}}}else{if(_45d==2){showTipper(i18n["zohodiscussions.widgetscontainer.watchForumSuccessMsg"],"success",3000);_459.attr("status","unwatch");if(_45c!="type"){processHash(_45c);}else{_459.find("a").html(i18n["zohodiscussions.general.Unwatch"]+" "+_460);$("#ajaxLoaderSmall").hide();}return false;}else{if(_45d==1){showTipper(i18n["zohodiscussions.widgetscontainer.watchCategorySuccessMsg"],"success",3000);_459.attr("status","unwatch");if(_45c!="type"){processHash(_45c);}else{_459.find("a").html(i18n["zohodiscussions.general.Unwatch"]+" "+_460);$("#ajaxLoaderSmall").hide();}return false;}else{if(_45d==4||_45d==5||_45d==6){showTipper(i18n["zohodsicussions.watchlist.announcement.follow.success"],"success",3000);_459.attr("status","unwatch");_459.html(i18n["zohodiscussions.general.Unwatch"]+" "+_460);$("#ajaxLoaderSmall").hide();return false;}}}}}});}else{var _464="";if(_45d==0){_464=i18n["zohodiscussions.singlepost.unwatchTopicConfirmMsg1"];}else{if(_45d==1){_464=i18n["zohodiscussions.singlepost.unwatchCategoryConfirmMsg3"];}else{if(_45d==2){_464=i18n["zohodiscussions.singlepost.unwatchForumConfirmMsg2"];}else{if(_45d==4||_45d==5||_45d==6){_464=i18n["zohodsicussions.watchlist.announcement.unwatch.confirm"];}}}}if(confirm(_464)){var _465={};_465.itemId=_45e;_465.forumGroupId=forumGroupId;_465[csrfParamName]=csrfToken;showSmallLoadingImage(_45b);doAjaxAction("/unWatch.do",_465,function(data){if(data=="SUCCESS"){removeTopicListCache();if(_45d==0){showTipper(i18n["zohodiscussions.singlepost.unwatchTopicSuccessMsg"],"info",3000);if(_45a=="singlePost"){loadSinglePost(_45e,false);}else{if(_45a=="singleTopicWatch"){_459.attr("status","watch");var _467=_459.parent();_467.removeClass("smallAshBoxShow").addClass("smallAshBox");_459.removeClass("imgSmallWatchSel").addClass("imgSmallWatch");hideLoadingImage();}else{_459.attr("status","watch");hideLoadingImage();}}}else{if(_45d==2){showTipper(i18n["zohodiscussions.widgetscontainer.unwatchForumSuccessMsg"],"success",3000);_459.attr("status","watch");if(_45c!="type"){processHash(_45c);}else{_459.find("a").html(i18n["zohodiscussions.general.watch"]+" "+_460);$("#ajaxLoaderSmall").hide();}return false;}else{if(_45d==1){showTipper(i18n["zohodiscussions.widgetscontainer.unwatchCategorySuccessMsg"],"success",3000);_459.attr("status","watch");if(_45c!="type"){processHash(_45c);}else{_459.find("a").html(i18n["zohodiscussions.general.watch"]+" "+_460);$("#ajaxLoaderSmall").hide();}return false;}else{if(_45d==4||_45d==5||_45d==6){showTipper(i18n["zohodsicussions.watchlist.announcement.stop.success"],"success",3000);_459.attr("status","watch");_459.html(i18n["zohodiscussions.general.watch"]+" "+_460);$("#ajaxLoaderSmall").hide();return false;}}}}}});}}}function bookMark(_468,_469){var _46a=_468.attr("status");var _46b={};_46b.forumGroupId=forumGroupId;_46b.forumTopicId=_468.attr("forumTopicId");_46b[csrfParamName]=csrfToken;showSmallLoadingImage(_469);if(_46a=="bookmark"){doAjaxAction("/addBookMark.do",_46b,function(data){hideLoadingImage();if(data=="failure"){showTipper(i18n["zohodiscussions.singlePost.bookMarkErrorMessage"],"failure");}else{removeTopicListCache();showTipper(i18n["zohodiscussions.singlepost.bookmarkTopicSuccessMsg"],"success",3000);_468.attr("status","removeBookmark");_468.find("a").html(i18n["zohodiscussions.singlePost.removeBookmark"]);}});}else{doAjaxAction("/removeBookMark.do",_46b,function(data){hideLoadingImage();if(data=="failure"){showTipper(i18n["zohodiscussions.singlePost.removeBookMarkErrorMessage"],"failure");}else{removeTopicListCache();showTipper(i18n["zohodiscussions.singlePost.removeBookmarkMsg"],"info",3000);_468.attr("status","bookmark");_468.find("a").html(i18n["zohodiscussions.singlePost.bookmarkTopic"]);}});}}function stickyLink(_46e,_46f){var _470=0;var _471=_46e.attr("status");var _472=_46e.attr("isSticky");if(_472=="true"){_470=1;}var _473={};_473.forumGroupId=forumGroupId;_473.forumTopicId=_46e.attr("forumTopicId");_473.action=_470;_473[csrfParamName]=csrfToken;showSmallLoadingImage(_46f);doAjaxAction("/stickyAction.do",_473,function(data){if(data=="SUCCESS"){removeTopicListCache();if(_471=="stickyPost"){showTipper(i18n["zohodiscussions.singlepost.stickyPostSuccessMsg"],"success",3000);_46e.attr("status","normal");_46e.attr("isSticky","true");$("#stickyPostText").html(i18n["zohodiscussions.singlePost.notStickyPost"]);}else{showTipper(i18n["zohodiscussions.singlePost.removeStickyPostMsg"],"info",3000);_46e.attr("status","stickyPost");_46e.attr("isSticky","false");$("#stickyPostText").html(i18n["zohodiscussions.singlePost.makeStickyPost"]);}hideLoadingImage();}});}function lockTopicLink(_475,_476){var _477=0;var _478=_475.attr("status");var _479=_475.attr("isLocked");var _47a=_475.attr("forumTopicId");if(_479=="true"){_477=1;}var _47b=(_478=="lockTopic")?i18n["zohodiscussions.singlepost.lockConfirmationMsg"]:i18n["zohodiscussions.singlepost.unlockConfirmationMsg"];if(confirm(_47b)){var _47c={};_47c.forumGroupId=forumGroupId;_47c.forumTopicId=_47a;_47c.action=_477;_47c[csrfParamName]=csrfToken;showSmallLoadingImage(_476);doAjaxAction("/lockAction.do",_47c,function(data){if(data=="SUCCESS"){removeTopicListCache();if(_478=="lockTopic"){showTipper(i18n["zohodiscussions.singlepost.lockTopicSuccessMsg"],"info",3000);}else{showTipper(i18n["zohodiscussions.singlepost.unlockTopicSuccessMsg"],"info",3000);}loadSinglePost(_47a,false);}});}}function addForumResponse(_47e,_47f,_480){showLoadingImage(i18n["zohodiscussions.general.publishing"]);var _481=editor.getContent();_481=_481.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_481==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");return;}$("#postContentTA").val(_481);$("#editorHolder").append($("#responseAttachmentContActual").clone().hide());var _482=(_47f&&_47f=="Edit")?"/updateResponse.do":(ZUID==-1)?"/addGuestForumResponse.do":"/addForumResponse.do";doAjaxAction(_482,$("#editorHolder").serialize(),function(data){hideLoadingImage();if(data.indexOf("'result':'failure'")>0){var _484=eval(data);if(_484.errorcode=="SPAM_DETECTED"){if(confirm(_484.reason)){$("#editorHolder").find("input[name=\"detectSpamPresence\"]").val(0);$("#publishResponse").trigger("click");}}else{showMessage(_484.reason,"failure");}}else{if(data.indexOf("'result':'success'")>0){var _484=eval(data);if($("#SinglePostContainer").length>0){removeTopicListCache();loadSinglePost(_47e,false);}else{if($("#topicList").length>0||$("#topicsList").length>0){$("#topicListMainContainer").attr("shouldReload","true");if($("#currentCategoryContext").length>0){$("#currentCategoryContext").trigger("click");}else{$("#currentForumContext").trigger("click");}}}showTipper(i18n[_484.reason],"info",5000);return;}else{var _485=(_47f&&_47f=="Edit")?i18n["zohodiscussions.singlepost.ResponseUpdated"]:i18n["zohodiscussions.singlepost.ResponseAdded"];showTipper(_485,"success",3000);if($("#SinglePostContainer").length>0){removeTopicListCache();showLoadingImage();loadSinglePost(_47e,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 _486=_47e;if(_480&&$("#topicContent_"+_486).length<1){_486=_480;}$("#topicContent_"+_486).html(_481);$("#editTopic_"+_486).html(_481);$("#cancelResponse").trigger("click");}else{if($("#authorProfileInnerContent").length>0){var _486=_47e;if(_480&&$("#topicContent_"+_486).length<1){_486=_480;}$("#topicContent_"+_486).html(_481);$("#editTopic_"+_486).html(_481);$("#cancelResponse").trigger("click");}}}}}}},function(_487){hideLoadingImage();if(_487.responseText.indexOf("'result':'failure'")>0){var _488=eval(_487.responseText);if(_488.result=="failure"){if(_488.errorcode=="HIP_REQUIRED"){$("#editorHolder").find("div#responseAttachmentContActual").remove();var _489=$("#responseAttachmentContActual").find("div[purpose=\"responseCaptcha\"]");if(_489.attr("currCaptcha")=="new"){showMessage(i18n["zohodiscussions.writePost.captchaMsg"],"failure");}else{showMessage(i18n["zohodiscussions.writePost.captchaErrorMsg"],"failure");}_489.find("img[purpose=\"captchaImage\"]").replaceWith("<img purpose=captchaImage name=hipImg border=0 src=/showcaptcha?digest="+_488.reason+" align=absmiddle alt=HIP image>");_489.find(":input").attr("name",_488.reason);_489.attr("currCaptcha","old");_489.show();if(!$("#responseAttachmentContActual").is(":visible")){$("#responseAttachmentContActual").show();}}else{showMessage(_488.reason,"failure");}}}else{$("#SinglePostContainer").get(0).innerHTML=_487.responseText;}});return false;}function removeTopicListCache(){$("#topicListMainContainer:hidden").remove();$("#userProfileMainContainer:hidden").remove();$("#myAreaParentContainer:hidden").remove();}function initModerationPanel(){openModerationPanel();}function openModerationPanel(){$("#moderationLeftCont li[isNiceURL=\"No\"]").click(function(){showLoadingImage();$this=$(this);var _48a=$this.attr("purpose");var _48b=$this.attr("tabPurpose");$this.removeClass("default").addClass("selected").siblings("li.selected").removeClass("selected").addClass("default");var _48c=$this.attr("pageToLoad");doAjaxAction(_48c,csrfOptions,function(data){if(_48a=="WaitingApproval"){$("#moderationRightCont").get(0).innerHTML=data;}else{if(_48a=="ReportedSpam"){$("#moderationRightCont").get(0).innerHTML=data;}else{if(_48a=="ReportedInappropriate"){$("#moderationRightCont").get(0).innerHTML=data;}else{if(_48a=="Trashed"){$("#moderationRightCont").get(0).innerHTML=data;}else{if(_48a=="Moderated"){$("#moderationRightCont").get(0).innerHTML=data;}else{if(_48a=="userAwaiting"){$("#moderationRightCont").get(0).innerHTML=data;}}}}}}hideLoadingImage();bindModerationTabClick();bindModerationActionClick(_48b);showAuthorPopout($("#moderationListForm"));},function(_48e){hideLoadingImage();var _48f=(_48e.responseText);$("#mainContent").get(0).innerHTML=_48f;});});}function bindModerationTabClick(){$("#moderationTabCont > ul > li[tabPurpose]").unbind("click").click(function(){$this=$(this);var _490=$this.attr("tabPurpose");var _491=$this.attr("action");$this.removeClass("default").addClass("selected").siblings("li.selected").removeClass("selected").addClass("default");moderationTab(_490,_491);});}function moderationTab(_492,_493){showLoadingImage();var _494=1;var _495=_492;var _496={};if(_495=="ModeratedUsers"){_496.userId=ZUID;}if(_495=="ModeratedTopicList"){_496.userId=ZUID;}_496.fetchPage=_494;_496.postFor=_495;_496.forumGroupId=forumGroupId;_496[csrfParamName]=csrfToken;doAjaxAction(_493,_496,function(data){hideLoadingImage();$("#moderationInnerCont").find("div.expand").get(0).innerHTML=data;bindModerationActionClick(_492);showAuthorPopout($("#moderationListForm"));var _498=$("#moderationListForm");var _499=_498.attr("topicCount");var _49a=_498.attr("responseCount");var _49b=_498.attr("totalCount");var _49c=_498.attr("userCount");var _49d=_498.attr("responseList");var _49e=_498.attr("moderatedUsersCount");$("#moderationTabCont").find("span[purpose=\"totalCount\"]").html("("+_49b+")");$("#moderationTabCont").find("span[purpose=\"topicCount\"]").html("("+_499+")");$("#moderationTabCont").find("span[purpose=\"responseCount\"]").html("("+_49a+")");$("#moderationTabCont").find("span[purpose=\"userCount\"]").html("("+_49c+")");$("#moderationTabCont").find("span[purpose=\"moderatedUsersCount\"]").html("("+_49e+")");if(_49d=="No"){$("#moderationActionListCont").hide();}else{$("#moderationActionListCont").show();$("#moderationAction").find("input[purpose=\"selectAll\"]").attr("checked",false);$("#selectAllModerationItem").html(i18n["zohodiscussions.moderationAction.selectAll"]);}var _49f=$("#moderationViewModeSelections").find("li a[purpose=\"expandedView\"]");var _4a0=$("#moderationViewModeSelections").find("li a[purpose=\"listView\"]");_49f.removeClass("boldText").addClass("underline");_4a0.removeClass("underline").addClass("boldText");},function(_4a1){hideLoadingImage();var _4a2=(_4a1.responseText);$("#moderationInnerCont").find("div.expand").get(0).innerHTML=_4a2;});}function bindModerationAction(_4a3){var _4a4=$(_4a3.target);var _4a5=_4a4.parent();if(_4a5.is("li[buttonPurpose]")){var _4a6=_4a5.attr("buttonPurpose");var _4a7="moderation";if(_4a6=="approve"||_4a6=="deleteForever"||_4a6=="restore"||_4a6=="spam"||_4a6=="inappropriate"){manageModerationeAction(_4a5);}else{if(_4a6=="inappropriateReason"){getReasonForInapppropriate(_4a5);}else{if(_4a6=="trash"){singlePostDeleteAction(_4a5,_4a7);}else{if(_4a6=="unModerateTopic"){unModerateTopic(_4a5);}else{if(_4a6=="allow"){allowUser(_4a5);}else{if(_4a6=="block"){blockSubscribedUser(_4a5);}}}}}}}else{if(_4a5.is("div[buttonPurpose]")){var _4a6=_4a5.attr("buttonPurpose");if(_4a6=="unModerateUser"){unmoderateUserAction(_4a5);}}else{if(_4a4.is("a[purpose=\"singlePostView\"]")&&isTopicQuickView=="true"){openSinglePost(_4a4.attr("forumTopicId"));}else{if(_4a4.is("a[purpose=\"singleForumTopics\"]")&&_4a4.attr("isNiceUrl")!="Yes"){var _4a8=1;var _4a9=_4a4.attr("forumId");getForumTopics(_4a9,-1,_4a8,"Home");}else{if(_4a4.is("a[purpose=\"authorProfile\"]")&&_4a4.attr("isNiceUrl")!="Yes"){var _4aa=_4a4.attr("authorName");var _4ab=_4a4.attr("singleClickflag");if(_4ab=="0"){if(_4aa==ZU_Name){processHash("MyArea");_4a4.attr("singleClickflag","1");}else{processHash("User/"+_4aa);_4a4.attr("singleClickflag","1");}}return;}}}}}if(_4a4.is("div[purpose=\"singlePostIconView\"]")){var _4ac=_4a4.attr("responseId");var _4ad=_4a4.attr("status");if(_4ad=="expandView"){$("#singlePostTextContent_"+_4ac).show();$("#singlePostIconView_"+_4ac).removeClass("bigPlusIcon").addClass("bigMinusIcon");_4a4.attr("status","listView");}else{$("#singlePostTextContent_"+_4ac).hide();$("#singlePostIconView_"+_4ac).removeClass("bigMinusIcon").addClass("bigPlusIcon");_4a4.attr("status","expandView");}}}function bindModerationActionClick(_4ae){$("#moderationAction").find("input[purpose=\"selectAll\"]").change(function(){$this=$(this);selectPost($this);return false;});$("#moderationAction").find("[purpose =\"selectAllItems\"]").unbind("click").click(function(){$this=$(this);selectPost($this);});$("#moderationAction").find("li[item=\"action\"]").unbind("click").click(function(){$this=$(this);var _4af=false;var _4b0=$("#moderationInnerCont").find("input[purpose=\"selectItem\"]").each(function(){var _4b1=this.checked;if(_4b1==true){_4af=true;}});if(_4af==true){var _4b2="";var _4b3="";var _4b4="";var _4b5="";var _4b6="";var _4b7=$this.attr("actionPurpose");var _4b8=$("#moderationTabCont").find("li.selected");var _4b9=_4b8.attr("itemType");if(_4b9=="All"){_4b5=i18n["zohodiscussions.moderationAction.deleteAllSelectedConfirmationMessage"];}else{_4b5=(_4b9=="post")?i18n["zohodiscussions.moderationAction.deleteTopicConfirmationMessage"]:i18n["zohodiscussions.moderationAction.deleteResponsesConfirmationMessage"];}if(_4b9=="All"&&_4b7=="approveAction"){_4b2="bulkApprove";_4b3="/approveAllAwaitingModeration.do";_4b4=_4b9;}else{if(_4b9=="post"&&_4b7=="approveAction"){_4b2="bulkApprove";_4b3="/approveTopic.do";_4b4=_4b9;}else{if(_4b9=="response"&&_4b7=="approveAction"){_4b2="bulkApprove";_4b3="/approveResponse.do";_4b4=_4b9;}else{if((_4b9=="All"&&_4b7=="deleteAction")){_4b2="bulkDelete";_4b3="/deleteAllAwaitingModeration.do";_4b4=_4b9;}else{if(_4b9=="post"&&_4b7=="deleteAction"){_4b2="bulkDelete";_4b3="/deleteTopic.do";_4b4=_4b9;}else{if(_4b9=="response"&&_4b7=="deleteAction"){_4b2="bulkDelete";_4b3="/deleteForumResponse.do";_4b4=_4b9;}else{if(_4b9=="All"&&_4b7=="deleteForeverAction"){_4b2="bulkDeleteForever";_4b3="/deleteAllTrashForever.do";_4b4=_4b9;}else{if(_4b9=="post"&&_4b7=="deleteForeverAction"){_4b2="bulkDeleteForever";_4b3="/deleteTopicForEver.do";_4b4=_4b9;}else{if(_4b9=="response"&&_4b7=="deleteForeverAction"){_4b2="bulkDeleteForever";_4b3="/deleteResponseForEver.do";_4b4=_4b9;}else{if(_4b9=="All"&&_4b7=="restoreAction"){_4b2="bulkRestore";_4b3="/RestoreAllTrash.do";_4b4=_4b9;}else{if(_4b9=="post"&&_4b7=="restoreAction"){_4b2="bulkRestore";_4b3="/restoreForumTopic.do";_4b4=_4b9;}else{if(_4b9=="response"&&_4b7=="restoreAction"){_4b2="bulkRestore";_4b3="/restoreForumResponse.do";_4b4=_4b9;}else{if(_4b9=="All"&&_4b7=="markAsNotSpam"){_4b2="markAsNotSpam";_4b3="/markAsNotSpam.do";_4b4=_4b9;}else{if(_4b9=="post"&&_4b7=="markAsNotSpam"){_4b2="bulkNotSpam";_4b3="/spamAction.do";_4b4=_4b9;_4b6="topic";}else{if(_4b9=="response"&&_4b7=="markAsNotSpam"){_4b2="bulkNotSpam";_4b3="/spamAction.do";_4b4=_4b9;_4b6="response";}else{if(_4b9=="All"&&_4b7=="markAsAppropriate"){_4b2="markAsNotSpam";_4b3="/markAsNotSpam.do";_4b4=_4b9;}else{if(_4b9=="post"&&_4b7=="markAsAppropriate"){_4b2="bulkNotSpam";_4b3="/spamAction.do";_4b4=_4b9;_4b6="topic";}else{if(_4b9=="response"&&_4b7=="markAsAppropriate"){_4b2="bulkNotSpam";_4b3="/spamAction.do";_4b4=_4b9;_4b6="response";}}}}}}}}}}}}}}}}}}if(_4b2=="bulkNotSpam"||_4b2=="spamAll"){showLoadingImage();doAjaxAction(_4b3+"?forumGroupId="+forumGroupId+"&purpose="+_4b2+"&postType="+_4b6,$("#moderationListForm").serialize(),function(data){hideLoadingImage();getDataFromBulkModeration(data,_4b2,_4ae,_4b4);});}else{if(_4b2=="bulkDeleteForever"||_4b2=="bulkDelete"||_4b2=="trashAll"){if(confirm(_4b5)){doAjaxAction(_4b3+"?forumGroupId="+forumGroupId+"&purpose="+_4b2,$("#moderationListForm").serialize(),function(data){getDataFromBulkModeration(data,_4b2,_4ae,_4b4);});}}else{doAjaxAction(_4b3+"?forumGroupId="+forumGroupId+"&purpose="+_4b2,$("#moderationListForm").serialize(),function(data){getDataFromBulkModeration(data,_4b2,_4ae,_4b4);});}}}else{showTipper(i18n["zohodiscussions.moderationList.selectAtleastOneCheckboxinfoMess"],"info",2000);}});paginationNavBtnEnabled();selectViewMode();}function selectPost(_4bd){var _4be=_4bd.attr("checked");var _4bf=$("#moderationInnerCont");if(_4be==1){_4bf.find("input[purpose=\"selectItem\"]").each(function(){this.checked=true;});$("#selectAllModerationItem").attr("checked","0");$("#moderationAction").find("input[purpose=\"selectAll\"]").attr("checked",true);$("#selectAllModerationItem").html(i18n["zohodiscussions.moderationAction.deselectedAll"]);}else{_4bf.find("input[purpose=\"selectItem\"]").each(function(){this.checked=false;});$("#selectAllModerationItem").attr("checked","1");$("#moderationAction").find("input[purpose=\"selectAll\"]").attr("checked",false);$("#selectAllModerationItem").html(i18n["zohodiscussions.moderationAction.selectAll"]);}}function selectViewMode(){$("#moderationViewModeSelections").find("li a[purpose]").unbind("click").click(function(){$this=$(this);var _4c0=$this.attr("purpose");var _4c1=$("#moderationViewModeSelections").find("li a[purpose=\"expandedView\"]");var _4c2=$("#moderationViewModeSelections").find("li a[purpose=\"listView\"]");var _4c3=$("#moderationPanel div.singlePostIconView");if(_4c0=="expandedView"){$("div.viewMode").show();_4c1.removeClass("underline").addClass("boldText");_4c2.removeClass("boldText").addClass("underline");_4c3.removeClass("bigPlusIcon").addClass("bigMinusIcon");_4c3.attr("status","listView");}else{$("div.viewMode").hide();_4c1.removeClass("boldText").addClass("underline");_4c2.removeClass("underline").addClass("boldText");_4c3.removeClass("bigMinusIcon").addClass("bigPlusIcon");_4c3.attr("status","expandView");}});}function unModerateTopic(_4c4){var _4c5={};var _4c6=_4c4.attr("forumTopicId");_4c5.forumTopicId=_4c6;_4c5.forumGroupId=forumGroupId;_4c5[csrfParamName]=csrfToken;if(confirm(i18n["zohodiscussions.moderationList.UnmoderateTopicConfirmMess"])){doAjaxAction("/unModerateTopic.do",_4c5,function(data){var _4c8=_4c4.attr("forumTopicId");if(data=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.moderationList.UnmoderateTopicmessage"],"info",2000);$("#moderationLeftCont li[purpose=\"Moderated\"]").trigger("click");}});}}function unmoderateUserAction(_4c9){var _4ca=$("#moderationTabCont").find("li.selected").attr("tabPurpose");var _4cb=_4c9.attr("authorId");var _4cc=_4c9.attr("isAdmin");var _4cd=_4c9.attr("forumId");var _4ce=_4c9.attr("moderationId");var _4cf=0;if(_4c9.attr("levelType")=="1"){_4cf=1;}var _4d0={};_4d0.authorId=_4cb;_4d0.forumGroupId=forumGroupId;_4d0.forumId=_4cd;_4d0.adminUser=_4cc;_4d0.moderateType=_4cf;_4d0[csrfParamName]=csrfToken;if(confirm(i18n["zohodiscussions.moderationList.UnmoderateUserConfirmMess"])){doAjaxAction("/unModerateUser.do",_4d0,function(data){if(data=="SUCCESS"){showTipper(i18n["zohodiscussions.moderationList.UnmoderateUsermessage"],"info",2000);refreshingPage(_4ca);}});}}function allowUser(_4d2){var _4d3=$("#moderationTabCont").find("li.selected").attr("tabPurpose");var _4d4=_4d2.attr("userId");var _4d5=_4d2.attr("action");var _4d6={};_4d6.userId=_4d4;_4d6.forumGroupId=forumGroupId;_4d6[csrfParamName]=csrfToken;doAjaxAction(_4d5,_4d6,function(data){if(data=="success"){showTipper(i18n["zohodiscussions.moderationList.AllowSubscribedUser"],"info",2000);if(_4d3){refreshingPage(_4d3);}}});}function blockSubscribedUser(_4d8){var _4d9=$("#moderationTabCont").find("li.selected").attr("tabPurpose");var _4da=_4d8.attr("userId");var _4db=_4d8.attr("action");var _4dc={};_4dc.userId=_4da;_4dc.forumGroupId=forumGroupId;_4dc[csrfParamName]=csrfToken;doAjaxAction(_4db,_4dc,function(data){if(data=="success"){showTipper(i18n["zohodiscussions.moderationList.BlockSubscribedUser"],"info",2000);if(_4d9){refreshingPage(_4d9);}}});}function manageModerationeAction(_4de){var _4df=$("#moderationTabCont").find("li.selected").attr("tabPurpose");var _4e0=_4de.attr("buttonPurpose");var _4e1=_4de.attr("action");var _4e2=_4de.attr("forumTopicId");var _4e3=_4de.attr("forumId");var _4e4=_4de.attr("categoryId");var _4e5=_4de.attr("itemType");var _4e6={};if(_4e0=="spam"||_4e0=="inappropriate"){_4e6.action=_4de.attr("spamValue");_4e6.postType=_4de.attr("postType");_4e6.purpose=null;}_4e6.forumGroupId=forumGroupId;_4e6.forumTopicId=_4e2;_4e6.forumId=_4e3;_4e6.categoryId=_4e4;_4e6.authorId=_4de.attr("authorId");_4e6[csrfParamName]=csrfToken;if(_4e5=="post"){var _4e7=true;if(_4e0=="deleteForever"){_4e7=confirm(i18n["zohodiscussions.moderationList.deleteTopicConfirmMess"]);}if(_4e7){doAjaxAction(_4e1,_4e6,function(data){if(data=="SUCCESS"){if(_4e0=="restore"){showTipper(i18n["zohodiscussions.moderationList.topicRestoredMess"],"info",2000);}else{if(_4e0=="approve"){showTipper(i18n["zohodiscussions.moderationList.topicApprovedMess"],"info",2000);}else{if(_4e0=="spam"){showTipper(i18n["zohodiscussions.moderationList.topicUnmarkAsSpamMess"],"info",2000);}else{if(_4e0=="inappropriate"){showTipper(i18n["zohodiscussions.moderationList.topicUnmarkAsInappropriate"],"info",2000);}else{if(_4e0=="deleteForever"){showTipper(i18n["zohodiscussions.moderationList.topicDeleteFromTrashMess"],"info",2000);}}}}}if(_4df){refreshingPage(_4df);}}});}}else{var _4e9=_4de.attr("responseId");_4e6.responseId=_4e9;var _4e7=true;if(_4e0=="deleteForever"){_4e7=confirm(i18n["zohodiscussions.moderationList.deleteResponseConfirmMess"]);}if(_4e7){doAjaxAction(_4e1,_4e6,function(data){if(data=="SUCCESS"){if(_4e0=="restore"){showTipper(i18n["zohodiscussions.moderationList.responseRestoredMess"],"info",2000);}else{if(_4e0=="approve"){showTipper(i18n["zohodiscussions.moderationList.responseApprovedMess"],"info",2000);}else{if(_4e0=="spam"){showTipper(i18n["zohodiscussions.moderationList.responseUnmarkAsSpamMess"],"info",2000);}else{if(_4e0=="inappropriate"){showTipper(i18n["zohodiscussions.moderationList.responseUnmarkAsInappropriate"],"info",2000);}else{if(_4e0=="deleteForever"){showTipper(i18n["zohodiscussions.moderationList.responseDeleteFromTrashMess"],"info",2000);}}}}}if(_4df){refreshingPage(_4df);}}});}}}function getDataFromBulkModeration(data,_4ec,_4ed,_4ee){if(data=="SUCCESS"){if(_4ec=="bulkDeleteForever"||_4ec=="bulkDelete"||_4ec=="trashAll"){if(_4ee=="All"){showTipper(i18n["zohodiscussions.moderationList.selectedItemsdeletedMess"],"info",2000);}else{if(_4ee=="post"){showTipper(i18n["zohodiscussions.moderationList.topicdeletedMess"],"info",2000);}else{showTipper(i18n["zohodiscussions.moderationList.responsedeletedMess"],"info",2000);}}}else{if(_4ec=="bulkRestore"||_4ec=="RestoreAll"){if(_4ee=="All"){showTipper(i18n["zohodiscussions.moderationList.selectedItemsRestoreMess"],"info",2000);}else{if(_4ee=="post"){showTipper(i18n["zohodiscussions.moderationList.topicRestoredMess"],"info",2000);}else{showTipper(i18n["zohodiscussions.moderationList.responseRestoredMess"],"info",2000);}}}else{if(_4ec=="bulkApprove"||_4ec=="approveAll"){if(_4ee=="All"){showTipper(i18n["zohodiscussions.moderationList.selectedItemsApprovedMess"],"info",2000);}else{if(_4ee=="post"){showTipper(i18n["zohodiscussions.moderationList.topicApprovedMess"],"info",2000);}else{showTipper(i18n["zohodiscussions.moderationList.responseApprovedMess"],"info",2000);}}}else{if(_4ed=="AllReportedInappropriate"){if(_4ee=="All"){showTipper(i18n["zohodiscussions.moderationList.selectedItemsUnmarkAsInappropriate"],"info",2000);}else{if(_4ee=="post"){showTipper(i18n["zohodiscussions.moderationList.topicUnmarkAsInappropriate"],"info",2000);}else{showTipper(i18n["zohodiscussions.moderationList.responseUnmarkAsInappropriate"],"info",2000);}}}else{if(_4ec=="bulkNotSpam"||_4ec=="markAsNotSpam"){if(_4ee=="All"){showTipper(i18n["zohodiscussions.moderationList.selectedItemsUnmarkAsSpamMess"],"info",2000);}else{if(_4ee=="post"){showTipper(i18n["zohodiscussions.moderationList.topicUnmarkAsSpamMess"],"info",2000);}else{showTipper(i18n["zohodiscussions.moderationList.responseUnmarkAsSpamMess"],"info",2000);}}}}}}}refreshingPage(_4ed);}else{showTipper(i18n["zohodiscussions.moderationList.infoMess"],"info",2000);}}function refreshingPage(_4ef){if(_4ef=="AllAwaiting"){$("#moderationLeftCont li[purpose=\"WaitingApproval\"]").trigger("click");}else{if(_4ef=="AllReportedSpam"){$("#moderationLeftCont li[purpose=\"ReportedSpam\"]").trigger("click");}else{if(_4ef=="AllReportedInappropriate"){$("#moderationLeftCont li[purpose=\"ReportedInappropriate\"]").trigger("click");}else{if(_4ef=="AllTrash"){$("#moderationLeftCont li[purpose=\"Trashed\"]").trigger("click");}else{if(_4ef=="AllAwaitingUser"){$("#moderationLeftCont li[purpose=\"userAwaiting\"]").trigger("click");}else{$("#moderationTabCont > ul > li[tabPurpose="+_4ef+"]").trigger("click");}}}}}}function paginationNavBtnEnabled(){$("#moderationListForm").find("li.navBtnEnabled").click(function(){var _4f0=$(this);var _4f1=_4f0.parent("ul");var type=_4f0.attr("purpose");moderationPagination(_4f1,type);});}function moderationPagination(_4f3,type){showLoadingImage();var _4f5=$("#moderationTabCont").find("li.selected");var _4f6=_4f5.attr("action");var _4f7=_4f5.attr("tabpurpose");var _4f8=parseInt(_4f3.attr("fetchPage"));if(type=="next"){_4f8=_4f8+1;}else{_4f8=_4f8-1;}var _4f9={};_4f9.forumGroupId=forumGroupId;_4f9.fetchPage=_4f8;_4f9.postFor=_4f7;_4f9[csrfParamName]=csrfToken;doAjaxAction(_4f6,_4f9,function(data){hideLoadingImage();$("#moderationInnerCont").find("div.expand").get(0).innerHTML=data;showAuthorPopout($("#moderationListForm"));paginationNavBtnEnabled();var _4fb=$("#moderationViewModeSelections");_4fb.find("li[linkpurpose=\"expandedView\"]").html("<a class=underline purpose=expandedView>"+i18n["zohodiscussions.myArea.expandView"]+"</a>");_4fb.find("li[linkpurpose=\"listView\"]").html("<a class=boldText purpose=listView>"+i18n["zohodiscussions.myArea.listView"]+"</a>");selectViewMode();},function(_4fc){$("#mainContent").get(0).innerHTML=_4fc.responseText;hideLoadingImage();});}function bindMyAreaClicks(_4fd){_4fd.unbind("click",processMyAreaClick).click(processMyAreaClick);$("#recentActivityContent, #profileDetailCont").unbind("click",processAllMyAreaMainClick).click(processAllMyAreaMainClick);$("#mainContent").unbind("click",processAuthorProfileClick);$("#mainContent").unbind("click",processAllActionClick);}function processMyAreaClick(_4fe){var _4ff=$(_4fe.target);var _500=_4ff.parent();if($("#loadingImg").is(":visible")){return;}if((_500.is("[purpose=\"dashBoard\"]")||_500.is("[purpose=\"myJournals\"]")||_500.is("[purpose=\"watchList\"]")||_500.is("[purpose=\"friends\"]")||_500.is("[purpose=\"bookMark\"]")||_500.is("[purpose=\"privateMsg\"]")||_500.is("[purpose=\"preference\"]"))&&_500.attr("isNiceUrl")!="Yes"){getMyAreaAction(_500);return;}else{if((_4ff.is("[purpose=\"dashBoard\"]")||_4ff.is("[purpose=\"myJournals\"]")||_4ff.is("[purpose=\"watchList\"]")||_4ff.is("[purpose=\"friends\"]")||_4ff.is("[purpose=\"bookMark\"]")||_4ff.is("[purpose=\"privateMsg\"]")||_4ff.is("[purpose=\"preference\"]"))&&_4ff.attr("isNiceUrl")!="Yes"){getMyAreaAction(_4ff);return;}}}function getMyAreaAction(_501,_502){showLoadingImage();_501.parent("ul").find("li").removeClass("selected");_501.addClass("selected");var _503=_501.attr("action");var _504={};_504.forumGroupId=forumGroupId;_504[csrfParamName]=csrfToken;_504.ch=ch;var _505=_501.attr("purpose");if(_502!=undefined&&_505=="watchList"){_503="/myWatchListSubAction.do";_504.subAction=_502;}$("#myAreaLists").attr("currView",_505);if(_505=="myJournals"){_504.userId=_501.attr("userId");_504.viewType="myself";}doAjaxAction(_503,_504,function(data){hideLoadingImage();$("#myAreaInnerMainContent").find("div.innerWrapper").get(0).innerHTML=data;if(_505=="myJournals"){$.history.add("MyArea/myPosts");}else{if(_505=="watchList"&&_502!=undefined){$.history.add("MyArea/"+_505+"/"+_502);}else{if(_505=="friends"&&_502!=undefined){$.history.add("MyArea/"+_505+"/"+_502);}else{$.history.add("MyArea/"+_505);}}}bindMyareaTabsActions(_505,_502);return false;},function(err){var _508=eval(err.responseText);showMessage(_508.reason,"failure");hideLoadingImage();});}function bindMyareaTabsActions(_509,_50a){var _50b=$("#myAreaInnerMainContent").find("div.innerWrapper");if(_509=="preference"){_50b.unbind("click",processPreferenceClick).click(processPreferenceClick);var _50c=$("#user_AvatarImage");if(_50c.find("li.selected").length>0){avatarImageFocus(_50c);}var _50d=$("#preferenceInnerContent").find("form").attr("userPhotoPref");var _50e=$("#preferenceInnerContent").find("form").attr("userUploadPhotoUrl");var _50f=$("#preferenceInnerContent").find("form").attr("userIAMphoto");var _510="";if(_50d=="IAM"){_510=_50f;}else{if(_50d=="userUpload"){_510=_50e;}else{if(_50d=="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(_50d,_510);var _512=$("#resetpassword");var _513={};_513[csrfParamName]=csrfToken;_512.find("a").click(function(_514){showSmallLoadingImage(_514);_512.hide();doAjaxAction("https://discussions.zoho.com/sendResetPassword.do",_513,function(data){if(data=="success"){hideLoadingImage();_512.html(i18n["zohodiscussions.reset.success"]);_512.show();}else{hideLoadingImage();_512.html(i18n["zohodiscussions.reset.failure"]);_512.show();}});});}else{_50b.unbind("click",processAllMyAreaMainClick).click(processAllMyAreaMainClick);_50b.unbind("click",processAllActionClick).click(processAllActionClick);allFilterOption(_509);showAuthorPopout(_50b);if(_50a=="following"){setFocusToContainer(_50b.find("#followingAuthors"),false,100,0);}}if(_509=="dashBoard"){if(typeof WmsContacts!="undefined"&&ch==true){var _516=WmsContacts.getZohoContacts();setPresence(_516,"followingUserDetails");setPresence(_516,"followersUserDetails");setPresence(_516,"friendsListContainer");setPresenceInMyArea(_516,"current_recentActivity_List");}}if(_509=="watchList"){if(typeof WmsContacts!="undefined"&&ch==true){var _516=WmsContacts.getZohoContacts();setPresenceInMyArea(_516,"userChat_watchTopics");}}if(_509=="privateMsg"){if(typeof WmsContacts!="undefined"&&ch==true){var _516=WmsContacts.getZohoContacts();setPresenceInMyArea(_516,"userChat_inbox");}}if(_509=="friends"){if(typeof WmsContacts!="undefined"&&ch==true){var _516=WmsContacts.getZohoContacts();setPresenceInMyArea(_516,"friendsDetailsInnerContent");}}}function avatarImageFocus(_517){var _518=_517.find("li.selected").attr("count");var _519=parseInt(_518/7);if(_518%7==0){_519=_519-1;}_517.scrollTop(_519*60);}function UserPhotoPreference(_51a,_51b){if(_51b=="uploadUserPhoto"){$("#uploadPhotoCont").find("input[name=\"imageFileName\"]").val("");$("#uploadPhotoCont").find("img[purpose=\"uploadPhotoLoadingCont\"]").remove();$("#uploadPhotoPreference").attr("src",_51a);$("#uploadPhotoCont").find("img[purpose=\"avat_Image\"]").attr("src",_51a);$("#userSelectedAvatarImage").attr("value",_51a);$("#userSelectedProfileImage").attr("value",_51a);$("#preferenceInnerContent").find("form").attr("userUploadPhotoUrl",_51a);$("#userPreferencePhotoCont").find("img").attr("src",_51a);$("#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(_51c){var _51d=$(_51c.target);var _51e=_51d.parent();if($("#loadingImg").is(":visible")){return;}else{if(_51d.is("a[purpose=\"postTitle\"]")){if(_51d.attr("postType")=="draft"){editDraftPost(_51d);return;}showLoadingImage();if(isTopicQuickView=="false"){}else{var _51f=_51d.attr("forumTopicId");var _520=_51d.attr("recentResponseId");if(_520!=undefined){processHash("Topic/"+_51f+"/"+_520);}else{processHash("Topic/"+_51f);}return false;}}else{if((_51d.is("a[purpose=\"forumAction\"]")||_51d.is("a[purpose=\"categoryAction\"]"))&&_51d.attr("isNiceUrl")!="Yes"){var _521=_51d.attr("hashPurpose");processHash(_521);}else{if((_51d.is("a[purpose=\"authorProfile\"],a[purpose=\"authorProfileMore\"]"))&&_51d.attr("isNiceUrl")!="Yes"){var _522=_51d.attr("authorName");var _523=_51d.attr("singleClickflag");if(_523=="0"){if(_522==ZU_Name){processHash("MyArea");_51d.attr("singleClickflag","1");}else{processHash("User/"+_522);_51d.attr("singleClickflag","1");}}return;}else{if(_51d.is("div[purpose=\"unWatch\"]")){unWatchItem(_51d);return;}else{if(_51d.is("a[purpose=\"moreFollowing\"]")&&_51d.attr("isNiceUrl")!="Yes"){processHash("myarea/watchList/following");return;}else{if(_51d.is("a[purpose=\"moreFollowers\"]")&&_51d.attr("isNiceUrl")!="Yes"){processHash("myarea/watchList/follower");return;}else{if(_51e.is("li[deletepurpose=\"deleteAttachment\"]")){deletePublishedAttachment(_51e,_51c);return;}else{if(_51d.is("li.navBtnEnabled")&&_51d.is("li[action=\"false\"]")){var type=_51d.attr("purpose");fnPaginationProcess(_51e,type);return;}}}}}}}}}}function processAllActionClick(_525){var _526=$(_525.target);var _527=_526.parent();var _528=$("#myAreaLists").attr("currView");if(!_528){_528="authorProfile";}if($("#loadingImg").is(":visible")){return;}else{if(_526.is(".bigPlusIcon")){var _529=_526.parents("li.headerContent");if(!_529.find("div.expandTextContent").is(":visible")||_528=="privateMsg"){_529.find("div.textContent").addClass("expandTextContent").show();_529.parents("div.moderateSinglePost").find("div.lowerButton").show();}else{_529.find("div.textContent").addClass("expandTextContent");}_526.removeClass("bigPlusIcon").addClass("bigMinusIcon");setFocusToContainer(_526,true,200);return;}else{if(_526.is(".bigMinusIcon")){var _529=_526.parents("li.headerContent");_529.find("div.textContent").removeClass("expandTextContent").hide();_529.parents("div.moderateSinglePost").find("div.lowerButton").hide();_526.removeClass("bigMinusIcon").addClass("bigPlusIcon");return;}else{if(_527.is("li[purpose=\"expandedView\"]")||_527.is("li[purpose=\"listView\"]")){manageExpandOrCollapseType(_527,_528);return;}else{if(_526.is("li.navBtnEnabled")&&_526.is("li[action=\"true\"]")){var _52a=_526.attr("purpose");if(_528=="authorProfile"){fnPagination(_527,_52a,"true");}else{fnPagination(_527,_52a);}return;}else{if(_526.is("li[purpose=\"removeBookMark\"]")){removeBookMarkAction(_526);return;}else{if(_527.is("li[purpose=\"removeBookMark\"]")){removeBookMarkAction(_527);return;}else{if(_526.is("li[purpose=\"postTitle\"]")){if(_526.attr("postType")=="draft"){editDraftPost(_526);return;}showLoadingImage();if(isTopicQuickView=="false"){}else{var _52b=_526.attr("forumTopicId");processHash("Topic/"+_52b);return false;}}else{if(_527.is("li[purpose=\"postTitle\"]")){if(_527.attr("postType")=="draft"){editDraftPost(_527);return;}showLoadingImage();if(isTopicQuickView=="false"){}else{var _52b=_527.attr("forumTopicId");processHash("Topic/"+_52b);return false;}}else{if(_527.is("li[purpose=\"delete\"]")){myJournalsDeletePost(_527,_528+"Tab");return;}else{if(_526.is("li[purpose=\"delete\"]")){myJournalsDeletePost(_526,_528+"Tab");return;}else{if(_526.is("li[purpose=\"topics\"]")||_526.is("li[purpose=\"drafts\"]")||_526.is("li[purpose=\"replies\"]")||_526.is("li[purpose=\"authorTopics\"]")||_526.is("li[purpose=\"authorReplies\"]")||_526.is("li[purpose=\"privateMsg\"]")){$("#"+_528+"Tab").find("li").removeClass("selected");myAreaAllTabClick(_526,_528);return;}else{if(_527.is("li[purpose=\"topics\"]")||_527.is("li[purpose=\"drafts\"]")||_527.is("li[purpose=\"replies\"]")||_527.is("li[purpose=\"authorTopics\"]")||_527.is("li[purpose=\"authorReplies\"]")||_527.is("li[purpose=\"privateMsg\"]")){$("#"+_528+"Tab").find("li").removeClass("selected");myAreaAllTabClick(_527,_528);return;}else{if(_526.attr("purpose")=="watchTopics"||_526.attr("purpose")=="watchUsers"||_526.attr("purpose")=="watchForums"||_526.attr("purpose")=="watchCategories"||_526.attr("purpose")=="simpleView"||_526.attr("purpose")=="followers"){$("#watchListTabs").find("li").removeClass("selected");myAreaAllTabClick(_526,"watchList");}else{if(_527.attr("purpose")=="watchTopics"||_527.attr("purpose")=="watchUsers"||_527.attr("purpose")=="watchForums"||_527.attr("purpose")=="watchCategories"||_527.attr("purpose")=="simpleView"||_527.attr("purpose")=="followers"){$("#watchListTabs").find("li").removeClass("selected");myAreaAllTabClick(_527,"watchList");}else{if(_526.attr("purpose")=="friendsActivities"||_526.attr("purpose")=="friendsList"||_526.attr("purpose")=="pendingFriendRequests"){$("#friendsDetailsTabs").find("li").removeClass("selected");friendsTabClick(_526,"friendsDetails");}else{if(_527.attr("purpose")=="friendsActivities"||_527.attr("purpose")=="friendsList"||_527.attr("purpose")=="pendingFriendRequests"){$("#friendsDetailsTabs").find("li").removeClass("selected");friendsTabClick(_527,"friendsDetails");}else{if(_527.is("li[purpose=\"removeFriend\"]")){removeFriend(_527);}else{if(_527.is("li[purpose=\"confirmFriend\"]")){confirmFriendRequest(_527);}else{if(_526.is("li[purpose=\"unWatch\"]")){unWatchItem(_526);return;}else{if(_527.is("li[purpose=\"unWatch\"]")){unWatchItem(_527);return;}else{if(_527.is("li[purpose=\"unWatchItem\"]")){unWatchItem(_527,"authorProfile");}else{if(_526.attr("purpose")=="inbox"||_526.attr("purpose")=="sent"){$("#privateMsgTab").find("li").removeClass("selected");var _52c=$("#newReplyPrivateMsgCont");if(_52c.is(":visible")){_52c.parent().hide();_52c.remove();}myAreaAllTabClick(_526,"privateMsg");return;}else{if(_527.attr("purpose")=="inbox"||_527.attr("purpose")=="sent"){$("#privateMsgTab").find("li").removeClass("selected");var _52c=$("#newReplyPrivateMsgCont");if(_52c.is(":visible")){_52c.parent().hide();_52c.remove();}myAreaAllTabClick(_527,"privateMsg");return;}else{if(_526.is("li[purpose=\"deleteThisPM\"]")){deletePrivateMsg(_526);}else{if(_527.is("li[purpose=\"deleteThisPM\"]")){deletePrivateMsg(_527);}else{if(_526.is("li[purpose=\"replyToThisPM\"]")||_526.is("li[purpose=\"editThisPM\"]")){replyToPrivateMsg(_526);}else{if(_527.is("li[purpose=\"replyToThisPM\"]")||_527.is("li[purpose=\"editThisPM\"]")){replyToPrivateMsg(_527);}else{if(_527.is("a[purpose=\"postConversation\"]")){privateConversation(_527);}else{if(_526.is("a[purpose=\"postConversation\"]")){privateConversation(_526);}else{if(_526.is("a[purpose=\"postConversationTitle\"]")){var _52d=_526.parents("li.headerContent");var _52e=_52d.find("div.textContent");if(_52e.is(":visible")){_52d.find("div.bigMinusIcon").trigger("click");}else{_52d.find("div.bigPlusIcon").trigger("click");}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}function allFilterOption(type){$("#"+type+"_Filter").change(function(){var _530=$(this);var _531=_530.val();var _532=$(this).find("option[filterType=\""+_531+"\"]");if(_530.attr("action")=="true"){myJournalsFilterAction(_532,type);}else{myJournalsFilter(_532,type);}});}function removeBookMarkAction(_533){var _534=_533.attr("forumTopicId");var _535={};_535.forumGroupId=forumGroupId;_535.forumTopicId=_534;_535[csrfParamName]=csrfToken;doAjaxAction("/removeBookMark.do",_535,function(data){hideLoadingImage();showTipper(i18n["zohodiscussions.bookMark.successfullyRemoveBookMark"],"success");$("#bookMark_"+_534).remove();},function(err){var _538=eval(err.responseText);showMessage(_538.reason,"failure");hideLoadingImage();});}function processPreferenceClick(_539){var _53a=$(_539.target);var _53b=_53a.parent();var _53c=$("#preferenceInnerContent").find("form").attr("userUploadPhotoUrl");var _53d=$("#preferenceInnerContent").find("form").attr("userIAMphoto");if($("#loadingImg").is(":visible")){return;}if(_53a.attr("purpose")=="profile"||_53a.attr("purpose")=="notification"||_53a.attr("purpose")=="privacy"){_53b.find("li.selected").removeClass("selected");_53a.addClass("selected");myAreaAllTabClick(_53a,"preference");}else{if(_53b.attr("purpose")=="profile"||_53b.attr("purpose")=="notification"||_53b.attr("purpose")=="privacy"){_53b.parent("ul").find("li.selected").removeClass("selected");_53b.addClass("selected");myAreaAllTabClick(_53b,"preference");}else{if(_53a.is("input[purpose=\"save\"]")||_53b.is("input[purpose=\"save\"]")){updateUserPreference();}else{if(_53b.is("li[purpose=\"avat_Image\"]")){$("#user_IamImage").find("div.profilePhotoSelected").removeClass("profilePhotoSelected").addClass("profilePhoto");$("#user_AvatarImage").find("li.selected").removeClass("selected");_53b.addClass("selected");var src=_53a.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(_53a.is("#myComputer")){$("#zohoAccountMess").remove();$("#uploadPhotoCont").remove();$("#curr_UploadPhoto_Cont").remove();$("#fgid").remove();$("#allAvatarList").hide();$("#myComputer").addClass("selected").siblings("li.selected").removeClass("selected");insertBrowserOptionToUpload("userUpload",_53c);}else{if(_53a.is("#zohoAccounts")){$("#curr_UploadPhoto_Cont").remove();$("#fgid").remove();$("#uploadPhotoCont").remove();$("#curr_UploadPhoto_Cont").remove();$("#allAvatarList").hide();$("#zohoAccounts").addClass("selected").siblings("li.selected").removeClass("selected");insertBrowserOptionToUpload("IAM",_53d);}else{if(_53a.is("#AvatarsList")){$("#zohoAccountMess").remove();$("#uploadPhotoCont").remove();$("#curr_UploadPhoto_Cont").remove();$("#AvatarsList").addClass("selected").siblings("li.selected").removeClass("selected");if($("#fgid").length==0){var _53f=$("<input type = \"hidden\" id=\"fgid\" name=\"forumGroupId\" value=\""+forumGroupId+"\"/>");_53f.insertAfter($("#preferenceInnerContent > form > input[name=\"avatar\"]")).show();}var _540=$("#allAvatarList").find("li.selected").find("img").attr("src");$("#userSelectedAvatarImage").attr("value",_540);$("#userSelectedProfileImage").attr("value",_540);$("#allAvatarList").show();avatarImageFocus($("#user_AvatarImage"));}else{if(_53b.is("div[purpose=\"avat_Image\"]")){$("#user_AvatarImage").find("li.selected").removeClass("selected");_53b.removeClass("profilePhoto").addClass("profilePhotoSelected");$("#userSelectedProfileImage").val("yes");var src=_53a.attr("src");$("#userPreferencePhotoCont").find("img").attr("src",src);$("#userSelectedAvatarImage").val(src);$("#zohoAccounts").removeAttr("purpose");$("#myComputer").removeAttr("purpose");}}}}}}}}}function insertBrowserOptionToUpload(_541,_542){var _543=$("#preferenceInnerContent").find("form").attr("userUploadPhotoUrl");var _544=$("#preferenceInnerContent").find("form").attr("userIAMphoto");if(_541=="IAM"){var _545=$("#uploadPhoto_Cont");var _546=_545.clone();_546.insertAfter($("#user_AvatarImage").find("ul")).show();_546.attr("id","curr_UploadPhoto_Cont");_546.attr("purpose","userPhotoTemplate");_546.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>");_546.find("div.iFrameContainer").html("<iframe name = \"fileUpdTgt_user\"> </iframe>");_546.find("form").attr("target","fileUpdTgt_user");var _547=$("<input type = \"hidden\"  name=\"forumGroupId\" value=\""+forumGroupId+"\"/>");_547.insertAfter($("#curr_UploadPhoto_Cont").find("div[purpose=\"uploadPhotoContent\"]"));$("#curr_UploadPhoto_Cont").find("div[purpose=\"uploadName\"]").html(i18n["zohodiscussions.userProfile.zohoImage"]);_546.find(":file").change(function(){_546.find("[purpose=\"uploadPhotoLoadingCont\"]").show();_546.find(":input[name=\"attacher\"]").val("");_546.find("form").get(0).submit();});var _548=$("#zohoAccounts").attr("purpose");var _549="profilePhoto";if(typeof _548!="undefined"){_549="profilePhotoSelected";}var _54a=$("<div class=\""+_549+"\"  imgpurpose=\"IAMPhotoSelected\"><img height=\"48\" width=\"48\" purpose=\"avat_Image\" src=\""+_544+"\"/></div>");_54a.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 _54b=$("#preferenceInnerContent").find("form").attr("userIAMphoto");$("#userPreferencePhotoCont").find("img").attr("src",_54b);var _54c=$("#userPreferencePhotoCont").attr("currentPref");if(_54c="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");});$("<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(_541=="userUpload"){var _545=$("#uploadPhoto_Cont");var _54d=_545.clone();_54d.insertAfter($("#user_AvatarImage").find("ul")).show();_54d.attr("id","uploadPhotoCont");_54d.attr("purpose","uploadUserPhotoTemplate");_54d.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>");_54d.find(":input[type=\"file\"]").attr("name","imageFileName");_54d.find("div.iFrameContainer").html("<iframe name = \"fileUpdTgt_user\"> </iframe>");_54d.find("form").attr("target","fileUpdTgt_user");var _547=$("<input type = \"hidden\"  name=\"forumGroupId\" value=\""+forumGroupId+"\"/>");var _54e=$(" <input type=\"hidden\" value=\"uploadUserPhoto\" name=\"purpose\"/>");_547.insertAfter($("#uploadPhotoCont").find("div[purpose=\"uploadPhotoContent\"]"));_54e.insertAfter($("#uploadPhotoCont").find("div[purpose=\"uploadPhotoContent\"]"));_54d.find(":file").change(function(){_54d.find("[purpose=\"uploadPhotoLoadingCont\"]").show();_54d.find("form").get(0).submit();});var _548=$("#myComputer").attr("purpose");var _549="profilePhoto";if(typeof _548!="undefined"){_549="profilePhotoSelected";}var _54a=$("<div class=\""+_549+"\" imgpurpose=\"userUploadedPhotoSelected\"><img height=\"48\" width=\"48\" purpose=\"avat_Image\" src=\""+_543+"\"/></div>");_54a.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 _54f=$("#preferenceInnerContent").find("form").attr("userUploadPhotoUrl");$("#uploadPhotoCont").find("div.profilePhoto").removeClass("profilePhoto").addClass("profilePhotoSelected");$("#userPreferencePhotoCont").find("img").attr("src",_54f);$("#user_Photo").attr("value","userUpload");$("#allAvatarList").find("li.selected").removeClass("selected");var _550=$("#userPreferencePhotoCont").attr("currentPref");if(_550="IAM"){$("#zohoAccounts").removeAttr("purpose");$("#myComputer").attr("purpose","userUploadselected");}});}}}function uploadUserPhoto(_551,_552){$("#curr_UploadPhoto_Cont").find("img[purpose=\"uploadPhotoLoadingCont\"]").remove();if(_551=="failure"){showMessage(_552+" ,Please try again.","failure");}else{$("#curr_UploadPhoto_Cont").find("input[name=\"uploadPhotoFile\"]").val("");var _553=$("#preferenceInnerContent").find("form").attr("photoUrl");var src=_553+"/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 updateUserPreference(){if($("#userAvatarList").is(":focus")){var _555=$("#imgContUl");var _556=_555.find("li.listAvatarSelected");var src=_556.find("img").attr("src");_555.find("input[name=\"avatar\"]").val(src);}var _558=$("#wikiUrl");var _559=$("#blogUrl");var _55a=$("#webSite");var _55b=sanitizeURL($.trim(""+_558.val()));var _55c=sanitizeURL($.trim(""+_559.val()));var _55d=sanitizeURL($.trim(""+_55a.val()));_558.val(_55b);_559.val(_55c);_55a.val(_55d);doAjaxAction("/updateUserSetting.do",$("#preferenceInnerContent").find("form").serialize(),function(data){if(data=="SUCCESS"){showTipper(i18n["zohodiscussions.userpreference.userprofileupdated"],"success");var _55f=$("#userSelectedAvatarImage").val();$("#topContainerPhoto").find("img").attr("src",_55f);processHash("myArea/preference");}},function(err){var _561=eval(err.responseText);showMessage(_561.reason,"failure");});}function editDraftPost(_562){showLoadingImage();var _563=_562.attr("authorId");var _564=_562.attr("forumTopicId");var _565={};_565.forumGroupId=forumGroupId;_565.forumTopicId=_564;_565[csrfParamName]=csrfToken;_565.editMode="true";var _566=_562.attr("forumId");var _567=_562.attr("categoryId");if(_563==ZUID){_565.access="author";}doAjaxAction("/editDraft.do",_565,function(data){hideLoadingImage();document.title=i18n["zohodiscussions.writePost.documentTitle"]+" - "+forumGroupName;$("#mainContent").get(0).innerHTML=data;$("#SelectForum").val(_566);initWritePost();$("#SelectCategory").val(_567);},function(_569){var _56a=eval(_569.responseText);showMessage(_56a.reason,"failure");hideLoadingImage();});}function myJournalsDeletePost(_56b,_56c){var _56d=_56b.attr("authorId");var _56e=_56b.attr("action");var _56f={};_56f.forumGroupId=forumGroupId;_56f.forumId=_56b.attr("forumId");_56f.categoryId=_56b.attr("categoryId");_56f.forumTopicId=_56b.attr("forumTopicId");_56f[csrfParamName]=csrfToken;if(_56e=="/deleteForumResponse.do"){_56f.responseId=_56b.attr("responseId");}if(_56d==ZUID){_56f.access="author";}doAjaxAction(_56e,_56f,function(data){hideLoadingImage();if(_56e=="/deleteForumResponse.do"){showTipper(i18n["zohodiscussions.myJournals.successfullyTopicDeleted"],"success");}else{showTipper(i18n["zohodiscussions.myJournals.successfullyResponseDeleted"],"success");}_56b.parents("div.moderateSinglePost").hide();},function(err){var _572=eval(err.responseText);showMessage(_572.reason,"failure");hideLoadingImage();});}function myJournalsFilter(_573,_574){var _575=_573.attr("purpose");var _576=$("#"+_574+"InnerContent").find("div[status=\"show\"]");_576.attr("currFilterType",_573.text());_576.attr("filterType",_575);_576.find("div.moderateSinglePost").hide();var _577=-1;if(_575=="all"){$listOfTypes=_576.find("div.moderateSinglePost");$listOfTypes.each(function(_578,item){if(_578<postPerPage){$(item).show();}_577=_578;});}else{$listOfTypes=_576.find("div."+_575);$listOfTypes.each(function(_57a,item){if(_57a<postPerPage){$(item).show();}_577=_57a;});}if(_574=="watchList"){_574="watchTopic";}if(postPerPage>_577||_577==-1){$("#"+_574+"Next").removeClass("navBtnEnabled").addClass("navBtnDisabled");}else{$("#"+_574+"Next").removeClass("navBtnDisabled").addClass("navBtnEnabled");}var _57c=$("#"+_574+"Prev");_57c.removeClass("navBtnEnabled").addClass("navBtnDisabled");_57c.parent("ul").attr("fetchPage",1);if(_577==-1){$("#"+_574+"FilterEmptyMsg").show();$("#"+_574+"_Nav").hide();}else{$("#"+_574+"FilterEmptyMsg").hide();$("#"+_574+"_Nav").show();}}function myJournalsFilterAction(_57d,_57e){var _57f=_57d.parent();var _580=_57d.attr("purpose");var _581=$("#"+_57e+"InnerContent").find("div[status=\"show\"]");var _582=_57d.text();_581.attr("currFilterType",_582);var _583=$("#"+_57e+"Tab").find("li.selected").attr("purpose");showLoadingImage();var _584=_57f.attr(_583+"Action");var _585={};_585.forumGroupId=forumGroupId;_585.userId=_57f.attr("userId");_585.filterType=_582;_585[csrfParamName]=csrfToken;doAjaxAction(_584,_585,function(data){hideLoadingImage();_581.get(0).innerHTML=data;if(_57e=="myJournals"){var _587=$("#"+_57e+"SelectAction");_587.find("li[purpose=\"expandedView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.expandView"]+"</a>");_587.find("li[purpose=\"listView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.listView"]+"</span>");}},function(err){var _589=eval(err.responseText);showMessage(_589.reason,"failure");hideLoadingImage();});}function replyToPrivateMsg(_58a){var _58b=$("#newReplyPrivateMsgCont");if(_58b.is(":visible")){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");return;}var type=_58a.attr("postType");var _58d=_58a.attr("forumTopicId");var _58e=$("#privateMsgCont_"+_58d);var _58f=$("#privateMsg"+type+"Container");var _590="reply";var _591="Write";var _592=_58a.attr("toMember");var _593=_58a.attr("purpose");var _594=-1;var _595="";if(type=="Sent"){$("#topicContent_"+_58d).hide();}_58e.show();if(_593=="editThisPM"){$("#PrivateMsgReply").hide();$("#PrivateMsgEdit").show();}else{$("#PrivateMsgReply").show();$("#PrivateMsgEdit").hide();}var _596=$("#replyPrivateMsgContent");_58b=_596.clone();_58b.attr("id","newReplyPrivateMsgCont");_58b.find("#PrivateMsgReply").attr("id","newPrivateMsgReply");_58b.find("#PrivateMsgEdit").attr("id","newPrivateMsgEdit");_58b.find("#cancelPrivateReplyButton").attr("id","newcancelPrivateReplyButton");var _590="";var _597=_58b.find("textarea[name=\"privateMsgContent\"]");var _598=_58b.find("input[name=\"toMemberName\"]");var _599=_58b.find("input[name=\"forumPostTitle\"]");var _59a="";var _59b=$("#privateMsg_"+_58d).html();if(_593=="editThisPM"){_594=_58a.attr("responseId");_598.parent().hide();_59a=_58a.attr("postTitle");_599.val(_59a);_590="/editPrivateMsg.do";$("#privateMsg_"+_58d).hide();}else{_595=_58a.attr("toMemberName");_598.val(_595);_599.parent().hide();_590="/replyToPM.do";}_597.val(_59b);_58b.find("input[name=\"toMember\"]").val(_592);_58b.find("input[name=\"forumTopicId\"]").val(_58d);_58b.find("input[name=\"responseId\"]").val(_594);_58e.append(_58b.show());$("#newPrivateMsgReply, #newPrivateMsgEdit").unbind("click").click(function(){if(_593=="editThisPM"){if(_599.val().trim()==""){showMessage(i18n["zohodiscussions.writePost.noTitleInPost"],"failure");return;}}if(_597.val().trim()==""){showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");return;}doAjaxAction(_590,_58b.find("form").serialize(),function(data){showTipper(i18n["zohodiscussions.privateMsg.successfullyPMAdded"],"success");if(_593=="editThisPM"){$("#privateMsg_"+_58d).html(_597.val());$("#topicContent_"+_58d).html(_597.val());$("#editPrivateMsg_"+_58d).attr("postTitle",_599.val());$("#privateMsgPostTitle_"+_58d).html(_599.val());$("#newcancelPrivateReplyButton").trigger("click");}else{processHash("myArea/privateMsg");}},function(err,desc,_59f){_58b.find("div#writePMCaptcha").attr("id","newWritePMCaptcha");var _5a0=eval(err.responseText);if(_5a0.errorcode=="HIP_REQUIRED"){var _5a1=$("#newWritePMCaptcha");_5a1.find("input#captchaCodePM").attr("id","newCaptchaCodePM");_5a1.show();if(_5a1.attr("currCaptcha")=="new"){showMessage(i18n["zohodiscussions.writePost.captchaMsg"],"failure");}else{showMessage(i18n["zohodiscussions.writePost.captchaErrorMsg"],"failure");}_5a1.find("img[purpose=\"captchaImage\"]").replaceWith("<img purpose=captchaImage name=hipImg border=0 src=/showcaptcha?digest="+_5a0.reason+" align=absmiddle alt=HIP image>");$("#newCaptchaCodePM").attr("name",_5a0.reason);_5a1.attr("currCaptcha","old");_5a1.show();}else{showMessage(_5a0.reason,"failure");}hideLoadingImage();});});$("#newcancelPrivateReplyButton").click(function(){$("#privateMsgCont_"+_58d).hide();_58b.remove();if(_593=="editThisPM"){$("#privateMsg_"+_58d).show();}});return false;}function addPrivateMsg(_5a2,_5a3,_5a4,type){showLoadingImage();if(type=="UserPM"){var _5a6=$("#privateMsgTab").find("li.selected");_5a6.attr("isthere","false");}var _5a7=$("#postContentTA");var _5a8="";if(_5a3&&_5a3=="Edit"){_5a8=_5a7.parent().find("input[name=\"forumPostTitle\"]").val();_5a8=_5a8.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_5a8==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noTitleInPost"],"failure");return;}}var _5a9=_5a7.data("editor").val();_5a9=_5a9.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_5a9==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");return;}_5a7.val(_5a9);var _5aa=(_5a3&&_5a3=="Edit")?"/editPrivateMsg.do":(type=="UserPM")?"/addPrivateMsg.do":"/replyToPM.do";doAjaxAction(_5aa,$("#editorHolder").serialize(),function(data){hideLoadingImage();showTipper(i18n["zohodiscussions.privateMsg.successfullyPMAdded"],"success");if(_5a3=="Edit"){var _5ac=$("#privateMsgCont_"+_5a2).parent("li");_5ac.find("a[purpose=\"postConversationTitle\"]").html(_5a8);$("#cancelResponse").trigger("click");}else{if(type=="UserPM"){var _5ad=$("#UserPM").attr("authorName");processHash("user/"+_5ad);}else{processHash("myArea/privateMsg");}}},function(err,desc,_5b0){var _5b1=eval(err.responseText);if(_5b1.errorcode=="HIP_REQUIRED"){var _5b2=$("#replyPMContActual").show().find("div[purpose=\"responseCaptcha\"]");_5b2.find(":input").val("");if(_5b2.attr("currCaptcha")=="new"){showMessage(i18n["zohodiscussions.writePost.captchaMsg"],"failure");}else{showMessage(i18n["zohodiscussions.writePost.captchaErrorMsg"],"failure");}_5b2.find("img[purpose=\"captchaImage\"]").replaceWith("<img purpose=captchaImage name=hipImg border=0 src=/showcaptcha?digest="+_5b1.reason+" align=absmiddle alt=HIP image>");_5b2.find(":input").attr("name",_5b1.reason);_5b2.attr("currCaptcha","old");_5b2.show();}else{showMessage(_5b1.reason,"failure");}hideLoadingImage();});return false;}function deletePrivateMsg(_5b3){var _5b4=_5b3.attr("forumTopicId");var _5b5={};_5b5.forumGroupId=forumGroupId;_5b5.forumTopicId=_5b4;_5b5[csrfParamName]=csrfToken;doAjaxAction("/deletePM.do",_5b5,function(data){hideLoadingImage();showTipper(i18n["zohodiscussions.privateMsg.successfullyPMDeleted"],"success");var _5b7=$("#privateMsgTab").find("li.selected");if(_5b7.attr("purpose")=="inbox"){processHash("myArea/privateMsg");}else{_5b7.attr("isthere","false").trigger("click");}},function(err){var _5b9=eval(err.responseText);showMessage(_5b9.reason,"failure");hideLoadingImage();});}function privateConversation(_5ba){var _5bb=_5ba.attr("forumTopicId");var _5bc=$("#privateConversation_"+_5bb).html();var _5bd=$("#privateConversation");_5bd.show();$("#privateConversationCont").get(0).innerHTML=_5bc;$("#privateConversationClose").unbind("click").click(function(){_5bd.hide();return;});$("#morePrivateConversation").unbind("click").click(function(){_5bd.hide();showLoadingImage();openSinglePost(_5bb);return;});}function friendsTabClick(_5be){_5be.addClass("selected");showLoadingImage();var _5bf=_5be.attr("purpose");var _5c0=_5be.attr("action");var _5c1={};_5c1.forumGroupId=forumGroupId;doAjaxAction(_5c0,_5c1,function(data){hideLoadingImage();$("#friendsInnerCont").get(0).innerHTML=data;setPresenceInMyArea(dataOb,"friendsDetailsInnerContent");});}function myAreaAllTabClick(_5c3,_5c4){var _5c5=$("#"+_5c4+"InnerContent");var _5c6=_5c5.find("div[status=\"show\"]");_5c3.addClass("selected");var _5c7=_5c3.attr("purpose");var _5c8=_5c3.attr("isthere");var _5c9=_5c5.find("div[purpose=\"author_"+_5c7+"\"]");_5c6.attr("status","hide").hide();if(_5c4=="authorProfile"){if(_5c7=="privateMsg"){$("#authorProfileContentAction").hide();}else{$("#authorProfileContentAction").show();}}if(_5c4=="watchList"){if(_5c7!="watchTopics"){$("#"+_5c4+"_Filter").parent().hide();}else{$("#"+_5c4+"_Filter").parent().show();}}if(_5c4=="myJournals"||_5c4=="privateMsg"||_5c4=="authorProfile"){var _5ca=$("#"+_5c4+"SelectAction");if(_5c8=="true"){if(_5c4=="myJournals"||_5c4=="authorProfile"){var _5cb=$("#"+_5c4+"_Filter");if(_5c7=="replies"||_5c7=="authorReplies"){_5cb.parent().hide();}else{_5cb.parent().show();var _5cc=_5c9.attr("currFilterType");_5cb.val(_5cc);}}_5c9.attr("status","show").show();if(_5c9.find("div.collapse").length>0){_5ca.find("li[purpose=\"expandedView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.expandView"]+"</a>");_5ca.find("li[purpose=\"listView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.listView"]+"</span>");}else{if(_5c9.find("div.expand").length>0){_5ca.find("li[purpose=\"expandedView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.expandView"]+"</span>");_5ca.find("li[purpose=\"listView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.listView"]+"</a>");}}if(_5c4=="privateMsg"){if(typeof WmsContacts!="undefined"&&ch==true){var _5cd=WmsContacts.getZohoContacts();setPresenceInMyArea(_5cd,"userChat_"+_5c7);}}return;}}else{if(_5c8=="true"){_5c9.attr("status","show").show();if(_5c4=="watchList"){if(typeof WmsContacts!="undefined"&&ch==true){var _5cd=WmsContacts.getZohoContacts();setPresenceInMyArea(_5cd,"userChat_"+_5c7);}}return;}}showLoadingImage();var _5c7=_5c3.attr("purpose");var _5ce=_5c3.attr("action");var _5cf={};if(_5c7!="privateMsg"){_5cf.forumGroupId=forumGroupId;_5cf[csrfParamName]=csrfToken;if(_5c4=="myJournals"||_5c4=="authorProfile"){_5cf.userId=_5c3.attr("userId");}}if(_5c4=="myJournals"){_5cf.viewType="myself";}doAjaxAction(_5ce,_5cf,function(data){hideLoadingImage();var _5d1;if(_5c4=="myJournals"||_5c4=="authorProfile"){_5d1=$("<div purpose=author_"+_5c7+" status=show currFilterType=all></div>").html(data);var _5d2=$("#"+_5c4+"_Filter");if(_5c7=="replies"||_5c7=="authorReplies"){_5d2.parent().hide();}else{_5d2.parent().show();_5d2.val("All");}}else{_5d1=$("<div purpose=author_"+_5c7+" status=show id=userChat_"+_5c7+"></div>").html(data);}hideLoadingImage();showAuthorPopout(_5d1);_5d1.insertAfter(_5c6);_5c3.attr("isthere","true");if(_5c7=="drafts"||_5c7=="inbox"||_5c7=="sent"||_5c7=="authorTopics"){_5ca.find("li[purpose=\"expandedView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.expandView"]+"</a>");_5ca.find("li[purpose=\"listView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.listView"]+"</span>");}else{if(_5c7=="replies"||_5c7=="authorReplies"){_5ca.find("li[purpose=\"expandedView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.expandView"]+"</span>");_5ca.find("li[purpose=\"listView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.listView"]+"</a>");}}if(_5c4=="privateMsg"||_5c4=="watchList"){if(typeof WmsContacts!="undefined"&&ch==true){var _5d3=WmsContacts.getZohoContacts();setPresenceInMyArea(_5d3,"userChat_"+_5c7);}}},function(err){var _5d5=eval(err.responseText);showMessage(_5d5.reason,"failure");hideLoadingImage();});}function manageExpandOrCollapseType(_5d6,_5d7){var _5d8=_5d6.attr("purpose");if(_5d6.find("a").length<1){return;}var _5d9=$("#"+_5d7+"InnerContent");var _5da=$("#"+_5d7+"SelectAction");var _5db=_5d9.find("div[status=\"show\"]");if(_5d8=="expandedView"){_5db.find("div.collapse").attr("class","expand");_5db.find("div.expand div.bigPlusIcon").removeClass("bigPlusIcon").addClass("bigMinusIcon");_5db.find("div.textContent").addClass("expandTextContent").show();_5db.find("div.moderateSinglePost div.lowerButton").show();_5da.find("li[purpose=\"expandedView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.expandView"]+"</span>");_5da.find("li[purpose=\"listView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.listView"]+"</a>");}else{if(_5d8=="listView"){_5db.find("div.expand").attr("class","collapse");_5db.find("div.collapse div.bigMinusIcon").removeClass("bigMinusIcon").addClass("bigPlusIcon");_5db.find("div.textContent").addClass("expandTextContent").hide();_5db.find("div.moderateSinglePost div.lowerButton").hide();_5da.find("li[purpose=\"expandedView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.expandView"]+"</a>");_5da.find("li[purpose=\"listView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.listView"]+"</span>");}}return;}function manageCountValue(_5dc){var _5dd=$("#"+_5dc).find("li.selected");var _5de=_5dd.attr("count");_5de=--_5de;var _5df=_5dd.attr("purpose");if(_5df=="watchTopics"){_5dd.find("a").html(i18n["zohodiscussions.myJournals.topics"]+"("+_5de+")");}else{if(_5df=="authorReplies"){_5dd.find("a").html(i18n["zohodiscussions.general.replies"]+"("+_5de+")");}else{if(_5df=="watchUsers"){_5dd.find("a").html(i18n["zohodiscussions.watchList.users"]+"("+_5de+")");}else{if(_5df=="inbox"){_5dd.find("a").html(i18n["zohodiscussions.privateMsg.inbox"]+"("+_5de+")");}else{if(_5df=="sent"){_5dd.find("a").html(i18n["zohodiscussions.privateMsg.sent"]+"("+_5de+")");}}}}}_5dd.attr("count",_5de);}function fnPagination(_5e0,_5e1,_5e2){showLoadingImage();var _5e3=_5e0.attr("action");var _5e4=_5e0.attr("currType");var _5e5={};if(_5e2=="true"){_5e4="authorProfile";}var _5e6=$("#"+_5e4+"InnerContent").find("div[status=\"show\"]");_5e5.forumGroupId=forumGroupId;if(_5e4!="privateMsg"){_5e5.userId=_5e0.attr("userId");var _5e7=$("#"+_5e4+"Tab").find("li.selected").attr("purpose");if(_5e7=="topics"||_5e7=="drafts"||_5e7=="authorTopics"){_5e5.filterType=_5e6.attr("currfiltertype");}}if(_5e4=="myJournals"){_5e5.viewType="myself";}var _5e8=parseInt(_5e0.attr("fetchPage"));if(_5e1=="next"){_5e5.fetchPage=_5e8+1;}else{_5e5.fetchPage=_5e8-1;}_5e5.getPostFor=_5e0.attr("getPostFor");doAjaxAction(_5e3,_5e5,function(data){hideLoadingImage();_5e6.get(0).innerHTML=data;var _5ea=$("#"+_5e4+"Tab").find("li.selected").attr("purpose");var _5eb=$("#"+_5e4+"SelectAction");if(_5ea=="replies"){_5eb.find("li[purpose=\"expandedView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.expandView"]+"</span>");_5eb.find("li[purpose=\"listView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.listView"]+"</a>");}else{_5eb.find("li[purpose=\"expandedView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.expandView"]+"</a>");_5eb.find("li[purpose=\"listView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.listView"]+"</span>");}},function(err){var _5ed=eval(err.responseText);showMessage(_5ed.reason,"failure");hideLoadingImage();});}function fnPaginationProcess(_5ee,type){var _5f0=parseInt(_5ee.attr("fetchPage"));var _5f1=_5ee.attr("currType");var _5f2=_5ee.attr("postCount");if(type=="next"){_5f0=_5f0+1;}else{_5f0=_5f0-1;}_5ee.attr("fetchPage",_5f0);var _5f3=$("#current_"+_5f1+"_List");var _5f4=(_5f0*postPerPage);var _5f5=(_5f4-postPerPage)+1;var _5f6=_5f5;if(_5f2<=_5f4){_5f4=_5f2;_5ee.find("li[purpose=\"next\"]").removeClass("navBtnEnabled").addClass("navBtnDisabled");}else{_5ee.find("li[purpose=\"next\"]").removeClass("navBtnDisabled").addClass("navBtnEnabled");}if(_5f5==1){_5ee.find("li[purpose=\"prev\"]").removeClass("navBtnEnabled").addClass("navBtnDisabled");}else{_5ee.find("li[purpose=\"prev\"]").removeClass("navBtnDisabled").addClass("navBtnEnabled");}if(_5f1=="recentActivity"){_5f3.find("li").hide();for(_5f6;_5f6<=_5f4;_5f6++){$("#recentActivity_"+_5f6).show();}}else{_5f3.find("div.moderateSinglePost").hide();var _5f7=_5f1;if(_5f1=="watchTopic"){_5f1="watchList";}var _5f8=$("#"+_5f1+"InnerContent").find("div[status=\"show\"]").attr("filterType");if((_5f1=="watchList"||_5f1=="bookMark")&&_5f8!="all"){var _5f9;$listOfTypes=_5f3.find("."+_5f8);_5f6--;$listOfTypes.each(function(_5fa,item){if(_5fa<_5f4&&_5f6<=_5fa){$(item).show();}_5f9=_5fa;});}else{for(_5f6;_5f6<=_5f4;_5f6++){_5f3.find("div.moderateSinglePost[listStage=\""+_5f7+"_"+_5f6+"\"]").show();}}}}function getAuthorProfile(_5fc){showLoadingImage();var _5fd=$("#userProfileMainContainer");if(_5fd.length>0&&_5fd.is("[shouldReload=\"false\"]")){_5fd.show().attr("shouldReload","true").siblings().remove();hideLoadingImage();}else{var _5fe={};_5fe.forumGroupId=forumGroupId;_5fe.authorName=_5fc;_5fe[csrfParamName]=csrfToken;_5fe.ch=ch;doAjaxAction("/getAuthorProfile.do",_5fe,function(data){hideLoadingImage();$("#authorPopout:visible").hide();$("#mainContent").get(0).innerHTML=data;$.history.add("User/"+_5fc);bindAuthorProfileActions(_5fc);},function(err){var _601=eval(err.responseText);showMessage(_601.reason,"failure");hideLoadingImage();});}}function bindAuthorProfileActions(_602){$("#mainContent").unbind("click",processAuthorProfileClick).click(processAuthorProfileClick);$("#mainContent").unbind("click",processAllMyAreaMainClick).click(processAllMyAreaMainClick);$("#mainContent").unbind("click",processAllActionClick).click(processAllActionClick);allFilterOption("authorProfile");var _603=$("#mainContent > #userProfileMainContainer").attr("authorId");$("#authorPopout_"+_603).hide();if(typeof WmsContacts!="undefined"&&ch==true){var _604=WmsContacts.status(_603);if(_604===false){_604=9;}manageUserChatStatus("userOnlineStatus_"+_602,_604,_602);}}function processAuthorProfileClick(_605){var _606=$(_605.target);var _607=_606.parent();if($("#loadingImg").is(":visible")){return;}else{if(_607.is("li[purpose=\"sendPM\"]")){addPrivateMessage(_607);}else{if(_607.is("li[purpose=\"watchItem\"]")){watchItem(_607);}else{if(_607.is("li[purpose=\"addAsFriend\"]")){addAsFriend(_607);}else{if(_607.is("li[purpose=\"blockUser\"]")){blockUser(_607);}else{if(_607.is("li[purpose=\"unBlockUser\"]")){unBlockUser(_607);}else{if(_607.is("li[purpose=\"moderateUser\"]")){moderateUser();}else{if(_607.is("li[purpose=\"assignLabel\"]")){bindUserLabelsAction();}}}}}}}}}function writePrivateMsg(){var _608=$("#sentPrivateMsg");var _609=$("#editorContainer_PM");if(_609.data("inEditMode")){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"failure");return false;}_608.show();openEditor($("#editPM"),"privateMsgContent","postContentTA","UserPM","Write","editorContainer_PM");_609.data("inEditMode",true);}function watchItem(_60a){showLoadingImage();var _60b=_60a.attr("itemType");var _60c={};_60c.forumGroupId=forumGroupId;_60c.itemType=_60b;_60c.itemId=_60a.attr("itemId");_60c[csrfParamName]=csrfToken;doAjaxAction("/watchItem.do",_60c,function(data){hideLoadingImage();showTipper(i18n["zohodiscussions.watchList.successfullyWatchUser"],"success");_60a.attr("purpose","unWatchItem");_60a.find("a").html(i18n["zohodiscussions.userProfile.unwatchUser"]);},function(err){var _60f=eval(err.responseText);showMessage(_60f.reason,"failure");hideLoadingImage();});}function unWatchItem(_610,type){showLoadingImage();var type=_610.attr("unWatchType");var _612=_610.attr("itemId");var _613={};_613.forumGroupId=forumGroupId;_613.itemId=_612;_613[csrfParamName]=csrfToken;doAjaxAction("/unWatch.do",_613,function(data){hideLoadingImage();if(type=="authorProfile"){showTipper(i18n["zohodiscussions.watchList.successfullyUnwatchUser"],"success");_610.attr("purpose","watchItem");_610.find("a").html(i18n["zohodiscussions.userProfile.watchUser"]);}else{if(type=="following"){showTipper(i18n["zohodiscussions.watchList.successfullyUnwatchUser"],"success");$("#watch_"+_612).parents("li").remove();}else{showTipper(i18n["zohodiscussions.watchList.successfullyUnwatchTopic"],"success");_610.parents("div#watch_"+_612).remove();manageCountValue("watchListTabs");}}},function(err){var _616=eval(err.responseText);showMessage(_616.reason,"failure");hideLoadingImage();});}function addAsFriend(_617){showLoadingImage();var _618=_617.attr("successMsg");var _619={};_619.forumGroupId=forumGroupId;_619.userId=_617.attr("userId");_619[csrfParamName]=csrfToken;doAjaxAction("/addAsFriend.do",_619,function(data){hideLoadingImage();if(data=="SUCCESS"){_617.attr("purpose","friendWaitingApproval");$("#addAsFriendLink").attr("style","cursor:default;text-decoration:none;").html(i18n["zohodiscussions.friends.awaitingApproval"]);showTipper(_618,"success");}},function(err){var _61c=eval(err.responseText);showMessage(_61c.reason,"failure");hideLoadingImage();});}function confirmFriendRequest(_61d){showLoadingImage();var _61e=_61d.attr("userId");var _61f=_61d.attr("successMsg");var _620={};_620.forumGroupId=forumGroupId;_620.userId=_61e;_620[csrfParamName]=csrfToken;doAjaxAction("/confirmFriendRequest.do",_620,function(data){hideLoadingImage();showTipper(_61f,"info");var _622=$("#friendId_"+_61e);if(_622.length>0){var _623=_622.siblings("div.moderateSinglePost");_622.fadeOut().remove();$("#friendsDetailsTabs li.selected span[purpose=\"friendsCount\"]").html(_623.length);var _624=$("#friendsDetailsTabs li span[mainPurpose=\"approvedFriends\"]").text();_624=parseInt(_624);_624++;$("#friendsDetailsTabs li span[mainPurpose=\"approvedFriends\"]").html(_624);}else{location.reload();}},function(err){var _626=eval(err.responseText);showMessage(_626.reason,"failure");hideLoadingImage();});}function removeFriend(_627){var _628=_627.attr("confirmMsg");if(confirm(_628)){showLoadingImage();var _629=_627.attr("userId");var _62a=_627.attr("successMsg");var _62b={};_62b.forumGroupId=forumGroupId;_62b.userId=_629;_62b[csrfParamName]=csrfToken;doAjaxAction("/removeFriend.do",_62b,function(data){hideLoadingImage();showTipper(_62a,"info");var _62d=$("#friendId_"+_629);if(_62d.length>0){var _62e=_62d.siblings("div.moderateSinglePost");_62d.fadeOut().remove();$("#friendsDetailsTabs li.selected span[purpose=\"friendsCount\"]").html(_62e.length);}else{location.reload();}},function(err){var _630=eval(err.responseText);showMessage(_630.reason,"failure");hideLoadingImage();});}}function blockUser(_631){showLoadingImage();var _632={};_632.forumGroupId=forumGroupId;_632.authorId=_631.attr("authorId");_632[csrfParamName]=csrfToken;doAjaxAction("/blockUser.do",_632,function(data){hideLoadingImage();showTipper(i18n["zohodiscussions.userProfile.successfullyBlockUser"],"success");_631.attr("purpose","unBlockUser");_631.find("a").html(i18n["zohodiscussions.userProfile.unblockUser"]);},function(err){var _635=eval(err.responseText);showMessage(_635.reason,"failure");hideLoadingImage();});}function unBlockUser(_636){showLoadingImage();var _637={};_637.forumGroupId=forumGroupId;_637.authorId=_636.attr("authorId");_637[csrfParamName]=csrfToken;doAjaxAction("/unBlockUser.do",_637,function(data){hideLoadingImage();showTipper(i18n["zohodiscussions.userProfile.successfullyUnBlockUser"],"success");_636.attr("purpose","blockUser");_636.find("a").html(i18n["zohodiscussions.userProfile.blockUser"]);},function(err){var _63a=eval(err.responseText);showMessage(_63a.reason,"failure");hideLoadingImage();});}function moderateUser(){$("#moderateUserTemplate").html($("#dimDivModerateUser").html());$("#dimDivModerateUser").html("");$("#moderateUserTemplate").show();var _63b=$("#eachForumListForModeration").find(":input[name='forumLevelModeration']");var _63c=$("#moderateUserPopOutForm").find(":input[name='portalLevelModeration']");if(_63b.length==0){$("#forumLabel").hide();}if(_63c.attr("checked")){_63b.attr("disabled",true);}$("#imgCancel").click(function(){$this=$(this);$("#dimDivModerateUser").html($("#moderateUserTemplate").html());$("#moderateUserTemplate").hide();$("#moderateUserTemplate").html("");var _63d=$("#moderateUserCont");if(_63d.attr("status")=="changed"){var _63e=$("#userProfileMainContainer");_63e.show().attr("shouldReload","true");getAuthorProfile($this.attr("authorName"));}});_63c.click(function(){$this=$(this);if($this.attr("checked")){_63b.attr("disabled",true);}else{_63b.attr("disabled",false);}moderateUserAction($this);});_63b.click(function(){$this=$(this);moderateUserAction($this);});}function moderateUserAction(_63f){var _640=$("#moderateUserCont");_640.attr("status","changed");var _641=_63f.attr("authorId");var _642=_63f.attr("userName");var _643=_63f.attr("moderationStatus");var _644=_63f.attr("isAdmin");var _645=_63f.attr("isPortal");var _646=0;var _647=false;var _648="";var _649="";var _64a={};_64a.authorId=_641;_64a.forumGroupId=forumGroupId;_64a[csrfParamName]=csrfToken;_64a.adminUser=_644;if(_645){_64a.moderateType=1;if(_643=="unmoderated"){_648=i18n["zohodiscussions.userProfile.moderateUserConfirmMess"]+" "+_642+" "+i18n["zohodiscussions.userProfile.moderateUserPortalLevel"];_649=i18n["zohodiscussions.userProfile.usermoderatedSuccessMess"];}else{_648=i18n["zohodiscussions.userProfile.unmoderateUserConfirmMess"]+" "+_642+" "+i18n["zohodiscussions.userProfile.moderateUserPortalLevel"];_649=i18n["zohodiscussions.userProfile.userUnmoderatedSuccessMess"];}}else{_64a.moderateType=0;var _64b=_63f.attr("forumId");_64a.forumId=_64b;var _64c=_63f.attr("forumName");if(_643=="unmoderated"){_648=i18n["zohodiscussions.userProfile.moderateUserConfirmMess"]+" "+_642+" "+i18n["zohodiscussions.general.in"]+" "+_64c+" "+i18n["zohodiscussions.userProfile.moderateUserForumLevel"];_649=" "+i18n["zohodiscussions.userProfile.usermoderatedSuccessMess"];}else{_648=i18n["zohodiscussions.userProfile.unmoderateUserConfirmMess"]+" "+_642+" "+i18n["zohodiscussions.general.in"]+" "+_64c+" "+i18n["zohodiscussions.userProfile.moderateUserForumLevel"];_649=i18n["zohodiscussions.userProfile.userUnmoderatedSuccessMess"];}}if(_643=="unmoderated"){if(confirm(_648)){doAjaxAction("/moderateUser.do",_64a,function(data){if(data=="SUCCESS"){showTipper(_642+" "+_649,"success",1000);_63f.attr("moderationStatus","moderated");if(!_645){$("#itemListCont_"+_64b).find("span.italicText").html(i18n["zohodiscussions.moderationLeftContainer.moderated"]);}}else{showMessage(i18n["zohodiscussions.moderationAction.errormessage"],"failure");}});}else{var _640=$("#moderateUserCont");_640.attr("status","");if(_645){$("#moderateUserPopOutForm").find(":input[isPortal='true']").attr("checked",false);$("#eachForumListForModeration").find(":input[name='forumLevelModeration']").attr("disabled",false);}else{$("#moderateUserPopOutForm").find(":input[forumId='"+_64b+"']").attr("checked",false);}}}else{if(confirm(_648)){doAjaxAction("/unModerateUser.do",_64a,function(data){if(data=="SUCCESS"){showTipper(_642+" "+_649,"success",1000);_63f.attr("moderationStatus","unmoderated");if(!_645){$("#itemListCont_"+_64b).find("span.italicText").html(i18n["zohodiscussions.ModerateUsers.ModerateUsers"]);}}else{showMessage(i18n["zohodiscussions.moderationAction.errormessage"],"failure");}});}else{var _640=$("#moderateUserCont");_640.attr("status","");if(_645){$("#moderateUserPopOutForm").find(":input[isPortal='true']").attr("checked",true);$("#eachForumListForModeration").find(":input[name='forumLevelModeration']").attr("disabled",true);}else{$("#moderateUserPopOutForm").find(":input[forumId='"+_64b+"']").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 _64f=$(this);var _650=_64f.attr("forumId");var _651=_64f.attr("userId");var _652=_64f.val();var _653={};_653.forumGroupId=forumGroupId;_653.forumId=_64f.attr("forumId");_653.userId=_64f.attr("userId");_653.labelId=_64f.val();_653[csrfParamName]=csrfToken;doAjaxAction("/mapLabelToUser.do",_653,function(data){if(data=="SUCCESS"){_64f.find("option[selected]").removeAttr("selected");var _655=_64f.find("option[value='"+_652+"']");var _656=_655.text();_655.replaceWith("<option value='"+_652+"' selected>"+_656+"</option>");if(_652=="-1"){showTipper(i18n["zohodiscussions.UserDetails.labelRemovedMsg"],"info");}else{showTipper(i18n["zohodiscussions.UserDetails.labelAddedMsg"],"success");}}});});}function setPresenceInTopicList(dObj,_658){if(!dObj){return;}var _659="";if(!_658){if($("#topicList").length>0){_659=$("#topicList > div.singleTopicCont > div.chatTopicCont > div.topicMDetails > div.lightGreyText > img.authorChatPresence");}else{_659=$("#topicsList > div.singleTopicCont > div.chatTopicCont > div.topicMDetails > div.lightGreyText > img.authorChatPresence");}$stickyPostAuthors=$("#recentStickyPosts >li  >div.ashColorText >div.authorChatPresence");$announcementPostAuthors=$("#recentAnnouncementPosts >li  >div.ashColorText >div.authorChatPresence");_659.each(function(_65a,item){var _65c=$(item);var _65d=_65c.attr("authorId");if(_65d==ZUID){return;}var _65e=_65c.attr("responseId");var _65f="";_65f=$("#uc_"+_65e+"_"+_65d);try{var _660=dObj[_65d]["STATUS"];manageUserChatStatusInTopicList(_65f,_660,"topicList");}catch(ex){}});$stickyPostAuthors.each(function(_661,item){var _663=$(item);var _664=_663.attr("authorId");if(_664==ZUID){return;}try{var _665=dObj[_664]["STATUS"];manageUserChatStatusInTopicList(_663,_665);}catch(ex){}});$announcementPostAuthors.each(function(_666,item){var _668=$(item);var _669=_668.attr("authorId");if(_669==ZUID){return;}try{var _66a=dObj[_669]["STATUS"];manageUserChatStatusInTopicList(_668,_66a);}catch(ex){}});}else{_659=$("#SinglePostContainer_"+_658+" div.postTitle div.authorChatPresence");_659.each(function(_66b,item){var _66d=$(item);var _66e=_66d.attr("authorId");if(_66e==ZUID){return;}var _66f=_66d.attr("responseId");var _670="";_670=$("#uc_"+_658+"_"+_66f+"_"+_66e);try{var _671=dObj[_66e]["STATUS"];manageUserChatStatusInTopicList(_670,_671);}catch(ex){}});}}function setPresenceInMyArea(dObj,_673){if(!dObj){return;}var _674="";if(_673=="current_recentActivity_List"){_674=$("#"+_673+" >li >div.authorChatPresence");}else{if(_673=="userChat_inbox"||_673=="userChat_sent"){_674=$("#"+_673+" div.moderateSinglePost ul li img.authorChatPresence");}else{_674=$("#"+_673+" div.moderateSinglePost ul li div.authorChatPresence");}}_674.each(function(_675,item){var _677=$(item);var _678=_677.attr("authorId");if(_678==ZUID){return;}try{var _679=dObj[_678]["STATUS"];manageUserChatStatusInTopicList(_677,_679);}catch(ex){}});}function setPresence(dObj,_67b){if(!dObj){return;}var _67c=$("#"+_67b+" > li > div.userChatPresence");_67c.each(function(_67d,item){var _67f=$(item);var _680=_67f.attr("authorId");if(_680==ZUID){return;}var _681=_67f.attr("id");var _682=_67f.attr("authorName");try{var _683=dObj[_680]["STATUS"];manageUserChatStatus(_681,_683,_682);}catch(ex){}});}function manageUserChatStatus(_684,_685,_686){var _687=$("#"+_684);if(_685=="4"){_687.find("div").attr("class","wms-4 chatOverride flLeft").unbind("click",chatInvoker).click(chatInvoker);_687.find("a").html(i18n["zohodiscussions.chat.idleForChat"]);_687.attr("title",_686+" "+i18n["zohodiscussions.chat.isNowIdle"]).unbind("click",chatInvoker).click(chatInvoker);}else{if(_685=="3"){_687.find("div").attr("class","wms-3 chatOverride flLeft").unbind("click",chatInvoker).click(chatInvoker);_687.find("a").html(i18n["zohodiscussions.chat.busyforchat"]);_687.attr("title",_686+" "+i18n["zohodiscussions.chat.isBusyToChat"]).unbind("click",chatInvoker).click(chatInvoker);}else{if(_685=="1"){_687.find("div").attr("class","wms-1 chatOverride flLeft");_687.find("a").html(i18n["zohodiscussions.chat.availableforchatmessage"]);_687.attr("title",_686+" "+i18n["zohodiscussions.chat.isAvailableToChat"]).unbind("click",chatInvoker).click(chatInvoker);}else{if(_685=="0"){_687.find("div").attr("class","wms-0 chatOverride flLeft");_687.find("a").html(i18n["zohodiscussions.chat.offlineforchat"]).unbind("click",chatInvoker).click(chatInvoker);_687.attr("title",i18n["zohodiscussions.chat.offlineforchat"]).unbind("click",chatInvoker).click(chatInvoker);}else{if(_685=="-1"){_687.find("div").attr("class","imgAddContact flLeft");_687.find("a").html(i18n["zohodiscussions.chat.invitedforchat"]);_687.attr("title",i18n["zohodiscussions.chat.youHaveInvited"]+" "+_686+" "+i18n["zohodiscussions.chat.toChat"]).unbind("click",chatInvoker);}else{if(_685=="-3"){_687.find("div").attr("class","imgAddContact flLeft");_687.find("a").html(i18n["zohodiscussions.chat.acceptinvitationforchat"]);_687.attr("title",_686+" "+i18n["zohodiscussions.chat.youHaveInvited"]).unbind("click",chatInvoker);}}}}}}_687.find("div").unbind("click",chatInvoker).click(chatInvoker);_687.find("a").unbind("click",chatInvoker).click(chatInvoker);}function manageUserChatStatusInTopicList(_688,_689,_68a){var flag=0;if(_689=="4"){flag=1;_688.attr("class","wms-4 flLeft").unbind("click",chatInvoker).click(chatInvoker);}else{if(_689=="3"){flag=1;_688.attr("class","wms-3 flLeft").unbind("click",chatInvoker).click(chatInvoker);}else{if(_689=="1"){flag=1;_688.attr("class","wms-1 flLeft").unbind("click",chatInvoker).click(chatInvoker);}else{if(_689=="0"){flag=1;_688.attr("class","wms-0 flLeft").unbind("click",chatInvoker).click(chatInvoker);}else{if(_689=="-4"){_688.attr("class","flLeft").unbind("click",chatInvoker);}else{if(_689=="-5"){_688.attr("class","flLeft").unbind("click",chatInvoker);}}}}}}if(_68a=="topicList"){if(flag==1){_688.addClass("authorChatPresence chatStyleOverride");}else{_688.remove();}}else{_688.addClass("authorChatPresence chatOverride");}}function chatInvoker(){var _68c=$(this);var name=_68c.attr("authorName");var _68e=_68c.attr("authorId");if(_68e==undefined){_68e=_68c.parent().attr("authorId");name=_68c.parent().attr("authorName");}var _68f=WmsContacts.status(_68e);if(_68f>-1&&_68f!==false){WebMessanger.chat(_68e);return;}if(_68f==-1){if(confirm(name+" "+i18n["zohodiscussions.chat.reminder"])){WmsContacts.add("zoho",name,ZUID);}}else{if(_68f==-3){WmsContacts.accept("zoho",name,ZUID);}else{WmsContacts.add("zoho",name,ZUID);}}}function updatePresence(usid,_691,_692){if(ch!=true){return;}if($("#recentStickyPosts").is(":visible")){var _693=$("#recentStickyPosts >li >div.ashColorText >div.authorChatPresence");_693.each(function(_694,item){var _696=$(item);var _697=_696.attr("authorId");if(_697==usid){manageUserChatStatusInTopicList(_696,_692);}});}if($("#recentAnnouncementPosts").is(":visible")){var _693=$("#recentAnnouncementPosts >li >div.ashColorText >div.authorChatPresence");_693.each(function(_698,item){var _69a=$(item);var _69b=_69a.attr("authorId");if(_69b==usid){manageUserChatStatusInTopicList(_69a,_692);}});}if($("#topicListMainContainer").is(":visible")){var _69c=eval("("+$("#uListForStatusUpdate").html()+")");var zuid="z"+usid;if(typeof _69c[zuid]!="undefined"){for(i=0;i<_69c[zuid].length;i++){var _69e=$("#uc_"+_69c[zuid][i]+"_"+usid);manageUserChatStatusInTopicList(_69e,_692,"topicList");}}if($("#singleForumHeaderView").is(":visible")){var _69f=$("#singleForumHeaderView").attr("forumId");manageUserChatStatus("moderatorOnlineStatus_"+_69f+"_"+_691,_692,_691);}}else{if($("#SinglePostContainer").is(":visible")){var _6a0=$("#SinglePostContainer").attr("forumTopicId");var _69c=eval("("+$("#uListForStatusUpdateInSP").html()+")");var zuid="z"+usid;if(typeof _69c[zuid]!="undefined"){for(i=0;i<_69c[zuid].length;i++){var _69e=$("#uc_"+_6a0+"_"+_69c[zuid][i]+"_"+usid);manageUserChatStatusInTopicList(_69e,_692);}}}else{if($("#userProfileMainContainer").is(":visible")){manageUserChatStatus("userOnlineStatus_"+_691,_692,_691);}else{if($("#myAreaInnerMainContent").is(":visible")){if($("#profileDetailCont").is(":visible")){manageUserChatStatus("followersOnlineStatus_"+_691,_692,_691);manageUserChatStatus("followingOnlineStatus_"+_691,_692,_691);var _6a1=$("#current_recentActivity_List >li >div.authorChatPresence");_6a1.each(function(_6a2,item){var _6a4=$(item);var _6a5=_6a4.attr("authorId");if(_6a5==usid){manageUserChatStatusInTopicList(_6a4,_692);}});}else{var _6a6="";if($("#watchListInnerContent").is(":visible")){var _6a7=$("#watchListInnerContent").find("div[status=\"show\"]");_6a6=_6a7.attr("id");}else{if($("#privateMsgInnerContentent").is(":visible")){var _6a7=$("#privateMsgInnerContent").find("div[status=\"show\"]");_6a6=_6a7.attr("id");}}if(_6a6!=""){var _6a1="";if(_6a6=="privateMsgInnerContent"){_6a1=$("#"+_6a6+" div.moderateSinglePost ul li img.authorChatPresence");}else{_6a1=$("#"+_6a6+" div.moderateSinglePost ul li div.authorChatPresence");}_6a1.each(function(_6a8,item){var _6aa=$(item);var _6ab=_6aa.attr("authorId");if(_6ab==usid){manageUserChatStatusInTopicList(_6aa,_692);}});}}manageUserChatStatus("authorPopup_"+_691,_692,_691);}}}}}function addPrivateMessage(_6ac){var _6ad=_6ac.attr("toMember");var _6ae=_6ac.attr("authorname");var _6af=$("#privateMsgPrompt");var _6b0=$("#privateMsgToMemberArea");var _6b1=$("#privateMsgTitleArea");var _6b2=$("#privateMsgContentArea");var _6b3=$("#privateMsgToMemberId");_6b3.val("");_6b0.val("");_6b1.val("");_6b2.val("");_6b3.val(_6ad);_6b0.val(_6ae);_6af.show().parent().show();$("#cancelPrivateMsgButton, #cancelPrivateMsg").unbind("click").click(function(){_6b0.val("");_6b1.val("");_6b2.val("");var _6b4=$("#writePMCaptcha");_6b4.find("img").attr("src","/images/spacer.gif");_6b4.find(":input").val("");_6b4.hide();_6af.hide().parent().hide();});$("#addNewPrivateMsg").unbind("click").click(function(){showLoadingImage();var _6b5=_6b2.val();_6b5=_6b5.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_6b5==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");return;}var _6b6=_6b1.val();_6b6=_6b6.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_6b6==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noTitleInPost"],"failure");return;}doAjaxAction("/addPrivateMsg.do",_6af.find("form").serialize(),function(data){var _6b8=$("#writePMCaptcha");_6b8.find("img").attr("src","/images/spacer.gif");_6b8.find(":input").val("");_6b8.hide();hideLoadingImage();if(data=="SUCCESS"){showTipper(i18n["zohodiscussions.privateMsg.successfullyPMAdded"],"success");}else{var _6b9=eval(data);showMessage(_6b9.reason,"failure");hideLoadingImage();}_6af.hide().parent().hide();},function(err){var _6bb=eval(err.responseText);if(_6bb.errorcode=="HIP_REQUIRED"){var _6bc=$("#writePMCaptcha");if(_6bc.attr("currCaptcha")=="new"){showMessage(i18n["zohodiscussions.writePost.captchaMsg"],"failure");}else{showMessage(i18n["zohodiscussions.writePost.captchaErrorMsg"],"failure");}_6bc.find("img[purpose=\"captchaImage\"]").replaceWith("<img purpose=captchaImage name=hipImg border=0 src=/showcaptcha?digest="+_6bb.reason+" align=absmiddle alt=HIP image>");$("#captchaCodePM").attr("name",_6bb.reason);_6bc.attr("currCaptcha","old");_6bc.show();}else{showMessage(_6bb.reason,"failure");}hideLoadingImage();});});_6b1.focus();}function Collaboration(){}Collaboration.handleUserList=function(chid,list){};Collaboration.handleMessage=function(chid,_6c0,zuid,_6c2,msg){};Collaboration.handlePresence=function(chid,_6c5,zuid,_6c7,_6c8){};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,_6ce,_6cf,_6d0,att,_6d2){if(prd=="FM"){setTimeout(function(){showBubble(msg,_6cf);},2);return true;}else{return false;}};Collaboration.handleCustomMessage=function(msg){};Collaboration.handleCrossProductMessage=function(prd,msg){};Collaboration.onConnect=function(){};Collaboration.openURL=function(url,_6d7,_6d8,prd){return true;};Collaboration.handleCollabAdd=function(_6da,_6db,zuid,time,chid){};Collaboration.handleCollabDelete=function(_6df,_6e0,zuid,time,chid){};Collaboration.handleUserAdd=function(chid,_6e5){};Collaboration.handleUserDeleted=function(chid,_6e7){};Collaboration.handleIsOnline=function(_6e8){updateStatus(_6e8);};Collaboration.handleLogout=function(_6e9){setTimeout(function(){$.get("/cleardomain.do","",function(){window.location.href=window.location.href;});},5);};Collaboration.goOffline=function(){};Collaboration.handleChatNotifyMessage=function(chid,_6eb,_6ec){};Collaboration.getPageTitle=function(){return false;};Collaboration.handleWmsDisable=function(_6ed){setTimeout(function(){$.get("/cleardomain.do","",function(){window.location.href=window.location.href;});},5);};function WmsContactImpl(){}WmsContactImpl.handlePresence=function(zuid,_6ef,_6f0,_6f1,_6f2){setTimeout(function(){updatePresence(zuid,_6ef,_6f1);},2);};WmsContactImpl.handleAddressBook=function(){};WmsContactImpl.handleInvite=function(zuid,_6f4,_6f5){};WmsContactImpl.notifyInvite=function(zuid,_6f7,_6f8){};WmsContactImpl.handleAccept=function(zuid,_6fa,_6fb,_6fc,_6fd){};WmsContactImpl.notifyAccept=function(zuid,_6ff,_700,_701,_702){};WmsContactImpl.handleReject=function(zuid,_704,_705){};WmsContactImpl.notifyRemove=function(zuid,_707,_708){};WmsContactImpl.handleDelete=function(zuid,_70a,_70b){};WmsContactImpl.handleContactUpdated=function(){};WmsContactImpl.handleStatusMessage=function(_70c,_70d){};WmsContactImpl.handeAllStatusMessages=function(){};WmsContactImpl.handleHideContactsUI=function(){};WmsContactImpl.handleShowContactsUI=function(){};WmsContactImpl.handleGetContacts=function(){var _70e=WmsContacts.getZohoContacts();if($("#topicListMainContainer").is(":visible")||$("#allForums_MainContentCont").is(":visible")){setPresenceInTopicList(_70e);if($("#singleForumHeaderView").is(":visible")){var _70f=$("#singleForumHeaderView").attr("forumId");setPresence(_70e,"moderatorsChatList_"+_70f);}}else{if($("#SinglePostContainer").is(":visible")){var _710=$("#SinglePostContainer").attr("forumtopicid");setPresenceInTopicList(_70e,_710);}else{if($("#myAreaParentContainer").is(":visible")){if($("#recentActivityContent").is(":visible")){setPresenceInMyArea(_70e,"current_recentActivity_List");setPresence(_70e,"followingUserDetails");setPresence(_70e,"followersUserDetails");}else{if($("#watchListInnerContent").is(":visible")){setPresenceInMyArea(_70e,"userChat_watchTopics");}else{if($("#privateMsgInnerContent").is(":visible")){setPresenceInMyArea(_70e,"userChat_inbox");}}}}else{if($("#userProfileMainContainer").is(":visible")){var _711=$("#userProfileMainContainer");var _712=_711.attr("authorId");var _713=_711.attr("authorName");if(typeof WmsContacts!="undefined"&&ch==true){var _714=WmsContacts.status(_712);if(_714===false){_714=9;}manageUserChatStatus("userOnlineStatus_"+_713,_714,_713);}}}}}};WmsContactImpl.handleMPReject=function(_715,_716,_717){};WmsContactImpl.handleMPAccept=function(_718,_719,_71a){};WmsContactImpl.handleMPDelete=function(_71b,_71c,_71d){};WmsContactImpl.handleMPAdd=function(_71e,_71f,_720){};WmsContactImpl.handleMPInvite=function(_721,_722,_723){};WmsContactImpl.handleLogin=function(_724,_725,_726,_727){};WmsContactImpl.handleLogout=function(_728,_729,_72a,_72b){};WmsContactImpl.handleGetAccounts=function(_72c){};WmsContactImpl.handleInvitations=function(_72d){};if((((navigator.userAgent).indexOf("Safari")!=-1))){var curdomain=document.domain;if(curdomain.indexOf("zoho.com")!=-1){document.domain="zoho.com";}else{if(curdomain.indexOf("baihui.com")!=-1){document.domain="baihui.com";}else{if(curdomain.indexOf("india.adventnet.com")!=-1){document.domain="india.adventnet.com";}else{var lastIndexOfDot=curdomain.lastIndexOf(".");var lastPrevIndexOfDot=curdomain.lastIndexOf(".",lastIndexOfDot-1);if(lastPrevIndexOfDot!=lastIndexOfDot){curdomain=curdomain.substring(lastPrevIndexOfDot+1,curdomain.length);}document.domain=curdomain;}}}}function bindReportsClicks(_72e){var _72e=$("#reportsLeftPanel");_72e.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"));lightBox("#topicTypeTrendChartsCont");avtivateReportsCalendar();showOverallUsageCharts();}function avtivateReportsCalendar(){if($("#dateFilterCont").length<=0){return;}Calendar.setup({inputField:"fromDate",ifFormat:"%Y-%m-%d",timeFormat:"12",onUpdate:printFromDate});Calendar.setup({inputField:"toDate",ifFormat:"%Y-%m-%d",timeFormat:"12",onUpdate:printToDate});function printFromDate(cal){var date=cal.date;$("#fromDate").val(date.print());}function printToDate(cal){var date=cal.date;$("#toDate").val(date.print());}}function processReportClick(_733){var _734=$(_733.target);var _735=_734.parent();if(_735.is("[topicType=\"-1\"]")||_735.is("[topicType=\"0\"]")||_735.is("[topicType=\"1\"]")||_735.is("[topicType=\"2\"]")||_735.is("[topicType=\"3\"]")||_735.is("[topicType=\"4\"]")){bindReportsAction(_735);}else{if(_734.is("[topicType=\"-1\"]")||_734.is("[topicType=\"0\"]")||_734.is("[topicType=\"1\"]")||_734.is("[topicType=\"2\"]")||_734.is("[topicType=\"3\"]")||_734.is("[topicType=\"4\"]")){bindReportsAction(_734);}}}function bindReportsAction(_736){showLoadingImage();$("#dateFilter").text($("#reportsDateFilterArrow .forumOptions ul").find("li[dateFilter=\"1\"]").text());$("#forumDropDownArrow div").text($("#reportsForumFilter").find("li[forumId=\"-1\"]").text());$("#dateFilterCont").hide();_736.parent("ul").find("li").removeClass("selected");_736.addClass("selected");var _737={};_737.forumGroupId=forumGroupId;_737[csrfParamName]=csrfToken;_737.ch=ch;var _738=_736.attr("purpose");var _739=_736.attr("forumId");var _73a=_736.attr("categoryId");var _73b=_736.attr("dateFilter");var _73c=_736.attr("topicType");if(_739){_737.forumId=_739;}if(_73a){_737.categoryId=_73a;}if(_73b){_737.dateFilter=_73b;}var _73d=_736.find("a").text();if(_73c){_737.topicType=_73c;}else{}var _73e=$("#reportsLeftPanel li.selected").attr("action");if(_73e=="/topicTypeReports.do"){$("#topicTypesFilterCont").show();}else{$("#topicTypesFilterCont").hide();}doAjaxAction(_73e,_737,function(data){$("#reportsInnerContent").get(0).innerHTML=data;if(_73e=="/topicTypeReports.do"){showOverallUsageCharts();}else{}$("#reportsTitle").text(_73d);bindReportsClicks();hideLoadingImage();});}function displayStatisticsArrowClick(_740){var _741=_740.find("div.forumOptions");_741.show();_741.find("li").unbind("click").click(function(){var _742=$(this);var _743={};var _744=_742.attr("dateFilter");if(_744=="2"){$("#dateFilterCont").show();_741.mouseout();$("#dateFilter").text(_742.text());return;}$("#dateFilterCont").hide();var _745=((_742.attr("topFilter")=="true"))?true:false;_743.dateFilter=_744;_743.forumGroupId=forumGroupId;_743.forumId=$("#forumDropDownArrow div").attr("forumId");_743[csrfParamName]=csrfToken;var _746=(_745)?$("#reportsLeftPanel li.selected").attr("action"):_742.attr("action");var _747=$("#reportsLeftPanel li.selected").attr("topicType");if(_747){_743.topicType=_747;}var _748=_742.attr("chartFor");if(_748){_743.chartFor=_748;}showLoadingImage();doAjaxAction(_746,_743,function(data){_741.hide();hideLoadingImage();var _74a;if(_745){_74a=$("#reportsInnerContent");$("#dateFilter").text(_742.text());}else{_74a=_742.parents("#allTypeTrendChartCont,#postRespTrendChartCont,#repUnrepChartCont,#topicStatusPieChartCont,#mostVotedTopicsChartCont,#userParticipationChartCont,#reportsInnerContent");}_74a.get(0).innerHTML=data;bindReportsClicks();showOverallUsageCharts();},function(err,desc,_74d){var _74e=eval(err.responseText);showMessage(_74e.reason,"failure");hideLoadingImage();});});_740.hover(function(){var _74f=_740.data("destroyHandle");_740.data("destroyHandle",false);if(_74f){clearTimeout(_74f);}},function(){var _750=setTimeout(function(){_741.hide();_740.unbind("mouseenter").unbind("mouseleave");},500);_740.data("destroyHandle",_750);});}function bindDateFilterClick(_751){$(_751).unbind("click").click(function(){var _752=$(this);var _753={};var _754=_751.parents().find("input[name=\"startDate\"]").val();var _755=_751.parents().find("input[name=\"endDate\"]").val();if(!_754||""==_754){showMessage(i18n["zohodiscussions.statistics.provideStartDateMsg"],"failure");return;}_753.startDate=_754;if(_755&&!(""==_755)){_753.endDate=_755;}_753.forumGroupId=forumGroupId;_753.dateFilter="2";_753.forumId=$("#forumDropDownArrow div").attr("forumId");_753[csrfParamName]=csrfToken;var _756=$("#reportsLeftPanel li.selected").attr("action");var _757=$("#reportsLeftPanel li.selected").attr("topicType");if(_757){_753.topicType=_757;}showLoadingImage();doAjaxAction(_756,_753,function(data){hideLoadingImage();var _759=$("#reportsInnerContent");_759.get(0).innerHTML=data;bindReportsClicks();showOverallUsageCharts();},function(err,desc,_75c){var _75d=eval(err.responseText);showMessage(_75d.reason,"failure");hideLoadingImage();});});}function processForumArrowClick(_75e){var _75f=$(_75e.target);var _760=$("#reportsForumFilterCont div.moreOptions");_760.show();_760.find("ul").find("li").unbind("click").click(function(){var _761=$(this);var _762={};_760.hide();_762.forumGroupId=forumGroupId;_762[csrfParamName]=csrfToken;var _763=_761.attr("forumId");_762.forumId=_763;_762.dateFilter=$("#dateFilter").attr("dateFilter");var _764=$("#reportsLeftPanel li.selected").attr("topicType");if(_764){_762.topicType=_764;}showLoadingImage();var _765=$("#reportsLeftPanel li.selected").attr("action");doAjaxAction(_765,_762,function(data){hideLoadingImage();var _767=$("#reportsInnerContent");_767.get(0).innerHTML=data;$("#forumDropDownArrow div").text(_761.text()).attr("forumId",_763);bindReportsClicks();showOverallUsageCharts();},function(err,desc,_76a){var _76b=eval(err.responseText);showMessage(_76b.reason,"failure");hideLoadingImage();});});_760.hover(function(){var _76c=_760.data("destroyHandle");if(_76c){clearTimeout(_76c);}},function(){var _76d=setTimeout(function(){_760.hide();_760.unbind("mouseenter").unbind("mouseleave");},500);_760.data("destroyHandle",_76d);});}function showOverallUsageCharts(){isImageLoaded("topicTypeTrendImgCont");var _76e=[0,8,9,10,11,12,13];for(var idx=0;idx<=_76e.length;idx++){isImageLoaded("postRespTrendImgCont_"+_76e[idx]);}isImageLoaded("statusPieChartImgCont");isImageLoaded("statusMeterPlotImgCont");isImageLoaded("repUnrepPieChartImgCont");isImageLoaded("repUnrepMeterImgCont");}function isImageLoaded(_770){var _771=$("#"+_770);if(_771.length>0){var _772=_771.find("img").length;var _773=0;_771.find("img").load(function(){_773++;if(_773==_772){_771.fadeIn(500);_771.siblings("div[purpose=\"chartLoading\"]").hide();}});}}function triggerTopicType(_774){$("#reportsLeftPanel").find("li[topicType=\""+_774+"\"]").trigger("click");}