       pr_num = 6;
song_info_num = 6;
       en_num = 72;
nickname_num  = 1;
nickname_fid  = 5;
comment_max_length =50;
commentf_max_length =250;
entry_chk ="";
chg_chk ="";
jckt_state ="";
y_jkt_msg = "<br>　各行をクリックすると、<br>　ジャケット写真が固定され、<br>　ジャケット写真をクリックすると、<br>　Amazon に飛びます。";
n_jkt_msg = "<br>　このアルバムは、現在 Amazon で<br>　入手不可のようです。<br>　あるいは、<br>　現在リンク情報を取得中です。";
fix_jkt_msg = "　ジャケット写真をクリックすると、<br>　Amazon に飛びます。<br><br>　選択行をもう一度クリックするか、<br>　別の行をクリックすることにより、<br>　行選択は解除されます。";
n_fix_jkt_msg ="　現在 Amazon で入手不可のようです。<br>　あるいは、現在リンク情報を取得中です。<br><br>　選択行をもう一度クリックするか、<br>　別の行をクリックすることにより、<br>　行選択は解除されます。";

//-検索-----------------------------------------------------------------------------------------------------

function srh_focus(){

 document.list_srh.pr0.focus();

}


//Login------------------------------------------------------------------------------------------------------

function pass_chk(){
   if(document.list_srh.e_mail.value != ""){
      mail = document.list_srh.e_mail.value;
      if(mail != 'admin'){
      if(!mail.match(/^[a-zA-Z0-9][a-zA-Z0-9_\.-]+@[a-zA-Z0-9][a-zA-Z0-9_\.-]+\.[a-zA-Z]+$/)){
          alert("『メールアドレス』 を確認してください。");
         document.list_srh.e_mail.value = "";
      }
      }
   }
   if(document.list_srh.password.value != ""){
      pass = document.list_srh.password.value;
      if(!pass.match(/[0-9a-zA-z]/)){
         alert("『パスワード』を５文字以上１０文字以内の半角数字で入力してください。");
         document.list_srh.password.value = "";
      }else if(5>document.list_srh.password.value.length && document.list_srh.password.value.length >10) {
         alert("『パスワード』を５文字以上１０文字以内の半角数字で入力してください。");
         document.list_srh.password.value = "";
      }else{
         alert("『パスワード』 を入力してください。");
      }
   }
}

function login_wopen(){
   make_now("l_in");
   if((document.list_srh.e_mail.value !="") && (document.list_srh.password.value !="")){
   for(i=en_num,j=0; i<(en_num+song_info_num); i++,j++){
      if(document.getElementById("last").getElementsByTagName('p')[i].innerHTML == "-"){
         document.list_srh["pr"+j].value ="";
      }else{
         document.list_srh["pr"+j].value = document.getElementById("last").getElementsByTagName('p')[i].innerHTML;
      }
   }
   for(i=0; i<en_num; i++){
      if(document.getElementById("last").getElementsByTagName('p')[i].innerHTML == "-"){
         document.list_srh["ev"+i].value = "";
      }else{
         document.list_srh["ev"+i].value = document.getElementById("last").getElementsByTagName('p')[i].innerHTML;
      }
   }
    v_page = document.list_srh.page.value;
    if(v_page == 2){
      document.list_srh.page.value = v_page -2;
    }else{
      document.list_srh.page.value = v_page -1;
    }
      document.list_srh.submit();
   }else{
      alert("『e_mail』と『password』を入力してください。 ");
   }
}


function data_entry_wopen(){
      window.open('./entry.php', '_blank', 'top=100,left=300,width=536,height=680,scrollbars=yes');
      return false;
}


function user_wopen(){
   window.open('./login/user_entry.php', '_blank', 'top=150,left=300,width=550,height=550,scrollbars=yes');
   return false;
}


function help_wopen(){
   window.open('./help.html', '_blank', 'top=150,left=300,width=500,height=650,scrollbars=yes');
   return false;
}


function news_wopen(){
   window.open('./news.html', '_blank', 'top=150,left=300,width=500,height=650,scrollbars=yes');
   return false;
}


function contact_wopen(){
   window.open('./contact.html', '_blank', 'top=150,left=300,width=500,height=650,scrollbars=no');
   return false;
}

function chg_open(cid){
   window.open('./chg_db.php?id='+cid, '_blank', 'top=140,left=300,width=536,height=650,scrollbars=yes');
   return false;
}

function cmmnt_open(cid){
   window.open('./comment.php?cid='+cid, '_blank', 'top=200,left=150,width=960,height=700,scrollbars=yes');
   return false;
}

function login_out_wopen(){
   make_now("l_out");
   document.list_srh.logout.value = "out";
   if(document.list_srh.logout.value =="out"){
   for(i=en_num,j=0; i<(en_num+song_info_num); i++,j++){
      if(document.getElementById("last").getElementsByTagName('p')[i].innerHTML == "-"){
         document.list_srh["pr"+j].value ="";
      }else{
         document.list_srh["pr"+j].value = document.getElementById("last").getElementsByTagName('p')[i].innerHTML;
      }
   }
   for(i=0; i<en_num; i++){
      if(document.getElementById("last").getElementsByTagName('p')[i].innerHTML == "-"){
         document.list_srh["ev"+i].value = "";
      }else{
         document.list_srh["ev"+i].value = document.getElementById("last").getElementsByTagName('p')[i].innerHTML;
      }
   }
    v_page = document.list_srh.page.value;
    if(v_page == 2){
      document.list_srh.page.value = v_page -2;
    }else{
      document.list_srh.page.value = v_page -1;
    }
      document.list_srh.submit();
   }
}


function srh_pr0_check(){
   if(document.list_srh.pr0.value != ""){
      pr0 = document.list_srh.pr0.value;
      if(pr0.match(/[Ａ-Ｚａ-ｚ０-９ｱ-ﾝ　]/)){
         alert("・英数字：半角\n・カタカナ：全角\n・空白：半角\nを入力してください。");
         document.list_srh.pr0.value ="";
      }
   }
}


function srh_pr1_check(){
   if(document.list_srh.pr1.value != ""){
      pr1 = document.list_srh.pr1.value;
      if(pr1.match(/[Ａ-Ｚａ-ｚ０-９ｱ-ﾝ　]/)){
         alert("・英数字：半角\n・カタカナ：全角\n・空白：半角\nを入力してください。");
         document.list_srh.pr1.value ="";
      }
   }
}


function srh_pr4_check(){
   if(document.list_srh.pr4.value !=""){
      pr4 =  document.list_srh.pr4.value;
      if(!pr4.match(/^[1-2][0-9]*$/)){
         alert("『リリース年』　を半角数字で入力してください。");
         document.list_srh.pr4.value = "";
      }
   }
}


function srh_ev_check(){
   for(i=0; i<en_num; i++){
      if(document.list_srh["ev"+i].value !=""){
         ev= document.list_srh["ev"+i].value;
         if(!ev.match(/^[0-5][+-]?$/)){
            alert("『0〜5』 の範囲で半角数字を入力してください。\n数字に『+』を付け足すと「〜以上」\n『-』なら「〜以下」という意味になります。");
            document.list_srh["ev"+i].value = "";
         }
      }
   }
}

