/**
 * JavaScript for the SearchBox component
 *
 * @author Ben Barber (bbarber@i2rd.com)
 * @require i2rd-util.js
 */
if (typeof SB === 'undefined') {
  SB={};
  SB.init = function(id,keyword) {
    var input = document.getElementById(id);
    var clearDefault = function() {if (this.value === keyword) this.value = '';};
    var setDefault = function() {if (this.value === '') this.value = keyword;};    
    i2rd.addEvent(input, 'focus', i2rd.bind(clearDefault, input));
    i2rd.addEvent(input, 'blur', i2rd.bind(setDefault, input));
  };
}
