<table id="content" width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>
			  <?php 
$start = mysql_real_escape_string($_REQUEST['start']);
?>
			<?php if ($start=='') { 
$start=0;
}?>
              <?php
			$sql1 = "SELECT * FROM photos WHERE room_id='0' AND info_id='0' AND priority>'$start' ORDER BY priority LIMIT 24";
			$result1 = mysql_query($sql1);
       	    $countph=0;
			while ($myrow=mysql_fetch_array($result1)) {
			$countph++;
			$photoid=$myrow['id'];
			$photo=$myrow['name'];
			$photo_en=$myrow['name_en'];
			$photo_de=$myrow['name_de'];
			$photo_fr=$myrow['name_fr'];
            $photo_it=$myrow['name_it'];
            $photo_es=$myrow['name_es'];
            $photo_ru=$myrow['name_ru'];
			$ppriority=$myrow['priority'];
?>
<?php include 'lang.php';?> 
<?php if ($photo=='') { 
$photo=$company1;
}?>
              <?php include 'photo.php';?>
              <?php } ?>
              </td>
          </tr>
          <tr>
            <td><div align="center" style="clear: both; padding: 5px;">
              <?php
			$sql2 = "SELECT * FROM photos WHERE room_id='0' AND info_id='0' AND priority>'$start' ORDER BY priority LIMIT 1";
			$result2 = mysql_query($sql2);
			while ($myrow=mysql_fetch_array($result2)) {
			$ppriority1=$myrow['priority'];
}?>
              <?php
			$sql3 = "SELECT * FROM photos WHERE room_id='0' AND info_id='0' AND priority<'$ppriority1' ORDER BY priority desc LIMIT 24";
			$result3 = mysql_query($sql3);
			$num_prev = mysql_num_rows($result3);
			while ($myrow=mysql_fetch_array($result3)) {
			$ppriority2=$myrow['priority'];
}?>
              <?php
$startpr=$ppriority2 - 1;
?>
              <?php 
	if  ( ($ppriority2!='')) {
	?>
              <a href="javascript:history.go(-1);"><img src="/images/prev.png" alt=""></a>
              <?php } ?>
              <?php
			$sql4 = "SELECT * FROM photos WHERE room_id='0' AND info_id='0' AND priority>'$ppriority'";
			$result4 = mysql_query($sql4);
			$num_items = mysql_num_rows($result4);
?>
              <?php 
	if  ( ( $num_items!=0)) {
	?>
              <a href="gallery.php?start=<?php echo $ppriority ?>"><img src="/images/next.png" alt=""></a>
              <?php } ?>
              </div></td>
          </tr>
          </table>