function page_btn(n){
  make_now("page");
  for(i=en_num,j=0; i<(en_num+pr_num); i++,j++){
    if(document.getElementById("last").getElementsByTagName('p')[i].innerHTML == "-"){
      document.list_srh["pr"+j].value ="";
    }else{
      document.list_srh["pr"+j].value = document.getElementById("last").getElementsByTagName('p')[i].innerHTML;
    }
  }
  for(i=0; i<en_num; i++){
    if(document.getElementById("last").getElementsByTagName('p')[i].innerHTML == "-"){
      document.list_srh["ev"+i].value = "";
    }else{
      document.list_srh["ev"+i].value = document.getElementById("last").getElementsByTagName('p')[i].innerHTML;
    }
  }
  switch(n){
    case "nxt":
      document.list_srh.submit();
      break;
    case "rtrn":
      if(document.list_srh.page.value >1){
        v_page = document.list_srh.page.value;
        document.list_srh.page.value = v_page -2;
        document.list_srh.submit();
      }
      break;
    default:
      break;
  }
}

function next_btn(){
   document.list_srh.submit();
}

function return_btn(){
   if(document.list_srh.page.value >1){
      page_v = document.list_srh.page.value;
      document.list_srh.page.value = page_v -2;
      document.list_srh.submit();
   }
}

function srh_list_search(){
   if(document.list_srh.page.value !=""){
      document.list_srh.page.value ="";
   }
  make_now("srch");
  document.list_srh.submit();
  now_n_ev = "";
}

//全クリア
 
function srh_all_clear(){
   for(i=0; i<song_info_num; i++){
      document.list_srh["pr"+i].value ="";
   }
   for(i=0; i<en_num; i++){
      document.list_srh["ev"+i].value ="";
   }
      document.list_srh.pr0.focus();
}


//評価値クリア
function srh_ev_clear(){
   for(i=0; i<en_num; i++){
      document.list_srh["ev"+i].value ="";
      document.list_srh.pr0.focus();
   }
}

//曲情報クリア
function srh_pr_clear(){
   for(i=0; i<song_info_num; i++){
      document.list_srh["pr"+i].value ="";
      document.list_srh.pr0.focus();
   }
}

function notice(){
   ntc = document.getElementById('notice').innerHTML;
   document.getElementById('main_notice').innerHTML = ntc;
//alert(document.getElementById('notice').inner);
}

amz_jkt_msg ="";
function notice_div_in(){
  if(document.getElementById("main_notice").innerHTML ==""){
     document.getElementById("main_notice").innerHTML = document.getElementById("notice").innerHTML;
     document.getElementById("notice").style.color ="";
  }
   document.getElementById("notice").style.backgroundColor ="";
   document.getElementById("notice").innerHTML = document.getElementById("main_notice").innerHTML;
  if(document.getElementById("b_jkt_msg").innerHTML ==""){
     document.getElementById("b_jkt_msg").innerHTML = document.getElementById("jkt_msg").innerHTML;
   }
   if(amz_jkt_msg == ""){
     document.getElementById("jkt_msg").innerHTML = document.getElementById("b_jkt_msg").innerHTML;
   }
}


n_ev_v = "";
back_ev_chk = "";
function result_div_in(){
   if(back_ev_chk == ""){
      for(i=0; i<en_num; i++){
        n_ev  = document.list_srh["ev"+i].value;
        if(n_ev == ""){
           n_ev_p = "-";
        }else{
           n_ev_p = n_ev;
        }
        n_ev_v = n_ev_v + n_ev_p;
      }
      nev_p = document.getElementsByTagName("form")[0].getElementsByTagName("DIV")[0];
      nev_p.innerHTML = '<p>'+n_ev_v+'</p>';
   }
}


function result_div_out(){
   nev_p = document.getElementsByTagName("form")[0].getElementsByTagName("DIV")[0];
   nev_group = nev_p.getElementsByTagName("p")[0].innerHTML;
   for(i=0; i<en_num; i++){
     nev_char = nev_group.charAt(i);
     if(nev_char == "-"){
        nev_ch = "";
     }else{
        nev_ch = nev_char;
     }
     document.list_srh["ev"+i].value = nev_ch;
   }
   n_ev_v = "";
   back_ev_chk = "";
}


ev="";
function profile_in(cmt,jckt){
   back_ev_chk = "1";
   row_cnt = cmt.getAttribute("NAME");
   ev_group = cmt.getElementsByTagName("td")[1].getElementsByTagName("p")[0].innerHTML;
//   ev_group = cmt.getElementsByTagName("td")[1].getAttribute("ID");
   if(ev_group !=""){
     for(i=0; i<en_num; i++){
       ev_char = ev_group.charAt(i);
       if(ev_char == "-"){
          ev_ch = "";
       }else{
          ev_ch = ev_char;
       }
       document.list_srh["ev"+i].value = ev_ch;
     }
   }
   amzprice = cmt.getElementsByTagName("td")[1].getElementsByTagName("p")[1].innerHTML;
//   amzprice = cmt.getElementsByTagName("td")[2].getAttribute("ID");
   if(document.getElementById("b_jkt_msg").innerHTML ==""){
     document.getElementById("b_jkt_msg").innerHTML = document.getElementById("jkt_msg").innerHTML;
   }
   if(jckt_state == ""){
      jckt_id = jckt.getAttribute("ID");
      document.getElementById(jckt_id).getElementsByTagName("div")[row_cnt].style.display = "block";
//      if(amzprice !=""){
        document.getElementById("jkt_msg").style.color = "maroon";
        document.getElementById("jkt_msg").innerHTML = y_jkt_msg;
//        document.getElementById("price").innerHTML = "";
//        document.getElementById("price").style.display = "block";
//      }else{
//        document.getElementById("jkt_msg").style.color = "maroon";
//        document.getElementById("jkt_msg").innerHTML = n_jkt_msg;
//        document.getElementById("price").innerHTML ="";
//      }
      for(i=1; i<8; i++){
         cmt.getElementsByTagName("td")[i].style.backgroundColor = "DeepSkyBlue";
      }
   }else{
      if(row_cnt != fix_cnt){
        for(i=1; i<8; i++){
         cmt.getElementsByTagName("td")[i].style.backgroundColor = "DeepSkyBlue";
        }
      }
   }
   comment_v = cmt.getElementsByTagName("td")[2].getElementsByTagName("p")[0].innerHTML;
//   comment_v = cmt.getElementsByTagName("td")[0].getAttribute("ID");
   if(document.getElementById("main_notice").innerHTML ==""){
     document.getElementById("main_notice").innerHTML = document.getElementById("notice").innerHTML;
     document.getElementById("notice").innerHTML ="";
   }
   document.getElementById("notice").style.color = "black";
      comment_in_div = document.getElementById("notice");
      Song    = cmt.getElementsByTagName("td")[3].innerHTML;
      Artist  = cmt.getElementsByTagName("td")[4].innerHTML;
      Album   = cmt.getElementsByTagName("td")[5].innerHTML;
      Release = cmt.getElementsByTagName("td")[7].innerHTML;
      Author  = cmt.getElementsByTagName("td")[1].innerHTML;
      space ="&nbsp;";
      space4 ="&nbsp;&nbsp;&nbsp;&nbsp;";
   if(comment_v !=""){
   comment_in_div.style.color = "black";
      comment_in_div.style.backgroundColor ="Ivory";
      comment_in_div.innerHTML = Song+space4+Artist+space4+Album+space4+Release+"<br>"+comment_v+space4+"-"+space+Author+space+"-";
   }else{
      comment_in_div.style.color = "green";
      comment_in_div.style.backgroundColor ="Ivory";
      comment_in_div.innerHTML = Song+space4+Artist+space4+Album+space4+Release+"<br>この登録曲には、コメントボードがまだありません。編集・削除でコメント登録すればコメントボードが作成されます。";
   }
}


