function Add2Fav(id)
{	
	$('#ajax_log_res').addClass('ajax-loading_pro');
	
	$('#ajax_log_res').css('top', $(document).scrollTop()+220);
 
 	$.ajax({
		url:'httprequest.php?act=add2fav', 
		type: 'POST', 
		data: 'id=' + id,
		success : function (date) { 
			$('#ajax_log_res').removeClass('ajax-loading_pro');
			$('#ajax_log_res').html("");
			var top = parseInt($('#ajax_log_res').css('top'))
			$("#ajax_log_res").html(date);
			$('#promptMsg').css('top',top-20);
		} 
	});
	
	switchBackground();
}

function switchBackground() 
{	
	if ($('#msgBg').css('display') == 'none')
	{
		var backgroundHeight = Math.max(document.documentElement.clientHeight,document.body.scrollHeight);
		$('#msgBg').css('height', backgroundHeight);
		$('#msgBg').css('display', 'block');
		$('#msgBg').css('background-color', '#666');
	}
	else
	{
		$('#msgBg').css('display', 'none');
	}
}


function hidePromptMsg()
{
	$('#promptMsg').css('display', 'none');
	switchBackground();
}

function userNameCheck(input)
{
	$.ajax({
		url:'./httprequest.php?act=checkprofile&type=username&data=' + encodeURIComponent(input), 
		type: 'GET', 
		success : function (date) { 
			$('#userNameInfo').html("");
			$("#userNameInfo").html(date);
		} 
	});
}

function userPasswordCheck(input)
{
	$.ajax({
		url:'./httprequest.php?act=checkprofile&type=password&data=' + encodeURIComponent(input), 
		type: 'GET', 
		success : function (date) { 
			$('#passwordInfo').html("");
			$("#passwordInfo").html(date);
		} 
	});
}

function userRPasswordCheck(input)
{
	var password = document.getElementById('password').value;
	
	$.ajax({
		url:'./httprequest.php?act=checkprofile&type=rpassword&data=' + encodeURIComponent(input) + '&pw=' + password, 
		type: 'GET', 
		success : function (date) { 
			$('#rpasswordInfo').html("");
			$("#rpasswordInfo").html(date);
		} 
	});
}

function userEmailCheck(input)
{
	$.ajax({
		url:'./httprequest.php?act=checkprofile&type=email&data=' + encodeURIComponent(input), 
		type: 'GET', 
		success : function (date) { 
			$('#emailInfo').html("");
			$("#emailInfo").html(date);
		} 
	});
}
