
document.events = [];
document.attachEvent = function(type, reference) {
    var evt = this.events;
    if(!evt[type]) evt[type] = [];
    evt[type][evt[type].length] = reference;

    document[type] = function(e) { 
        document.executeEvents(type, e);        
    }
}    

document.executeEvents = function(type, e) {
    for(var i in this.events[type]) {
        this.events[type][i](e);
    }    
}
window.onunload = function() { document.executeEvents('onunload'); }
window.onload = function() { document.executeEvents('onload'); }
window.onresize = function() { document.executeEvents('onresize'); }

function pageHit(){

  p = escape(document.location.href);
  rfr = escape(document.referrer);
  if (rfr == "undefined"){ rfr = "";}
  sx = screen.width;
  sy = screen.height;
  sc = (navigator.appName.indexOf("Microsoft") > -1) ? screen.colorDepth : screen.pixelDepth;
  src = 'stats.php?p=' + p + '&rfr=' + rfr + '&sx=' + sx + '&sy=' + sy + '&sc=' + sc;
  src = '<img style="position:absolute;left:-10px;top:-10px;" src="' + src + '" width="1" height="1" border="0" alt="" />';
  document.getElementById('counter').innerHTML = src;
  
}

document.attachEvent("onload", pageHit);

/* 
var SWIS = {

    /**
     *  @desc start function, wordt altijd uitgevoerd
     *
  
    start: function(){
    
        SWIS.pageHit();
    
    },
    
    /**
     *  @desc pageHit: statistieken
     *

    pageHit: function(){
        p = escape(document.location.href);
        rfr = escape(document.referrer);
        if (rfr == "undefined"){ rfr = "";}
        sx = screen.width;
        sy = screen.height;
        sc = (navigator.appName.indexOf("Microsoft") > -1) ? screen.colorDepth : screen.pixelDepth;
        src = 'stats.php?p=' + p + '&rfr=' + rfr + '&sx=' + sx + '&sy=' + sy + '&sc=' + sc;
        src = '<img style="position:absolute;left:-10px;top:-10px;" src="' + src + '" width="1" height="1" border="0" alt="" />';
        
        document.getElementById("counter").innerHTML = src;    
    }
    
}

window.onload = SWIS.start();

*/
