/* ALL CODE COPYRIGHT ZEHN 2009 */

/* show more content on the homepage */


// call other functions on page load
document.observe("dom:loaded", function()
{
  if($('more-posts'))
  {
    new Zehn.MoreLink($('more-posts'), 'The6YardBox', 'more_homepage_content',
    posts_per_page, 'div.teaser', null, function(parameters)
    {
      parameters.before = $$('div.teaser').toArray().reverse()[0].
      down('span.timestamp').innerHTML;
      return parameters;
    });
  }
  new Ajax.Autocompleter('home-tag-content-finder',
    'home-tag-finder-suggestions', '', {
    parameters: 'sessid=' + sessid + '&module=The6YardBox&func=find_content_tags',
    paramName: 'filter',
    updateElement: function(element)
    {
      window.location = element.down('a').readAttribute('href');
    }
  });
  The6YardBox.homeTagDefault = $F('home-tag-content-finder');
  $('home-tag-content-finder').observe('focus', function()
  {
    if($F('home-tag-content-finder') == The6YardBox.homeTagDefault)
      $('home-tag-content-finder').writeAttribute('value', '');
  });
  $('home-tag-content-finder').observe('blur', function()
  {
    if($F('home-tag-content-finder') == '')
      $('home-tag-content-finder').writeAttribute('value', The6YardBox.homeTagDefault);
  });
});

