function inputText(Name){
  var kugiri = ",";
  var tx = document.getElementsByName(Name);

  for (var a="", i=tx.length; i--; ){
    if (tx[i].checked){
      var a = tx[i].value.split(kugiri);
      break;
    }
  }
  switch(a[0]){
    case "1":
      document.getElementById("Q1Mon1").innerText = a[1];
      document.getElementById("Q1Thu1").innerText = a[1];
      document.getElementById("q1mon1_button").style.visibility="hidden";
      document.getElementById("q1thu1_button").style.visibility="hidden";
      break;

    case "2":
      document.getElementById("Q1Mon2").innerText = a[1];
      document.getElementById("Q1Thu2").innerText = a[1];
      document.getElementById("q1mon2_button").style.visibility="hidden";
      document.getElementById("q1thu2_button").style.visibility="hidden";
      break;

    case "3":
      document.getElementById("Q1Mon3").innerText = a[1];
      document.getElementById("Q1Thu3").innerText = a[1];
      document.getElementById("q1mon3_button").style.visibility="hidden";
      document.getElementById("q1thu3_button").style.visibility="hidden";
        break;

    case "4":
      document.getElementById("Q1Mon4").innerText = a[1];
      document.getElementById("Q1Thu4").innerText = a[1];
      document.getElementById("q1mon4_button").style.visibility="hidden";
      document.getElementById("q1thu4_button").style.visibility="hidden";
      break;

    case "5":
      document.getElementById("Q1Tue1").innerText = a[1];
      document.getElementById("Q1Fr1").innerText = a[1];
      document.getElementById("q1tue1_button").style.visibility="hidden";
      document.getElementById("q1fri1_button").style.visibility="hidden";
      break;

    case "6":
      document.getElementById("Q1Tue2").innerText = a[1];
      document.getElementById("Q1Fri2").innerText = a[1];
      document.getElementById("q1tue2_button").style.visibility="hidden";
      document.getElementById("q1fri2_button").style.visibility="hidden";
      break;

    case "7":
      document.getElementById("Q1Tue3").innerText = a[1];
      document.getElementById("Q1Fr3").innerText = a[1];
      document.getElementById("q1tue3_button").style.visibility="hidden";
      document.getElementById("q1fri3_button").style.visibility="hidden";
      break;

    case "8":
      document.getElementById("Q1Tue4").innerText = a[1];
      document.getElementById("Q1Fr4").innerText = a[1];
      document.getElementById("q1tue4_button").style.visibility="hidden";
      document.getElementById("q1fri4_button").style.visibility="hidden";
      break;

    case "9":
      document.getElementById("Q1Mon1").innerText = a[1];
      document.getElementById("Q1Mon2").innerText = a[1];
      document.getElementById("q1mon1_button").style.visibility="hidden";
      document.getElementById("q1mon2_button").style.visibility="hidden";
      break;

    case "10":
      document.getElementById("Q1Mon3").innerText = a[1];
      document.getElementById("Q1Mon4").innerText = a[1];
      document.getElementById("q1mon3_button").style.visibility="hidden";
      document.getElementById("q1mon4_button").style.visibility="hidden";
      break;

    case "11":
      document.getElementById("Q1Tue1").innerText = a[1];
      document.getElementById("Q1Tue2").innerText = a[1];
      document.getElementById("q1tue1_button").style.visibility="hidden";
      document.getElementById("q1tue2_button").style.visibility="hidden";
      break;

    case "12":
      document.getElementById("Q1Tue3").innerText = a[1];
      document.getElementById("Q1Tue4").innerText = a[1];
      document.getElementById("q1tue3_button").style.visibility="hidden";
      document.getElementById("q1tue4_button").style.visibility="hidden";
      break;

    case "13":
      document.getElementById("Q1Wed1").innerText = a[1];
      document.getElementById("Q1Wed2").innerText = a[1];
      document.getElementById("q1wed1_button").style.visibility="hidden";
      document.getElementById("q1wed2_button").style.visibility="hidden";
      break;

    case "14":
      document.getElementById("Q1Thu1").innerText = a[1];
      document.getElementById("Q1Thu2").innerText = a[1];
      document.getElementById("q1tue1_button").style.visibility="hidden";
      document.getElementById("q1tue2_button").style.visibility="hidden";
      break;

    case "15":
      document.getElementById("Q1Thu3").innerText = a[1];
      document.getElementById("Q1Thu4").innerText = a[1];
      document.getElementById("q1thu3_button").style.visibility="hidden";
      document.getElementById("q1thu4_button").style.visibility="hidden";
      break;

    case "16":
      document.getElementById("Q1Fri1").innerText = a[1];
      document.getElementById("Q1Fri2").innerText = a[1];
      document.getElementById("q1fir1_button").style.visibility="hidden";
      document.getElementById("q1fri2_button").style.visibility="hidden";
      break;

    case "17":
      document.getElementById("Q1Fri3").innerText = a[1];
      document.getElementById("Q1Fri4").innerText = a[1];
      document.getElementById("q1fri3_button").style.visibility="hidden";
      document.getElementById("q1fri4_button").style.visibility="hidden";
      break;
    }
}

function delbtn(IdValue, Id){
  var text = document.getElementById(IdValue).innerText = "未選択";
  var text2 = document.getElementById(Id).style.visibility="visible"

}
