/*
 マイリスト数／マイリスト率の表示スクリプト
 (c)[nl424.txt]までの作者
 (c)2010,2011,2013,2016 CJ？ごろう

 (2016-04-02)
*/


/*
 グラフとマイリスト数／マイリスト率を挿入。
*/
var nl_mylistCountBar = function (mode, count_off, caption_off, denominator_mode, graph_mode, is_autopager, autopager_elements)
{
/*
 変数の宣言。

 マイリストで1ページに表示できる最大アイテム数。
 2010-08-15時点では100。
*/
 var items_per_page = 100;


/*
 変数の宣言。
 (2013-12-04)
*/
 var _lh = location.hostname;
 var _lp = location.pathname;

 var is_mylist = (_lp.indexOf('/mylist/') == 0 || _lp.indexOf('/my/mylist') == 0) ? true : false;
 var is_mylist2 = is_mylist;
 var is_thumb = ((_lh + _lp).indexOf('ext.nicovideo.jp/thumb') == 0) ? true : false;
 var is_itemTime = false;

 var mcb_mode = false, mcb_count_off = false, mcb_caption_off = false, mcb_denominator_mode = false, mcb_graph_mode = false;

 var c_str_res = 'コメント：', c_str_creat = '作成', c_str_mylist = 'マイリスト：', c_str_post = '投稿', c_str_play = '再生：';
 var c_str_mylist_n = 'マイリスト数：', c_str_mylist_p = 'マイリスト率：';
 var c_thumb_class = 'thumb_num', c_post_class = 'vinfo_posted';
 var c_mylist_class = 'vinfo_mylist', c_res_class = 'vinfo_res', c_view_class = 'vinfo_view';

 var block_start = '', block_end = '';
 var pbar_class = 'nl_mylistCountBar_Container';

 var list_p = [];
 var list_thumb_num = [], list_mylist = [], list_mylist_text = [], list_denominator = [];
 var list_percent = [], list_class = [], list_html = [];
 var count_thumb_num = 0, count_mylist = 0, count_denominator = 0;


/*
 動作設定の設定。
*/
 this.mode = (typeof(mode) == 'number') ? (mode === 1) : this.mode;
 this.count_off = (typeof(count_off) == 'number') ? (count_off === 1) : this.count_off;
 this.caption_off = (typeof(caption_off) == 'number') ? (caption_off === 1) : this.caption_off;
 this.denominator_mode = (typeof(denominator_mode) == 'number') ? (denominator_mode === 1) : this.denominator_mode;
 this.graph_mode = (typeof(graph_mode) == 'number') ? (graph_mode === 1) : this.graph_mode;

 mcb_mode = this.mode;
 mcb_count_off = this.count_off;
 mcb_caption_off = this.caption_off;
 mcb_denominator_mode = this.denominator_mode;
 mcb_graph_mode = this.graph_mode;

 if (_lh.indexOf('tw.nicovideo.jp') == 0)
 {
// 台湾
  if (is_mylist)
  {
   c_str_play = '再生：';
   c_thumb_class = 'TXT12';
  }
  else
  {
   c_str_play = '播放：';
   c_thumb_class = 'TXT10';
  }
  is_mylist = false;
  c_str_res = '評論：', c_str_creat = '<<!--作成-->>', c_str_mylist = '我的清單：', c_str_post = '投稿';
  c_str_mylist_n = '我的清單數：', c_str_mylist_p = '我的清單率：';
  c_post_class = 'video_info_posted_at';
  c_mylist_class = 'video_info_mylist', c_res_class = 'video_info_res', c_view_class = 'video_info_view';
 }
 else if (_lh.indexOf('es.nicovideo.jp') == 0)
 {
// スペイン
  if (is_mylist)
  {
   c_str_post = 'Agregar', c_str_play = 'Reproducir:';
   c_thumb_class = 'TXT12', c_post_class = 'video_info_posted_at';
  }
  else
  {
   c_str_post = 'Agregado el', c_str_play = 'Reproducciones:';
   c_thumb_class = 'TXT10', c_post_class = 'video_info_posted_at';
  }
  is_mylist = false;
  c_str_res = 'Comentarios:', c_str_creat = '<<!--作成-->>', c_str_mylist = 'Mi lista:';
  c_str_mylist_n = 'Mi lista n&uacute;mero:', c_str_mylist_p = 'Mi lista proporci&oacute;n:';
  c_mylist_class = 'video_info_mylist', c_res_class = 'video_info_res', c_view_class = 'video_info_view';
 }
 else if (_lh.indexOf('de.nicovideo.jp') == 0)
 {
// ドイツ
  if (is_mylist)
  {
   c_str_mylist = '“mylists”', c_str_play = 'Abspielen:';
   c_thumb_class = 'TXT12', c_post_class = 'video_info_posted_at';
  }
  else
  {
   c_str_mylist = 'mylists:', c_str_play = 'Wiedergabe:';
   c_thumb_class = is_mylist ? 'TXT12' : 'TXT10', c_post_class = 'video_info_posted_at';
  }
  is_mylist = false;
  c_str_res = 'Kommentare:', c_str_creat = '<<!--作成-->>', c_str_post = 'abgegeben am';
  c_str_mylist_n = 'mylists zahl:', c_str_mylist_p = 'mylists prozentsatz:';
  c_mylist_class = 'video_info_mylist', c_res_class = 'video_info_res', c_view_class = 'video_info_view';
 }


/*
 投稿日時の要素を探して変数にセット１。
 (2016-04-02)
*/
 (function (document)
 {
  var thumb_class = is_thumb ? 'TXT10' : c_thumb_class;
  var count_list, count_tmp;
  var tmp_class, tmp_node, tmp_nodeType;
  if (is_autopager)
  {
   list_p = autopager_elements.getElementsByTagName('P');
  }
  else
  {
   list_p = is_mylist ? document.getElementById('SYS_box_mylist_body').getElementsByTagName('P') : document.getElementsByTagName('P');
  }
  count_list = list_p.length;
  for (var i = 0; i < count_list; i++)
  {
   tmp_class = list_p[i].className;
   if (tmp_class)
   {
    if (tmp_class.indexOf(thumb_class) != -1)
    {
     var list_tmp = list_p[i].getElementsByTagName('STRONG');
     count_tmp = list_tmp.length;
     for (var j = 0; j < count_tmp; j++)
     {
      tmp_node = list_tmp[j].nextSibling;
      tmp_nodeType = tmp_node ? tmp_node.nodeType : tmp_node;
      if (tmp_node && tmp_nodeType == 3)
      {
       if (tmp_node.nodeValue.indexOf(c_str_post) != -1)
       {
        list_thumb_num[count_thumb_num++] = list_p[i];
        break;
       }
       else if (tmp_node.nodeValue.indexOf(c_str_creat) != -1 && is_mylist)
       {
        list_thumb_num[count_thumb_num++] = list_p[i];
        break;
       }
      }
     }
     list_tmp = null;
    }
    else if (tmp_class.indexOf('itemTime') != -1)
    {
     var list_tmp2 = list_p[i].parentNode.getElementsByTagName('li');
     var tmp_class2 = (list_tmp2.length > 0) ? list_tmp2[0].className : false;
     if (tmp_class2 && tmp_class2.indexOf('count') != -1)
     {
      var list_tmp = list_p[i].getElementsByTagName('span');
      count_tmp = list_tmp.length;
      for (var j = 0; j < count_tmp; j++)
      {
       tmp_node = list_tmp[j].firstChild;
       tmp_nodeType = tmp_node ? tmp_node.nodeType : tmp_node;
       if (tmp_node && tmp_nodeType == 3)
       {
        if (tmp_node.nodeValue.indexOf(c_str_post) != -1)
        {
         list_thumb_num[count_thumb_num++] = list_p[i];
         is_itemTime = true;
         break;
        }
       }
      }
      list_tmp = null;
     }
     list_tmp2 = null;
     tmp_class2 = null;
    }
    else if (tmp_class.indexOf('itemTitle') != -1) // 動画トップページの投稿日の要素がない動画対策。
    {
     var list_tmp = list_p[i].parentNode.parentNode.getElementsByTagName('div');
     tmp_class = (list_tmp.length > 0) ? list_tmp[0].className : false;
     if (tmp_class && tmp_class.indexOf('itemRank') != -1)
     {
      list_thumb_num[count_thumb_num++] = list_p[i].parentNode.parentNode.childNodes[3];
     }
     list_tmp = null;
    }
   }
  }
  thumb_class = null;
  count_list = null;
  count_tmp = null;
  tmp_class = null;
  tmp_node = null;
  tmp_nodeType = null;
 })(document);


/*
 投稿日時の要素を探して変数にセット２。
 ここまでで投稿日時が見つからなければ return 1 。

 分子（マイリスト数）と分母（再生数orコメント数）を探して変数にセット。
 分子と分母の個数が違っていれば return 2 。

 投稿日時の要素の個数が分子の個数より少なければ return 3 。
*/
// マイリストのページを探す処理。
 var date_mylist = function ()
 {
  var count_list = my.currentItems.length;
  var page;
  page = (location.hash.indexOf('#') == 0) ? location.hash.replace(/.+?page=(\d+?).*$/g, '$1') - 0 || 1 : 1;
  var min = (page - 1) * items_per_page - 1;
  var max = page * items_per_page - 1;
  var tmp_mylist;
  var denominator_video = '', denominator_seiga = '';
  if (mcb_denominator_mode)
  {
   denominator_video = 'num_res';
   denominator_seiga = 'comment_count';
  }
  else
  {
   denominator_video = 'view_counter';
   denominator_seiga = 'view_count';
  }
  for (var i = min + 1; i < count_list; i++)
  {
   if (i > min + count_thumb_num || i > max)
   {
    break;
   }
   if (my.currentItems[i].item_data)
   {
    if (my.currentItems[i].item_data.mylist_counter)
    {
     tmp_mylist = my.currentItems[i].item_data.mylist_counter + '';
     list_mylist[count_mylist] = tmp_mylist - 0;
     list_mylist_text[count_mylist++] = tmp_mylist.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
     list_denominator[count_denominator++] = my.currentItems[i].item_data[denominator_video] - 0;
    }
    else if (my.currentItems[i].item_data.mylist_count)
    {
     tmp_mylist = my.currentItems[i].item_data.mylist_count + '';
     list_mylist[count_mylist] = tmp_mylist - 0;
     list_mylist_text[count_mylist++] = tmp_mylist.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
     list_denominator[count_denominator++] = my.currentItems[i].item_data[denominator_seiga] - 0;
    }
   }
  }
  var count_list = null;
  var page = null;
  var min = null;
  var max = null;
  var denominator_key = null;
  var tmp_mylist = null;
 };

// 動画情報のページを探す処理。
// 日本以外のマイリストのページを探す処理。
 var data_thumb = function (document)
 {
  var list_nodes = is_autopager ? autopager_elements.getElementsByTagName('STRONG') : document.getElementsByTagName('STRONG');
  var denominator_text = (mcb_denominator_mode) ? c_str_res : c_str_play;
  var count_list = list_nodes.length, count_tmp;
  var tmp_node, tmp_nodeType, tmp_nodeValue, tmp_number;
  for (var i = 0; i < count_list; i++)
  {
   tmp_node = list_nodes[i].previousSibling;
   tmp_nodeType = tmp_node ? tmp_node.nodeType : tmp_node;
   if (tmp_nodeType && tmp_nodeType == 3)
   {
    if (tmp_node.nodeValue.indexOf(c_str_post) != -1)
    {
     list_thumb_num[count_thumb_num++] = list_nodes[i].parentNode;
    }
    else if (tmp_node.nodeValue.indexOf(c_str_mylist) != -1)
    {
     var list_tmp = list_nodes[i].childNodes;
     count_tmp = list_tmp.length;
     for (var j = 0; j < count_tmp; j++)
     {
      tmp_node = list_tmp[j];
      tmp_nodeType = tmp_node ? tmp_node.nodeType : tmp_node;
      if (tmp_nodeType && tmp_nodeType == 3)
      {
       tmp_nodeValue = tmp_node.nodeValue;
       tmp_number = tmp_nodeValue.replace(/,/g, '') - 0;
       if (tmp_number != NaN)
       {
        list_mylist[count_mylist] = tmp_number;
        list_mylist_text[count_mylist++] = tmp_nodeValue;
        break;
       }
      }
     }
     list_tmp = null;
    }
    else if (tmp_node.nodeValue.indexOf(denominator_text) != -1)
    {
     var list_tmp = list_nodes[i].childNodes;
     count_tmp = list_tmp.length;
     for (var j = 0; j < count_tmp; j++)
     {
      tmp_node = list_tmp[j];
      tmp_nodeType = tmp_node ? tmp_node.nodeType : tmp_node;
      if (tmp_nodeType && tmp_nodeType == 3)
      {
       tmp_number = tmp_node.nodeValue.replace(/,/g, '') - 0;
       if (tmp_number != NaN)
       {
        list_denominator[count_denominator++] = tmp_number;
        break;
       }
      }
     }
     list_tmp = null;
    }
   }
  }
  list_nodes = null;
  denominator_text = null;
  count_list = null;
  count_tmp = null;
  tmp_node = null;
  tmp_nodeType = null;
  tmp_nodeValue = null;
  tmp_number = null;;
 };

// 動画トップページ（日本）を探す処理。
// (2013-12-04)
 var data_top = function (document)
 {
  var list_nodes = is_autopager ? autopager_elements.getElementsByTagName('li') : document.getElementsByTagName('li');
  var denominator_class = (mcb_denominator_mode) ? 'comment' : 'view';
  var count_list = list_nodes.length;
  var tmp_class, tmp_node, tmp_nodeType, tmp_nodeValue, tmp_number;
  var tmp_log = '';
  for (var i = 0; i < count_list; i++)
  {
   tmp_class = list_nodes[i].className;
   if (tmp_class)
   {
    if (tmp_class.indexOf('count') != -1)
    {
     tmp_node = list_nodes[i].lastChild.firstChild;
     tmp_nodeType = tmp_node ? tmp_node.nodeType : tmp_node;
     if (tmp_nodeType && tmp_nodeType == 1)
     {
      tmp_node = list_nodes[i].lastChild.firstChild.firstChild;
      tmp_nodeType = tmp_node ? tmp_node.nodeType : tmp_node;
     }
     if (tmp_nodeType && tmp_nodeType == 3)
     {
      tmp_nodeValue = tmp_node.nodeValue;
      tmp_number = tmp_nodeValue.replace(/,/g, '') - 0;
      if (isFinite(tmp_number))
      {
       if (tmp_class.indexOf('mylist') != -1)
       {
        list_mylist[count_mylist] = tmp_number;
        list_mylist_text[count_mylist++] = tmp_nodeValue;
       }
       else if (tmp_class.indexOf(denominator_class) != -1)
       {
        list_denominator[count_denominator++] = tmp_number;
       }
      }
     }
    }
   }
  }
  list_nodes = null;
  denominator_class = null;
  count_list = null;
  tmp_node = null;
  tmp_nodeType = null;
  tmp_nodeValue = null;
  tmp_number = null;
 };

// 「マイリスト、動画情報」以外のページを探す処理。
 var data_other = function (document)
 {
  var list_nodes = is_autopager ? autopager_elements.getElementsByTagName('STRONG') : document.getElementsByTagName('STRONG');
  var denominator_class = (mcb_denominator_mode) ? c_res_class : c_view_class;
  var count_list = list_nodes.length, count_tmp;
  var tmp_class, tmp_node, tmp_nodeType, tmp_nodeValue, tmp_number;
  for (var i = 0; i < count_list; i++)
  {
   tmp_class = list_nodes[i].className;
   if (tmp_class)
   {
    if (tmp_class.indexOf(c_post_class) != -1)
    {
     list_thumb_num[count_thumb_num++] = list_nodes[i].parentNode;
    }
    else if (tmp_class.indexOf(c_mylist_class) != -1)
    {
     var list_tmp = list_nodes[i].childNodes;
     count_tmp = list_tmp.length;
     for (var j = 0; j < count_tmp; j++)
     {
      tmp_node = list_tmp[j];
      tmp_nodeType = tmp_node ? tmp_node.nodeType : tmp_node;
      if (tmp_nodeType && tmp_nodeType == 3)
      {
       tmp_nodeValue = tmp_node.nodeValue;
       tmp_number = tmp_nodeValue.replace(/,/g, '') - 0;
       if (tmp_number != NaN)
       {
        list_mylist[count_mylist] = tmp_number;
        list_mylist_text[count_mylist++] = tmp_nodeValue;
        break;
       }
      }
     }
     list_tmp = null;
    }
    else if (tmp_class.indexOf(denominator_class) != -1)
    {
     var list_tmp = list_nodes[i].childNodes;
     count_tmp = list_tmp.length;
     for (var j = 0; j < count_tmp; j++)
     {
      tmp_node = list_tmp[j];
      tmp_nodeType = tmp_node ? tmp_node.nodeType : tmp_node;
      if (tmp_nodeType && tmp_nodeType == 3)
      {
       tmp_number = tmp_node.nodeValue.replace(/,/g, '') - 0;
       if (tmp_number != NaN)
       {
        list_denominator[count_denominator++] = tmp_number;
        break;
       }
      }
     }
     list_tmp = null;
    }
   }
  }
  list_nodes = null;
  denominator_class = null;
  count_list = null;
  count_tmp = null;
  tmp_class = null;
  tmp_node = null;
  tmp_nodeType = null;
  tmp_nodeValue = null;
  tmp_number = null;
 };

 if (is_mylist2)
 {
  if (is_mylist)
  {
// マイリストのページを探す処理を実行。
   date_mylist();
  }
  else
  {
// 日本以外のマイリストのページを探す処理を実行。
   data_thumb(document);
  }
 }
 else if (is_thumb)
 {
// 動画情報のページを探す処理を実行。
  data_thumb(document);
 }
 else if (is_itemTime)
 {
// 動画トップページを探す処理を実行。
  data_top(document);
 }
 else
 {
// 「マイリスト、動画情報」以外のページを探す処理を実行。
  data_other(document);
 }

// 探した結果をチェック
 date_mylist = null;
 data_thumb = null;
 data_top = null;
 data_other = null;
 is_autopager = false;
 if (count_thumb_num == 0) { return 1; }
 if (count_mylist != count_denominator) { return 2; }
 if (count_thumb_num < count_mylist) { return 3; }


/*
 マイリスト率とクラスを求めて変数にセット。
*/
 (function ()
 {
  var count_list = list_denominator.length;
  if (mcb_graph_mode)
  {
   var percent;
   for (var i = 0; i < count_list; i++)
   {
    percent = (list_denominator[i] > 0) ? list_mylist[i] / list_denominator[i] : -1;
    list_percent[i] = ((percent > -1) ? Math.round(percent * 1000) / 10 : '---.-') + '%';
    if (percent < 0.0125)
    {
     list_class[i] = '0';
    }
    else if (percent < 0.025)
    {
     list_class[i] = '1';
    }
    else if (percent < 0.0375)
    {
     list_class[i] = '2';
    }
    else if (percent < 0.05)
    {
     list_class[i] = '3';
    }
    else if (percent < 0.0625)
    {
     list_class[i] = '4';
    }
    else if (percent < 0.075)
    {
     list_class[i] = '5';
    }
    else if (percent < 0.0875)
    {
     list_class[i] = '6';
     }
    else if (percent < 0.1)
    {
     list_class[i] = '7';
    }
    else
    {
     list_class[i] = '8';
    }
   }
  }
  else
  {
   for (var i = 0; i < count_list; i++)
   {
    list_percent[i] = ((list_denominator[i] > 0) ? Math.round(list_mylist[i] * 1000 / list_denominator[i]) / 10 : '---.-') + '%';
    if (list_mylist[i] < 10)
    {
     list_class[i] = '0';
    }
    else if (list_mylist[i] < 50)
    {
     list_class[i] = '1';
    }
    else if (list_mylist[i] < 100)
    {
     list_class[i] = '2';
    }
    else if (list_mylist[i] < 500)
    {
     list_class[i] = '3';
    }
    else if (list_mylist[i] < 1000)
    {
     list_class[i] = '4';
    }
    else if (list_mylist[i] < 5000)
    {
     list_class[i] = '5';
    }
    else if (list_mylist[i] < 10000)
    {
     list_class[i] = '6';
     }
    else if (list_mylist[i] < 20000)
    {
     list_class[i] = '7';
    }
    else
    {
     list_class[i] = '8';
    }
   }
  }
  count_list = null;
 })();


/*
 キャプションの準備。
*/
 if (!mcb_caption_off && !is_itemTime)
 {
  block_end = '</div>&nbsp;';
  pbar_class = 'nl_mylistCountBar_ContainerBox';
  if (mcb_count_off)
  {
   block_start = '<p class="nl_mylistCountBar_Caption">' + c_str_mylist_p + '</p><div class="nl_mylistCountBar_InContainer">'
  }
  else
  {
   block_start = '<p class="nl_mylistCountBar_Caption">' + c_str_mylist_n + '</p><div class="nl_mylistCountBar_InContainer">'
  }
 }


/*
 挿入する HTML を準備。
*/
 (function (document)
 {
  var count_list = list_percent.length;
  var tmp_html = '';
  var tmp_title = '';
  if (mcb_caption_off || is_itemTime)
  {
   if (mcb_count_off)
   {
    tmp_title = c_str_mylist_p.replace(/:/, '').replace(/：/, '');
   }
   else
   {
    tmp_title = c_str_mylist_n.replace(/:/, '').replace(/：/, '');
   }
  }
  if (mcb_count_off)
  {
   for (var i = 0; i < count_list; i++)
   {
    tmp_html = block_start;
    tmp_html += '<div class="nl_mylistCountBar_Percent nl_mylistCountBar_Graph';
    tmp_html += list_class[i];
    tmp_html += '"></div><p class="nl_mylistCountBar_Count nl_mylistCountBar_Number';
    tmp_html += list_class[i];
    tmp_html += '">';
    tmp_html += list_percent[i];
    tmp_html += '</p> ';
    tmp_html += block_end;
    list_html[i] = document.createElement('DIV');
    list_html[i].className = pbar_class;
    list_html[i].innerHTML = tmp_html;
    list_html[i].title = tmp_title;
   }
  }
  else
  {
   for (var i = 0; i < count_list; i++)
   {
    tmp_html = block_start;
    tmp_html += '<div class="nl_mylistCountBar_Percent nl_mylistCountBar_Graph';
    tmp_html += list_class[i];
    tmp_html += '"></div><p class="nl_mylistCountBar_Count nl_mylistCountBar_Number';
    tmp_html += list_class[i];
    tmp_html += '">';
    tmp_html += list_mylist_text[i];
    tmp_html += ' (';
    tmp_html += list_percent[i];
    tmp_html += ')</p> ';
    tmp_html += block_end;
    list_html[i] = document.createElement('DIV');
    list_html[i].className = pbar_class;
    list_html[i].innerHTML = tmp_html;
    list_html[i].title = tmp_title;
   }
  }
  count_list = null;
  tmp_html = null;
 })(document);


/*
 マイリスト数／マイリスト率の挿入。
*/
 (function ()
 {
  var count_list = list_html.length;
  var tmp_node, tmp_nodeType;
  if (mcb_mode) {
   for (var i = 0; i < count_list; i++)
   {
    tmp_node = list_thumb_num[i].nextSibling;
    tmp_nodeType = tmp_node ? tmp_node.nodeType : tmp_node;
    if (tmp_nodeType && (tmp_nodeType == 1 || tmp_nodeType == 3))
    {
     list_thumb_num[i].parentNode.insertBefore(list_html[i], tmp_node);
    }
   }
  }
  else
  {
   for (var i = 0; i < count_list; i++)
   {
    tmp_nodeType = list_thumb_num[i].nodeType;
    if (tmp_nodeType && tmp_nodeType == 1)
    {
     list_thumb_num[i].parentNode.insertBefore(list_html[i], list_thumb_num[i]);
    }
   }
  }
  count_list = null;
  tmp_node = null;
  tmp_nodeType = null;
 })();


/*
 処理が最後まで完了したので変数の後始末をしてから return 0 。
*/
 items_per_page = null;

 _lp = null;

 is_mylist = null;
 is_thumb = null;

 mcb_mode = null;
 mcb_count_off = null;
 mcb_caption_off = null;
 mcb_denominator_mode = null;

 block_start = null;
 block_end = null;
 pbar_class = null;

 list_p = null;
 list_thumb_num = null;
 list_mylist = null;
 list_mylist_text = null;
 list_denominator = null;
 list_percent = null;
 list_class = null;
 list_html = null;
 count_thumb_num = null;
 count_mylist = null;
 count_denominator = null;

 return 0;
};


