

$(document).ready(function(){

	clearInput('input#q');

});




function clearInput(tag)
{

	var clearMePrevious = '';
	
	//clear input on focus
	$(tag).focus(function()
	{
		if($(this).val()==$(this).attr('title'))
		{
		clearMePrevious = $(this).val();
			$(this).val('');
		}
		$(this).css("color", "#000");
	});
	
	//if field is empty afterward, add text again
	$(tag).blur(function()
	{
		if($(this).val()=='')
		{
			$(this).val(clearMePrevious);
		}
		$(this).css("color", "#ccc");
	});


}

 
