<?
include_once('../cashe_catalog/_svod_catalog.php');
$magaz=intval($_GET['magaz']);
$w=intval($_GET['w'])+1;
$id_catalog=intval($_GET['id_cat']);

	if($id_catalog)
		{
		if(file_exists('../cashe_catalog/_svod_catalog_'.$id_catalog.'.php'));
		include_once('../cashe_catalog/_svod_catalog_'.$id_catalog.'.php');
		?>
		<script language="javascript">
		document.getElementById('name_cat_<?=($w-1)?>').value = '<?=$arr_catalog['url']?>'; 
		</script>				
		<?
		}
	else
		{
		?>
		<script language="javascript">
		document.getElementById('name_cat_<?=($w-1)?>').value = ''; 
		</script>				
		<?
		}

	if($id_catalog && $arr_razdel[$id_catalog])
		{
		if(!($w>1 && $magaz))
			{
			?>
			<select style="width: 150px" name="razdel_<?=$w?>" onChange="search_cat(<?=$w?>, this.value); return false">
			<option value="0">все разделы</option>
			<?
			foreach ($arr_razdel[$id_catalog] as $index=>$raz)
				{
				?>
				<option value="<?=$index?>"><?=$raz?></option>
				<?
				}
			?>
			</select>
			<input type="hidden" name="name_cat_<?=$w?>" id="name_cat_<?=$w?>" value="">
			<script language="javascript">
			document.getElementById('param').innerHTML = ''; 
			</script>				
			<?
			}
		} 
	elseif(!$magaz)
		{
		?>
		<script language="javascript">
		search_param(<?=$w?>, <?=$id_catalog?>);
		</script>
		<?
		}
	?>