function list_comment(type, id_str, page){
	if(type != '' && id_str != '' && page != ''){
		var req = new Subsys_JsHttpRequest_Js();
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				var div = document.getElementById("comt");
				var div2 = document.getElementById("comtview");
				div.innerHTML = req.responseJS.content; 
				div2.innerHTML = req.responseJS.view;
			}
		}
		req.caching = false;
		file = './ajax/list_comment.php';
		req.open('GET', file, true);
		req.send({ type: type, page: page, id_str: id_str });
	}
}
function add_comment(type, id_str){
	var comment = document.getElementById('comment').value;
	if(comment != ''){
		var req = new Subsys_JsHttpRequest_Js();
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				if(req.responseJS.content == 'ok'){
					document.getElementById("comment").value = '';
					list_comment(type, id_str, '1');
				}
			}
		}
		req.caching = false;
		file = './ajax/add_comment.php';
		req.open('POST', file, true);
		req.send({ type: type, comment: comment, id_str: id_str });
	}
}
function del_comment(type, id_str, page, id){
	if(type != '' && id_str != '' && page != '' && id != ''){
		var req = new Subsys_JsHttpRequest_Js();
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				list_comment(type, id_str, page);
			}
		}
		req.caching = false;
		file = './ajax/del_comment.php';
		req.open('POST', file, true);
		req.send({ type: type, id: id });
	}
}
