// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

//Put this code in "functions.js" to be really slick
$(document).ready( function(){
	autoFill($("#txtSearch"), "Enter Search Keyword(s)");
	$("tr")
		.filter(".tune")
		.dblclick(function(){
		current_id = $(this).attr("id");
		alert("Show record number " + current_id);
		$.get("tunes/" + current_id);
	})
	   .end()
	   .filter(".hideme")
	     .click(function(){
	       $(this).hide();
	       return false;
	     })
	   .end();
});

//Auto-Fill function accepts id of input and fills it with the given value.
//Written by Joe Sak http://www.joesak.com/2008/11/19/a-jquery-function-to-auto-fill-input-fields-and-clear-them-on-click/
function autoFill(id, v){
	$(id).css({ color: "#b2adad" }).attr({ value: v }).focus(function(){
		if($(this).val()==v){
			$(this).val("").css({ color: "#333" });
		}
	}).blur(function(){
		if($(this).val()==""){
			$(this).css({ color: "#b2adad" }).val(v);
		}
	});
	
}

function smook() {
	
}

