var browser, version, thestring, place;
var i_flash,a_flash,v_flash,i_shock,v_shock
var sys
var fv = verCaps("{D27CDB6E-AE6D-11CF-96B8-444553540000}");
//var fileContatore = 'http://www.motofficinaleoncini.it/modules/statistics/contatore.aspx';
var fileContatore = 'http://www.motofficinaleoncini.it/modules/statistics/contatore.aspx';
var controlBrowser = navigator.userAgent.toLowerCase();
var controlSystem  = navigator.userAgent.toLowerCase();
//----------------------------------------------------------------------------------- b = browser
function checkBrowser(string) {
	place = controlBrowser.indexOf(string) + 1;
	thestring = string;
	return place;
}
if (checkBrowser('konqueror')) {
									browser = "Konqueror";
}
else if (checkBrowser('k-meleon')) {
									browser = "K-Meleon";
	var rv = controlBrowser.match(/k-meleon ([\w.]+)/);
	if (rv) {
		rv = rv[0];
									version = rv.substr(3);
	}
}
else if (checkBrowser('safari'))	browser = "safari";
else if (checkBrowser('omniweb'))	browser = "omniweb";
else if (checkBrowser('opera'))		browser = "opera";
else if (checkBrowser('webtv'))		browser = "webtv";
else if (checkBrowser('icab'))		browser = "icab"
else if (checkBrowser('msie'))		browser = "internet explorer";
else if (checkBrowser('netscape'))	browser = "netscape";
else if (!checkBrowser('compatible')) {
	 if (typeof(navigator.product) != "undefined") { //Mozilla
									browser = "mozilla"
									checkBrowser('rv')
									version = controlBrowser.substr(place + thestring.length,3);
	 }else{ // netscape 4.74
									browser = "netscape";
									version = "4.7";
	 }
}
else browser = "*";
if (!version) {
	version = controlBrowser.substr(place + thestring.length,3);
	if(version=="/6."){
		version = 6;
	}
}
var b = "";
if (browser)
	b += browser;
	b = b.toLowerCase();
if (version)
	b += " " + version;
	b = b.toLowerCase();
if (!b)
b = "*"
//----------------------------------------------------------------------------------- sis = sistema
function checkSystem(string) {
	place = controlSystem.indexOf(string) + 1;
	thestring = string;
	return place;
}
if (checkSystem('98'))			sys = "windows 98";
if (checkSystem('95'))			sys = "windows 95";
if (checkSystem('win 9x'))		sys = "windows me";
if (checkSystem('nt'))			sys = "windows nt";
if (checkSystem('nt 5'))		sys = "windows 2000";
if (checkSystem('nt 5.1'))		sys = "windows xp";
if (checkSystem('linux'))		sys = "linux";
if (checkSystem('mac'))			sys = "mac";
if (checkSystem('2000'))		sys = "windows 2000";
if (!sys)
	sys = "*" 
//---------------------------------------------------------------------------------- detect flashplayer
function verCaps(id) {
if (typeof(caps) != "undefined" && typeof(caps.id) != "undefined" && typeof(caps.getComponentVersion) != "undefined")
	return caps.getComponentVersion(id, "ComponentID");
else
	return false;
}
<!--per netscape e altri -->
if (fv) 
	a_flash = fv;
	if (navigator.plugins) {
		for (var i=0; i < navigator.plugins.length; i++) {
			if (navigator.plugins[i].name.toLowerCase().indexOf("shockwave flash") >= 0) {
				i_flash = true;
				v_flash = navigator.plugins[i].description.substring(navigator.plugins[i].description.toLowerCase().lastIndexOf("flash ") + 6, navigator.plugins[i].description.length);
				v_flash= v_flash.slice(0,1)
			}
			if (navigator.plugins[i].name.indexOf("Shockwave for Director") >= 0) {
				i_shock = true;
				v_shock = navigator.plugins[i].description.substring(navigator.plugins[i].description.toLowerCase().lastIndexOf("version ") + 8, navigator.plugins[i].description.length);
				v_shock= v_shock.slice(0,3)
			}
		}
	}
//document.write('</SCR' + 'IPT\> \n');
<!--per explorer -->
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
document.write('on error resume next \n');
document.write('set f = CreateObject("ShockwaveFlash.ShockwaveFlash") \n');
document.write('if IsObject(f) then \n');
document.write('i_flash = true \n');
document.write('v_flash = hex(f.FlashVersion()) \n');
document.write('	v_flash=left(v_flash,1) \n');
document.write('end if \n');
document.write('set s = CreateObject("SWCtl.SWCtl") \n');
document.write('if IsObject(s) then \n');
document.write('i_shock = true \n');
document.write('v_shock = s.ShockwaveVersion("") \n');
//document.write('	v_shock=left(v_shock,5) \n');
document.write('end if \n');
// -->
document.write('</SCR' + 'IPT\> \n');
//document.write('<SCR' + 'IPT LANGUAGE=JavaScript\> \n');
//
//----------------------------------------------------------------------------------- RACCOLTA DATI ---------------------------------
//----------------------------------------------------------------------------------- l = lingua
l = navigator.browserLanguage
if (!l){ //ns 4.74
	l = navigator.language
}
l = l.slice(0,2)
if (!l)
	l = "*"
//----------------------------------------------------------------------------------- ref = referrer
ref = '' + escape(document.referrer);
if (!ref)
	ref = "*"
//----------------------------------------------------------------------------------- u = pagina
u = '' + escape(document.URL);
//----------------------------------------------------------------------------------- ris = risoluzione
w = screen.width;
h = screen.height; 
res= w+"x"+h
if (!res)
	res = "*"
//----------------------------------------------------------------------------------- c = colori
v = navigator.appName; 
if (v != 'Netscape') {
	c = screen.colorDepth;
} else {
	c = screen.pixelDepth;
}
if (!c)
c = "*"
//----------------------------------------------------------------------------------- plugin
if (!v_shock)
	v_shock = "*"
if (!v_flash)
	v_flash = "*"

//----------------------------------------------------------------------------------- INVIO DATI ---------------------------------
info='res=' + res + '&c=' + c + '&b=' + b + '&u='+ u + '&v_flash=' + v_flash + '&v_shock=' + v_shock + '&s=' + sys + '&l=' + l + '&ref=' + ref;
document.write('<img src="' + fileContatore + '?'+info+ '" width="0" height="0" border="0">');
//---------------------per debug-----------------------------
//newWindow = window.open(fileContatore+'?'+info, 'popup','height=600,width=1000', 'top=10,left=10');
//newWindow.focus();
//-----------------------------------------------------------
