function setToday() {
  var id = 'calendardata';   // カレンダーのID
  var top = '<span class="today"><img src="http://www.rinonko.net/blog/emoji/today.gif" width="12" height="11" border="0" align="absmiddle" alt="today" title="today"><font color="#" style="display:none;">';  // 今日を囲むタグ（前）
  var end = '</font></span>';  // 今日を囲むタグ（後）
  var now = new Date();
  var tmp, list;
  var calMonth, calYear, calDay;

  var obj = document.getElementById( id );
  if ( !obj ) return;

  // 月判断
  list = obj.getElementsByTagName( 'a' );
  for( var i = 0; i < list.length; i++ ) {
    tmp = list[i].innerHTML;
    if ( tmp == '&lt;&lt;' ) {
      tmp = list[i].href;
      if ( tmp.match(/month=(\d\d\d\d)(\d\d)/) ) {
        calMonth = (RegExp.$2-0)+1;
        calYear = RegExp.$1;
        if ( calMonth > 12 ) {
          calMonth = 1;
          calYear++;
        }
        break;
      }
    }
  }
  if ( now.getFullYear() != calYear || now.getMonth()+1 != calMonth ) return;

  tmp = obj.innerHTML;
  var day = now.getDate().toString();
  list = tmp.split( day );
  for ( i = 0; i < list.length - 1; i++ ) {
    var flg = false;
    if ( calMonth == day && 
        (list[i+1].charAt(5) == '-' || list[i+1].charAt(7) == '-') ) {
      // ↑縦タイプ例外対応
    } else if ( list[i].length != 0 && list[i+1].length != 0 ) {
      var tmp2 = list[i+1].charAt(0);
      var tmp3 = list[i].charAt( list[i].length-1 );
      if ( ( '>\r\n '.indexOf( tmp3 ) != -1 ) &&
           ( '<\r\n '.indexOf( tmp2 ) != -1 ) ) {
        flg = true;
      }
    }
    if ( flg ) {
      list[i] += top + day + end;
    } else {
      list[i] += day;
    }
  }
  obj.innerHTML = list.join('');
}
setToday();