function change_text(obj){
    if(obj.className == "gray_w")
    {
        obj.className = "black_w";
        obj.value = "";
    }
}

function set_value(name, value){
    var obj = document.getElementById(name);
    obj.value = value;
}

function get_value(name){
    var obj = document.getElementById(name);
    return obj.value;
}

  function change_content(){
      var con = document.getElementById("condition");
      var other = document.getElementById("other_condition");
      if(con.options[con.selectedIndex].value == "其他")
          other.disabled = false;
      else{
          other.disabled = true;
          other.className = "gray_w";
          other.value = "若為其他請輸入狀況種類";
      }
  }

function check_longTxt(obj, length){
  var arr = obj.value.split(" ");

  var str = "";
  for(var i = 0; i < arr.length; i++)
  {
      if(arr[i].length > length)
      {
          str = str + arr[i].substring(0, length) + " " + arr[i].substring(length, arr[i].length)+" ";
      }
      else
          str = str + arr[i]+" ";  
  }
  obj.value = str.substr(0, str.length-1);
}

