function changeVendor( container )
{
	document.getElementById( "categoryFrame" ).src= root_path + "production/getCategoriesByProducer/" + container.value + "/";
}

function changeCategory( container )
{
	document.getElementById( "categoryFrame" ).src= root_path + "production/getOptionsByCategory/" + container.value + "/";
}

function updateCategories( categories )
{
	var categoryContainer = document.getElementById('categoryContainer');
	categoryContainer.options.length=categories.length + 1;
	for ( var i = 0 ; i < categories.length ; i++ )
	{
		categoryContainer.options[i+1].text = categories[i].name;
		categoryContainer.options[i+1].value = categories[i].value;
	}
}

function setOption( name )
{
	var optContainer = document.getElementById('optContainer');
	optContainer.options.length=2;
	optContainer.options[0].text = name;
	optContainer.options[0].value = "";
	optContainer.options[1].text = "Все";
	optContainer.options[1].value = "all";
}
		
function updateOptions( categories )
{
	var optContainer = document.getElementById('optContainer');
	optContainer.options.length=categories.length + 2;
	for ( var i = 0 ; i < categories.length ; i++ )
	{
		optContainer.options[i+2].text = categories[i].name;
		optContainer.options[i+2].value = categories[i].id;
	}
}

function updateBag( count , cost )
{
	document.getElementById("bag_count").innerHTML="Товаров: " + count + " Стоимость: " + cost;
	hide( "wait");
}