if (window.onload) window.onload_searchCache = window.onload


window.onload = function()
{
	var category = document.getElementById("property-search-category")
	if (category)
	{
		category.onchange = updateSubCategories;
		updateSubCategories( null, true )
	}
	if (window.onload_searchCache) 
	{
		window.onload_searchCache()
		//delete( window.onload_searchCache )
	}
}


function updateSubCategories( e, bDontReset )
{
	var category = document.getElementById("property-search-category")
	var subCategories = document.getElementById("property-search-subcategory")
	
	var id = category.value
	
	for (var c=1; c<subCategories.options.length; c++)
	{	
		var option = subCategories.options[c]

		if (option.className.substring(3)==id)
		{
			option.style.display="block"
		}
		else
		{
			option.style.display="none"
		}
	}
	if (!bDontReset) subCategories.selectedIndex=0
	
}