function profile_out(cmt,jckt){
   evstr ="";
   for(i=0; i<en_num; i++){
      document.list_srh["ev"+i].value = "";
      if(document.getElementById("last").getElementsByTagName('p')[i].innerHTML == "-"){
         document.list_srh["ev"+i].value = "";
      }else{
         document.list_srh["ev"+i].value = document.getElementById("last").getElementsByTagName('p')[i].innerHTML;
      }
   }
   back_ev_chk = "";
   if(jckt_state == ""){
      document.getElementById(jckt_id).getElementsByTagName("div")[row_cnt].style.display = "none";
//      document.getElementById("price").innerHTML = "";
//      document.getElementById("price").style.display = "none";
      for(i=1; i<8; i++){
       cmt.getElementsByTagName("td")[i].style.backgroundColor = "";
      }
   }else{
     if(row_cnt != fix_cnt){
       for(i=1; i<8; i++){
         cmt.getElementsByTagName("td")[i].style.backgroundColor = "";
       }
     }
   }
   document.getElementById("notice").innerHTML = "";
   document.getElementById("notice").style.color ="";
   document.getElementById("notice").style.backgroundColor ="";
}


before_cmt ="";
fix_cnt ="";
same_row ="";
function profile_clck(cmt,jckt){
   jckt_id = jckt.getAttribute("ID");
   amzprice = cmt.getElementsByTagName("td")[1].getElementsByTagName("p")[1].innerHTML;
//   amzprice = cmt.getElementsByTagName("td")[2].getAttribute("ID");
   if(before_cmt !=""){
     document.getElementById(jckt_id).getElementsByTagName("div")[fix_cnt].style.display = "none";
     for(i=1; i<8; i++){
       before_cmt.getElementsByTagName("td")[i].style.backgroundColor = "";
       before_cmt.getElementsByTagName("td")[i].style.color = "navy";
     }
     document.getElementById("price").innerHTML ="";
     document.getElementById("jkt_msg").innerHTML = document.getElementById("b_jkt_msg").innerHTML;
     before_cmt ="";
     amz_jkt_msg ="";
   }
   if((fix_cnt != row_cnt) || (same_row == "1")){
     row_cnt = cmt.getAttribute("NAME");
     document.getElementById(jckt_id).getElementsByTagName("div")[row_cnt].style.display = "block";
     jckt_state = "fix";
     fix_cnt = row_cnt;
     for(i=1; i<8; i++){
       cmt.getElementsByTagName("td")[i].style.backgroundColor = "navy";
       cmt.getElementsByTagName("td")[i].style.color = "oldlace";
     }
     if(amzprice !=""){
       amz_jkt_msg ="1";
       document.getElementById("jkt_msg").style.color = "maroon";
       document.getElementById("jkt_msg").innerHTML = fix_jkt_msg;
//       document.getElementById("price").innerHTML = "";
//       document.getElementById("price").style.display = "block";
     }else{
       amz_jkt_msg ="1";
       document.getElementById("jkt_msg").style.color = "maroon";
       document.getElementById("jkt_msg").innerHTML = n_fix_jkt_msg;
//       document.getElementById("price").innerHTML ="";
     }
     before_cmt = cmt;
     if(same_row == "1"){
       same_row ="";
     }
   }else{
     row_cnt = "";
     jckt_state = "";
     same_row ="1";
     amz_jkt_msg ="";
   }
}


//登録-----------------------------------------------------------------------------------------------

function focus(){
   document.list_entry.ev_ck.value ="";
   document.list_entry.pr0.focus();
   for(i=0; i<(song_info_num -1); i++){
      document.list_entry["pr"+i].value = document.list_entry["v_pr"+i].value;
   }
}


function slt_song(song){
  slt_t = song.options[song.selectedIndex].text;
   document.list_entry.pr0.value = slt_t;
}


function pr0_check(){
   if(document.list_entry.pr0.value != ""){
      pr0 = document.list_entry.pr0.value;
      if(pr0.match(/[Ａ-Ｚａ-ｚ０-９ｱ-ﾝ　]/)){
         entry_chk ="ng";
         alert("『Song』に、\n・英数字：半角\n・カタカナ：全角\n・空白：半角\nを入力してください。");
      }
   }else{
         alert("『Song』を入力してください。");
   }
}


function pr1_check(){
   if(document.list_entry.pr1.value !=""){
      pr1 = document.list_entry.pr1.value;
      if(pr1.match(/[Ａ-Ｚａ-ｚ０-９ｱ-ﾝ　]/)){
         entry_chk ="ng";
         alert("『Artist』に、\n・英数字：半角\n・カタカナ：全角\n・空白：半角\nを入力してください。");
      }
   }else{
         alert("『Artist』を入力してください。");
   }
}


function pr2_check(){
   if(document.list_entry.pr2.value !=""){
      pr2 = document.list_entry.pr2.value;
      if(pr2.match(/[Ａ-Ｚａ-ｚ０-９ｱ-ﾝ　]/)){
         entry_chk ="ng";
         alert("『Album』に、\n・英数字：半角\n・カタカナ：全角\n・空白：半角\nを入力してください。");
      }
   }else{
         alert("『Album』を入力してください。");
   }
}


function jkt_refer(){
   document.list_entry.rfr.value = "1";
   document.list_entry.submit();
}


