function makeRequest(url)
{
    http_request = false;

	if (window.XMLHttpRequest)
	{ // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject)
	{ // IE
		try
		{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request)
	{
		alert('Nie ma mozliwosci stworzenia instancji obiektu XMLHTTP');
		return false;
	}
	
	http_request.open('GET', url, true);
	http_request.send(null);
}


function clickInput(e)
{
    var b, x, y, locationObj, w, z
    if (!e) e = event
    b = document.body
    w=document.documentElement.clientWidth;
    
    if (w==0)
    {
		w=document.body.clientWidth;
    }
    
    z=11;
    
    if (screen.width>1300)
    {
		z=9
    }
    if (screen.width==800)
    {
		z=12
    }
    if (screen.width<800)
    {
		z=10
    }

	
    
    if (w<980)
    {                                                        
		x = e.clientX + b.scrollLeft +z
	} 
	else
	{
		x = e.clientX + b.scrollLeft - ((w-980)/2) +z                                       
	}  
    
    y = e.clientY + b.scrollTop
    
    locationObj = window.location;
    
    makeRequest('clickmap/clickinput.php' + '?x=' + x +'&y=' + y +'&adres=' + locationObj)
}
