function createXmlHttpRequestObject()
{
	var xmlHttp;
	try
	{
		xmlHttp = new XMLHttpRequest();
	}
	catch(e)
	{
		var XmlHttpVersions = new Array('MSXML2.XMLHTTP.6.0',
										'MSXML2.XMLHTTP.5.0',
										'MSXML2.XMLHTTP.4.0',
										'MSXML2.XMLHTTP.3.0',
										'MSXML2.XMLHTTP',
										'Microsoft.XMLHTTP');

		for(var i=0; i<XmlHttpVersions.length && !xmlHttp; i++)
		{
			try
			{
				xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
			}
			catch (e) {}
		}
	}
	return xmlHttp;
}
function AddBriefcase(saveTxt,system,hory,iddata,UID)
{
	var xmlHttp=createXmlHttpRequestObject();
	if(xmlHttp)
	{
		var span="system-"+system+"-hory-"+hory+"-iddata-"+iddata+"-"+UID;
		var p=document.getElementById(span);
		p.innerHTML="Nahrávám ...";

		xmlHttp.open("GET","/briefcase/briefcase_server.php?system="+system+"&hory="+hory+"&iddata="+iddata,true);
		xmlHttp.onreadystatechange=function()
		{
			ShowResponse(xmlHttp,saveTxt,span,hory);
		}
		xmlHttp.send(null);
		return true;
	}
	return false;
}
function ShowResponse(xmlHttp,saveTxt,span,hory)
{
	if(xmlHttp.readyState==4)
	{
		if (xmlHttp.status==200)
		{
			if(typeof(svr)=="undefined")
				svr="";

			var p=document.getElementById(span);
			var xmlResponse=xmlHttp.responseXML;
			var xmlRoot=xmlResponse.documentElement;
			var nodeAlert=xmlRoot.getElementsByTagName("alert");
			var txt=nodeAlert.item(0).firstChild.nodeValue;
			if(txt=="OK")
				p.innerHTML=saveTxt+" ve Vaší <a href=\""+svr+"/briefcase/?hory="+hory+"\"><b>Aktovce</b></a>";
			else
				p.innerHTML=txt;
			return true;
		}
	}
	return false;
}