/*
 ＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
*/


/*
 autopager関連処理。
*/
var nl_mylistCountBar_autopager = function (type_select)
{
 var userAgent = window.navigator.userAgent.toLowerCase();

 switch (type_select - 0)
 {
/*
 AutoPagerize（AutoPagerize_DOMNodeInserted）に連動する。
*/
  case 1:
   if (typeof(window.addEventListener) == 'function')
   {
    document.body.addEventListener('AutoPagerize_DOMNodeInserted', function (evt)
    {
     nl_mylistCountBar(false, false, false, false, true, evt.target);
    }, false);
   }
  break;

/*
 Internet Explorerならautopager_modに連動する。
 それ以外は、AutoPagerize（AutoPagerize_DOMNodeInserted）に連動する。
*/
  case 2:
   if (userAgent.indexOf('msie') != -1 && window.autopager_mod)
   {
    autopager_mod.register(function(div) {
     nl_mylistCountBar(false, false, false, false, true, div);
    });
   }
   else if (typeof(window.addEventListener) == 'function')
   {
    document.body.addEventListener('AutoPagerize_DOMNodeInserted', function (evt)
    {
     nl_mylistCountBar(false, false, false, false, false, true, evt.target);
    }, false);
   }
  break;

/*
 上記以外の時はautopager_modに連動する。
*/
  default:
  if (window.autopager_mod)
  {
   autopager_mod.register(function(div) {
    nl_mylistCountBar(false, false, false, false, false, true, div);
   });
  }
  break;
 }
 userAgent = null;
};


