// Found on http://www.geekpedia.com/code100_Get-window-width-and-height.html
// Who names a site like this ? congratz ;)
function GetWidth() {
  var x = 0;
  if (self.innerHeight)
    x = self.innerWidth;
  else if (document.documentElement && document.documentElement.clientHeight)
    x = document.documentElement.clientWidth;
  else if (document.body)
    x = document.body.clientWidth;
  return x;
}
 
function GetHeight() {
  var y = 0;
  if (self.innerHeight)
    y = self.innerHeight;
  else if (document.documentElement && document.documentElement.clientHeight)
    y = document.documentElement.clientHeight;
  else if (document.body)
    y = document.body.clientHeight;
  return y;
}
// Found on http://www.editeurjavascript.com/trucs/35,ajax_interrogez_votre_serveur_avec_javascript.php
function HttpGetFile(fichier)
{
  if(window.XMLHttpRequest) // FIREFOX
    xhr_object = new XMLHttpRequest();
  else if(window.ActiveXObject) // IE
    xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
  else
    return(false);
  xhr_object.open("GET", fichier, false);
  xhr_object.send(null);
  if(xhr_object.readyState == 4) return(xhr_object.responseText);
  else return(false);
}

// Log into db the size of window see ajax.php
function track_visitor() {
  data = 's=' + GetWidth() + 'x' + GetHeight();
  result = HttpGetFile('ajax.php?action=storestat&msg='+data);
}

