function vst() {
	var
	nomeFile = '/vst.php',
	b = document.getElementsByTagName('body'),
	w = b[0].offsetWidth,
	p = document.URL,
	scr = screen.width + 'x' + screen.height + ' (' + w + ')',
	ref = document.referrer;
	
	p = p.replace(/^http:\/\/www\.ritrattisti\.it/, '');
	
	if(navigator.userAgent.search(/msie/i) >= 0)
		var lng = navigator.userLanguage;
	else
		var lng = navigator.language;

	var ck = getCookie();
	if(ck == null) var ck = 1;

	var ajax = assegnaXMLHttpRequest();
  
	if(ajax) {				
		ajax.open("post", nomeFile, true);
		ajax.setRequestHeader("content-type", "application/x-www-form-urlencoded");
		ajax.send('p=' + escape(p) + '&scr=' + scr + '&l=' + lng + '&ref=' + escape(ref) + '&ck=' + ck);
		//ajax.setRequestHeader("connection", "close");
	}
}

// per prendere un elemento con id univoco
function trovaElm(id) {
	if(document.getElementById) e = document.getElementById(id);
	else e = document.all[id];
	return e;
}

// legge cookie
function getCookie() {
	var cookies = document.cookie.split('; ');
	for(var i = 0; i < cookies.length; i++) {
		var c = cookies[i];
		var pos = c.indexOf('=');
		var n = c.substring(0,pos);
		if(n == 'vst') return c.substring(pos+1);
	}
	return null;
}
	
// assegna un oggetto XMLHttpRequest
function assegnaXMLHttpRequest() {
	var
	XHR = null,
	browserUtente = navigator.userAgent.toUpperCase();
	if(typeof(XMLHttpRequest) === "function" || typeof(XMLHttpRequest) === "object")
		XHR = new XMLHttpRequest();
	else if(window.ActiveXObject && browserUtente.indexOf("MSIE 4") < 0) {
		if(browserUtente.indexOf("MSIE 5") < 0)
			XHR = new ActiveXObject("Msxml2.XMLHTTP");
		else
			XHR = new ActiveXObject("Microsoft.XMLHTTP");
	}
	return XHR;
};



// oggetto di verifica stato
var readyState = {
	INATTIVO:	0,
	INIZIALIZZATO:	1,
	RICHIESTA:	2,
	RISPOSTA:	3,
	COMPLETATO:	4
};

// array descrittivo dei codici restituiti dal server
// [la scelta dell' array è per evitare problemi con vecchi browsers]
var statusText = new Array();
statusText[200] = "OK";
statusText[204] = "No Content";
statusText[400] = "Bad Request";
statusText[401] = "Unauthorized";
statusText[403] = "Forbidden";
statusText[404] = "Not Found";
statusText[408] = "Request Timeout";
statusText[500] = "Internal Server Error";
statusText[503] = "Service Unavailable";
statusText[504] = "Gateway Timeout";