
function wopen( url, name, option ) {
    window.open( url, name, option );
}

function gotourl( url ) { 
    document.location.href = url;
}

function show( idname ) {
   try { document.getElementById( idname ).style.display = ""; } catch(e) {}
}
function hide( idname ) { 
   try { document.getElementById( idname ).style.display = "none"; } catch(e) {}
}

function Admin_List( data ) {
   window.open("system/select_no.php?data=" + data + "&bno=" + document.all['bno'].value + "&cate=" + document.all['cate'].value, "adminlist", "screenX=0,screenY=0,width=500,height=300,resizable=no,scrollbars=no,scrolling=no,scroll=no");
}

function webnaviurl( data ) {
   window.open(data, "_black", "");
}


function listcheck_all(checkdata, check_option)  {
  
      var putdata = "";
      
      // 일단추가..
      document.all["select_num"].value = checkdata + document.all["select_num"].value;
      
      // 중복자료제거
      listdata = document.all["select_num"].value.split("|");
      for(i=0;i<listdata.length;i++) {
         if(listdata[i] != "") {
            for(j=i+1;j<listdata.length;j++) {
               if(listdata[i] == listdata[j]) { listdata[j] = ""; }
            }
         }
      }
      
      // 다시 합치기
      for(i=0;i<listdata.length;i++) {
         if(listdata[i] != "") {
            putdata += listdata[i] + "|";
         }
      }
     
      document.all["select_num"].value = putdata;
      parent.document.getElementById("iparty_list").contentWindow.BoardList("ANIPARTY_MAIN");  
}

function listcheck_up(checkdata, check_option) {
      
      var upcheck = 0;
      var putdata = "";
      
      // 1이면 무조건 체크, 2이면 무조건 해제
      if(check_option == '2') { putdata += checkdata + "|"; }

      listdata = document.all["select_num"].value.split("|");
      for(i=0;i<listdata.length;i++) {
        if(listdata[i] != "") {
          if(listdata[i] != checkdata) {
             putdata += listdata[i] + "|";
          }
        }
      }
     
      document.all["select_num"].value = putdata;
      select_listcount();
}

function select_listcount() {
      var upcount = 0;
      listdata = document.all["select_num"].value.split("|");
      for(i=0;i<listdata.length;i++) {
        if(listdata[i] != "") { upcount++; }
      }
      if(upcount > 0) {
        document.getElementById("ANIPARTY_SELECT").innerHTML = upcount + "개의 게시물이 선택된 상태입니다.";
      } else {
        document.getElementById("ANIPARTY_SELECT").innerHTML = "";
      }
}

function msgSend_Process( id ) {
    window.open('system/msg_send.php?check=' + encodeURIComponent(id),'_blank','screenX=0,screenY=0,width=500,height=272,resizable=no,scrollbars=no,scrolling=no'); 
}

