function GetPodCatList(CatID)
{
	if(CatID == 0)
	{
		$(".MoList").empty();
		$(".ElList").empty();
		$(".PList").empty();
		$(".MoList").append("<select style='width:300px'></select>");
		$(".ElList").append("<select style='width:300px'></select>");
		$(".PList").append("<select style='width:300px'></select>");

	}
	else
	{
	$.post('handler.php',
		{
			Cat: CatID
		},
		onPodCat
	);
	}
}


function GetElList(PodCatID)
{
	if(PodCatID == 0)
	{
		$(".ElList").empty();
		$(".ElList").append("<select style='width:300px'></select>");
	}
	else
	{
	$.post('handler.php',
		{
			PCat: PodCatID
		},
		onElemList
	);
	}
}


function GetModList(MCatID)
{
	if(MCatID == 0)
	{
		$(".MoList").empty();
		$(".MoList").append("<select style='width:300px'></select>");
	}
	else
	{
	$.post('handler.php',
		{
			MCat: MCatID
		},
		onModList
	);
	}
}

function onPodCat(data)
{
	// Здесь мы получаем данные, отправленные сервером для подкатегории
	$(".MoList").empty();
	$(".MoList").append("<select style='width:300px'></select>");
	$(".ElList").empty();
	$(".ElList").append("<select style='width:300px'></select>");
	$(".PList").empty();
	$(".PList").append( data.substr(0,data.indexOf("</select>")+9));
//	$(".PList").append(data);
	$(".Other").empty();
	$(".Other").append(data.substr(data.indexOf("</select>")+9));

}

function onElemList(data)
{
	// Здесь мы получаем данные, отправленные сервером для списка элементов
	$(".ElList").empty();
	$(".ElList").append(data);
}

function onModList(data)
{
	// Здесь мы получаем данные, отправленные сервером для списка элементов
	$(".MoList").empty();
	$(".MoList").append(data);
}
