var AudienceMeter = Class.create();
AudienceMeter.prototype = {
  initialize: function()
  {

    if ( typeof(Prototype) == 'undefined' || typeof(Ajax) == 'undefined' )
      throw new Error('Prototype library required.');

    this.params = { 'agent':      navigator.userAgent,
                    'protocol':   window.location.protocol,
                    'host':       window.location.host,
                    'pathname':   window.location.pathname,
                    'url_params': window.location.href.split("?")[1]
                  }
  },

  log: function()
  {
    var params = $H(this.params).map(function(pair) { return pair.key+"="+escape(pair.value || "");}).join("&");
    new Ajax.Request(
      'http://www.lotece.com.br/novosite/adm/audiencemeter.php', 
//      'http://localhost/lotece/site/novosite/adm/audiencemeter.php',
      {
        method: 'post', 
        parameters: params
      });
  }
}

if (window.attachEvent) {

        window.attachEvent("onload", function() {
					 var au = new AudienceMeter();
           au.log();
        });
} else {
        window.addEventListener("load", function() {
					 var au = new AudienceMeter();
           au.log();
        }, false);
}

