function show_profile()
{
	$.getJSON
	(
		path_yume + "apis/profile_box/" + username + "/?jsoncallback=?",
		function(data)
		{
			var result = data.result;
			if (result)
			{
				$("#spanProfile").html(result);
			}
		}
	);
}
function show_boxmusicsong()
{
	if( document.getElementById("mypage_boxmusicsong").innerHTML == '' )
	{	
		$.getJSON
		(
			MUSIC_HOST + "apis/getnewsongmypage/"+username+"/5/?jsoncallback=?",
			function(data)
			{
				var result = data.html;
				$("#mypage_boxmusicsong").html(result);
			}
		);
	}
}
function show_boxvideo()
{	
	if( document.getElementById("mypage_boxvideo").innerHTML == '' )
	{
		$.getJSON
		(
			VIDEO_HOST + "apis/getmypagevideomember/"+username+"/6/blog/?jsoncallback=?",
			function(data)
			{
				var result = data.html;
				$("#mypage_boxvideo").html(result);
			}
		);
	}
}
function show_boxphoto()
{
	if( document.getElementById("mypage_boxphoto").innerHTML == '' )
	{
		$.getJSON
		(
			PHOTO_HOST + "apis/getnewphotomypage/"+username+"/9/blog/?jsoncallback=?",
			function(data)
			{
				var result = data.html;
				$("#mypage_boxphoto").html(result);
			}
		);
	}
}
function show_boxblogfriend(path_yume)
{
	$.getJSON
	(
		path_yume + "apis/infofriend/"+username+"/blog/?jsoncallback=?",
		function(data)
		{
			var result = data.result;
			$("#mypage_boxblogfriend").html(result);
		}
	);
}
function show_blogroll(intPage)
{
	$.getJSON
	(
		path_yume+ "apis/profile_blogroll/" + username64 + "/"+intPage+"/?jsoncallback=?",
		function(data)
		{
			var result  = data.result; 
			if (result)
			{
				$("#profile_blogroll").html(result);
			}
		}
	);	
}
function deleteBlogroll(id)
{
	if( confirm("Bạn đồng ý xóa không?") )
	{
		$.getJSON
		(
			 path_yume+"apis/profile_blogroll_del/"+username64 +"/"+ id + "?jsoncallback=?",
			function(data)
			{
				var result = data.result;
				if (result)
				{
					show_blogroll(1);
				}
			}
		);
	}
}
function insertBlogroll()
{	
	var eTitle = $("#blogrollTitle");
	var eLink = $("#blogrollLink"); 
	var strTitle = eTitle.val();
	var strLink = eLink.val(); 
	if (strTitle && strLink)
	{	
		strTitle = Base64.encode(strTitle); 
		strLink  = Base64.encode(strLink); 
		$.getJSON
		(
			 path_yume+"apis/profile_blogroll_insert/"+username64+"?jsoncallback=?",
			{title:strTitle,link:strLink},
			function(data)
			{	
				var result = data.result;
				switch(result)
				{
					case -1:
						alert("Bạn chỉ được add tối đa 10 link. Nếu muốn add thêm, vui lòng xóa 1 trong 10 link mà bạn đã add.");
						break;
					case 0:
						alert("Thêm dữ liệu không thành công !!");
						break;
					case 1:
						eTitle.val("");
						eLink.val("");
						show_blogroll(1);
						break;
					case 2:
						eLink.select();
						alert("Link bạn nhập bị sai, vui lòng nhập lại.");
						break;
					default:
						break;
				}
			}
		);
	}
}