/**
 * require: Core
 */
 
var Etrack = new Class({

  COOKIE_NAME: "__etrack", 

  getSessionId: function(){
    var id = Cookie.read(this.COOKIE_NAME);
    if (! id) {
      id = Math.round(Math.random() * 10000000);
      Cookie.write(this.COOKIE_NAME, id);
    }
    return id; 
  }, 


 track: function(e){
  var beacon, data;
  var self = this;
  if (typeof e === 'object') {
    e = e.join("/");
  }
  data = new Hash({
    path: e,
    location: document.location.href,
    session_id: self.getSessionId(),
    nocache: Math.random()
  });
  beacon = new Element('img', {src: 'http://etrack.michaelflatley.com/?' + data.toQueryString()});
 } 

});
