/* configuration
 ------------------------------------------------------- */
var domain = 'site';
var debug  = true;

/* _onload
 ------------------------------------------------------- */

$(document).ready(function() {
  loginState = new Observable.create();
  loginState.register('drawHeaderRight', drawHeaderRight);
  $('#categories li').each(function(){
    $(this).click(function(){
      location.href = $(this).find('a').get(0).getAttribute('href');
    });
  });
  
  Debug.openDebugDialog();
  
  $('#scoreberlin').click(function(){top.location.href='http://www.scoreberlin.de/';});
  
  // check for hanging connections every 2 seconds
  loadGravatars();
  setUrlParams();
  doFocus();
});


// adds webride to the firefox search box
function addToFirefoxSearch(name,ext,cat) {
  if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {
    window.sidebar.addSearchEngine(
      "http://webride/download/" + name + ".src",
      "http://webride/download/" + name + "."+ext,
      name,
      cat
    );
    alert('Download completed');
  }
  else {
    //Debug.log('site::addToFirefoxSearch:' + name + ',' + ext + ',' + cat);
  }
}

