
/**
 * Hide defafault text for input:text element 
 */
$.fn.hideDefaultVal = function () {
  var el = $(this);
  if (!el.is('input')) {
	  return $(this);
  }
  var dval = el.attr('rel');
  if (dval == el.val()) {
	  el.val('');
  }
  return $(this);
};

/**
 * Show default text for input:text element 
 */
$.fn.showDefaultVal = function () {
  var el = $(this);
  if (!el.is('input')) {
	  return $(this);
  }
  var dval = el.attr('rel');
  if (dval == el.val() || el.val() == '') {
	  el.val(dval);
  }
  return $(this);
};


$(document).ready(function() {
//handler for search focus

 $(".search input.text").focus(function(){
   $(this).addClass('focus-in').hideDefaultVal();
 }).blur(function(){
   $(this).removeClass('focus-in').showDefaultVal();
 });
});

