function chgAction($, _) {
  $.action = _
}
function toggle($) {
  if (typeof($) == "string") $ = document.getElementById($);
  if ($.style.display != "") {
    $.style.display = "";
    return
  }
  if ($.style.display != "none") {
    $.style.display = "none";
    return
  }
}
function getCookie(A) {
  var _ = A + "=",
  $ = document.cookie.indexOf(_);
  if ($ == -1) return "";
  var C = document.cookie.indexOf(";", $ + _.length);
  if (C == -1) C = document.cookie.length;
  var B = document.cookie.substring($ + _.length, C);
  return unescape(B)
}
function setCookie(_, D, $, C, B, A) {
  document.cookie = _ + "=" + escape(D) + (($) ? "; expires=" + $.toGMTString() : "") + ((C) ? "; path=" + C: "") + ((B) ? "; domain=" + B: "") + ((A) ? "; secure": "")
}
function deleteCookie($, A, _) {
  if (getCookie($)) document.cookie = $ + "=" + ((A) ? "; path=" + A: "") + ((_) ? "; domain=" + _: "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"
}
function InputIsDigit($) {
  $ = $ || event;
  var _ = ($.keyCode || $.charCode);
  if ((_ >= 48 && _ <= 57) || (_ >= 37 && _ <= 40) || _ == 8 || _ == 46) return;
  else {
    _ = 0;
    $.keyCode = 0;
    $.charCode = 0
  }
}
function setNavig(_) {
  var $ = document.getElementById("urlheader");
  if ($) for (var A = 0; A < _.length; A += 2) $.innerHTML = $.innerHTML + "&gt; <a href=\"" + _[A] + "\">" + _[A + 1] + "</a>"
}
function hideNavig() {
  var $ = document.getElementById("urlheader_tb");
  if ($) $.style.display = "none"
}
function stripTags($) {
  return $.replace(/<\/?[^>]+>/gi, "")
}
function delHtmlTag($) {
  return $.replace(/<[^>]+>/g, "")
}
function trim($) {
  return $.replace(/(^\s*)|(\s*$)/g, "")
}
function trimHTML($) {
  return $.replace(/^(&nbsp;|[\s　])+|(&nbsp;|[\s　])+$/g, "")
}
function allOptions(_) {
  var $ = document.getElementById(_),
  A = $.length;
  if (A > 0) for (var B = 0; B < A; B++) $.options[B].selected = true;
  return true
}
function addOptions(B, _) {
  var A = document.getElementById(B),
  D = A.length,
  $ = document.getElementById(_);
  if (D > 0) for (var C = 0; C < D; C++) if (A.options[C].selected == true) $.options[$.length] = new Option(A.options[C].text, A.options[C].value)
}
function delOptions(_) {
  var $ = document.getElementById(_),
  A = $.length;
  if (A > 0) for (var B = A; B > 0; B = B - 1) if ($.options[B - 1].selected == true) $.remove(B - 1)
}
function addFvrDlg($, A) {
  var _ = new Array($, A);
  if (window.showModalDialog) window.showModalDialog("/inc/add.php?title="+encodeURI($)+"&url="+A+"&temp=" + Math.random(),"titlebar='no';resizable='no';scroll='no';help='no';status='no';dialogHeight=328px;dialogWidth=428px;");
  else {
    modalWin = window.open("/inc/add.php", "\u4fdd\u5b58/\u4fee\u6539\u6536\u85cf\u4fe1\u606f", "height=328px,width=428px,toolbar=no,directories=no,titlebar=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes");
    modalWin.dialogArguments = _
  }
}
function popUp($) {
  if (window.showModalDialog) window.showModalDialog($ + "?temp=" + Math.random(), MyArgs, "titlebar='no';resizable='no';scroll='no';help='no';status='no';dialogHeight=320px;dialogWidth=240px;");
  else {
    modalWin = window.open($, "", "height=320px,width=240px,toolbar=no,directories=no,titlebar=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes");
    modalWin.dialogArguments = MyArgs
  }
}
function editFvrDlg($) {
  var _ = new Array(window);
  if (window.showModalDialog) window.showModalDialog("/inc/view/fvr/" + $ + "?temp=" + Math.random(), _, "titlebar='no';resizable='no';scroll='no';help='no';status='no';dialogHeight=328px;dialogWidth=428px;");
  else {
    modalWin = window.open("/inc/view/fvr/" + $, "\u4fdd\u5b58/\u4fee\u6539\u6536\u85cf\u4fe1\u606f", "height=328px,width=428px,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes");
    modalWin.dialogArguments = _
  }
}
function addMsgDlg(_) {
  var $ = new Array(_);
  if (window.showModalDialog) window.showModalDialog("addmsg.php?name="+_+"&temp=" + Math.random(), $, "scroll='no';help='no';status='no';dialogHeight=258px;dialogWidth=428px;");
  else {
    modalWin = window.open("addmsg.php?name="+_, "\u53d1\u9001\u77ed\u4fe1\u606f", "height=258px,width=428px,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes");
    modalWin.dialogArguments = $
  }
}
function addMsgDlg2(_) {
  var $ = new Array(_);
  if (window.showModalDialog) window.showModalDialog("../addmsg.php?name="+_+"&temp=" + Math.random(), $, "scroll='no';help='no';status='no';dialogHeight=258px;dialogWidth=428px;");
  else {
    modalWin = window.open("../addmsg.php?name="+_, "\u53d1\u9001\u77ed\u4fe1\u606f", "height=258px,width=428px,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes");
    modalWin.dialogArguments = $
  }
}
function addFrdDlg(_) {
  var $ = new Array(_);
  if (window.showModalDialog) window.showModalDialog("addfr.php?name="+_+"&temp=" + Math.random(), $, "scroll='no';help='no';status='no';dialogHeight=258px;dialogWidth=428px;");
  else {
    modalWin = window.open("addfr.php?name="+_, "\u53d1\u9001\u77ed\u4fe1\u606f", "height=258px,width=428px,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes");
    modalWin.dialogArguments = $
  }
}
function viewMsgDlg($) {
  var _ = new Array(window);
  if (window.showModalDialog) window.showModalDialog("/inc/view/msg_dlg/" + $ + "?temp=" + Math.random(), _, "scroll='no';help='no';status='no';dialogHeight=258px;dialogWidth=428px;");
  else {
    modalWin = window.open("/inc/view/msg_dlg/" + $, "\u7ad9\u5185\u4fe1\u606f", "height=258px,width=428px,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes");
    modalWin.dialogArguments = _
  }
}
function viewHprDlg($) {
  var _ = new Array(window);
  if (window.showModalDialog) window.showModalDialog("/inc/view/hpr/" + $ + "?temp=" + Math.random(), _, "help='no';status='no';dialogHeight=328px;dialogWidth=428px;");
  else {
    modalWin = window.open("/inc/view/hpr/" + $, "\u6bcf\u65e5\u6280\u5de7", "height=328px,width=428px,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes");
    modalWin.dialogArguments = _
  }
}
function addCplDlg($) {
  if (window.showModalDialog) window.showModalDialog("/complain.php?question=" + $, null, "scroll='no';help='no';status='no';dialogHeight=235px;dialogWidth=428px;");
  else modalWin = window.open("/complain.php?question=" + $, "\u6211\u8981\u6295\u8bc9", "height=235px,width=428px,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes")
}
function cancelCplDlg($) {
  if (!confirm("\u786e\u5b9a\u53d6\u6d88\u6295\u8bc9?")) return;
  if (window.showModalDialog) window.showModalDialog("/complain.php?select=" + $, null, "scroll='no';help='no';status='no';dialogHeight=235px;dialogWidth=428px;");
  else modalWin = window.open("/complain.php?select=" + $, "\u6211\u8981\u6295\u8bc9", "height=235px,width=428px,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes")
}
function editFrdDlg($) {
  var _ = new Array(window);
  if (window.showModalDialog) window.showModalDialog("editfr.php?frid=" + $ + "&temp=" + Math.random(), _, "help='no';status='no';dialogHeight=258px;dialogWidth=428px;");
  else {
    modalWin = window.open("editfr.php?frid=" + $, "\u4fdd\u5b58/\u4fee\u6539\u597d\u53cb\u4fe1\u606f", "height=258px,width=428px,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes");
    modalWin.dialogArguments = _
  }
}
function setFrameHight($, _) {
  var A = document.getElementById($);
  A.height = parseInt(A.height) + _;
  if (A.height < 50) A.height = 50
}
function setNewHight(_) {
  var $ = document.getElementById("qstframe");
  $.height = parseInt($.height) + _;
  if ($.height < 50) $.height = 50
}
function gotoPage(C, _, B) {
  var A = document.getElementById("pageno");
  if (A) {
    var $ = A.value;
    if (parseInt($) > parseInt(_)) $ = _;
    self.location = C + $ + B
  }
}
function getNewSDCString(A) {
  var $ = A.indexOf("BAAAgFQAZQB4");
  if ($ < 0) return "";
  else {
    var _ = A.indexOf("AAAAAAAAAAAAAAAAAAAAAAAAAAAA", $);
    if (_ < 0) return "";
    else return A.substr($, _ + 8 - $)
  }
  return ""
}
function encodeBase64(_) {
  var A = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
  D = _.length,
  C = "";
  function $(B, F) {
    if (!F) return "";
    var E = 0,
    D = "";
    while (E < F) {
      var C = Number(B.charCodeAt(E)).toString(16) + Number(B.charCodeAt(++E)).toString(16) + Number(B.charCodeAt(++E)).toString(16),
      $ = parseInt(C.substring(0, 3), 16),
      _ = parseInt(C.slice( - 3), 16);
      D += A.charAt(Math.floor($ / 64)) + A.charAt($ % 64) + A.charAt(Math.floor(_ / 64)) + A.charAt(_ % 64);
      E += 1
    }
    return D
  }
  if (D % 3 == 0) return $(_, D);
  if (D % 3 == 2) {
    C = $(_.slice(0, -2), D - 2);
    var B = Number(_.charCodeAt(D - 2)).toString(16) + Number(_.charCodeAt(D - 1)).toString(16);
    C += A.charAt(Math.floor(parseInt(B.substring(0, 3), 16) / 64)) + A.charAt(parseInt(B.substring(0, 3), 16) % 64) + A.charAt(parseInt(B.slice( - 1), 16) * 4) + "="
  }
  if (D % 3 == 1) {
    C = $(_.slice(0, -1), D - 1);
    B = Number(_.charCodeAt(D - 1)).toString(2);
    while (B.length < 8) B = "0" + B;
    C += A.charAt(parseInt(B.substring(0, 6), 2)) + A.charAt(parseInt(B.slice( - 2), 2) * 16) + "=="
  }
  return C
}
function decodeBase64($) {
  var _ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
  A = {},
  B = "";
  $.replace(/=/g, "").replace(/./g,
  function(B) {
    var C = _.indexOf(B);
    if (A[C] === undefined) {
      var $ = Number(C).toString(2);
      while ($.length < 6) $ = "0" + $;
      A[C] = $
    }
    return A[C]
  }).replace(/.{8}/g,
  function($) {
    B += String.fromCharCode(parseInt($, 2));
    return ""
  });
  return B
}
function encode_utf8(_) {
  _ = _.replace(/\r\n/g, "\n");
  var B = "";
  for (var A = 0; A < _.length; A++) {
    var $ = _.charCodeAt(A);
    if ($ < 128) B += String.fromCharCode($);
    else if (($ > 127) && ($ < 2048)) {
      B += String.fromCharCode(($ >> 6) | 192);
      B += String.fromCharCode(($ & 63) | 128)
    } else {
      B += String.fromCharCode(($ >> 12) | 224);
      B += String.fromCharCode((($ >> 6) & 63) | 128);
      B += String.fromCharCode(($ & 63) | 128)
    }
  }
  return B
}
function decode_utf8(A) {
  var _ = "",
  B = 0,
  $ = c1 = c2 = 0;
  while (B < A.length) {
    $ = A.charCodeAt(B);
    if ($ < 128) {
      _ += String.fromCharCode($);
      B++
    } else if (($ > 191) && ($ < 224)) {
      c2 = A.charCodeAt(B + 1);
      _ += String.fromCharCode((($ & 31) << 6) | (c2 & 63));
      B += 2
    } else {
      c2 = A.charCodeAt(B + 1);
      c3 = A.charCodeAt(B + 2);
      _ += String.fromCharCode((($ & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
      B += 3
    }
  }
  return _
}
function showDiv(A, B, _, $) {
  for (var C = 1; C <= B; C++) {
    document.getElementById(_ + C).childNodes[0].style.background = A == C ? "url('/images/button_leftBg_On.gif')": "url('/images/button_leftBg_Off.gif')";
    document.getElementById(_ + C).childNodes[0].style.color = A == C ? "#294c4c": "#668e8e";
    document.getElementById(_ + C).childNodes[1].style.background = A == C ? "url('/images/button_rightBg_On.gif')": "url('/images/button_rightBg_Off.gif')";
    document.getElementById($ + C).style.display = A == C ? "block": "none"
  }
}
function showOption(A, B, _, $, C) {
  for (var D = 1; D <= B; D++) {
    document.getElementById(_ + D).style.background = A == D ? "url('/images/" + C + "ON.gif')": "url('/images/" + C + "OFF.gif')";
    document.getElementById(_ + D).style.color = A == D ? "#294c4c": "#668e8e";
    document.getElementById($ + D).style.display = A == D ? "block": "none"
  }
}
function showValue($) {
  if ($ == 1) {
    document.getElementById("optionsV" + 1).style.background = "url('/images/button_myPlace_optionON.gif')";
    document.getElementById("optionsV" + 2).style.background = "url('/images/button_myPlaceLong_optionOFF.gif')";
    document.getElementById("optionsV" + 1).style.color = "#294c4c";
    document.getElementById("optionsV" + 2).style.color = "#668e8e";
    document.getElementById("valueCon" + 1).style.display = "block";
    document.getElementById("valueCon" + 2).style.display = "none"
  }
  if ($ == 2) {
    document.getElementById("optionsV" + 1).style.background = "url('/images/button_myPlace_optionOFF.gif')";
    document.getElementById("optionsV" + 2).style.background = "url('/images/button_myPlaceLong_optionON.gif')";
    document.getElementById("optionsV" + 1).style.color = "#668e8e";
    document.getElementById("optionsV" + 2).style.color = "#294c4c";
    document.getElementById("valueCon" + 1).style.display = "none";
    document.getElementById("valueCon" + 2).style.display = "block"
  }
}
function showMassage(A, B, _, $, C) {
  for (var D = 1; D <= B; D++) {
    document.getElementById(_ + D).style.background = A == D ? "url('/images/buttom_myDomain.gif')": "none";
    document.getElementById(_ + D).style.font = A == D ? "normal normal 600 12px/25px \u5b8b\u4f53;": "normal normal 300 12px/25px \u5b8b\u4f53;";
    document.getElementById(_ + D).style.color = A == D ? "#294c4c": "#668e8e";
    if ($ != "") document.getElementById($ + D).style.display = A == D ? "block": "none"
  }
}
function showTitle($) {
  document.getElementById($).style.display = "block"
}
function hiddenTitle(_) {
  var $ = (window.event) ? window.event.srcElement: window.event.target;
  if ($.nodeName != "DIV") return;
  document.getElementById(_).style.display = "none"
}
function flash(_, $, A) {
  document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"[url]http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6[/url],0,29,0\" width=\"" + $ + "\" height=\"" + A + "\"> ");
  document.write("<param name=\"movie\" value=\"" + _ + "\">");
  document.write("<param name=\"quality\" value=\"high\"> ");
  document.write("<param name=\"wmode\" value=\"transparent\"> ");
  document.write("<param name=\"menu\" value=\"false\"> ");
  document.write("<embed src=\"" + _ + "\" quality=\"high\" pluginspage=\"[url]http://www.macromedia.com/go/getflashplayer[/url]\" type=\"application/x-shockwave-flash\" width=\"" + $ + "\" height=\"" + A + "\"></embed> ");
  document.write("</object> ")
}
function showDiv(A, B, _, $) {
  for (var C = 1; C <= B; C++) {
    document.getElementById(_ + C).childNodes[0].style.background = A == C ? "url('/images/button_leftBg_On.gif')": "url('/images/button_leftBg_Off.gif')";
    document.getElementById(_ + C).childNodes[0].style.color = A == C ? "#294c4c": "#668e8e";
    document.getElementById(_ + C).childNodes[1].style.background = A == C ? "url('/images/button_rightBg_On.gif')": "url('/images/button_rightBg_Off.gif')";
    document.getElementById($ + C).style.display = A == C ? "block": "none"
  }
}
function showOption(A, B, _, $, C) {
  for (var D = 1; D <= B; D++) {
    document.getElementById(_ + D).style.background = A == D ? "url('/images/" + C + "ON.gif')": "url('/images/" + C + "OFF.gif')";
    document.getElementById(_ + D).style.color = A == D ? "#294c4c": "#668e8e";
    document.getElementById($ + D).style.display = A == D ? "block": "none"
  }
}
function showValue($) {
  if ($ == 1) {
    document.getElementById("optionsV" + 1).style.background = "url('/images/button_myPlace_optionON.gif')";
    document.getElementById("optionsV" + 2).style.background = "url('/images/button_myPlaceLong_optionOFF.gif')";
    document.getElementById("optionsV" + 1).style.color = "#294c4c";
    document.getElementById("optionsV" + 2).style.color = "#668e8e";
    document.getElementById("valueCon" + 1).style.display = "block";
    document.getElementById("valueCon" + 2).style.display = "none"
  }
  if ($ == 2) {
    document.getElementById("optionsV" + 1).style.background = "url('/images/button_myPlace_optionOFF.gif')";
    document.getElementById("optionsV" + 2).style.background = "url('/images/button_myPlaceLong_optionON.gif')";
    document.getElementById("optionsV" + 1).style.color = "#668e8e";
    document.getElementById("optionsV" + 2).style.color = "#294c4c";
    document.getElementById("valueCon" + 1).style.display = "none";
    document.getElementById("valueCon" + 2).style.display = "block"
  }
}
function showMassage(A, B, _, $, C) {
  for (var D = 1; D <= B; D++) {
    document.getElementById(_ + D).style.background = A == D ? "url('/images/buttom_myDomain.gif')": "none";
    document.getElementById(_ + D).style.font = A == D ? "normal normal 600 12px/25px \u5b8b\u4f53;": "normal normal 300 12px/25px \u5b8b\u4f53;";
    document.getElementById(_ + D).style.color = A == D ? "#294c4c": "#668e8e";
    if ($ != "") document.getElementById($ + D).style.display = A == D ? "block": "none"
  }
}
function showTitle($) {
  document.getElementById($).style.display = "block"
}
function hiddenTitle(_) {
  var $ = (window.event) ? window.event.srcElement: window.event.target;
  if ($.nodeName != "DIV") return;
  document.getElementById(_).style.display = "none"
}
if (!document.getElementById) document.getElementById = function() {
  return null
};
var initselect = 0;
function setInitSelect($) {
  if ($ > 0) initselect = $ - 1
}
function deleteCookie($, A, _) {
  if (getCookie($)) document.cookie = $ + "=" + ((A) ? "; path=" + A: "") + ((_) ? "; domain=" + _: "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"
}
function setCookie(_, D, $, C, B, A) {
  var E = new Date();
  E.setTime(E.getTime() + (3600000));
  C = "/";
  document.cookie = _ + "=" + escape(D) + ("; expires=" + E.toGMTString()) + ((C) ? "; path=" + C: "") + ((B) ? "; domain=" + B: "") + ((A) ? "; secure": "")
}
function getCookie(A) {
  var _ = A + "=",
  $ = document.cookie.indexOf(_);
  if ($ == -1) return null;
  var C = document.cookie.indexOf(";", $ + _.length);
  if (C == -1) C = document.cookie.length;
  var B = document.cookie.substring($ + _.length, C);
  return unescape(B)
}
function activateMenu($) {
  var A = document.getElementById("novCon"),
  _ = A.getElementsByTagName("a"),
  B = -1,
  E = "" + $;
  if (E == "") E = self.location.toString();
  for (var G = 0; G < _.length; G++) {
    var F = _[G].getAttribute("href");
    if (E.indexOf(F) != -1) {
      B = G;
      break
    }
    _[G].className = ""
  }
  if (B > -1) {
    var D = B + 1,
    C = document.getElementById("navLink" + D);
    if (C) {
      C.firstChild.style.background = "url(/images/button_nov_BG.jpg)";
      C.firstChild.style.color = "#FFF"
    }
  } else if (initselect < _.length) {
    D = 1,
    C = document.getElementById("navLink" + D);
    if (C) {
      C.firstChild.style.background = "url(/images/button_nov_BG.jpg)";
      C.firstChild.style.color = "#FFF"
    }
  }
}
function navgpos() {
  var $ = "/index.php,/question.php,/jforum/forums/list.page,/pub/mistakes,/pub/writings,/pub/tests,/pub/courses,/pub/community,/pub/siteacts,/pub/tutors,/my/studomain,/my/tchdomain,/my/recharge",
  A = self.location.toString();
  url = A.substring(A.lastIndexOf("/") + 1);
  if (url == "") url = "index.html";
  if ($.indexOf(url) >= 0) {
    activateMenu(A);
    deleteCookie("headerKeepUrl", "/");
    setCookie("headerKeepUrl", A)
  } else {
    var _ = getCookie("headerKeepUrl");
    if (!_) _ = "index.html";
    activateMenu(_);
    url = _
  }
}
document.onkeydown = function($) {
  var $ = window.event || $,
  _ = $.keyCode || $.which;
  if (_ == 116) {
    window.event ? $.keyCode = 0 : _ = 0;
    $.preventDefault ? $.preventDefault() : $.returnValue = false
  }
};
document.onkeyup = function($) {
  var $ = window.event || $,
  _ = $.keyCode || $.which;
  if ($ && _ == 116) location.reload()
};
function popUp($) {
  if (window.showModalDialog) window.showModalDialog($ + "?temp=" + Math.random(), null, "titlebar='no';resizable='no';scroll='no';help='no';status='no';dialogHeight=320px;dialogWidth=240px;");
  else modalWin = window.open($, "", "height=320px,width=240px,toolbar=no,directories=no,titlebar=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes")
}
var stateid = 1;
function downcomplete() {
  if (this.document && this.document.readyState == "complete") {
    if (stateid == 3) {
      if (this.contentWindow.document.body.innerHTML.length != 0) alert(this.contentWindow.document.body.innerHTML);
      stateid = 1
    } else stateid++
  } else if (this.contentWindow.document.body.innerHTML.length != 0) alert(this.contentWindow.document.body.innerHTML)
}
function downAttach(_) {
  var $ = document.getElementById("download");
  if ($.onreadystatechange) $.onreadystatechange = downcomplete;
  else $.onload = downcomplete;
  $.src = _
}