// epoch 日曆
var _popup_cal = null;
function popupCal(element) {
    if (_popup_cal == null) {
        _popup_cal = new Epoch('_popup_cal','popup', element);
    }
    _popup_cal.setTarget(element);
    _popup_cal.show();
}

// 將日期的欄位設為今日
function setToday(field){
    var today = new Date();
    var year = today.getFullYear();
    var month = today.getMonth()+1;
    if (month < 10){
        month = "0"+month;
    }
    var day = today.getDate();
    if (day < 10){
        day = "0"+day;
    }
    var formatedDate = year+"."+month+"."+day;
    field.value = formatedDate;
}

function OpenCloseDiv(objectId) 
    {
      var obj = document.getElementById(objectId);
      if (obj.style.display == "none") 
      {
        obj.style.display = "block";
      } 
      else 
      {
        obj.style.display = "none";
      }
    }