/*
 ＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
*/


/*
 new_list関連処理。
 （新しくコメントされた動画がxx件あります。）
 (2013-12-05)
*/
var nl_mylistCountBar_new_list = function (view, res, mylist)
{
 var dmy_html = document.createElement('pre');
 var dmy_date1 = document.createElement('p');
 var dmy_date2 = document.createElement('span');
 var dmy_date3 = document.createTextNode('投稿');
 var dmy_view1 = document.createElement('li');
 var dmy_view2 = document.createTextNode('再生');
 var dmy_view3 = document.createElement('span');
 var dmy_view4 = document.createTextNode(view);
 var dmy_res1 = document.createElement('li');
 var dmy_res2 = document.createTextNode('コメ');
 var dmy_res3 = document.createElement('span');
 var dmy_res4 = document.createTextNode(res);
 var dmy_mylist1 = document.createElement('li');
 var dmy_mylist2 = document.createTextNode('マイ');
 var dmy_mylist3 = document.createElement('span');
 var dmy_mylist4 = document.createElement('a');
 var dmy_mylist5 = document.createTextNode(mylist);
 var return_html = '';

 dmy_date1.className = 'itemTime';
 dmy_view1.className = 'count view';
 dmy_res1.className = 'count comment';
 dmy_mylist1.className = 'count mylist';

 dmy_date2.appendChild(dmy_date3);
 dmy_date1.appendChild(dmy_date2);
 dmy_view3.appendChild(dmy_view4);
 dmy_view1.appendChild(dmy_view2);
 dmy_view1.appendChild(dmy_view3);
 dmy_res3.appendChild(dmy_res4);
 dmy_res1.appendChild(dmy_res2);
 dmy_res1.appendChild(dmy_res3);
 dmy_mylist4.appendChild(dmy_mylist5);
 dmy_mylist3.appendChild(dmy_mylist4);
 dmy_mylist1.appendChild(dmy_mylist2);
 dmy_mylist1.appendChild(dmy_mylist3);
 dmy_html.appendChild(dmy_date1);
 dmy_html.appendChild(dmy_view1);
 dmy_html.appendChild(dmy_res1);
 dmy_html.appendChild(dmy_mylist1);

// var nl_mylistCountBar_rc =
 nl_mylistCountBar(false, false, false, false, false, true, dmy_html);
// alert('nl_mylistCountBar() のリターンコード: ' + nl_mylistCountBar_rc);

 dmy_date2.removeChild(dmy_date3);
 dmy_date1.removeChild(dmy_date2);
 dmy_view3.removeChild(dmy_view4);
 dmy_view1.removeChild(dmy_view2);
 dmy_view1.removeChild(dmy_view3);
 dmy_res3.removeChild(dmy_res4);
 dmy_res1.removeChild(dmy_res2);
 dmy_res1.removeChild(dmy_res3);
 dmy_mylist4.removeChild(dmy_mylist5);
 dmy_mylist3.removeChild(dmy_mylist4);
 dmy_mylist1.removeChild(dmy_mylist2);
 dmy_mylist1.removeChild(dmy_mylist3);
 dmy_html.removeChild(dmy_date1);
 dmy_html.removeChild(dmy_view1);
 dmy_html.removeChild(dmy_res1);
 dmy_html.removeChild(dmy_mylist1);

 return_html = dmy_html.innerHTML;

 dmy_html = null;
 dmy_date1 = null;
 dmy_date2 = null;
 dmy_date3 = null;
 dmy_view1 = null;
 dmy_view2 = null;
 dmy_view3 = null;
 dmy_view4 = null;
 dmy_res1 = null;
 dmy_res2 = null;
 dmy_res3 = null;
 dmy_res4 = null;
 dmy_mylist1 = null;
 dmy_mylist2 = null;
 dmy_mylist3 = null;
 dmy_mylist4 = null;
 dmy_mylist5 = null;

 return return_html;
};
