function swapRight(){
	 clearInterval(showtime);
	 if(midaction==true){
	 	exit;
	 }
	 midaction = true;
	 
	 var $hiddenfirst = $('.hiddenfirst');  
     var $active = $('.first');
     var $nextfirst = $('.first').next();
	 var $nextactive = $nextfirst.next();
	 var $nextnormal = $nextactive.next();
	 var $nextnormal2 = $nextnormal.next();
	 var $nextend = $nextnormal2.next();
	 var $nextlast = $nextend.next();
	  
	$hiddenfirst.removeClass('hiddenfirst').css('left','').remove()
	$hiddenfirst.appendTo('.scroll');

    $active.animate({left: '-=210'}, 2000, function() {	$active.removeClass('first').css("left", -360).addClass('hiddenfirst');	});
    $nextfirst.animate({left: '-=200'}, 2000, function() { $nextfirst.removeClass('hidden'); $nextfirst.addClass('first').css("left", -160); });
	$('.mainimage').animate({ opacity: 1.0 },500).fadeOut('slow', function() { $('.mainimage').css("background", $nextactive.css("background")); $('.mainimage').fadeIn(); $('.mainimage').children().html($nextactive.html()); $('.mainimage div').attr("class", $nextactive.children().attr("class")); });
    $nextactive.animate({left: '-=200'}, 2000, function() {	$nextactive.removeClass('normal'); $nextactive.addClass('hidden').css("left", 40);	});
	$nextnormal.animate({left: '-=200'}, 2000, function() {	$nextnormal.css('left', 0); });
	$nextnormal2.animate({left: '-=200'}, 2000, function() { $nextnormal2.css('left', 0); midaction = false; showtime = setInterval('swapRight()', 6000);}); 
	$nextend.animate({left: '-=200'}, 2000, function() { $nextend.css('left', 0);
	});   
}



	
function swapLeft(){
	 
	 if(midaction==true){
	 	exit;
	 }
	 midaction = true;
	 
	clearInterval(showtime);
	 
	var $hiddenfirst = $('.hiddenfirst');  
    var $first = $('.first');
    var $nextnormal = $('.first').next();
	var $nextnormal2 = $nextnormal.next();
	var $nextlast = $nextnormal2.next();
	var $notused = $nextlast.next();
	var $notused2 = $notused.next();
	var $nexthidden = $notused2.next();	 
	$hiddenfirst.animate({left: '+=200'}, 2000, function() {$hiddenfirst.removeClass('hiddenfirst').css("left", -160).addClass('first');});
    $first.animate({left: '+=200'}, 2000, function() {$first.removeClass('first').css("left", '').addClass('hidden');});	
	$('.mainimage').animate({ opacity: 1.0 },500).fadeOut('slow', function() { $('.mainimage').css("background", $first.css("background")); $('.mainimage').fadeIn(); $('.mainimage').children().html($first.html()); $('.mainimage div').attr("class", $first.children().attr("class"));});
	$nextnormal.css("left", 312);
    $nextnormal.animate({left: '+=200'}, 2000, function() {	$nextnormal.removeClass('hidden'); $nextnormal.css("left", 0).css("left", '');});
	$nextlast.animate({left: '+=200'}, 2000, function() { $nextlast.css("left", 0);	});
    $nextnormal2.animate({left: '+=200'}, 2000, function() {$nextnormal2.css("left", 0);	});
	$notused.animate({left: '+=200'}, 2000, function() { $notused.css("left", 0); midaction = false; showtime = setInterval('swapRight()', 6000);});
	$('.scroll div:last').remove().prependTo('.scroll').css('left' ,-360).addClass('hiddenfirst');
}