//選択チェック全選択or全解除
function checkAll(arg) {
	if (arg) {
		for (i=0; i<document.FM_LIST.SelectCB.length; i++) { document.FM_LIST.SelectCB[i].checked = true; }
		for (i=0; i<document.FM_LIST.SelectCBAll.length; i++) { document.FM_LIST.SelectCBAll[i].checked = true; }
	} else {
		for (i=0; i<document.FM_LIST.SelectCB.length; i++) { document.FM_LIST.SelectCB[i].checked = false; }
		for (i=0; i<document.FM_LIST.SelectCBAll.length; i++) { document.FM_LIST.SelectCBAll[i].checked = false; }
	}
}

// tab
function tabChange(tabNo) {
    var i;
    var tabCount = 2;
    
    for (i = 1; i <= tabCount; i++) {
        document.getElementById("tab" + i).className = "tab_selector";
        document.getElementById("search_ber" + i).className = "noshow";
    }
    document.getElementById("tab" + tabNo).className="tab_selector selected";
    document.getElementById("search_ber" + tabNo).className="tab";
}

// scroll
function backToTop() {
  var x1 = x2 = x3 = 0;
  var y1 = y2 = y3 = 0;
  if (document.documentElement) {
      x1 = document.documentElement.scrollLeft || 0;
      y1 = document.documentElement.scrollTop || 0;
  }
  if (document.body) {
      x2 = document.body.scrollLeft || 0;
      y2 = document.body.scrollTop || 0;
  }
  x3 = window.scrollX || 0;
  y3 = window.scrollY || 0;
  var x = Math.max(x1, Math.max(x2, x3));
  var y = Math.max(y1, Math.max(y2, y3));
  window.scrollTo(Math.floor(x / 2), Math.floor(y / 2));
  if (x > 0 || y > 0) {
      window.setTimeout("backToTop()", 25);
  }
}