document.onmouseover = TabOver;
document.onmouseout  = TabOut;
document.onmousedown = TabDown;
document.onmouseup   = TabUp;

var eOld = null;

function TabOver() {
 var eSrc = window.event.srcElement;
  if (eSrc.className == "tab-button") {
    eSrc.className = "tab-button2";
  }
  if (eSrc.className == "tab-button4") {
    eSrc.className = "tab-button3";
  }
}
function TabOut() {
 var eSrc = window.event.srcElement;
  if (eSrc.className == "tab-button2") {
    eSrc.className = "tab-button";
  }
  if (eSrc.className == "tab-button3") {
    eSrc.className = "tab-button4";
  }
}
function TabDown() {
 var eSrc = window.event.srcElement;
//为了不出现脚本冲突，此处是mouseover
  if (eSrc.className == "tab-button") {
    eSrc.className = "tab-button2";
  }
  if (eSrc.className == "tab-button4") {
    eSrc.className = "tab-button3";
  }

//结束
  if (eSrc.className == "tab-button2") {
    eSrc.className = "tab-button3";
  }
}
function TabUp() {
 var eSrc = window.event.srcElement;
  if (eSrc.className == "tab-button3") {
    if (eOld != null) {
      eOld.className = "tab-button";
      var eTxt2 = eval("txt" + eOld.id)
      eTxt2.style.display = "none";
    }
    eOld = eSrc;
    var eTxt = eval("txt" + eSrc.id)
    eSrc.className = "tab-button3";
    eTxt.style.display = "";
  }
}
function setActiveTab(eSrc) {
  eOld = eSrc;
  eOld.className = "tab-button4"
  var eTxt = eval("txt" + eOld.id)
  eTxt.style.display = "";
}