	var http = createXmlHttpRequestObject();
	var idd;
	var tresc;
	function createXmlHttpRequestObject()
	{
		var xmlHttp;
		if(window.ActiveXObject)
		{
			try
			{
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				xmlHttp = false;
			}
		}
		else
		{
			try
			{
				xmlHttp = new XMLHttpRequest();
			}
			catch (e)
			{
				xmlHttp = false;
			}
		}
		if (!xmlHttp)
			alert("Twoja przeglądarka nie współpracuje.. Zmień na inną..");
		else
			return xmlHttp;
	}
	
	function vote(ocena, nr)
	{
		var myurl = "/avote.php?o="+ocena+"&d="+nr;
		http.open("GET", myurl, true);
		http.onreadystatechange = useHttpResponse;
		http.send(null);
	}

	function tytul(id)
	{	
	        idd=id;
	        var myurl = "/prop.php?id="+id+"&rand="+new Date().getTime();
                http.open("GET", myurl, true);
                http.onreadystatechange = useHttpResponse3;
                http.send(null);
	}
	function tytul2(id,text)
	{	
	        idd=id;
	        tresc=text;
	        var myurl = "/prop.php?id2="+id+"&tresc="+tresc+"&rand="+new Date().getTime();
                http.open("GET", myurl, true);
                http.onreadystatechange = useHttpResponse3;
                http.send(null);
	}
	function ulubione(id)
	{	
	        idd=id;
	        var myurl = "/ulub.php?id="+id+"&rand="+new Date().getTime();
                http.open("GET", myurl, true);
                http.onreadystatechange = useHttpResponse3;
                http.send(null);
	}
	function ulubione2(id,text)
	{	
	        idd=id;
	        tresc=text;
	        var myurl = "/ulub.php?id2="+id+"&tresc="+tresc+"&rand="+new Date().getTime();
                http.open("GET", myurl, true);
                http.onreadystatechange = useHttpResponse3;
                http.send(null);
	}
	
	function useHttpResponse3()
	{
		if (http.readyState == 4)
		{
			if (http.status == 200)
			{
                            document.getElementById("t"+idd).innerHTML=http.responseText; 
			}
			else
			{
			}
		}
		else
		{
			document.getElementById("t"+idd).innerHTML ='<b>Ładuję..</b>';
		}
	}
	
	function odpal(id)
	{
	        idd=id;
		var myurl = "/flv/fpdev.php";
		var myRand = new Date().getTime();
		var modurl = myurl+"?id="+id+"&rand="+myRand;
		http.open("GET", modurl, true);
		http.onreadystatechange = useHttpResponse2;
		http.send(null);
	}
	
	function useHttpResponse()
	{
		if(http.readyState == 4)
		{
			if(http.status == 200)
			{
				checkVote();
			}
			else
			{
			}
		}
		else
		{
			document.getElementById('infobox').innerHTML =	'<b>Głosujemy..</b>';
			document.getElementById('infobox2').innerHTML = '';
			document.getElementById('infobox3').innerHTML = '';
		}
	}
	function useHttpResponse2()
	{
		if(http.readyState == 4)
		{
			if(http.status == 200)
			{
				checkVote2();
			}
			else
			{
			}
		}
		else
		{
			document.getElementById(idd).innerHTML =	'<b>Ładuję..</b>';
		}
	}

	function checkVote2()
	{
		document.getElementById("s"+idd).innerHTML=http.responseText;
		document.getElementById("o"+idd).style.visibility='hidden';
	}
	function checkVote()
	{
		document.getElementById("infobox").innerHTML=http.responseText;
	}
    function schowaj(id,tresc)
    {
        document.getElementById("s"+id).innerHTML= tresc;
        document.getElementById("o"+id).style.visibility='visible';
                        
    }
    function chowa(id)
    {
       idd=id;
       document.getElementById("t"+idd).innerHTML='';
    }    





