// チェックボックス用イベントリスナー
function set_th_event () {
 $('th').click (
  function () {
   id     = this.id;
   target = 'td.'+ id +' label input:checkbox';
   check  = $(target).attr('checked');
   if ( check ) {
    $(target).attr('checked','');
   } else {
    $(target).attr('checked','checked');
   }
  }
 );
}

// 初期化処理 ==============================================
function initialize() {

 // th をクリッカブルに
 $('th').css('cursor','pointer');

 // イベントリスナー設定
 set_th_event ();

}

// for event --------------------------------------------------------------------
$( initialize );




