/*
*/


if (!utils) { var utils = {}; }

utils.bind_to_inputs = function() {
  $('input').bind('focus', function() {
    $(this).select()
  });
}

utils.enable_location_autosuggest = function(inputid) {
  new bsn.AutoSuggest(inputid, {
    script: "/a/location_autosuggest/?",
  	varname: inputid,
  	json: true,
  	minchars: 3,
  	maxresults: 20,
  	delay: 50,
  	timeout: 5000
  });
}

utils.enable_search_shortcuts = function() {
  /* Provides functionality to the "search-shortcut" elements
  */
  var id = $(this).attr('id'),
      items = id.split('-'),
      type = items[0],
      value = items[1];
  
  value = value.replace('__', ', ').replace('_', ' ');
  $('input#' + type).attr('value', value);
}