function comment_more() {
	
	var obj_id = $('#js_cm_objid').attr('value');
	var en = $('#js_cm_en').attr('value');
	var c_count = $('#js_cm_count').attr('value');
	var c_cur = $('#js_cm_count_cur').attr('value');
	var c_cur_desc = $('#js_cm_count_cur_desc').attr('value');
	
	$.ajax({
		type: "POST",
		url: "/ajax/comment_more.php",
		data: 'edit[obj_id]=' + obj_id 
		+ '&edit[en]=' + en
		+ '&edit[c_count]=' + c_count
		+ '&edit[c_cur]=' + c_cur
		+ '&edit[c_cur_desc]=' + c_cur_desc,
		success: function(msg){
			$('#comment_base').append(msg);
			if ( (c_cur < c_count) & ((c_count - c_cur) >= en) ) {
				c_cur_new = parseInt(c_cur) + parseInt(en);
				c_cur_new_desc = parseInt(c_cur_desc) - parseInt(en);
				$('#js_cm_count_cur').attr('value', c_cur_new); 
				$('#js_cm_count_cur_desc').attr('value', c_cur_new_desc); 
			}
			if ( (c_cur < c_count) & ((c_count - c_cur) < en) ) {
				c_cur_new = parseInt(c_cur) + parseInt(en);
				c_cur_new_desc = parseInt(c_cur_desc) - parseInt(en);
				en_new = parseInt(en) - (parseInt(c_count) - parseInt(c_cur));
				$('#js_cm_en').attr('value', en_new); 
				$('#js_cm_count_cur').attr('value', c_cur_new); 
				$('#js_cm_count_cur_desc').attr('value', c_cur_new_desc); 
			}
			if ( c_cur >= c_count) {
				$('#comment_more').html('');
			}
		}
	});	
}

function comment_preview() {
	$.ajax({
		type: "POST",
		url: "/ajax/comment_preview.php",
		data: 'edit[comment1]=' + $('#js_comment1').attr('value'),
		success: function(msg){
			$('#comment_preview').html(msg);
		}
	});	
}

function comment_preview2() {
	$.ajax({
		type: "POST",
		url: "/ajax/comment_preview.php",
		data: 'edit[comment1]=' + $('#js_comment2').attr('value'),
		success: function(msg){
			$('#comment_preview2').html(msg);
		}
	});	
}

function comment_add() {
	$.ajax({
		type: "POST",
		url: "/ajax/comment_add.php",
		data: 'edit[comment1]=' + $('#js_comment1').attr('value')
			   + '&edit[tname1]=' + $('#js_tname1').attr('value')
			   + '&edit[objid1]=' + $('#js_objid1').attr('value'),
		success: function(msg){
			if (msg != 'error') {
				$('#comment_add').prepend(msg);
				$('#comment_preview').html("");
				$('#js_comment1').attr('value', ''); 
			}
		}
	});	
}

function comment_add2() {
	$.ajax({
		type: "POST",
		url: "/ajax/comment_add.php",
		data: 'edit[comment1]=' + $('#js_comment2').attr('value')
			   + '&edit[tname1]=' + $('#js_tname1').attr('value')
			   + '&edit[objid1]=' + $('#js_objid1').attr('value'),
		success: function(msg){
			if (msg != 'error') {
				$('#comment_add2').prepend(msg);
				$('#comment_preview2').html("");
				$('#js_comment2').attr('value', ''); 
			}
		}
	});	
}

function city_comment_add() {
	$.ajax({
		type: "POST",
		url: "/ajax/city_comment_add.php",
		data: 'edit[comment1]=' + $('#js_comment1').attr('value')
			   + '&edit[tname1]=' + $('#js_tname1').attr('value')
			   + '&edit[objid1]=' + $('#js_objid1').attr('value'),
		success: function(msg){
			if (msg != 'error') {
				$('#comment_add').prepend(msg);
				$('#comment_preview').html("");
				$('#js_comment1').attr('value', ''); 
			}
		}
	});	
}

function city_comment_add2() {
	$.ajax({
		type: "POST",
		url: "/ajax/city_comment_add.php",
		data: 'edit[comment1]=' + $('#js_comment2').attr('value')
			   + '&edit[tname1]=' + $('#js_tname1').attr('value')
			   + '&edit[objid1]=' + $('#js_objid1').attr('value'),
		success: function(msg){
			if (msg != 'error') {
				$('#comment_add2').prepend(msg);
				$('#comment_preview2').html("");
				$('#js_comment2').attr('value', ''); 
			}
		}
	});	
}

function photo_comment_add() {
	$.ajax({
		type: "POST",
		url: "/ajax/photo_comment_add.php",
		data: 'edit[comment1]=' + $('#js_comment1').attr('value')
			   + '&edit[tname1]=' + $('#js_tname1').attr('value')
			   + '&edit[objid1]=' + $('#js_objid1').attr('value'),
		success: function(msg){
			if (msg != 'error') {
				$('#comment_add').prepend(msg);
				$('#comment_preview').html("");
				$('#js_comment1').attr('value', ''); 
			}
		}
	});	
}