/**
*
*/
function rate(id)
{
}
/**
*
*/
function cmt(id)
{
}
/**
*
*/
function share(id)
{
}
/**
*
*/
function fetchCmt(id, ctype, isFetchAll, isAlwaysFetchAll)
{
	if( !isFetchAll )
	{
		isFetchAll = 0;
	}
	if( !isAlwaysFetchAll )
	{
		isAlwaysFetchAll = 0;
	}

	var url = "http://" + location.host + "/ajax/comment.php?secret=" + secret + "&act=list&id=" + id + "&ctype=" + ctype + "&all=" + isFetchAll + "&aall=" + isAlwaysFetchAll;
	$.get(url, null, function(data){
		$("#cmt-list-" + id).html(data);
		$("#cmt-msg-" + id).focus();

		$("div").find("img.ifn").hover(
			function(){
				$(this).css("opacity","1.0");
				$(this).css("alpha",  "alpha(opacity=100)");
			}, 
			function(){
				$(this).css("opacity","0.4");
				$(this).css("alpha",  "alpha(opacity=40)");
			}
		);

	});
	// refreshUpdates(who);
}
/**
*
*/
function delCmt(cmtid, id, ctype, isFetchAll, isAlwaysFetchAll)
{
	if( !isFetchAll )
	{
		isFetchAll = 0;
	}
	if( !isAlwaysFetchAll )
	{
		isAlwaysFetchAll = 0;
	}
	
	if(confirm("ท่านต้องการลบเม้นท์นี้จริงๆเหรอ ?\n(ลบแล้วจะกู้คืนไม่ได้)"))
	{
		var url = "http://" + location.host + "/ajax/comment.php?secret=" + secret + "&act=delete&cmtid=" + cmtid + "&id=" + id + "&ctype=" + ctype;

		$.get(url, null, function(res){
			if(res == 'true')
			{
				fetchCmt(id, ctype, isFetchAll, isAlwaysFetchAll);
			}
			else
			{
				alert("เกิดข้อผิดพลาดบางประการขณะทำการลบข้อมูล กรุณา reload หน้านี้ให่ แล้วลองอีกทีค่ะ ... \nข้อมูลทางด้านเทคนิคเกี่ยวกับข้อผิดพลาด : " + res + "");
			}
		});
	}
	return false;
}
