function body(){
	//
        
        
	$('.next,.prev').click(function(){
		clearInterval(SINT);
		var t=$(this).attr('class')=='pa next'?'f':'b';
		slideIt(t);
		SINT=setInterval(function(){slideIt('f');},6000);
	});
	// SLIDESHOW
	// массив изображений
	IMAGES=new Array();
	TITLES=new Array();
	$('#slideshow').find('img').each(function(){
		IMAGES.push($(this).attr('src'));
		TITLES.push($(this).attr('title'));
	});
	// вставляем картинки по умолчанию
	$('.d0').css({backgroundImage:'url('+IMAGES[0]+')'}).attr('name',0).find('div').show().html(TITLES[0]);
	$('.d1').css({backgroundImage:'url('+IMAGES[1]+')'}).attr('name',1).find('div').find('div').html(TITLES[1]);
	$('.d_1').css({backgroundImage:'url('+IMAGES[IMAGES.length-1]+')'}).attr('name',IMAGES.length-1).find('div').html(TITLES[IMAGES.length-1]);
	$('.d_2').css({backgroundImage:'url('+IMAGES[IMAGES.length-2]+')'}).attr('name',IMAGES.length-2).find('div').html(TITLES[IMAGES.length-2]);
	SINT=setInterval(function(){slideIt('f');},6000);
	//
	$('.poiskbtn').mouseover(function(){$(this).attr('src','images/poisk_hover.png');}).mouseleave(function(){$(this).attr('src','images/poisk.png');});
// SLIDEIT
SIZE=IMAGES.length;
}
// body() end
sFlag=false;

function slideIt(direction){
	if(!sFlag){
		// четыре дива, меняем изображения в них
		sFlag=true;
		var SPEED=800;
		switch(direction){
			case'f':
				// вперед
				$('.d_2').show().animate(
					{
						left:'-101px',
						top: parseInt($('.d_1').css('top'))+'px',
						opacity: 0.3,
						filter:"alpha(opacity=30)"
					}
				,SPEED).css({zIndex:1});
				$('.d_1').css({zIndex:2}).animate(
					{
						left: parseInt($('.d0').css('left'))+'px',
						top: parseInt($('.d0').css('top'))+'px',
						width: parseInt($('.d0').css('width'))+'px',
						height: parseInt($('.d0').css('height'))+'px',
						opacity: 1.0,
						filter:"alpha(opacity=100)"
					}
				,SPEED);
				$('.d0').animate(
					{
						left: parseInt($('.d1').css('left'))+'px',
						top: parseInt($('.d1').css('top'))+'px',
						opacity: 0.3,
						filter:"alpha(opacity=30)",
						width: parseInt($('.d1').css('width'))+'px',
						height: parseInt($('.d1').css('height'))+'px'
					}
				,SPEED).css({zIndex:1}).find('div').slideUp(600);
				$('.d1').animate(
					{
						top: '-25px',
						left:'-110px',
						opacity: 0.0,
						filter:"alpha(opacity=0)"
					}
				,SPEED).css({zIndex:0});
				// меняем классы
				setTimeout(function(){
					$('.d1').attr('class','pa d_22');
					$('.d0').attr('class','pa d1');
					$('.d_1').attr('class','pa d0');
					$('.d_2').attr('class','pa d_1');
					$('.d_22').attr('class','pa d_2').hide();

					$('.d0').find('div').slideDown(500);
					sFlag=false;
				},SPEED);
				// вставляем картинки
					// d_2 => d_1
					var N=parseInt($('.d_1').attr('name'));
					N-1>=0?N-=1:N=SIZE-1;
					$('.d_2').css({backgroundImage:'url('+IMAGES[N]+')'}).attr('name',N).find('div').html(TITLES[N]);
				//
				break;
			case'b':
				// назад
				$('.d1').css({zIndex:2}).animate(
					{
						left: parseInt($('.d0').css('left'))+'px',
						top: parseInt($('.d0').css('top'))+'px',
						opacity: 1.0,
						filter:"alpha(opacity=100)",
						width: parseInt($('.d0').css('width'))+'px',
						height: parseInt($('.d0').css('height'))+'px'
					}
				,SPEED);
				$('.d0').animate(
					{
						left: parseInt($('.d_1').css('left'))+'px',
						top: parseInt($('.d_1').css('top'))+'px',
						opacity: 0.3,
						filter:"alpha(opacity=30)",
						width: parseInt($('.d_1').css('width'))+'px',
						height: parseInt($('.d_1').css('height'))+'px'
					}
				,SPEED).css({zIndex:1}).find('div').slideUp(600);
				$('.d_1').animate(
					{
						left: parseInt($('.d_2').css('left'))+'px',
						top: parseInt($('.d_2').css('top'))+'px',
						opacity: 0.0,
						filter:"alpha(opacity=0)"
					}
				,SPEED).css({zIndex:0});
				$('.d_2').show().animate(
					{
						left:'401px',
						top:'-5px',
						opacity: 0.3,
						filter:"alpha(opacity=30)"
					}
				,SPEED).css({zIndex:1});

				// меняем классы
				setTimeout(function(){
					$('.d_2').attr('class','pa d11');
					$('.d_1').attr('class','pa d_2').hide();
					$('.d0').attr('class','pa d_1');
					$('.d1').attr('class','pa d0');
					$('.d11').attr('class','pa d1');

					$('.d0').find('div').slideDown(500);
					sFlag=false;
				},SPEED);
				// вставляем картинки
					// d_2 => d_1
					var N=parseInt($('.d1').attr('name'));
					N+1<SIZE?N+=1:N=0;
					$('.d_2').css({backgroundImage:'url('+IMAGES[N]+')'}).attr('name',N).find('div').html(TITLES[N]);
				//
				break;
		}
	}
}

