function MM_jumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function f_lgnfrmchk(){
   var eml = document.loginForm.username.value;
   if (eml.indexOf("@") == -1){
      window.alert("Please make sure that you enter a valid email address to login.");
      document.loginForm.username.focus();
   } else {
      document.loginForm.submit();
   }
}
function popup_win(in_messageid,in_board_name,in_thread_name,in_heading,in_author) {
	var url = 'report_abuse.jsp?in_messageid='+in_messageid+'&in_board_name='+in_board_name+'&in_thread_name='+in_thread_name+'&in_heading='+ in_heading +'&in_author=' + in_author;
	var name = 'abuse';
	window.open(url,name,'width=495,height=545','');
}
var pc = navigator.userAgent.toLowerCase();
var ie4_win = (pc.indexOf("win")!=-1) && (pc.indexOf("msie") != -1)
    && (parseInt(navigator.appVersion) >= 4);
var checked = false;
function checkPost() {
    if (!checked) {
        checked = true;
        return true;
    }
    return false;
}
function styleTag(tag, ta) {
    var tagOpen = '[' + tag.toLowerCase() + ']';
    var tagClose = '[/' + tag.toLowerCase() + ']';
    if (ie4_win) {
        var selected = document.selection.createRange().text;
        if (selected) {
            var addSpace = false;
            if (selected.charAt(selected.length-1) == ' ') {
                selected = selected.substring(0, selected.length-1);
                addSpace = true;
            }
            document.selection.createRange().text
                    = tagOpen + selected + tagClose + ((addSpace)?" ":"");
        } else {
            ta.value += tagOpen + tagClose;
        }
    } else {
        ta.value += tagOpen + tagClose;
    }
    ta.focus();
    return;
}
function caret(ta) {
    if (ie4_win && ta.createTextRange) {
        ta.caretPos = document.selection.createRange().duplicate();
    }
}
function doPrev(){
  document.pstfrm.ac.name = "preview";
  document.pstfrm.ac.value="Preview";
  document.pstfrm.submit();
}
function doSpellCheck(){
  document.pstfrm.ac.name = "spellCheck";
  document.pstfrm.ac.value="";
  document.pstfrm.submit();
}
function doSpellChg(){
  document.spellForm.ac.name = "change";
  document.spellForm.ac.value= "Change";
  document.spellForm.submit();
}
function doSpellIg(){
  document.spellForm.ac.name = "ignore";
  document.spellForm.ac.value= "Ignore";
  document.spellForm.submit();
}
function doSpellDelete(){
  document.spellForm.ac.name = "delete";
  document.spellForm.ac.value= "Delete";
  document.spellForm.submit();
}
function doSpellChgAll(){
  document.spellForm.ac.name = "changeAll";
  document.spellForm.ac.value= "Change All";
  document.spellForm.submit();
}
function doSpellIgAll(){
  document.spellForm.ac.name = "ignoreAll";
  document.spellForm.ac.value= "Ignore All";
  document.spellForm.submit();
}
function doSpellEdit(){
  document.spellForm.ac.name = "edit";
  document.spellForm.ac.value= "Go Back or Edit";
  document.spellForm.submit();
}
function doSpellPost(){
  document.spellForm.ac.name = "doPost";
  document.spellForm.ac.value= "Post Message";
  document.spellForm.submit();
}
function goCat(){
  selectedCat = document.jump_form.topCats.selectedIndex;
  val = document.jump_form.topCats.options[selectedCat].value;
  window.location.href = "index.jsp?cat="+document.jump_form.topCats.options[selectedCat].value;
}
function goForum(){
  selectedForum = document.jump_form.thisLevel.selectedIndex;
  frmVal = document.jump_form.thisLevel.options[selectedForum].value;
  if (frmVal.indexOf("cat_") >= 0){
    frmLngth = frmVal.length;
    frmCat = frmVal.substring(4,frmLngth);
    window.location.href = "index.jsp?cat="+frmCat;
  } else {
     window.location.href = "forum.jsp?forum="+frmVal;
  }
}
function goSort(){
  selInd = document.sort.order.selectedIndex;
  vForId =  document.sort.forumID.value;
  document.location.href = "forum.jsp?forum=" + vForId + "&sort="+document.sort.order.options[selInd].value;
}