$(function () {
    var typ = {}, splitCSS, string, logLink, date = new Date();
    $('a[class*=stat-]').each(function () {
        logLink = $(this).attr('class') + ' : ' + document.URL + ' : ' + date.getDate() + ':' + date.getMonth()  + ':' + date.getFullYear() + ':' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();
        $.get('/temp/tkp/writelog.php?log=' + logLink);
        splitCSS = $(this).attr('class').split(' ');
        $.each(splitCSS, function () {
            if (this.toString().match(/stat-/)) {
                string = this.toString().replace(/stat-/, '');
                if (string !== '') {
                    typ[string] = (typ[string] === undefined) ? 1 : typ[string] + 1;
                }
            }
        });
    });

    $.get('/temp/tkp/writexml.php?' + $.param(typ));
});