function menushow( idname ) {
   try { document.getElementById( 'menusilde_01' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_02' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_03' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_03a' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_04' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_04a' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_04b' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_04c' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_04d' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_04e' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_05' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_05a' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_06' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_07' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_08' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_09' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_10' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_11' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_11a' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_11b' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( 'menusilde_11c' ).style.display = "none";  } catch(e) {}
   try { document.getElementById( idname ).style.display = "";  } catch(e) {}
}


function navishow( idname ) {
  document.getElementById( 'navisilde_1' ).style.display = "none"; 
  document.getElementById( 'navisilde_2' ).style.display = "none"; 
  document.getElementById( 'navisilde_3' ).style.display = "none"; 
  document.getElementById( idname ).style.display = ""; 
}

function honokashow( idname ) {
  document.getElementById( 'honokasilde_1' ).style.display = "none";
  //document.getElementById( 'honokasilde_2' ).style.display = "none";
  //document.getElementById( 'honokasilde_3' ).style.display = "none";
  document.getElementById( idname ).style.display = ""; 
}

function naviurl( url ) { 
    window.open( url , url, option );
}

function Write_Open( url, name, option ) {
    window.open( url + "?bno=" + document.all["bno"].value + "&cate=" + document.all["cate"].value, name, option );
}

function Delete_Open( url, name, option ) {
    window.open( url , name, option );
}

function CateBoardList(pageElement, cateno) {
  try {
  if(document.all['erproc'].value == 1) {
    
    try {
       parent.document.getElementById("iparty_list").contentWindow.document.all['select_num'].value = ""; // 선택된 값 초기화
       parent.document.getElementById("iparty_list").contentWindow.document.all['cate'].value = cateno;
       parent.document.getElementById("iparty_list").contentWindow.document.all['pno'].value = "1";
       parent.document.getElementById("iparty_list").contentWindow.document.all['no'].value = "";
       parent.document.getElementById("iparty_list").contentWindow.BoardList("ANIPARTY_MAIN");
       
       parent.hide("ANIPARTY_COM_WRITE");
       hide("ANIPARTY_COMMENT");
       hide("ANIPARTY_VIEW_FOOT");
       hide("ANIPARTY_VIEW");
       show("ANIPARTY_MAIN");
       
    } catch(e) {
       parent.document.getElementById( 'iparty_list' ).src = "party.php?mode=list&bno=" + document.all['bno'].value 
                                                              + "&cate=" + cateno
                                                              + "&pno=" + document.all["pno"].value
                                                              + "&cate=" + document.all["cate"].value
                                                              + "&cate2=" + document.all["cate2"].value
                                                              + "&dic0=" + document.all["dic0"].value
                                                              + "&dic1=" + document.all["dic1"].value
                                                              + "&dic2=" + document.all["dic2"].value
                                                              + "&dic3=" + document.all["dic3"].value
                                                              + "&dic4=" + document.all["dic4"].value
                                                              + "&dic5=" + document.all["dic5"].value
                                                              + "&dic6=" + document.all["dic6"].value
                                                              + "&dic9=" + document.all["dic9"].value
                                                              + "&keyword=" + document.all["keyword"].value
                                                              + "&typeno=" + document.all["typeno"].value
                                                              + "&orderby=" + document.all["orderby"].value
                                                              + "&wallset=" + document.all["wallset"].value
                                                              + "&party=" + document.all["party"].value
                                                              + "&select_num=" + document.all["select_num"].value
                                                              + "&ww=" + document.body.clientWidth;
    }
    parent.me_edit(1);
    
  }
  } catch(e) {}
}

function BoardList(pageElement) {
    
  select_listcount();
  document.all['erproc'].value = 0;
  ErrorCare();
  
  parent.hide("ANIPARTY_COM_WRITE");
  hide("ANIPARTY_COMMENT");
  hide("ANIPARTY_VIEW_FOOT");

  if( window.XMLHttpRequest ) {
       req = new XMLHttpRequest();
  } else if( window.ActiveXObject ) {
       req = new ActiveXObject("Microsoft.XMLHTTP"); 
  }
  
  if (!req) {
    alert( "XMLHTTP 생성 실패" );
    return false;
  }
    
  var now = new Date();
  time = now.getTime();
  
  var request = "time=" + time 
              + "&bno=" + document.all["bno"].value
              + "&pno=" + document.all["pno"].value
              + "&cate=" + document.all["cate"].value
              + "&cate2=" + document.all["cate2"].value
              + "&dic0=" + document.all["dic0"].value
              + "&dic1=" + document.all["dic1"].value
              + "&dic2=" + document.all["dic2"].value
              + "&dic3=" + document.all["dic3"].value
              + "&dic4=" + document.all["dic4"].value
              + "&dic5=" + document.all["dic5"].value
              + "&dic6=" + document.all["dic6"].value
              + "&dic9=" + document.all["dic9"].value
              + "&keyword=" + encodeURIComponent(document.all["keyword"].value)
              + "&typeno=" + document.all["typeno"].value
              + "&orderby=" + document.all["orderby"].value
              + "&wallset=" + document.all["wallset"].value
              + "&party="   + document.all["party"].value
              + "&memno="   + document.all["memno"].value
              + "&selectnum=" + document.all["select_num"].value
              + "&ww=" + parent.document.body.clientWidth;
  
  
  req.open("POST", "board/board.php", true);
  req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
  req.setRequestHeader('Content-length', request.length);

  req.onreadystatechange = function() { 
    if(req.readyState == 4) {
      if(req.status == 200) {
        document.getElementById(pageElement).innerHTML = req.responseText;
        ViewOK();
        
        // 보드를 다 불러왔다면 이젠 카테고리를 불러오자~
        CategoryList("ANIPARTY_CATE");
        //BattleMonster("ANIPARTY_BATTLE");
        hide("ANIPARTY_VIEW");
        show("ANIPARTY_MAIN");
        CoinExpRefrash();
        
      }
    }
  };
  req.send(request);
  
}


function BattleMonster(pageElement) {

  show('ANIPARTY_BATTLE');
  hide('ANIPARTY_BATTLE2');

  if( window.XMLHttpRequest ) {
       req = new XMLHttpRequest();
  } else if( window.ActiveXObject ) {
       req = new ActiveXObject("Microsoft.XMLHTTP"); 
  }
  
  if (!req) {
    alert( "XMLHTTP 생성 실패" );
    return false;
  }
    
  var now = new Date();
  time = now.getTime();
  
  var request = "time=" + time 
              + "&bno=" + document.all["bno"].value;
  
  req.open("POST", "battle/monster.php", true);
  req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
  req.setRequestHeader('Content-length', request.length);

  req.onreadystatechange = function() { 
    if(req.readyState == 4) { if(req.status == 200) { document.getElementById(pageElement).innerHTML = req.responseText; } }
  };
  req.send(request);
  
}

function CharHappyLoad(no) {

  if( window.XMLHttpRequest ) {
       req15 = new XMLHttpRequest();
  } else if( window.ActiveXObject ) {
       req15 = new ActiveXObject("Microsoft.XMLHTTP"); 
  }
  
  if (!req15) {
    alert( "XMLHTTP 생성 실패" );
    return false;
  }
    
  var now = new Date();
  time = now.getTime();
  
  var request15 = "time=" + time 
              + "&no=" + no;
              
  
  req15.open("POST", "system/happy_board.php", true);
  req15.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
  req15.setRequestHeader('Content-length', request15.length);

  req15.onreadystatechange = function() { 
    if(req15.readyState == 4) { if(req15.status == 200) { document.getElementById('ANIPARTY_HAPPY').innerHTML = req15.responseText;  } }
  };
  req15.send(request15);
  
}

function TournamentMemoLoad(no) {

  if( window.XMLHttpRequest ) {
       req15 = new XMLHttpRequest();
  } else if( window.ActiveXObject ) {
       req15 = new ActiveXObject("Microsoft.XMLHTTP"); 
  }
  
  if (!req15) {
    alert( "XMLHTTP 생성 실패" );
    return false;
  }
    
  var now = new Date();
  time = now.getTime();
  
  var request15 = "time=" + time 
              + "&no=" + no;
              
  
  req15.open("POST", "system/tournament_board.php", true);
  req15.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
  req15.setRequestHeader('Content-length', request15.length);

  req15.onreadystatechange = function() { 
    if(req15.readyState == 4) { if(req15.status == 200) { document.getElementById('ANIPARTY_TOURNAMENT').innerHTML = req15.responseText;  } }
  };
  req15.send(request15);
  
}


function BoardListBack(pageElement) {
  parent.hide("ANIPARTY_COM_WRITE");
  location.href = "#";
  parent.document.getElementById("iparty_list").contentWindow.BoardList(pageElement);     
  parent.me_edit(1);
}

function CategoryList(pageElement) {
  
  try {
    
  var images = "";
  if( window.XMLHttpRequest ) {
       req3 = new XMLHttpRequest();
  } else if( window.ActiveXObject ) {
       req3 = new ActiveXObject("Microsoft.XMLHTTP");
  }

  var htmlsave = "";
  document.getElementById(pageElement).innerHTML = htmlsave;

  if (!req3) {
    alert( "XMLHTTP 생성 실패" );
    return false;
  }
    
  var now = new Date();
  time = now.getTime();
  
  var request3 = "time=" + time
               + "&memno=" + document.all["memno"].value
               + "&bno=" + document.all["bno"].value
               + "&cate=" + document.all["cate"].value
               + "&no=" + document.all["no"].value;
  
  req3.open("POST", "board/cate.php", true);
  req3.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
  req3.setRequestHeader('Content-length', request3.length);

  req3.onreadystatechange = function() { 
    if(req3.readyState == 4) {
      if(req3.status == 200) {
        if(req3.responseText == "no") { hide("category_menu"); } 
                                 else { document.getElementById("ANIPARTY_CATE").innerHTML = req3.responseText;
                                        show("category_menu"); }

      }
    }
  };
  req3.send(request3);
  
  } catch(e) { } 
  
}


function BoardViewColl(pageElement, no) {
  document.getElementById("ANIPARTY_COMMENT").innerHTML = "";
  document.body.scrollTop = "0"; 
  document.all['no'].value = no;
  
  /*
  var request = "&time=" + time 
              + "&bno=" + document.all["bno"].value
              + "&pno=" + document.all["pno"].value
              + "&cate=" + document.all["cate"].value
              + "&cate2=" + document.all["cate2"].value
              + "&dic0=" + document.all["dic0"].value
              + "&dic1=" + document.all["dic1"].value
              + "&dic2=" + document.all["dic2"].value
              + "&dic3=" + document.all["dic3"].value
              + "&dic4=" + document.all["dic4"].value
              + "&dic5=" + document.all["dic5"].value
              + "&dic6=" + document.all["dic6"].value
              + "&dic9=" + document.all["dic9"].value
              + "&keyword=" + encodeURIComponent(document.all["keyword"].value)
              + "&typeno=" + document.all["typeno"].value
              + "&orderby=" + document.all["orderby"].value
              + "&wallset=" + document.all["wallset"].value
              + "&party="   + document.all["party"].value
              + "&memno="   + document.all["memno"].value
              + "&selectnum=" + document.all["select_num"].value;
  
  window.open("/party.php?mode=list&no=" + no + request,'iparty_view');

  */

  BoardView(pageElement);

}

function ErrorCare(no) {
  // 로딩접수
  if(document.all['erproc'].value == 0) {
   show("ANIPARTY_LOAD_TIME");
   if(document.all['ertime'].value == 15) {
     
       if( window.XMLHttpRequest ) {
            var htmlsave  = "<table border=\"0\" width=\"100%\" height=\"400\">"
                   + "<tr><td align=\"center\" valign=\"middle\">"
                     + "<table border=\"0\" width=\"401\" height=\"157\">"
                     + "<tr><td align=\"center\" valign=\"middle\" style=\"background:url('/degain/layout/loading_bg.png');\">"
                       + "<img src=\"/degain/board_loading.gif\">"
                     + "</td></tr>"
                     + "</table>"
                   + "</td></tr>"
                   + "</table>";
       } else if( window.ActiveXObject ) {
            var htmlsave  = "<table border=\"0\" width=\"100%\" height=\"400\">"
                   + "<tr><td align=\"center\" valign=\"middle\">"
                     + "<table border=\"0\" width=\"401\" height=\"157\">"
                     + "<tr><td align=\"center\" valign=\"middle\" style=\"FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=ture, sizingMethod=crop, src='/degain/layout/loading_bg.png');\">"
                       + "<img src=\"/degain/board_loading.gif\">"
                     + "</td></tr>"
                     + "</table>"
                   + "</td></tr>"
                   + "</table>";
       }
       
     if(no == 1) {        
       document.getElementById("ANIPARTY_VIEW").innerHTML = htmlsave;
     } else {
       document.getElementById("ANIPARTY_MAIN").innerHTML = htmlsave;
     }
   }
   document.all['ertime'].value = document.all['ertime'].value - 1;
   if(document.all['ertime'].value <= 0) { 
     document.all['ertime'].value = "15";
     document.all['prot'].value = "0";
     var htmlsave  = "<div style='position:relative;width:100%;left:0;top:-150;color:#666666;' align='center'>";
         htmlsave += "페이지 로드에 실패했습니다. <BR>다른메뉴를 클릭하여 페이지를 이동해 주시기 바랍니다.</div>";
   } else {
     var htmlsave  = "<div style='position:relative;width:100%;left:0;top:-150;color:#666666;' align='center'>";
         htmlsave += document.all['ertime'].value + "초 이상 응답이 없을 경우 다시 메뉴를 클릭해 주시기 바랍니다.</div>";
         setTimeout('ErrorCare();', 1000);
   }
   document.getElementById("ANIPARTY_LOAD_TIME").innerHTML = htmlsave;
  }
}

function BoardView(pageElement) {
  
  document.all['erproc'].value = 0;
  ErrorCare(1);
  
  if( window.XMLHttpRequest ) {
       req = new XMLHttpRequest();
  } else if( window.ActiveXObject ) {
       req = new ActiveXObject("Microsoft.XMLHTTP");
  }
  
  if (!req) {
    alert( "XMLHTTP 생성 실패" );
    return false;
  }
    
  var now = new Date();
  time = now.getTime();
  
  var request = "time=" + time 
              + "&bno=" + document.all["bno"].value
              + "&no=" + document.all["no"].value
              + "&dic0=" + document.all["dic0"].value
              + "&dic1=" + document.all["dic1"].value
              + "&dic2=" + document.all["dic2"].value
              + "&dic3=" + document.all["dic3"].value
              + "&dic4=" + document.all["dic4"].value
              + "&dic5=" + document.all["dic5"].value
              + "&dic6=" + document.all["dic6"].value
              + "&dic9=" + document.all["dic9"].value
              + "&cate=" + document.all["cate"].value;
  
  
  req.open("POST", "board/view.php", true);
  req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
  req.setRequestHeader('Content-length', request.length);

  req.onreadystatechange = function() { 
    if(req.readyState == 4) {
      if(req.status == 200) {
        
        // 뷰 창 띄우기
        if(req.responseText == "error") {
          document.getElementById('ANIPARTY_VIEW').innerHTML = "삭제되거나 존재하지 않는 게시물입니다";
        } else {
          document.body.scrollTop=120;
          document.getElementById('ANIPARTY_VIEW').innerHTML = req.responseText;
          // if(parent.document.all["quick_menu"]) { parent.show("ANIPARTY_COM_WRITE"); }
        }
        
        try { parent.document.all['comment_time'].value = "0"; } catch(e) { }
       
        ViewOK();
        
        // 코멘트 읽어오기
        //CategoryList("ANIPARTY_CATE");
        show("ANIPARTY_VIEW");
        hide("ANIPARTY_MAIN");
        show("ANIPARTY_VIEW_FOOT");
        
        
        parent.hide('menu_1c');
        parent.show('menu_2c');
        parent.hide('menu_3c');
        parent.hide('menu_4c');
      
        BoardFootView("ANIPARTY_VIEW_FOOT");
        
      }
    }
  };
  req.send(request);
  
}

function ViewOK() {
        document.all["prot"].value = 0;
        document.all['erproc'].value = 1;
        document.all['ertime'].value = 15;
        hide("ANIPARTY_LOAD_TIME");
}

//////////////////////////////////////////////////////////////////////////// 추천처리
function vote_process(pageElement, mainElement) {
    
  var images = "";
  if( window.XMLHttpRequest ) {
       req = new XMLHttpRequest();
       images = "background:url(\'degain/vote_loading.png\');";
  } else if( window.ActiveXObject ) {
       req = new ActiveXObject("Microsoft.XMLHTTP");
       images = "FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=ture, sizingMethod=scale, src=\'degain/vote_loading.png\');";
  }

  var htmlsave = "<div style=\"position:relative;left:-360;top:-160px;width:331;height:140;" + images + "\">";
      htmlsave += "<div style='position:absolute;left:60;top:61px;width:211;height:22;'><img src='degain/join_loading.gif' width='211' height='22'></div></div>";

  document.getElementById(pageElement).innerHTML = htmlsave;
  
  if (!req) {
    alert( "XMLHTTP 생성 실패" );
    return false;
  }
    
  var now = new Date();
  time = now.getTime();
  
  var request = "time=" + time
              + "&no=" + document.all["no"].value;
  
  req.open("POST", "board/vote.php", true);
  req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
  req.setRequestHeader('Content-length', request.length);
  
  req.onreadystatechange = function() { 
    if(req.readyState == 4) {
      if(req.status == 200) {
        document.getElementById(pageElement).innerHTML = "";
        if(req.responseText == "1") { alert("이미 추천하셨습니다."); }
        if(req.responseText == "2") { alert("추천할 수 없습니다."); }
        if(req.responseText == "3") { BoardView(mainElement); alert("추천하였습니다."); }
      }
    }
  };
  req.send(request);
  
}


//////////////////////////////////////////////////////////////////////////// 코멘트보기
function comment_process(pageElement) {
  
  var images = "";
  if( window.XMLHttpRequest ) {
       req4 = new XMLHttpRequest();
  } else if( window.ActiveXObject ) {
       req4 = new ActiveXObject("Microsoft.XMLHTTP");
  }
  
        if( window.XMLHttpRequest ) {
            var htmlsave  = "<table border=\"0\" width=\"100%\" height=\"400\">"
                   + "<tr><td align=\"center\" valign=\"middle\">"
                     + "<table border=\"0\" width=\"401\" height=\"157\">"
                     + "<tr><td align=\"center\" valign=\"middle\" style=\"background:url('/degain/layout/loading_bg.png');\">"
                       + "<img src=\"/degain/board_loading.gif\">"
                     + "</td></tr>"
                     + "</table>"
                   + "</td></tr>"
                   + "</table>";
       } else if( window.ActiveXObject ) {
            var htmlsave  = "<table border=\"0\" width=\"100%\" height=\"400\">"
                   + "<tr><td align=\"center\" valign=\"middle\">"
                     + "<table border=\"0\" width=\"401\" height=\"157\">"
                     + "<tr><td align=\"center\" valign=\"middle\" style=\"FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=ture, sizingMethod=crop, src='/degain/layout/loading_bg.png');\">"
                       + "<img src=\"/degain/board_loading.gif\">"
                     + "</td></tr>"
                     + "</table>"
                   + "</td></tr>"
                   + "</table>";
       }
  document.getElementById(pageElement).innerHTML = htmlsave;
  
  if (!req4) {
    alert( "XMLHTTP 생성 실패" );
    return false;
  }
    
  var now = new Date();
  time = now.getTime();
  
  var request4 = "time=" + time + "&mode=comment"
              + "&no=" + document.all["no"].value
              + "&cpno=" + document.all["cpno"].value
              + "&bno=" + document.all["bno"].value;
              //+ "&comment_memo=" + document.all["comment_memo"].value
              //+ "&comment_coin=" + document.all["comment_coin"].value;
  
  //document.all['comment_memo'].value='';
  
  req4.open("POST", "board/comment.php", true);
  req4.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
  req4.setRequestHeader('Content-length', request4.length);
  
  req4.onreadystatechange = function() { 
    if(req4.readyState == 4) {
      if(req4.status == 200) {
        document.getElementById(pageElement).innerHTML = req4.responseText;
        show("ANIPARTY_COMMENT");
        CoinExpRefrash();
      }
    }
  };
  req4.send(request4);
  
}



//////////////////////////////////////////////////////////////////////////// 코멘트작성
function comment_send() {
  
  var images = "";
  if( window.XMLHttpRequest ) {
       req4 = new XMLHttpRequest();
  } else if( window.ActiveXObject ) {
       req4 = new ActiveXObject("Microsoft.XMLHTTP");
  }
  
  try {
       if( window.XMLHttpRequest ) {
            var htmlsave  = "<table border=\"0\" width=\"100%\" height=\"400\">"
                   + "<tr><td align=\"center\" valign=\"middle\">"
                     + "<table border=\"0\" width=\"401\" height=\"157\">"
                     + "<tr><td align=\"center\" valign=\"middle\" style=\"background:url('/degain/layout/loading_bg.png');\">"
                       + "<img src=\"/degain/board_loading.gif\">"
                     + "</td></tr>"
                     + "</table>"
                   + "</td></tr>"
                   + "</table>";
       } else if( window.ActiveXObject ) {
            var htmlsave  = "<table border=\"0\" width=\"100%\" height=\"400\">"
                   + "<tr><td align=\"center\" valign=\"middle\">"
                     + "<table border=\"0\" width=\"401\" height=\"157\">"
                     + "<tr><td align=\"center\" valign=\"middle\" style=\"FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=ture, sizingMethod=crop, src='/degain/layout/loading_bg.png');\">"
                       + "<img src=\"/degain/board_loading.gif\">"
                     + "</td></tr>"
                     + "</table>"
                   + "</td></tr>"
                   + "</table>";
       }
       if(document.getElementById("iparty_list").contentWindow.document.all["no"].value == document.all["comment_no"].value) {
          document.getElementById("iparty_list").contentWindow.document.getElementById("ANIPARTY_COMMENT").innerHTML = htmlsave;
       }
  } catch(e) { }
  
  
  if (!req4) {
    alert( "XMLHTTP 생성 실패" );
    return false;
  }
    
  var now = new Date();
  time = now.getTime();
  var hide1 = 0;
  var hide2 = 0;
  
  if(document.all["comment_hide1"].checked == true) { hide1 = 1; }
  if(document.all["comment_hide2"].checked == true) { hide2 = 1; }
  
  var request4 = "time=" + time + "&mode=comment"
              + "&no=" + document.all["comment_no"].value
              + "&bno=" + document.all["comment_bno"].value
              + "&comment_hide1=" + hide1
              + "&comment_hide2=" + hide2
              + "&c_time=" + document.all["comment_time"].value
              + "&comment_memo=" + document.all["comment_memo"].value
              + "&comment_re=" + document.all["comment_re"].value
              + "&comment_coin=" + document.all["comment_coin"].value;
  try {
     if(document.all["comment_re"].value == "") { document.all["comment_page"].value = 1; }
     if(document.all["comment_re"].value == "0") { document.all["comment_page"].value = 1; }
     request4 += "&cpno=" + document.all["comment_page"].value;
  } catch(e) { }
              
  req4.open("POST", "/board/comment.php", true);
  req4.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
  req4.setRequestHeader('Content-length', request4.length);
  
  req4.onreadystatechange = function() { 
    if(req4.readyState == 4 && req4.status == 200) {
      try {
          if(document.all["comment_re"].value > 0) {
              document.getElementById("iparty_list").contentWindow.document.location.href = "party.php?mode=list&bno=" + document.all["comment_bno"].value + "&no=" + document.all["comment_no"].value;
          } else {
              document.getElementById("iparty_list").contentWindow.document.getElementById("ANIPARTY_COMMENT").innerHTML = req4.responseText;
          }
      } catch(e) {
          try {
              document.getElementById("ibook").contentWindow.document.location.reload();
          } catch(e) {
              
          }
      }

      try {
          CoinExpRefrash();
      } catch(e) {}
    }
  };
  
  req4.send(request4);
  
}

/////////////////////////////////////////////////////////////////////////////
function BoardReturn() {
   if(document.getElementById('ANIPARTY_MAIN').innerHTML == "") {
     BoardList("ANIPARTY_MAIN");
   }
   hide('ANIPARTY_VIEW');
   hide('ANIPARTY_VIEW_FOOT');
   hide('ANIPARTY_COMMENT');
   show('ANIPARTY_MAIN');
   document.body.scrollTop=120;
}

function BoardFootView(pageElement) {
  
  var images = "";
  if( window.XMLHttpRequest ) {
       req5 = new XMLHttpRequest();
  } else if( window.ActiveXObject ) {
       req5 = new ActiveXObject("Microsoft.XMLHTTP"); 
  }

  document.getElementById(pageElement).innerHTML = "";
  
  
  if (!req5) {
    alert( "XMLHTTP 생성 실패" );
    return false;
  }
    
  var now = new Date();
  time = now.getTime();
  
  var request5 = "time=" + time 
               + "&bno=" + document.all["bno"].value
               + "&no=" + document.all["no"].value
               + "&memno=" + document.all["memno"].value
               + "&cate=" + document.all["cate"].value;
  
  
  req5.open("POST", "board/view_foot.php", true);
  req5.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
  req5.setRequestHeader('Content-length', request5.length);

  req5.onreadystatechange = function() { 
    if(req5.readyState == 4) {
      if(req5.status == 200) {
        document.getElementById(pageElement).innerHTML = req5.responseText;
        document.all["cpno"].value = "1";
        comment_process("ANIPARTY_COMMENT");
      }
    }
  };
  req5.send(request5);
  
}





////////////////////////////////////////////////////////////////// BoardHeadView

////////////////////////////////////////////////////////////////////////

function CoinExpRefrash() {
  
  try {
    
  if( window.XMLHttpRequest ) {
       req8 = new XMLHttpRequest();
  } else if( window.ActiveXObject ) {
       req8 = new ActiveXObject("Microsoft.XMLHTTP");
  }

  if (!req8) {
    alert( "XMLHTTP 생성 실패" );
    return false;
  }
    
  var now = new Date();
  time = now.getTime();
  
  var request8 = "time=" + time;
  
  
  req8.open("POST", "/redata.php", true);
  req8.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
  req8.setRequestHeader('Content-length', request8.length);

  req8.onreadystatechange = function() { 
    if(req8.readyState == 4) {
      if(req8.status == 200) { 
        
        var chatdata = req8.responseText;
        var data = chatdata.split("#");
        
        try {
    
        if(parent.document.getElementById("coin_value").innerHTML != data[0])  { parent.document.getElementById("coin_value").innerHTML = data[0]; }
        if(parent.document.getElementById("exp_value").innerHTML != data[1])   { parent.document.getElementById("exp_value").innerHTML = data[1];  }
        if(parent.document.getElementById("exp_prog").style.width != data[2]) { parent.document.getElementById("exp_prog").style.width = data[2]; }

        if("/degain/icon/admin_5.gif" == data[3])   {
           alert("로그아웃되었습니다."); 
           parent.document.location.href = "index.php"; 
        } else {
           if(parent.document.getElementById("mem_level_icon").src != data[3])   { 
             parent.document.getElementById("mem_level_icon").src = data[3]; 
             alert("레벨이 조정되었습니다.");
           }
        }
        
        } catch(e) {
    
        if(opener.document.getElementById("coin_value").innerHTML != data[0])  { opener.document.getElementById("coin_value").innerHTML = data[0]; }
        if(opener.document.getElementById("exp_value").innerHTML != data[1])   { opener.document.getElementById("exp_value").innerHTML = data[1];  }
        if(opener.document.getElementById("exp_prog").style.width != data[2]) { opener.document.getElementById("exp_prog").style.width = data[2]; }

        if("/degain/icon/admin_5.gif" == data[3])   {
           alert("로그아웃되었습니다."); 
           opener.document.location.href = "index.php"; 
        } else {
           if(opener.document.getElementById("mem_level_icon").src != data[3])   { 
             opener.document.getElementById("mem_level_icon").src = data[3]; 
             alert("레벨이 조정되었습니다.");
           }
        }
        
        }
        
      } 
    }
  };
  req8.send(request8);
  
  } catch(e) { }
}

////////////////////////////////////////////////////////////////////////

function MsgBoardList() {
  document.getElementById('imsg').src = "/system/msg_board.php?mno=" + document.all['mno'].value;
}

function MsgBoardList2() {
  document.getElementById('imsg').src = "/system/msg_board2.php?mno=" + document.all['mno'].value;
}


////////////////////////////////////////////////////////////////////////

function CommentBoardList(option) {
  
  try {
    
  show('ANIPARTY_COMC');
  show('comment_check_board');
  show('comment_check_board_x');
  
  if( window.XMLHttpRequest ) { req = new XMLHttpRequest(); }
  else if( window.ActiveXObject ) { req = new ActiveXObject("Microsoft.XMLHTTP"); }
  if (!req) {  alert( "XMLHTTP 생성 실패" ); return false; }
    
  var now = new Date();  time = now.getTime();
  var request = "time=" + time +
                "&del=" + option;
  
  req.open("POST", "system/comment_board.php", true);
  req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
  req.setRequestHeader('Content-length', request.length);

  req.onreadystatechange = function() { 
    if(req.readyState == 4 && req.status == 200) { 
        document.getElementById("ANIPARTY_COMC").innerHTML = req.responseText;
    }
  };
  req.send(request);
  
  } catch(e) { }
  
}

////////////////////////////////////////////////////////////////////////////////
var NewsSave;
function NewsCheck() {
  
  if( window.XMLHttpRequest ) { req = new XMLHttpRequest(); }
  else if( window.ActiveXObject ) { req = new ActiveXObject("Microsoft.XMLHTTP"); }
  if (!req) {  alert( "XMLHTTP 생성 실패" ); return false; }
    
  var now = new Date();  time = now.getTime();
  var request = "time=" + time;
  
  req.open("POST", "dat/new.php", true);
  req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
  req.setRequestHeader('Content-length', request.length);

  req.onreadystatechange = function() { 
    if(req.readyState == 4 && req.status == 200) {

        var str = req.responseText;
        var linedata = str.split("/t&%");
        var i = 1;
        var chatdata;
        var bhtml;
        
			  for(i=0;i<=3;i++) {
			    
          chatdata = linedata[i].split("/t#@");
          chatdata[5] = chatdata[5].replace(/\\/g,'');
          
               if(chatdata[1] == "0") { chatdata[1] = "/degain/icon/x.gif"; }
          else if(chatdata[1] == "1") { chatdata[1] = "/degain/icon/f.gif"; }
          else if(chatdata[1] == "2") { chatdata[1] = "/degain/icon/e.gif"; }
          else if(chatdata[1] == "3") { chatdata[1] = "/degain/icon/d.gif"; }
          else if(chatdata[1] == "4") { chatdata[1] = "/degain/icon/c.gif"; }
          else if(chatdata[1] == "5") { chatdata[1] = "/degain/icon/b.gif"; }
          else if(chatdata[1] == "6") { chatdata[1] = "/degain/icon/a.gif"; }
          else if(chatdata[1] == "7") { chatdata[1] = "/degain/icon/9.gif"; }
          else if(chatdata[1] == "8") { chatdata[1] = "/degain/icon/8.gif"; }
          else if(chatdata[1] == "9") { chatdata[1] = "/degain/icon/7.gif"; }
          else if(chatdata[1] == "10") { chatdata[1] = "/degain/icon/6.gif"; }
          else if(chatdata[1] == "11") { chatdata[1] = "/degain/icon/5.gif"; }
          else if(chatdata[1] == "12") { chatdata[1] = "/degain/icon/4.gif"; }
          else if(chatdata[1] == "13") { chatdata[1] = "/degain/icon/3.gif"; }
          else if(chatdata[1] == "14") { chatdata[1] = "/degain/icon/2.gif"; }
          else if(chatdata[1] == "15") { chatdata[1] = "/degain/icon/1.gif"; }
          else if(chatdata[1] == "100") { chatdata[1] = "/degain/icon/admin_4.gif"; }
          else if(chatdata[1] == "101") { chatdata[1] = "/degain/icon/admin_3.gif"; }
          else if(chatdata[1] == "102") { chatdata[1] = "/degain/icon/admin_2.gif"; }
          else if(chatdata[1] == "103") { chatdata[1] = "/degain/icon/admin_1.gif"; }
          
               if(chatdata[4] == "0") { chatdata[4] = "/degain/icon/x.gif"; }
          else if(chatdata[4] == "1") { chatdata[4] = "/degain/icon/f.gif"; }
          else if(chatdata[4] == "2") { chatdata[4] = "/degain/icon/e.gif"; }
          else if(chatdata[4] == "3") { chatdata[4] = "/degain/icon/d.gif"; }
          else if(chatdata[4] == "4") { chatdata[4] = "/degain/icon/c.gif"; }
          else if(chatdata[4] == "5") { chatdata[4] = "/degain/icon/b.gif"; }
          else if(chatdata[4] == "6") { chatdata[4] = "/degain/icon/a.gif"; }
          else if(chatdata[4] == "7") { chatdata[4] = "/degain/icon/9.gif"; }
          else if(chatdata[4] == "8") { chatdata[4] = "/degain/icon/8.gif"; }
          else if(chatdata[4] == "9") { chatdata[4] = "/degain/icon/7.gif"; }
          else if(chatdata[4] == "10") { chatdata[4] = "/degain/icon/6.gif"; }
          else if(chatdata[4] == "11") { chatdata[4] = "/degain/icon/5.gif"; }
          else if(chatdata[4] == "12") { chatdata[4] = "/degain/icon/4.gif"; }
          else if(chatdata[4] == "13") { chatdata[4] = "/degain/icon/3.gif"; }
          else if(chatdata[4] == "14") { chatdata[4] = "/degain/icon/2.gif"; }
          else if(chatdata[4] == "15") { chatdata[4] = "/degain/icon/1.gif"; }
          else if(chatdata[4] == "100") { chatdata[4] = "/degain/icon/admin_4.gif"; }
          else if(chatdata[4] == "101") { chatdata[4] = "/degain/icon/admin_3.gif"; }
          else if(chatdata[4] == "102") { chatdata[4] = "/degain/icon/admin_2.gif"; }
          else if(chatdata[4] == "103") { chatdata[4] = "/degain/icon/admin_1.gif"; }
          
          if(document.getElementById("new_comment" + i).innerHTML == '') {
            document.getElementById("new_name" + i).innerHTML    = "<IMG src='" + chatdata[1] + "' align=absMiddle> " + chatdata[3];
            document.getElementById("new_comment" + i).innerHTML = "<IMG src='" + chatdata[4] + "' align=absMiddle> [" + chatdata[2] + "] " + chatdata[5] + "</FONT>";
            if(i == 0) {
              document.getElementById("news_mini").value           = chatdata[5];
            }
          } else {
            if(i == 0) {
              if(document.getElementById("news_mini").value != chatdata[5]) {  show('news_mini_box');
                 document.getElementById("news_mini_label").innerHTML    = "<IMG src='" + chatdata[1] + "' align=absMiddle> " + chatdata[3] + " :: " + "<IMG src='" + chatdata[4] + "' align=absMiddle> [" + chatdata[2] + "] " + chatdata[5] + "</FONT>";
              }
              document.getElementById("news_mini").value           = chatdata[5];
            }
            document.getElementById("new_name" + i).innerHTML    = "<IMG src='" + chatdata[1] + "' align=absMiddle> " + chatdata[3];
            document.getElementById("new_comment" + i).innerHTML = "<IMG src='" + chatdata[4] + "' align=absMiddle> [" + chatdata[2] + "] " + chatdata[5] + "</FONT>";
          }
          
          
        }
        
        chatdata = linedata[4].split("/t#@");
        
        if(chatdata[2] > 0) { 
           show('pop_daycheck'); 
           try { document.getElementById( 'ivoice' ).src = "/voice/voice.php?se=" + document.all['mem_se'].value + "&no=3"; } catch(e) {}
           
        } else { hide('pop_daycheck'); }
                
        try { document.all["ANIPARTY_ONAIR"].innerHTML = chatdata[3]; } catch(e) {}
        
        if(parseInt(chatdata[0]) > 0) {
           try {
           document.getElementById("msg_pop_label").innerHTML = chatdata[0]; 
           show('msg_pop');
           hide('comment_check_pop');
           document.getElementById( 'ivoice' ).src = "/voice/voice.php?se=" + document.all['mem_se'].value + "&no=1"; } catch(e) {}
        } else {
           if(parseInt(chatdata[1]) > 0) {
             try {
             document.getElementById("comment_pop_label").innerHTML = chatdata[1]; 
             show('comment_check_pop'); 
             document.getElementById( 'ivoice' ).src = "/voice/voice.php?se=" + document.all['mem_se'].value + "&no=2"; } catch(e) {}
             hide('msg_pop'); 
           }
        }
        document.getElementById("online_count_label").innerHTML = chatdata[4] + "명 접속중";
        if(chatdata[5] == "0" || chatdata[5] == "") {
           location.href = "/";
        }
        if(chatdata[5] == "error") {
           location.href = "/error.php";
        }
        if(chatdata[6]) {
           document.all['mktime'].value = chatdata[6]; 
           document.all['mktime2'].value = "";
        }
        
    }
  };
  req.send(request);
  
}
////////////////////////////////////////////////////////////////////////

function OnlineList(view_no) {
    
  try {
  if(view_no == 1) { hide('online_friendboard');hide('online_friendboards');show('online_menu_1c');hide('online_menu_2c');hide('online_menu_3c');hide('online_menu_4c');show('mem_online_1');hide('mem_online_2');hide('mem_online_3');hide('mem_online_4'); }
  if(view_no == 2) { hide('online_friendboard');hide('online_friendboards');hide('online_menu_1c');show('online_menu_2c');hide('online_menu_3c');hide('online_menu_4c');hide('mem_online_1');show('mem_online_2');hide('mem_online_3');hide('mem_online_4'); }
  if(view_no == 3) { show('online_friendboard');show('online_friendboards');hide('online_menu_1c');hide('online_menu_2c');show('online_menu_3c');hide('online_menu_4c');hide('mem_online_1');hide('mem_online_2');show('mem_online_3');hide('mem_online_4'); }
  if(view_no == 4) { hide('online_friendboard');hide('online_friendboards');hide('online_menu_1c');hide('online_menu_2c');hide('online_menu_3c');show('online_menu_4c');hide('mem_online_1');hide('mem_online_2');hide('mem_online_3');show('mem_online_4'); }
  
    
  if( window.XMLHttpRequest ) { req = new XMLHttpRequest(); }
  else if( window.ActiveXObject ) { req = new ActiveXObject("Microsoft.XMLHTTP"); }
  if (!req) {  alert( "XMLHTTP 생성 실패" ); return false; }
    
  var now = new Date();  time = now.getTime();
  var request = "time=" + time +
                "&no=" + view_no;
  
  req.open("POST", "system/online.php", true);
  req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
  req.setRequestHeader('Content-length', request.length);

  req.onreadystatechange = function() { 
    if(req.readyState == 4 && req.status == 200) { 
        document.getElementById("online_data_" + view_no).innerHTML = req.responseText;
    }
  };
  req.send(request);
  
  } catch(e) { }
  
}


////////////////////////////////////////////////////////////////////////

function friend_text(options) {
    
  try {
        
  if( window.XMLHttpRequest ) { req = new XMLHttpRequest(); }
  else if( window.ActiveXObject ) { req = new ActiveXObject("Microsoft.XMLHTTP"); }
  if (!req) {  alert( "XMLHTTP 생성 실패" ); return false; }
    
  var now = new Date();  time = now.getTime();
  var request = "time=" + time +
                "&keyword=" + encodeURIComponent(document.all['friend_text'].value) +
                "&no=" + options;
                
  document.all['friend_text'].value = "";
  
  req.open("POST", "system/friend.php", true);
  req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
  req.setRequestHeader('Content-length', request.length);

  req.onreadystatechange = function() { 
    if(req.readyState == 4 && req.status == 200) { 
       if(req.responseText == "ok" && options == 1) { alert("친구 등록 완료 되었습니다."); }
       if(req.responseText == "error1" && options == 1) { alert("이미 있는 친구 입니다."); }
       if(req.responseText == "error2" && options == 1) { alert("존재하지 않는 친구 입니다."); }
       if(req.responseText == "error3" && options == 1) { alert("친구가 없습니까? 자신을 왜 등록하나요?"); }
       if(req.responseText == "ok" && options == 2) { alert("친구 삭제 완료 되었습니다."); }
       if(req.responseText == "error1" && options == 2) { alert("등록되어 있지 않은 친구 입니다."); }
       if(req.responseText == "error2" && options == 2) { alert("존재하지 않는 친구 입니다."); }
       
       OnlineList(3);
    }
  };
  req.send(request);
   
  } catch(e) { }
  
}

function Comment_RE(exp, coin, max, no, bno, subject, option) {
  try {
    document.getElementById('comment_subject').innerHTML=subject;
    document.getElementById('exp_comment').innerHTML=exp;
    document.getElementById('coin_comment').innerHTML=coin;
    document.getElementById('max_comment').innerHTML=max;;
    document.all['comment_bno'].value=bno;
    document.all['comment_memo'].value='';
    document.all['comment_re'].value='0';
    document.all['comment_coin'].value='3';
    document.all['comment_hide1'].checked=false;
    document.all['comment_hide2'].checked=false;
    document.all['comment_check'][1].checked=true;
    document.all['comment_no'].value=no;
    document.all['comment_page'].value='1';
    if(option == "0") {
    show('ANIPARTY_COM_WRITE');
    }
  } catch(e) {
    //alert("코멘트를 작성할 수 없습니다.");
  }
}
function Comment_RE2(exp, coin, max, no, bno, subject, option, re, page) {
  try {
    document.getElementById('comment_subject').innerHTML=subject;
    document.getElementById('exp_comment').innerHTML=exp;
    document.getElementById('coin_comment').innerHTML=coin;
    document.getElementById('max_comment').innerHTML=max;
    document.all['comment_bno'].value=bno;
    document.all['comment_memo'].value='';
    document.all['comment_coin'].value='3';
    document.all['comment_re'].value=re;
    document.all['comment_hide1'].checked=false;
    document.all['comment_hide2'].checked=false;
    document.all['comment_check'][1].checked=true;
    document.all['comment_no'].value=no;
    document.all['comment_page'].value=page;
    if(option == "0") {
    show('ANIPARTY_COM_WRITE');
    }
  } catch(e) {
    //alert("코멘트를 작성할 수 없습니다.");
  }
}


////////////////////////////////////////////////////////////////////////

function ChatSend() {
  
  if( document.all['c_comment'].value != "" ) {
  if( window.XMLHttpRequest ) { req = new XMLHttpRequest(); }
  else if( window.ActiveXObject ) { req = new ActiveXObject("Microsoft.XMLHTTP"); }
  if (!req) {  alert( "XMLHTTP 생성 실패" ); return false; }
  
  ajaxchatstate = 2;
    
  var now = new Date();  
  time = now.getTime();
  var request = "time=" + time +
                "&c_name=" + document.all['c_name'].value +
                "&c_no=" + document.all['c_no'].value +
                "&c_comment=" + document.all['c_comment'].value +
                "&c_color=" + document.all['c_color'].value +
                "&c_level=" + document.all['c_level'].value +
                "&c_se=" + document.all['c_se'].value;
  
  document.all['c_comment'].value= "";
  
  req.open("POST", "reg.php", true);
  req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
  req.setRequestHeader('Content-length', request.length);

  req.onreadystatechange = function() { 
    if(req.readyState == 4 && req.status == 200) { ChatLoad(); ajaxchatstate = 1; }
  };
  req.send(request);
  }
  
}


function MsgIdSend() {
  
  if( window.XMLHttpRequest ) { req = new XMLHttpRequest(); }
  else if( window.ActiveXObject ) { req = new ActiveXObject("Microsoft.XMLHTTP"); }
  if (!req) {  alert( "XMLHTTP 생성 실패" ); return false; }
  
  var now = new Date();  
  time = now.getTime();
  var request = "time=" + time +
                "&id=" + document.all['msg_send_id'].value;
  
  req.open("POST", "system/msg_id.php", true);
  req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
  req.setRequestHeader('Content-length', request.length);

  
  req.onreadystatechange = function() { 
    if(req.readyState == 4 && req.status == 200) {
       if(req.responseText == "error1") {
          alert("없는 아이디나 닉네임입니다."); 
       } else {
          window.open('system/msg_send.php?no=' + req.responseText,'_blank','screenX=0,screenY=0,width=500,height=272,resizable=no,scrollbars=no,scrolling=no');
       }
    }
  };
  req.send(request);
  
}

