﻿function chooseCatalog(menu)
{
	var catalogId = menu.options[menu.selectedIndex].value;
	if (catalogId != "")
	{
		if (catalogId != currentCatalogId)
		{
			location.href = "catalog.asp?catalog=" + escape(catalogId);
		}
	}
	else
	{
		location.href = "index.asp";
	}
}

function chooseSubCatalog(menu)
{
	var subCatalogId = menu.options[menu.selectedIndex].value;
	if (subCatalogId != "")
	{
		if (subCatalogId != currentSubCatalogId)
		{
			location.href = "subcatalog.asp?catalog=" + escape(currentCatalogId) + "&subcatalog=" + escape(subCatalogId);
		}
	}
	else
	{
		location.href = "catalog.asp?catalog=" + escape(currentCatalogId);
	}
}

function chooseProduct(menu)
{
	var productId = menu.options[menu.selectedIndex].value;
	if (productId != "")
	{
		if (productId != currentProductId)
		{
			location.href = "product.asp?catalog=" + escape(currentCatalogId) + "&subcatalog=" + escape(currentSubCatalogId) + "&product=" + escape(productId);
		}
	}
	else
	{
		location.href = "subcatalog.asp?catalog=" + escape(currentCatalogId) + "&subcatalog=" + escape(currentSubCatalogId);
	}	
}

function submitForm(control, action)
{
	control.form.elements['action'].value = action;
	control.form.submit();
}

