$(document).ready(function() {
  var hasVal = false;
    $(".Advanced").css({opacity: 0});
  if ($("#search_query").val()=="") {
    $("#search_query").val("Search");
  } else {
    hasVal = true;
  }
  $("#search_query").bind("focus",function() {
    $(".Advanced").stop(true).animate({opacity: 1});
    if (hasVal==false) {
      $(this).val("");
    }
  });
  $("#search_query").bind("blur",function() {
    $(".Advanced").stop(true).animate({opacity: 0});
    if ($(this).val()=="") {
      $(this).val("Search");
      hasVal = false;
    } else {
      hasVal = true;
    }
  });
});

