<?
  // верхняя панель навигации
  function panel_list_items_top_navigat(&$system,&$options=array())
  { //damp_array($options) ;
    if ($options['no_any_panel']) return ;
    if ((!$options['panel_select_pages'] or $options['panel_select_pages']=='bottom') and (!$options['panel_select_usl'] or $options['panel_select_usl']=='bottom') and !$options['panel_diapazon_page']) return ;
	?><div id=panel_navigat class="top isCorner"><?
	  if ($options['panel_select_pages'] and $options['panel_select_pages']!='bottom') 	panel_select_pages($system,$options);
	  if ($options['panel_select_usl'] and $options['panel_select_usl']!='bottom') 		panel_select_usl($system,$options,1);
	  if ($options['panel_diapazon_page'] and $options['panel_diapazon_page']!='bottom')panel_diapazon_page($system,$options) ;
	?><div class=clear></div></div><?
  }

  // нижняя панель навигации
  function panel_list_items_bottom_navigat(&$system,&$options=array())
  { //damp_array($options);
    if ($options['no_any_panel']) return ;
    if ((!$options['panel_select_pages'] or $options['panel_select_pages']=='top') and (!$options['panel_select_usl'] or $options['panel_select_usl']=='top')/* and !$options['panel_diapazon_page']*/) return ;
	?><div id=panel_navigat class=bottom><?
	  if ($options['panel_select_pages'] and $options['panel_select_pages']!='top') 	panel_select_pages($system,$options);
	  if ($options['panel_select_usl'] and $options['panel_select_usl']!='top') 		panel_select_usl($system,$options,1);
	  if ($options['panel_diapazon_page'] and $options['panel_diapazon_page']!='top') 	panel_diapazon_page($system,$options) ;
	?><div class=clear></div></div><?
  }

  function panel_select_pages(&$system,$options=array()) // show_page_panel
  {  global $search_text ;
     //damp_array($system->pages_info) ;
     $text=array() ;
     $page_number_rasdel=$system->pages_info['options']['page_number_rasdel'] ;
     $cur_page=$options['current_page'] ;
     list($arr_pages,$to_prev,$to_next)=$system->prepare_panel_select_pages($options) ;
     //damp_array($arr_pages) ; damp_array($to_prev) ; damp_array($to_next) ;

     ?><div class=list_pages><?

     if (_sizeof($to_prev))  if ($to_prev['href']) echo '<a href="'.$to_prev['href'].'"><img src="'.$to_prev['img_src'].'" alt="" border="0"></a>' ;
                            else                  echo '<img src="'.$to_prev['img_src'].'" alt="" border="0">' ;

     if (_sizeof($arr_pages)) { foreach($arr_pages as $rec) $text[]=($rec['selected'])? "<span class=cur_page>".$rec['value'].'</span>':'<a href="'.$rec['href'].'" >'.$rec['value'].'</a>' ;
     						   echo implode(' ',$text) ;
     						 }
     if (_sizeof($to_next))  if ($to_next['href']) echo '<a href="'.$to_next['href'].'"><img src="'.$to_next['img_src'].'" alt="" border="0"></a>' ;
                            else                  echo '<img src="'.$to_next['img_src'].'" alt="" border="0">' ;

     ?></div><?
   }

   function panel_select_usl(&$system,$options=array(),$num=1)
   {  global $search_text ;
      //damp_array($system->pages_info['size']) ;
      //damp_array($system->pages_info['sort_type']) ;
      ?><div class=select_usl>
         <form name="sort_size<?echo $num?>" method="GET">
         <input name="page" type="hidden" value="1">
         <? $arr=$system->prepare_panel_page_size($options) ; //damp_array($arr) ;
            if (_sizeof($arr))
	          { ?><div class=panel_select_size>выводить
					<select name="size" onchange="document.forms.sort_size<?echo $num?>.submit();return(false);">
						 <? foreach ($arr as $rec)  {?><option value="<?echo $rec['value']?>"  <? if ($rec['selected']) echo 'selected'?>><?echo $rec['title']?></option><?}?>
					</select>
		         </div>
		        <?
		      }
			$arr=$system->prepare_panel_sort_usl($options) ;  //damp_array($arr) ;
            if (_sizeof($arr))
		      { ?><div class=panel_select_sort>сортировать по
					<select name="sort" onchange="document.forms.sort_size<?echo $num?>.submit();return(false);">
							 <? foreach ($arr as $rec)  {?><option value="<?echo $rec['value']?>"  <? if ($rec['selected']) echo 'selected'?>><?echo $rec['title']?></option><?}?>
					</select>
		         </div><?
		      }
	     if ($search_text) {?><input name="search_text" type="hidden" value="<?echo $search_text?>"><?}?>
		</form>
		</div>
	<?
   }

 function panel_diapazon_page($system,$options=array())
 {
    echo '<div class=panel_diapazon_page>'.$options['first_obj'].' ... '.$options['last_obj'].' из '.$options['count_obj'].'</div>' ;
    $system->first_obj=$options['first_obj'] ;
 }


?>
