function GetXmlHttpObject() {

  var xmlHttp=null;

  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    }
  return xmlHttp;
}

function stateChanged_lirycs() { 

	//kiedy wskaznik xmlhttp zmienia sie na complete czyli 4
	if (xmlHttp.readyState==4)
		{
		//do spana w warstwie div_lirycs wstawiamy to co zwrocil plik php
		document.getElementById("span_lirycs").innerHTML=xmlHttp.responseText;
		}
}

function show_lirycs(tytul, wysokosc) {
	
	document.getElementById("div_transparent").style.display = "block";
	document.getElementById("div_lirycs").style.height = wysokosc;
	document.getElementById("div_lirycs").style.clip = "rect(0px,340px,"+wysokosc+"px,0px)";
	document.getElementById("div_lirycs").style.display = "block";

	//pobieramy uchwyt do obiektu xmlhttp
	xmlHttp=GetXmlHttpObject()

	xmlHttp.onreadystatechange=stateChanged_lirycs;
	xmlHttp.open("POST",tytul, true);
	xmlHttp.send(null);
}

function hide_lirycs() 
	{
	document.getElementById("div_transparent").style.display = "none";
	document.getElementById("div_lirycs").style.display = "none";
	}
	
function show_news(id) {
	
	document.getElementById("div_news2").style.display = "block";
	
	xmlHttp=GetXmlHttpObject();
	
	var url = "news_ajax.php?q="+id;
	//document.write(url);
	
	xmlHttp.onreadystatechange=stateChanged_news;
	xmlHttp.open("GET",url, true);
	xmlHttp.send(null);
}

function stateChanged_news() { 

	//kiedy wskaznik xmlhttp zmienia sie na complete czyli 4
	if (xmlHttp.readyState==4)
		{
		//do spana w warstwie div_news2 wstawiamy to co zwrocil plik php
		document.getElementById("span_news").innerHTML=xmlHttp.responseText;
		}
}

function show_koncerty(id) {
	
	document.getElementById("div_koncerty3").style.display = "none";
	document.getElementById("div_koncerty2").style.display = "block";
	
	xmlHttp=GetXmlHttpObject();
	
	var url = "koncerty_ajax.php?q="+id;
	
	xmlHttp.onreadystatechange=stateChanged_koncerty;
	xmlHttp.open("GET",url, true);
	xmlHttp.send(null);
}

function stateChanged_koncerty() { 

	//kiedy wskaznik xmlhttp zmienia sie na complete czyli 4
	if (xmlHttp.readyState==4)
		{
		//do spana w warstwie div_news2 wstawiamy to co zwrocil plik php
		document.getElementById("span_koncerty").innerHTML=xmlHttp.responseText;
		}
}

function show_video(name) {
	
	document.getElementById("div_transparent").style.display = "block";
	document.getElementById("div_youtube").style.display = "block";
	
	xmlHttp=GetXmlHttpObject();
	
	var url = "video_ajax.php?q="+name;
	
	xmlHttp.onreadystatechange=stateChanged_video;
	xmlHttp.open("GET",url, true);
	xmlHttp.send(null);
	
}

function stateChanged_video() { 

	//kiedy wskaznik xmlhttp zmienia sie na complete czyli 4
	if (xmlHttp.readyState==4)
		{
		//do spana w warstwie div_news2 wstawiamy to co zwrocil plik php
		document.getElementById("span_video").innerHTML=xmlHttp.responseText;
		}
}

function hide_video() 
	{
	document.getElementById("div_transparent").style.display = "none";
	document.getElementById("div_youtube").style.display = "none";
	
	xmlHttp=GetXmlHttpObject();
	
	var url = "video_ajax.php?q=none";
	
	xmlHttp.onreadystatechange=stateChanged_video;
	xmlHttp.open("GET",url, true);
	xmlHttp.send(null);
	}
