function toggleContextHelp() {
	var helpfulInfo = $(this).attr("rel");
	if ($(this).val()==helpfulInfo) {
		$(this).val("");
		$(this).css("color", "#333333");
	}
	else if ($(this).val()=="") {
		$(this).val(helpfulInfo);
		$(this).css("color", "#888888");
	}
}

function addContextHelp() {
	var helpfulInfo = $(this).attr("rel");
	$(this).val(helpfulInfo);
	$(this).css("color", "#888888");
}


function deleteButtonHover() {
	$(this).attr("title", "delete");
	$(this).hover(function () {
		$(this).css("position", "relative");
		$(this).css("top", "1px");
	},
	function () {
		$(this).css("top", "0px");
	});
}
function editButtonHover() {
	$(this).attr("title", "edit");
	$(this).hover(function () {
		$(this).css("position", "relative");
		$(this).css("top", "1px");
	},
	function () {
		$(this).css("top", "0px");
	});
}


$(function() {
	$("input.contextFriendly").focus(toggleContextHelp);
	$("input.contextFriendly").blur(toggleContextHelp);
	$("input.contextFriendly").each(addContextHelp);

	$("a>img[src=images/icons/application_delete.png]").each(deleteButtonHover);
	$("a>img[src=images/icons/application_edit.png]").each(editButtonHover);
});