var i = 0;
var start = 0;
$(document).ready(function(){
 $.get('filelist.php',{start: start},callbackFunction);

 <!--подмена ссылки для первого новостного блока-->
	var podm = $('a.news-summary:eq(0)').attr("href");
	var podm_ = $('a.news-summary:eq(1)').attr("href");
	var podm_2 = $('a.news-summary:eq(2)').attr("href");
	var podm_3 = $('a.news-summary:eq(3)').attr("href");
	if(podm=='/news/2010/03/17/zagolovok_novoj_novosti_59/'){
	$('a.news-summary:eq(0)').attr('href','/catalog/dezinfecziya/');	
	}
	if(podm_=='/news/2010/03/17/zagolovok_novoj_novosti_59/'){
	$('a.news-summary:eq(1)').attr('href','/catalog/dezinfecziya/');	
	}
		if(podm_2=='/news/2010/03/17/zagolovok_novoj_novosti_59/'){
	$('a.news-summary:eq(2)').attr('href','/catalog/dezinfecziya/');	
	}
		if(podm_3=='/news/2010/03/17/zagolovok_novoj_novosti_59/'){
	$('a.news-summary:eq(3)').attr('href','/catalog/dezinfecziya/');	
	}
	

 $('#rightArrow').click(function() {
  start = start + 8;
  $.get('filelist.php', {start: start}, callbackFunction);
  return false;
 });

 $('#leftArrow').click(function() {
 start = (start - 8 > 0) ? start - 8 : 0;
 $.get('filelist.php', {start: start}, callbackFunction);
 return false;
 });

function callbackFunction(html) {
if(html){
$('#galleryContainer').empty().append(html);
}

if ($('#galleryContainer em').is(":contains('restart')")) {
        start = 0;
        $('#galleryContainer').empty().append(html);

      } 

<!--вызов fancybox -->
	$('#galleryContainer .tab-body a').lightBox();

<!--Slideshow-->
	  window.setInterval(function() {
		var indexLast = $('.tab a').index($('.tab a:last'));
		var indexSlide = Math.round(Math.random() * indexLast);
		$('.tab-body').hide();
		$('.tab-body:eq('+indexSlide+')').show();
		}, 10000);

<!--Vkladki-->
      $('.tab-body:first').css('display','block');
	  $('.tab a:first').css('background','transparent');
		$('.tab a').click(function(){
          var index = $('.tab a').index($(this));
			$('.tab a').removeClass('active');
			$(this).addClass('active');

			$('.tab-body').hide();

			$('.tab-body:eq('+index+')').show();

			return false;

		});

}
});




