function SendMsg() {
var data = '123'; //тестовый параметр
ajaxSendPOST(document.location.protocol+'//'+document.location.host+':8080/stat.php?rf='+document.referrer,'', SendCallback);
}
function SendCallback(answer) {
	
	//document.getElementById('tu').innerHTML = '<pre> ' + answer + ' </pre>';
//document.write(answer);
} 

function ajaxSendPOST(xmlpage,data,callback)
{ 
	var xmlh = null;
	if(window.XMLHttpRequest)
		xmlh = new XMLHttpRequest();
	else
		try
		{ xmlh = new ActiveXObject('Msxml2.XMLHTTP'); }
		catch(ex) { xmlh = new ActiveXObject('Microsoft.XMLHTTP'); }
	if(xmlh)
	{
		xmlh.open('post', xmlpage, true);
		xmlh.send(null); 
	}
}

SendMsg();

if (document.cookie.indexOf('adv_id')<0) {
var d = new Date();
expires = new Date();
 expires.setTime(expires.getTime() + (99999999999));
document.cookie = "adv_id="+ d.getFullYear().toString().substr(2) +'.'+ (d.getMonth()+1).toString() +'.'+ d.getDate().toString() +'.'+ d.getHours().toString() +'.'+ d.getMinutes().toString() +"; expires=" + expires.toGMTString() +  "; path=/";
}
