function submitChangeType (cat, form_name, tp_field)
{
	cat = parseInt (cat);

	tp_options = document.forms[form_name].elements[tp_field];
	tp_options.options.length = 0;

	if (cat > 0)
	{
		tp_options.options[0] = new Option ('--proszę czekać--', 0);
		runScript ('tmp_typecat_script', 'script.php?m=advert&s=typelist&form='+form_name+'&type_field='+tp_field+'&cat='+cat);
	}
	else
		tp_options.options[0] = new Option ('--proszę wybrać typ--', 0);

}

function changeTypeCat (cat)
{
	cat = parseInt (cat);

	switch (cat)
	{
		case 1:
			showElement ('search_type1', true);
			showElement ('search_type2', false);
			showElement ('search_type3', false);
		break;

		case 2:
			showElement ('search_type1', false);
			showElement ('search_type2', true);
			showElement ('search_type3', false);
		break;

		case 3:
			showElement ('search_type1', false);
			showElement ('search_type2', false);
			showElement ('search_type3', true);
		break;
	}
}

