function AddLabelValuePair(){var F=document.getElementById("LabelValuePairCount");var A=document.getElementById("CustomInfo");if(F&&A){F.value++;var E=document.createElement("li");var D=document.createElement("input");D.type="text";D.name="Label"+F.value;D.maxLength="20";D.className="LVLabelInput";var B=document.createElement("li");var C=document.createElement("input");C.type="text";C.name="Value"+F.value;C.maxLength="200";C.className="LVValueInput";E.appendChild(D);B.appendChild(C);A.appendChild(E);A.appendChild(B)}}function DiscussionSwitch(A,H,G,F,I,B){var D=document.getElementById(I);if(D){D.className="Progress"}var E="Type="+H+"&DiscussionID="+G+"&Switch="+F+"&PostBackKey="+B;var C=new DataManager();C.RequestCompleteEvent=RefreshPageWhenAjaxComplete;C.RequestFailedEvent=HandleFailure;C.LoadData(A+"?"+E)}function HideComment(C,A,J,B,E,D,K,F){var I=(A==1?D:E);if(confirm(I)){var H=document.getElementById(K);if(H){H.innerHTML=" ";H.className="HideProgress"}var G=new DataManager();G.RequestCompleteEvent=RefreshPageWhenAjaxComplete;G.RequestFailedEvent=HandleFailure;G.LoadData(C+"?Type=Comment&Switch="+A+"&DiscussionID="+J+"&CommentID="+B+"&PostBackKey="+F)}}function SetBookmark(C,J,G,B,H,E){var I=document.getElementById("SetBookmark");if(I){I.className="Progress";var A=I.name==""?J:I.name;var D=A==1?0:1;I.name=D;var F=new DataManager();F.Param=(D==0?B:H);F.RequestCompleteEvent=BookmarkComplete;F.RequestFailedEvent=BookmarkFailed;F.LoadData(C+"?Type=Bookmark&Switch="+D+"&DiscussionID="+G+"&PostBackKey="+E)}}function ApplyBookmark(B,C,D){var A=document.getElementById(B);if(A){A.className=C;A.innerHTML=D}}function BookmarkComplete(A){setTimeout("ApplyBookmark('SetBookmark', 'Complete', '"+this.Param+"');",400)}function BookmarkFailed(B){var A=document.getElementById("SetBookmark");if(A){A.className="Complete";alert("Failed: ("+B.status+") "+B.statusText)}}function ShowAdvancedSearch(){var D=document.getElementById("SearchSimpleFields");var A=document.getElementById("SearchDiscussionFields");var C=document.getElementById("SearchCommentFields");var B=document.getElementById("SearchUserFields");if(D&&A&&C&&B){D.style.display="none";A.style.display="block";C.style.display="block";B.style.display="block"}}function ShowSimpleSearch(){var D=document.getElementById("SearchSimpleFields");var A=document.getElementById("SearchDiscussionFields");var C=document.getElementById("SearchCommentFields");var B=document.getElementById("SearchUserFields");if(D&&A&&C&&B){D.style.display="block";A.style.display="none";C.style.display="none";B.style.display="none"}}function ToggleCategoryBlock(G,C,F,H,E){var D=document.getElementById(H);if(D){D.innerHTML=" ";D.className="HideProgress"}var B="BlockCategoryID="+C+"&Block="+F+"&PostBackKey="+E;var A=new DataManager();A.RequestCompleteEvent=RefreshPageWhenAjaxComplete;A.RequestFailedEvent=HandleFailure;A.LoadData(G+"?"+B)}function ToggleCommentBox(E,H,C,D){SwitchElementClass("CommentBox","CommentBoxController","SmallCommentBox","LargeCommentBox",C,H);var F=0;var G=document.getElementById("CommentBox");if(G){if(G.className=="LargeCommentBox"){F=1}var B="Type=ShowLargeCommentBox&Switch="+F+"&PostBackKey="+D;var A=new DataManager();A.RequestCompleteEvent=ToggleCommentBoxComplete;A.RequestFailedEvent=HandleFailure;A.LoadData(E+"?"+B)}}function ToggleCommentBoxComplete(A){}function WhisperBack(D,A,B){var C=document.getElementById("frmPostComment");if(!C){document.location=B+"post.php?PostBackAction=Reply&DiscussionID="+D+"&WhisperUsername="+escape(A)}else{C.WhisperUsername.value=A;C.Body.focus()}}