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 openEditor(_84,_85,_86,_87,_88,_89){var _8a=_84.show();var _8b=_8a.next();var $ta=$("<textArea name = \""+_85+"\" id = \""+_86+"\" style = \"width:100%;max-height:400px;min-height:200px;height:"+_8a.innerHeight()+"px\"></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;if(_87){_90=$("<form id = \"editorHolder\"></form>");$replyLinkLocation=$("#"+_87);if(_85=="privateMsgContent"){var _91=$replyLinkLocation.attr("toMember");if(_87=="UserPM"||_88=="Edit"){var _92=$replyLinkLocation.attr("postTitle");if(_88=="Edit"){_90.append("<input value=\""+_92+"\" name = \"forumPostTitle\" class=\"replyTextBox\" type=\"text\" style=\"width:98%;height:18px;padding:3px;margin:0px 0px 6px 0px;\"/>");}else{_90.append("<input value=\"\" name = \"forumPostTitle\" class=\"replyTextBox\" type=\"text\" style=\"width:98%;height:18px;padding:3px;margin:0px 0px 6px 0px;\"/>");}}if(_87!="UserPM"){var _93=$replyLinkLocation.attr("forumTopicId");_90.append("<input type = \"hidden\" name = \"forumTopicId\" value = \""+_93+"\">");}_90.append("<input type = \"hidden\" name = \"toMember\" value = \""+_91+"\">").append("<input type = \"hidden\" name = \"forumGroupId\" value = \""+forumGroupId+"\">").append("<input type = \"hidden\" name = \""+csrfParamName+"\" value = \""+csrfToken+"\">");}else{var _93=$replyLinkLocation.attr("forumTopicId");_93=_93||$replyLinkLocation.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _94=$replyLinkLocation.attr("responseId");var _95=$replyLinkLocation.attr("isPrivate");var _96=$replyLinkLocation.attr("isThread");var _97=$replyLinkLocation.attr("forumId");var _98=$replyLinkLocation.attr("categoryId");var _92=$replyLinkLocation.attr("postTitle");var _99=$replyLinkLocation.attr("responseAuthorId");_90.append("<input value=\""+_92+"\" 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 = \""+_93+"\">").append("<input type = \"hidden\" name = \"responseId\" value = \""+_94+"\">").append("<input type = \"hidden\" name = \"forumGroupId\" value = \""+forumGroupId+"\">").append("<input type = \"hidden\" name = \"isPrivate\" value = \""+_95+"\">").append("<input type = \"hidden\" name = \"isThread\" value = \""+_96+"\">").append("<input type = \"hidden\" name = \"forumId\" value = \""+_97+"\">").append("<input type = \"hidden\" name = \"categoryId\" value = \""+_98+"\">").append("<input type = \"hidden\" name = \""+csrfParamName+"\" value = \""+csrfToken+"\">").append("<input type = \"hidden\" name = \"detectSpamPresence\" value = \""+1+"\">");if((_88&&_88=="Edit")&&_99==ZUID){_90.append("<input type = \"hidden\" name = \"responseowner\" value = \"true\">");}}}else{_90=$("<div id = \"editorHolder\"></div>");}_90.append($ta);_90.insertAfter(_8a.hide()).show();if(_88){$replyLinkLocation=$("#"+_87);var _93=$replyLinkLocation.attr("forumTopicId");var _94=$replyLinkLocation.attr("responseId");var _9a=(_88=="Write")?i18n["zohodiscussions.general.publish"]:i18n["zohodiscussions.general.update"];var _9b=$("<button id=\"publishResponse\" class=\"ashBtn normalText boldText\">"+_9a+"</button>");_9b.click(function(){if(_85=="privateMsgContent"){var _9c="";if(_87=="UserPM"){_9c="UserPM";}addPrivateMsg(_93,_88,_94,_9c);}else{addForumResponse(_93,_88,_94);}});var _9d=$("<button id='cancelResponse' class='ashBtn normalText boldText'>"+i18n["zohodiscussions.general.cancel"]+"</button>");_9d.click(function(){$("#postContentTA").editor("cancel");_8a.show();$("#"+_89).data("inEditMode",false);var _9e="";if($("#newThreadResponseCont_"+_94).is(":visible")){_9e="#newThreadResponseCont_"+_94;}else{if($("#newResponseCont_"+_93).is(":visible")){_9e="#newResponseCont_"+_93;}else{if($("#eachTopicReplyCont_"+_93).is(":visible")){_9e="#eachTopicReplyCont_"+_93;}}}if(_9e!=""){$(""+_9e+"").hide();}if(_89=="privateMsgInboxContainer"){$("#privateMsgCont_"+_93).hide();}else{if(_89=="privateMsgSentContainer"){$("#privateMsgCont_"+_93).hide();if($("#topicContent_"+_93).parent().find("div.bigMinusIcon").length>0){$("#topicContent_"+_93).show();}}else{if(_89=="editorContainer_PM"){processHash("user/"+$("#UserPM").attr("authorName"));}else{if(_89=="eachTopic_"+_94){var _9f=$("#paginationContainer");_9f.data("inEditMode",false);$("#singlePostActions_"+_94).show();$("#linkedTopic_"+_94).show();$("#recent_ResPonse_"+_94).find("div.navigationCont").show();}else{if(_89=="topicContainer_"+_93){$("#postTypeActions_"+_94).show();$("#linkTopicCont_"+_93).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_"+_94).is(":visible"))==true){$("#fullResponseContainer_"+_94).find("div.postTypeActions").show();var _a0=$("#responsePreviewButton");var _a1=$("#fullResponseContainer_"+_94);var _a2=$("#responseContentContainer_"+_94);CancelPreview(_a0,_a1,_a2);}if(($("#recentResponseContent_"+_94).is(":visible"))==true){$("#postTextContent_"+_94).find("ul.singlePostActions").show();$("#resposeVoteLink_"+_94).show();$("#chooseBestResponse_"+_94).show();var _a0=$("#responsePreviewButtonInTopicList");var _a1=$("#postTextContent_"+_94);var _a3=$("#recentResponseContent_"+_94);CancelPreview(_a0,_a1,_a3);}});var _a4=$("<button id=\"previewResponse\" class=\"ashBtn normalText boldText\">"+i18n["zohodiscussions.writePost.preview"]+"</button>");_a4.click(function(){var _a5=$(this);var _a6=_a5.attr("location");var _a7=$("#editorHolder").find("input[name=forumPostTitle]").val();var _a8=_a7.replace(/^<+|<+$/g,"&lt;").replace(/<+/g,"&lt;").replace(/^>+|>+$/g,"&gt;").replace(/>+/g,"&gt;");var _a9=_a5.attr("forumTopicId");var _aa=_a5.attr("responseId");var _ab=$("#postContentTA").data("editor").val();_ab=_ab.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_a6=="editResponse"||_a6=="editTopic"){var _aa=_a5.attr("responseId");if($("#responsePreviewButton").length==0){$responsePreviewButton=$("#previewButtonTemplate").clone();$responsePreviewButton.attr("id","responsePreviewButton");}else{$responsePreviewButton=$("#responsePreviewButton");}if(_a6=="editTopic"){$("#fullResponseContainer_"+_aa).find("div.postTypeActions").hide();$responsePreviewButton.insertAfter($("#fullResponseContainer_"+_aa).find("div.postTypeActions")).show();}var _ac=$("#fullResponseContainer_"+_aa);_ac.find("h3.header").html(_a8);editAndPreviewPost($responsePreviewButton,$("#postTypeActions_"+_aa),_ac,_a6);_ad=$("#fullResponseContainer_"+_aa).find("div.attachmentListCont").hide();var _ae=$("#fullResponseContainer_"+_aa).find("div[purpose =\"attachmentListContForPreview\"]");var _af=$("#responseContentContainer_"+_aa);attachmentPreview(_af,_ad,_ac,_a5);if(($("#cancelResponse").attr("disabled"))==true){$("#responsePreviewButton").find("button[purpose=\"cancelPreviewResponse\"]").attr("disabled",true);}_ae.show();previewContentContainer($("#responseContentContainer_"+_aa),_ab);previewActions($("#fullResponseContainer_"+_aa),_a9,_aa,_9d,_9b);}else{if(_a6=="topicListEditResponse"){if($("#responsePreviewButtonInTopicList").length==0){$responsePreviewButton=$("#previewButtonTemplate").clone();$responsePreviewButton.attr("id","responsePreviewButtonInTopicList");}else{$responsePreviewButton=$("#responsePreviewButtonInTopicList");}var _ac=$("#postTextContent_"+_aa);var _af=$("#recentResponseContent_"+_aa);var _ad=$("#postTextContent_"+_aa).find("div.attachmentListCont").hide();var _ae=$("#postTextContent_"+_aa).find("div[purpose =\"attachmentListContForPreview\"]");_ae.show();if(($("#cancelResponse").attr("disabled"))==true){$("#responsePreviewButtonInTopicList").find("button[purpose=\"cancelPreviewResponse\"]").attr("disabled",true);}attachmentPreview(_af,_ad,_ac,_a5);previewContentContainer($("#recentResponseContent_"+_aa),_ab);editAndPreviewPost($responsePreviewButton,$("#postTextContent_"+_aa),_ac,_a6);previewActions($("#responsePreviewButtonInTopicList"),_a9,_aa,_9d,_9b);}else{if($("#responsePreviewContainer").length==0){$responsePreviewContainer=$("#responsePreviewContainerTemplate").clone();$responsePreviewContainer.attr("id","responsePreviewContainer");}else{$responsePreviewContainer=$("#responsePreviewContainer");}if(_87=="newThreadReply_"+_aa){if($("#fullThreadResponseContainer").length==0){var _b0=$("<div id=\"fullThreadResponseContainer\" purpose = \"threadResponseContainer\" class=\"threadContainer\"><div class=\"threadArrow\" purpose=\"threadArrow\"></div><div purpose =\"singleThreadPreview\"></div></div>");}else{var _b0=$("#topicContainer_"+_a9).find("div[purpose=\"threadResponseContainer\"]");}}$responsePreviewContainer.find("[purpose=\"previewResponseAttachment\"]").attr("id","attachmentForResponsePreview");if(_87=="newThreadReply_"+_aa){_b0.find("div[purpose=\"singleThreadPreview\"]").append($responsePreviewContainer);_b0.insertAfter("#newThreadResponseCont_"+_aa);$responsePreviewContainer.find("button[purpose=\"backToEditorResponse\"]").attr("location","threadResponse");$("#replyToTopicBtn_"+_a9).attr("location","threadResponse");}else{$responsePreviewContainer.insertAfter("#newResponseCont_"+_a9);$responsePreviewContainer.find("button[purpose=\"backToEditorResponse\"]").attr("location","topicResponse");$("#replyToTopicBtn_"+_a9).attr("location","topicResponse");}$responsePreviewContainer.find("h3[purpose=\"topicTitleOfResponse\"]").html(_a8);$responsePreviewContainer.find("div[purpose=\"responseContPreviewContainer\"]").html(_ab);if(_87=="newThreadReply_"+_aa){$("#newThreadResponseCont_"+_aa).hide();_b0.show();_b0.find("div.singleReplyContainer").show();}else{$responsePreviewContainer.show();$("#newResponseCont_"+_a9).hide();}var _b1=_a5.find("input[name=\"attachmentId\"]");$.each(_b1,function(_b2,_b3){var _b4=$(_b3).attr("attachmentDetails").split(",");var _b5=$("<li class=\"singleList\" id=\"eachAttachmentForPreview_"+_b4[0]+"\" ><div class=\"flLeft iconCont\"><div class=\"attachIcon imgAttachmentTh\"></div></div>  <ul class=\"ulNoStyle detailsListNew\"> <li class=\"header\"> <a>"+_b4[1]+"</a> </li> <li class=\"forumDetailsList\"> <span>Size:"+_b4[2]+"</span></li></ul></li>");$("#attachmentForResponsePreview").append(_b5);});if($("#attachmentForResponsePreview > li").length>0){$responsePreviewContainer.find("[purpose=\"attachmentResponsePreviewCont\"]").show();}else{$responsePreviewContainer.find("[purpose=\"attachmentResponsePreviewCont\"]").hide();}previewActions($responsePreviewContainer,_a9,_aa,_9d,_9b);}}});var _b6=$("#responseAttachmentContTemplate").clone();_b6.attr("id","responseAttachmentContActual");var _b7=_b6.find("div.whiteAttachmentBox").show();_b6.find("div[attachmentPurpose=\"browseBox\"]").attr("id","attachBrowseCont");var _b8=_b7.find("ul[purpose=\"responseAtatchmentsListCont\"]").attr("id","attachmentsListCont");if(_88=="Edit"){if(_8b.is(".Attachments")){var _b9=_8b.find("div[purpose=\"attachmenUtilCont\"]");var _ba=_b9.attr("attachmentIds");var _bb=_b9.attr("attachmentNames");var _bc=_b9.attr("attachmentSizes");var _bd=_ba.split(",");var _be=_bb.split(",");var _bf=_bc.split(",");for(index=0;index<_bd.length;index++){var _c0=_bd[index];var _c1=_be[index];var _c2=_bf[index];var _c3=_c0+","+_c1+","+_c2;$currentAttachment=$("#responseEachAttachmentTemplate").clone();$currentAttachment.attr("id","newAttachment_"+_c0).attr("attachmentDetails",_c3).show();$currentAttachment.find("[attachmentPurpose=\"attachmentName\"]").html(_c1);$currentAttachment.find("[attachmentPurpose=\"attachmentSize\"]").html(_c2);$currentAttachment.find("div.imgAshDelete").attr("thisAttachmentId",_c0).attr("thisAttachmentName",_c1);$currentAttachment.find("div.imgAshDelete").click(function(_c4){if(confirm(i18n["zohodiscussions.generalmessage.deleteAttachmentConfirmMsg"])){showSmallLoadingImage(_c4);$this=$(this);var _c5=$this.attr("thisAttachmentId");var _c6={};_c6.forumGroupId=forumGroupId;_c6.forumTopicId=_93;_c6.fileName=$this.attr("thisAttachmentName");_c6.fileId=_c5;_c6[csrfParamName]=csrfToken;doAjaxAction("/deleteAttachment.do",_c6,function(_c7){hideLoadingImage();if(_c7=="SUCCESS"){$("#newAttachment_"+_c5).remove();$("#eachAttachmentForPreview_"+_c5).remove();$("#fullResponseContainer_"+_94).find("li[attachmentId=\""+_c5+"\" ]").remove();showTipper(i18n["zohodiscussions.generalmessage.deleteAttachmentSuccessMsg"],"info");loadUploadAttachmentsCont();_9d.attr("disabled",true);_9d.unbind("click");}});}});_b8.append($currentAttachment);}_8b.hide();}$("#postTypeActions_"+_94).hide();}var _c8="padding:3px;";if(_85=="privateMsgContent"){_c8=_c8+""+((_88=="Write")?"width:97%":"width:99%");}else{_c8=_c8+""+((_88=="Write")?"width:93.2%":"width:99%");}$("#editorHolder").wrap("<div class=\"flLeft\" style=\""+_c8+"\" purpose=\"editorMainParentCont\"></div>");if(_85!="privateMsgContent"){if(maxAttachmentsPerPost>0){$("#editorHolder").append(_b6.css("margin-top",25).show());var _c9=$("<div class=\"flRight btnContainer\" purpose=\"editorActionUtilCont\" style=\"margin-right:10px;\"></div>");}else{var _c9=$("<div class=\"flRight btnContainer\" purpose=\"editorActionUtilCont\" style=\"margin-top:25px;margin-right:10px;\"></div>");}_c9.append(_9b);if(_89!="paginationContainer"){_c9.append(_a4);}_c9.append(_9d).insertAfter($("#editorHolder").parent());}else{var _ca=$("#replyPMContTemplate").clone();_ca.attr("id","replyPMContActual");$("#editorHolder").append(_ca.css("margin-top",25).hide());$("<div class=\"flRight btnContainer\" style=\"margin-top:30px;margin-right:30px;\"  purpose=\"editorActionUtilCont\"></div>").append(_9b).append(_9d).insertAfter($("#editorHolder").parent());}loadUploadAttachmentsCont();if(_88=="Write"){var _cb=$("#editorAuthProfileTemp").clone().show();_cb.attr("id","");_cb.insertBefore($("#editorHolder").parent());}}_8a.data(_86,$ta);var _cc=function(_cd){var _ce=$("#linkDialog");_ce.show().find(":button[action=\"cancel\"], span.imgCloseDialog").click(function(){_ce.hide();}).end().find(":button[action=\"insertLink\"]").unbind().click(function(){var _cf=_ce.find(":input[name=\"displayText\"]").val();var _d0="";if($("#linkDiv").is(":visible")){var _d1=sanitizeURL($.trim(""+_ce.find(":input[name=\"url\"]").val()));if(_d1==""){_d1=sanitizeURL($.trim(""+_ce.find(":text:last").val()));}if(_d1==""){alert(i18n["zohodiscussions.createforumgroup.LinkInvalid"]);_ce.find(":input[name=\"url\"]").focus().select();return;}var _d2=_ce.find(":input[name=\"title\"]").val();var _d3=_ce.find(":input[name=\"target\"]").val();var rel=_ce.find(":input[name=\"rel\"]").val();if(_d3!=""){optionAttrs=" target = '"+_d3+"' ";}if(rel!=""){optionAttrs+=" rel = '"+rel+"' ";}if(_d2!=""){optionAttrs+=" title = '"+_d2+"' ";}if(_cf==""){_cf=_ce.find(":input[name=\"url\"]").val();}}else{var _d5=/^[a-zA-Z0-9]([\w\-\.\+]*)@([\w\-\.]*)(\.[a-zA-Z]{2,4}(\.[a-zA-Z]{2}){0,2})$/i;_d1=$.trim(""+_ce.find(":input[name=\"email\"]").val());if(_d1==""||_d1.match(_d5)==null){alert(i18n["zohodiscussions.writePost.inValidEmailMessage"]);_ce.find("[name=\"email\"]").focus().select();return;}_d1="mailto:"+_d1;if(_cf==""){_cf=_ce.find(":input[name=\"email\"]").val();}optionAttrs="";}if(_ce.data("alreadyLinked")=="true"){$(_cd).remove();}$ta.data("editor").addLink(_d1,_cf,optionAttrs);_ce.hide();}).end().find("div[purpose=\"urlSection\"]").unbind("click").click(function(){toggleSections($(this).parents("div.editorPopup2"),"urlSection");}).end().find("div[purpose=\"emailSection\"]").unbind("click").click(function(){toggleSections($(this).parents("div.editorPopup2"),"emailSection");}).end().attr("tabIndex",-1).unbind("keydown").keydown(function(e){switch(e.keyCode){case 27:_ce.find(":button[action=\"cancel\"]").trigger("click");break;case 13:_ce.find(":button[action=\"insertLink\"]").trigger("click");break;}}).show().find("[purpose=\"urlSection\"]").trigger("click");if(_cd){if(_cd.tagName&&_cd.tagName.toLowerCase()=="a"){var _d7=$(_cd);var _d8=_d7.attr("href");if(_d8.substr(0,7)=="mailto:"){_ce.find(":input[name=\"email\"]").val(_d8.substr(7)).end().find("[purpose='emailSection']").click();}else{_ce.find(":input[name=\"url\"]").val(_d8).end().find("[purpose='urlSection']").click();}_ce.find(":input[name=\"displayText\"]").val(_d7.html()).end().find(":input[name=\"title\"]").val(_d7.attr("title")).end().find(":input[name=\"rel\"]").val(_d7.attr("rel"));if(_d7.attr("target")=="_blank"){_ce.find(":input[name=\"linktarget\"]").val(["new"]);}_ce.data("alreadyLinked","true");}else{_ce.find(":input[name=\"displayText\"]").val(_cd);if(_ce.find(":input[name=\"displayText\"]").val()=="[object]"){_ce.find(":input[name=\"displayText\"]").val("");}}}};var _d9=function(_da){var _db=$("#imageDialog");_db.find("input[type='text']").val("").end().find("[name='imgSize']").val(["FullSize"]).end().find("[name='imgAlignment']").val(["none"]).end().find("[name='imageFileName']").val("").end().find("#image_error").html("").end().find("#imagePreview").attr("src","/images/img-preview.gif").end().show().find(":button[action=\"cancel\"], span.imgCloseDialog").click(function(){_db.find("input[type = \"text\"]").val("");_db.find("input[type = \"file\"]").val("");_db.find("input[name=\"responseId\"]").val("");_db.find("input[name=\"responseId\"]").val("");_db.find("input[name=\"uploadedImageUrl\"]").val("");_db.find("input[name=\"linkTo\"").val("");_db.hide();}).end().find(":button[action=\"insertImage\"]").attr("disabled","disabled").unbind().click(function(){if($("#urldiv").is(":visible")){var _dc=_db.find(":input[name=\"url\"]").val();if(_dc&&$.trim(_dc)!=""){var _dd=/^(https?:\/\/)?((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|((\d{1,3}\.){3}\d{1,3}))(\:\d+)?(\/[-a-zA-Z\d%_.~+]*)*(\?[;&a-zA-Z\d%_.~+=-]*)?(\#[-a-zA-Z\d_]*)?$/;if(_dc.match(_dd)!=null){imageAdded(_dc,_86);}else{alert(i18n["zohodiscussions.createforumgroup.LinkInvalid"]);}}else{alert(i18n["zohodiscussions.createforumgroup.LinkInvalid"]);}}else{imageAdded(_db.find(":input[name=\"uploadedImageUrl\"]").val(),_86);return;}}).end().find(":button[action=\"linkToNone\"]").unbind().click(function(){_db.find(":input[name=\"linkTo\"]").val("");}).end().find(":button[action=\"linktoImageUrl\"]").unbind().click(function(){fillImageUrl();}).end().find("#url").unbind().blur(function(){fillImageUrl();}).end().find(":radio[name=\"imgSize\"]").unbind().change(function(){switch(_db.find(":input[name=\"imgSize\"]").filter(":checked").val()){case "Small":_db.find(":input[name=\"width\"]").val("100").attr("readonly","true");_db.find(":input[name=\"height\"]").val("100").attr("readonly","true");break;case "Medium":_db.find(":input[name=\"width\"]").val("250").attr("readonly","true");_db.find(":input[name=\"height\"]").val("250").attr("readonly","true");break;case "FullSize":_db.find(":input[name=\"width\"]").val("").attr("readonly","true");_db.find(":input[name=\"height\"]").val("").attr("readonly","true");break;case "Custom":_db.find(":input[name=\"width\"]").removeAttr("readonly");_db.find(":input[name=\"height\"]").removeAttr("readonly");break;}}).end().find("[name=\"imageFileName\"]").unbind().change(function(){return uploadImage();}).end().find(":text:first").focus();if(_da){$("#urlSection").click();var _de="";var _df="";if(_da.tagName.toLowerCase()=="img"){_df=_da;}else{while(_da.childNodes&&_da.childNodes[0].tagName.toLowerCase()!="img"){if(_da.childNodes[0].tagName.toLowerCase()=="a"){_de=$(_da.childNodes[0]).attr("href");}_da=_da.childNodes[0];}_df=_da.childNodes[0];}$("#url").val($(_df).attr("src")).blur();}};var _e0=function(){var _e1=$("#objectDialog");_e1.show().find(":button[action=\"cancel\"], span.imgCloseDialog").click(function(){_e1.hide().find("textarea").val("");}).end().find(":button[action=\"insertObject\"]").unbind("click").click(function(){var _e2=sanitize($.trim(""+_e1.find(":input:first").val()));if(_e2==""){alert("Please enter a valid Object");return;}$ta.data("editor").insertObject(_e2);_e1.hide().find("textarea").val("");}).end().find(":text:first").focus();$("#boxcontent_content").find(":textarea").focus();};$ta.editor({linkPrompter:_cc,imagePrompter:_d9,objectPrompter:_e0});}function toggleSections(_e3,_e4){_e3.find("div[purpose]").hide().end().find("div[purpose=\""+_e4+"\"]").show().end().find("li[purpose]").removeClass("selectedMenu").end().find("li[purpose=\""+_e4+"\"]").addClass("selectedMenu");}function uploadError(_e5){var _e6=$("#imageDialog");_e6.find("#image_error").hide().html(_e5).css("background","#FFF1A8").fadeIn();}function previewActions(_e7,_e8,_e9,_ea,_eb){_e7.find("button[purpose=\"backToEditorResponse\"]").unbind("click").click(function(){var _ec=$(this);var _ed=_ec.attr("location");if(_ed=="topicResponse"){_e7.hide();$("#newResponseCont_"+_e8).show();}else{if(_ed=="editEachResponse"){$("#resposeVoteLink_"+_e9).show();$("#chooseBestResponse_"+_e9).show();backtoEditorWhilePreviewing($("#fullResponseContainer_"+_e9),$("#responseContentContainer_"+_e9),$("#responsePreviewButton"));}else{if(_ed=="topicListEditResponse"){backtoEditorWhilePreviewing($("#postTextContent_"+_e9),$("#recentResponseContent_"+_e9),$("#responsePreviewButtonInTopicList"));}else{$("#newThreadResponseCont_"+_e9).show();$("#fullThreadResponseContainer").hide();}}}$("#attachmentForResponsePreview").html(" ");});_e7.find("button[purpose=\"publishPreviewResponse\"]").unbind("click").click(function(){_eb.trigger("click");});_e7.find("button[purpose=\"cancelPreviewResponse\"]").unbind("click").click(function(){_ea.trigger("click");});}function editAndPreviewPost(_ee,_ef,_f0,_f1){var _f1=(_f1=="editResponse"||_f1=="editTopic")?"editEachResponse":"topicListEditResponse";_ee.insertAfter(_ef).show();_f0.find("div[purpose=\"editorMainParentCont\"]").hide();_f0.find("div[purpose=\"editorActionUtilCont\"]").hide();_ee.find("button[purpose=\"publishPreviewResponse\"]").html(i18n["zohodiscussions.general.update"]);_ee.find("button[purpose=\"backToEditorResponse\"]").attr("location",_f1);_ee.find("button[purpose=\"publishPreviewResponse\"]").attr("location",_f1);_ee.find("button[purpose=\"cancelPreviewResponse\"]").attr("location",_f1);}function CancelPreview(_f2,_f3,_f4){_f2.remove();_f3.find("div.Attachments").show();_f3.find("div.attachmentListCont").show();_f3.find("div[purpose =\"attachmentListContForPreview\"]").hide();_f4.show();$("#previewContentContainer").remove();$("#newAttachmentForPreview").remove();}function previewContentContainer(_f5,_f6){_f5.hide();if($("#previewContentContainer").length==0){var _f7=$("<div id=\"previewContentContainer\" class=\"postContent\"> </div>");}else{_f7=$("#previewContentContainer");}_f7.insertAfter(_f5);_f7.html(_f6).show();}function backtoEditorWhilePreviewing(_f8,_f9,_fa){_f8.find("div[purpose=\"editorMainParentCont\"]").show();_f8.find("div[purpose=\"editorActionUtilCont\"]").show();_f9.hide();_f8.find("div.Attachments").hide();$("#previewContentContainer").hide();var _fb=_f8.find("div[purpose =\"attachmentListContForPreview\"] > ul");_fb.html(" ");var _fc=$("#newAttachmentForPreview").find("ul[purpose=\"previewResponseAttachment\"]");_fc.html(" ");_fa.hide();}function attachmentListPreview(_fd,_fe){$.each(_fe,function(_ff,item){var _101=$(item).attr("attachmentDetails").split(",");var _102=$("<li class=\"singleList\" id=\"eachAttachmentForPreview_"+_101[0]+"\" ><div class=\"flLeft iconCont\"><div class=\"attachIcon imgAttachmentTh\"></div></div>  <ul class=\"ulNoStyle detailsListNew\"> <li class=\"header\"> <a>"+_101[1]+"</a> </li> <li class=\"forumDetailsList\"> <span>Size:"+_101[2]+"</span></li></ul></li>");_fd.append(_102).show();});}function attachmentPreview(_103,_104,_105,_106){var _107=_105.find("div[purpose =\"attachmentListContForPreview\"]");if(_107.length==0&&$("#newAttachmentForPreview").length==0){var _108=$("<div class=\"attachmentListCont\" purpose =\"attachmentListContForPreview\"> <ul class=\"ulNoStyle\"> </ul></div>");_108.insertAfter(_104);}if($("#newAttachmentForPreview").length==0){if(($("#attachmentsListCont").find("li[purpose=\"attachmentDetails\"]")).length>0&&_104.length==0){$newAttachmentForPreview=$("#responsePreviewContainerTemplate").find("div[purpose =\"attachmentResponsePreviewCont\"]").clone();$newAttachmentForPreview.attr("id","newAttachmentForPreview");$newAttachmentForPreview.insertAfter(_103);$newAttachmentForPreview.find("div.attachmentListCont").show();}}if($("#newAttachmentForPreview").length>0){$("#newAttachmentForPreview").show();var _109=_106.find("input[name=\"attachmentId\"]");var _10a=$("#newAttachmentForPreview").find("ul[purpose=\"previewResponseAttachment\"]");attachmentListPreview(_10a,_109);$newAttachmentForPreview.find("div.attachmentListCont").show();}else{var _109=$("#attachmentsListCont").find("li[purpose=\"attachmentDetails\"]");var _10a=_105.find("div[purpose =\"attachmentListContForPreview\"] > ul");attachmentListPreview(_10a,_109);}if(_105.find("div[purpose =\"attachmentListContForPreview\"] > ul > li").length>0||$("#newAttachmentForPreview").find("ul[purpose =\"previewResponseAttachment\"] > li").length>0){_105.find("div.Attachments").show();}else{_105.find("div.Attachments").hide();}}function imageUploaded(_10b,_10c,_10d,_10e){$("#imagePreview").attr({src:_10b,width:"100",height:"100"});var _10f=$("#imageDialog");_10f.find("#image_error").html("");_10f.find(":input[name=\"linkTo\"]").val(_10e);_10f.find(":button[action=\"insertImage\"]").attr("disabled","").end().find(":input[name=\"uploadedImageUrl\"]").val(_10b);}function imageAdded(_110,_111){var _112=$("#imageDialog");var _113={};_113.title=_112.find("[name=\"title\"]").val();_113.altText=_112.find("[name=\"altText\"]").val();_113.linkTo=_112.find("[name=\"linkTo\"]").val();_113.imgSize=_112.find("[name=\"imgSize\"]").filter(":checked").val();$("#"+_111).data("editor").addImage(_110,_113);$("#imageDialog").hide();}function toggleSections(_114,_115){_114.find("div[purpose]").hide().end().find("div[purpose=\""+_115+"\"]").show().end().find("span[purpose]").removeClass("select").addClass("default").end().find("span[purpose=\""+_115+"\"]").removeClass("default").addClass("select");}function fillImageUrl(){var _116=$("#imageDialog");if(_116.find("#urldiv").is(":visible")){var _117=_116.find(":input[name=\"url\"]").val();if(_117&&$.trim(_117)!=""){if($.trim(_117)!=""&&isValidUrl(_117)){_116.find(":input[name=\"linkTo\"]").val(_117).end().find("#imagePreview").attr({src:_117,width:"100",height:"100"}).end().find(":button[action=\"insertImage\"]").attr("disabled","");}else{alert(i18n["zohodiscussions.createforumgroup.LinkInvalid"]);_116.find(":input[name=\"url\"]").focus();}}}else{var _117=_116.find(":input[name=\"uploadedImageUrl\"]").val();_116.find(":input[name=\"linkTo\"]").val(_117);}}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 _119=$("#imageDialog");if($.trim(_119.find("[name='imageFileName']").val())!=""){var _11a=_119.find("form");_119.find("#image_error").html("<em>Uploading .. <img src = '/images/progressbarsmall.gif' /></em>").end().find(":button[action=\"insertImage\"]").attr("disabled","true");_11a.find(":hidden[name=\"responseId\"]").val($("#editorHolder :hidden[name=\"responseId\"]").val());_11a.attr("action","/uploadImage.do");_11a.attr("enctype","multipart/form-data").attr("encoding","multipart/form-data");_11a.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 _11c=$("#urldiv");_11c.show();_11c.find(":inpur[name=\"url\"]").focus();}}function initTabContClick(){$("#homeTab,#allforumsTab,#myareaTab,#moderationTab,#SettingsTab,#NewTopicTab,#Search,#reportsTab").click(function(){var _11d=$(this);var _11e=_11d.attr("hashPurpose");processHash(_11e);return false;});$("#searchComboDownArrow").parent().click(function(){displaySearchOption();});}function processHash(hash){if(isTopicQuickView=="false"){if(hash.toLowerCase()=="home"){hash="recent";}else{if(hash.toLowerCase()=="search"){var _120=$("#searchInputBox").val();_120=$.trim(_120);if(_120==""){showMessage(i18n["zohodiscussions.searchList.noSearchString"],"failure");return;}location.href=serverURL+"/"+hash.toLowerCase()+"/"+_120;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"]();return false;}var _121=hash.split("/");var _122=_121[0];var _123=_122.toLowerCase();selectTab(_123);switch(_123){case "home":case "chome":var _124=1;if(parseInt(_121[1])>1){_124=_121[1];}discussionsFunctions[_123](_122,_124);break;case "alltags":discussionsFunctions[_123](_122);break;case "allforums":discussionsFunctions[_123](_122);break;case "reports":discussionsFunctions[_123](_122);break;case "search":var _120=_121[1];discussionsFunctions[_123](_122,_120);break;case "myarea":var _125=_121[1];var _126="";if(_125){_125=_125.toLowerCase();}if(_125=="watchlist"){_126=_121[2];if(_126){_126=_126.toLowerCase();}}discussionsFunctions[_123](_122,_125,_126);break;case "moderation":case "settings":discussionsFunctions[_123](_122);break;case "topic":var _127=_121[1];var _128=_121[2];discussionsFunctions[_123](_122,_127,_128);break;case "forum":var _129=_121[1];var _124=1;if(_121[2]){var _12a="";var _12b=parseInt(2);if(_121[_12b]!="filter"&&_121[_12b].toLowerCase()!="all"){var temp=parseInt(_121[_12b]);if(temp>0){_124=temp;_12b=_12b+1;}else{_12a=_121[_12b];_12b=_12b+1;}}if(_121[_12b]){if(_121[_12b]=="filter"){_12b=_12b+1;var _12d=_121[_12b];var _12e="";_12d=_12d.toLowerCase();if(_12d!="discussions"&&_12d!="questions"&&_12d!="ideas"&&_12d!="problems"&&_12d!="announcement"&&_12d!="sticky"&&_12d!="unrepliedposts"&&_12d!="postssincelastvisit"){_12d="all";if(isOneTopicType!="true"){_12b=_12b+1;}}else{_12b=_12b+1;if(_121[_12b]){_12e=_121[_12b];}}if(isOneTopicType=="true"&&_12d=="all"){_12e=_121[_12b];}if(_121[_12b]){if(parseInt(_121[_12b])>0){_124=_121[_12b];}}getMoreTopics(_129,_12a,_124,_12d,"",_12e,"reload");}else{if(_121[_12b]){if(parseInt(_121[_12b])>0){_124=_121[_12b];}}discussionsFunctions[_123](_122,_129,_12a,_124);}}else{discussionsFunctions[_123](_122,_129,_12a,_124);}}else{discussionsFunctions[_123](_122,_129,"",_124);}break;case "filter":var _12d=_121[1];_12d=_12d.toLowerCase();var _12e="";var _124=1;if(_12d!="discussions"&&_12d!="questions"&&_12d!="ideas"&&_12d!="problems"&&_12d!="announcement"&&_12d!="sticky"&&_12d!="unrepliedposts"&&_12d!="postssincelastvisit"){_12d="all";if(parseInt(_121[2])>0){_124=_121[2];}}else{if(_121[3]){_12e=_121[2];if(parseInt(_121[3])>0){_124=_121[3];}}else{if(parseInt(_121[2])>0){_124=_121[2];}else{_12e=_121[2];}}}if(isOneTopicType=="true"&&_12d=="all"){_12e=_121[1];}getMoreTopics("","",_124,_12d,"",_12e,"reload");break;case "user":var _12f=_121[1];discussionsFunctions[_123](_122,_12f);break;case "tag":var _130=_121[1];discussionsFunctions[_123](_122,_130);break;case "newtopic":var _131=_121[1];var _132=_121[2];discussionsFunctions[_123](_122,_131,_132);break;case "newdiscussion":var _131=_121[1];var _132=_121[2];discussionsFunctions["newtopic"](_122,_131,_132);break;case "newquestion":var _131=_121[1];var _132=_121[2];discussionsFunctions["newtopic"](_122,_131,_132);break;case "newidea":var _131=_121[1];var _132=_121[2];discussionsFunctions["newtopic"](_122,_131,_132);break;case "newproblem":var _131=_121[1];var _132=_121[2];discussionsFunctions["newtopic"](_122,_131,_132);break;case "tpw":var _131=_121[1];var _132=_121[2];var _133=_121[3];var _134=_121[4];var ph=_121[5];var tps=_121[6];var _137=_121[7];var aj=_121[8];var stat=_121[9];var qstr=_121[10];var tgt=_121[11];discussionsFunctions["tphome"](_122,_131,_132,_133,_134,ph,tps,_137,aj,stat,qstr,tgt);break;default:hideLoadingImage();}return false;}var discussionsFunctions={};discussionsFunctions["tphome"]=function(_13c,_13d,_13e,_13f,_140,ph,tps,_143,aj,stat,qstr,tgt){var _148=1;getForumTopics(_13d,_13e,_148,_13c,_13f,_140,ph,tps,_143,aj,stat,qstr,tgt);};discussionsFunctions["home"]=function(_149,_14a){var _14b=-1;var _14c=-1;var _14a=_14a;if(typeof _149=="undefined"){_149="home";_14a=1;}getForumTopics(_14b,_14c,_14a,_149);};discussionsFunctions["chome"]=function(_14d,_14e){var _14f=-1;var _150=-1;var _14e=_14e;if(typeof _14d=="undefined"){_14d="chome";_14e=1;}getForumTopics(_14f,_150,_14e,_14d);};discussionsFunctions["reports"]=function(_151){var _152=-1;var _153=-1;var _154=1;getTopicsReport(_152,_153,_154,_151);};discussionsFunctions["forum"]=function(_155,_156,_157,_158){document.title=forumGroupName;var _159=$("#topicListMainContainer");if(_159.length>0&&_159.is("[shouldReload=\"false\"]")){_159.show().attr("shouldReload","true").siblings().remove();hideLoadingImage();if(isMac=="false"){setToHotkeys();}}else{var _15a={};_15a.forumGroupId=forumGroupId;_15a.forumURL=_156;_15a.fetchPage=_158;if(_157){_15a.categoryURL=_157;}doAjaxAction("/getSingleForumTopics.do",_15a,function(data){hideLoadingImage();$("#mainContent").get(0).innerHTML=data;lightBox("#chartWidget");if(_157){if(parseInt(_158)>1){$.history.add(_155+"/"+_156+"/"+_157+"/"+_158);}else{$.history.add(_155+"/"+_156+"/"+_157);}}else{if(parseInt(_158)>1){$.history.add(_155+"/"+_156+"/"+_158);}else{$.history.add(_155+"/"+_156);}}goToTop();bindTopicClicks($("#topicList"));bindTopicClicks($("#topicsList"));bindTopicListHeaderClicks($("#topicListHeader"));bindWidgetsContClick($("#topicListWidgetsCont"));var _15c=$("#forumComboCont");var _15d=_15c.attr("forumId");var _15e=_15c.attr("categoryId");var _15f="NewTopic/"+_15d+"/"+_15e;if($("#allForumWidget").length>0){if($("#allForumWidget").find("li[purpose=\"forumList\"]").length<9){$("#moreForumView").hide();}}$("#NewTopicTab").attr("hashPurpose",_15f);if(typeof WmsContacts!="undefined"&&ch==true){var _160=WmsContacts.getZohoContacts();setPresence(_160,"moderatorsChatList_"+_15d);setPresenceInTopicList(_160);}if(isMac=="false"){setToHotkeys();}return false;},function(_161){$("#mainContent").get(0).innerHTML=_161.responseText;hideLoadingImage();});}};discussionsFunctions["newtopic"]=function(_162,_163,_164){if(typeof _163=="undefined"&&typeof _164=="undefined"){getWritePost("-1","-1",_162);}else{_163=(typeof _163=="undefined")?-1:_163;_164=(typeof _164=="undefined")?-1:_164;getWritePost(_163,_164,_162);}};discussionsFunctions["search"]=function(_165,_166){var _167={};_167.forumGroupId=forumGroupId;if(!_166){_166=$("#searchInputBox").val();_166=$.trim(_166);}if(_166==""){showMessage(i18n["zohodiscussions.searchList.noSearchString"],"failure");hideLoadingImage();return;}_167.searchFor=_166;var _168=-1;_167.forumId=_168;_167.normalSearchType=$("#searchSelectedImage").attr("purpose");$.history.add(_165+"/"+_166);if($("#currSearchSortBy").attr("currSortBy")=="date"){_167.searchSortBy="date";}doAjaxAction("/getSearchResult.do",_167,function(data){hideLoadingImage();var _16a=$("<div></div>");_16a.get(0).innerHTML=data;$("#mainContent").get(0).innerHTML=data;bindSearchContentClick($("#mainContent"));showAuthorPopout(_16a);$("#searchInputBox").val(_166);});};discussionsFunctions["topic"]=function(_16b,_16c,_16d){if(_16d!=undefined){openSinglePost(_16c,_16b,_16d);}else{openSinglePost(_16c,_16b);}};discussionsFunctions["tag"]=function(_16e,_16f){$.history.add(_16e+"/"+_16f);$this=$(this);var _170={};_170.forumGroupId=forumGroupId;_170.tagName=_16f;_170.fetchPage=1;doAjaxAction("/getTagRelatedPosts.do",_170,function(data){hideLoadingImage();$("#mainContent").get(0).innerHTML=data;goToTop();bindTopicClicks($("#topicList"));bindTopicClicks($("#topicsList"));bindTopicListHeaderClicks($("#topicListHeader"));bindWidgetsContClick($("#topicListWidgetsCont"));return false;},function(_172){hideLoadingImage();var _173=(_172.responseText);$("#mainContent").get(0).innerHTML=_173;});};discussionsFunctions["alltags"]=function(_174){$.history.add(_174);$this=$(this);var _175={};_175.forumGroupId=forumGroupId;doAjaxAction("/showAllTags.do",_175,function(data){hideLoadingImage();$("#mainContent").get(0).innerHTML=data;bindTagsContClick($("#allTagsContainer"));bindWidgetsContClick($("#topicListWidgetsCont"));return false;},function(_177){hideLoadingImage();var _178=(_177.responseText);$("#mainContent").get(0).innerHTML=_178;});};discussionsFunctions["allforums"]=function(_179){var _17a={};_17a.purpose="AllForums";_17a.forumGroupId=forumGroupId;_17a[csrfParamName]=csrfToken;doAjaxAction("/AllForums.do",_17a,function(data){hideLoadingImage();document.title=i18n["zohodiscussions.general.allForums"];$.history.add("AllForums");$("#mainContent").get(0).innerHTML=data;allForumsBindActions();return false;},function(_17c){hideLoadingImage();var _17d=(_17c.responseText);$("#mainContent").get(0).innerHTML=_17d;});};function allForumsBindActions(){lightBox("#chartWidget");bindAllForumsClick($("#allForums_MainContentCont"));bindWidgetsContClick($("#topicListWidgetsCont"));goToTop();var _17e=$("#listof_FC_Counts");$("#countOfForum").html(_17e.attr("forumCount"));$("#countOfCategory").html(_17e.attr("categoryCount"));$("#countOfPosts").html(_17e.attr("postCount"));$("#countOfResponses").html(_17e.attr("responseCount"));if(typeof WmsContacts!="undefined"&&ch==true){var _17f=WmsContacts.getZohoContacts();setPresenceInTopicList(_17f);}}discussionsFunctions["settings"]=function(_180){var _181={};_181.forumGroupId=forumGroupId;doAjaxAction("/settings.do",_181,function(data){hideLoadingImage();$("#mainContent").get(0).innerHTML=data;$.history.add("Settings");initSettingTabClick();return false;},function(_183){});};discussionsFunctions["myarea"]=function(_184,_185,_186){document.title=i18n["zohodiscussions.general.myarea"];var _187=$("#myAreaParentContainer");if(_187.length>0&&_187.is("[shouldReload=\"false\"]")){_187.show().attr("shouldReload","true").siblings().remove();hideLoadingImage();}else{var _188={};_188.forumGroupId=forumGroupId;_188[csrfParamName]=csrfToken;if(!_185){_185="dashboard";}if(_185!="dashboard"&&_185!="myposts"&&_185!="watchlist"&&_185!="bookmark"&&_185!="privatemsg"&&_185!="preference"){hideLoadingImage();return;}_188.myAreaAction=_185;_188.ch=ch;doAjaxAction("/getMyArea.do",_188,function(data){$("#authorPopout:visible").hide();hideLoadingImage();$("#mainContent").get(0).innerHTML=data;getMyAreaBindActions(_185,_184,"",_186);return false;},function(_18a){hideLoadingImage();var _18b=(_18a.responseText);$("#mainContent").get(0).innerHTML=_18b;});}};discussionsFunctions["user"]=function(_18c,_18d){getAuthorProfile(_18d);};discussionsFunctions["moderation"]=function(_18e){document.title=i18n["zohodiscussions.moderationAction.moderation"];var _18f={};_18f.forumGroupId=forumGroupId;if(portalPlanIndex>4){_18f.postFor="AllWaitingApproval";}else{_18f[csrfParamName]=csrfToken;_18f.postFor="AllReportedSpam";}ModerationLoadingPage(_18f);};function ModerationLoadingPage(_190){var _191="";if(portalPlanIndex>4){_191="/getModerationPanel.do";}else{_191="/getReportedSpam.do";}doAjaxAction(_191,_190,function(data){hideLoadingImage();$("#mainContent").get(0).innerHTML=data;$.history.add("Moderation");getModerationPanelBindAction();return false;},function(_193){hideLoadingImage();var _194=(_193.responseText);$("#mainContent").get(0).innerHTML=_194;});}function getModerationPanelBindAction(){goToTop();bindModerationTabClick();if(portalPlanIndex>4){bindModerationActionClick("AllAwaiting");}else{bindModerationActionClick("AllReportedSpam");var _195=$("#moderationLeftCont li[purpose=\"ReportedSpam\"]");_195.removeClass("default").addClass("selected").siblings("li.selected").removeClass("selected").addClass("default");}ModerationAction($("#moderationRightCont"));initModerationPanel($("#moderationPanel"));}function getMyAreaBindActions(_196,_197,_198,_199){bindMyAreaClicks($("#myAreaContent"));$("#authorPopout_"+ZUID).hide();showAuthorPopout($("#myAreaInnerMainContent"));if(_196!="dashboard"){if(_196=="myposts"){_196="myjournals";}if(_199!=undefined){if(_199!="topic"&&_199!="user"&&_199!="forum"&&_199!="subforum"&&_199!="following"&&_199!="follower"){_199="topic";}}if(_198!="niceurl"){if($("#"+_196+"View").length>0){getMyAreaAction($("#"+_196+"View"),_199);}else{getMyAreaAction($("#dashboardView"));}}else{var _19a=$("#"+_196+"View").attr("purpose");bindMyareaTabsActions(_19a,_199);}}else{if(_198!="niceurl"){$.history.add(_197+"/"+_196);}if(typeof WmsContacts!="undefined"&&ch==true){var _19b=WmsContacts.getZohoContacts();setPresence(_19b,"followingUserDetails");setPresence(_19b,"followersUserDetails");setPresenceInMyArea(_19b,"current_recentActivity_List");}}}function ModerationAction(_19c){_19c.unbind("click",bindModerationAction).click(bindModerationAction);showAuthorPopout(_19c);}function getTopicsReport(_19d,_19e,_19f,_1a0){document.title=forumGroupName;var _1a1={};_1a1.forumGroupId=forumGroupId;_1a1.forumId=_19d;_1a1.categoryId=_19e;_1a1.fetchPage=_19f;doAjaxAction("/Reports.do",_1a1,function(data){hideLoadingImage();if(_1a0){$.history.add(_1a0);}$("#mainContent").get(0).innerHTML=data;lightBox("#chartWidget");bindReportsClicks($("#reportsContent"));});}function getForumTopics(_1a3,_1a4,_1a5,_1a6,_1a7,_1a8,ph,tps,_1ab,aj,stat,qstr,tgt){document.title=forumGroupName;var _1b0=$("#topicListMainContainer");var _1b1={};_1b1.forumGroupId=forumGroupId;_1b1.forumId=_1a3;_1b1.categoryId=_1a4;_1b1.fetchPage=_1a5;_1b1.givenkey=_1a6;if(_1a6=="tpw"){_1b1.limit=_1a7;_1b1.style=_1a8;_1b1.ph=ph;_1b1.tps=tps;_1b1.widget=_1ab;_1b1.aj=aj;_1b1.stat=stat;_1b1.querystring=qstr;_1b1.tgt=tgt;}if(_1b0.length>0&&_1b0.is("[shouldReload=\"false\"]")){_1b0.show().attr("shouldReload","true").siblings().remove();hideLoadingImage();if(isMac=="false"){setToHotkeys();}}else{doAjaxAction("/getSingleForumTopics.do",_1b1,function(data){hideLoadingImage();if(_1a6){if(parseInt(_1a5)>1){$.history.add(_1a6+"/"+_1a5);}else{$.history.add(_1a6);}}$("#mainContent").get(0).innerHTML=data;lightBox("#chartWidget");bindTopicClicks($("#topicList"));bindTopicClicks($("#topicsList"));bindTopicListHeaderClicks($("#topicListHeader"));bindWidgetsContClick($("#topicListWidgetsCont"));var _1b3="NewTopic/"+_1a3+"/"+_1a4;$("#NewTopicTab").attr("hashPurpose",_1b3);if($("#allForumWidget").length>0){if($("#allForumWidget").find("li[purpose=\"forumList\"]").length<9){$("#moreForumView").hide();}}if(typeof WmsContacts!="undefined"&&ch==true){var _1b4=WmsContacts.getZohoContacts();setPresenceInTopicList(_1b4);}if(isMac=="false"){setToHotkeys();}return false;},function(_1b5){hideLoadingImage();var _1b6=(_1b5.responseText);$("#mainContent").get(0).innerHTML=_1b6;});}}function getWritePost(_1b7,_1b8,_1b9,_1ba){var _1bb={};_1bb.forumGroupId=forumGroupId;_1bb.forumId=_1b7;_1bb.categoryId=_1b8;if(isTopicQuickView!="false"){showLoadingImage();}doAjaxAction("/writePost.do",_1bb,function(data){hideLoadingImage();document.title=i18n["zohodiscussions.writePost.documentTitle"]+" - "+forumGroupName;$("#mainContent").get(0).innerHTML=data;if(_1ba!="true"){$.history.add(_1b9);}$("#tabListCont li.selected").removeClass("selected");goToTop();var _1bd=$("#SelectForum > option");if((_1bd.length)==1){_1bd.attr("selected",true);}var _1be=$("#SelectCategory > option");if((_1be.length)==1){_1be.attr("selected",true);}initWritePost();_1b9=_1b9.toLowerCase();if(_1b9!="newtopic"){if(_1b9=="newproblem"){_1b9="error";}else{if(_1b9=="newquestion"){_1b9="question";}else{if(_1b9=="newidea"){_1b9="idea";}else{if(_1b9=="newdiscussion"){_1b9="discuss";}}}}var _1bf=$("#writepostTabsCont").find("li[topiciconclass=\""+_1b9+"\"]");selectTopicType(_1bf);}hideLoadingImage();return false;},function(_1c0){hideLoadingImage();var _1c1=(_1c0.responseText);$("#mainContent").get(0).innerHTML=_1c1;});}function selectTab(_1c2){if(_1c2=="user"){$("#newtopicTab").siblings("li.selected").removeClass("selected");return;}else{if(_1c2=="newtopic"||_1c2=="search"){searchFor=$("#searchInputBox").val();searchFor=$.trim(searchFor);if(_1c2=="search"&&searchFor==""){return;}$("#"+_1c2+"Tab").siblings("li.selected").removeClass("selected");return;}else{if(_1c2=="forum"||_1c2=="topic"||_1c2=="chome"){_1c2="home";}}}$("#"+_1c2+"Tab").addClass("selected").siblings("li.selected").removeClass("selected");}function bindTopicListHeaderClicks(_1c3){_1c3.unbind("click",processTopicListHeaderClick).click(processTopicListHeaderClick);}function bindTopicClicks(_1c4){_1c4.unbind("click",processTopicListClick).click(processTopicListClick);var _1c5=_1c4.find("script").html();try{eval(_1c5);}catch(e){}}function showAuthorPopout(_1c6){_1c6.find("a[purpose=\"authorProfile\"],img[purpose=\"authorProfile\"]").hover(function(){var _1c7=$(this);var _1c8=_1c7.attr("authorId");if(_1c8==-1){return;}var _1c9=_1c7.attr("authorName");var _1ca=_1c7.attr("forumId");var _1cb=setTimeout(function(){var _1cc=_1c7.position();if(_1cc.left>800){_1cc.left=_1cc.left-300;}$authorPopup=$("#authorPopout_"+_1c8);if($authorPopup.length>0){$authorPopup.css(_1cc).show();authorPopupHover($authorPopup);}else{$authorPopup=$("#authorPopoutTemplate").clone();$authorPopup.attr("popoutPurpose","authorDetailsPopout");$authorPopup.attr("id","authorPopout_"+_1c8);var _1cd={};_1cd.forumGroupId=forumGroupId;_1cd.authorId=_1c8;_1cd.forumId=_1ca;_1cd.ch=ch;doAjaxAction("/getAuthorPopup.do",_1cd,function(data){$thisAuthPopup=$("<div>"+data+"</div>");authorPopUpAction($thisAuthPopup,_1c8,_1c9,$authorPopup);});$authorPopup.css(_1cc).show();$authorPopup.appendTo("body");authorPopupHover($authorPopup);}},700);_1c7.data("destroyHandleAuthPopout",_1cb);},function(){var _1cf=$(this);var _1d0=_1cf.attr("authorId");var _1d1=_1cf.data("destroyHandleAuthPopout");if(_1d1){clearTimeout(_1d1);}var _1d2=$("#authorPopout_"+_1d0);_1d2.attr("hideAuhPopout","true");setTimeout(function(){var _1d3=_1d2.attr("hideAuhPopout");if(_1d3=="true"){_1d2.hide();}},500);});}function mouseOutAuthor(_1d4){var _1d5=_1d4;var _1d6=_1d5.attr("authorId");var _1d7=_1d5.data("destroyHandleAuthPopout");if(_1d7){clearTimeout(_1d7);}var _1d8=$("#authorPopout_"+_1d6);_1d8.attr("hideAuhPopout","true");setTimeout(function(){var _1d9=_1d8.attr("hideAuhPopout");if(_1d9=="true"){_1d8.hide();}},500);}function mouseOverAuthor(_1da){var _1db=_1da;var _1dc;var _1dd=_1db.attr("authorId");if(_1dd==-1){return;}var _1de=_1db.attr("authorName");var _1df=_1db.parents("div[parentCont=\"actualParent\"]").attr("forumId");if(typeof _1df=="undefined"){_1df=_1db.attr("forumId");}var _1e0=setTimeout(function(){var _1e1=_1db.position();_1dc=$("#authorPopout_"+_1dd);if(_1dc.length>0){_1dc.css(_1e1).show();authorPopupHover(_1dc);}else{_1dc=$("#authorPopoutTemplate").clone();_1dc.attr("popoutPurpose","authorDetailsPopout");_1dc.attr("id","authorPopout_"+_1dd);var _1e2={};_1e2.forumGroupId=forumGroupId;_1e2.authorId=_1dd;_1e2.forumId=_1df;_1e2.ch=ch;doAjaxAction("/getAuthorPopup.do",_1e2,function(data){$thisAuthPopup=$("<div>"+data+"</div>");authorPopUpAction($thisAuthPopup,_1dd,_1de,_1dc);});_1dc.css(_1e1).show();_1dc.appendTo("body");authorPopupHover(_1dc);}},700);_1db.data("destroyHandleAuthPopout",_1e0);}function authorPopUpAction(_1e4,_1e5,_1e6,_1e7){_1e4.find("li[purpose=\"watchUser\"]").click(function(){$thisWatchCont=$(this);var _1e8={};_1e8.forumGroupId=forumGroupId;_1e8.itemId=_1e5;_1e8.itemType=3;_1e8[csrfParamName]=csrfToken;var _1e9=$thisWatchCont.attr("watchAction");var _1ea=(_1e9=="watch")?"/watchUser.do":"/unwatchUser.do";doAjaxAction(_1ea,_1e8,function(data){if(data=="SUCCESS"){$thisWatchCont.attr("watchAction",(_1e9=="watch")?"unwatch":"watch");var _1ec=((_1e9=="watch")?i18n["zohodiscussions.general.Unwatch"]:i18n["zohodiscussions.general.watch"])+" "+_1e6;$thisWatchCont.find("a[purpose=\"watchuserNameCont\"]").html(_1ec);if(_1e9=="watch"){showTipper(i18n["zohodiscussions.generalmessage.userAddedToWatchlist"],"success");}else{showTipper(i18n["zohodiscussions.generalmessage.userRemovedFromWatchlist"]);}}});});_1e4.find("li[purpose=\"authorProfile\"]").click(function(){if(_1e6==ZU_Name){processHash("MyArea");}else{processHash("User/"+_1e6);}});_1e7.html("").append(_1e4);if(typeof WmsContacts!="undefined"&&ch==true){var _1ed=WmsContacts.status(_1e5);if(_1ed===false){_1ed=9;}manageUserChatStatus("authorPopup_"+_1e6,_1ed,_1e6);}}function authorPopupHover(_1ee){_1ee.hover(function(){_1ee.attr("hideAuhPopout","false");var _1ef=_1ee.data("destroyHandle");if(_1ef){clearTimeout(_1ef);}},function(){var _1f0=setTimeout(function(){_1ee.hide();_1ee.unbind("mouseenter").unbind("mouseleave");},700);_1ee.data("destroyHandle",_1f0);});}function displaySearchOption(){var _1f1=$("#listOfSearchOptions");_1f1.show();_1f1.find("li").unbind("click").click(function(){var _1f2=$(this);var _1f3=_1f2.find("div");var _1f4=_1f3.attr("class");var _1f5=_1f3.attr("purpose");if(!_1f3.is(".imgAdvanceSearch")){$("#searchSelectedImage").attr("class",_1f4).attr("purpose",_1f5);}else{if($("#advanceSearchContainerForm").is(":visible")){$("#listOfSearchOptions").hide();return;}if($("#searchMainContainer").is(":visible")){$("#normalSearchInSearchList").hide();$("#advanceSearchContainerForm").show();$("#advanceSearchInpurBox").focus();return;}showLoadingImage();var _1f6={};_1f6.forumGroupId=forumGroupId;doAjaxAction("/AdvanceSearchContainer.do",_1f6,function(data){hideLoadingImage();var _1f8=$("#mainContent > div:first");var _1f9=$("<div></div>");_1f9.get(0).innerHTML=data;_1f9.insertBefore(_1f8);_1f9.find("#advanceSearchContainerForm").show();_1f9.find("#advanceSearchInpurBox").focus();if($("#normalSearchInSearchList").is(":visible")){$("#normalSearchContainer").hide();}bindSearchContentClick(_1f9);},function(_1fa){hideLoadingImage();var _1fb=(_1fa.responseText);$("#mainContent").get(0).innerHTML=_1fb;});}_1f1.hide();});var _1fc=_1f1.parent("div.searchOpList");_1fc.hover(function(){var _1fd=_1fc.data("destroyHandle");if(_1fd){clearTimeout(_1fd);}},function(){var _1fe=setTimeout(function(){_1f1.hide();_1fc.unbind("mouseenter").unbind("mouseleave");},500);_1fc.data("destroyHandle",_1fe);});}function bindSearchContentClick(_1ff){_1ff.unbind("click",processSearchContClick).click(processSearchContClick);$("#SearchforumCategoryVice").change(function(){searchForumCatSelect($(this));});}function searchForumCatSelect(_200){var _201=_200.val();var _202=$("#searchCategoryList").val().split("$$");$.each(_202,function(_203,item){if(item.indexOf(_201+":")>-1){$("#SearchCategoryVice").html("<option selected value=\"-1\">"+i18n["zohodiscussions.searchList.all"]+"</option>"+item.split(":")[1]).show();$("#SelectCategory option:first").attr("selected","true");return false;}else{if(_201==-1){$("#SearchCategoryVice").html("<option selected value=\"-1\">"+i18n["zohodiscussions.searchList.all"]+"</option>").show();}else{$("#SearchCategoryVice").html("<option selected value=\"-1\">Uncategorised</option>").show();}}});$("#SearchCategoryVice option:first").attr("selected","true");}function bindWidgetsContClick(_205){_205.unbind("click",processWidgetsContClick).click(processWidgetsContClick);showAuthorPopout(_205);}function bindAllForumsClick(_206){_206.unbind("click",processAllForumsClick).click(processAllForumsClick);showAuthorPopout(_206);}function processTopicListHeaderClick(_207){var _208=$(_207.target);var _209=_208.parent();if(_208.is("#forumsFilter li,#categoriesFilter li,#currentCategoryContext,#currentForumContext")){hashPurpose=_208.attr("hashPurpose");processHash(hashPurpose);return false;}else{if(_208.is("div[purpose=\"linkForDropDown\"]")){var _20a=_208;var _20b=_20a.attr("dropDownContLocation");var _20c=$(_20a.attr("parentCont"));if(_20c.is(".newCombo")){_20c.addClass("newComboSelected").removeClass("newCombo");}else{_20c.addClass("newCombo").removeClass("newComboSelected");}var _20d=$("#"+_20b);_20d.toggle();}}if(_208.is("#topicListFilter li[purpose=\"filterLink\"]")){var _20e=_208.attr("topicFilter");$topicFilterParent=$("#topicListFilter");var _20f=$topicFilterParent.attr("forumURL");var _210=$topicFilterParent.attr("subForumURL");var _211=$topicFilterParent.attr("postSinceLastVisitTime");var _212="";if($topicFilterParent.attr("isTypeURL")=="yes"){getMoreTopics(_20f,_210,fetchPage,_20e,"",_212);$("#currentFilterContext").html(_208.text());}else{manageFilterHash(_20f,_210,_20e,_212);}return false;}if(_208.is("#showAllTags")&&_208.attr("isNiceURL")!="Yes"){processHash("AllTags");}if(_208.is("#innerTabFilter span")&&_209.attr("purpose")=="filterTab"){manageFilterTabList(_208);}if(_208.is("#innerTabFilter div[purpose=\"filterTabCombo\"]")){manageFilterMenuList(_208.attr("filterParent"));}var _213=$("#forumsListOptions,#categoriesListOptions,#typeFilterOptions");_213.hover(function(){var _214=_213.data("destroyHandle");if(_214){clearTimeout(_214);}},function(){var _215=setTimeout(function(){_213.parent(".newComboSelected").addClass("newCombo").removeClass("newComboSelected");_213.hide();},500);_213.data("destroyHandle",_215);});}function manageFilterTabList(_216){var _217=$("#innerTabFilter");_217.find("li.selectedTab").removeClass("selectedTab");_216.parents("li").addClass("selectedTab");var _218=_217.attr("forumURL");var _219=_217.attr("subForumURL");var _21a=1;var _21b=_216.attr("filterBy");var _21c="";var _21d=_217.attr("topicFilterType");var _21e=_217.attr("postSinceLastVisitTime");if(_21d!="All"){_21c=_216.attr("filterLabelId");if(_21c){_21c=_21b;_21b=_21d;}}if(_217.attr("isTypeURL")=="yes"){getMoreTopics(_218,_219,_21a,_21b,_21e,_21c);}else{manageFilterHash(_218,_219,_21b,_21c);}}function manageFilterHash(_21f,_220,_221,_222){if(_21f==""&&_220==""){if(_222){processHash("filter/"+_221+"/"+_222+"/1");}else{processHash("filter/"+_221+"/1");}}else{if(_220==""){if(_222){processHash("forum/"+_21f+"/filter/"+_221+"/"+_222+"/1");}else{processHash("forum/"+_21f+"/filter/"+_221+"/1");}}else{if(_222){processHash("forum/"+_21f+"/"+_220+"/filter/"+_221+"/"+_222);}else{processHash("forum/"+_21f+"/"+_220+"/filter/"+_221);}}}}function manageFilterMenuList(_223){var _224=$("#"+_223);if($("#innerTabFilter div.forumOptions").is(":visible")){$(this).hide();}_224.removeClass("newCombo").addClass("newComboSelected");_224.hover(function(){var _225=_224.data("destroyHandle");if(_225){clearTimeout(_225);}},function(){var _226=setTimeout(function(){_224.removeClass("newComboSelected").addClass("newCombo");},500);_224.data("destroyHandle",_226);});_224.find("li[purpose=\"filterTabMenu\"]").unbind("click").click(function(){var _227=$(this);var _228=$("#innerTabFilter");var _229=_228.attr("forumURL");var _22a=_228.attr("subForumURL");var _22b=_227.attr("labelName");var _22c=_227.parent().attr("filterType");var _22d=1;_228.find("li.selectedTab").removeClass("selectedTab");$("#"+_22c+"FilterMenuList").addClass("selectedTab");var _22e=_227.attr("filterBy");var _22f="";if(_22e){_22c=_22e;}if(_228.attr("isTypeURL")=="yes"){getMoreTopics(_229,_22a,_22d,_22c,"",_22b);}else{manageFilterHash(_229,_22a,_22c,_22b);}});}function bindTagsContClick(_230){_230.find("li[purpose =\"getTagPosts\"]").click(function(){$this=$(this);var _231=$this.attr("hashPurpose");processHash(_231);});}function processTopicListClick(_232){var _233=$(_232.target);var _234=_233.parent();var _235=$("#paginationContainer");var _236="topicList";var _237=_233.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");if(_233.is("div.quickViewBtn")||_233.is("a[purpose=\"postTitleQuickView\"]")){_237=_237||_234.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");handleTopicClick(_232,_237,_236);}else{if(_233.is("a[purpose=\"postTitle\"]")||_233.is("div[purpose=\"postTitle\"]")){showLoadingImage();if(isTopicQuickView=="false"){}else{var _238=_233.parents("div[parentCont=\"actualParent\"]").attr("recentResponseId");var _239=_233.attr("isResponse");if(_238!=undefined&&_239=="true"){processHash("Topic/"+_237+"/"+_238);}else{processHash("Topic/"+_237);}return false;}}else{if(_234.is("li[purpose=\"moreAction\"]")){manageMoreAction(_234);}else{if(_233.is("a[purpose=\"moreAction\"]")){var _23a=_233.parents("li");manageMoreAction(_23a);}else{if(_233.is("a[purpose=\"linkedTopicTitle\"]")){showLoadingImage();if(isTopicQuickView=="false"){}else{var _23b=_233.attr("linkToTopicId");processHash("Topic/"+_23b);return false;}}else{if(_233.is("li[linkPurpose=\"replyToTopic\"]")||_234.is("li[linkPurpose=\"replyToTopic\"]")){_237=_237||_234.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");if(_235.data("inEditMode")==true){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");var _23c=_235.data("editorContLocation");var _23d=_235.data("eachTopicContainerId");var _23e=_235.data("forumTopicId");if(_23e!=_237){handleTopicClick(_232,_23e,"editTopicList");}setFocusToContainer($(_23c));return false;}$("#eachTopicReplyCont_"+_237).show();openEditor($("#eachTopicReply_"+_237),"responseContent","postContentTA","replyToTopic_"+_237,"Write","paginationContainer");setFocusToContainer($("#eachTopicReplyCont_"+_237));_235.data("inEditMode",true);_235.data("editorContLocation","#eachTopicReplyCont_"+_237);_235.data("eachTopicContainerId","#eachTopic_"+_237);_235.data("forumTopicId",_237);return false;}else{if((_233.is("#olderPostsLink")||_233.is("#newerPostsLink"))&&_233.is(".navBtnEnabled")){var _23f=_233.attr("forumURL");var _240=_233.attr("categoryURL");var _241=_233.attr("fetchPage");var _242=_233.attr("topicFilter");var _243=_233.attr("getPostFor");var _244=_233.attr("topicStatus");var _245=_233.attr("postSinceLastVisitTime");if(typeof _243=="undefined"){getMoreTopics(_23f,_240,_241,_242,_245,_244,"true");}else{var _246=_233.attr("tag_Name");getMoreTagRelatedPost(_241,_246,_243);}}else{if(_233.is("a[purpose=\"forumPostsFilter\"]")){hashPurpose=_233.attr("hashPurpose");processHash(hashPurpose);return false;}else{if((_233.is("a[purpose=\"authorProfile\"]"))||_233.is("img[purpose=\"authorProfile\"]")){var _247=_233.attr("authorName");if(_247==ZU_Name){processHash("MyArea");}else{processHash("User/"+_247);}return;}else{if(_233.is("div.imgSmallWatchSel")||_233.is("div.imgSmallWatch")){watchThisItem(_233,"singleTopicWatch",_232);return;}else{if((_233.is("li.imgNavPrevious")||_233.is("li.imgNavNext"))&&!_234.is(".navLoading")){checkPrevNextResponse(_233);return;}else{if((_233.is("li.imgNavStart")||_233.is("li.imgNavEnd"))&&!_234.is(".navLoading")){firstOrLastResponse(_233);return;}}}}}}}}}}}}if(_234.is("li[purpose=\"watchAction\"]")){watchThisItem(_234,_236,_232);return;}else{if(_234.is("li[purpose=\"emailThisTopic\"]")){openEmailTopicDialog(_234);var _23a=_234.parents("li[purpose=\"moreAction\"]");manageMoreAction(_23a);return;}else{if(_234.is("li[purpose=\"moderateThisTopic\"]")){moderateAction(_234,_236,_232);return;}else{if(_234.is("li[actionPurpose=\"reportSpam\"],span[actionPurpose=\"reportSpam\"]")){singlePostSpamAction(_234,_236);return;}else{if(_234.is("div[actionPurpose=\"reportInappropriate\"]")||_234.is("li[actionPurpose=\"reportInappropriate\"]")||_234.is("span[actionPurpose=\"reportInappropriate\"]")){singlePostSpamAction(_234,_236);return;}else{if(_233.is("span[purpose=\"inappropriateReason\"]")){getReasonForInapppropriate(_233);}else{if(_234.is("li[actionPurpose=\"delete\"]")){singlePostDeleteAction(_234,_236);return;}else{if(_234.is("#removeTopicLink")||_234.is("li[purpose=\"removeTopicLink\"]")){deletelinkedTopic(_234);}else{if(_234.is("li[actionPurpose=\"edit\"]")){var _248=_234.attr("responseId");var _249=_234.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _24a="#eachTopic_"+_249;if(_235.data("inEditMode")){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");_23c=_235.data("editorContLocation");var _23e=_235.data("forumTopicId");if(_249!=_23e){handleTopicClick(_232,_23e,_236);}setFocusToContainer($(_23c));return false;}openEditor($("#recentResponseContent_"+_248),"responseContent","postContentTA",("editPostContent_"+_248),"Edit",("eachTopic_"+_248));setFocusToContainer($(_24a));_235.data("inEditMode",true);_235.data("editorContLocation",_24a);_235.data("forumTopicId",_249);$("#postTextContent_"+_248).find("ul.singlePostActions").hide();$("#linkedTopic_"+_248).hide();$("#singlePostActions_"+_248).hide();$("#recent_ResPonse_"+_248).find("div.navigationCont").hide();$("#previewResponse").attr("location","topicListEditResponse");$("#previewResponse").attr("responseId",_248);$("#previewResponse").attr("forumTopicId",_249);return false;}else{if(_234.is("li[deletepurpose=\"deleteAttachment\"]")){deletePublishedAttachment(_234,_232);return;}else{if(_234.is("li[votePurpose]")){var _24b=_234;var _248=_24b.attr("responseId");_237=_24b.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _24c=_24b.attr("votePurpose");var _24d=(_24c=="removeVote")?"/removeResponseVote.do":"/voteResponse.do";showSmallLoadingImage(_232);var _24e={};_24e.forumGroupId=forumGroupId;_24e.responseId=_248;_24e.forumTopicId=_237;_24e[csrfParamName]=csrfToken;doAjaxAction(_24d,_24e,function(data){if(data=="SUCCESS"){refreshResponseVoteContainer(_248);}else{hideLoadingImage();}});}else{if(_234.is("li[bestResponse]")){var _24b=_234;var _248=_24b.attr("responseId");var _237=_24b.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _250=_24b.attr("topicAuthorId");var _251=_24b.attr("bestResponse");var _24e={};_24e.forumGroupId=forumGroupId;if(_251=="choose"){_24e.responseId=_248;}_24e.forumTopicId=_237;if(_250==ZUID){_24e.topicowner="true";}_24e[csrfParamName]=csrfToken;var _252=(_251=="choose")?"/bestResponse.do":"/removeBestResponse.do";showSmallLoadingImage(_232);doAjaxAction(_252,_24e,function(data){if(data=="SUCCESS"){var _254=(_251=="choose")?i18n["zohodiscussions.singlepost.bestResponseSuccessMsg"]:i18n["zohodiscussions.singlePost.removeBestResponseMsg"];var _255=(_251=="choose")?"success":"info";showTipper(_254,_255);refreshSingleTopic(_237);}else{hideLoadingImage();showMessage(i18n["zohodiscussions.generalmessage.noPermission"]);}});}else{if(_234.is("div[voteTopic]")){var _24b=_234;var _256=_24b.attr("firstResponseId");var _237=_24b.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");showSmallLoadingImage(_232);var _257={};_257.forumGroupId=forumGroupId;_257.responseId=_256;_257.forumTopicId=_237;_257[csrfParamName]=csrfToken;doAjaxAction("/voteTopic.do",_257,function(data){if(data=="SUCCESS"){refreshResponseVoteContainer(_256);}else{hideLoadingImage();}});}}}}}}}}}}}}}}function manageMoreAction(_259){if(_259.is(".newComboSelectedNm")){_259.removeClass("newComboSelectedNm").addClass("newCombo");_259.find("div.forumOptins").hide();return;}_259.removeClass("newCombo").addClass("newComboSelectedNm");var _25a=_259.find("div.forumOptins");_25a.show();_259.hover(function(){_259.attr("hideAuhPopout","false");var _25b=_259.data("destroyHandle");if(_25b){clearTimeout(_25b);}},function(){var _25c=setTimeout(function(){_259.removeClass("newComboSelectedNm").addClass("newCombo");_25a.hide();_259.unbind("mouseenter").unbind("mouseleave");},500);_259.data("destroyHandle",_25c);});}function refreshResponseVoteContainer(_25d){var _25e={};_25e.forumGroupId=forumGroupId;_25e.responseId=_25d;doAjaxAction("/refreshSingleResponse.do",_25e,function(data){var _260=$(data).find("div[contPurpose=\"voteContainer\"]");$("#postTextContent_"+_25d+" div[contPurpose=\"voteContainer\"]").html(_260.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(_261,_262,flag,_264){var _265=$("#topicTitle").val();var _266=_265.replace(/^<+|<+$/g,"&lt;").replace(/<+/g,"&lt;").replace(/^>+|>+$/g,"&gt;").replace(/>+/g,"&gt;");_266=_266.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ");if(_266==""){hideLoadingImage();setFocusToContainer(($("#topicTitle")).focus());enablePostButtons();showMessage(i18n["zohodiscussions.writePost.TopicTitleCannotbeEmptymessage"],"failure");return;}if(_266.length>200){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.TopicTitleLengthMsg"],"failure");enablePostButtons();return;}var _267=$("#postContentTA").data("editor").val();_267=_267.replace(/^\s+/g,"").replace(/\s+$/g,"");var _268=$("<div></div>").html(_267);_267=_268.text();if(_267==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");enablePostButtons();return;}var _269=$("#SelectForum").val();if(_269==null){hideLoadingImage();$("#selectForumMessage").show();setFocusToContainer($("#SelectForum"));enablePostButtons();showMessage(i18n["zohodiscussions.writePost.selectAnyForum"],"failure");return;}else{$("#selectForumMessage").hide();}var _26a=$("#forumTags").val();if(_26a!=""){_26a=_26a.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");if(_26a.match(/[a-zA-Z0-9, ]+$/)==null){hideLoadingImage();showMessage(i18n["zohodiscussions.singlepost.specialCharacterNotAllowedMsg"],"failure");enablePostButtons();return;}}if(_264){$("#previewAttachment >li").html("");var _26b=$("#attachmentsListCont").find("div[attachmentDetails]");var _26c=$("#attachmentsListCont").find("div[attachmentDetails]").length;if(_26c>0){var _26d=$("#previewAttachment");attachmentListPreview(_26d,_26b);$("#AttachmentPreviewCont").show();}else{$("#AttachmentPreviewCont").hide();}}$("#addForumPostForm").hide();$("#writeNewTopic").hide();$("#publishPreviewedTopic").show();$("#backToEditor").show();var _26e=$("#preview_Posts").show();$("#writePostButtons").hide();var _26f=$("#TopicContentHolder").attr("class");var _270=$("#topicTypePreview").attr("class");var _271=_270.split(" ");$("#topicTypePreview").removeClass(_271[1]).addClass(_26f);if(_26e.is(":visible")){$("#preview_postHeader").find("a[purpose=\"authorProfile\"]").html(_261);$("#previewDocumentTitle").html(_266);$("#preview_postHeader").find("a[purpose=\"forum_Topic\"]").html($("#SelectForum option:selected").text());var _272=$("#SelectCategory option:selected").text();if(_272!="Uncategorised"){$("#preview_postHeader").find("a[purpose=\"category_Topic\"]").html("&nbsp;&raquo; "+_272+"");}_26a=_26a.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");if(_26a==""){$("#forumTagsPreview").append("No tags available for this topic.");}var _273=_26a.split(",");for(var _274=0;_274<_273.length;_274++){if(jQuery.trim(_273[_274])!=""){$("#forumTagsPreview").append("<li><div class=\"imgTag flLeft\"></div><div class=\"flLeft\">&nbsp;<a class=\"blueLink\" >"+_273[_274]+"</a>&nbsp;</div><div class=\"clearAll\"></div> </li>");}}var _267=$("#postContentTA").data("editor").val();_267=_267.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_267==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");return;}_26e.find("#responsePreviewContentContainer").html(_267);}}function forHidingSmallLoadingImg(){var _275="";var cont="";if($("#newPostRightCont").length>0){_275=$("#newPostRightCont");}else{if($("#attachBrowseCont").length>0){_275=$("#attachBrowseCont");}}_275.find("[purpose='attachLoadingCont']").hide();}function processSearchContClick(_277){var _278=$(_277.target);var _279=_278.parent();if($("#loadingImg").is(":visible")){return;}if(_279.is("div[purpose=\"advanceSearch\"]")){$("#advanceSearchContainerForm").show();$("#normalSearchInSearchList").hide();}else{if(_278.is("button[purpose=\"advanceSearchCancel\"]")||_278.is("div[purpose=\"advanceSearchCancel\"]")){if($("#advancedSearchForm").is(":visible")){$("#advancedSearchForm").remove();}else{$("#advanceSearchContainerForm").hide();$("#normalSearchContainer").show();$("#normalSearchInSearchList").show();}}else{if(_278.is("button[purpose=\"normalSearch\"]")){var _27a=$("#normalSearchInputBox").val();processHash("search/"+_27a);}else{if(_278.is("button[purpose=\"getAdvanceSearch\"]")){getAdvanceSearchResult();}else{if(_278.is("a[purpose=\"postTitle\"]")){var _27b=_278.attr("forumTopicId");var _27a=_278.attr("searchFor");openSinglePost(_27b,"topic",_27a);return;}else{if(_279.is("a[purpose=\"postTitle\"]")){var _27b=_279.attr("forumTopicId");var _27a=_279.attr("searchFor");openSinglePost(_27b,"topic",_27a);return;}else{if(_278.is("a[purpose=\"forumAction\"]")||_278.is("a[purpose=\"categoryAction\"]")){var _27c=_278.attr("hashPurpose");processHash(_27c);}else{if(_278.is("a[purpose=\"authorProfile\"]")||_279.is("a[purpose=\"authorProfile\"]")){var _27d=_278.attr("authorName");if(!_27d){_27d=_279.attr("authorName");}var _27e=_278.attr("singleClickflag");if(!_27e){_27e=_279.attr("singleClickflag");}if(_27e=="0"){if(_27d==ZU_Name){processHash("MyArea");_278.attr("singleClickflag","1");}else{processHash("User/"+_27d);_278.attr("singleClickflag","1");}}return;}else{if(_278.is("li.navBtnEnabled")&&_278.is("[navType=\"searchNav\"]")){var _27f=_278.attr("purpose");searchNavigation(_279,_27f);return;}else{if(_278.is("a[purpose=\"relativeLinkSearch\"]")){searchNavigation(_278,"relativeLinkSearch");}else{if(_278.is("a[purpose=\"sortbyrelevance\"]")&&!_278.is(".boldText")){searchNavigation($("#breadCrumbForSearch a[fieldType=\"All\"]"),"breadCrumbForSearch","relevance");}else{if(_278.is("a[purpose=\"sortbydate\"]")&&!_278.is(".boldText")){searchNavigation($("#breadCrumbForSearch a[fieldType=\"All\"]"),"breadCrumbForSearch","date");}else{if(_278.is("a[purpose=\"breadCrumbForSearch\"]")){searchNavigation(_278,"breadCrumbForSearch");}else{if(_278.is("a[purpose=\"expandForumList\"]")){var _280=_278.attr("status");if(_280=="off"){_278.attr("status","on").html("&laquo; less");_278.parents("ul").find("li").show();}else{_278.attr("status","off").html("more &raquo;");var _281=0;_278.parents("ul").children("li").each(function(){if(_281>4){$(this).hide();}_281++;});}}}}}}}}}}}}}}}}function searchNavigation(_282,_283,_284){showLoadingImage();var _285=parseInt(_282.attr("fetchPage"));var _286=_282.attr("fieldType");var _287=_282.attr("categId");var _288=_282.attr("pathTraverse");var _289=$("#breadCrumbForSearch");if(_283=="next"){_285=_285+1;}else{if(_283=="prev"){_285=_285-1;}else{_285=1;}}var _28a=_284;if(_28a!="relevance"&&_28a!="date"){_28a=$("#currSearchSortBy").attr("currSortBy");}if($("#searchListContainer").is(".selected")){doAjaxAction("/getMoreSearchResult.do?fetchPage="+_285+"&searchSortBy="+_28a+"&category_id="+_287+"&category_pathTraverse="+_288+"",$("#advanceSearchForm").serialize(),function(data){hideLoadingImage();reloadeSearchContainer(data,_283,_286,_28c,_287,_288,_28a);});}else{var _28d={};_28d.fetchPage=_285;_28d.category_id=_287;_28d.category_pathTraverse=_288;_28d.searchSortBy=_28a;var _28c=_282.attr("forumId");if(!_28c){_28c=-1;}if(_283=="breadCrumbForSearch"){_28d.searchFor=_289.attr("searchFor");}else{_28d.searchFor=_282.attr("searchFor");}_28d.forumGroupId=forumGroupId;_28d.forumId=_28c;_28d.normalSearchType=$("#searchSelectedImage").attr("purpose");doAjaxAction("/getMoreSearchResult.do",_28d,function(data){hideLoadingImage();reloadeSearchContainer(data,_283,_286,_28c,_287,_288,_28a);});}}function reloadeSearchContainer(data,_290,_291,_292,_293,_294,_295){var _296=$("#breadCrumbForSearch");var _297=$("<div></div>");_297.get(0).innerHTML=data;var _298=_297.find("#searchListContainer").html();$("#searchListContainer").html(_298);var _299=_297.find("#searchResultViewRange").html();$("#searchResultViewRange").html(_299);var _29a=_297.find("#searchFilterArea").html();$("#searchFilterArea").html(_29a);var _29b=_297.find("#currSearchSortBy").html();$("#currSearchSortBy").html(_29b).attr("currSortBy",_295);if(_290=="relativeLinkSearch"){var _29c=$("<span> &raquo; <a class=underline href=javaScript:; purpose=breadCrumbForSearch fieldType="+_291+" forumId="+_292+" categId="+_293+" pathTraverse="+_294+">"+_291+"</a></span>");_29c.insertAfter($("#breadCrumbForSearch").find("span:last"));}else{if(_290=="breadCrumbForSearch"){var _29d=0;_296.children().each(function(){var _29e=$(this);var _29f=_29e.find("a").attr("fieldType");if(_29d==1){_29e.remove();}if(_29f==_291){_29d=1;}});}}}function getAdvanceSearchResult(){showLoadingImage();var _2a0=$("#advanceSearchInpurBox").val();_2a0=$.trim(_2a0);if(_2a0==""){showMessage(i18n["zohodiscussions.searchList.noSearchString"],"failure");hideLoadingImage();return;}var _2a1=$("#SearchforumCategoryVice");var _2a2="forumId";var _2a3={};doAjaxAction("/getAdvanceSearchResult.do",$("#advanceSearchForm").serialize(),function(data){hideLoadingImage();var _2a5=$("<div></div>");_2a5.get(0).innerHTML=data;var _2a6=$("#searchContainer");if($("#searchListContainer").is(":visible")){var _2a7=_2a5.find("#searchResultFullContainer").html();$("#searchResultFullContainer").html(_2a7);$("#searchListContainer").addClass("selected");}else{$("#mainContent").get(0).innerHTML=data;bindSearchContentClick($("#mainContent"));$("#advanceSearchContainerForm").show();$("#normalSearchInSearchList").hide();}},function(_2a8){hideLoadingImage();$("#mainContent").html(_2a8.responseText);});}function processWidgetsContClick(_2a9){var _2aa=$(_2a9.target);var _2ab=_2aa.parent();if(_2aa.is("a[hashPurpose]")&&_2aa.is("a[currpurpose=\"usingHash\"]")){var hash=_2aa.attr("hashPurpose");if(isTopicQuickView=="false"&&hash.indexOf("Topic/")==0){}else{processHash(hash);return false;}}else{if(_2aa.is("div.teeplus")){var _2ad=_2aa.attr("forumId");var _2ae=$("#allForumControl").find("div[purpose=\"subForumView_"+_2ad+"\"]");_2ae.removeClass("teeplus").addClass("teeminus");$("ul.eachCategoryContainer_"+_2ad).show();}else{if(_2aa.is("div.teeminus")){var _2ad=_2aa.attr("forumId");var _2ae=$("#allForumControl").find("div[purpose=\"subForumView_"+_2ad+"\"]");_2ae.removeClass("teeminus").addClass("teeplus");$("ul.eachCategoryContainer_"+_2ad).hide();}else{if(_2ab.is("#forumPermalink")){var _2af=_2ab.attr("thisForumPermalink");$("#PermalinkCont textarea").val(_2af);$("#permalink_Text").select();$("#PermalinkCont").show().parent().show();return;}else{if(_2ab.is("li.watchingForum")){watchThisItem(_2ab,"singleForumActions",_2a9);}else{if(_2ab.is("li.watchingCategory")){watchThisItem(_2ab,"singleCategoryActions",_2a9);}else{if(_2aa.is("a[purpose=\"newWatchedUser\"]")){processHash("myarea/dashboard");return;}else{if(_2aa.is("a[purpose=\"newPrivateMsg\"]")){processHash("myarea/privateMsg");return;}else{if(_2aa.is("a[purpose=\"newRecentActivity\"]")){var _2b0=_2aa.attr("currStatus");if(_2b0=="dashboard"){processHash("myarea/"+_2b0);return;}processHash("myarea/watchList/"+_2b0);return;}else{if(_2aa.is("a[purpose=\"authorProfile\"]")){var _2b1=_2aa.attr("authorName");var _2b2=_2aa.attr("singleClickflag");if(_2b2=="0"){if(_2b1==ZU_Name){processHash("MyArea");_2aa.attr("singleClickflag","1");}else{processHash("User/"+_2b1);_2aa.attr("singleClickflag","1");}}return;}else{if(_2ab.is("#loginToParticipate")){$("#signinwidgetBox").hide();$("#iamLoginBox").show();}else{if(_2ab.is("#chartMenu")){if(_2aa.is("li")){_2aa.siblings().removeClass("selected");_2aa.addClass("selected");var _2b3=_2aa.attr("assocImage");$(_2b3).show().siblings().hide();}}else{if(_2ab.is("#topContributorsMenu")){if(_2aa.is("li")){_2aa.siblings().removeClass("selected");_2aa.addClass("selected");var _2b3=_2aa.attr("assocDiv");$(_2b3).show().siblings("ul").hide();}}}}}}}}}}}}}}}function processAllForumsClick(_2b4){var _2b5=$(_2b4.target);var _2b6=_2b5.parent();if(_2b5.is("a[hashPurpose]")){var _2b7=_2b5.attr("hashPurpose");if((isTopicQuickView=="false"&&_2b7.indexOf("Topic/")==0)||_2b5.attr("isNiceUrl")=="Yes"){}else{processHash(_2b7);return false;}}else{if(_2b6.is("li[purpose=\"eachForumPermalink\"]")){var _2b8=_2b6.attr("thisForumPermalink");$("#PermalinkCont textarea").val(_2b8);$("#permalink_Text").select();$("#PermalinkCont").show().parent().show();return;}else{if(_2b6.is("li.watchingForum")){watchThisItem(_2b6,"singleForumActions",_2b4);}}}}function handleTopicClick(_2b9,_2ba,_2bb){var _2bc=$("#eachTopic_"+_2ba);var _2bd=$("#lastResponse_"+_2ba);var _2be=_2bd.parents("div[parentCont=\"actualParent\"]").attr("recentResponseId");var _2bf=$("#topicList");_2bf.data("currentSelectedPost",_2bc);var _2c0=_2bf.data("currentFocusPost");if(_2c0!=undefined){_2c0.removeClass("hotKeyTopicCont");}_2bf.data("currentFocusPost",_2bc);if(_2bd.is(":visible")==true){_2bc.removeClass("singleTopicContSel").addClass("singleTopicCont");}else{_2bc.siblings("div.singleTopicContSel").removeClass("singleTopicContSel").addClass("singleTopicCont");_2bc.removeClass("singleTopicCont").addClass("singleTopicContSel");if(topicContent[_2ba]){$("#recentResponseContent_"+_2be).html(topicContent[_2ba]);topicContent[_2ba]=undefined;}setFocusToContainer($("#eachTopic_"+_2ba),false,0);}if(_2bd.attr("navStatus")=="No"&&_2bb=="topicList"){_2bd.attr("navStatus","Yes");getprevAndFirstPost(_2bd);}}function getMoreTopics(_2c1,_2c2,_2c3,_2c4,_2c5,_2c6,_2c7){showLoadingImage();var _2c8={};var _2c9="";var _2ca=$("#innerTabFilter");if($("#topicListFilter").is(":visible")){_2ca=$("#topicListFilter");}if(_2c1!=""){_2c8.forumURL=_2c1;_2c9="forum/"+_2c1;}if(_2c2!=""){_2c8.categoryURL=_2c2;_2c9=_2c9+"/"+_2c2;}_2c8.forumGroupId=forumGroupId;_2c8.fetchPage=_2c3;var _2cb=0;if(_2c4&&_2c4.toLowerCase()!="all"&&(isOneTopicType!="true"||_2c4.toLowerCase()!="questions"&&_2c4.toLowerCase()!="ideas"&&_2c4.toLowerCase()!="problems")){if(_2c9==""){_2c9="filter";}else{_2c9=_2c9+"/filter";}_2cb=1;_2c9=_2c9+"/"+_2c4;}if(_2c4){if(_2ca.attr("isTypeURL")=="yes"){var _2cc=_2ca.attr("topicfiltertype");if(_2c4.toLowerCase()=="all"){_2c4=_2cc;}else{if(_2c4.toLowerCase()=="unrepliedposts"){_2c8.unReplyWithType=_2cc;}}}_2c8.topicFilter=_2c4;}if(_2c4=="postssincelastvisit"){var _2cd=_2ca.attr("postSinceLastVisitTime");if(_2cd!=null&&_2cd!="undefined"){_2c8.postSinceLastVisitTime=_2cd;}}var _2ce="";var _2cf="";if($("#topicList").length>0&&_2c7!="reload"){_2ce="/getMoreTopics.do";$locadLocation=$("#topicList");}else{if($("#topicsList").length>0&&_2c7!="reload"){_2ce="/getMoreTopicsTP.do";$locadLocation=$("#topicsList");}else{_2ce="/getSingleForumTopics.do";$locadLocation=$("#mainContent");}}if(_2c6){if(_2c7=="true"){_2c8.topicStatus=_2c6;}else{_2c6=_2c6.toLowerCase();_2c6=_2c6.replace(/\s/ig,"").replace("-","");var _2d0=_2c6;if(_2c4=="problems"&&_2c6=="needmoreinfo"){_2c6="moreinfo";_2d0="needmoreinfo";}if(_2c4=="questions"&&_2c6=="workingonit"){_2c6="working";_2d0="workingonit";}if(_2c6=="we"){_2c6="wewillthinkaboutit";_2d0=_2c6;}if(i18n_Status_[_2c6]){var _2d1=i18n_Status_[_2c6];if(_2d1){if(_2cb==0&&_2c9==""){_2c9="filter";}else{if(_2cb==0){_2c9=_2c9+"/filter";}}_2c9=_2c9+"/"+_2d0;_2c8.statusURL=_2d1;}}}}doAjaxAction(_2ce,_2c8,function(data){$locadLocation.get(0).innerHTML=data;bindTopicClicks($("#topicList"));bindTopicClicks($("#topicsList"));if(_2ce="/getSingleForumTopics.do"){lightBox("#chartWidget");bindTopicListHeaderClicks($("#topicListHeader"));bindWidgetsContClick($("#topicListWidgetsCont"));}goToTop();hideLoadingImage();if(typeof WmsContacts!="undefined"&&ch==true){var _2d3=WmsContacts.getZohoContacts();setPresenceInTopicList(_2d3);}if(_2c4=="PostsSinceLastVisit"){var _2d4=$("#topicList").find("a.mediumUnderlineLink");_2d4.removeClass("mediumUnderlineLink").addClass("mediumUnderlineLinkNew");}if(_2ca.attr("isTypeURL")=="no"){if(_2c9!=""){if(parseInt(_2c3)>1){$.history.add(_2c9+"/"+_2c3);}else{$.history.add(_2c9);}}else{if(parseInt(_2c3)>1){$.history.add("home/"+_2c3);}else{$.history.add("home");}}}},function(_2d5){});return false;}function getMoreTagRelatedPost(_2d6,_2d7,_2d8){showLoadingImage();var _2d9={};_2d9.fetchPage=_2d6;_2d9.tagName=_2d7;_2d9.forumGroupId=forumGroupId;_2d9.getPostFor=_2d8;doAjaxAction("/getMoreTagRelatedPosts.do",_2d9,function(data){if($("#topicList").length>0){$("#topicList").get(0).innerHTML=data;bindTopicClicks($("#topicList"));}else{$("#topicsList").get(0).innerHTML=data;bindTopicClicks($("#topicsList"));}goToTop();hideLoadingImage();},function(_2db){});return false;}function getSingleForumTopics(_2dc){showLoadingImage();var _2dd=_2dc;var _2de={};_2de.forumId=_2dd.attr("forumId");_2de.categoryId=_2dd.attr("categoryId");_2de.forumGroupId=forumGroupId;_2de.fetchPage=_2dd.attr("fetchPage");_2de.ch=ch;doAjaxAction("/getSingleForumTopics.do",_2de,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(_2e0){$("#mainContent").get(0).innerHTML=_2e0.responseText;hideLoadingImage();});return false;}function bindTopContainerClick(){var _2e1=$("#switchPortalLink");var _2e2=$("#portalsDropDown,#borderPortal");var _2e3=$("#portalComboCont");_2e1.click(function(){if(_2e2.is(":visible")){_2e2.hide();_2e3.removeClass("newComboSelected").addClass("newCombo");}else{_2e2.show();_2e3.removeClass("newCombo").addClass("newComboSelected");}});_2e2.hover(function(){var _2e4=_2e2.data("destroyHandle");if(_2e4){clearTimeout(_2e4);}},function(){var _2e5=setTimeout(function(){_2e2.hide();_2e3.removeClass("newComboSelected").addClass("newCombo");},500);_2e2.data("destroyHandle",_2e5);});$("#portalsDropDown li").click(function(){$("#portalsDropDown").hide();var _2e6=$(this);var _2e7=_2e6.attr("thisPoratlUrl");if(_2e7!=currentForumGroupURL){$("#dimDivContainer").show();location.href=defaultDomain+"/"+_2e7;return false;}});}function selectTopicType(_2e8){_2e8.addClass("selected").siblings("li[purpose=\"topicTypeTab\"]").removeClass("selected");var _2e9=_2e8.attr("topicType");if(_2e9==1){$("#announcementExpiryCont").show();}else{$("#announcementExpiryCont").hide();}$("#currentTopicType").val(_2e9);var _2ea=_2e8.attr("topicIconClass");if(_2ea=="discuss"){$("#writeNewTopic").html(i18n["zohodiscussions.writePost.discussionTypeMessage"]);}else{if(_2ea=="question"){$("#writeNewTopic").html(i18n["zohodiscussions.writePost.questionTypeMessage"]);}else{if(_2ea=="idea"){$("#writeNewTopic").html(i18n["zohodiscussions.writePost.ideaTypeMessage"]);}else{if(_2ea=="error"){$("#writeNewTopic").html(i18n["zohodiscussions.writePost.problemTypeMessage"]);}else{$("#writeNewTopic").html(i18n["zohodiscussions.writePost.announcementTypeMessage"]);}}}}$("#TopicContentHolder").attr("class",_2ea);var _2eb=$("#SelectForum").val();if(_2eb==null){$("#selectForumMessage").show();}else{$("#selectForumMessage").hide();}}function initWritePost(){openEditor($("#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 _2ec=$(this);var _2ed=_2ec.attr("isDraft");var _2ee=_2ec.attr("userName");writePostPreview(_2ee,"Preview","true",_2ed);});$("#attachmentsListCont").find("div.imgAshDelete").click(function(_2ef){$this=$(this);var _2f0=$this.attr("attachmentName");var _2f1=$this.attr("attachmentId");deleteUnpublishedAttachment(_2f0,_2f1,_2ef);return;});$("#listOfMyDraftCont").click(function(){var _2f2=$(this).attr("draftsize");if(_2f2<1){return;}var _2f3=$(this);if(_2f3.is(".moreOptionsTop")){_2f3.removeClass("moreOptionsTop").addClass("moreOptionsTopSelected");}else{_2f3.removeClass("moreOptionsTopSelected").addClass("moreOptionsTop");}_2f3.hover(function(){var _2f4=_2f3.data("destroyHandle");if(_2f4){clearTimeout(_2f4);}},function(){var _2f5=setTimeout(function(){_2f3.removeClass("moreOptionsTopSelected").addClass("moreOptionsTop");},500);_2f3.data("destroyHandle",_2f5);});});$("#saveDraft").click(function(){addForumPost(true);});$("#cancelAddTopic").click(function(){$("#mainContent div.mainFullWrite").html("");processHash("Home");});loadUploadAttachmentsCont();}function loadUploadAttachmentsCont(){var _2f6=($("#attachTemplate").length==1)?true:false;var _2f7=(_2f6==true)?"attachTemplate":"responseAttachTemplate";var _2f8=$("#attachmentsListCont");var _2f9=_2f8.find("div.singleElementBox,li.tinyText").length;if(_2f6==true){$("#newPostRightCont  div[purpose=\"attachmentTemplate\"]").remove();}else{$("#attachBrowseCont").html("");}if(_2f9<maxAttachmentsPerPost){var _2fa=_2f9+1;var _2fb=$("#"+_2f7);var _2fc=_2fb.clone();if(_2f6==true){_2fc.insertBefore(_2f8).show();}else{$("#attachBrowseCont").append(_2fc.show()).show();}_2fc.attr("id",_2f7+"_"+_2fa);_2fc.attr("purpose","attachmentTemplate");_2fc.find("div.dataEncloser").wrap("<form action = \"/uploadFile.do\" target = \"fileUpdTgt\" method=\"post\" enctype=\"multipart/form-data\"></form>");_2fc.find("div.iFrameContainer").html("<iframe name = \"fileUpdTgt_"+_2fa+"\"> </iframe>");_2fc.find("form").attr("target","fileUpdTgt_"+_2fa);_2fc.find(":file").change(function(){_2fc.find("[purpose=\"attachLoadingCont\"]").show();_2fc.find(":input[name=\"attacher\"]").val("");_2fc.find("form").get(0).submit();});}}function uploadFileSuccess(_2fd,_2fe,_2ff,_300,_301){var _302=$("#attachmentsListCont");var _303=($("#attachTemplate").length==1)?true:false;var _304;var _305=_2fd+","+_2fe+","+_301;if(_303==true){_304=$("<div id=\"newAttachment_"+_2fd+"\" class=\"singleElementBox\" attachmentDetails=\""+_305+"\"><div class=\"flLeft\">"+_2fe+"</div><div class=\"flRight imgAshDelete bgBox\"></div></div>");var _306=$("#previewAttachment");var _307=$("<li class=\"singleList\" id=\"eachAttachmentForPreview_"+_2fd+"\"  attachmentDetails=\""+_305+"\"><div class=\"flLeft iconCont\"><div class=\"attachIcon imgAttachmentTh\"></div></div>  <ul class=\"ulNoStyle detailsListNew\"> <li class=\"header\"> <a>"+_2fe+"</a> </li> <li class=\"forumDetailsList\"> <span>Size:"+_301+"</span></li></ul></li>");_306.append(_307);$("#newAttachment_"+_2fd).attr("attachmentDetails",_305);$("#AttachmentPreviewCont").show();}else{_304=$("#responseEachAttachmentTemplate").clone();_304.attr("id","newAttachment_"+_2fd).attr("attachmentDetails",_305).show();_304.find("[attachmentPurpose=\"attachmentName\"]").html(_2fe);_304.find("[attachmentPurpose=\"attachmentSize\"]").html(_301);}$("#previewResponse").append("<input type = \"hidden\" name=\"attachmentId\" value = \""+_2fd+"\"  attachmentDetails= \""+_305+"\">");_304.append("<input type = \"hidden\" name=\"attachmentId\" value = \""+_2fd+"\">");if(_300!="-1"){_304.append("<input type = \"hidden\" name=\"attachmentId\" value = \""+_300+"\">");}_304.find("div.imgAshDelete").click(function(_308){deleteUnpublishedAttachment(_2fe,_2fd,_308);});_302.append(_304);loadUploadAttachmentsCont();}function deleteUnpublishedAttachment(_309,_30a,_30b){if(confirm(i18n["zohodiscussions.generalmessage.deleteAttachmentConfirmMsg"])){showSmallLoadingImage(_30b);var _30c={};_30c.forumGroupId=forumGroupId;_30c.fileName=_309;_30c.fileId=_30a;_30c[csrfParamName]=csrfToken;doAjaxAction("/deleteUnpublishedAttachment.do",_30c,function(data){hideLoadingImage();if(data=="SUCCESS"){$("#newAttachment_"+_30a).remove();if($("#previewAttachment").find("li.singleList").length==1){$("#AttachmentPreviewCont").hide();}$("#previewResponse").find("input[value= \""+_30a+"\"]").remove();showTipper(i18n["zohodiscussions.generalmessage.deleteAttachmentSuccessMsg"],"info");loadUploadAttachmentsCont();}});}}function loadCategories(){loadAdminActionsLinks();var _30e=$("#SelectForum");var _30f=_30e.val();var _310=_30e.attr("selectedCategoryName");var _311=_30e.attr("selectedCategoryId");var _312=$("#categoryList").val().split("$$");$("#SelectCategory").hide();$("#selectCategory").html("");$.each(_312,function(_313,item){if(item.indexOf(_30f+":")>-1){$("#SelectCategory").html(item.split(":")[1]).show();return false;}else{$("#SelectCategory").html("<option selected value=\"-1\">Uncategorised</option>").show();}});var _315=$("#SelectCategory").find("option[value=\""+_311+"\"]");if(_315.length==1){_315.attr("selected","true");}else{$("#SelectCategory option:first").attr("selected","true");}}function loadAdminActionsLinks(){var _316=$("#SelectForum option:selected").attr("isForumModerator");if(_316=="true"){$("#isStickyLinkCont,#announcementLinkCont").fadeIn();}else{$("#isStickyLinkCont,#announcementLinkCont").fadeOut();if($("#writepostTabsCont li.selected").attr("topicIconClass")=="announcement"){$("#writepostTabsCont li:first").trigger("click");}}}function addForumPost(_317){if($("#fileUploadStatus").val()!="uploading"){var _318=(_317==true)?i18n["zohodiscussions.general.saving"]:i18n["zohodiscussions.general.publishing"];disablePostButtons();var _319=$("#addForumPostForm");$topicTitle=$("#topicTitle");var _31a=$topicTitle.val();_31a=_31a.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");_31a=$.trim(_31a);if(_31a==""){hideLoadingImage();setFocusToContainer($("#topicTitle"));enablePostButtons();showMessage(i18n["zohodiscussions.writePost.TopicTitleCannotbeEmptymessage"],"failure");$("#topicTitle").focus();return;}$("#topicTitle").val(_31a);if(_31a.length>200){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.TopicTitleLengthMsg"],"failure");enablePostButtons();return;}var _31b=$("#forumTags").val();_31b=_31b.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");if(_31b!=""){if(_31b.match(/^[^()~`!@#$%&:;\/?|<>{}[\]*-+=]+$/)==null){hideLoadingImage();showMessage(i18n["zohodiscussions.singlepost.specialCharacterNotAllowedMsg"],"failure");enablePostButtons();return;}}var tag=_31b.split(",");for(var i=0;i<tag.length;i++){if(tag[i].length>50){showTipper(i18n["zohodiscussions.singlepost.TagexceedMessage"],"failure");enablePostButtons();return;}}var _31e=$("#postContentTA").data("editor").val();_31e=_31e.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");$("#postContentTA").val(_31e);var _31f=$("<div></div>").html(_31e);_31e=_31f.text();_31e=$.trim(_31e);if(_31e==""){setFocusToContainer(($("#editorHolder")).focus());hideLoadingImage();enablePostButtons();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");return;}if(_317==true){$("#topicStatus").val(1);}else{$("#topicStatus").val(0);}var _320=$("#SelectForum").val();if(_320==null){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.selectAnyForum"],"failure");enablePostButtons();return;}var _321="/addForumPost.do";if(ZUID==-1){_321="/addGuestForumPost.do";}showLoadingImage(_318);doAjaxAction(_321,$("#addForumPostForm").serialize(),function(data){hideLoadingImage();var _323=eval(data);if(_323.result=="success"){var _324=_323.value;if(_317==true){showTipper(i18n["zohodiscussions.writePost.saveDraftMsg"],"success",3000);enablePostButtons();$("#forumTopicId").val(_324);}else{if(_323.isApproved==0){$("#mainContent div.mainFullWrite").html("");showMessage(i18n["zohodiscussions.writePost.topicAwaitingModeration"],"info");if(isTopicQuickView=="false"){window.location.href=serverURL+"/topic/"+_323.topicPermaLink;}else{showLoadingImage();openSinglePost(_324);}return;}else{$("#mainContent div.mainFullWrite").html("");showTipper(i18n["zohodiscussions.writePost.publishMsg"],"success",4000);if(isTopicQuickView=="false"){window.location.href=serverURL+"/topic/"+_323.topicPermaLink;}else{showLoadingImage();openSinglePost(_323.value);}}}}else{showMessage(_323.reason,"failure");if(_323.errorcode=="IMAGE_CODE_MANDATORY"||_323.errorcode=="INVALID_IMAGE_CODE"){var _325=new Date();}enablePostButtons();}},function(_326){hideLoadingImage();if(_326.responseText.indexOf("'result':'failure'")>0){var _327=eval(_326.responseText);if(_327.result=="failure"){if(_327.errorcode=="HIP_REQUIRED"){var _328=$("#writePostCaptcha");if(_328.attr("currCaptcha")=="new"){showMessage(i18n["zohodiscussions.writePost.captchaMsg"],"failure");}else{showMessage(i18n["zohodiscussions.writePost.captchaErrorMsg"],"failure");}_328.find("img[purpose=\"captchaImage\"]").replaceWith("<img purpose=captchaImage name=hipImg border=0 src=/showcaptcha?digest="+_327.reason+" align=absmiddle alt=HIP image>");$("#captchaCode").attr("name",_327.reason);_328.attr("currCaptcha","old");_328.show();}else{showMessage(_327.reason,"failure");}}}else{$("#writepostCont").get(0).innerHTML=_326.responseText;}enablePostButtons();});}else{$("#submitStat").show();}}function singlePostDeleteAction(_329,_32a){var _32b=_329.attr("forumTopicId");_32b=_32b||_329.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _32c=_329.attr("responseId");var _32d=_329.attr("categoryId");_32d=_32d||_329.parents("div[parentCont=\"actualParent\"]").attr("categoryId");var _32e=_329.parents("div[parentCont=\"actualParent\"]").attr("responseAuthorId");var _32f=_329.attr("forumId");_32f=_32f||_329.parents("div[parentCont=\"actualParent\"]").attr("forumId");var _330=_329.attr("itemType");if(_330!="post"){if(confirm(i18n["zohodiscussions.singlePost.messagefordeletingResponse"])){var _331={};if(_32e==ZUID){_331.responseowner="true";}_331.forumGroupId=forumGroupId;_331.forumTopicId=_32b;_331.categoryId=_32d;_331.forumId=_32f;_331.responseId=_32c;_331[csrfParamName]=csrfToken;doAjaxAction("/deleteForumResponse.do",_331,function(data){if((data)=="SUCCESS"){showTipper(i18n["zohodiscussions.generalmessage.responseMovedToTrash"],"info",2000);if(_32a=="moderation"){var _333=$("#moderationTabCont").find("li.selected").attr("tabPurpose");refreshingPage(_333);}else{refreshSingleTopic(_32b);}}});}}else{if(confirm(i18n["zohodiscussions.singlePost.messagefordeletingTopic"])){var _334={};if(_32e==ZUID){_334.access="author";}_334.forumGroupId=forumGroupId;_334.forumTopicId=_32b;_334.categoryId=_32d;_334.forumId=_32f;_334[csrfParamName]=csrfToken;doAjaxAction("/deleteTopic.do",_334,function(data){if((data)=="SUCCESS"){showTipper(i18n["zohodiscussions.generalmessage.topicMovedToTrash"],"info",2000);if(_32a=="moderation"){var _336=$("#moderationTabCont").find("li.selected").attr("tabPurpose");refreshingPage(_336);}else{refreshSingleTopic(_32b);}}});}}}function refreshSingleTopic(_337){var _338=$("#topicList");if(_338.length<1){_338=$("#topicsList");}var _339={};_339.forumTopicId=_337;_339.forumGroupId=forumGroupId;_339.singleTopicRefresh="singleTopicRefresh";var _33a=$("#eachTopic_"+_337);doAjaxAction("/refreshSingleTopic.do",_339,function(data){hideLoadingImage();$data=$("<div></div>").html(data);if($data.find("div.singleTopicCont").length<1){_33a.remove();return false;}var _33c=$data.find("div.singleTopicCont").attr("modifiedtime");var _33d=_338.find("div.singleTopicCont:last").attr("modifiedtime");var _33e=_338.find("div.singleTopicCont:first");var _33f=_33e.attr("modifiedtime");var _340=false;if(_33c<_33d){_33a.remove();}else{if(_33c>_33f){$data.insertBefore(_33e);_33a.remove();eval($data.find("script").html());_340=true;}else{$data.insertBefore(_33a);_33a.remove();eval($data.find("script").html());_340=true;}}if(_340==true){goToTop();}});}function disablePostButtons(){$("#publishTopic").attr("disabled",true);$("#saveDraft").attr("disabled",true);}function enablePostButtons(){$("#publishTopic").attr("disabled",false);$("#saveDraft").attr("disabled",false);}function getprevAndFirstPost(_341){var _342=_341.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _343={};_343.forumGroupId=forumGroupId;_343.forumTopicId=_342;var _344=_341.attr("recentResponseId");if(typeof _344!="undefined"){_343.responseId=_344;_343.modifiedTime=_341.attr("modifiedTime");_343.currResponseCount=_341.attr("currResponseCount");}else{var _345=_341.parents("div.listOfResponseLink");_343.responseId=_345.attr("responseId");_343.modifiedTime=_345.attr("modifiedTime");_343.currResponseCount=_345.attr("currResponseCount");}_343.toProvide="First";_343.currStage="1";doAjaxAction("/getResponse.do",_343,function(data){var _347=$(data);var _348=$("#recent_ResPonse_"+_344);if($("#lastResponse_"+_342).find("div.listOfResponseLink[prev=\"-1\"]").length<1){_347.insertAfter(_348);_348.next("div.listOfResponseLink").attr("Prev","-1");}var _349=$("#navigationLoading_"+_344);if(_349.attr("currRequest")=="first"){_349.remove();_348.hide();$("#navCont_"+_344+",#navCont_1_"+_344).removeClass("navLoading");firstOrLastResponse($("#navCont_"+_344).find("li.imgNavStart"));}else{provideResponse(_341);}return;});}function provideResponse(_34a){var _34b=_34a.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _34c=_34a.attr("recentResponseId");var _34d=_34a.attr("toProvide");var _34e={};_34e.forumGroupId=forumGroupId;_34e.forumTopicId=_34b;_34e.toProvide=_34d;if(typeof _34c!="undefined"){_34e.modifiedTime=_34a.attr("modifiedTime");_34e.currResponseCount=_34a.attr("currResponseCount");_34e.currStage=_34a.attr("currResponsestage");}else{var _34f=_34a.parents("div.listOfResponseLink");_34c=_34f.attr("responseId");_34e.modifiedTime=_34f.attr("modifiedTime");_34e.currResponseCount=_34f.attr("currResponseCount");_34e.currStage=_34f.attr("currResponsestage");}_34e.responseId=_34c;doAjaxAction("/getResponse.do",_34e,function(data){var _351=$("#recent_ResPonse_"+_34c);var _352=$("<div>"+data+"</div>");var _353=_352.find("div.listOfResponseLink").attr("responseId");var _354=$("#lastResponse_"+_34b).find("div.listOfResponseLink[responseId = \""+_353+"\"]");if(_354.length>0){if(_34d=="Prev"){_351.attr("Prev",_353);_354.attr("Next",_34c);}else{if(_34d=="Next"){_351.attr("Next",_353);_354.attr("Prev",_34c);}}}else{var _355=$(_352.html());if(_34d=="Prev"){_355.insertAfter(_351);var _356=_351.next("div.listOfResponseLink");_356.attr("Next",_34c);_351.attr("Prev",_353);}else{if(_34d=="Next"){_355.insertBefore(_351);var _356=_351.prev("div.listOfResponseLink");_356.attr("Prev",_34c);_351.attr("Next",_353);}}}var _357=$("#navigationLoading_"+_34c);if(_357.attr("currRequest")=="Prev"){_357.remove();_351.hide();checkPrevNextResponse($("#navCont_"+_34c).find("li.imgNavPrevious"));$("#navCont_"+_34c+",#navCont_1_"+_34c).removeClass("navLoading");}else{if(_357.attr("currRequest")=="Next"){_357.remove();_351.hide();checkPrevNextResponse($("#navCont_"+_34c).find("li.imgNavNext"));$("#navCont_"+_34c+",#navCont_1_"+_34c).removeClass("navLoading");}}});}function checkPrevNextResponse(_358){var _359=_358.parents("div.listOfResponseLink");var _35a=_359.attr("responseId");var _35b=_358.attr("toProvide");var _35c=_359.attr(_35b);if(_35c=="0"){var _35d=$("#navigationLoading").clone();_35d.attr("id","navigationLoading_"+_35a).attr("currRequest",_35b);var _35e=$("#navCont_"+_35a);_35d.insertAfter(_35e).show();$("#navCont_"+_35a+",#navCont_1_"+_35a).addClass("navLoading");provideResponse(_358);return;}else{var _35f=$("#recent_ResPonse_"+_35c);_359.hide();_35f.show();setFocusToContainer(_35f.parents(".singleTopicContSel"),false,0);if($("#navCont_"+_35c).is(".navLoading")){$("#navCont_"+_35a+",#navCont_1_"+_35a).removeClass("navLoading");}if(_35f.attr(_35b)=="0"){var _360=$("#navCont_"+_35c).find("li[toProvide=\""+_35b+"\"]");provideResponse(_360);}else{return;}}}function firstOrLastResponse(_361){var _362=_361.parents("div.listOfResponseLink");var _363=_361.attr("toProvide");var _364=_362.attr("responseId");var _365=_361.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _366=$("#lastResponse_"+_365);var _367=$("#recent_ResPonse_"+_364);if(_363=="First"){var _368=_366.find("div.listOfResponseLink[Prev=\"-1\"]");if(_368.length==0){var _369=$("#navigationLoading").clone();_369.attr("id","navigationLoading_"+_364).attr("currRequest","first");var _36a=$("#navCont_"+_364);_369.insertAfter(_36a).show();$("#navCont_"+_364+", #navCont_1_"+_364).addClass("navLoading");getprevAndFirstPost(_361);return;}_367.hide();_368.show();setFocusToContainer($("#eachTopic_"+_365),false,0);if($("#navCont_"+_364).is(".navLoading")){$("#navCont_"+_364+",#navCont_1_"+_364).removeClass("navLoading");}var _36b=_368.attr("responseId");if(_368.attr("Next")=="0"){var _36c=$("#navCont_"+_36b).find("li[toProvide=\"Next\"]");provideResponse(_36c);}}else{if(_363=="Last"){_367.hide();_366.find("div.listOfResponseLink[Next=\"-1\"]").show();setFocusToContainer($("#eachTopic_"+_365),false,0);}}}function lightBox(_36d){$(_36d+" 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 openSinglePost(_36f,_370,_371){_370=_370||"Topic";if(_371!=undefined){loadSinglePost(_36f,"true",undefined,_371);}else{loadSinglePost(_36f);}$.history.add(_370+"/"+_36f);}function loadSinglePost(_372,_373,_374,_375){var _376={};_376.forumTopicId=_372;_376.forumGroupId=forumGroupId;if(typeof _373=="undefined"){_373=true;}doAjaxAction("/getSinglePost.do",_376,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 _378=document.createElement("div");_378.innerHTML=data;$("#mainContent").get(0).appendChild(_378);}}else{$("#mainContent").get(0).innerHTML=data;}if(_373&&_373==true){$(window).scrollTop(0);}if(typeof _374!="undefined"){var _379=$(_374).offset().top;$("html,body").scrollTop(_379-100);}initSinglePost(_372);var _37a=$("#topicContainer_"+_372);var _37b=_37a.attr("forumId");var _37c=_37a.attr("categoryId");if(typeof _37b=="undefined"){_37b=-1;}if(typeof _37c=="undefined"){_37c=-1;}var _37d="NewTopic/"+_37b+"/"+_37c;$("#NewTopicTab").attr("hashPurpose",_37d);if(typeof WmsContacts!="undefined"&&ch==true){var _37e=WmsContacts.getZohoContacts();setPresenceInTopicList(_37e,_372);}if(_375!=undefined){setFocusToContainer($("#fullResponseContainer_"+_375),false,100,0);$("#SinglePostContainer").data("currentFocusResponse",$("#"+_375));}if(isMac=="false"){setHotkeysToSinglePost();}},function(_37f){hideLoadingImage();var _380=(_37f.responseText);$("#mainContent").get(0).innerHTML=_380;});}function initSinglePost(_381){showAuthorPopout($("#SinglePostContainer"));var _382=$("#DocumentTitle");document.title=(_382.length>0)?_382.text()+" - "+forumGroupName:forumGroupName;bindSingleTopicClicks($("#SinglePostContainer"));var _383=$("#topicContainer_"+_381);$("#topicContainer_"+_381).unbind("click",singlePostWidgetActions).click(singlePostWidgetActions);singlePostTagActions(_381);$("#mainContent").attr("process-pre-tags",_381);setTimeout(function(){processCodeTags($("#SinglePostContainer"),_381);},5);return false;}function showCode(_384){var _385=_384.parentNode.nextSibling.innerHTML;_385=_385.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(_385).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(_386,_387){if(!_387||!_386||_386.length<1){return;}var _388=$("#mainContent");var _389=_388.attr("process-pre-tags");if(_389!=_387){return;}var _38a=_386.find("ol.code");_38a.before(codeForPreview);}function bindSingleTopicClicks(_38b){_38b.unbind("click",processSingleTopicClicks).click(processSingleTopicClicks);}function processSingleTopicClicks(_38c){var _38d=$(_38c.target);var _38e=_38d.parent();var _38f="singlePost";var _390=$("#SinglePostContainer").attr("forumTopicId");var _391=$("#topicContainer_"+_390);var _392=$("#statusList");if($("#loadingImg").is(":visible")){return;}if(_38d.is("a[purpose=\"authorProfile\"]")){var _393=_38d.attr("authorName");var _394=_38d.attr("singleClickflag");if(_394=="0"){var _395=(_393==ZU_Name)?"MyArea":"User/"+_393;processHash(_395);}return;}else{if(_38e.is("#replyToTopicBtn_"+_390+",#replyToTopicBtnSec_"+_390+",#privateResponseThisTopic_"+_390)){_396=_38e;var _397=_396.attr("location");var _398=_396.attr("postauthor");var _399=_396.attr("topicTypeString");var _39a=$("#paginationContainer");if($("#topicListMainContainer").length>0&&$("#singlePostMainContainer").length>0&&_39a.data("inEditMode")){removeTopicListCache();}if($("#responsePreviewContainer").is(":visible")){$("#responsePreviewContainer").find("button[purpose=\"backToEditorResponse\"]").trigger("click");showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");var _39b=_391.data("editorContLocation");setFocusToContainer($(_39b),false);return;}var _39c="replyToTopicBtn";if(_38e.is("[purpose=\"privateResponse\"]")){_39c="privateResponseThisTopic";}var _39d="#newResponseCont_"+_390;if(_391.data("inEditMode")){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"]);$("#responsePreviewButton").find("button[purpose=\"backToEditorResponse\"]").trigger("click");var _39b=_391.data("editorContLocation");setFocusToContainer($(_39b),false);return false;}$(_39d).show();openEditor($("#newResponse_"+_390),"responseContent","postContentTA",_39c+"_"+_390,"Write","topicContainer_"+_390);setFocusToContainer($(_39d),false);_391.data("inEditMode",true);_391.data("editorContLocation",_39d);$("#previewResponse").attr("forumTopicId",_390);if($(this).is("[purpose=\"privateResponse\"]")){$("#newResponseCont_"+_390).find("div.header").html(i18n["zohodiscussions.singlePost.editorHeaderPrivateResponseTo"]+" "+_398+"");}return false;}else{if(_38d.is("#TopicListLink,#ForumTopicListLink,#CategoryTopicListLink")){_396=_38d;hashPurpose=_396.attr("hashPurpose");$("#topicListMainContainer").attr("shouldReload","true");processHash(hashPurpose);return false;}else{if(_38e.is("#topicVoteLink")){var _396=_38e;var _39e=_396.attr("firstResponseId");showSmallLoadingImage(_38c);doAjaxAction("/voteTopic.do?forumGroupId="+forumGroupId+"&forumTopicId="+_390+"&responseId="+_39e,csrfOptions,function(data){if(data=="SUCCESS"){removeTopicListCache();loadSinglePost(_390,false);}else{hideLoadingImage();}});}else{if(_38e.is("#topicPermalink")){var _3a0=_38e.attr("thisTopicPermalink");$("#PermalinkCont textarea").val(_3a0);$("#permalink_Text").select();$("#PermalinkCont").show().parent().show();return;}else{if(_38e.is("#linkToTopic")){linkToTopic();}else{if(_38e.is("#deleteLinkedTopic")){deletelinkedTopic(_38e);}else{if(_38d.is("a[purpose=\"linkedTopicTitle\"]")){if(isTopicQuickView=="false"){}else{var _390=_38d.attr("forumTopicId");processHash("Topic/"+_390);return false;}}else{if(_38e.is("#emailThisTopic")){openEmailTopicDialog(_38e);return false;}else{if(_38e.is("li[actionPurpose=\"reportSpam\"],div[actionPurpose=\"reportSpam\"]")){singlePostSpamAction(_38e,_38f);return;}else{if(_38e.is("div[buttonPurpose=\"approve\"]")||_38e.is("li[buttonPurpose=\"approve\"]")){singlePostApproveAction(_38e,"singlePostApprove");return;}else{if(_38d.is("div[purpose=\"inappropriateReason\"]")||_38d.is("span[purpose=\"inappropriateReason\"]")){getReasonForInapppropriate(_38d);}else{if(_38e.is("li[deletepurpose=\"deleteAttachment\"]")){deletePublishedAttachment(_38e,_38c);return;}else{if(_38d.is("li[purpose=\"topicLabel\"]")){changeTopicLabel(_38d);}else{var _3a1=_391.attr("topicAuthorId");var _3a2=_391.attr("forumId");var _3a3=_391.attr("categoryId");var _3a4=$("#singlePostUtilCont");var _3a5=_3a4.attr("newThreadReplyLinks");if(_38e.is(_3a5)){var _396=_38e;var _390=_396.attr("forumTopicId");var _3a6=_396.attr("responseId");var _3a7="#newThreadResponseCont_"+_3a6;var _39a=$("#paginationContainer");if($("#topicListMainContainer").length>0&&$("#singlePostMainContainer").length>0&&_39a.data("inEditMode")){removeTopicListCache();}if($("#responsePreviewContainer").is(":visible")){$("#responsePreviewContainer").find("button[purpose=\"backToEditorResponse\"]").trigger("click");showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");var _39b=_391.data("editorContLocation");setFocusToContainer($(_39b),false);return;}if(_391.data("inEditMode")){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");$("#responsePreviewButton").find("button[purpose=\"backToEditorResponse\"]").trigger("click");var _39b=_391.data("editorContLocation");setFocusToContainer($(_39b),false);return false;}$(_3a7).show();openEditor($("#newThreadResponse_"+_3a6),"responseContent","postContentTA","newThreadReply_"+_3a6,"Write","topicContainer_"+_390);setFocusToContainer($(_3a7),false);_391.data("inEditMode",true);_391.data("editorContLocation",_3a7);$("#previewResponse").attr("forumTopicId",_390);$("#previewResponse").attr("responseId",_3a6);return false;}var _3a8=_3a4.attr("responseVoteLinks");if(_38e.is(_3a8)){var _396=_38e;var _3a6=_396.attr("responseId");var _3a9=_396.attr("votePurpose");var _3aa=(_3a9=="removeVote")?"/removeResponseVote.do":"/voteResponse.do";showSmallLoadingImage(_38c);doAjaxAction(_3aa+"?forumGroupId="+forumGroupId+"&responseId="+_3a6+"&forumTopicId="+_390,csrfOptions,function(data){if(data=="SUCCESS"){removeTopicListCache();loadSinglePost(_390,false);}else{hideLoadingImage();}});return;}var _3ac=_3a4.attr("chooseBestResponseLinks");if(_38e.is(_3ac)){var _396=_38e;var _3a6=_396.attr("responseId");var _3ad={};_3ad.forumGroupId=forumGroupId;_3ad.responseId=_3a6;_3ad.forumTopicId=_390;if(_3a1==ZUID){_3ad.topicowner="true";}_3ad[csrfParamName]=csrfToken;showSmallLoadingImage(_38c);doAjaxAction("/bestResponse.do",_3ad,function(data){if(data=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlepost.bestResponseSuccessMsg"],"success");loadSinglePost(_390,false,"#bestResponseContainer_"+_3a6);_3ad={};_3ad.forumGroupId=forumGroupId;_3ad.forumTopicId=_390;doAjaxAction("/notifyForBestResponse.do",_3ad,function(){});}else{hideLoadingImage();showMessage(i18n["zohodiscussions.generalmessage.noPermission"]);}});return;}var _3af=_3a4.attr("responseEditLinks");if(_38e.is(_3af)){var _3b0=_38e.attr("id");var _396=_38e;var _3a6=_396.attr("responseId");var _3b1="#fullResponseContainer_"+_3a6;var _39a=$("#paginationContainer");if($("#topicListMainContainer").length>0&&$("#singlePostMainContainer").length>0&&_39a.data("inEditMode")){removeTopicListCache();}if($("#responsePreviewContainer").is(":visible")){$("#responsePreviewContainer").find("button[purpose=\"backToEditorResponse\"]").trigger("click");showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");var _39b=_391.data("editorContLocation");setFocusToContainer($(_39b),false);return;}if(_391.data("inEditMode")){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"info");var _39b=_391.data("editorContLocation");$("#responsePreviewButton").find("button[purpose=\"backToEditorResponse\"]").trigger("click");setFocusToContainer($(_39b),false);return false;}$(_3b1).show();if(_3b0=="editTopic"){$("#linkTopicCont_"+_390).hide();$("#statusContainer").hide();}openEditor($("#responseContentContainer_"+_3a6),"responseContent","postContentTA",_3b0,"Edit","topicContainer_"+_390);setFocusToContainer($(_3b1),false);_391.data("inEditMode",true);_391.data("editorContLocation",_3b1);$("#previewResponse").attr("responseId",_3a6);if($(_3b1).attr("class")=="postContent"){$("#previewResponse").attr("location","editTopic");}else{$("#previewResponse").attr("location","editResponse");}$("#previewResponse").attr("forumTopicId",_390);return false;}if(_38e.is("#removeBestResponse")){var _3ad={};_3ad.forumGroupId=forumGroupId;_3ad.forumTopicId=_390;if(_3a1==ZUID){_3ad.topicowner="true";}_3ad[csrfParamName]=csrfToken;showSmallLoadingImage(_38c);doAjaxAction("/removeBestResponse.do",_3ad,function(data){if(data=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlePost.removeBestResponseMsg"],"info");loadSinglePost(_390);}else{hideLoadingImage();showMessage(i18n["zohodiscussions.generalmessage.noPermission"]);}});return;}if(_38e.is("#deleteTopic")){if(confirm(i18n["zohodiscussions.singlePost.messagefordeletingTopic"])){var _3b3={};if(_3a1==ZUID){_3b3.access="author";}_3b3.forumGroupId=forumGroupId;_3b3.forumTopicId=_390;_3b3.categoryId=_3a3;_3b3.forumId=_3a2;_3b3[csrfParamName]=csrfToken;doAjaxAction("/deleteTopic.do",_3b3,function(data){if(jQuery.trim(data)=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.generalmessage.topicMovedToTrash"],"info");processHash("Home");}},function(_3b5){});}return;}var _3b6=_3a4.attr("responseDeleteLinks");if(_38e.is(_3b6)){var _396=_38e;var _3a6=_396.attr("responseId");var _3b7=_396.attr("responseAuthorId");if(confirm(i18n["zohodiscussions.singlePost.messagefordeletingResponse"])){var _3b8={};if(_3b7==ZUID){_3b8.responseowner="true";}_3b8.forumGroupId=forumGroupId;_3b8.forumTopicId=_390;_3b8.categoryId=_3a3;_3b8.forumId=_3a2;_3b8.responseId=_3a6;_3b8[csrfParamName]=csrfToken;doAjaxAction("/deleteForumResponse.do",_3b8,function(data){if(data=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.generalmessage.responseMovedToTrash"],"info");loadSinglePost(_390);}},function(_3ba){});}return false;}}}}}}}}}}}}}}}_392.hover(function(){var _3bb=_392.data("destroyHandle");if(_3bb){clearTimeout(_3bb);}},function(){var _3bc=setTimeout(function(){_392.hide();},500);_392.data("destroyHandle",_3bc);});}function getReasonForInapppropriate(_3bd){if(moderatorForSpam!="true"){return;}showLoadingImage();var _3be=_3bd.attr("responseId");var _3bf={};_3bf.forumGroupId=forumGroupId;_3bf.responseId=_3be;_3bf[csrfParamName]=csrfToken;doAjaxAction("/getInappropriateReason.do",_3bf,function(data){hideLoadingImage();var _3c1=$("<div></div>").html(data);if(_3c1.is("#noInappropriateReason")){showMessage(i18n["zohodiscussions.inappropriate.NoReasonForInappropriate"],"failure");}var _3c2=$("#inappropriateReason");_3c2.html(data).show();$("#inappropriateReasonClose").click(function(){_3c2.html("").hide();});});}function editTopicTitle(_3c3,_3c4,_3c5,_3c6,_3c7){var _3c8=_3c7.val();if(jQuery.trim(_3c8)==""){showMessage(i18n["zohodiscussions.writePost.TopicTitleCannotbeEmptymessage"],"failure");return;}if(_3c8.length>200){showMessage(i18n["zohodiscussions.writePost.TopicTitleLengthMsg"],"failure");return;}var _3c9=_3c3.attr("authorId");var _3ca={};if(ZUID==_3c9){_3ca.access="author";}_3ca.forumGroupId=forumGroupId;_3ca.forumTopicId=_3c4;_3ca.forumId=_3c5;_3ca.categoryId=_3c6;_3ca.topicTitle=_3c8;_3ca[csrfParamName]=csrfToken;doAjaxAction("/editTopicTitle.do",_3ca,function(data){var _3cc=eval(data);if(_3cc.result=="failure"){showTipper(i18n["zohodiscussions.singlepost.topicTitleUpdateErrordMsg"],"failure");}else{removeTopicListCache();showTipper(i18n["zohodiscussions.singlepost.topicTitleUpdatedMsg"],"success");loadSinglePost(_3c4);}});}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 _3cd=$this.attr("currentTopicId");var _3ce="^(ht|f)tp(s?)://[0-9a-zA-Z]([-.w]*[0-9a-zA-Z])*(:(0-9)*)*(/?)([a-zA-Z0-9-.?,:'/\\+=&amp;%$#_]*)?$";var _3cf="#Topic/";var _3d0="?ftid=";var _3d1="/topic/";var _3d2=$("#linkTopicUrl").val();if(jQuery.trim(_3d2)==""){showMessage(i18n["zohodiscussions.createforumgroup.LinkEmpty"],"failure");return;}_3d2=$.trim(_3d2);if((_3d2.match(_3ce))){if(_3d2.indexOf(_3cf)>-1||_3d2.indexOf(_3d0)>-1||_3d2.indexOf(_3d1)){var _3d3={};_3d3.forumGroupId=forumGroupId;_3d3.currentTopicId=_3cd;_3d3.linkToTopicUrl=_3d2;_3d3[csrfParamName]=csrfToken;doAjaxAction("/addLinkToTopic.do",_3d3,function(data){if(data=="SUCCESS"){removeTopicListCache();loadSinglePost(_3cd);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 _3d5=eval(data).reason;showTipper(i18n[_3d5],"failure");}}}});}else{showTipper(i18n["zohodiscussions.settings.PleaseEnteraValidurl"],"failure");}}else{showTipper(i18n["zohodiscussions.settings.PleaseEnteraValidurl"],"failure");}});}function deletelinkedTopic(_3d6){var _3d7=_3d6.attr("currentTopicId");var _3d8=_3d6.attr("linkedTopicId");var _3d9=_3d6.attr("location");var _3da={};_3da.forumGroupId=forumGroupId;_3da.forumTopicId=_3d7;_3da.linkedTopicId=_3d8;_3da[csrfParamName]=csrfToken;if(confirm(i18n["zohodiscussions.singlepost.removeLinkConfirmationMess"])){doAjaxAction("/deleteLinkedTopic.do",_3da,function(data){if(data=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlePost.deleteLinkedTopicMessage"],"success");if(_3d9=="topicList"){getForumTopics(-1,-1,1,"Home");}else{if(_3d9=="singlepost"){loadSinglePost(_3d7);}}}else{if(data=="FAILURE"){showTipper(i18n["zohodiscussions.generalmessage.errorOccured"],"failure");}}});}}function deletePublishedAttachment(_3dc,_3dd){if(confirm(i18n["zohodiscussions.generalmessage.deleteAttachmentConfirmMsg"])){showSmallLoadingImage(_3dd);$this=_3dc;var _3de=$this.attr("attachmentId");var _3df=$this.attr("forumTopicId");var _3e0=$this.attr("responseId");var _3e1=(typeof _3e0!="undefined")?_3e0:_3df;var _3e2={};_3e2.forumGroupId=forumGroupId;_3e2.forumTopicId=$this.attr("forumTopicId");_3e2.fileName=$this.attr("attachmentName");_3e2.fileId=_3de;_3e2[csrfParamName]=csrfToken;doAjaxAction("/deleteAttachment.do",_3e2,function(data){if(data=="SUCCESS"){showTipper(i18n["zohodiscussions.generalmessage.deleteAttachmentSuccessMsg"],"info");if($("#SinglePostContainer").length>0){hideLoadingImage();showLoadingImage();removeTopicListCache();loadSinglePost(_3df,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_"+_3e1).length>0)){$("#topicContent_"+_3e1).find("li[attachmentId ="+_3de+"]").remove();if(($("#topicContent_"+_3e1).find("li.singleList").length==0)){($("#topicContent_"+_3e1).find("div.Attachments")).remove();}}}}}});}}function openEmailTopicDialog(_3e4){var _3e5=_3e4;var _3e6=_3e5.attr("topicTitle");var _3e7=_3e5.attr("forumTopicId");_3e7=_3e7||_3e5.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _3e8=_3e8;var _3e9=$("#emailTopicPrompt");_3e9.find(":input[name=\"Subject\"]").val(_3e6);_3e9.find(":input[name=\"forumTopicId\"]").val(_3e7);_3e9.find(":input[name=\"topicTitle\"]").val(_3e6);_3e9.find(":input[name=\"emailIds\"]");_3e9.show().parent().show();_3e9.find(":input[name=\"emailIds\"]").focus();return false;}function emailTopic(_3ea){var _3eb=$(_3ea.target);_3eb.html(i18n["zohodiscussions.singlePost.sending"]);var _3ec=$("#emailTopicPrompt");if(validate(_3ec.find("form"))==true){doAjaxAction("/eMailTopic.do",_3ec.find("form").serialize(),function(data){if(data=="SUCCESS"){showTipper(i18n["zohodiscussions.singlepost.mailsentmessage"],"success");_3eb.html(i18n["zohodiscussions.general.send"]);cancelEmailTopic();}},function(err){if(err.responseText.indexOf("'result':'failure'")>0){var _3ef=eval(err.responseText);showMessage(_3ef.reason,"failure");_3eb.html(i18n["zohodiscussions.general.send"]);}else{showTipper(i18n["zohodiscussions.errorpage.requestedURLisnotfoundMess"],"failure",1000);}});return false;}else{_3eb.html(i18n["zohodiscussions.general.send"]);}return false;}function cancelEmailTopic(){var _3f0=$("#emailTopicPrompt");_3f0.hide().parent().hide();_3f0.find(":input[name=\"emailIds\"]").val("");_3f0.find(":input[name=\"Subject\"]").val("");$("#emailContentArea").val("");return false;}function singlePostApproveAction(_3f1){var _3f2=_3f1.attr("action");var _3f3=_3f1.attr("forumTopicId");var _3f4=_3f1.attr("forumId");var _3f5=_3f1.attr("categoryId");var _3f6=_3f1.attr("itemType");var _3f7={};_3f7.forumGroupId=forumGroupId;_3f7.forumTopicId=_3f3;_3f7.forumId=_3f4;_3f7.categoryId=_3f5;_3f7.authorId=_3f1.attr("authorId");_3f7[csrfParamName]=csrfToken;if(_3f6=="response"){var _3f8=_3f1.attr("responseId");_3f7.responseId=_3f8;}doAjaxAction(_3f2,_3f7,function(data){if(data=="SUCCESS"){removeTopicListCache();var _3fa=i18n["zohodiscussions.moderationList.topicApprovedMess"];if(_3f6=="response"){_3fa=i18n["zohodiscussions.moderationList.responseApprovedMess"];}showTipper(_3fa,"info",4000);loadSinglePost(_3f3);}});}function singlePostSpamAction(_3fb,_3fc){var _3fd=_3fb.attr("postType");if(_3fd=="topic"){_3fd=i18n["zohodiscussions.moderationList.topic"];}else{if(_3fd=="response"){_3fd=i18n["zohodiscussions.moderationList.response"];}}var _3fe=_3fb.attr("spamValue");var _3ff="";if(moderatorForSpam=="true"){if(_3fe==1){_3ff=i18n["zohodiscussions.singlepost.spamActionconfirmationmessage1"]+" "+_3fd+" "+i18n["zohodiscussions.singlepost.inappropriateActionconfirmationmessage2"];}else{_3ff=i18n["zohodiscussions.singlepost.spamActionconfirmationmessage3"]+" "+_3fd+" "+i18n["zohodiscussions.singlepost.appropriateActionconfirmationmessage2"];}if(confirm(_3ff)){spamAction(_3fb,_3fd,_3fc);}}else{if(_3fe==1){$("#spamStatusMsg").show();$("#spamDetails_Text").html("");$("#spamContentDetails").unbind("click").click(function(){var _400=$("#spamDetails_Text").val();_400=$.trim(_400);if(_400==""){showMessage(i18n["zohodiscussions.singlePost.EmptyMsgError"],"failure");return;}spamAction(_3fb,_3fd,_3fc,"appropriate",_400);});}else{if(confirm(i18n["zohodiscussions.singlepost.spamActionconfirmationmessage3"]+" "+_3fd+" "+i18n["zohodiscussions.singlepost.appropriateActionconfirmationmessage2"])){spamAction(_3fb,_3fd,_3fc,"appropriate");}}}return;}function spamAction(_401,_402,_403,_404,_405){var _406=_401.attr("forumTopicId");_406=_406||_401.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _407=_401.attr("forumId");_407=_407||_401.parents("div[parentCont=\"actualParent\"]").attr("forumId");var _408=_401.attr("categoryId");_408=_408||_401.parents("div[parentCont=\"actualParent\"]").attr("categoryId");var _409={};var _40a=_401.attr("spamValue");_409.forumTopicId=_406;_409.forumGroupId=forumGroupId;_409.action=_40a;_409.postType=_402;_409.purpose=_404;_409.forumId=_407;_409.categoryId=_408;_409[csrfParamName]=csrfToken;if(typeof _405!="undefined"){_409.spamDetails=_405;}var _40b=_401.attr("responseId");if(typeof _40b!="undefined"){_409.responseId=_40b;}doAjaxAction("/spamAction.do",_409,function(data){$("#spamStatusMsg").hide();if(data=="SUCCESS"){removeTopicListCache();if(_40a=="1"){if(_404=="appropriate"){showTipper(i18n["zohodiscussions.singlepost.Inappropriatemarkedmessage1"]+" "+_402+" "+i18n["zohodiscussions.singlepost.Inappropriatemarkedmessage2"],"success",1000);}else{showTipper(i18n["zohodiscussions.singlepost.spammarkedmessage1"]+" "+_402+" "+i18n["zohodiscussions.singlepost.spammarkedmessage2"],"success",1000);}}else{if(_404=="appropriate"){showTipper(i18n["zohodiscussions.singlepost.Inappropriatemarkedmessage1"]+" "+_402+" "+i18n["zohodiscussions.singlepost.InappropriateRemovedmessage"],"success",1000);}else{showTipper(i18n["zohodiscussions.singlepost.spammarkedmessage1"]+" "+_402+" "+i18n["zohodiscussions.singlepost.spamRemovedmessage"],"success",1000);}}if(_403=="singlePost"){loadSinglePost(_406);}else{if(moderatorForSpam=="true"){if(_40a==1){processHash("home");}else{_401.parent().remove();$("#reportInappropriate_"+_40b).remove();}}else{if(_40a==1){var _40d=$("#reportInappropriate_"+_40b);_40d.attr("spamValue","2");_40d.find("div.imgAshSpam").removeClass("imgAshSpam").addClass("imgNotSpamIcon");_40d.find("a").html(i18n["zohodiscussions.singlePost.Appropriate"]);if($("#reasonInappropriate_"+_40b).length>0){var _40e=$("#reasonInappropriate_"+_40b);var _40f=parseInt(_40e.attr("reportCount"));_40f=_40f+1;_40e.find("span[purpose=\"inappropriateReason\"]").html(i18n["zohodiscussions.singlePost.Inappropriate"]+" ("+_40f+")");_40e.attr("reportCount",_40f);}}else{var _40d=$("#reportInappropriate_"+_40b);_40d.attr("spamValue","1");_40d.find("div.imgNotSpamIcon").removeClass("imgNotSpamIcon").addClass("imgAshSpam");_40d.find("a").html(i18n["zohodiscussions.singlePost.Inappropriate"]);var _40e=$("#reasonInappropriate_"+_40b);var _40f=parseInt(_40e.attr("reportCount"));_40f=_40f-1;if(_40f>0){_40e.attr("reportCount",_40f);_40e.find("span[purpose=\"inappropriateReason\"]").html(i18n["zohodiscussions.singlePost.Inappropriate"]+" ("+_40f+")");}else{_40e.remove();}}}}}},function(_410){var _411=eval(_410.responseText);if(_411.result=="failure"){showMessage(_411.reason,"failure");}});}function singlePostWidgetActions(_412){var _413=$(_412.target);var _414=_413.parent();var _415="singlePost";if(_414.is("div[purpose=\"bookmark\"]")){bookMark(_414,_412);}else{if(_414.is("div[purpose=\"watchAction\"]")){watchThisItem(_414,_415,_412);}else{if((_414.is("div[purpose=\"lockTopic\"]"))||(_414.is("#unLockTopic"))){lockTopicLink(_414,_412);}else{if(_414.is("div[purpose=\"moveTopic\"]")){moveTopic(_414);}else{if(_414.is("div[purpose=\"stickyPost\"]")){stickyLink(_414,_412);}else{if(_414.is("div[purpose=\"moderateThisTopic\"]")){moderateAction(_414,_415,_412);}else{if(_414.is("div[purpose=\"changeTopicType\"]")){var _416=_414.attr("forumTopicId");changeTopicType(_416);}else{if(_413.is("input[purpose=\"notifyAuthor\"]")){var _416=_413.attr("forumTopicId");updateNotification(_413,_416,_412);}else{if(_413.is("a[purpose=\"forumPostsFilter\"]")){hashPurpose=_413.attr("hashPurpose");processHash(hashPurpose);return false;}}}}}}}}}}function changeTopicType(_417){$("#changeTopicTypeTemplate").html($("#changeTopicType_"+_417).html());$("#changeTopicType_"+_417).html("");$("#changeTopicTypeTemplate").show();$("#cancelTopicChange,#cancelChangingTopicType").click(function(){$("#changeTopicType_"+_417).html($("#changeTopicTypeTemplate").html());$("#changeTopicTypeTemplate").hide();$("#changeTopicTypeTemplate").html("");});$("#topicTypeListForChange").change(function(){var _418=$(this);if(_418.val()==1){$("#postExpiryDays_"+_417).show();}else{$("#postExpiryDays_"+_417).hide();}});$("#doChange_"+_417).click(function(){var _419=$(this);var _41a=$("#topicTypeListForChange").val();var _41b=_419.attr("forumId");var _41c=_419.attr("categoryId");var _41d=_419.attr("isTopicOwner");var _41e=_419.attr("postAuthorId");var _41f={};if(_41d=="true"){_41f.access="author";}if(_41a==1){var _420=$("#announcementExpiryDays_"+_417).val();_41f.expiryDay=_420;}_41f.authorId=_41e;_41f.forumGroupId=forumGroupId;_41f.forumTopicId=_417;_41f.forumId=_41b;_41f.categoryId=_41c;_41f.postTopicType=_41a;_41f[csrfParamName]=csrfToken;doAjaxAction("/updateTopicType.do",_41f,function(data){if(data=="failure"){showTipper(i18n["zohodiscussions.singlePost.updateTopicTypeErrorMessage"],"failure");}else{removeTopicListCache();loadSinglePost(_417);$("#changeTopicTypeTemplate").hide();}});});}function updateNotification(_422,_423,_424){var _425={};_425.forumGroupId=forumGroupId;_425.forumTopicId=_423;_425.access="author";_425.currNotifyStatus=_422.attr("checked");_425[csrfParamName]=csrfToken;showSmallLoadingImage(_424);doAjaxAction("/updateNotify.do",_425,function(data){removeTopicListCache();showTipper(i18n["zohodiscussions.singlepost.Notificationsavedmessage"],"success",1000);loadSinglePost(_423);});}function moderateAction(_427,_428,_429){var _42a=_427.attr("forumTopicId");_42a=_42a||_427.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _42b=_427.attr("forumId");_42b=_42b||_427.parents("div[parentCont=\"actualParent\"]").attr("forumId");if(_427.attr("moderationStatus")=="moderate"){var _42c={};_42c.forumTopicId=_42a;_42c.forumGroupId=forumGroupId;_42c.forumId=_42b;_42c[csrfParamName]=csrfToken;showSmallLoadingImage(_429);doAjaxAction("/moderateTopic.do",_42c,function(data){if(data=="SUCCESS"){removeTopicListCache();_427.attr("moderationStatus","moderated");showTipper(i18n["zohodiscussions.singlepost.Now"]+i18n["zohodiscussions.singlepost.topicundermoderationmessage"],"success",2000);if(_428=="singlePost"){$("#moderateTopicText").html(i18n["zohodiscussions.singlepost.unmoderatethistopicmessage"]);}else{_427.find("a[purpose = \"moderateTopicText\"]").html(i18n["zohodiscussions.singlepost.unmoderatethistopicmessage"]);}}else{showTipper(i18n["zohodiscussions.singlepost.Moderationfailed"],"success",2000);}hideLoadingImage();});}else{if(_427.attr("moderationStatus")=="moderated"){var _42e={};_42e.forumTopicId=_42a;_42e.forumGroupId=forumGroupId;_42e[csrfParamName]=csrfToken;doAjaxAction("/unModerateTopic.do",_42e,function(data){if(data=="SUCCESS"){removeTopicListCache();_427.attr("moderationStatus","moderate");showTipper(i18n["zohodiscussions.singlepost.moderationtopicremoved"],"success",2000);if(_428=="singlePost"){$("#moderateTopicText").html(i18n["zohodiscussions.singlepost.moderatethistopicmessage"]);}else{_427.find("a[purpose = \"moderateTopicText\"]").html(i18n["zohodiscussions.singlepost.moderatethistopicmessage"]);}}else{showTipper(i18n["zohodiscussions.singlepost.Moderationfailed"],"success",2000);}});}}}function moveTopic(_430){var _431=_430.attr("forumTopicId");$("#moveTopicTemplate").html($("#moveTopic_"+_431).html());$("#moveTopic_"+_431).html("");loadCategoriesToMove($("#forumListForMove").val());$("#moveTopicTemplate").show();var _432=$("#forumListForMove");var _433=$("#forumListForModerator");if(_430.attr("moderatorUser")=="yes"){_433.hide();_432.show();_432.val(_430.attr("forumId"));loadCategoriesToMove(_430.attr("forumId"));$("#moveToCategory").val(_430.attr("categoryId"));}else{_432.hide();_433.show();loadCategoriesToMove(_433.val());}$("#cancelMove,#cancelMoveTopic").click(function(){$("#moveTopic_"+_431).html($("#moveTopicTemplate").html());$("#moveTopicTemplate").hide();$("#moveTopicTemplate").html("");$("#doMove").html(i18n["zohodiscussions.singlePost.Movetopic"]);});$("#forumListForMove,#forumListForModerator").change(function(){var _434=_430.attr("forumId");var _435=$(this).val();if(_434==_435){$("#doMove").attr("disabled",true);}else{$("#doMove").attr("disabled",false);}loadCategoriesToMove($(this).val());});$("#doMove").unbind("click").click(function(){var _436=$(this);_436.html(i18n["zohodiscussions.singlePost.Moving"]);var _437=0;if(_430.attr("moderatorUser")=="yes"){_437=1;}var _438=$(this).attr("isTopicOwner");var args={};args.forumTopicId=_431;args.forumId=$("#forumListForMove").val();if(_437==0){args.forumId=$("#forumListForModerator").val();}if(_438){args.topicowner="true";}var _43a=$("#moveToCategory");var _43b=_43a.is(":visible");args.categoryId=(_43b==true)?_43a.val():-1;args.forumGroupId=forumGroupId;args[csrfParamName]=csrfToken;if(!args.categoryId){args.categoryId="";}doAjaxAction("/moveTopic.do",args,function(data){var _43d=eval(data);if(_43d.result=="success"){removeTopicListCache();$("#moveTopicTemplate").hide();$("#moveTopicTemplate").html("");showTipper(i18n["zohodiscussions.generalmessage.moveTopicSuccessMsg"],"success",3000);loadSinglePost(_431);}else{_436.html(i18n["zohodiscussions.singlePost.Movetopic"]);showMessage(_43d.reason,"failure");}});});}function loadCategoriesToMove(_43e){categoriesForForum=$("#categoryListFormove").val().split("$$");$("#moveToCategory").hide().parent().hide();$.each(categoriesForForum,function(_43f,item){if(item.indexOf(_43e+":")>-1){$("#moveToCategory").html(item.split(":")[1]).show().parent().show();return;}});}function singlePostTagActions(_441,_442){$("#forumTopicTags").find("div[purpose = \"deleteTag\"]").click(function(){if(confirm(i18n["zohodiscussions.singlepost.tagDeleteConfirmMsg"])){$this=$(this);var _443={};var _444=$this.attr("postTagId");var _445=$this.attr("eachTagName");var zuid=$this.attr("zuid");var _447=$this.attr("forumId");var _448=$this.attr("postAuthorId");if(_448==zuid){_443.access="author";}_443.forumGroupId=forumGroupId;_443.forumTopicId=_441;_443.forumId=_447;_443.postTagId=_444;_443[csrfParamName]=csrfToken;doAjaxAction("/deleteForumPostTags.do",_443,function(data){if(data=="SUCCESS"){removeTopicListCache();showTipper("<i>"+_445+" </i> "+i18n["zohodiscussions.singlepost.tagDeletedMsg"],"info",3000);loadSinglePost(_441);}});}});$("#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 _44a=$("#addPostTags");var _44b=_44a.find(":input[name=\"postTags\"]").val();_44b=_44b.replace(/^\s+|\s+$/g," ").replace(/\s+/g," ");var flag="false";if(_44b!=""){if(_44b.match(/^[^\^()~`!@#$%&:;\/?|<>{}[\]*-+=]+$/)==null){hideLoadingImage();showMessage(i18n["zohodiscussions.singlepost.specialCharacterNotAllowedMsg"],"failure");enablePostButtons();return;}}var _44d=_44b.split(",");for(var i=0;i<_44d.length;i++){if(_44d[i].length>50){showTipper(i18n["zohodiscussions.singlepost.TagexceedMessage"],"failure");return;}if(!((_44d[i])=="")&&!(jQuery.trim(_44d[i]))==""){flag="true";}}if(flag=="false"){showMessage(i18n["zohodiscussions.singlepost.tagNameEmptyMsg"],"failure");return;}if(_44b.indexOf("-")<0){var _44f=$this.attr("forumId");var _450=$this.attr("postAuthorId");var _451={};if(_450==ZUID){_451.access="author";}_451.forumId=_44f;_451.postTags=_44b;_451.forumGroupId=forumGroupId;_451.forumTopicId=_441;_451[csrfParamName]=csrfToken;if(jQuery.trim(_44b)==""){showMessage(i18n["zohodiscussions.singlepost.tagNameEmptyMsg"],"failure");return;}doAjaxAction("/addNewTagsForPost.do",_451,function(data){var _453=eval(data);if(_453.result=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlepost.tagAddedMsg"],"success",2000);loadSinglePost(_441,false);}});}});$("#forumTopicTags").find("[purpose=\"getTagRelatedPosts\"]").unbind("click").click(function(){$this=$(this);_442=_442||"Tag";var _454=$this.attr("hashPurpose");processHash(_454);});}function changeTopicLabel(_455){var _456=$("#statusList");var _457=_455.attr("topicLabelId");var _458=_456.attr("forumTopicId");var _459=_456.attr("forumId");showSmallLoadingImageForCont($("#statusContainer"),0,130);var _45a={};_45a.forumGroupId=forumGroupId;_45a.forumTopicId=_458;_45a.forumId=_459;_45a.topicLabelId=_457;_45a[csrfParamName]=csrfToken;doAjaxAction("/updateTopicLabel.do",_45a,function(data){if(data=="success"){removeTopicListCache();showTipper(i18n["zohodiscussions.singlePost.updateTopicLabelSuccessMsg"],"success");loadSinglePost(_458);}else{showMessage(i18n["zohodiscussions.singlePost.updateTopicLabelErrorMessage"],"failure");}},function(_45c){});}function watchThisItem(_45d,_45e,_45f){var _460=_45d.attr("hashPurpose");var _461=_45d.attr("itemType");var _462=_45d.attr("itemId");_462=_462||_45d.parents("div[parentCont=\"actualParent\"]").attr("forumTopicId");var _463=_45d.attr("status");var _464=_45d.attr("itemName");var _465={};_465.itemType=_461;_465.itemId=_462;_465.forumGroupId=forumGroupId;_465[csrfParamName]=csrfToken;if(_463=="watch"){showSmallLoadingImage(_45f);doAjaxAction("/watchItem.do",_465,function(data){if(data=="SUCCESS"){removeTopicListCache();if(_461==0){showTipper(i18n["zohodiscussions.singlepost.watchTopicSuccessMsg"],"success",3000);if(_45e=="singlePost"){loadSinglePost(_462,false);}else{if(_45e=="singleTopicWatch"){_45d.attr("status","unwatch");var _467=_45d.parent();_467.removeClass("smallAshBox").addClass("smallAshBoxShow");_45d.removeClass("imgSmallWatch").addClass("imgSmallWatchSel");hideLoadingImage();}else{_45d.attr("status","unwatch");_45d.find("a[purpose = \"watchItemText\"]").html(i18n["zohodiscussions.singlePost.unwatchTopic"]);hideLoadingImage();}}}else{if(_461==2){showTipper(i18n["zohodiscussions.widgetscontainer.watchForumSuccessMsg"],"success",3000);_45d.attr("status","unwatch");if(_460!="type"){processHash(_460);}else{_45d.find("a").html(i18n["zohodiscussions.general.Unwatch"]+" "+_464);$("#ajaxLoaderSmall").hide();}return false;}else{if(_461==1){showTipper(i18n["zohodiscussions.widgetscontainer.watchCategorySuccessMsg"],"success",3000);_45d.attr("status","unwatch");if(_460!="type"){processHash(_460);}else{_45d.find("a").html(i18n["zohodiscussions.general.Unwatch"]+" "+_464);$("#ajaxLoaderSmall").hide();}return false;}}}}});}else{var _468="";if(_461==0){_468=i18n["zohodiscussions.singlepost.unwatchTopicConfirmMsg1"];}else{if(_461==1){_468=i18n["zohodiscussions.singlepost.unwatchCategoryConfirmMsg3"];}else{if(_461==2){_468=i18n["zohodiscussions.singlepost.unwatchForumConfirmMsg2"];}}}if(confirm(_468)){var _469={};_469.itemId=_462;_469.forumGroupId=forumGroupId;_469[csrfParamName]=csrfToken;showSmallLoadingImage(_45f);doAjaxAction("/unWatch.do",_469,function(data){if(data=="SUCCESS"){removeTopicListCache();if(_461==0){showTipper(i18n["zohodiscussions.singlepost.unwatchTopicSuccessMsg"],"info",3000);if(_45e=="singlePost"){loadSinglePost(_462,false);}else{if(_45e=="singleTopicWatch"){_45d.attr("status","watch");var _46b=_45d.parent();_46b.removeClass("smallAshBoxShow").addClass("smallAshBox");_45d.removeClass("imgSmallWatchSel").addClass("imgSmallWatch");hideLoadingImage();}else{_45d.attr("status","watch");hideLoadingImage();}}}else{if(_461==2){showTipper(i18n["zohodiscussions.widgetscontainer.unwatchForumSuccessMsg"],"success",3000);_45d.attr("status","watch");if(_460!="type"){processHash(_460);}else{_45d.find("a").html(i18n["zohodiscussions.general.watch"]+" "+_464);$("#ajaxLoaderSmall").hide();}return false;}else{if(_461==1){showTipper(i18n["zohodiscussions.widgetscontainer.unwatchCategorySuccessMsg"],"success",3000);_45d.attr("status","watch");if(_460!="type"){processHash(_460);}else{_45d.find("a").html(i18n["zohodiscussions.general.watch"]+" "+_464);$("#ajaxLoaderSmall").hide();}return false;}}}}});}}}function bookMark(_46c,_46d){var _46e=_46c.attr("status");var _46f={};_46f.forumGroupId=forumGroupId;_46f.forumTopicId=_46c.attr("forumTopicId");_46f[csrfParamName]=csrfToken;showSmallLoadingImage(_46d);if(_46e=="bookmark"){doAjaxAction("/addBookMark.do",_46f,function(data){hideLoadingImage();if(data=="failure"){showTipper(i18n["zohodiscussions.singlePost.bookMarkErrorMessage"],"failure");}else{removeTopicListCache();showTipper(i18n["zohodiscussions.singlepost.bookmarkTopicSuccessMsg"],"success",3000);_46c.attr("status","removeBookmark");_46c.find("a").html(i18n["zohodiscussions.singlePost.removeBookmark"]);}});}else{doAjaxAction("/removeBookMark.do",_46f,function(data){hideLoadingImage();if(data=="failure"){showTipper(i18n["zohodiscussions.singlePost.removeBookMarkErrorMessage"],"failure");}else{removeTopicListCache();showTipper(i18n["zohodiscussions.singlePost.removeBookmarkMsg"],"info",3000);_46c.attr("status","bookmark");_46c.find("a").html(i18n["zohodiscussions.singlePost.bookmarkTopic"]);}});}}function stickyLink(_472,_473){var _474=0;var _475=_472.attr("status");var _476=_472.attr("isSticky");if(_476=="true"){_474=1;}var _477={};_477.forumGroupId=forumGroupId;_477.forumTopicId=_472.attr("forumTopicId");_477.action=_474;_477[csrfParamName]=csrfToken;showSmallLoadingImage(_473);doAjaxAction("/stickyAction.do",_477,function(data){if(data=="SUCCESS"){removeTopicListCache();if(_475=="stickyPost"){showTipper(i18n["zohodiscussions.singlepost.stickyPostSuccessMsg"],"success",3000);_472.attr("status","normal");_472.attr("isSticky","true");$("#stickyPostText").html(i18n["zohodiscussions.singlePost.notStickyPost"]);}else{showTipper(i18n["zohodiscussions.singlePost.removeStickyPostMsg"],"info",3000);_472.attr("status","stickyPost");_472.attr("isSticky","false");$("#stickyPostText").html(i18n["zohodiscussions.singlePost.makeStickyPost"]);}hideLoadingImage();}});}function lockTopicLink(_479,_47a){var _47b=0;var _47c=_479.attr("status");var _47d=_479.attr("isLocked");var _47e=_479.attr("forumTopicId");if(_47d=="true"){_47b=1;}var _47f=(_47c=="lockTopic")?i18n["zohodiscussions.singlepost.lockConfirmationMsg"]:i18n["zohodiscussions.singlepost.unlockConfirmationMsg"];if(confirm(_47f)){var _480={};_480.forumGroupId=forumGroupId;_480.forumTopicId=_47e;_480.action=_47b;_480[csrfParamName]=csrfToken;showSmallLoadingImage(_47a);doAjaxAction("/lockAction.do",_480,function(data){if(data=="SUCCESS"){removeTopicListCache();if(_47c=="lockTopic"){showTipper(i18n["zohodiscussions.singlepost.lockTopicSuccessMsg"],"info",3000);}else{showTipper(i18n["zohodiscussions.singlepost.unlockTopicSuccessMsg"],"info",3000);}loadSinglePost(_47e,false);}});}}function addForumResponse(_482,_483,_484){showLoadingImage(i18n["zohodiscussions.general.publishing"]);var _485=$("#postContentTA").data("editor").val();_485=_485.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_485==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");return;}$("#postContentTA").val(_485);var _486=(_483&&_483=="Edit")?"/updateResponse.do":(ZUID==-1)?"/addGuestForumResponse.do":"/addForumResponse.do";doAjaxAction(_486,$("#editorHolder").serialize(),function(data){hideLoadingImage();if(data.indexOf("'result':'failure'")>0){var _488=eval(data);if(_488.errorcode=="SPAM_DETECTED"){if(confirm(_488.reason)){$("#editorHolder").find("input[name=\"detectSpamPresence\"]").val(0);$("#publishResponse").trigger("click");}}else{showMessage(_488.reason,"failure");}}else{if(data.indexOf("'result':'success'")>0){var _488=eval(data);if($("#SinglePostContainer").length>0){removeTopicListCache();loadSinglePost(_482,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[_488.reason],"info",5000);return;}else{var _489=(_483&&_483=="Edit")?i18n["zohodiscussions.singlepost.ResponseUpdated"]:i18n["zohodiscussions.singlepost.ResponseAdded"];showTipper(_489,"success",3000);if($("#SinglePostContainer").length>0){removeTopicListCache();showLoadingImage();loadSinglePost(_482,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 _48a=_482;if(_484&&$("#topicContent_"+_48a).length<1){_48a=_484;}$("#topicContent_"+_48a).html(_485);$("#editTopic_"+_48a).html(_485);$("#cancelResponse").trigger("click");}else{if($("#authorProfileInnerContent").length>0){var _48a=_482;if(_484&&$("#topicContent_"+_48a).length<1){_48a=_484;}$("#topicContent_"+_48a).html(_485);$("#editTopic_"+_48a).html(_485);$("#cancelResponse").trigger("click");}}}}}}},function(_48b){hideLoadingImage();if(_48b.responseText.indexOf("'result':'failure'")>0){var _48c=eval(_48b.responseText);if(_48c.result=="failure"){if(_48c.errorcode=="HIP_REQUIRED"){var _48d=$("#responseAttachmentContActual").find("div[purpose=\"responseCaptcha\"]");if(_48d.attr("currCaptcha")=="new"){showMessage(i18n["zohodiscussions.writePost.captchaMsg"],"failure");}else{showMessage(i18n["zohodiscussions.writePost.captchaErrorMsg"],"failure");}_48d.find("img[purpose=\"captchaImage\"]").replaceWith("<img purpose=captchaImage name=hipImg border=0 src=/showcaptcha?digest="+_48c.reason+" align=absmiddle alt=HIP image>");_48d.find(":input").attr("name",_48c.reason);_48d.attr("currCaptcha","old");_48d.show();}else{showMessage(_48c.reason,"failure");}}}else{$("#SinglePostContainer").get(0).innerHTML=_48b.responseText;}});return false;}function removeTopicListCache(){$("#topicListMainContainer:hidden").remove();$("#userProfileMainContainer:hidden").remove();$("#myAreaParentContainer:hidden").remove();}function initModerationPanel(){openModerationPanel();}function openModerationPanel(){$("#moderationLeftCont li[purpose]").click(function(){showLoadingImage();$this=$(this);var _48e=$this.attr("purpose");var _48f=$this.attr("tabPurpose");$this.removeClass("default").addClass("selected").siblings("li.selected").removeClass("selected").addClass("default");var _490=$this.attr("pageToLoad");doAjaxAction(_490,csrfOptions,function(data){if(_48e=="WaitingApproval"){$("#moderationRightCont").get(0).innerHTML=data;}else{if(_48e=="ReportedSpam"){$("#moderationRightCont").get(0).innerHTML=data;}else{if(_48e=="ReportedInappropriate"){$("#moderationRightCont").get(0).innerHTML=data;}else{if(_48e=="Trashed"){$("#moderationRightCont").get(0).innerHTML=data;}else{if(_48e=="Moderated"){$("#moderationRightCont").get(0).innerHTML=data;}}}}}hideLoadingImage();bindModerationTabClick();bindModerationActionClick(_48f);showAuthorPopout($("#moderationListForm"));},function(_492){hideLoadingImage();var _493=(_492.responseText);$("#mainContent").get(0).innerHTML=_493;});});}function bindModerationTabClick(){$("#moderationTabCont > ul > li[tabPurpose]").unbind("click").click(function(){$this=$(this);var _494=$this.attr("tabPurpose");var _495=$this.attr("action");$this.removeClass("default").addClass("selected").siblings("li.selected").removeClass("selected").addClass("default");moderationTab(_494,_495);});}function moderationTab(_496,_497){showLoadingImage();var _498=1;var _499=_496;var _49a={};if(_499=="ModeratedUsers"){_49a.userId=ZUID;}if(_499=="ModeratedTopicList"){_49a.userId=ZUID;}_49a.fetchPage=_498;_49a.postFor=_499;_49a.forumGroupId=forumGroupId;_49a[csrfParamName]=csrfToken;doAjaxAction(_497,_49a,function(data){hideLoadingImage();$("#moderationInnerCont").find("div.expand").get(0).innerHTML=data;bindModerationActionClick(_496);showAuthorPopout($("#moderationListForm"));var _49c=$("#moderationListForm");var _49d=_49c.attr("topicCount");var _49e=_49c.attr("responseCount");var _49f=_49c.attr("totalCount");var _4a0=_49c.attr("responseList");var _4a1=_49c.attr("moderatedUsersCount");$("#moderationTabCont").find("span[purpose=\"totalCount\"]").html("("+_49f+")");$("#moderationTabCont").find("span[purpose=\"topicCount\"]").html("("+_49d+")");$("#moderationTabCont").find("span[purpose=\"responseCount\"]").html("("+_49e+")");$("#moderationTabCont").find("span[purpose=\"moderatedUsersCount\"]").html("("+_4a1+")");if(_4a0=="No"){$("#moderationActionListCont").hide();}else{$("#moderationActionListCont").show();$("#moderationAction").find("input[purpose=\"selectAll\"]").attr("checked",false);$("#selectAllModerationItem").html(i18n["zohodiscussions.moderationAction.selectAll"]);}var _4a2=$("#moderationViewModeSelections").find("li a[purpose=\"expandedView\"]");var _4a3=$("#moderationViewModeSelections").find("li a[purpose=\"listView\"]");_4a2.removeClass("boldText").addClass("underline");_4a3.removeClass("underline").addClass("boldText");},function(_4a4){hideLoadingImage();var _4a5=(_4a4.responseText);$("#moderationInnerCont").find("div.expand").get(0).innerHTML=_4a5;});}function bindModerationAction(_4a6){var _4a7=$(_4a6.target);var _4a8=_4a7.parent();if(_4a8.is("li[buttonPurpose]")){var _4a9=_4a8.attr("buttonPurpose");var _4aa="moderation";if(_4a9=="approve"||_4a9=="deleteForever"||_4a9=="restore"||_4a9=="spam"||_4a9=="inappropriate"){manageModerationeAction(_4a8);}else{if(_4a9=="inappropriateReason"){getReasonForInapppropriate(_4a8);}else{if(_4a9=="trash"){singlePostDeleteAction(_4a8,_4aa);}else{if(_4a9=="unModerateTopic"){unModerateTopic(_4a8);}}}}}else{if(_4a8.is("div[buttonPurpose]")){var _4a9=_4a8.attr("buttonPurpose");if(_4a9=="unModerateUser"){unmoderateUserAction(_4a8);}}else{if(_4a7.is("a[purpose=\"singlePostView\"]")){openSinglePost(_4a7.attr("forumTopicId"));}else{if(_4a7.is("a[purpose=\"singleForumTopics\"]")&&_4a7.attr("isNiceUrl")!="Yes"){var _4ab=1;var _4ac=_4a7.attr("forumId");getForumTopics(_4ac,-1,_4ab,"Home");}else{if(_4a7.is("a[purpose=\"authorProfile\"]")&&_4a7.attr("isNiceUrl")!="Yes"){var _4ad=_4a7.attr("authorName");var _4ae=_4a7.attr("singleClickflag");if(_4ae=="0"){if(_4ad==ZU_Name){processHash("MyArea");_4a7.attr("singleClickflag","1");}else{processHash("User/"+_4ad);_4a7.attr("singleClickflag","1");}}return;}}}}}if(_4a7.is("div[purpose=\"singlePostIconView\"]")){var _4af=_4a7.attr("responseId");var _4b0=_4a7.attr("status");if(_4b0=="expandView"){$("#singlePostTextContent_"+_4af).show();$("#singlePostIconView_"+_4af).removeClass("bigPlusIcon").addClass("bigMinusIcon");_4a7.attr("status","listView");}else{$("#singlePostTextContent_"+_4af).hide();$("#singlePostIconView_"+_4af).removeClass("bigMinusIcon").addClass("bigPlusIcon");_4a7.attr("status","expandView");}}}function bindModerationActionClick(_4b1){$("#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 _4b2=false;var _4b3=$("#moderationInnerCont").find("input[purpose=\"selectItem\"]").each(function(){var _4b4=this.checked;if(_4b4==true){_4b2=true;}});if(_4b2==true){var _4b5="";var _4b6="";var _4b7="";var _4b8="";var _4b9="";var _4ba=$this.attr("actionPurpose");var _4bb=$("#moderationTabCont").find("li.selected");var _4bc=_4bb.attr("itemType");if(_4bc=="All"){_4b8=i18n["zohodiscussions.moderationAction.deleteAllSelectedConfirmationMessage"];}else{_4b8=(_4bc=="post")?i18n["zohodiscussions.moderationAction.deleteTopicConfirmationMessage"]:i18n["zohodiscussions.moderationAction.deleteResponsesConfirmationMessage"];}if(_4bc=="All"&&_4ba=="approveAction"){_4b5="bulkApprove";_4b6="/approveAllAwaitingModeration.do";_4b7=_4bc;}else{if(_4bc=="post"&&_4ba=="approveAction"){_4b5="bulkApprove";_4b6="/approveTopic.do";_4b7=_4bc;}else{if(_4bc=="response"&&_4ba=="approveAction"){_4b5="bulkApprove";_4b6="/approveResponse.do";_4b7=_4bc;}else{if((_4bc=="All"&&_4ba=="deleteAction")){_4b5="bulkDelete";_4b6="/deleteAllAwaitingModeration.do";_4b7=_4bc;}else{if(_4bc=="post"&&_4ba=="deleteAction"){_4b5="bulkDelete";_4b6="/deleteTopic.do";_4b7=_4bc;}else{if(_4bc=="response"&&_4ba=="deleteAction"){_4b5="bulkDelete";_4b6="/deleteForumResponse.do";_4b7=_4bc;}else{if(_4bc=="All"&&_4ba=="deleteForeverAction"){_4b5="bulkDeleteForever";_4b6="/deleteAllTrashForever.do";_4b7=_4bc;}else{if(_4bc=="post"&&_4ba=="deleteForeverAction"){_4b5="bulkDeleteForever";_4b6="/deleteTopicForEver.do";_4b7=_4bc;}else{if(_4bc=="response"&&_4ba=="deleteForeverAction"){_4b5="bulkDeleteForever";_4b6="/deleteResponseForEver.do";_4b7=_4bc;}else{if(_4bc=="All"&&_4ba=="restoreAction"){_4b5="bulkRestore";_4b6="/RestoreAllTrash.do";_4b7=_4bc;}else{if(_4bc=="post"&&_4ba=="restoreAction"){_4b5="bulkRestore";_4b6="/restoreForumTopic.do";_4b7=_4bc;}else{if(_4bc=="response"&&_4ba=="restoreAction"){_4b5="bulkRestore";_4b6="/restoreForumResponse.do";_4b7=_4bc;}else{if(_4bc=="All"&&_4ba=="markAsNotSpam"){_4b5="markAsNotSpam";_4b6="/markAsNotSpam.do";_4b7=_4bc;}else{if(_4bc=="post"&&_4ba=="markAsNotSpam"){_4b5="bulkNotSpam";_4b6="/spamAction.do";_4b7=_4bc;_4b9="topic";}else{if(_4bc=="response"&&_4ba=="markAsNotSpam"){_4b5="bulkNotSpam";_4b6="/spamAction.do";_4b7=_4bc;_4b9="response";}else{if(_4bc=="All"&&_4ba=="markAsAppropriate"){_4b5="markAsNotSpam";_4b6="/markAsNotSpam.do";_4b7=_4bc;}else{if(_4bc=="post"&&_4ba=="markAsAppropriate"){_4b5="bulkNotSpam";_4b6="/spamAction.do";_4b7=_4bc;_4b9="topic";}else{if(_4bc=="response"&&_4ba=="markAsAppropriate"){_4b5="bulkNotSpam";_4b6="/spamAction.do";_4b7=_4bc;_4b9="response";}}}}}}}}}}}}}}}}}}if(_4b5=="bulkNotSpam"||_4b5=="spamAll"){showLoadingImage();doAjaxAction(_4b6+"?forumGroupId="+forumGroupId+"&purpose="+_4b5+"&postType="+_4b9,$("#moderationListForm").serialize(),function(data){hideLoadingImage();getDataFromBulkModeration(data,_4b5,_4b1,_4b7);});}else{if(_4b5=="bulkDeleteForever"||_4b5=="bulkDelete"||_4b5=="trashAll"){if(confirm(_4b8)){doAjaxAction(_4b6+"?forumGroupId="+forumGroupId+"&purpose="+_4b5,$("#moderationListForm").serialize(),function(data){getDataFromBulkModeration(data,_4b5,_4b1,_4b7);});}}else{doAjaxAction(_4b6+"?forumGroupId="+forumGroupId+"&purpose="+_4b5,$("#moderationListForm").serialize(),function(data){getDataFromBulkModeration(data,_4b5,_4b1,_4b7);});}}}else{showTipper(i18n["zohodiscussions.moderationList.selectAtleastOneCheckboxinfoMess"],"info",2000);}});paginationNavBtnEnabled();selectViewMode();}function selectPost(_4c0){var _4c1=_4c0.attr("checked");var _4c2=$("#moderationInnerCont");if(_4c1==1){_4c2.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{_4c2.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 _4c3=$this.attr("purpose");var _4c4=$("#moderationViewModeSelections").find("li a[purpose=\"expandedView\"]");var _4c5=$("#moderationViewModeSelections").find("li a[purpose=\"listView\"]");var _4c6=$("#moderationPanel div.singlePostIconView");if(_4c3=="expandedView"){$("div.viewMode").show();_4c4.removeClass("underline").addClass("boldText");_4c5.removeClass("boldText").addClass("underline");_4c6.removeClass("bigPlusIcon").addClass("bigMinusIcon");_4c6.attr("status","listView");}else{$("div.viewMode").hide();_4c4.removeClass("boldText").addClass("underline");_4c5.removeClass("underline").addClass("boldText");_4c6.removeClass("bigMinusIcon").addClass("bigPlusIcon");_4c6.attr("status","expandView");}});}function unModerateTopic(_4c7){var _4c8={};var _4c9=_4c7.attr("forumTopicId");_4c8.forumTopicId=_4c9;_4c8.forumGroupId=forumGroupId;_4c8[csrfParamName]=csrfToken;if(confirm(i18n["zohodiscussions.moderationList.UnmoderateTopicConfirmMess"])){doAjaxAction("/unModerateTopic.do",_4c8,function(data){var _4cb=_4c7.attr("forumTopicId");if(data=="SUCCESS"){removeTopicListCache();showTipper(i18n["zohodiscussions.moderationList.UnmoderateTopicmessage"],"info",2000);$("#moderationLeftCont li[purpose=\"Moderated\"]").trigger("click");}});}}function unmoderateUserAction(_4cc){var _4cd=$("#moderationTabCont").find("li.selected").attr("tabPurpose");var _4ce=_4cc.attr("authorId");var _4cf=_4cc.attr("isAdmin");var _4d0=_4cc.attr("forumId");var _4d1=_4cc.attr("moderationId");var _4d2=0;if(_4cc.attr("levelType")=="1"){_4d2=1;}var _4d3={};_4d3.authorId=_4ce;_4d3.forumGroupId=forumGroupId;_4d3.forumId=_4d0;_4d3.adminUser=_4cf;_4d3.moderateType=_4d2;_4d3[csrfParamName]=csrfToken;if(confirm(i18n["zohodiscussions.moderationList.UnmoderateUserConfirmMess"])){doAjaxAction("/unModerateUser.do",_4d3,function(data){if(data=="SUCCESS"){showTipper(i18n["zohodiscussions.moderationList.UnmoderateUsermessage"],"info",2000);refreshingPage(_4cd);}});}}function manageModerationeAction(_4d5){var _4d6=$("#moderationTabCont").find("li.selected").attr("tabPurpose");var _4d7=_4d5.attr("buttonPurpose");var _4d8=_4d5.attr("action");var _4d9=_4d5.attr("forumTopicId");var _4da=_4d5.attr("forumId");var _4db=_4d5.attr("categoryId");var _4dc=_4d5.attr("itemType");var _4dd={};if(_4d7=="spam"||_4d7=="inappropriate"){_4dd.action=_4d5.attr("spamValue");_4dd.postType=_4d5.attr("postType");_4dd.purpose=null;}_4dd.forumGroupId=forumGroupId;_4dd.forumTopicId=_4d9;_4dd.forumId=_4da;_4dd.categoryId=_4db;_4dd.authorId=_4d5.attr("authorId");_4dd[csrfParamName]=csrfToken;if(_4dc=="post"){var _4de=true;if(_4d7=="deleteForever"){_4de=confirm(i18n["zohodiscussions.moderationList.deleteTopicConfirmMess"]);}if(_4de){doAjaxAction(_4d8,_4dd,function(data){if(data=="SUCCESS"){if(_4d7=="restore"){showTipper(i18n["zohodiscussions.moderationList.topicRestoredMess"],"info",2000);}else{if(_4d7=="approve"){showTipper(i18n["zohodiscussions.moderationList.topicApprovedMess"],"info",2000);}else{if(_4d7=="spam"){showTipper(i18n["zohodiscussions.moderationList.topicUnmarkAsSpamMess"],"info",2000);}else{if(_4d7=="inappropriate"){showTipper(i18n["zohodiscussions.moderationList.topicUnmarkAsInappropriate"],"info",2000);}else{if(_4d7=="deleteForever"){showTipper(i18n["zohodiscussions.moderationList.topicDeleteFromTrashMess"],"info",2000);}}}}}if(_4d6){refreshingPage(_4d6);}}});}}else{var _4e0=_4d5.attr("responseId");_4dd.responseId=_4e0;var _4de=true;if(_4d7=="deleteForever"){_4de=confirm(i18n["zohodiscussions.moderationList.deleteResponseConfirmMess"]);}if(_4de){doAjaxAction(_4d8,_4dd,function(data){if(data=="SUCCESS"){if(_4d7=="restore"){showTipper(i18n["zohodiscussions.moderationList.responseRestoredMess"],"info",2000);}else{if(_4d7=="approve"){showTipper(i18n["zohodiscussions.moderationList.responseApprovedMess"],"info",2000);}else{if(_4d7=="spam"){showTipper(i18n["zohodiscussions.moderationList.responseUnmarkAsSpamMess"],"info",2000);}else{if(_4d7=="inappropriate"){showTipper(i18n["zohodiscussions.moderationList.responseUnmarkAsInappropriate"],"info",2000);}else{if(_4d7=="deleteForever"){showTipper(i18n["zohodiscussions.moderationList.responseDeleteFromTrashMess"],"info",2000);}}}}}if(_4d6){refreshingPage(_4d6);}}});}}}function getDataFromBulkModeration(data,_4e3,_4e4,_4e5){if(data=="SUCCESS"){if(_4e3=="bulkDeleteForever"||_4e3=="bulkDelete"||_4e3=="trashAll"){if(_4e5=="All"){showTipper(i18n["zohodiscussions.moderationList.selectedItemsdeletedMess"],"info",2000);}else{if(_4e5=="post"){showTipper(i18n["zohodiscussions.moderationList.topicdeletedMess"],"info",2000);}else{showTipper(i18n["zohodiscussions.moderationList.responsedeletedMess"],"info",2000);}}}else{if(_4e3=="bulkRestore"||_4e3=="RestoreAll"){if(_4e5=="All"){showTipper(i18n["zohodiscussions.moderationList.selectedItemsRestoreMess"],"info",2000);}else{if(_4e5=="post"){showTipper(i18n["zohodiscussions.moderationList.topicRestoredMess"],"info",2000);}else{showTipper(i18n["zohodiscussions.moderationList.responseRestoredMess"],"info",2000);}}}else{if(_4e3=="bulkApprove"||_4e3=="approveAll"){if(_4e5=="All"){showTipper(i18n["zohodiscussions.moderationList.selectedItemsApprovedMess"],"info",2000);}else{if(_4e5=="post"){showTipper(i18n["zohodiscussions.moderationList.topicApprovedMess"],"info",2000);}else{showTipper(i18n["zohodiscussions.moderationList.responseApprovedMess"],"info",2000);}}}else{if(_4e4=="AllReportedInappropriate"){if(_4e5=="All"){showTipper(i18n["zohodiscussions.moderationList.selectedItemsUnmarkAsInappropriate"],"info",2000);}else{if(_4e5=="post"){showTipper(i18n["zohodiscussions.moderationList.topicUnmarkAsInappropriate"],"info",2000);}else{showTipper(i18n["zohodiscussions.moderationList.responseUnmarkAsInappropriate"],"info",2000);}}}else{if(_4e3=="bulkNotSpam"||_4e3=="markAsNotSpam"){if(_4e5=="All"){showTipper(i18n["zohodiscussions.moderationList.selectedItemsUnmarkAsSpamMess"],"info",2000);}else{if(_4e5=="post"){showTipper(i18n["zohodiscussions.moderationList.topicUnmarkAsSpamMess"],"info",2000);}else{showTipper(i18n["zohodiscussions.moderationList.responseUnmarkAsSpamMess"],"info",2000);}}}}}}}refreshingPage(_4e4);}else{showTipper(i18n["zohodiscussions.moderationList.infoMess"],"info",2000);}}function refreshingPage(_4e6){if(_4e6=="AllAwaiting"){$("#moderationLeftCont li[purpose=\"WaitingApproval\"]").trigger("click");}else{if(_4e6=="AllReportedSpam"){$("#moderationLeftCont li[purpose=\"ReportedSpam\"]").trigger("click");}else{if(_4e6=="AllReportedInappropriate"){$("#moderationLeftCont li[purpose=\"ReportedInappropriate\"]").trigger("click");}else{if(_4e6=="AllTrash"){$("#moderationLeftCont li[purpose=\"Trashed\"]").trigger("click");}else{$("#moderationTabCont > ul > li[tabPurpose="+_4e6+"]").trigger("click");}}}}}function paginationNavBtnEnabled(){$("#moderationListForm").find("li.navBtnEnabled").click(function(){var _4e7=$(this);var _4e8=_4e7.parent("ul");var type=_4e7.attr("purpose");moderationPagination(_4e8,type);});}function moderationPagination(_4ea,type){showLoadingImage();var _4ec=$("#moderationTabCont").find("li.selected");var _4ed=_4ec.attr("action");var _4ee=_4ec.attr("tabpurpose");var _4ef=parseInt(_4ea.attr("fetchPage"));if(type=="next"){_4ef=_4ef+1;}else{_4ef=_4ef-1;}var _4f0={};_4f0.forumGroupId=forumGroupId;_4f0.fetchPage=_4ef;_4f0.postFor=_4ee;_4f0[csrfParamName]=csrfToken;doAjaxAction(_4ed,_4f0,function(data){hideLoadingImage();$("#moderationInnerCont").find("div.expand").get(0).innerHTML=data;showAuthorPopout($("#moderationListForm"));paginationNavBtnEnabled();var _4f2=$("#moderationViewModeSelections");_4f2.find("li[linkpurpose=\"expandedView\"]").html("<a class=underline purpose=expandedView>"+i18n["zohodiscussions.myArea.expandView"]+"</a>");_4f2.find("li[linkpurpose=\"listView\"]").html("<a class=boldText purpose=listView>"+i18n["zohodiscussions.myArea.listView"]+"</a>");selectViewMode();},function(_4f3){$("#mainContent").get(0).innerHTML=_4f3.responseText;hideLoadingImage();});}function bindMyAreaClicks(_4f4){_4f4.unbind("click",processMyAreaClick).click(processMyAreaClick);$("#recentActivityContent, #profileDetailCont").unbind("click",processAllMyAreaMainClick).click(processAllMyAreaMainClick);$("#mainContent").unbind("click",processAuthorProfileClick);$("#mainContent").unbind("click",processAllActionClick);}function processMyAreaClick(_4f5){var _4f6=$(_4f5.target);var _4f7=_4f6.parent();if($("#loadingImg").is(":visible")){return;}if((_4f7.is("[purpose=\"dashBoard\"]")||_4f7.is("[purpose=\"myJournals\"]")||_4f7.is("[purpose=\"watchList\"]")||_4f7.is("[purpose=\"bookMark\"]")||_4f7.is("[purpose=\"privateMsg\"]")||_4f7.is("[purpose=\"preference\"]"))&&_4f7.attr("isNiceUrl")!="Yes"){getMyAreaAction(_4f7);return;}else{if((_4f6.is("[purpose=\"dashBoard\"]")||_4f6.is("[purpose=\"myJournals\"]")||_4f6.is("[purpose=\"watchList\"]")||_4f6.is("[purpose=\"bookMark\"]")||_4f6.is("[purpose=\"privateMsg\"]")||_4f6.is("[purpose=\"preference\"]"))&&_4f6.attr("isNiceUrl")!="Yes"){getMyAreaAction(_4f6);return;}}}function getMyAreaAction(_4f8,_4f9){showLoadingImage();_4f8.parent("ul").find("li").removeClass("selected");_4f8.addClass("selected");var _4fa=_4f8.attr("action");var _4fb={};_4fb.forumGroupId=forumGroupId;_4fb[csrfParamName]=csrfToken;_4fb.ch=ch;var _4fc=_4f8.attr("purpose");if(_4f9!=undefined&&_4fc=="watchList"){_4fa="/myWatchListSubAction.do";_4fb.subAction=_4f9;}$("#myAreaLists").attr("currView",_4fc);if(_4fc=="myJournals"){_4fb.userId=_4f8.attr("userId");_4fb.viewType="myself";}doAjaxAction(_4fa,_4fb,function(data){hideLoadingImage();$("#myAreaInnerMainContent").find("div.innerWrapper").get(0).innerHTML=data;if(_4fc=="myJournals"){$.history.add("MyArea/myPosts");}else{if(_4fc=="watchList"&&_4f9!=undefined){$.history.add("MyArea/"+_4fc+"/"+_4f9);}else{$.history.add("MyArea/"+_4fc);}}bindMyareaTabsActions(_4fc,_4f9);return false;},function(err){var _4ff=eval(err.responseText);showMessage(_4ff.reason,"failure");hideLoadingImage();});}function bindMyareaTabsActions(_500,_501){var _502=$("#myAreaInnerMainContent").find("div.innerWrapper");if(_500=="preference"){_502.unbind("click",processPreferenceClick).click(processPreferenceClick);var _503=$("#user_AvatarImage");if(_503.find("li.selected").length>0){avatarImageFocus(_503);}var _504=$("#preferenceInnerContent").find("form").attr("userPhotoPref");var _505=$("#preferenceInnerContent").find("form").attr("userUploadPhotoUrl");var _506=$("#preferenceInnerContent").find("form").attr("userIAMphoto");var _507="";if(_504=="IAM"){_507=_506;}else{if(_504=="userUpload"){_507=_505;}else{if(_504=="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(_504,_507);}else{_502.unbind("click",processAllMyAreaMainClick).click(processAllMyAreaMainClick);_502.unbind("click",processAllActionClick).click(processAllActionClick);allFilterOption(_500);showAuthorPopout(_502);if(_501=="following"){setFocusToContainer(_502.find("#followingAuthors"),false,100,0);}}if(_500=="dashBoard"){if(typeof WmsContacts!="undefined"&&ch==true){var _509=WmsContacts.getZohoContacts();setPresence(_509,"followingUserDetails");setPresence(_509,"followersUserDetails");setPresenceInMyArea(_509,"current_recentActivity_List");}}if(_500=="watchList"){if(typeof WmsContacts!="undefined"&&ch==true){var _509=WmsContacts.getZohoContacts();setPresenceInMyArea(_509,"userChat_watchTopics");}}if(_500=="privateMsg"){if(typeof WmsContacts!="undefined"&&ch==true){var _509=WmsContacts.getZohoContacts();setPresenceInMyArea(_509,"userChat_inbox");}}}function avatarImageFocus(_50a){var _50b=_50a.find("li.selected").attr("count");var _50c=parseInt(_50b/7);if(_50b%7==0){_50c=_50c-1;}_50a.scrollTop(_50c*60);}function UserPhotoPreference(_50d,_50e){if(_50e=="uploadUserPhoto"){$("#uploadPhotoCont").find("input[name=\"imageFileName\"]").val("");$("#uploadPhotoCont").find("img[purpose=\"uploadPhotoLoadingCont\"]").remove();$("#uploadPhotoPreference").attr("src",_50d);$("#uploadPhotoCont").find("img[purpose=\"avat_Image\"]").attr("src",_50d);$("#userSelectedAvatarImage").attr("value",_50d);$("#userSelectedProfileImage").attr("value",_50d);$("#preferenceInnerContent").find("form").attr("userUploadPhotoUrl",_50d);$("#userPreferencePhotoCont").find("img").attr("src",_50d);$("#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(_50f){var _510=$(_50f.target);var _511=_510.parent();if($("#loadingImg").is(":visible")){return;}else{if(_510.is("a[purpose=\"postTitle\"]")){if(_510.attr("postType")=="draft"){editDraftPost(_510);return;}showLoadingImage();if(isTopicQuickView=="false"){}else{var _512=_510.attr("forumTopicId");var _513=_510.attr("recentResponseId");if(_513!=undefined){processHash("Topic/"+_512+"/"+_513);}else{processHash("Topic/"+_512);}return false;}}else{if((_510.is("a[purpose=\"forumAction\"]")||_510.is("a[purpose=\"categoryAction\"]"))&&_510.attr("isNiceUrl")!="Yes"){var _514=_510.attr("hashPurpose");processHash(_514);}else{if((_510.is("a[purpose=\"authorProfile\"],a[purpose=\"authorProfileMore\"]"))&&_510.attr("isNiceUrl")!="Yes"){var _515=_510.attr("authorName");var _516=_510.attr("singleClickflag");if(_516=="0"){if(_515==ZU_Name){processHash("MyArea");_510.attr("singleClickflag","1");}else{processHash("User/"+_515);_510.attr("singleClickflag","1");}}return;}else{if(_510.is("div[purpose=\"unWatch\"]")){unWatchItem(_510);return;}else{if(_510.is("a[purpose=\"moreFollowing\"]")&&_510.attr("isNiceUrl")!="Yes"){processHash("myarea/watchList/following");return;}else{if(_510.is("a[purpose=\"moreFollowers\"]")&&_510.attr("isNiceUrl")!="Yes"){processHash("myarea/watchList/follower");return;}else{if(_511.is("li[deletepurpose=\"deleteAttachment\"]")){deletePublishedAttachment(_511,_50f);return;}else{if(_510.is("li.navBtnEnabled")&&_510.is("li[action=\"false\"]")){var type=_510.attr("purpose");fnPaginationProcess(_511,type);return;}}}}}}}}}}function processAllActionClick(_518){var _519=$(_518.target);var _51a=_519.parent();var _51b=$("#myAreaLists").attr("currView");if(!_51b){_51b="authorProfile";}if($("#loadingImg").is(":visible")){return;}else{if(_519.is(".bigPlusIcon")){var _51c=_519.parents("li.headerContent");if(!_51c.find("div.expandTextContent").is(":visible")||_51b=="privateMsg"){_51c.find("div.textContent").addClass("expandTextContent").show();_51c.parents("div.moderateSinglePost").find("div.lowerButton").show();}else{_51c.find("div.textContent").addClass("expandTextContent");}_519.removeClass("bigPlusIcon").addClass("bigMinusIcon");setFocusToContainer(_519,true,200);return;}else{if(_519.is(".bigMinusIcon")){var _51c=_519.parents("li.headerContent");_51c.find("div.textContent").removeClass("expandTextContent").hide();_51c.parents("div.moderateSinglePost").find("div.lowerButton").hide();_519.removeClass("bigMinusIcon").addClass("bigPlusIcon");return;}else{if(_51a.is("li[purpose=\"expandedView\"]")||_51a.is("li[purpose=\"listView\"]")){manageExpandOrCollapseType(_51a,_51b);return;}else{if(_519.is("li.navBtnEnabled")&&_519.is("li[action=\"true\"]")){var _51d=_519.attr("purpose");if(_51b=="authorProfile"){fnPagination(_51a,_51d,"true");}else{fnPagination(_51a,_51d);}return;}else{if(_519.is("li[purpose=\"removeBookMark\"]")){removeBookMarkAction(_519);return;}else{if(_51a.is("li[purpose=\"removeBookMark\"]")){removeBookMarkAction(_51a);return;}else{if(_519.is("li[purpose=\"postTitle\"]")){if(_519.attr("postType")=="draft"){editDraftPost(_519);return;}showLoadingImage();if(isTopicQuickView=="false"){}else{var _51e=_519.attr("forumTopicId");processHash("Topic/"+_51e);return false;}}else{if(_51a.is("li[purpose=\"postTitle\"]")){if(_51a.attr("postType")=="draft"){editDraftPost(_51a);return;}showLoadingImage();if(isTopicQuickView=="false"){}else{var _51e=_51a.attr("forumTopicId");processHash("Topic/"+_51e);return false;}}else{if(_51a.is("li[purpose=\"delete\"]")){myJournalsDeletePost(_51a,_51b+"Tab");return;}else{if(_519.is("li[purpose=\"delete\"]")){myJournalsDeletePost(_519,_51b+"Tab");return;}else{if(_519.is("li[purpose=\"topics\"]")||_519.is("li[purpose=\"drafts\"]")||_519.is("li[purpose=\"replies\"]")||_519.is("li[purpose=\"authorTopics\"]")||_519.is("li[purpose=\"authorReplies\"]")||_519.is("li[purpose=\"privateMsg\"]")){$("#"+_51b+"Tab").find("li").removeClass("selected");myAreaAllTabClick(_519,_51b);return;}else{if(_51a.is("li[purpose=\"topics\"]")||_51a.is("li[purpose=\"drafts\"]")||_51a.is("li[purpose=\"replies\"]")||_51a.is("li[purpose=\"authorTopics\"]")||_51a.is("li[purpose=\"authorReplies\"]")||_51a.is("li[purpose=\"privateMsg\"]")){$("#"+_51b+"Tab").find("li").removeClass("selected");myAreaAllTabClick(_51a,_51b);return;}else{if(_519.attr("purpose")=="watchTopics"||_519.attr("purpose")=="watchUsers"||_519.attr("purpose")=="watchForums"||_519.attr("purpose")=="watchCategories"||_519.attr("purpose")=="simpleView"||_519.attr("purpose")=="followers"){$("#watchListTabs").find("li").removeClass("selected");myAreaAllTabClick(_519,"watchList");}else{if(_51a.attr("purpose")=="watchTopics"||_51a.attr("purpose")=="watchUsers"||_51a.attr("purpose")=="watchForums"||_51a.attr("purpose")=="watchCategories"||_51a.attr("purpose")=="simpleView"||_51a.attr("purpose")=="followers"){$("#watchListTabs").find("li").removeClass("selected");myAreaAllTabClick(_51a,"watchList");}else{if(_519.is("li[purpose=\"unWatch\"]")){unWatchItem(_519);return;}else{if(_51a.is("li[purpose=\"unWatch\"]")){unWatchItem(_51a);return;}else{if(_51a.is("li[purpose=\"unWatchItem\"]")){unWatchItem(_51a,"authorProfile");}else{if(_519.attr("purpose")=="inbox"||_519.attr("purpose")=="sent"){$("#privateMsgTab").find("li").removeClass("selected");myAreaAllTabClick(_519,"privateMsg");return;}else{if(_51a.attr("purpose")=="inbox"||_51a.attr("purpose")=="sent"){$("#privateMsgTab").find("li").removeClass("selected");myAreaAllTabClick(_51a,"privateMsg");return;}else{if(_519.is("li[purpose=\"deleteThisPM\"]")){deletePrivateMsg(_519);}else{if(_51a.is("li[purpose=\"deleteThisPM\"]")){deletePrivateMsg(_51a);}else{if(_519.is("li[purpose=\"replyToThisPM\"]")){replyToPrivateMsg(_519);}else{if(_51a.is("li[purpose=\"replyToThisPM\"]")){replyToPrivateMsg(_51a);}else{if(_51a.is("a[purpose=\"postConversation\"]")){privateConversation(_51a);}else{if(_519.is("a[purpose=\"postConversation\"]")){privateConversation(_519);}else{if(_519.is("a[purpose=\"postConversationTitle\"]")){var _51f=_519.parents("li.headerContent");var _520=_51f.find("div.textContent");if(_520.is(":visible")){_51f.find("div.bigMinusIcon").trigger("click");}else{_51f.find("div.bigPlusIcon").trigger("click");}}}}}}}}}}}}}}}}}}}}}}}}}}}}}function allFilterOption(type){$("#"+type+"_Filter").change(function(){var _522=$(this);var _523=_522.val();var _524=$(this).find("option[filterType=\""+_523+"\"]");if(_522.attr("action")=="true"){myJournalsFilterAction(_524,type);}else{myJournalsFilter(_524,type);}});}function removeBookMarkAction(_525){var _526=_525.attr("forumTopicId");var _527={};_527.forumGroupId=forumGroupId;_527.forumTopicId=_526;_527[csrfParamName]=csrfToken;doAjaxAction("/removeBookMark.do",_527,function(data){hideLoadingImage();showTipper(i18n["zohodiscussions.bookMark.successfullyRemoveBookMark"],"success");$("#bookMark_"+_526).remove();},function(err){var _52a=eval(err.responseText);showMessage(_52a.reason,"failure");hideLoadingImage();});}function processPreferenceClick(_52b){var _52c=$(_52b.target);var _52d=_52c.parent();var _52e=$("#preferenceInnerContent").find("form").attr("userUploadPhotoUrl");var _52f=$("#preferenceInnerContent").find("form").attr("userIAMphoto");if($("#loadingImg").is(":visible")){return;}if(_52c.attr("purpose")=="profile"||_52c.attr("purpose")=="notification"||_52c.attr("purpose")=="privacy"){_52d.find("li.selected").removeClass("selected");_52c.addClass("selected");myAreaAllTabClick(_52c,"preference");}else{if(_52d.attr("purpose")=="profile"||_52d.attr("purpose")=="notification"||_52d.attr("purpose")=="privacy"){_52d.parent("ul").find("li.selected").removeClass("selected");_52d.addClass("selected");myAreaAllTabClick(_52d,"preference");}else{if(_52c.is("input[purpose=\"save\"]")||_52d.is("input[purpose=\"save\"]")){updateUserPreference();}else{if(_52d.is("li[purpose=\"avat_Image\"]")){$("#user_IamImage").find("div.profilePhotoSelected").removeClass("profilePhotoSelected").addClass("profilePhoto");$("#user_AvatarImage").find("li.selected").removeClass("selected");_52d.addClass("selected");var src=_52c.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(_52c.is("#myComputer")){$("#zohoAccountMess").remove();$("#uploadPhotoCont").remove();$("#curr_UploadPhoto_Cont").remove();$("#fgid").remove();$("#allAvatarList").hide();$("#myComputer").addClass("selected").siblings("li.selected").removeClass("selected");insertBrowserOptionToUpload("userUpload",_52e);}else{if(_52c.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",_52f);}else{if(_52c.is("#AvatarsList")){$("#zohoAccountMess").remove();$("#uploadPhotoCont").remove();$("#curr_UploadPhoto_Cont").remove();$("#AvatarsList").addClass("selected").siblings("li.selected").removeClass("selected");if($("#fgid").length==0){var _531=$("<input type = \"hidden\" id=\"fgid\" name=\"forumGroupId\" value=\""+forumGroupId+"\"/>");_531.insertAfter($("#preferenceInnerContent > form > input[name=\"avatar\"]")).show();}var _532=$("#allAvatarList").find("li.selected").find("img").attr("src");$("#userSelectedAvatarImage").attr("value",_532);$("#userSelectedProfileImage").attr("value",_532);$("#allAvatarList").show();avatarImageFocus($("#user_AvatarImage"));}else{if(_52d.is("div[purpose=\"avat_Image\"]")){$("#user_AvatarImage").find("li.selected").removeClass("selected");_52d.removeClass("profilePhoto").addClass("profilePhotoSelected");$("#userSelectedProfileImage").val("yes");var src=_52c.attr("src");$("#userPreferencePhotoCont").find("img").attr("src",src);$("#userSelectedAvatarImage").val(src);$("#zohoAccounts").removeAttr("purpose");$("#myComputer").removeAttr("purpose");}}}}}}}}}function insertBrowserOptionToUpload(_533,_534){var _535=$("#preferenceInnerContent").find("form").attr("userUploadPhotoUrl");var _536=$("#preferenceInnerContent").find("form").attr("userIAMphoto");if(_533=="IAM"){var _537=$("#uploadPhoto_Cont");var _538=_537.clone();_538.insertAfter($("#user_AvatarImage").find("ul")).show();_538.attr("id","curr_UploadPhoto_Cont");_538.attr("purpose","userPhotoTemplate");_538.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>");_538.find("div.iFrameContainer").html("<iframe name = \"fileUpdTgt_user\"> </iframe>");_538.find("form").attr("target","fileUpdTgt_user");var _539=$("<input type = \"hidden\"  name=\"forumGroupId\" value=\""+forumGroupId+"\"/>");_539.insertAfter($("#curr_UploadPhoto_Cont").find("div[purpose=\"uploadPhotoContent\"]"));$("#curr_UploadPhoto_Cont").find("div[purpose=\"uploadName\"]").html("Zoho image");_538.find(":file").change(function(){_538.find("[purpose=\"uploadPhotoLoadingCont\"]").show();_538.find(":input[name=\"attacher\"]").val("");_538.find("form").get(0).submit();});var _53a=$("#zohoAccounts").attr("purpose");var _53b="profilePhoto";if(typeof _53a!="undefined"){_53b="profilePhotoSelected";}var _53c=$("<div class=\""+_53b+"\"  imgpurpose=\"IAMPhotoSelected\"><img height=\"48\" width=\"48\" purpose=\"avat_Image\" src=\""+_536+"\"/></div>");_53c.insertBefore($("#curr_UploadPhoto_Cont").find("form"));$("<div class=\"boldText\" style=\"margin-left:120px;margin-top:-45px;margin-right:100px;\">change photo:</div>").insertAfter($("#curr_UploadPhoto_Cont").find("div[imgpurpose=\"IAMPhotoSelected\"]"));$("#curr_UploadPhoto_Cont").find("div[imgpurpose=\"IAMPhotoSelected\"]").click(function(){var _53d=$("#preferenceInnerContent").find("form").attr("userIAMphoto");$("#userPreferencePhotoCont").find("img").attr("src",_53d);var _53e=$("#userPreferencePhotoCont").attr("currentPref");if(_53e="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(_533=="userUpload"){var _537=$("#uploadPhoto_Cont");var _53f=_537.clone();_53f.insertAfter($("#user_AvatarImage").find("ul")).show();_53f.attr("id","uploadPhotoCont");_53f.attr("purpose","uploadUserPhotoTemplate");_53f.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>");_53f.find(":input[type=\"file\"]").attr("name","imageFileName");_53f.find("div.iFrameContainer").html("<iframe name = \"fileUpdTgt_user\"> </iframe>");_53f.find("form").attr("target","fileUpdTgt_user");var _539=$("<input type = \"hidden\"  name=\"forumGroupId\" value=\""+forumGroupId+"\"/>");var _540=$(" <input type=\"hidden\" value=\"uploadUserPhoto\" name=\"purpose\"/>");_539.insertAfter($("#uploadPhotoCont").find("div[purpose=\"uploadPhotoContent\"]"));_540.insertAfter($("#uploadPhotoCont").find("div[purpose=\"uploadPhotoContent\"]"));_53f.find(":file").change(function(){_53f.find("[purpose=\"uploadPhotoLoadingCont\"]").show();_53f.find("form").get(0).submit();});var _53a=$("#myComputer").attr("purpose");var _53b="profilePhoto";if(typeof _53a!="undefined"){_53b="profilePhotoSelected";}var _53c=$("<div class=\""+_53b+"\" imgpurpose=\"userUploadedPhotoSelected\"><img height=\"48\" width=\"48\" purpose=\"avat_Image\" src=\""+_535+"\"/></div>");_53c.insertBefore($("#uploadPhotoCont").find("form"));$("<div class=\"boldText\" style=\"margin-left:120px;margin-top:-45px;margin-right:100px;\">change photo:</div>").insertAfter($("#uploadPhotoCont").find("div[imgpurpose=\"userUploadedPhotoSelected\"]"));$("#uploadPhotoCont").find("div[imgpurpose=\"userUploadedPhotoSelected\"]").click(function(){var _541=$("#preferenceInnerContent").find("form").attr("userUploadPhotoUrl");$("#uploadPhotoCont").find("div.profilePhoto").removeClass("profilePhoto").addClass("profilePhotoSelected");$("#userPreferencePhotoCont").find("img").attr("src",_541);$("#user_Photo").attr("value","userUpload");$("#allAvatarList").find("li.selected").removeClass("selected");var _542=$("#userPreferencePhotoCont").attr("currentPref");if(_542="IAM"){$("#zohoAccounts").removeAttr("purpose");$("#myComputer").attr("purpose","userUploadselected");}});}}}function uploadUserPhoto(_543,_544){$("#curr_UploadPhoto_Cont").find("img[purpose=\"uploadPhotoLoadingCont\"]").remove();if(_543=="failure"){showMessage(_544+" ,Please try again.","failure");}else{$("#curr_UploadPhoto_Cont").find("input[name=\"uploadPhotoFile\"]").val("");var _545=$("#preferenceInnerContent").find("form").attr("photoUrl");var src=_545+"/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 _547=$("#imgContUl");var _548=_547.find("li.listAvatarSelected");var src=_548.find("img").attr("src");_547.find("input[name=\"avatar\"]").val(src);}var _54a=$("#wikiUrl");var _54b=$("#blogUrl");var _54c=$("#webSite");var _54d=sanitizeURL($.trim(""+_54a.val()));var _54e=sanitizeURL($.trim(""+_54b.val()));var _54f=sanitizeURL($.trim(""+_54c.val()));_54a.val(_54d);_54b.val(_54e);_54c.val(_54f);doAjaxAction("/updateUserSetting.do",$("#preferenceInnerContent").find("form").serialize(),function(data){if(data=="SUCCESS"){showTipper(i18n["zohodiscussions.userpreference.userprofileupdated"],"success");var _551=$("#userSelectedAvatarImage").val();$("#topContainerPhoto").find("img").attr("src",_551);processHash("myArea/preference");}},function(err){var _553=eval(err.responseText);showMessage(_553.reason,"failure");});}function editDraftPost(_554){showLoadingImage();var _555=_554.attr("authorId");var _556=_554.attr("forumTopicId");var _557={};_557.forumGroupId=forumGroupId;_557.forumTopicId=_556;_557[csrfParamName]=csrfToken;_557.editMode="true";var _558=_554.attr("forumId");var _559=_554.attr("categoryId");if(_555==ZUID){_557.access="author";}doAjaxAction("/editDraft.do",_557,function(data){hideLoadingImage();document.title=i18n["zohodiscussions.writePost.documentTitle"]+" - "+forumGroupName;$("#mainContent").get(0).innerHTML=data;$("#SelectForum").val(_558);initWritePost();$("#SelectCategory").val(_559);},function(_55b){var _55c=eval(_55b.responseText);showMessage(_55c.reason,"failure");hideLoadingImage();});}function myJournalsDeletePost(_55d,_55e){var _55f=_55d.attr("authorId");var _560=_55d.attr("action");var _561={};_561.forumGroupId=forumGroupId;_561.forumId=_55d.attr("forumId");_561.categoryId=_55d.attr("categoryId");_561.forumTopicId=_55d.attr("forumTopicId");_561[csrfParamName]=csrfToken;if(_560=="/deleteForumResponse.do"){_561.responseId=_55d.attr("responseId");}if(_55f==ZUID){_561.access="author";}doAjaxAction(_560,_561,function(data){hideLoadingImage();if(_560=="/deleteForumResponse.do"){showTipper(i18n["zohodiscussions.myJournals.successfullyTopicDeleted"],"success");}else{showTipper(i18n["zohodiscussions.myJournals.successfullyResponseDeleted"],"success");}_55d.parents("div.moderateSinglePost").hide();},function(err){var _564=eval(err.responseText);showMessage(_564.reason,"failure");hideLoadingImage();});}function myJournalsFilter(_565,_566){var _567=_565.attr("purpose");var _568=$("#"+_566+"InnerContent").find("div[status=\"show\"]");_568.attr("currFilterType",_565.text());_568.attr("filterType",_567);_568.find("div.moderateSinglePost").hide();var _569=-1;if(_567=="all"){$listOfTypes=_568.find("div.moderateSinglePost");$listOfTypes.each(function(_56a,item){if(_56a<postPerPage){$(item).show();}_569=_56a;});}else{$listOfTypes=_568.find("div."+_567);$listOfTypes.each(function(_56c,item){if(_56c<postPerPage){$(item).show();}_569=_56c;});}if(_566=="watchList"){_566="watchTopic";}if(postPerPage>_569||_569==-1){$("#"+_566+"Next").removeClass("navBtnEnabled").addClass("navBtnDisabled");}else{$("#"+_566+"Next").removeClass("navBtnDisabled").addClass("navBtnEnabled");}var _56e=$("#"+_566+"Prev");_56e.removeClass("navBtnEnabled").addClass("navBtnDisabled");_56e.parent("ul").attr("fetchPage",1);if(_569==-1){$("#"+_566+"FilterEmptyMsg").show();$("#"+_566+"_Nav").hide();}else{$("#"+_566+"FilterEmptyMsg").hide();$("#"+_566+"_Nav").show();}}function myJournalsFilterAction(_56f,_570){var _571=_56f.parent();var _572=_56f.attr("purpose");var _573=$("#"+_570+"InnerContent").find("div[status=\"show\"]");var _574=_56f.text();_573.attr("currFilterType",_574);var _575=$("#"+_570+"Tab").find("li.selected").attr("purpose");showLoadingImage();var _576=_571.attr(_575+"Action");var _577={};_577.forumGroupId=forumGroupId;_577.userId=_571.attr("userId");_577.filterType=_574;_577[csrfParamName]=csrfToken;doAjaxAction(_576,_577,function(data){hideLoadingImage();_573.get(0).innerHTML=data;if(_570=="myJournals"){var _579=$("#"+_570+"SelectAction");_579.find("li[purpose=\"expandedView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.expandView"]+"</a>");_579.find("li[purpose=\"listView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.listView"]+"</span>");}},function(err){var _57b=eval(err.responseText);showMessage(_57b.reason,"failure");hideLoadingImage();});}function replyToPrivateMsg(_57c){var type=_57c.attr("postType");var _57e=_57c.attr("forumTopicId");var _57f=$("#privateMsgCont_"+_57e);var _580=$("#privateMsg"+type+"Container");var _581="reply";var _582="Write";if(type=="Sent"){_581="edit";_582="Edit";$("#topicContent_"+_57e).hide();}if(_580.data("inEditMode")){showTipper(i18n["zohodiscussions.singlepost.alertmessageforediting"],"failure");setFocusToContainer($("#editorHolder"));return false;}_57f.show();_580.data("inEditMode",true);openEditor($("#privateMsg_"+_57e),"privateMsgContent","postContentTA",_581+"PrivateMsg_"+_57e,_582,"privateMsg"+type+"Container");return false;}function addPrivateMsg(_583,_584,_585,type){showLoadingImage();if(type=="UserPM"){var _587=$("#privateMsgTab").find("li.selected");_587.attr("isthere","false");}var _588=$("#postContentTA");var _589="";if(_584&&_584=="Edit"){_589=_588.parent().find("input[name=\"forumPostTitle\"]").val();_589=_589.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_589==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noTitleInPost"],"failure");return;}}var _58a=_588.data("editor").val();_58a=_58a.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_58a==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");return;}_588.val(_58a);var _58b=(_584&&_584=="Edit")?"/editPrivateMsg.do":(type=="UserPM")?"/addPrivateMsg.do":"/replyToPM.do";doAjaxAction(_58b,$("#editorHolder").serialize(),function(data){hideLoadingImage();showTipper(i18n["zohodiscussions.privateMsg.successfullyPMAdded"],"success");if(_584=="Edit"){var _58d=$("#privateMsgCont_"+_583).parent("li");_58d.find("a[purpose=\"postConversationTitle\"]").html(_589);$("#cancelResponse").trigger("click");}else{if(type=="UserPM"){var _58e=$("#UserPM").attr("authorName");processHash("user/"+_58e);}else{processHash("myArea/privateMsg");}}},function(err,desc,_591){var _592=eval(err.responseText);if(_592.errorcode=="HIP_REQUIRED"){var _593=$("#replyPMContActual").show().find("div[purpose=\"responseCaptcha\"]");_593.find(":input").val("");if(_593.attr("currCaptcha")=="new"){showMessage(i18n["zohodiscussions.writePost.captchaMsg"],"failure");}else{showMessage(i18n["zohodiscussions.writePost.captchaErrorMsg"],"failure");}_593.find("img[purpose=\"captchaImage\"]").replaceWith("<img purpose=captchaImage name=hipImg border=0 src=/showcaptcha?digest="+_592.reason+" align=absmiddle alt=HIP image>");_593.find(":input").attr("name",_592.reason);_593.attr("currCaptcha","old");_593.show();}else{showMessage(_592.reason,"failure");}hideLoadingImage();});return false;}function deletePrivateMsg(_594){var _595=_594.attr("forumTopicId");var _596={};_596.forumGroupId=forumGroupId;_596.forumTopicId=_595;_596[csrfParamName]=csrfToken;doAjaxAction("/deletePM.do",_596,function(data){hideLoadingImage();showTipper(i18n["zohodiscussions.privateMsg.successfullyPMDeleted"],"success");var _598=$("#privateMsgTab").find("li.selected");if(_598.attr("purpose")=="inbox"){processHash("myArea/privateMsg");}else{_598.attr("isthere","false").trigger("click");}},function(err){var _59a=eval(err.responseText);showMessage(_59a.reason,"failure");hideLoadingImage();});}function privateConversation(_59b){var _59c=_59b.attr("forumTopicId");var _59d=$("#privateConversation_"+_59c).html();var _59e=$("#privateConversation");_59e.show();$("#privateConversationCont").get(0).innerHTML=_59d;$("#privateConversationClose").unbind("click").click(function(){_59e.hide();return;});$("#morePrivateConversation").unbind("click").click(function(){_59e.hide();showLoadingImage();openSinglePost(_59c);return;});}function myAreaAllTabClick(_59f,_5a0){var _5a1=$("#"+_5a0+"InnerContent");var _5a2=_5a1.find("div[status=\"show\"]");_59f.addClass("selected");var _5a3=_59f.attr("purpose");var _5a4=_59f.attr("isthere");var _5a5=_5a1.find("div[purpose=\"author_"+_5a3+"\"]");_5a2.attr("status","hide").hide();if(_5a0=="authorProfile"){if(_5a3=="privateMsg"){$("#authorProfileContentAction").hide();}else{$("#authorProfileContentAction").show();}}if(_5a0=="watchList"){if(_5a3!="watchTopics"){$("#"+_5a0+"_Filter").parent().hide();}else{$("#"+_5a0+"_Filter").parent().show();}}if(_5a0=="myJournals"||_5a0=="privateMsg"||_5a0=="authorProfile"){var _5a6=$("#"+_5a0+"SelectAction");if(_5a4=="true"){if(_5a0=="myJournals"||_5a0=="authorProfile"){var _5a7=$("#"+_5a0+"_Filter");if(_5a3=="replies"||_5a3=="authorReplies"){_5a7.parent().hide();}else{_5a7.parent().show();var _5a8=_5a5.attr("currFilterType");_5a7.val(_5a8);}}_5a5.attr("status","show").show();if(_5a5.find("div.collapse").length>0){_5a6.find("li[purpose=\"expandedView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.expandView"]+"</a>");_5a6.find("li[purpose=\"listView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.listView"]+"</span>");}else{if(_5a5.find("div.expand").length>0){_5a6.find("li[purpose=\"expandedView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.expandView"]+"</span>");_5a6.find("li[purpose=\"listView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.listView"]+"</a>");}}if(_5a0=="privateMsg"){if(typeof WmsContacts!="undefined"&&ch==true){var _5a9=WmsContacts.getZohoContacts();setPresenceInMyArea(_5a9,"userChat_"+_5a3);}}return;}}else{if(_5a4=="true"){_5a5.attr("status","show").show();if(_5a0=="watchList"){if(typeof WmsContacts!="undefined"&&ch==true){var _5a9=WmsContacts.getZohoContacts();setPresenceInMyArea(_5a9,"userChat_"+_5a3);}}return;}}showLoadingImage();var _5a3=_59f.attr("purpose");var _5aa=_59f.attr("action");var _5ab={};if(_5a3!="privateMsg"){_5ab.forumGroupId=forumGroupId;_5ab[csrfParamName]=csrfToken;if(_5a0=="myJournals"||_5a0=="authorProfile"){_5ab.userId=_59f.attr("userId");}}if(_5a0=="myJournals"){_5ab.viewType="myself";}doAjaxAction(_5aa,_5ab,function(data){hideLoadingImage();var _5ad;if(_5a0=="myJournals"||_5a0=="authorProfile"){_5ad=$("<div purpose=author_"+_5a3+" status=show currFilterType=all></div>").html(data);var _5ae=$("#"+_5a0+"_Filter");if(_5a3=="replies"||_5a3=="authorReplies"){_5ae.parent().hide();}else{_5ae.parent().show();_5ae.val("All");}}else{_5ad=$("<div purpose=author_"+_5a3+" status=show id=userChat_"+_5a3+"></div>").html(data);}hideLoadingImage();showAuthorPopout(_5ad);_5ad.insertAfter(_5a2);_59f.attr("isthere","true");if(_5a3=="drafts"||_5a3=="inbox"||_5a3=="sent"||_5a3=="authorTopics"){_5a6.find("li[purpose=\"expandedView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.expandView"]+"</a>");_5a6.find("li[purpose=\"listView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.listView"]+"</span>");}else{if(_5a3=="replies"||_5a3=="authorReplies"){_5a6.find("li[purpose=\"expandedView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.expandView"]+"</span>");_5a6.find("li[purpose=\"listView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.listView"]+"</a>");}}if(_5a0=="privateMsg"||_5a0=="watchList"){if(typeof WmsContacts!="undefined"&&ch==true){var _5af=WmsContacts.getZohoContacts();setPresenceInMyArea(_5af,"userChat_"+_5a3);}}},function(err){var _5b1=eval(err.responseText);showMessage(_5b1.reason,"failure");hideLoadingImage();});}function manageExpandOrCollapseType(_5b2,_5b3){var _5b4=_5b2.attr("purpose");if(_5b2.find("a").length<1){return;}var _5b5=$("#"+_5b3+"InnerContent");var _5b6=$("#"+_5b3+"SelectAction");var _5b7=_5b5.find("div[status=\"show\"]");if(_5b4=="expandedView"){_5b7.find("div.collapse").attr("class","expand");_5b7.find("div.expand div.bigPlusIcon").removeClass("bigPlusIcon").addClass("bigMinusIcon");_5b7.find("div.textContent").addClass("expandTextContent").show();_5b7.find("div.moderateSinglePost div.lowerButton").show();_5b6.find("li[purpose=\"expandedView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.expandView"]+"</span>");_5b6.find("li[purpose=\"listView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.listView"]+"</a>");}else{if(_5b4=="listView"){_5b7.find("div.expand").attr("class","collapse");_5b7.find("div.collapse div.bigMinusIcon").removeClass("bigMinusIcon").addClass("bigPlusIcon");_5b7.find("div.textContent").addClass("expandTextContent").hide();_5b7.find("div.moderateSinglePost div.lowerButton").hide();_5b6.find("li[purpose=\"expandedView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.expandView"]+"</a>");_5b6.find("li[purpose=\"listView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.listView"]+"</span>");}}return;}function manageCountValue(_5b8){var _5b9=$("#"+_5b8).find("li.selected");var _5ba=_5b9.attr("count");_5ba=--_5ba;var _5bb=_5b9.attr("purpose");if(_5bb=="watchTopics"){_5b9.find("a").html(i18n["zohodiscussions.myJournals.topics"]+"("+_5ba+")");}else{if(_5bb=="authorReplies"){_5b9.find("a").html(i18n["zohodiscussions.general.replies"]+"("+_5ba+")");}else{if(_5bb=="watchUsers"){_5b9.find("a").html(i18n["zohodiscussions.watchList.users"]+"("+_5ba+")");}else{if(_5bb=="inbox"){_5b9.find("a").html(i18n["zohodiscussions.privateMsg.inbox"]+"("+_5ba+")");}else{if(_5bb=="sent"){_5b9.find("a").html(i18n["zohodiscussions.privateMsg.sent"]+"("+_5ba+")");}}}}}_5b9.attr("count",_5ba);}function fnPagination(_5bc,_5bd,_5be){showLoadingImage();var _5bf=_5bc.attr("action");var _5c0=_5bc.attr("currType");var _5c1={};if(_5be=="true"){_5c0="authorProfile";}var _5c2=$("#"+_5c0+"InnerContent").find("div[status=\"show\"]");_5c1.forumGroupId=forumGroupId;if(_5c0!="privateMsg"){_5c1.userId=_5bc.attr("userId");var _5c3=$("#"+_5c0+"Tab").find("li.selected").attr("purpose");if(_5c3=="topics"||_5c3=="drafts"||_5c3=="authorTopics"){_5c1.filterType=_5c2.attr("currfiltertype");}}if(_5c0=="myJournals"){_5c1.viewType="myself";}var _5c4=parseInt(_5bc.attr("fetchPage"));if(_5bd=="next"){_5c1.fetchPage=_5c4+1;}else{_5c1.fetchPage=_5c4-1;}_5c1.getPostFor=_5bc.attr("getPostFor");doAjaxAction(_5bf,_5c1,function(data){hideLoadingImage();_5c2.get(0).innerHTML=data;var _5c6=$("#"+_5c0+"Tab").find("li.selected").attr("purpose");var _5c7=$("#"+_5c0+"SelectAction");if(_5c6=="replies"){_5c7.find("li[purpose=\"expandedView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.expandView"]+"</span>");_5c7.find("li[purpose=\"listView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.listView"]+"</a>");}else{_5c7.find("li[purpose=\"expandedView\"]").html("<a class=underline href=javaScript:;>"+i18n["zohodiscussions.myArea.expandView"]+"</a>");_5c7.find("li[purpose=\"listView\"]").html("<span class=boldText>"+i18n["zohodiscussions.myArea.listView"]+"</span>");}},function(err){var _5c9=eval(err.responseText);showMessage(_5c9.reason,"failure");hideLoadingImage();});}function fnPaginationProcess(_5ca,type){var _5cc=parseInt(_5ca.attr("fetchPage"));var _5cd=_5ca.attr("currType");var _5ce=_5ca.attr("postCount");if(type=="next"){_5cc=_5cc+1;}else{_5cc=_5cc-1;}_5ca.attr("fetchPage",_5cc);var _5cf=$("#current_"+_5cd+"_List");var _5d0=(_5cc*postPerPage);var _5d1=(_5d0-postPerPage)+1;var _5d2=_5d1;if(_5ce<=_5d0){_5d0=_5ce;_5ca.find("li[purpose=\"next\"]").removeClass("navBtnEnabled").addClass("navBtnDisabled");}else{_5ca.find("li[purpose=\"next\"]").removeClass("navBtnDisabled").addClass("navBtnEnabled");}if(_5d1==1){_5ca.find("li[purpose=\"prev\"]").removeClass("navBtnEnabled").addClass("navBtnDisabled");}else{_5ca.find("li[purpose=\"prev\"]").removeClass("navBtnDisabled").addClass("navBtnEnabled");}if(_5cd=="recentActivity"){_5cf.find("li").hide();for(_5d2;_5d2<=_5d0;_5d2++){$("#recentActivity_"+_5d2).show();}}else{_5cf.find("div.moderateSinglePost").hide();var _5d3=_5cd;if(_5cd=="watchTopic"){_5cd="watchList";}var _5d4=$("#"+_5cd+"InnerContent").find("div[status=\"show\"]").attr("filterType");if((_5cd=="watchList"||_5cd=="bookMark")&&_5d4!="all"){var _5d5;$listOfTypes=_5cf.find("."+_5d4);_5d2--;$listOfTypes.each(function(_5d6,item){if(_5d6<_5d0&&_5d2<=_5d6){$(item).show();}_5d5=_5d6;});}else{for(_5d2;_5d2<=_5d0;_5d2++){_5cf.find("div.moderateSinglePost[listStage=\""+_5d3+"_"+_5d2+"\"]").show();}}}}function getAuthorProfile(_5d8){showLoadingImage();var _5d9=$("#userProfileMainContainer");if(_5d9.length>0&&_5d9.is("[shouldReload=\"false\"]")){_5d9.show().attr("shouldReload","true").siblings().remove();hideLoadingImage();}else{var _5da={};_5da.forumGroupId=forumGroupId;_5da.authorName=_5d8;_5da[csrfParamName]=csrfToken;_5da.ch=ch;doAjaxAction("/getAuthorProfile.do",_5da,function(data){hideLoadingImage();$("#authorPopout:visible").hide();$("#mainContent").get(0).innerHTML=data;$.history.add("User/"+_5d8);bindAuthorProfileActions(_5d8);},function(err){var _5dd=eval(err.responseText);showMessage(_5dd.reason,"failure");hideLoadingImage();});}}function bindAuthorProfileActions(_5de){$("#mainContent").unbind("click",processAuthorProfileClick).click(processAuthorProfileClick);$("#mainContent").unbind("click",processAllMyAreaMainClick).click(processAllMyAreaMainClick);$("#mainContent").unbind("click",processAllActionClick).click(processAllActionClick);allFilterOption("authorProfile");var _5df=$("#mainContent > #userProfileMainContainer").attr("authorId");$("#authorPopout_"+_5df).hide();if(typeof WmsContacts!="undefined"&&ch==true){var _5e0=WmsContacts.status(_5df);if(_5e0===false){_5e0=9;}manageUserChatStatus("userOnlineStatus_"+_5de,_5e0,_5de);}}function processAuthorProfileClick(_5e1){var _5e2=$(_5e1.target);var _5e3=_5e2.parent();if($("#loadingImg").is(":visible")){return;}else{if(_5e3.is("li[purpose=\"sendPM\"]")){addPrivateMessage(_5e3);}else{if(_5e3.is("li[purpose=\"watchItem\"]")){watchItem(_5e3);}else{if(_5e3.is("li[purpose=\"blockUser\"]")){blockUser(_5e3);}else{if(_5e3.is("li[purpose=\"unBlockUser\"]")){unBlockUser(_5e3);}else{if(_5e3.is("li[purpose=\"moderateUser\"]")){moderateUser();}else{if(_5e3.is("li[purpose=\"assignLabel\"]")){bindUserLabelsAction();}}}}}}}}function writePrivateMsg(){var _5e4=$("#sentPrivateMsg");var _5e5=$("#editorContainer_PM");if(_5e5.data("inEditMode")){showMessage(i18n["zohodiscussions.singlepost.alertmessageforediting"],"failure");return false;}_5e4.show();openEditor($("#editPM"),"privateMsgContent","postContentTA","UserPM","Write","editorContainer_PM");_5e5.data("inEditMode",true);}function watchItem(_5e6){showLoadingImage();var _5e7=_5e6.attr("itemType");var _5e8={};_5e8.forumGroupId=forumGroupId;_5e8.itemType=_5e7;_5e8.itemId=_5e6.attr("itemId");_5e8[csrfParamName]=csrfToken;doAjaxAction("/watchItem.do",_5e8,function(data){hideLoadingImage();showTipper(i18n["zohodiscussions.watchList.successfullyWatchUser"],"success");_5e6.attr("purpose","unWatchItem");_5e6.find("a").html(i18n["zohodiscussions.userProfile.unwatchUser"]);},function(err){var _5eb=eval(err.responseText);showMessage(_5eb.reason,"failure");hideLoadingImage();});}function unWatchItem(_5ec,type){showLoadingImage();var type=_5ec.attr("unWatchType");var _5ee=_5ec.attr("itemId");var _5ef={};_5ef.forumGroupId=forumGroupId;_5ef.itemId=_5ee;_5ef[csrfParamName]=csrfToken;doAjaxAction("/unWatch.do",_5ef,function(data){hideLoadingImage();if(type=="authorProfile"){showTipper(i18n["zohodiscussions.watchList.successfullyUnwatchUser"],"success");_5ec.attr("purpose","watchItem");_5ec.find("a").html(i18n["zohodiscussions.userProfile.watchUser"]);}else{if(type=="following"){showTipper(i18n["zohodiscussions.watchList.successfullyUnwatchUser"],"success");$("#watch_"+_5ee).parents("li").remove();}else{showTipper(i18n["zohodiscussions.watchList.successfullyUnwatchTopic"],"success");$("#watch_"+_5ee).remove();manageCountValue("watchListTabs");}}},function(err){var _5f2=eval(err.responseText);showMessage(_5f2.reason,"failure");hideLoadingImage();});}function blockUser(_5f3){showLoadingImage();var _5f4={};_5f4.forumGroupId=forumGroupId;_5f4.authorId=_5f3.attr("authorId");_5f4[csrfParamName]=csrfToken;doAjaxAction("/blockUser.do",_5f4,function(data){hideLoadingImage();showTipper(i18n["zohodiscussions.userProfile.successfullyBlockUser"],"success");_5f3.attr("purpose","unBlockUser");_5f3.find("a").html(i18n["zohodiscussions.userProfile.unblockUser"]);},function(err){var _5f7=eval(err.responseText);showMessage(_5f7.reason,"failure");hideLoadingImage();});}function unBlockUser(_5f8){showLoadingImage();var _5f9={};_5f9.forumGroupId=forumGroupId;_5f9.authorId=_5f8.attr("authorId");_5f9[csrfParamName]=csrfToken;doAjaxAction("/unBlockUser.do",_5f9,function(data){hideLoadingImage();showTipper(i18n["zohodiscussions.userProfile.successfullyUnBlockUser"],"success");_5f8.attr("purpose","blockUser");_5f8.find("a").html(i18n["zohodiscussions.userProfile.blockUser"]);},function(err){var _5fc=eval(err.responseText);showMessage(_5fc.reason,"failure");hideLoadingImage();});}function moderateUser(){$("#moderateUserTemplate").html($("#dimDivModerateUser").html());$("#dimDivModerateUser").html("");$("#moderateUserTemplate").show();var _5fd=$("#eachForumListForModeration").find(":input[name='forumLevelModeration']");var _5fe=$("#moderateUserPopOutForm").find(":input[name='portalLevelModeration']");if(_5fd.length==0){$("#forumLabel").hide();}if(_5fe.attr("checked")){_5fd.attr("disabled",true);}$("#imgCancel").click(function(){$this=$(this);$("#dimDivModerateUser").html($("#moderateUserTemplate").html());$("#moderateUserTemplate").hide();$("#moderateUserTemplate").html("");var _5ff=$("#moderateUserCont");if(_5ff.attr("status")=="changed"){var _600=$("#userProfileMainContainer");_600.show().attr("shouldReload","true");getAuthorProfile($this.attr("authorName"));}});_5fe.click(function(){$this=$(this);if($this.attr("checked")){_5fd.attr("disabled",true);}else{_5fd.attr("disabled",false);}moderateUserAction($this);});_5fd.click(function(){$this=$(this);moderateUserAction($this);});}function moderateUserAction(_601){var _602=$("#moderateUserCont");_602.attr("status","changed");var _603=_601.attr("authorId");var _604=_601.attr("userName");var _605=_601.attr("moderationStatus");var _606=_601.attr("isAdmin");var _607=_601.attr("isPortal");var _608=0;var _609=false;var _60a="";var _60b="";var _60c={};_60c.authorId=_603;_60c.forumGroupId=forumGroupId;_60c[csrfParamName]=csrfToken;_60c.adminUser=_606;if(_607){_60c.moderateType=1;if(_605=="unmoderated"){_60a=i18n["zohodiscussions.userProfile.moderateUserConfirmMess"]+" "+_604+" "+i18n["zohodiscussions.userProfile.moderateUserPortalLevel"];_60b=i18n["zohodiscussions.userProfile.usermoderatedSuccessMess"];}else{_60a=i18n["zohodiscussions.userProfile.unmoderateUserConfirmMess"]+" "+_604+" "+i18n["zohodiscussions.userProfile.moderateUserPortalLevel"];_60b=i18n["zohodiscussions.userProfile.userUnmoderatedSuccessMess"];}}else{_60c.moderateType=0;var _60d=_601.attr("forumId");_60c.forumId=_60d;var _60e=_601.attr("forumName");if(_605=="unmoderated"){_60a=i18n["zohodiscussions.userProfile.moderateUserConfirmMess"]+" "+_604+" "+i18n["zohodiscussions.general.in"]+" "+_60e+" "+i18n["zohodiscussions.userProfile.moderateUserForumLevel"];_60b=" "+i18n["zohodiscussions.userProfile.usermoderatedSuccessMess"];}else{_60a=i18n["zohodiscussions.userProfile.unmoderateUserConfirmMess"]+" "+_604+" "+i18n["zohodiscussions.general.in"]+" "+_60e+" "+i18n["zohodiscussions.userProfile.moderateUserForumLevel"];_60b=i18n["zohodiscussions.userProfile.userUnmoderatedSuccessMess"];}}if(_605=="unmoderated"){if(confirm(_60a)){doAjaxAction("/moderateUser.do",_60c,function(data){if(data=="SUCCESS"){showTipper(_604+" "+_60b,"success",1000);_601.attr("moderationStatus","moderated");if(!_607){$("#itemListCont_"+_60d).find("span.italicText").html(i18n["zohodiscussions.moderationLeftContainer.moderated"]);}}else{showMessage(i18n["zohodiscussions.moderationAction.errormessage"],"failure");}});}else{var _602=$("#moderateUserCont");_602.attr("status","");if(_607){$("#moderateUserPopOutForm").find(":input[isPortal='true']").attr("checked",false);$("#eachForumListForModeration").find(":input[name='forumLevelModeration']").attr("disabled",false);}else{$("#moderateUserPopOutForm").find(":input[forumId='"+_60d+"']").attr("checked",false);}}}else{if(confirm(_60a)){doAjaxAction("/unModerateUser.do",_60c,function(data){if(data=="SUCCESS"){showTipper(_604+" "+_60b,"success",1000);_601.attr("moderationStatus","unmoderated");if(!_607){$("#itemListCont_"+_60d).find("span.italicText").html(i18n["zohodiscussions.ModerateUsers.ModerateUsers"]);}}else{showMessage(i18n["zohodiscussions.moderationAction.errormessage"],"failure");}});}else{var _602=$("#moderateUserCont");_602.attr("status","");if(_607){$("#moderateUserPopOutForm").find(":input[isPortal='true']").attr("checked",true);$("#eachForumListForModeration").find(":input[name='forumLevelModeration']").attr("disabled",true);}else{$("#moderateUserPopOutForm").find(":input[forumId='"+_60d+"']").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 _611=$(this);var _612=_611.attr("forumId");var _613=_611.attr("userId");var _614=_611.val();var _615={};_615.forumGroupId=forumGroupId;_615.forumId=_611.attr("forumId");_615.userId=_611.attr("userId");_615.labelId=_611.val();_615[csrfParamName]=csrfToken;doAjaxAction("/mapLabelToUser.do",_615,function(data){if(data=="SUCCESS"){_611.find("option[selected]").removeAttr("selected");var _617=_611.find("option[value='"+_614+"']");var _618=_617.text();_617.replaceWith("<option value='"+_614+"' selected>"+_618+"</option>");if(_614=="-1"){showTipper(i18n["zohodiscussions.UserDetails.labelRemovedMsg"],"info");}else{showTipper(i18n["zohodiscussions.UserDetails.labelAddedMsg"],"success");}}});});}function setPresenceInTopicList(dObj,_61a){if(!dObj){return;}var _61b="";if(!_61a){if($("#topicList").length>0){_61b=$("#topicList > div.singleTopicCont > div.chatTopicCont > div.topicMDetails > div.lightGreyText > img.authorChatPresence");}else{_61b=$("#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");_61b.each(function(_61c,item){var _61e=$(item);var _61f=_61e.attr("authorId");if(_61f==ZUID){return;}var _620=_61e.attr("responseId");var _621="";_621=$("#uc_"+_620+"_"+_61f);try{var _622=dObj[_61f]["STATUS"];manageUserChatStatusInTopicList(_621,_622,"topicList");}catch(ex){}});$stickyPostAuthors.each(function(_623,item){var _625=$(item);var _626=_625.attr("authorId");if(_626==ZUID){return;}try{var _627=dObj[_626]["STATUS"];manageUserChatStatusInTopicList(_625,_627);}catch(ex){}});$announcementPostAuthors.each(function(_628,item){var _62a=$(item);var _62b=_62a.attr("authorId");if(_62b==ZUID){return;}try{var _62c=dObj[_62b]["STATUS"];manageUserChatStatusInTopicList(_62a,_62c);}catch(ex){}});}else{_61b=$("#SinglePostContainer_"+_61a+" div.postTitle div.authorChatPresence");_61b.each(function(_62d,item){var _62f=$(item);var _630=_62f.attr("authorId");if(_630==ZUID){return;}var _631=_62f.attr("responseId");var _632="";_632=$("#uc_"+_61a+"_"+_631+"_"+_630);try{var _633=dObj[_630]["STATUS"];manageUserChatStatusInTopicList(_632,_633);}catch(ex){}});}}function setPresenceInMyArea(dObj,_635){if(!dObj){return;}var _636="";if(_635=="current_recentActivity_List"){_636=$("#"+_635+" >li >div.authorChatPresence");}else{if(_635=="userChat_inbox"||_635=="userChat_sent"){_636=$("#"+_635+" div.moderateSinglePost ul li img.authorChatPresence");}else{_636=$("#"+_635+" div.moderateSinglePost ul li div.authorChatPresence");}}_636.each(function(_637,item){var _639=$(item);var _63a=_639.attr("authorId");if(_63a==ZUID){return;}try{var _63b=dObj[_63a]["STATUS"];manageUserChatStatusInTopicList(_639,_63b);}catch(ex){}});}function setPresence(dObj,_63d){if(!dObj){return;}var _63e=$("#"+_63d+" > li > div.userChatPresence");_63e.each(function(_63f,item){var _641=$(item);var _642=_641.attr("authorId");if(_642==ZUID){return;}var _643=_641.attr("id");var _644=_641.attr("authorName");try{var _645=dObj[_642]["STATUS"];manageUserChatStatus(_643,_645,_644);}catch(ex){}});}function manageUserChatStatus(_646,_647,_648){var _649=$("#"+_646);if(_647=="4"){_649.find("div").attr("class","wms-4 chatOverride flLeft").unbind("click",chatInvoker).click(chatInvoker);_649.find("a").html(i18n["zohodiscussions.chat.idleForChat"]);_649.attr("title",_648+" "+i18n["zohodiscussions.chat.isNowIdle"]).unbind("click",chatInvoker).click(chatInvoker);}else{if(_647=="3"){_649.find("div").attr("class","wms-3 chatOverride flLeft").unbind("click",chatInvoker).click(chatInvoker);_649.find("a").html(i18n["zohodiscussions.chat.busyforchat"]);_649.attr("title",_648+" "+i18n["zohodiscussions.chat.isBusyToChat"]).unbind("click",chatInvoker).click(chatInvoker);}else{if(_647=="1"){_649.find("div").attr("class","wms-1 chatOverride flLeft");_649.find("a").html(i18n["zohodiscussions.chat.availableforchatmessage"]);_649.attr("title",_648+" "+i18n["zohodiscussions.chat.isAvailableToChat"]).unbind("click",chatInvoker).click(chatInvoker);}else{if(_647=="0"){_649.find("div").attr("class","wms-0 chatOverride flLeft");_649.find("a").html(i18n["zohodiscussions.chat.offlineforchat"]).unbind("click",chatInvoker).click(chatInvoker);_649.attr("title",i18n["zohodiscussions.chat.offlineforchat"]).unbind("click",chatInvoker).click(chatInvoker);}else{if(_647=="-1"){_649.find("div").attr("class","imgAddContact flLeft");_649.find("a").html(i18n["zohodiscussions.chat.invitedforchat"]);_649.attr("title",i18n["zohodiscussions.chat.youHaveInvited"]+" "+_648+" "+i18n["zohodiscussions.chat.toChat"]).unbind("click",chatInvoker);}else{if(_647=="-3"){_649.find("div").attr("class","imgAddContact flLeft");_649.find("a").html(i18n["zohodiscussions.chat.acceptinvitationforchat"]);_649.attr("title",_648+" "+i18n["zohodiscussions.chat.youHaveInvited"]).unbind("click",chatInvoker);}}}}}}_649.find("div").unbind("click",chatInvoker).click(chatInvoker);_649.find("a").unbind("click",chatInvoker).click(chatInvoker);}function manageUserChatStatusInTopicList(_64a,_64b,_64c){var flag=0;if(_64b=="4"){flag=1;_64a.attr("class","wms-4 flLeft").unbind("click",chatInvoker).click(chatInvoker);}else{if(_64b=="3"){flag=1;_64a.attr("class","wms-3 flLeft").unbind("click",chatInvoker).click(chatInvoker);}else{if(_64b=="1"){flag=1;_64a.attr("class","wms-1 flLeft").unbind("click",chatInvoker).click(chatInvoker);}else{if(_64b=="0"){flag=1;_64a.attr("class","wms-0 flLeft").unbind("click",chatInvoker).click(chatInvoker);}else{if(_64b=="-4"){_64a.attr("class","flLeft").unbind("click",chatInvoker);}else{if(_64b=="-5"){_64a.attr("class","flLeft").unbind("click",chatInvoker);}}}}}}if(_64c=="topicList"){if(flag==1){_64a.addClass("authorChatPresence chatStyleOverride");}else{_64a.remove();}}else{_64a.addClass("authorChatPresence chatOverride");}}function chatInvoker(){var _64e=$(this);var name=_64e.attr("authorName");var _650=_64e.attr("authorId");if(_650==undefined){_650=_64e.parent().attr("authorId");name=_64e.parent().attr("authorName");}var _651=WmsContacts.status(_650);if(_651>-1&&_651!==false){WebMessanger.chat(_650);return;}if(_651==-1){if(confirm(name+" "+i18n["zohodiscussions.chat.reminder"])){WmsContacts.add("zoho",name,ZUID);}}else{if(_651==-3){WmsContacts.accept("zoho",name,ZUID);}else{WmsContacts.add("zoho",name,ZUID);}}}function updatePresence(usid,_653,_654){if(ch!=true){return;}if($("#recentStickyPosts").is(":visible")){var _655=$("#recentStickyPosts >li >div.ashColorText >div.authorChatPresence");_655.each(function(_656,item){var _658=$(item);var _659=_658.attr("authorId");if(_659==usid){manageUserChatStatusInTopicList(_658,_654);}});}if($("#recentAnnouncementPosts").is(":visible")){var _655=$("#recentAnnouncementPosts >li >div.ashColorText >div.authorChatPresence");_655.each(function(_65a,item){var _65c=$(item);var _65d=_65c.attr("authorId");if(_65d==usid){manageUserChatStatusInTopicList(_65c,_654);}});}if($("#topicListMainContainer").is(":visible")){var _65e=eval("("+$("#uListForStatusUpdate").html()+")");var zuid="z"+usid;if(typeof _65e[zuid]!="undefined"){for(i=0;i<_65e[zuid].length;i++){var _660=$("#uc_"+_65e[zuid][i]+"_"+usid);manageUserChatStatusInTopicList(_660,_654,"topicList");}}if($("#singleForumHeaderView").is(":visible")){var _661=$("#singleForumHeaderView").attr("forumId");manageUserChatStatus("moderatorOnlineStatus_"+_661+"_"+_653,_654,_653);}}else{if($("#SinglePostContainer").is(":visible")){var _662=$("#SinglePostContainer").attr("forumTopicId");var _65e=eval("("+$("#uListForStatusUpdateInSP").html()+")");var zuid="z"+usid;if(typeof _65e[zuid]!="undefined"){for(i=0;i<_65e[zuid].length;i++){var _660=$("#uc_"+_662+"_"+_65e[zuid][i]+"_"+usid);manageUserChatStatusInTopicList(_660,_654);}}}else{if($("#userProfileMainContainer").is(":visible")){manageUserChatStatus("userOnlineStatus_"+_653,_654,_653);}else{if($("#myAreaInnerMainContent").is(":visible")){if($("#profileDetailCont").is(":visible")){manageUserChatStatus("followersOnlineStatus_"+_653,_654,_653);manageUserChatStatus("followingOnlineStatus_"+_653,_654,_653);var _663=$("#current_recentActivity_List >li >div.authorChatPresence");_663.each(function(_664,item){var _666=$(item);var _667=_666.attr("authorId");if(_667==usid){manageUserChatStatusInTopicList(_666,_654);}});}else{var _668="";if($("#watchListInnerContent").is(":visible")){var _669=$("#watchListInnerContent").find("div[status=\"show\"]");_668=_669.attr("id");}else{if($("#privateMsgInnerContentent").is(":visible")){var _669=$("#privateMsgInnerContent").find("div[status=\"show\"]");_668=_669.attr("id");}}if(_668!=""){var _663="";if(_668=="privateMsgInnerContent"){_663=$("#"+_668+" div.moderateSinglePost ul li img.authorChatPresence");}else{_663=$("#"+_668+" div.moderateSinglePost ul li div.authorChatPresence");}_663.each(function(_66a,item){var _66c=$(item);var _66d=_66c.attr("authorId");if(_66d==usid){manageUserChatStatusInTopicList(_66c,_654);}});}}manageUserChatStatus("authorPopup_"+_653,_654,_653);}}}}}function addPrivateMessage(_66e){var _66f=_66e.attr("toMember");var _670=_66e.attr("authorname");var _671=$("#privateMsgPrompt");var _672=$("#privateMsgToMemberArea");var _673=$("#privateMsgTitleArea");var _674=$("#privateMsgContentArea");var _675=$("#privateMsgToMemberId");_675.val("");_672.val("");_673.val("");_674.val("");_675.val(_66f);_672.val(_670);_671.show().parent().show();$("#cancelPrivateMsgButton, #cancelPrivateMsg").unbind("click").click(function(){_672.val("");_673.val("");_674.val("");var _676=$("#writePMCaptcha");_676.find("img").attr("src","/images/spacer.gif");_676.find(":input").val("");_676.hide();_671.hide().parent().hide();});$("#addNewPrivateMsg").unbind("click").click(function(){showLoadingImage();var _677=_674.val();_677=_677.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_677==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noContentInPost"],"failure");return;}var _678=_673.val();_678=_678.replace(/^\s+/g,"").replace(/\s+$/g,"");if(_678==""){hideLoadingImage();showMessage(i18n["zohodiscussions.writePost.noTitleInPost"],"failure");return;}doAjaxAction("/addPrivateMsg.do",_671.find("form").serialize(),function(data){var _67a=$("#writePMCaptcha");_67a.find("img").attr("src","/images/spacer.gif");_67a.find(":input").val("");_67a.hide();hideLoadingImage();showTipper(i18n["zohodiscussions.privateMsg.successfullyPMAdded"],"success");_671.hide().parent().hide();},function(err){var _67c=eval(err.responseText);if(_67c.errorcode=="HIP_REQUIRED"){var _67d=$("#writePMCaptcha");if(_67d.attr("currCaptcha")=="new"){showMessage(i18n["zohodiscussions.writePost.captchaMsg"],"failure");}else{showMessage(i18n["zohodiscussions.writePost.captchaErrorMsg"],"failure");}_67d.find("img[purpose=\"captchaImage\"]").replaceWith("<img purpose=captchaImage name=hipImg border=0 src=/showcaptcha?digest="+_67c.reason+" align=absmiddle alt=HIP image>");$("#captchaCodePM").attr("name",_67c.reason);_67d.attr("currCaptcha","old");_67d.show();}else{showMessage(_67c.reason,"failure");}hideLoadingImage();});});_673.focus();}function Collaboration(){}Collaboration.handleUserList=function(chid,list){};Collaboration.handleMessage=function(chid,_681,zuid,_683,msg){};Collaboration.handlePresence=function(chid,_686,zuid,_688,_689){};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,_68f,_690,_691,att,_693){if(prd=="FM"){setTimeout(function(){showBubble(msg,_690);},2);return true;}else{return false;}};Collaboration.handleCustomMessage=function(msg){};Collaboration.handleCrossProductMessage=function(prd,msg){};Collaboration.onConnect=function(){};Collaboration.openURL=function(url,_698,_699,prd){return true;};Collaboration.handleCollabAdd=function(_69b,_69c,zuid,time,chid){};Collaboration.handleCollabDelete=function(_6a0,_6a1,zuid,time,chid){};Collaboration.handleUserAdd=function(chid,_6a6){};Collaboration.handleUserDeleted=function(chid,_6a8){};Collaboration.handleIsOnline=function(_6a9){updateStatus(_6a9);};Collaboration.handleLogout=function(_6aa){setTimeout(function(){$.get("/cleardomain.do","",function(){window.location.href=window.location.href;});},5);};Collaboration.goOffline=function(){};Collaboration.handleChatNotifyMessage=function(chid,_6ac,_6ad){};Collaboration.getPageTitle=function(){return false;};Collaboration.handleWmsDisable=function(_6ae){setTimeout(function(){$.get("/cleardomain.do","",function(){window.location.href=window.location.href;});},5);};function WmsContactImpl(){}WmsContactImpl.handlePresence=function(zuid,_6b0,_6b1,_6b2,_6b3){setTimeout(function(){updatePresence(zuid,_6b0,_6b2);},2);};WmsContactImpl.handleAddressBook=function(){};WmsContactImpl.handleInvite=function(zuid,_6b5,_6b6){};WmsContactImpl.notifyInvite=function(zuid,_6b8,_6b9){};WmsContactImpl.handleAccept=function(zuid,_6bb,_6bc,_6bd,_6be){};WmsContactImpl.notifyAccept=function(zuid,_6c0,_6c1,_6c2,_6c3){};WmsContactImpl.handleReject=function(zuid,_6c5,_6c6){};WmsContactImpl.notifyRemove=function(zuid,_6c8,_6c9){};WmsContactImpl.handleDelete=function(zuid,_6cb,_6cc){};WmsContactImpl.handleContactUpdated=function(){};WmsContactImpl.handleStatusMessage=function(_6cd,_6ce){};WmsContactImpl.handeAllStatusMessages=function(){};WmsContactImpl.handleHideContactsUI=function(){};WmsContactImpl.handleShowContactsUI=function(){};WmsContactImpl.handleGetContacts=function(){var _6cf=WmsContacts.getZohoContacts();if($("#topicListMainContainer").is(":visible")||$("#allForums_MainContentCont").is(":visible")){setPresenceInTopicList(_6cf);if($("#singleForumHeaderView").is(":visible")){var _6d0=$("#singleForumHeaderView").attr("forumId");setPresence(_6cf,"moderatorsChatList_"+_6d0);}}else{if($("#SinglePostContainer").is(":visible")){var _6d1=$("#SinglePostContainer").attr("forumtopicid");setPresenceInTopicList(_6cf,_6d1);}else{if($("#myAreaParentContainer").is(":visible")){if($("#recentActivityContent").is(":visible")){setPresenceInMyArea(_6cf,"current_recentActivity_List");setPresence(_6cf,"followingUserDetails");setPresence(_6cf,"followersUserDetails");}else{if($("#watchListInnerContent").is(":visible")){setPresenceInMyArea(_6cf,"userChat_watchTopics");}else{if($("#privateMsgInnerContent").is(":visible")){setPresenceInMyArea(_6cf,"userChat_inbox");}}}}else{if($("#userProfileMainContainer").is(":visible")){var _6d2=$("#userProfileMainContainer");var _6d3=_6d2.attr("authorId");var _6d4=_6d2.attr("authorName");if(typeof WmsContacts!="undefined"&&ch==true){var _6d5=WmsContacts.status(_6d3);if(_6d5===false){_6d5=9;}manageUserChatStatus("userOnlineStatus_"+_6d4,_6d5,_6d4);}}}}}};WmsContactImpl.handleMPReject=function(_6d6,_6d7,_6d8){};WmsContactImpl.handleMPAccept=function(_6d9,_6da,_6db){};WmsContactImpl.handleMPDelete=function(_6dc,_6dd,_6de){};WmsContactImpl.handleMPAdd=function(_6df,_6e0,_6e1){};WmsContactImpl.handleMPInvite=function(_6e2,_6e3,_6e4){};WmsContactImpl.handleLogin=function(_6e5,_6e6,_6e7,_6e8){};WmsContactImpl.handleLogout=function(_6e9,_6ea,_6eb,_6ec){};WmsContactImpl.handleGetAccounts=function(_6ed){};WmsContactImpl.handleInvitations=function(_6ee){};