$(document).ready(function() {
	initLoginStatus();
	
	$("img.track").tooltip();
	
	$("#query").focus(function() {
		if ($(this).val() == "artist names or song titles") { $(this).val(""); }
	});
	
	$("a.deljam").click(function() {
		var $clicked = $(this), timestamp = this.id;
		
		tb_show(null, "confirm.html", false, function() {
			$("#TB_ajaxContent input[type=button]").click(function() {
				if ($(this).val() == "Yes") {
					$clicked.parent().slideUp(500);
					$.post("rmjam.php", {name: $.cookie("name"), hash: $.cookie("hash"), timestamp: timestamp});
				}
				
				tb_remove();
			});
		});
		
		return false;
	}).hover(
		function() { $(this).parent().parent().find("img.track").addClass("del"); },
		function() { $(this).parent().parent().find("img.track").removeClass("del"); }
	);
	
	$("a.editjam").hover(
		function() { $(this).parent().parent().find("img.track").addClass("edit"); },
		function() { $(this).parent().parent().find("img.track").removeClass("edit"); }
	);
});
