function showSecondRegion(ParentRegionId, selected)
{
    document.getElementById('SecondRegionSelect').style.display='';
    document.getElementById('ThirdRegionSelect').style.display='none';
	if (window.XMLHttpRequest) // code for IE7+, Firefox, Chrome, Opera, Safari
	{
		xmlhttp=new XMLHttpRequest();
	}
	else // code for IE6, IE5
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			document.getElementById("SecondRegionSelect").innerHTML=xmlhttp.responseText;
		}
	}
	
	xmlhttp.open("GET","ajax_scripts/show_second_region.php?regionId="+ParentRegionId+"&selected="+selected, true);
	xmlhttp.send();
}

function showThirdRegion(ParentRegionId, selected)
{
    document.getElementById('ThirdRegionSelect').style.display='';
	if (window.XMLHttpRequest) // code for IE7+, Firefox, Chrome, Opera, Safari
	{
		xmlhttp2 = new XMLHttpRequest();
	}
	else // code for IE6, IE5
	{
		xmlhttp2 = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	xmlhttp2.onreadystatechange=function()
	{
		if (xmlhttp2.readyState==4 && xmlhttp2.status==200)
		{
			document.getElementById("ThirdRegionSelect").innerHTML=xmlhttp2.responseText;
		}
	}
	
	xmlhttp2.open("GET","ajax_scripts/show_third_region.php?regionId="+ParentRegionId+"&selected="+selected, true);
	xmlhttp2.send();
}


//function returnAptiekasDetails(aptiekasId)
//{
//	if (window.XMLHttpRequest) // code for IE7+, Firefox, Chrome, Opera, Safari
//	{
//		xmlhttp2 = new XMLHttpRequest();
//	}
//	else // code for IE6, IE5
//	{
//		xmlhttp2 = new ActiveXObject("Microsoft.XMLHTTP");
//	}
//	
//	xmlhttp2.onreadystatechange=function()
//	{
//		if (xmlhttp2.readyState==4 && xmlhttp2.status==200)
//		{
//			document.getElementById("conteinerDiv").innerHTML = xmlhttp2.responseText;
//		}
//	}
//
//	
//	xmlhttp2.open("GET","../ajax_scripts/getAptiekasData.php?aptiekasId="+aptiekasId, true);
//	xmlhttp2.send();
//}

function returnAptiekasDetails(aptiekasId)
{
    $.get("../ajax_scripts/getAptiekasData.php?aptiekasId="+aptiekasId, { param: 1},
        function(data)
        {
          //  alert(data);
            document.getElementById("conteinerDiv").innerHTML = data;
        });
}

function returnAptiekasDetails2(aptiekasId)
{
    $.get("../../ajax_scripts/getAptiekasData.php?aptiekasId="+aptiekasId, { param: 1},
        function(data)
        {
          //  alert(data);
            document.getElementById("conteinerDiv").innerHTML = data;
        });
}



//function returnAptiekasDetails2(aptiekasId)
//{
//	if (window.XMLHttpRequest) // code for IE7+, Firefox, Chrome, Opera, Safari
//	{
//		xmlhttp2 = new XMLHttpRequest();
//	}
//	else // code for IE6, IE5
//	{
//		xmlhttp2 = new ActiveXObject("Microsoft.XMLHTTP");
//	}
//	
//	xmlhttp2.onreadystatechange=function()
//	{
//		if (xmlhttp2.readyState==4 && xmlhttp2.status==200)
//		{
//			document.getElementById("conteinerDiv").innerHTML = xmlhttp2.responseText;
//		}
//	}
//	
//	xmlhttp2.open("GET","../../ajax_scripts/getAptiekasData.php?aptiekasId="+aptiekasId, true);
//	xmlhttp2.send();
//}
