function User() {}

User.send_invite = function(n)
{
	var row = $("#invite_"+n);
	var email = row.find('input').val();
	
	ajx = new Ajax('/ajax/users/send_invite', {'email': email, 'n':n});
	ajx.parent_obj = row;
	ajx.pending_func = $(row).find('#submit_'+n).html('sending...');
	ajx.fetch();
}

User.show_people_list = function(type, id)
{
	Overlay.show('users/people_list', {'id':id, 'type': type});
	return false;
}

User.follow = function(id)
{
	if (require_login()) return false;
	$("#follow_button").hide();
	$("#follow_loading").show();
	ajx = new Ajax('/ajax/users/follow', {'uid': id});
	ajx.type = "post";
	ajx.fetch(function() {
		$("#follow_loading").hide();
		$("#follow_complete").show();
	});
	return false;
}

User.send_note = function(id, params) {
	if (require_login()) return false;
	if (!params) params = {};
	params.uid = id;
	return Overlay.show('users/send_note', params);
}

