var CheckUserAvatarsForum=function CheckUserAvatarsForum(){var B=document.getElementsByTagName("div");for(var A=0;A<B.length;A++){if(B[A].className=="forumAvatar"){changeImageSize(B[A],180,40)}}};var ResetEventTarget=function ResetEventTarget(){if(document.getElementById("__EVENTTARGET")!=null){document.getElementById("__EVENTTARGET").value=""}};function CheckUserAvatarsThread(){var B=document.getElementsByTagName("Li");for(var A=0;A<B.length;A++){if(B[A].className=="ForumPostUserAvatar"){changeImageSize(B[A],240,100)}}}function registerKeyPressHandler(){var A=document.getElementById(postSubjectClientId);if(A){if(document.addEventListener){A.addEventListener("keypress",checkEvent,false)}else{A.onkeypress=checkEvent}}}function checkEvent(A){if(!A){A=window.event}if(!A){return}var B=A.keyCode==13;if(B&&A.stopPropagation){A.stopPropagation();A.preventDefault()}return !B}function Preview(){var A=Page_ClientValidate("PostFormValidation");if(A==false){return false}else{document.getElementById(previewPosts).innerHTML="";document.getElementById("previewloading").style.display="block";PreviewHelperScript()}}function PreviewHelperScript(){__theFormPostData="";__theFormPostCollection=new Array();WebForm_InitCallback();document.getElementById("__EVENTTARGET").value="";document.getElementById("__EVENTARGUMENT").value="";WebForm_DoCallback(addPostControl,"preview",new Function("result","document.getElementById('"+previewPosts+"').innerHTML=result;PreviewCallback();"),"",ProcessCallBackError,false)}function PreviewCallback(){document.getElementById("previewloading").style.display="none";changeImageSize(document.getElementById(previewPosts),maxImageSize,maxImageSize)}function ProcessCallBackError(A,B){document.getElementById("previewloading").innerHTML=PreviewErrorString}var quoteMargins=20;function changeImageSize(B,D,C){var F=B.getElementsByTagName("img");for(var A=0;A<F.length;A++){var E=(quoteMargins*getIndents(B,F[A]));if(E>C){E=C}F[A].style.visibility="hidden";F[A].onload=new function(){resizeTimer(F[A],D*(1-(E/C)),C-E)}}}function getIndents(A,D){var C=0;var B=D;while(B.parentNode!=A&&B.parentNode!=null){if(B.tagName=="BLOCKQUOTE"){C++}B=B.parentNode}return C}function GetSelectedHtmlInElement(F,A,E,D){var L=true;var H=null;if(window.getSelection){var J=window.getSelection();if(J&&J.rangeCount>0&&J.toString().length>0){L=false;var B=J.getRangeAt(0);var C=document.createRange();C.selectNode(F);if(C.compareBoundaryPoints(Range.START_TO_START,B)<=0&&C.compareBoundaryPoints(Range.END_TO_END,B)>=0){var K=document.createElement("div");K.appendChild(B.cloneContents());H=K.innerHTML}else{if(D){alert(D)}}}}else{if(document.selection){var G=document.selection.createRange();if(G&&G.text){L=false;var I=G.parentElement();if(I!=null&&ElementContainsElement(F,I)){H=G.htmlText}else{if(D){alert(D)}}}}}if(H==null&&((L&&A)||E)){H=F.innerHTML}if(document.all){return insertParams(F,H)}return H}String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};function insertParams(E,I){var J=E.getElementsByTagName("object");for(var F=0;F<J.length;F++){var B=J[F];var H=B.outerHTML;var C="";for(var D=0;D<B.childNodes.length;D++){var A=B.childNodes[D];if(A.tagName=="PARAM"){C+=A.outerHTML}}var K=H.split(">")[0]+">";var G=K+C+B.innerHTML+" </OBJECT>";I=I.replace(H.trim(),G)}return I}function ElementContainsElement(B,C){if(!B||!C){return false}if(B==C){return true}if(B&&B.childNodes){for(var A=0;A<B.childNodes.length;A++){if(B.childNodes[A]==C||Telligent_Common.ElementContainsElement(B.childNodes[A],C)){return true}}}return false}function showPollArea(A){if(A.checked){document.getElementById(pollContainerId).style.display="block";ValidatorEnable(document.getElementById(titleValidator),true);ValidatorEnable(document.getElementById(answersValidator),true);ValidatorEnable(document.getElementById(requiredExpireAfterDaysValidator),true);ValidatorEnable(document.getElementById(expireAfterDaysValidator),true)}else{document.getElementById(pollContainerId).style.display="none";ValidatorEnable(document.getElementById(titleValidator),false);ValidatorEnable(document.getElementById(answersValidator),false);ValidatorEnable(document.getElementById(requiredExpireAfterDaysValidator),false);ValidatorEnable(document.getElementById(expireAfterDaysValidator),false)}}function validateAnswers(B,A){var C=document.getElementById(answersId).value;A.IsValid=C.split(",").length>=2}function search(){var A=document.getElementById("forumSearchQuery");if(validateSearch(A,searchErrorMsg)){var C=document.getElementById("forumSearchButton");if(C){C.href="#";C.onclick="return false;";if(C.childNodes.length>=1){C.childNodes[0].style.color="#bbb"}}ShowFetchBox(A,searchProgressMsg);var B=searchBaseUrl+"&qforums="+encodeURIComponent(A.value);if(searchFilter&&searchFilter.length>0){B+="&"+searchFilter}else{B+="&filterlang="+searchFilterLang}location.href=B}}function ShowFetchBox(B,A){var D=document.getElementById("SearchErrorBox");D.className="FetchBox";var C=FindElementPosition(B);D.style.top=C[1]-4+"px";D.style.width=B.offsetWidth-8+"px";D.innerHTML=A;D.style.left=C[0]+"px";if(D.filters){D.filters.alpha.opacity=100}B.blur();D.style.display="block"}function validateSearch(A,C){var D=A.value.replace(/^\s+|\s+$/g,"");if(D==""||A.value.length>100){var E=document.getElementById("SearchErrorBox");E.className="ErrorBox";var B=FindElementPosition(A);E.style.top=B[1]+25+"px";E.style.width=A.offsetWidth-8+"px";E.innerHTML=C;E.style.left=B[0]+"px";if(E.filters){E.filters.alpha.opacity=0;E.style.display="block";fade()}else{E.style.display="block"}A.onfocus=clearErrorBox;return false}return true}function fade(){var A=document.getElementById("SearchErrorBox");if(A.filters.alpha.opacity<65){A.filters.alpha.opacity+=2;setTimeout("fade()",40)}}function clearErrorBox(){var A=document.getElementById("SearchErrorBox");if(A.filters){A.filters.alpha.opacity=0}A.style.display="none"}function searchCheckEvent(A){if(!A){A=window.event}if(A&&A.keyCode==13){search();return false}return true}var searchFilter;function changeSearchFilter(A){searchFilter=A}var maxImageSize=491;var maxSignatureImageheight=125;var checkImages=function checkImages(){var B=document.getElementsByTagName("div");for(var A=0;A<B.length;A++){if(B[A].className=="ForumPostBodyArea"){changeImageSize(B[A],maxImageSize,maxImageSize)}else{if(B[A].className=="Signature"){changeImageSize(B[A],maxSignatureImageheight,maxImageSize)}}}CheckUserAvatarsThread()};function resizeTimer(A,C,B){window.setTimeout(function(){resizeImage(A,C,B)},500)}function resizeImage(B,F,E){var D=B.clientWidth;var A=B.clientHeight;var C=D/A;if(D>E){if((E/C)>F){B.style.height=F+"px";B.style.width=(F*C)+"px"}else{B.style.width=E+"px";B.style.height=(E/C)+"px"}}else{if(A>F){if((F*C)>E){B.style.width=E+"px";B.style.height=(E/C)+"px"}else{B.style.height=F;B.style.width=(F*C)+"px"}}}B.style.visibility="visible"}function EvalAjaxResponse(result,context){eval(result)}function ResetBox(B,A){if(B.value==A){B.value="";B.className="Normal"}}function BlurBox(B,A){if(B.value==""){B.value=A;B.className="Grayed"}}function ValidateAndGetPage(C,G,D,E,A){var F=document.getElementById(C);var B=parseInt(F.value,10);if(B>0&&B<=D){if(E=="0"){A=A.replace("&SortOrder={1}","")}else{A=A.replace("{1}",E)}if(B!=1){location.href=A.replace("{0}",B)}else{location.href=A.replace("&PageIndex={0}","")}}else{F.value=G;F.className="Grayed";F.blur()}}function OnGoToBoxEnter(G,C,F,D,E,B){var A;if(window.event){A=window.event.keyCode}else{if(G){A=G.which}}if(A=="13"){ValidateAndGetPage(C,F,D,E,B);return false}}function FindElementPosition(A){var B=etop=0;if(A.offsetParent){B=A.offsetLeft;etop=A.offsetTop;while(A=A.offsetParent){B+=A.offsetLeft;etop+=A.offsetTop}}return[B,etop]}function ShowPager(E,D,A){var B=document.getElementById(A);if(B.style.display=="none"||B.style.display==""){D.style.backgroundColor="#99b3cc";var C=FindElementPosition(D);B.style.top=C[1]+14+"px";B.style.left=C[0]+1+"px";B.style.display="block"}else{B.style.display="none"}cancelEvent(E)}function cancelEvent(A){if(!A){A=window.event}A.cancelBubble=true;A.returnValue=false;if(A.stopPropagation){A.stopPropagation();A.preventDefault()}}function AddPagerEvent(B,A,C){if(document.body.attachEvent){document.body.attachEvent("onclick",function(){HidePager(B,A,C)})}else{document.body.addEventListener("click",function(){HidePager(B,A,C)},false)}}function HidePager(B,A,D){var C=document.getElementById(B);var A=document.getElementById(A);C.style.display="none";A.style.backgroundColor=""}function GetWindowSize(){var B=0,A=0;if(typeof(window.innerWidth)=="number"){B=window.innerWidth;A=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){B=document.documentElement.clientWidth;A=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){B=document.body.clientWidth;A=document.body.clientHeight}}}return[B,A]}function GetWindowScrollXY(){var B=0,A=0;if(typeof(window.pageYOffset)=="number"){A=window.pageYOffset;B=window.pageXOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){A=document.body.scrollTop;B=document.body.scrollLeft}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){A=document.documentElement.scrollTop;B=document.documentElement.scrollLeft}}}return[B,A]}function CheckAll(){var C=document.getElementById("checkAll").checked;var B=document.getElementById("TopicsListTable");var D=B.getElementsByTagName("input");for(var A=0;A<D.length;A++){if(D[A].type=="checkbox"){D[A].checked=C}}}function up_launchChat(A,B){window.open("http://chat.myspace.com/index.cfm?fuseaction=messenger.chatroom&roomID="+B,"ICWindow_ChatRoom"+A+B,"status=1,toolbar=0,directories=0,menubar=0,location=0,scrollbars=0,resizable=1,width=800,height=600")}function ValidatePostBody(C,B){var A=getEditorContent();A=A.replace(/^\s+|\s+$/g,"");if(A!=""){B.IsValid=true}else{B.IsValid=false}}function onDeleteReplyClick(){if(confirm(MySpaceRes.ForumPage.DeleteReplyConfirmation)){return true}else{return false}}function onDeleteTopicClick(){if(confirm(MySpaceRes.ForumPage.DeleteTopicConfirmation)){return true}else{return false}}function onBanUserClick(){if(confirm(MySpaceRes.ForumPage.BanUserConfirmation)){return true}else{return false}};