function nor_jkt(img,cnt,artist,album,release,id){
   artist= artist.replace(/&#039;/,"'");
   artist= artist.replace(/&quot;/,'"');
   artist= artist.replace(/&amp;/,"&");
   album= album.replace(/&quot;/,'"');
   album= album.replace(/&#039;/,"'");
   album= album.replace(/&amp;/,"&");

   document.list_entry.pr1.value = artist;
   document.list_entry.pr2.value = album;
   document.list_entry.pr4.value = release;
   document.list_entry.al_id.value = id;
     for(i=0; i<img.parentNode.getElementsByTagName("div")[cnt].getElementsByTagName("p").length; i++){
       op = img.parentNode.getElementsByTagName("div")[cnt].getElementsByTagName("p")[i].innerHTML;
       op = op.replace(/&amp;/,"&");
       len = list_entry.songs.length;
       list_entry.songs.options[len] = new Option(op,op);
     }
     before_len = len;
   document.getElementById("jkt_srh").style.display = "none";
   document.getElementById("slt_sngs").style.display = "block";
   nor_jkt = second_nor_jkt;
}


function second_nor_jkt(img,cnt,artist,album,release,id){
   for(i=0; i<before_len; i++){
     list_entry.songs.options[1] = null;
   }
   document.list_entry.pr1.value = "";
   document.list_entry.pr2.value = "";
   document.list_entry.pr4.value = "";
   document.list_entry.al_id.value  = "";
   document.getElementById("jkt_srh").style.display = "block";
   document.getElementById("slt_sngs").style.display = "none";
   for(i=0; i<img.parentNode.getElementsByTagName("div")[cnt].getElementsByTagName("p").length; i++){
     op = img.parentNode.getElementsByTagName("div")[cnt].getElementsByTagName("p")[i].innerHTML;
     op = op.replace(/&amp;/,"&");
     len = list_entry.songs.length;
     list_entry.songs.options[len] = new Option(op,op);
   }
   before_len = len;
   artist= artist.replace(/&#039;/,"'");
   artist= artist.replace(/&quot;/,'"');
   artist= artist.replace(/&amp;/,"&");
   album= album.replace(/&quot;/,'"');
   album= album.replace(/&#039;/,"'");
   album= album.replace(/&amp;/,"&");

   document.list_entry.pr1.value = artist;
   document.list_entry.pr2.value = album;
   document.list_entry.pr4.value = release;
   document.list_entry.al_id.value = id;
   if(img.parentNode.getElementsByTagName("div")[cnt].getElementsByTagName("p").length != 0){
     document.getElementById("jkt_srh").style.display = "none";
     document.getElementById("slt_sngs").style.display = "block";
   }
}

function srh_jkt(img,cnt,artist,album,release,id){
   artist= artist.replace(/&#039;/,"'");
   artist= artist.replace(/&quot;/,'"');
   artist= artist.replace(/&amp;/,"&");
   album= album.replace(/&quot;/,'"');
   album= album.replace(/&#039;/,"'");
   album= album.replace(/&amp;/,"&");

   parent.document.list_entry.pr1.value = artist;
   parent.document.list_entry.pr2.value = album;
   release4 = release.substr(0,4);
   parent.document.list_entry.pr4.value = release4;
   parent.document.list_entry.al_id.value = id;
     for(i=0; i<img.parentNode.getElementsByTagName("div")[0].getElementsByTagName("p").length; i++){
       op = img.parentNode.getElementsByTagName("div")[0].getElementsByTagName("p")[i].innerHTML;
       op = op.replace(/&amp;/,"&");
       len = parent.document.list_entry.songs.length;
       parent.document.list_entry.songs.options[len] = new Option(op,op);
     }
     before_len = len;
   parent.document.getElementById("jkt_srh").style.display = "none";
   parent.document.getElementById("slt_sngs").style.display = "block";
   srh_jkt = second_srh_jkt;
}


function second_srh_jkt(img,cnt,artist,album,release,id){
   for(i=0; i<before_len; i++){
     parent.document.list_entry.songs.options[1] = null;
   }
   parent.document.list_entry.pr1.value = "";
   parent.document.list_entry.pr2.value = "";
   parent.document.list_entry.pr4.value = "";
   parent.document.getElementById("jkt_srh").style.display = "block";
   parent.document.getElementById("slt_sngs").style.display = "none";
   for(i=0; i<img.parentNode.getElementsByTagName("div")[0].getElementsByTagName("p").length; i++){
     op = img.parentNode.getElementsByTagName("div")[0].getElementsByTagName("p")[i].innerHTML;
     op = op.replace(/&amp;/,"&");
     len = parent.document.list_entry.songs.length;
     parent.document.list_entry.songs.options[len] = new Option(op,op);
   }
   before_len = len;
   artist= artist.replace(/&#039;/,"'");
   artist= artist.replace(/&quot;/,'"');
   artist= artist.replace(/&amp;/,"&");
   album= album.replace(/&quot;/,'"');
   album= album.replace(/&#039;/,"'");
   album= album.replace(/&amp;/,"&");

   parent.document.list_entry.pr1.value = artist;
   parent.document.list_entry.pr2.value = album;
   release4 = release.substr(0,4);
   parent.document.list_entry.pr4.value = release4;
   parent.document.list_entry.al_id.value = id;
   if(img.parentNode.getElementsByTagName("div")[0].getElementsByTagName("p").length != 0){
     parent.document.getElementById("jkt_srh").style.display = "none";
     parent.document.getElementById("slt_sngs").style.display = "block";
   }
}

function amz_jkt_f(){
   parent.document.getElementById("amzjkt_show").style.overflow = "hidden";
}


function pr3_check(){
   if(document.list_entry.pr3.value !=""){
      pr3 = document.list_entry.pr3.value;
      if(pr3.match(/[Ａ-Ｚａ-ｚ０-９ｱ-ﾝ　]/)){
         entry_chk ="ng";
         alert("『Player』に、\n・英数字：半角\n・カタカナ：全角\n・空白：半角\nを入力してください。");
      }
   }
}


function pr4_check(){
   if(document.list_entry.pr4.value !=""){
      re_y =  document.list_entry.pr4.value;
      if(!re_y.match(/^[1-2][0-9][0-9][0-9]$/)){
         entry_chk ="ng";
         alert("『リリース年』　を半角数字(4桁)で入力してください。");
      }else{
         entry_chk ="";
      }
   }
}

function comment_check(){
   if(document.list_entry.comment.value !=""){
      comment = document.list_entry.comment.value;
       if(comment.match(/[Ａ-Ｚａ-ｚ０-９ｱ-ﾝ　]/)){
         entry_chk ="ng";
         alert("『Comment』に、\n・英数字：半角\n・カタカナ：全角\n・空白：半角\nを入力してください。");
       }else{
         entry_chk ="";
       }
      comment_length = comment.length;
      if(comment_length > 0){
        document.getElementById("comment_leg").style.color = "maroon";
        document.getElementById("comment_leg").innerHTML = comment_length+" / 50 <br>文字　";
      }
//      document.getElementById("comment_leg").innerHTML = "文字数："+comment_length;
      if(comment_max_length < comment_length){
         entry_chk ="ng";
         alert("Commentは"+comment_max_length+"字以内で入力してください。");
      }else{
         entry_chk ="";
      }
   }
}


function ev_focus(){
   if((document.list_entry.pr0.value == "") || (document.list_entry.pr1.value == "")|| (document.list_entry.pr2.value == "")){
      alert("『曲名』と『アーチスト名』と『アルバム名』　は、必ず入力してください。");
      for(i=0; i<en_num; i++){
         document.list_entry["ev"+i].value = "";
      }
   }
}


function entry_ev_check(){
   for(i=0; i<en_num; i++){
      if(document.list_entry["ev"+i].value !=""){
         document.list_entry.ev_ck.value = "ev_flag";
         ev= document.list_entry["ev"+i].value;
         if(!ev.match(/^[0-5]/)){
            entry_chk ="ng";
            alert("『0〜5』 の半角数字を入力してください。");
            document.list_entry["ev"+i].value = "";
         }
      }
   }
}


function entry_db(){
   if((document.list_entry.pr0.value =="") || (document.list_entry.pr1.value =="") || (document.list_entry.pr2.value =="")){
      alert("『曲名』と『アーティスト名』と『アルバム名』は、必ず入力してください。");
   }else{
      if(entry_chk != "ng"){
         document.list_entry.rfr.value = "2";
         document.list_entry.submit();
         document.list_entry.sid.value = "";
         document.getElementById("comment_leg").style.color ="";
         document.getElementById("comment_leg").innerHTML ="";
         document.list_entry.ev_ck.value ="";
         document.list_entry.reload();
      }else{
         entry_chk ="";
      }
   }
   document.list_entry.pr0.focus();
}

//評価値クリア
function entry_pr_clear(){
   for(i=0; i<song_info_num; i++){
      if(i != nickname_fid){
         document.list_entry["pr"+i].value ="";
      }
   }
   document.list_entry.comment.value ="";
   for(i=0; i<en_num; i++){
      document.list_entry["ev"+i].value ="";
   }
   document.getElementById("comment_leg").style.color ="";
   document.getElementById("comment_leg").innerHTML ="";
   if(document.getElementById("slt_sngs").style.display == "block"){
     document.getElementById("slt_sngs").style.display = "none";
     document.getElementById("jkt_srh").style.display = "block";
   }
   entry_chk ="";
   document.list_entry.pr0.focus();
}

//--------------------------------------------------------------------------------------------------
function pr_clr(n){
  for(i=0; i<pr_num -1; i++){
    document.forms[""+n+""].elements["pr"+i].value ="";
  }
  switch(n){
     case "dt_entry":
       for(i=0; i<en_num; i++){
         document.forms[""+n+""].elements["ev"+i].value ="";
       }
       document.getElementById("comment_leg").style.color ="";
       document.getElementById("comment_leg").innerHTML ="";
       if(document.getElementById("slt_sngs").style.display == "block"){
         document.getElementById("slt_sngs").style.display = "none";
         document.getElementById("jkt_srh").style.display = "block";
       }
       entry_chk ="";
       break;
     case "add_entry":
       if(document.getElementById("slt_sngs").style.display == "block"){
         document.getElementById("slt_sngs").style.display = "none";
         document.getElementById("jkt_srh").style.display = "block";
       }
       break;
     defult:
       break;
  }
  document.forms[""+n+""].pr0.focus();
}


function submt_btn(btn){
   var div_wr = document.getElementsByTagName("form")[0].getElementsByTagName("div")[0];
   div_wr.innerHTML ='<input type="hidden" name="button" value="'+btn+'">';
}

function jckt_rfr(n){
  submt_btn('jckt_rfr');
  document.forms[""+n+""].submit();
}

function jckt_dbtk(img,cnt,artist,album,release,id,n){
  document.forms[""+n+""].pr1.value = artist;
  document.forms[""+n+""].pr2.value = album;
  document.forms[""+n+""].pr4.value = release;
  document.forms[""+n+""].al_id.value = id;
  ago_img = img;
  img.parentNode.style.backgroundColor ="blue";
  for(i=0; i<img.parentNode.parentNode.getElementsByTagName("span")[cnt].getElementsByTagName("p").length; i++){
    i_p = img.parentNode.parentNode.getElementsByTagName("span")[cnt].getElementsByTagName("p")[i].innerHTML;
    ic_p = i_p.replace(/&amp;/,"&");
    lngth = document.forms[""+n+""].songs.length; 
    document.forms[""+n+""].songs.options[lngth] = new Option(ic_p,ic_p);
  }
  ago_lngth = lngth;
  document.getElementById("jkt_srh").style.display = "none";
  document.getElementById("slt_sngs").style.display = "block";
  jckt_dbtk = jckt_scnd_clck;
}

function jckt_scnd_clck(img,cnt,artist,album,release,id,n){
  for(i=0; i<ago_lngth; i++){
    document.forms[""+n+""].songs.options[1] = null;
  }
  document.forms[""+n+""].pr1.value = "";
  document.forms[""+n+""].pr2.value = "";
  document.forms[""+n+""].pr4.value = "";
  ago_img.parentNode.style.backgroundColor ="";
  document.getElementById("jkt_srh").style.display = "block";
  document.getElementById("slt_sngs").style.display = "none";
  for(i=0; i<img.parentNode.parentNode.getElementsByTagName("span")[cnt].getElementsByTagName("p").length; i++){
    i_p = img.parentNode.parentNode.getElementsByTagName("span")[cnt].getElementsByTagName("p")[i].innerHTML;
    ic_p = i_p.replace(/&amp;/,"&");
    lngth = document.forms[""+n+""].songs.length;
    document.forms[""+n+""].songs.options[lngth] = new Option(ic_p,ic_p);
  }
  ago_lngth = lngth;
  document.forms[""+n+""].pr1.value = artist;
  document.forms[""+n+""].pr2.value = album;
  document.forms[""+n+""].pr4.value = release;
  document.forms[""+n+""].al_id.value = id;
  ago_img.parentNode.style.backgroundColor ="";
  ago_img = img;
  img.parentNode.style.backgroundColor ="blue";
  if(img.parentNode.parentNode.getElementsByTagName("span")[cnt].getElementsByTagName("p").length != 0){
    document.getElementById("jkt_srh").style.display = "none";
    document.getElementById("slt_sngs").style.display = "block";
  }
}

//amazon--------------------------------------------------------------------------------------------
function amzjckt_tk(img,cnt,artist,album,release,id,n){
  parent.document.forms[""+n+""].pr1.value = artist;
  parent.document.forms[""+n+""].pr2.value = album;
  rls4 = release.substr(0,4);
  parent.document.forms[""+n+""].pr4.value = rls4;
  parent.document.forms[""+n+""].al_id.value = id;
  for(i=0; i<img.parentNode.getElementsByTagName("div")[0].getElementsByTagName("p").length; i++){
    i_p = img.parentNode.getElementsByTagName("div")[0].getElementsByTagName("p")[i].innerHTML;
    ic_p = i_p.replace(/&amp;/,"&");
    lngth = parent.document.forms[""+n+""].songs.length;
    parent.document.forms[""+n+""].songs.options[lngth] = new Option(ic_p,ic_p);
  }
  ago_lngth = lngth;
  parent.document.getElementById("jkt_srh").style.display = "none";
  parent.document.getElementById("slt_sngs").style.display = "block";
  amzjckt_tk = amzjckt_scnd_clck;
}

function amzjckt_scnd_clck(img,cnt,artist,album,release,id,n){
  for(i=0; i<ago_lngth; i++){
    parent.document.forms[""+n+""].songs.options[1] = null;
  }
  parent.document.forms[""+n+""].pr1.value = "";
  parent.document.forms[""+n+""].pr2.value = "";
  parent.document.forms[""+n+""].pr4.value = "";
  parent.document.getElementById("jkt_srh").style.display = "block";
  parent.document.getElementById("slt_sngs").style.display = "none";
  for(i=0; i<img.parentNode.getElementsByTagName("div")[0].getElementsByTagName("p").length; i++){
    i_p = img.parentNode.getElementsByTagName("div")[0].getElementsByTagName("p")[i].innerHTML;
    ic_p = i_p.replace(/&amp;/,"&");
    lngth = parent.document.forms[""+n+""].songs.length;
    parent.document.forms[""+n+""].songs.options[lngth] = new Option(ic_p,ic_p);
  }
  ago_lngth = lngth;
  parent.document.forms[""+n+""].pr1.value = artist;
  parent.document.forms[""+n+""].pr2.value = album;
  rls4 = release.substr(0,4);
  parent.document.forms[""+n+""].pr4.value = rls4;
  parent.document.forms[""+n+""].al_id.value = id;
  if(img.parentNode.getElementsByTagName("div")[0].getElementsByTagName("p").length != 0){
    parent.document.getElementById("jkt_srh").style.display = "none";
    parent.document.getElementById("slt_sngs").style.display = "block";
  }
}

function amzfrm_rstr(){
  parent.document.getElementById("amzjkt_show").style.overflow = "hidden";
}
//データ編集・削除-----------------------------------------------------------------------------------------

function chg_focus(){
   document.list_chg.pr0.focus();
}

function chg_pr0_check(){
   if(document.list_chg.pr0.value != ""){
      chg_pr0 = document.list_chg.pr0.value;
      if(chg_pr0.match(/[Ａ-Ｚａ-ｚ０-９ｱ-ﾝ　]/)){
         chg_chk ="ng";
         alert("『Song』に、\n・英数字：半角\n・カタカナ：全角\n・空白：半角\nを入力してください。");
      }
   }else{
       alert("『Song』を入力してください。");
   }
}


function chg_pr1_check(){
   if(document.list_chg.pr1.value !=""){
      chg_pr1 = document.list_chg.pr1.value;
      if(chg_pr1.match(/[Ａ-Ｚａ-ｚ０-９ｱ-ﾝ　]/)){
         chg_chk ="ng";
         alert("『Artist』に、\n・英数字：半角\n・カタカナ：全角\n・空白：半角\nを入力してください。");
      }
   }else{
       alert("『Artist』を入力してください。");
   }
}


function chg_pr2_check(){
   if(document.list_chg.pr2.value !=""){
      chg_pr2 = document.list_chg.pr2.value;
      if(chg_pr2.match(/[Ａ-Ｚａ-ｚ０-９ｱ-ﾝ　]/)){
         chg_chk ="ng";
         alert("『Album』に、\n・英数字：半角\n・カタカナ：全角\n・空白：半角\nを入力してください。");
      }
   }else{
       alert("『Album』を入力してください。");
   }
}


function chg_pr3_check(){
   if(document.list_chg.pr3.value !=""){
      chg_pr3 = document.list_chg.pr3.value;
      if(chg_pr3.match(/[Ａ-Ｚａ-ｚ０-９ｱ-ﾝ　]/)){
         chg_chk ="ng";
         alert("『Player』に、\n・英数字：半角\n・カタカナ：全角\n・空白：半角\nを入力してください。");
      }
   }
}

function chg_pr4_check(){
   if(document.list_chg.pr4.value !=""){
      chg_re_y =  document.list_chg.pr4.value;
      if(!chg_re_y.match(/^[1-2][0-9][0-9][0-9]$/)){
         chg_chk ="ng";
         alert("『リリース年』　を半角数字(4桁)で入力してください。");
      }else{
         chg_chk ="";
      }
   }
}


function chg_ev_focus(){
   if((document.list_chg.pr0.value == "") || (document.list_chg.pr1.value == "")|| (document.list_chg.pr2.value == "")){
      alert("『曲名』と『アーチスト名』と『アルバム名』　は、必ず入力してください。");
   }
}


function chg_ev_check(){
   for(i=song_info_num; i<(song_info_num + en_num); i++){
      if(document.list_chg["ev"+i].value !=""){
         document.list_chg.ev_ck.value = "ev_flag";
         ev= document.list_chg["ev"+i].value;
         if(!ev.match(/^[0-5]/)){
            chg_chk ="ng";
            alert("『0〜5』 の半角数字を入力してください。");
            document.list_chg["ev"+i].value = "";
         }
      }
   }
}

function chg_comment_check(){
   if(document.list_chg.comment.value !=""){
      comment = document.list_chg.comment.value;
       if(comment.match(/[Ａ-Ｚａ-ｚ０-９ｱ-ﾝ　]/)){
         chg_chk ="ng";
         alert("・英数字：半角\n・カタカナ：全角\n・空白：半角\nを入力してください。");
      }else{
        chg_chk ="";
      }
      chg_comment_length = comment.length;
      if(chg_comment_length >0){
        document.getElementById("chg_comment_leg").style.color = "maroon";
        document.getElementById("chg_comment_leg").innerHTML = chg_comment_length+" / 50 <br>文字　";
      }
      if(comment_max_length < chg_comment_length){
         chg_chk ="ng";
         alert("Commentは"+comment_max_length+"字以内で入力してください。");
      }else{
         chg_chk ="";
      }
   }
}

function sql_chg(){
   document.list_chg.submit_flg.value = "chg";
   if(document.list_chg.submit_flg.value == "chg"){
      if((document.list_chg.pr0.value == "") || (document.list_chg.pr1.value == "")|| (document.list_chg.pr2.value == "")){
         alert("『曲名』と『アーチスト名』と『アルバム名』　は、必ず入力してください。");
      }else{
        if(chg_chk != "ng"){
         document.list_chg.submit();
         window.close();
         window.opener.location.reload();
        }else{
         chg_chk ="";
        }
      }
   }
}


function sql_dell(){
   document.list_chg.dell_flg.value = "dell";
   if(document.list_chg.dell_flg.value == "dell"){
     if(window.confirm("データ削除になりますが、よろしいですか？")){
        document.list_chg.submit();
         window.close();
         window.opener.location.reload();
     }else{
        window.close();
     }
   }
}

//comment---------------------------------------------------------------------------------------------------

function link_onload(cid){
   location.href="./comment.php?cid="+cid;
}


function chgview(){
   if(document.getElementById("chgview").style.height == "auto"){
      document.getElementById("chgview").style.height ="340px";
   }else{
      document.getElementById("chgview").style.height ="auto";
   }
}


function comment_fcheck(){
   if(document.comment_f.comment.value !=""){
      commentf = document.comment_f.comment.value;
      if(document.all){
         commentf = commentf.replace(/\r\n/g,"\r");
         commentf = commentf.replace(/\n/g,"");
      }else{
         commentf = commentf;
      }
      commentf_length = commentf.length;
      if(commentf_length > 0){
        document.getElementById("comment_leg").style.color = "maroon";
        document.getElementById("comment_leg").innerHTML = commentf_length+" / 250文字　";
      }
      if(commentf_max_length < commentf_length){
         fentry_chk ="ng";
         alert("Commentは"+commentf_max_length+"字以内で入力してください。");
      }else{
        fentry_chk ="";
     }
   }else{
      fentry_chk = "ng";
   }
}

function edit_comment_fcheck(com){
   if(document.comment_f.editcomment.value !=""){
      commentf = document.comment_f.editcomment.value;
      if(document.all){
         commentf = commentf.replace(/\r\n/g,"\r");
         commentf = commentf.replace(/\n/g,"");
      }else{
         commentf = commentf;
      }
      commentf_length = commentf.length;
      if(commentf_length > 0){
        document.getElementById(com).getElementsByTagName("TD")[2].getElementsByTagName("DIV")[3].style.visibility ="visible";
        document.getElementById(com).getElementsByTagName("TD")[2].getElementsByTagName("DIV")[3].style.color= "maroon";
        document.getElementById(com).getElementsByTagName("TD")[2].getElementsByTagName("DIV")[3].innerHTML = commentf_length+" / 250文字　";
      }
      if(commentf_max_length < commentf_length){
         fentry_chk ="ng";
         alert("Commentは"+commentf_max_length+"字以内で入力してください。");
      }else{
        fentry_chk ="";
     }
   }
}

function page_return(){
   location.reload();
}

function cmmnt(com,editicon,btn){
  switch(btn){
    case "new_submit":
            com_btn("new_submit");
            if(document.comment_f.comment.value ==""){
               alert("『Comment』を入力してください。");
            }else{
               document.comment_f.submit();
               document.comment_f.comment.focus();
               document.comment_f.button.value = null;
               document.getElementById("comment_leg").style.color ="";
               document.getElementById("comment_leg").innerHTML ="";
            }
           break;

     case "edit":

            document.getElementById(com).getElementsByTagName("TD")[2].getElementsByTagName("DIV")[3].style.visibility ="hidden";
            document.getElementById("com_new_form").style.display ="none";
            document.comment_f.comid.value = com;

            edit_time = document.getElementById(com).getElementsByTagName("DIV")[1].getElementsByTagName("p")[0].innerHTML;
            document.comment_f.before_time.value = edit_time;

            edit_comt = document.getElementById(com).getElementsByTagName("DIV")[4].innerHTML;
            com_br = edit_comt.replace(/<br>/ig,"");

            if(document.all && !window.opera){
               com_br = edit_comt.replace(/<br>/ig,"\n");
            }

            document.getElementById(com).getElementsByTagName("TD")[2].getElementsByTagName("DIV")[1].style.visibility ="visible";
            var edit_txt = document.getElementById(com).getElementsByTagName("DIV")[4];
            edit_txt.innerHTML ='<textarea class="edit" name="editcomment">'+com_br+'</textarea>';


           document.getElementById(com).getElementsByTagName("TD")[1].getElementsByTagName("DIV")[1].setAttribute("style","height:180px;");

            var return_btn = document.getElementById(com).getElementsByTagName("TD")[2].getElementsByTagName("DIV")[1];
            return_btn.innerHTML ='<img src="../../image/collection/return-button.jpg" name="return" onClick="page_return()">';

            editicon.setAttribute("src","../../image/collection/write-button.jpg");
            editicon.setAttribute("name","com-edit");

            if(document.all && !window.opera){
               editicon.setAttribute("onmouseover",new Function("edit_comment_fcheck("+com+");"));
               editicon.setAttribute("onclick", new Function("cmmnt('$comid',this,'edit_submit');"));
            }else{
               editicon.setAttribute("onmouseover","edit_comment_fcheck("+com+")");
               editicon.setAttribute("onClick","cmmnt('$comid','this','edit_submit')");
            }

            for(i=1; i<=document.getElementById(com).getElementsByTagName("p")[0].innerHTML; i++){
               if(document.getElementById(com).getElementsByTagName("DIV")[7].getAttribute("ID") != "edit"+i){
                  document.getElementById("edit"+i).style.display ="none";
               }
               if(document.getElementById(com).getElementsByTagName("DIV")[8].getAttribute("ID") != "del"+i){
                  document.getElementById("del"+i).style.display ="none";
               }
            }
            break;

     case "edit_submit":
            com_btn("edit_submit");
            if(document.comment_f.editcomment.value ==""){
               alert("『Comment』を入力してください。");
               fentry_chk ="";
            }else{
               if(fentry_chk != "ng"){
                  document.comment_f.submit();
                  document.comment_f.button.value = null;
               }else{
                  fentry_chk ="";
               }
            }
            document.comment_f.comment.focus();
            break;

     case "del_submit":
            com_btn("del_submit");
            del_comt = document.getElementById(com).getElementsByTagName("DIV")[4].innerHTML;
            com_br = del_comt.replace(/<br>/ig,"");

            if(document.all && !window.opera){
               com_br = del_comt.replace(/<br>/ig,"\n");
            }
            var comment_txt = document.getElementById(com).getElementsByTagName("DIV")[4];
            comment_txt.innerHTML ='<textarea class="edit" name="del_comment">'+com_br+'</textarea>';
            document.comment_f.comid.value = com;
            document.comment_f.submit();
            document.comment_f.button.value = null;
            break;

     case "checked":
            document.cmmnt_ety.submit();
            break;

     case "clear":
            document.cmmnt_ety.submit();

            break;
  }
}

function com_btn(btn){
   var div_btn = document.getElementsByTagName("form")[0].getElementsByTagName("div")[0];
   div_btn.innerHTML ='<input type="hidden" name="button" value="'+btn+'">';
}


//make_now-------------------------------------------------------------------------------------------------

function make_now(MODE){

   now_ev ="";
   now_pr ="";
   for(i=0; i<en_num; i++){
      ev  = document.getElementsByTagName("input")[i].value;
      if(ev ==""){
         ev = "-";
      } 
      now_ev = now_ev + ev +"\t";
   }
   for(i=0; i<song_info_num; i++){
       pr =document.list_srh["pr"+i].value;
      if(pr ==""){
         pr ="-";
      }
      now_pr = now_pr + pr +"\t";
   }
   now_ev_pr = now_ev+now_pr;
   var div_hidden_now = document.getElementsByTagName("form")[0].getElementsByTagName("div")[0];
   div_hidden_now.innerHTML = '<input type="hidden" name="now" value="'+MODE+"\t"+now_ev_pr+'">';
}

//データ参照-----------------------------------------------------------------------------------------------
/*

function lookup_radio(){

document.getElementById('lookup&close_radio').style.visibility ="visible";

  var div_data_lookup = document.getElementById("lookup&close_radio");
  div_data_lookup.innerHTML  ='<td class="buttons"><img src="../../image/collection/lookup-button.jpg" name="lookup-button" onClick="data_lookup()"></td>';

}


function data_lookup(){

   make_now("d_lup");
   for(i=en_num,j=0; i<(en_num+song_info_num); i++,j++){
      if(document.getElementById("last").getElementsByTagName('p')[i].innerHTML == "-"){
         document.list_srh["pr"+j].value ="";
      }else{
         document.list_srh["pr"+j].value = document.getElementById("last").getElementsByTagName('p')[i].innerHTML;
      }
   }
   for(i=0; i<en_num; i++){
      if(document.getElementById("last").getElementsByTagName('p')[i].innerHTML == "-"){
         document.list_srh["ev"+i].value = "";
      }else{
         document.list_srh["ev"+i].value = document.getElementById("last").getElementsByTagName('p')[i].innerHTML;
      }
   }
   document.list_srh.submit();
}


function return_now(){

   document.getElementById('lookup&close_radio').style.visibility ="hidden";

   for(i=0; i<document.list_srh.rb_song.length; i++){
     if(document.list_srh.rb_song[i].checked == true){
        document.list_srh.rb_song[i].checked = false;
    }
   }
   for(i=en_num,j=0; i<(en_num+song_info_num); i++,j++){
      if(document.getElementById("last").getElementsByTagName('p')[i].innerHTML == "-"){
         document.list_srh["pr"+j].value ="";
      }else{
         document.list_srh["pr"+j].value = document.getElementById("last").getElementsByTagName('p')[i].innerHTML;
      }
   }
   for(i=0; i<en_num; i++){
      if(document.getElementById("last").getElementsByTagName('p')[i].innerHTML == "-"){
         document.list_srh["ev"+i].value = "";
      }else{
         document.list_srh["ev"+i].value = document.getElementById("last").getElementsByTagName('p')[i].innerHTML;
      }
   }
   for(i=0; i<en_num; i++){
      if(document.getElementById("now").getElementsByTagName('p')[i].innerHTML == "-"){
         document.list_srh["ev"+i].value ="";
      }else{
         document.list_srh["ev"+i].value = document.getElementById("now").getElementsByTagName('p')[i].innerHTML;
      }
   }
   for(i=en_num,j=0; i<(en_num+song_info_num); i++,j++){
      if(document.getElementById("now").getElementsByTagName('p')[i].innerHTML == "-"){
         document.list_srh["pr"+j].value ="";
      }else{
         document.list_srh["pr"+j].value = document.getElementById("now").getElementsByTagName('p')[i].innerHTML;
      }
   }
}
*/

//HELP-------------------------------------------------------------------------------------------------------

function p_OnOff(pllt){
   if(pllt.getElementsByTagName("DIV")[1].style.display != "block"){
      pllt.getElementsByTagName("DIV")[1].style.display ="block";
   }
else{
      pllt.getElementsByTagName("DIV")[1].style.display = "none";
   }
}


//Login------------------------------------------------------------------------------------------------------

function pass_chk(){
   if(document.list_srh.e_mail.value != ""){
      mail = document.list_srh.e_mail.value;
      if(mail != 'admin'){
      if(!mail.match(/^[a-zA-Z0-9][a-zA-Z0-9_\.-]+@[a-zA-Z0-9][a-zA-Z0-9_\.-]+\.[a-zA-Z]+$/)){
         alert("『メールアドレス』 を確認してください。");
         document.list_srh.e_mail.value = "";
      }
      }
   }
   if(document.list_srh.password.value != ""){
      pass = document.list_srh.password.value;
      if(!pass.match(/[0-9a-zA-z]/)){
         alert("『パスワード』を５文字以上１０文字以内の半角数字で入力してください。");
         document.list_srh.password.value = "";
      }else if(5 > document.list_srh.password.value.length && document.list_srh.password.value.length > 10) {
         alert("『パスワード』を５文字以上１０文字以内の半角数字で入力してください。");
         document.list_srh.password.value = "";
      }else{
         alert("『パスワード』 を入力してください。");
      }
   }
}

//clickEsens-----------------------------------------------------------------------------------------------------------

function nullTofive(scale,evt){
      var scaleWidth = 42;
      var signWidth  = 24;
      var signHeight = 19;
      var whichTd    =  1;
      var marginLeft =  0;
      if (document.all) {
        var x = event.offsetX;
        if(event.x > (scaleWidth + signWidth + marginLeft)){
          whichTd = 3;
        }
      }else{
        var x = evt.layerX - marginLeft;
        if(evt.pageX > (scaleWidth + signWidth + marginLeft)){
          whichTd = 3;
        }
      }
      if(x > (scaleWidth + signWidth)){
        x = x - scaleWidth - signWidth;
      }
      evalx = parseInt(x / 6) - 1;
      if(evalx < 0){
        scale.parentNode.getElementsByTagName("TD")[whichTd].getElementsByTagName("INPUT")[0].value = "";
      }else{
        if(0 <= evalx && evalx <= 5){
          scale.parentNode.getElementsByTagName("TD")[whichTd].getElementsByTagName("INPUT")[0].value = evalx;
        }
      }
}

function plusOrminus(sign,evt){
      var scaleWidth = 42;
      var signWidth  = 24;
      var signHeight = 19;
      var whichTd    =  1;
      var marginLeft = 10;
      var marginTop  =  0;
      var enVal      =  0;
      if (document.all) {
        var y = event.offsetY;
        if(event.x > (scaleWidth + signWidth + marginLeft)){
          whichTd = 3;
        }
      }else{
        var y = evt.layerY - marginTop;
        if(evt.pageX > (scaleWidth + signWidth + marginLeft)){
          whichTd = 3;
        }
      }
      if(y > signHeight){
        y = y - parseInt(y / signHeight) * signHeight;
      }
      evaly = y;
      enVal = sign.parentNode.getElementsByTagName("TD")[whichTd].getElementsByTagName("INPUT")[0].value;
      if(enVal.match(/^[0-5][-+]$/)){
        enVal = enVal.replace(/[-+]$/,"");
      }
      if(0 <= enVal <= 5 && enVal != ""){
        if(evaly < 10){
          if(enVal != 5){
            sign.parentNode.getElementsByTagName("TD")[whichTd].getElementsByTagName("INPUT")[0].value = enVal + "+";
          }
        }else{
          if(enVal != 0){
            sign.parentNode.getElementsByTagName("TD")[whichTd].getElementsByTagName("INPUT")[0].value = enVal + "-";
          }
        }
      }
 }

//---entry_cickEsens--------------------------------------------------------------------------------

function entry_nullTofive(scale,evt){
      var scaleWidth = 56;
      var signWidth  = 23;
      var signHeight = 23;
      var whichTd    =  1;
      var marginLeft = 10;
      if (document.all) {
        var x = event.offsetX;
        if(event.x > (scaleWidth + signWidth)){
           eventx = parseInt((event.x) / (scaleWidth + signWidth));
           eventx_val = (eventx * 2)+1;
           whichTd = eventx_val;  
        }
      }else{
        var x = evt.layerX - marginLeft;
        if(evt.pageX > (scaleWidth + signWidth)){
           firefox_x = parseInt(x / (scaleWidth + signWidth));
           firefox_val = (firefox_x * 2)+1;
           whichTd = firefox_val;
        }
      }
      if(x > (scaleWidth + signWidth)){
        x = x - (firefox_x * (scaleWidth + signWidth));
      }
      evalx = parseInt(x / 8) - 1;
      if(evalx < 0){
        scale.parentNode.getElementsByTagName("TD")[whichTd].getElementsByTagName("INPUT")[0].value = "";
      }else{
        if(0 <= evalx && evalx <= 5){
          scale.parentNode.getElementsByTagName("TD")[whichTd].getElementsByTagName("INPUT")[0].value = evalx;
          document.list_entry.ev_ck.value = "ev_flag";
        }
      }
}

function entry_plusOrminus(sign,evt){
      var scaleWidth = 56;
      var signWidth  = 23;
      var signHeight = 23;
      var whichTd    =  1;
      var marginLeft = 10;
      var marginTop  =  0;
      var enVal      =  0;
      if (document.all) {
        var y = event.offsetY;
        if(event.x > (scaleWidth + signWidth)){
          whichTd = eventx_val;
        }
      }else{
        var y = evt.layerY - marginTop;
        if(evt.pageX > (scaleWidth + signWidth)){
          whichTd = firefox_val;
       }
      }
      if(y > signHeight){
        y = y - parseInt(y / signHeight) * signHeight;
      }
      evaly = y;
      enVal = sign.parentNode.getElementsByTagName("TD")[whichTd].getElementsByTagName("INPUT")[0].value;
 } 

function admin(admin_id){
 id = admin_id.parentNode.parentNode.getAttribute("ID");
 str = id.length;
 z = "";
 for(i=1; i<=(10-str); i++){
      z +="0";
 }
 file_name = "./profile/sample/"+z+id+".mp3";
 window.open(file_name,"_black","top=140,left=300,width=400,height=20");
}




