

	function commentList() {
	
				var boardcode		= comment.boardcode.value;
				var boardidx		= comment.boardidx.value;
				var bstar			= comment.bstar.value;
				var category		= comment.category.value;
				var bBlind			= comment.bBlind.value;
			
				
				new Ajax.Request("/bbs/comment_list.php", {
					asynchronous: true,
					method: "get",
					parameters: "?a=1&boardcode="+boardcode+"&boardidx="+boardidx+"&bstar="+bstar+"&category="+category+"&bBlind="+bBlind,
					onSuccess: function(request) {
						$("list_comment").innerHTML = request.responseText;
					}
					,	
					onFailure: function(request) {
						alert('error');
					}
				});
	}

	function delComment(com_idx,category) {
				var parent_type = $("boardidx").value;
				new Ajax.Request("/bbs/comment_delete.php", {
					parameters: "?a=1&com_idx="+com_idx+"&category="+category,
					asynchronous: true,
					method: "get",
					onSuccess: function(request) {
						CommentSuccess("D",request.responseText);
					},	
					onFailure: function(request) {
						alert('Error : ÁË¼ÛÇÕ´Ï´Ù. ');
					}
				});
	}

	
	function inComment(){	
		 var comform = document.comment; 
		  if (comform.re_content.value == "")
		  {
			alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä");
			//comform.re_content.focus(); 
		  }
		  else if (comform.re_content.length  >200 )
		  {
			alert("³»¿ëÀº 200ÀÚÀÌ»ó ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
			//comform.re_content.focus(); 
		  }  
		else{
				var params = Form.serialize($(comment));

				new Ajax.Request("/bbs/comment_add.php", {
					asynchronous: true,
					method: "post",					
					postBody : params,
					onSuccess: function(request) {
						
						CommentSuccess("W",request.responseText);
						comform.re_content.value="";
					},	
					onFailure: function(request) {
						alert('Error : ÁË¼ÛÇÕ´Ï´Ù. ');
					}
				});
						
		}
					
	}
	

	function CommentSuccess(flag,meg){
		//alert(flag+meg);
		if( meg == "NOTLOGIN" ){
			alert("·Î±×ÀÎ ÈÄ ÀÌ¿ëÇØÁÖ¼¼¿ä.");
		}	
		else if(flag =="D" && meg == "NOTWRITER"){
			alert("º»ÀÎÀÌ ÀÛ¼ºÇÑ ±Û¸¸ »èÁ¦ÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		}
		else{
			commentList();
		}			
	
	}



