// JavaScript Document
//shows the remove friend confirmation popup
function showRemoveFriend(friendId)
{
	$('#hdn_friend_id').val(friendId);
	tb_show('', '#TB_inline?height=150&width=530&modal=true&inlineId=removeFriendDiv', false);
}

//get friends email ids and message to send invitation
function inviteFriends()
{
	$.ajax({
		type: 'POST',
		url: base_url + 'friends/invite/' + Math.random(),
		dataType: 'json',
		data: 'invite_submit=1&to_ids=' + $('#txt_invitation_to').val() + '&message=' + $('#txt_invitation_message').val() ,
		success: function(response){
			$('#resultMsg').html(response.msg);
			$('#normMsg').show();
			if(response.error == 'no')
			{
				$('#txt_invitation_to').val('');
				$('#txt_invitation_message').val('');
			}
		}
	});
}
function validateImportFriends()
{
	
	if ($('#hdn_email_client_id').val() == 'G')
	{
		if($('#login').val()=='' || $('#password').val()=='')
		{
			$('#myOwnValidationMsg').show();
			$('#errorMsg1').html('');
			$('#errorMsg2').html('');
		}
		else
		{
			$('#save').disabled	= true;
			$('#grabform').submit();
		}
		
	}
	else
	{
		$('#save').disabled	= true;
		$('#grabform').submit();
	}
	
}

function displayemailclient(obj)
{
	if (obj.value == 'G')
	{
		$('#show_email').show();
		$('#show_password').show();
	}
	else
	{
		$('#show_email').hide();
		$('#show_password').hide();
	}
	$('#hdn_email_client_id').val(obj.value);
}