		<?
		if(!$baraholka) $kolvip=3; else $kolvip=4;
		//echo $query_vip;
		$r=mysql_query($query_vip);
		$nr=mysql_num_rows($r);
		if($nr)
		{
		$i=0;
		echo '<b>VIP объявления</b><br>';
		while($rr=mysql_fetch_array($r))
			{
			$tmp_dop='';
			if($rr['f_cena_'])
				{
				$tmp_dop = '<br>'.$rr['f_cena_'].' '.$rru['cena_valuta'];
				if($rr['suff']) $tmp_dop .= $rr['suff'];
				}

			if(file_exists($base_path.'foto_vip/'.$rr['id'].'m.jpg'))
				{
				$tmp_vip[$i] .= '<table width="200"><tr><td align=center>';
				$tmp_vip[$i] .= '<a href="'.$bp.'items/'.$rr['zag_url'].'_'.$rr['id'].'" ><img class="imground" src="'.$bp.'foto_vip/'.$rr['id'].'m.jpg" border=0></a><br>';
				$tmp_vip[$i] .= '<a href="'.$bp.'items/'.$rr['zag_url'].'_'.$rr['id'].'" >'.$rr['zag'].'</a>'.$tmp_dop;
				$tmp_vip[$i] .= '</td></tr></table>';
				}
			else
				{
				$tmp_vip[$i] .= '<table><tr><td align=center valign=middle class="imground" width="200" height="200" bgcolor="#D6D6D6">';
				$tmp_vip[$i] .= '<a href="'.$bp.'items/'.$rr['zag_url'].'_'.$rr['id'].'" >'.$rr['zag'].'</a>'.$tmp_dop.'</td></tr></table>';
				}
			
			$tmp_vip[$i] .= '<p>';
			$i++;
			}
			
		if($tmp_vip)
			{
			if(count($tmp_vip)<=$kolvip)
				{
				shuffle($tmp_vip);
				foreach($tmp_vip as $tmp_v)
					{
					echo $tmp_v;
					}
				}
			else
				{
				echo '<div id="vip"></div>';
				?>
				<script>
				var vip = new Array();
				<?
				foreach($tmp_vip as $index=>$tmp_v)
					{
					echo "\n vip[".$index."] = '".$tmp_v."';";
					}
				?>
				
				var cou=<?=$kolvip?>;
				var txt = '';
				
				function toNext()
					{
					txt='';
					Array.prototype.shuffle = function( b ){ var i = this.length, j, t; while( i )  {  j = Math.floor( ( i-- ) * Math.random() );  t = b && typeof this[i].shuffle!=='undefined' ? this[i].shuffle() : this[i];  this[i] = this[j];  this[j] = t; } return this;};
					vip.shuffle();
					for(i = 0; i < cou; i++)
						{
						txt = txt+vip[i];
						}
					document.getElementById('vip').innerHTML = txt; 
					$(".imground").corner("round");
					}
					
				toNext();
				
				function start_viget()
					{
   					setInterval('toNext()',6000);
					}
				start_viget();

				</script>
				<?
				}
			}
		}
		?>