function limitInputLength(D,C,E){if(D.value.length>C){D.value=D.value.substring(0,C)}var A=document.getElementById(E);if(A!=null){var B=C-D.value.length;if(B>0){A.style.color="#fff";A.innerHTML=B+" of "+C+" remaining"}else{A.style.color="red";A.innerHTML="Max Length Reached"}}}function getServletPath(){var A=window.location+"";if(A.search("/21online/talks")>0){return"/21online/talks"}return"/communities"}function setAskFormAction(){var A=document.ask_form;if(A){var B=A.action+"";if(B.indexOf(getServletPath()+"/servlet/")<0){A.action=B.replace("/servlet/",getServletPath()+"/servlet/")
}}}function setServletFormAction(A){if(A){var B=A.action+"";if(B.indexOf(getServletPath()+"/servlet/")<0){A.action=B.replace("/servlet/",getServletPath()+"/servlet/")}}return true}RfgQueueCommand("setAskFormAction();");function getHost(){var A=window.location+"";A=A.replace("http://","");var B=A.split("/");var C=B[0];C="http://"+C;return C}function showQuestionPermalinkPopup(E,G,A){var I=-235;var F=385;var D=A.length*4.5;var C=I-D;var B=F+D;var H="<a class='permalink' href='/communities/"+A+"/"+G+"' target='_blank'>"+getHost()+"/communities/"+A+"/"+G+"</a>";
openMessagePopup(E,H,C,5,70,B);return false}function showAnswerPermalinkPopup(F,H,C,A){var J=-235;var G=385;var E=A.length*5;var D=J-E;var B=G+E;var I="<a class='permalink' href='/communities/"+A+"/"+H+"/"+C+"' target='_blank'>"+getHost()+"/communities/"+A+"/"+H+"/"+C+"</a>";openMessagePopup(F,I,D,5,70,B);return false}function checkSearch(E){removeDefaultSearch();var A=document.getElementById("search_keywords");var F=document.getElementById("search_loc");var B=document.getElementById("search_location");if(A&&F&&B){var D=A.value;
var H=F.value;if(H=="All My Locations"){B.value="All My Locations";return true}else{if(H!="City, State"&&H!=""){if(E){var C=H.split(",");if(C.length==2){ajaxSearchLocation(H,E)}else{if(!isState(H)){ajaxSearchLocation(H,E)}else{var B=document.getElementById("search_location");if(B){B.value=H}return true}}}else{ajaxSearchLocation(H,E)}}else{if(D!="Enter Search Terms"&&D!=""){return true}else{var G=document.getElementById("search_form");if(G){openMessagePopup(G,"Please Enter Search Terms",0,5,85,190)}setTimeout("hidePopup('message_popup');",2000)
}}}}return false}function isState(B){var A=B.toUpperCase();if(A in oc(["AL","ALABAMA","AK","ALASKA","AZ","ARIZONA","AR","ARKANSAS","CA","CALIFORNIA","CO","COLORADO","CT","CONNECTICUT","DE","DELAWARE","DC","DISTRICT OF COLUMBIA","FL","FLORIDA","GA","GEORGIA","HI","HAWAII","ID","IDAHO","IL","ILLINOIS","IN","INDIANA","IA","IOWA","KS","KANSAS","KY","KENTUCKY","LA","LOUISIANA","ME","MAINE","MD","MARYLAND","MA","MASSACHUSETTS","MI","MICHIGAN","MN","MINNESOTA","MS","MISSISSIPPI","MO","MISSOURI","MT","MONTANA","NE","NEBRASKA","NV","NEVADA","NH","NEW HAMPSHIRE","NJ","NEW JERSEY","NM","NEW MEXICO","NY","NEW YORK","NC","NORTH CAROLINA","ND","NORTH DAKOTA","OH","OHIO","OK","OKLAHOMA","OR","OREGON","PA","PENNSYLVANIA","RI","RHODE ISLAND","SC","SOUTH CAROLINA","SD","SOUTH DAKOTA","TN","TENNESSEE","TX","TEXAS","UT","UTAH","VT","VERMONT","VA","VIRGINIA","WA","WASHINGTON","WV","WEST VIRGINIA","WI","WISCONSIN","WY","WYOMING"])){return true
}return false}function oc(A){var C={};for(var B=0;B<A.length;B++){C[A[B]]=""}return C}function removeDefaultSearch(){var A=document.getElementById("search_keywords");var B=document.getElementById("search_loc");if(A){if(A.value=="Enter Search Terms"){A.value=""}}if(B){if(B.value=="City, State"){B.value=""}}}function SearchLocationDisambSubmit(A){var B=document.getElementById("search_loc");if(B){B.value=A;checkSearch()}return false}function ajaxSearchLocation(A){var C="/xml-bin/locationsearch?where="+A;var B=function(R){if(R.readyState==4&&R.status==200){var U=R.responseXML;
var F=U.getElementsByTagName("location");var T=document.getElementById("search_location");if(T){if(F.length>0){var I=F[0].getElementsByTagName("city");var M=F[0].getElementsByTagName("state");if(I&&M){var Q=I[0].firstChild.nodeValue;var H=M[0].firstChild.nodeValue;var J=Q+", "+H;T.value=J;var E=document.getElementById("search_form");if(E){E.submit()}}}else{var N=U.getElementsByTagName("PossibleMatches");var D=document.getElementById("disamb_popup");var K=document.getElementById("search_loc");if(N.length>0&&D&&K){var G=N[0].getElementsByTagName("PossibleMatch");
if(G&&G.length>0){var P="";var O="";for(var S=0;S<G.length;S++){O=G[S].firstChild.nodeValue;P+="<li><a href='#' onclick=\"return SearchLocationDisambSubmit('"+O+"');\">"+O+"</a></li>"}openDisambPopup(K,P,126,-69)}else{var L=document.getElementById("search_loc");if(L){openMessagePopup(L,"Unable to verify location.",-30,5,70,175);setTimeout("hidePopup('message_popup');",2000)}}}else{var L=document.getElementById("search_loc");if(L){openMessagePopup(L,"Unable to verify location.",-30,5,70,175)}setTimeout("hidePopup('message_popup');",2000)
}}}}};g_AjaxQueue.schedule("search_location",C,B)}function ajaxSuggestLocation(){var B=document.getElementById("ask_loc");if(B){var A=B.value;if(A.length>3){var D="/xml-bin/locationcompletion?where="+A;var C=function(K){if(K.readyState==4&&K.status==200){var J=K.responseXML;var F=J.getElementsByTagName("locations");var E=document.getElementById("suggested_locations");if(E){E.innerHTML="";if(F.length>0){var F=J.getElementsByTagName("location");if(F&&F.length>0){var H="";var I="";for(var G=0;G<F.length;G++){I=F[G].firstChild.nodeValue;
H+='                                        <div class="suggested_location" onclick="return chooseQuestionLocation(\''+I+"');\">                                            "+I+"                                        </div>"}E.innerHTML=H}}}}};g_AjaxQueue.schedule("search_location",D,C)}}}function checkAsk(){if(checkMyC21TalksLogin()){var E=document.getElementById("ask_question");var D=document.getElementById("ask_loc");var A=document.getElementById("ask_location");if(E&&D&&A){var B=E.value;var F=D.value;if(B!="enter text"&&B!=""){if(F!="City, State"&&F!=""){ajaxQuestionLocation(F)
}else{ajaxSpellCheckAskSubmitCallback()}}else{var C=document.getElementById("ask_question");if(C){openMessagePopup(C,"Please Enter A Question",10,5,85,185)}setTimeout("hidePopup('message_popup');",2000)}}}return false}function checkAnswer(){if(checkMyC21TalksLogin()){var A=document.getElementById("answer_question");if(A){var B=A.value;if(B!="enter text"&&B!=""){ajaxSpellCheckAnswerSubmitCallback()}else{var C=document.getElementById("answer_question");if(C){openMessagePopup(C,"Please Enter An Answer",-5,50,85,185)
}setTimeout("hidePopup('message_popup');",2000)}}}return false}function QuestionLocationDisambSubmit(A){var B=document.getElementById("ask_loc");if(B){B.value=A;checkAsk()}return false}function ajaxQuestionLocation(A){var C="/xml-bin/locationsearch?where="+A;var B=function(Z){if(Z.readyState==4&&Z.status==200){var a=Z.responseXML;var F=a.getElementsByTagName("location");var W=document.getElementById("ask_location");var L=document.getElementById("ask_lat");var I=document.getElementById("ask_lon");if(W&&L&&I){if(F.length>0){var M=F[0].getElementsByTagName("city");
var S=F[0].getElementsByTagName("state");var Q=F[0].getElementsByTagName("latitude");var R=F[0].getElementsByTagName("longitude");if(M&&S&&Q&&R){var X=M[0].firstChild.nodeValue;var J=S[0].firstChild.nodeValue;var K=Q[0].firstChild.nodeValue;var G=R[0].firstChild.nodeValue;var N=X+", "+J;W.value=N;L.value=K;I.value=G;var E=document.getElementById("ask_form");if(E){E.submit()}}}else{var T=a.getElementsByTagName("PossibleMatches");var D=document.getElementById("disamb_popup");var P=document.getElementById("ask_loc");
if(T.length>0&&D&&P){var H=T[0].getElementsByTagName("PossibleMatch");if(H&&H.length>0){var V="";var U="";for(var Y=0;Y<H.length;Y++){U=H[Y].firstChild.nodeValue;V+="<li><a href='#' onclick=\"return QuestionLocationDisambSubmit('"+U+"');\">"+U+"</a></li>"}openDisambPopup(P,V,218,-118)}else{var O=document.getElementById("ask_loc");if(O){openMessagePopup(ask_question,"Unable to verify location",10,5,85,185)}setTimeout("hidePopup('message_popup');",2000)}}else{var O=document.getElementById("ask_loc");if(O){openMessagePopup(O,"Unable to verify location",10,5,85,185)
}setTimeout("hidePopup('message_popup');",2000)}}}}};g_AjaxQueue.schedule("add_account_location",C,B)}function checkAccountLocation(){if(checkMyC21TalksLogin()){var C=document.getElementById("addl_loc");if(C){var A=C.value;if(A=="City, State"||A==""){var B=document.getElementById("addl_loc_response");if(B){B.innerHTML="Please Enter Location.";B.style.display="inline"}return false}ajaxAddAccountLocation(A)}}return false}function AccountLocationDisambSubmit(A){var B=document.getElementById("addl_loc");if(B){B.value=A;
checkAccountLocation()}return false}function ajaxAddAccountLocation(A){var C="/xml-bin/locationsearch?where="+A;var B=function(Y){if(Y.readyState==4&&Y.status==200){var a=Y.responseXML;var F=a.getElementsByTagName("location");var Q=document.getElementById("addl_location");var Z=document.getElementById("addl_lat");var U=document.getElementById("addl_lon");if(Q&&Z&&U){if(F.length>0){var K=F[0].getElementsByTagName("city");var R=F[0].getElementsByTagName("state");var O=F[0].getElementsByTagName("latitude");var P=F[0].getElementsByTagName("longitude");
if(K&&R&&O&&P){var W=K[0].firstChild.nodeValue;var I=R[0].firstChild.nodeValue;var J=O[0].firstChild.nodeValue;var G=P[0].firstChild.nodeValue;var L=W+", "+I;Q.value=L;Z.value=J;U.value=G;var E=document.getElementById("add_account_location_form");if(E){E.submit()}}}else{var S=a.getElementsByTagName("PossibleMatches");var D=document.getElementById("disamb_popup");var M=document.getElementById("addl_loc");if(S.length>0&&D&&M){var H=S[0].getElementsByTagName("PossibleMatch");if(H&&H.length>0){var V="";var T="";
for(var X=0;X<H.length;X++){T=H[X].firstChild.nodeValue;V+="<li><a href='#' onclick=\"return AccountLocationDisambSubmit('"+T+"');\">"+T+"</a></li>"}openDisambPopup(M,V,142,-157)}else{var N=document.getElementById("addl_loc");if(N){openMessagePopup(N,"Unable to verify location.",-60,5,70,175);setTimeout("hidePopup('message_popup');",2000)}}}else{var N=document.getElementById("addl_loc");if(N){openMessagePopup(N,"Unable to verify location.",-60,5,70,175);setTimeout("hidePopup('message_popup');",2000)}}}}}};g_AjaxQueue.schedule("add_account_location",C,B)
}function checkMyC21TalksLogin(){if(!isTalksCookieSet()){if(!isMyC21CookieSet()){displayMyC21TalksLogin(null);return false}}return true}function displayMyC21TalksLogin(E){var C=document.getElementById("myc21popup");if(C){try{positionPopup(E,C);C.style.left=(parseInt(C.style.left)-250)+"px"}catch(D){}ShowModal();C.style.display="block";C.style.zIndex=50000;var B=(new Date()).getTime();var A=document.getElementById("myc21frame");if(A){A.src="/communities/forms/login.jsp?rid="+escape(B)}}return false}function isTalksCookieSet(){var A=GetCookie("talksacct");
if(A){if(A!=""){return true}}return false}function isMyC21CookieSet(){var A=GetCookie("myc21");if(A){if(A!=""){return true}}return false}function isInArray(B,C){for(var A=0;A<C.length;A++){if(C[A]==B){return true}}return false}function removeDefaultText(B,A){if(B){if(B.value==A){B.value=""}}return false}function showPopup(A){var B=document.getElementById(A);if(B){B.style.display="inline"}return false}function hidePopup(A){var B=document.getElementById(A);if(B){B.style.display="none"}return false}function findPos(A){var B=curtop=0;
if(A&&A.offsetParent){do{B+=A.offsetLeft;curtop+=A.offsetTop}while(A=A.offsetParent)}return[B,curtop]}function openSpellCheckPopup(F,G,C,B){var D=findPos(F);var A=document.getElementById("spellcheck_popup");var E=document.getElementById("spellcheck_content");if(A&&E){A.style.left=D[0]+C+"px";A.style.top=D[1]+B+"px";A.style.display="inline";E.innerHTML=G}return false}function openDisambPopup(F,G,C,B){var D=findPos(F);var A=document.getElementById("disamb_popup");var E=document.getElementById("disamb_content");
if(A&&E){A.style.left=D[0]+C+"px";A.style.top=D[1]+B+"px";A.style.display="inline";E.innerHTML=G}return false}function openMessagePopup(D,J,E,F,I,C){var H=findPos(D);var B=document.getElementById("message_popup");var G=document.getElementById("message_content");var A=document.getElementById("message_calloutblack");if(A&&I>0&&C>0){A.style.height=I+"px";A.style.width=C+"px"}if(B&&G){B.style.left=H[0]+E+"px";B.style.top=H[1]+F+"px";B.style.display="inline";G.innerHTML=J}return false}function openHelpPopup(E,C){var B=findPos(E);
var A=document.getElementById("help_popup");var D=document.getElementById("help_content");if(A&&D){A.style.left=B[0]+"px";A.style.top=B[1]+"px";A.style.display="inline";if(C=="questions"){D.innerHTML='<b>My Questions</b> allows you to go back to questions you have asked in order to read answers.                  Your questions will automatically be added here.  To remove a question click "Edit".  To change wheter or not                 you receive automated emails click the checkbox and the "change notification" text.'
}else{if(C=="answers"){D.innerHTML="<b>My Answers</b> takes you directly to answers you have posted, so that you can see who has                followed up with further responses."}else{if(C=="watch"){D.innerHTML='<b>Watch List</b> allows you to follow discussions that have been started by other users.                  To add questions here, click the "Watch this question" button next to an actual question.  To remove a question                 click "Edit".'}else{if(C=="areas"){D.innerHTML='<b>Email Alerts</b> allow you to receive emails when questions are asked about a particular                 area you are following.  To add an area, click on "Add an area" and enter the area name in the text box.'
}else{if(C=="email"){D.innerHTML="<b>MyC21 Users</b> will receive answer update emails at the email account registered with                 their MyC21 account.<br/>                <b>Agents</b> will receive answer update emails at the email account associated with their C21Online account.<br/>                "}else{if(C=="topics"){D.innerHTML="<b>Topics</b> are labels users create to describe questions they ask.  You can add topics                whenever you upload a question.  Popular topics will display in the <b>Topic Cloud</b> on the homepage.                These results are in alphabetical order.  More popular topics look bigger in the Topic Cloud.  Clicking on                a topic will display a list of questions associated with it."
}}}}}}}return false}var g_reportedAnswers=new Array;var g_currentReportAnswerId=-1;var g_reportedQuestions=new Array;var g_currentReportQuestionId=-1;function reportThis(F,E,G){var B=findPos(F);var A=document.getElementById("report_popup");var D=document.getElementById("report_type");var C=document.getElementById("report_id");if(A&&D&&C){A.style.left=B[0]-200+"px";A.style.top=B[1]+"px";A.style.display="inline";D.value=E;C.value=G}return false}function submitReportThis(){if(checkMyC21TalksLogin()){var B=document.getElementById("report_text");
var C=document.getElementById("report_type");var A=document.getElementById("report_id");if(B&&C&&A){if(C.value=="question"){if(!isInArray(A.value,g_reportedQuestions)){ajaxReportQuestion(A.value,B.value);g_reportedQuestions.push(A.value);g_currentReportQuestionId=A.value}else{closeReportPopup("Question has already been reported")}}else{if(C.value=="answer"){if(!isInArray(A.value,g_reportedAnswers)){ajaxReportAnswer(A.value,B.value);g_reportedAnswers.push(A.value);g_currentReportAnswerId=A.value}else{closeReportPopup("Answer has already been reported")
}}}}}return false}function closeReportPopup(E){var A=document.getElementById("report_popup");var B=document.getElementById("report_confirmation");var D=document.getElementById("report_text");var C=document.getElementById("popup_submit");if(C){C.style.display="none";setTimeout("document.getElementById('popup_submit').style.display='block';",3000)}if(B){B.style.display="inline";B.innerHTML=E;setTimeout("document.getElementById('report_confirmation').innerHTML='';document.getElementById('report_confirmation').style.display='none';",3000)
}if(A){setTimeout("document.getElementById('report_popup').style.display='none';",3000)}if(D){setTimeout("document.getElementById('report_text').value='enter text...';",3000)}}function showAnswerQuestion(){window.scrollTo(0,0);var A=document.getElementById("question_functions_container");var B=document.getElementById("question_answer_container");if(A&&B){A.style.display="none";B.style.display="inline"}return false}function hideAnswerQuestion(){var A=document.getElementById("question_functions_container");var B=document.getElementById("question_answer_container");
if(A&&B){A.style.display="inline";B.style.display="none"}return false}function questionRatingHover(B,E){var C=document.getElementById(B);if(C){var A=C.getElementsByTagName("img");for(var D=0;D<A.length;D++){if(D<E){A[D].src="/images/community/star.gif"}else{A[D].src="/images/community/star_empty.gif"}}}return false}function questionRatingHoverOff(B){var C=document.getElementById(B);if(C){var A=C.getElementsByTagName("img");for(var D=0;D<A.length;D++){A[D].src="/images/community/star_empty.gif"}}return false}function updateQuestionNotificationForLabel(C,A){if(checkMyC21TalksLogin()){var B=document.getElementById("notification"+C);
if(B){if(B.checked==false){ajaxSetQuestionNotification(C,A)}else{ajaxDeleteQuestionNotification(C)}}}return false}function updateQuestionNotification(C,A){if(checkMyC21TalksLogin()){var B=document.getElementById("notification"+C);if(B){if(B.checked==true){ajaxSetQuestionNotification(C,A)}else{ajaxDeleteQuestionNotification(C)}}}return false}function updateLocationNotificationForLabel(A){if(checkMyC21TalksLogin()){var B=document.getElementById("locnotification"+A);if(B){if(B.checked==false){ajaxSetLocationNotification(A)
}else{ajaxDeleteLocationNotification(A)}}}return false}function updateLocationNotification(A){if(checkMyC21TalksLogin()){var B=document.getElementById("locnotification"+A);if(B){if(B.checked==true){ajaxSetLocationNotification(A)}else{ajaxDeleteLocationNotification(A)}}}return false}function setAccountSkipIntroForLabel(){var A=document.getElementById("skip_intro");if(A){if(A.checked==false){ajaxSetSkipIntro()}}return false}function setAccountSkipIntro(){var A=document.getElementById("skip_intro");if(A){if(A.checked==true){ajaxSetSkipIntro()
}}return false}function watchQuestion(B){if(checkMyC21TalksLogin()){var A=document.getElementById("watch_question");if(A){if(A.checked){ajaxWatchQuestion(B)}else{ajaxDeleteWatchedQuestion(B)}}}return false}var g_currentRatingContainer="";function questionRatingRate(A,B,C){if(checkMyC21TalksLogin()){g_currentRatingContainer=A;ajaxRateQuestion(C,B);return false}}function questionAnswer(C,B){var A=document.getElementById(C);if(A){ajaxAnswerQuestion(B,A.value)}return false}function ajaxAnswerQuestion(A,B){var D=getServletPath()+"/servlet/talks/answerquestion?question_id="+A+"&answer="+escape(B);
var C=function(F){if(F.readyState==4&&F.status==200){var E=function(){hideAnswerQuestion()};handleAjaxResponse(F,E)}};g_AjaxQueue.schedule("answer_question",D,C)}function ajaxDeleteQuestionNotification(A){var C=getServletPath()+"/servlet/talks/deletequestionnotification?question_id="+A;var B=function(F){if(F.readyState==4&&F.status==200){var E=function(){var G=document.getElementById("notification"+A);if(G){G.checked=false;openMessagePopup(G,"Removed question notification",10,5,70,230)}setTimeout("hidePopup('message_popup');",2000)
};var D=function(H){var G=document.getElementById("notification"+A);if(G){openMessagePopup(G,"Could not delete question notification",10,5,70,230)}setTimeout("hidePopup('message_popup');",2000)};handleAjaxResponse(F,E,D)}};g_AjaxQueue.schedule("del_question_notification",C,B)}function ajaxSetQuestionNotification(A,B){var D=getServletPath()+"/servlet/talks/setquestionnotification?question_id="+A+"&type="+B;var C=function(G){if(G.readyState==4&&G.status==200){var F=function(){var H=document.getElementById("notification"+A);
if(H){H.checked=true;openMessagePopup(H,"Set question notification",10,5,70,230)}setTimeout("hidePopup('message_popup');",2000)};var E=function(I){var H=document.getElementById("notification"+A);if(H){openMessagePopup(H,"Could not set question notification",10,5,70,230)}setTimeout("hidePopup('message_popup');",2000)};handleAjaxResponse(G,F,E)}};g_AjaxQueue.schedule("set_question_notification",D,C)}function ajaxDeleteLocationNotification(A){var C=getServletPath()+"/servlet/talks/removelocationnotification?loc_id="+A;
var B=function(F){if(F.readyState==4&&F.status==200){var E=function(){var G=document.getElementById("locnotification"+A);if(G){G.checked=false;openMessagePopup(G,"Removed area notification",10,5,70,230)}setTimeout("hidePopup('message_popup');",2000)};var D=function(H){var G=document.getElementById("locnotification"+A);if(G){openMessagePopup(G,"Could not delete area notification",10,5,70,230)}setTimeout("hidePopup('message_popup');",2000)};handleAjaxResponse(F,E,D)}};g_AjaxQueue.schedule("del_location_notification",C,B)
}function ajaxSetLocationNotification(A){var C=getServletPath()+"/servlet/talks/setlocationnotification?loc_id="+A;var B=function(F){if(F.readyState==4&&F.status==200){var E=function(){var G=document.getElementById("locnotification"+A);if(G){G.checked=true;openMessagePopup(G,"Set area notification",10,5,70,230)}setTimeout("hidePopup('message_popup');",2000)};var D=function(H){var G=document.getElementById("locnotification$"+A);if(G){openMessagePopup(G,"Could not set area notification",10,5,70,230)}setTimeout("hidePopup('message_popup');",2000)
};handleAjaxResponse(F,E,D)}};g_AjaxQueue.schedule("set_location_notification",C,B)}function ajaxSetSkipIntro(){var B=getServletPath()+"/servlet/talks/setskipintro";var A=function(E){if(E.readyState==4&&E.status==200){var D=function(){var F=document.getElementById("skip_intro");if(F){F.checked=true;openMessagePopup(F,"Request to skip intro was accepted",10,5,70,230)}};var C=function(G){var F=document.getElementById("skip_intro");if(F){openMessagePopup(F,"Could not set skip intro",10,5,70,230)}setTimeout("hidePopup('message_popup');",2000)
};handleAjaxResponse(E,D,C)}};g_AjaxQueue.schedule("set_skip_intro",B,A)}function ajaxWatchQuestion(A){var C=getServletPath()+"/servlet/talks/watchquestion?question_id="+A;var B=function(F){if(F.readyState==4&&F.status==200){var E=function(){var G=document.getElementById("watch_question");if(G){openMessagePopup(G,"You are now watching this question",-40,5,85,155)}setTimeout("hidePopup('message_popup');",2000);setTimeout("window.location.reload()",2000)};var D=function(H){var G=document.getElementById("watch_question");
if(G){openMessagePopup(G,"Could not watch question",-40,5,85,155)}setTimeout("hidePopup('message_popup');",2000)};handleAjaxResponse(F,E,D)}};g_AjaxQueue.schedule("watch_question",C,B)}function ajaxDeleteWatchedQuestion(A){var C=getServletPath()+"/servlet/talks/deletewatchedquestion?delw_question_id="+A;var B=function(F){if(F.readyState==4&&F.status==200){var E=function(){var G=document.getElementById("watch_question");if(G){openMessagePopup(G,"You are no longer watching this question",-40,5,85,155)}setTimeout("hidePopup('message_popup');",2000)
};var D=function(H){var G=document.getElementById("watch_question");if(G){openMessagePopup(G,"Could not delete watch for question",-40,5,85,155)}setTimeout("hidePopup('message_popup');",2000)};handleAjaxResponse(F,E,D)}};g_AjaxQueue.schedule("delete_watch_question",C,B)}function ajaxRateQuestion(A,B){var D=getServletPath()+"/servlet/talks/ratequestion?question_id="+A+"&rating="+B;var C=function(G){if(G.readyState==4&&G.status==200){var F=function(){var I=document.getElementById(g_currentRatingContainer);if(I){var K="";
for(var J=0;J<B;J++){K+='<img src="/images/community/star.gif">&nbsp;'}for(var H=5;H>B;H--){K+='<img src="/images/community/star_empty.gif">&nbsp;'}I.innerHTML=K}var L=document.getElementById(g_currentRatingContainer);if(L){openMessagePopup(L,"Your rating has been recorded",-74,-15,70,200)}setTimeout("hidePopup('message_popup');",2000)};var E=function(I){var H=document.getElementById(g_currentRatingContainer);if(H){openMessagePopup(H,I,-74,-15,70,240)}setTimeout("hidePopup('message_popup');",2000)};handleAjaxResponse(G,F,E)
}};g_AjaxQueue.schedule("rate_question",D,C)}function ajaxReportQuestion(A,B){var D=getServletPath()+"/servlet/talks/reportquestion?question_id="+A+"&notes="+B;var C=function(G){if(G.readyState==4&&G.status==200){var F=function(){closeReportPopup("Thank you for reporting this question")};var E=function(H){closeReportPopup(H)};handleAjaxResponse(G,F,E)}};g_AjaxQueue.schedule("report_question",D,C)}var g_ratedAnswers=new Array;var g_currentRateAnswerId=-1;function answerRatingRate(A,B){if(checkMyC21TalksLogin()){if(!isInArray(B,g_ratedAnswers)){ajaxRateAnswer(B,A);
g_ratedAnswers.push(B);g_currentRateAnswerId=B}else{var C=document.getElementById("votes_for"+g_currentRateAnswerId);if(C){openMessagePopup(C,"Already Rated Answer",-50,5,70,185);setTimeout("hidePopup('message_popup');",2000)}}}return false}function ajaxRateAnswer(B,A){var D=getServletPath()+"/servlet/talks/rateanswer?answer_id="+B+"&rating="+A;var C=function(G){if(G.readyState==4&&G.status==200){var F=function(){var I=document.getElementById("votes_for"+g_currentRateAnswerId);var H=document.getElementById("votes_against"+g_currentRateAnswerId);
if(I&&H){if(A>0){var J=I.innerHTML;I.innerHTML=parseInt(J)+1;openMessagePopup(I,"Answer Rating Submitted",-50,5,70,180);setTimeout("hidePopup('message_popup');",2000)}else{var J=H.innerHTML;H.innerHTML=parseInt(J)+1;openMessagePopup(H,"Answer Rating Submitted",-50,5,70,180);setTimeout("hidePopup('message_popup');",2000)}}};var E=function(I){var H=document.getElementById("votes_for"+g_currentRateAnswerId);if(H){openMessagePopup(H,I,-50,5,70,235);setTimeout("hidePopup('message_popup');",2000)}};handleAjaxResponse(G,F,E)
}};g_AjaxQueue.schedule("rate_question",D,C)}function ajaxReportAnswer(B,A){var D=getServletPath()+"/servlet/talks/reportanswer?answer_id="+B+"&notes="+A;var C=function(G){if(G.readyState==4&&G.status==200){var F=function(){closeReportPopup("Thank you for reporting this answer")};var E=function(H){closeReportPopup(H)};handleAjaxResponse(G,F,E)}};g_AjaxQueue.schedule("report_question",D,C)}function deleteAccountLocation(C,A){var B=confirm("Are you sure you want to delete "+A+" from your Email Alerts?");if(B){ajaxDeleteAccountLocation(C)
}return false}function ajaxDeleteAccountLocation(A){var C=getServletPath()+"/servlet/talks/deleteaccountlocation?loc_id="+A;var B=function(F){if(F.readyState==4&&F.status==200){var E=function(){var I=document.getElementById("alert_count_content");var G=document.getElementById("alert_count_handle");var J=document.getElementById("area_item_"+A);if(I!=null&&G!=null){var H=I.innerHTML;H--;I.innerHTML=H;G.innerHTML=H}if(J!=null){J.style.display="none"}var K=document.getElementById("addl_loc");if(K){openMessagePopup(K,"Successfully deleted location.",10,5,135,185)
}setTimeout("hidePopup('message_popup');",2000)};var D=function(){var G=document.getElementById("addl_loc");if(G){openMessagePopup(G,"Could not delete location",10,5,135,185)}setTimeout("hidePopup('message_popup');",2000)};handleAjaxResponse(F,E,D)}};g_AjaxQueue.schedule("delete_account_location",C,B)}function handleAjaxResponse(F,D,B){var E=F.responseXML.getElementsByTagName("status");if(E.length>=1){if(E[0].firstChild.nodeValue=="success"){D()}else{var A=F.responseXML.getElementsByTagName("message");var C=F.responseXML.getElementsByTagName("details");
if(A.length>=1&&C.length>=1){B(A[0].firstChild.nodeValue)}else{B(A[0].firstChild.nodeValue)}}}else{alert("Unexpected Response.")}}function ShowAskQuestion(){var A=document.getElementById("full_ask");if(A){A.className=A.className.replace("hide","");var B=document.getElementById("ask_go");if(B){B.src="/images/community/go_gray_but.gif"}}return false}function HideAskQuestion(){var A=document.getElementById("full_ask");if(A){A.className=A.className+" hide";var B=document.getElementById("ask_go");if(B){B.src="/images/community/go_yel_but.gif"
}}return false}function chooseSearchLocation(A){var B=document.getElementById("search_loc");if(B){B.value=A}}function showSearchLocationSuggest(){var A=document.getElementById("search_autocomplete");if(A){A.style.display="inline"}}function hideSearchLocationSuggest(){var A=document.getElementById("search_autocomplete");if(A){setTimeout("document.getElementById('search_autocomplete').style.display='none';",250)}}function chooseQuestionLocation(A){var B=document.getElementById("ask_loc");if(B){B.value=A}}function showLocationSuggest(){var A=document.getElementById("ask_autocomplete");
if(A){A.style.display="inline"}}function hideLocationSuggest(){var A=document.getElementById("ask_autocomplete");if(A){setTimeout("document.getElementById('ask_autocomplete').style.display='none';",250)}}function EmbedTagCloud(B,C,A){AC_FL_RunContent("codebase","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0","width",B,"height",C,"src","TagCloud","quality","high","pluginspage","http://www.macromedia.com/go/getflashplayer","align","middle","play","true","loop","true","scale","showall","wmode","transparent","devicefont","false","id","TagCloud","bgcolor","#000000","name","TagCloud","menu","true","allowFullScreen","false","allowScriptAccess","sameDomain","movie","/communities/includes/TagCloud","FlashVars","xml="+escape(A),"salign","")
}function onTagCloudResize(A){var C=document.getElementById("tag_cloud");if(C){C.style.height=(A+50)+"px"}var B=document.getElementById("cloud");if(B){B.style.height=(A-4)+"px"}}var lastValue=new Array();function triggerSpellChecker(E){var A=document.getElementById(E);if(A!=null){var D=A.value;D=D.replace(/^\s+|\s+$/g," ");var B=D[D.length-1];var C=lastValue[E];if(String(B).match(/^[a-zA-Z0-9]/g)==null){if(C==null||D!=C){lastValue[E]=D;runSpellChecker(E)}}}}function runSpellChecker(D){var A=document.getElementById(D);
if(A!=null){var C=escape(A.value);var B="/ajaxservlet/c21spellchecker/spellcheck?text="+C;if(D=="ask_question"){g_AjaxQueue.schedule("spell_checker",B,askSpellCheckCallback)}else{if(D=="answer_question"){g_AjaxQueue.schedule("spell_checker",B,answerSpellCheckCallback)}}}}function askSpellCheckCallback(A){spellCheckCallback(A,"ask_misspell_count")}function answerSpellCheckCallback(A){spellCheckCallback(A,"answer_misspell_count")}function spellCheckCallback(G,D){if(G.readyState==4&&G.status==200){var F=G.responseXML;
var E=F.getElementsByTagName("spellchecker");if(E.length>0){var A=E[0].getElementsByTagName("count");if(A){var C=A[0].firstChild.nodeValue;var B=document.getElementById(D);if(B){if(C>0){B.style.display="block"}else{B.style.display="none"}}}}}}function ajaxSpellCheckAnswerSubmitCallback(){var A=document.getElementById("answer_question");if(A){var D=A.value;var C="/ajaxservlet/c21spellchecker/spellcheck?text="+D;var B=function(J){if(J.readyState==4&&J.status==200){var I=J.responseXML;var H=I.getElementsByTagName("spellchecker");
if(H.length>0){var E=H[0].getElementsByTagName("count");if(E){var G=E[0].firstChild.nodeValue;if(G>=8){doSpellCheckerPopup("answer_question")}else{var F=document.getElementById("answer_form");if(F){F.submit()}}}}}}}g_AjaxQueue.schedule("spellcheck_ask_submit",C,B)}function ajaxSpellCheckAskSubmitCallback(){var A=document.getElementById("ask_question");if(A){var D=A.value;var C="/ajaxservlet/c21spellchecker/spellcheck?text="+D;var B=function(J){if(J.readyState==4&&J.status==200){var I=J.responseXML;var H=I.getElementsByTagName("spellchecker");
if(H.length>0){var E=H[0].getElementsByTagName("count");if(E){var G=E[0].firstChild.nodeValue;if(G>=4){doSpellCheckerPopup("ask_question")}else{var F=document.getElementById("ask_form");if(F){F.submit()}}}}}}}g_AjaxQueue.schedule("spellcheck_ask_submit",C,B)}function doSpellCheckerPopup(D){var A=document.getElementById(D);if(A!=null){var C=escape(A.value);var B="/ajaxservlet/c21spellchecker/spellcheck?text="+C;if(D=="ask_question"){g_AjaxQueue.schedule("spell_checker_popup",B,askSpellCheckPopupCallback)}else{if(D=="answer_question"){g_AjaxQueue.schedule("spell_checker_popup",B,answerSpellCheckPopupCallback)
}}}}function answerSpellCheckPopupCallback(A){spellCheckPopupCallback(A,"answer_question")}function askSpellCheckPopupCallback(A){spellCheckPopupCallback(A,"ask_question")}function spellCheckPopupCallback(M,L){if(M.readyState==4&&M.status==200){var H=M.responseXML;var B=H.getElementsByTagName("spellchecker");if(B.length>0){var N=B[0].getElementsByTagName("count");if(N){var G=document.getElementById(L);var K="";if(G){var J=N[0].firstChild.nodeValue;if(J>0){K="Found <span id='spellpopup_count'>"+J+"</span> misspelled words. ";
K+="<table class='spellchecker_table'>";var I=B[0].getElementsByTagName("misspell");if(I&&I.length>0){for(var F=0;F<I.length;F++){var O=I[F].getElementsByTagName("word");if(O&&O.length>0){var A=O[0].firstChild.nodeValue;K+="<tr id='word_"+A+"'><td>"+A+"</td><td>";var E=I[F].getElementsByTagName("suggestion");if(E&&E.length>0){K+="<select id='suggestions_"+A+"'>";for(var D=0;D<E.length;D++){var C=E[D].firstChild.nodeValue;K+="<option value='"+C+"'>"+C+"</option>"}K+="</select>"}else{K+="-- NO SUGGESTIONS --"}K+="</td><td><a href='javascript:fixMisspelling(\""+L+'", "'+A+'");\'><img src="/images/community/fixit.gif"></a></td></tr>'
}}}K+="</table>"}else{K="Question does not appear to have any misspelled words."}if(L=="answer_question"){openSpellCheckPopup(G,K,-5,50)}else{openSpellCheckPopup(G,K,226,-69)}}}}}}function fixMisspelling(H,E){var D=document.getElementById("suggestions_"+E);if(D){var C=D.options[D.selectedIndex].value;replaceTextareaValue(H,E,C)}var A=document.getElementById("word_"+E);if(A){A.style.display="none"}var G=document.getElementById("spellpopup_count");if(G){var B=G.innerHTML;if(B>1){B--;G.innerHTML=B}else{hidePopup("spellcheck_popup")
}}runSpellChecker(H);var F=document.getElementById(H);if(F!=null&&H=="answer_question"){limitInputLength(F,160,"answer_char_counter")}else{if(F!=null){limitInputLength(F,160,"ask_char_counter")}}}function replaceTextareaValue(E,B,C){textarea=document.getElementById(E);if(textarea){var D=textarea.value;var A=D.replace(B,C);textarea.value=A}};