$(function(){
	transitions2 = new function(){
			
		var imageCount2;
		var current2 = -1;
		
		
		this.construct = function(images, rotationObj){
			imageCount2 = images;
			rPos2 = rotationObj;
			this.changeImage();
		}
		
		this.changeImage = function(){
			if(current2 == -1){
				current2 = current2 + 1;
				$("#" + rPos2 + " img.img_" + current2).fadeIn(3000, function(){
				   $("#" + rPos2).animate({left:0}, 2000, function(){
					   transitions2.changeImage();
					});
			   });
			} else if((current2 + 1) <= imageCount2){
				$("#" + rPos2 + " img.img_" + current2).fadeOut(2000);
				current2 = current2 + 1;
				$("#" + rPos2 + " img.img_" + current2).fadeIn(2000, function(){
				   $("#" + rPos2).animate({left:0}, 2000, function(){
					   transitions2.changeImage();
					});
			   });
			} else {
				$("#" + rPos2 + " img.img_" + current2).fadeOut(2000);
				current2 = 0;
				$("#" + rPos2 + " img.img_0").fadeIn(2000, function(){
					$("#" + rPos2).animate({left:0}, 2000, function(){
						transitions2.changeImage();
					});
			   });
			}
		}
		
	}
	
});

