var contentType = "application/x-www-form-urlencoded; charset=UTF-8";

function ajax_create_request()
{
	try
	{
		xmlHttp = new XMLHttpRequest();
	} catch (e)
	{
		try 
		{
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e)
			{
				alert("Váš prehliadac nepodporuje AJAX. Môžete mat problémy so zobrazovaním stránok.");
      			return false;
			}
		}
	}
	
	return xmlHttp;
}

function ajax_make_get_request(ajax_xmlHttp, url, statechangefunction)
{
	ajax_xmlHttp.onreadystatechange = statechangefunction;
	ajax_xmlHttp.open("GET", url, true);
	ajax_xmlHttp.send(null);
}

function ajax_make_post_request(ajax_xmlHttp, url, params, statechangefunction)
{
	ajax_xmlHttp.onreadystatechange = statechangefunction;
	ajax_xmlHttp.open("POST", url, true);
	ajax_xmlHttp.setRequestHeader("Content-Type", contentType);
	ajax_xmlHttp.send(params);
}
