
  // clear Search Field
  function clearSearchField () {
    var f = document.getElementById('keywords');
    if (f.value == 'search...') f.style.color = '#666';
    f.onfocus = function() {
      if (this.value == 'search...') this.value = '';
      this.style.color = '#222';
    }
    f.onblur = function() {
      if (this.value != '') return;
      this.style.color = '#666';
      this.value = 'search...';
    }
  }

  // select and update Storyline
  function selectStory (id, fk, el) {

    // first turn off any selected
    var items = document.getElementsByClassName("story_on");
    for (i = 0; i < items.length; i++) {
      $(items[i]).removeClassName('story_on');
    }
    
    // now activate chosen element
    $(el).addClassName('story_on');
    
    // update Storyline content
    new Ajax.Updater('story', '/includes/storyline_detail.php?t_id=' + id + '&id=' + fk, {method: 'get', asynchronous:true, evalScripts:true});
  }
