var item_sort = null;
var page	  = 1;

function set_sort(sort, no)
{
	this.item_sort = sort;
	this.page = 1;
	get_chart(no);
}

// Á¡¼ö¾÷µ¥ÀÌÆ®
// item_no > dno ÀÓ (2008.09 °³Æí ºÎÅÍ) no, dic_no´Â ÀÇ¹Ì ¾ø´Â °ªÀÓ
function add_point(item_no, point, no, dic_no, isReload, item_title)
{
	
	if (point == 99) {


		if (confirm(item_title + "\nÀÌ ¾ÆÀÌÅÛÀ» ¿ÏÀü ½ÈÀº ¾ÆÀÌÅÛÀ¸·Î µî·ÏÇÏ°Ú½À´Ï±î?")) {
			
			// pass
			
		} else {

			return;
		}
	}

	// Å×½ºÆ®ÇÑ °ªÀÌ ¾øÀ¸¸é ¸øÇÔ
	var tribe_no = idscfg['USER_TRIBE_NO'];
	if (tribe_no == "" || tribe_no =='0')
	{
		alert('ÃëÇâ Å×½ºÆ®¸¦ ¸ÕÀú ÇØÁÖ¼¼¿ä.');
		return;
	}

	var scTop = 0;
	try {
		scTop = document.body.scrollTop;
	} catch(e) {}


	new Ajax.Request('/chart/update_point.php', {
		method: 'POST',
		parameters: 'dno=' + item_no + '&point=' + point + '&chart_no=' + no + '&dic_no' + dic_no + '&scTop=' + scTop,
		onSuccess: function(transport) {
			var result = transport.responseText;			
			
			if (result == 'ok') {

				//get_chart(no);
				alert('Æò°¡Çß½À´Ï´Ù.');

				if ( isReload ) {

					location.href = location.href + '&scrollTop=' + scTop;
				}

			} else if (result == 'notribe') {

				alert('¼³Á¤µÈ ÃëÇâ Á¤º¸°¡ ¾ø½À´Ï´Ù.');
			} else if (result == 'tribe_not') {

				alert('°°Àº ÃëÇâ¸¸ Æò°¡°¡ °¡´ÉÇÕ´Ï´Ù.');
			} else if (result == 'exist') {

				if (point == 99)
					alert('ÀÌ¹Ì ¿ÏÀü ½ÈÀº ¾ÆÀÌÅÛÀ¸·Î µî·ÏµÅ ÀÖ½À´Ï´Ù.'); //¿ÏÀü ½È¾î
				else
					alert('ÀÌ¹Ì Æò°¡ÇÏ½Å ¾ÆÀÌÅÛÀÔ´Ï´Ù.');
			} else if (result == 'mine') {
				alert('Á÷Á¢ µî·ÏÇÏ½Å ¾ÆÀÌÅÛÀº ÃßÃµÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.');
			} else if (result == 'limit') {

				alert('´õÀÌ»ó Æò°¡ ÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.');
			} else if (result == 'dno') {

				alert('¾ÆÀÌÅÛ °íÀ¯¹øÈ£°¡ ¾ø½À´Ï´Ù.');
			} else {

				alert('¾÷µ¥ÀÌÆ®¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù');
			}
		}
	});
}



function get_user_info(no)
{
	parent.location.href='/chart/user_detail.php?no=' + no;
}

function pop_edit_chart(no, tribe_no)
{
	var obj;
	obj = open("/chart/pop_edit_chart.php?no="+no+"&tribe_no="+tribe_no, "popwin4", "width=460,height=300,scrollbars=0");
}

