this.swaper = function(o, i) {

	var ass = 1; /* autos-lider status */
	
	/*decoration frames*/
	var fs = new Array() /*size of the frames*/
	fs["th"] = $(o + " > div.t").height();
	fs["rw"] = $(o + " > div.r").width();
	if (!(i)){
		fs["bh"] = $(o + " > div.b").height();
	}else{
		if (i.indexOf("px")) { 
		fs["bh"] = i;
		} else {
		fs["bh"] = "60px";
		}
	}
	fs["lw"] = $(o + " > div.l").width();

	
	/* animation of the slides */
	this.anim = function(f){

		var speed = 500;
		var aw = "3px"; /* width during animation*/
		var elemclass = "slcntbox" /* name of the class to use for the slider elements ennumeration */
		  
		$(o).children(".t").animate({height: aw, left: aw, right: aw}, speed).end().children(".b").animate({height: aw, left: aw, right: aw}, speed).end().children(".r").animate({width: aw}, (speed + 7)).end().children(".l").animate({width: aw}, (speed + 7));
		 
		setTimeout(function(){
					$(o).children(".t").animate({height: fs["th"], left: fs["lw"], right: fs["rw"]}, speed).end().children(".b").animate({height: fs["bh"], left: fs["lw"], right: fs["rw"]}, speed).end().children(".r").animate({width: fs["rw"]}, (speed - 10)).end().children(".l").animate({width: fs["lw"]}, (speed - 10));

		}, 1000);

	};
	
	$(o).children("div.frame").scrollTo(0, 0); /* slide to first position onload*/
	$(o + " > div.frame > ul > li").children("*:not(img.jqsimg)").css("opacity", "0")
	
	var t = $(o + " > div.frame > ul").children().size(); /*total elements in slider*/
	var w = $(o + " > div.frame > ul > li:first-child").width(); /* with of the contents */
	var elems = $(o + " > div.frame > ul > li");
	var nfocon = new Array() /* variable that contains the contents of the slider elements*/ 
	$(elems).each(function(i) {
		$(this).addClass("slcntbox" + i);
		nfocon[i] = $(".slcntbox" + i).children().not("img.jqsimg");
	});

	
	var sp = 0; /*slider position*/

	function nextslide() {
		if (a === undefined){
			var a = 0;
		}
		if (a === 0) {
		sp++
		
		var a = 1;
		
			if (!(sp === t)){
				$(o + " > div.frame").scrollTo(".slcntbox" + sp, 1000, {axis: "x", onAfter: function(){ shownfo(); a = 0} })
			}else{
				$(o + " > div.frame").scrollTo(0, 1000, {onAfter:function(){ shownfo(); a = 0}})
				sp = 0;
			}
			
			
			function shownfo() {
				$(o + " > .b").html("").html(nfocon[sp]).children().css('opacity', 0).fadeTo(1200,1);
			}
			
			anim(); /* trigers the frame animation at each slide */
		}
	}
	
	function prevslide() {
		if (a === undefined){
			var a = 0;
		}
		if (a === 0) {
		sp--
		var a = 1;
		
			if (!(sp === -1)){
				$(o + " > div.frame").scrollTo(".slcntbox" + sp, 1000, {axis: "x", onAfter: function(){ shownfo(); a = 0} })
			}else{
				$(o + " > div.frame").scrollTo(".slcntbox" + (t - 1), 1000, {onAfter:function(){ shownfo(); a = 0}})
				sp = (t - 1);
			}
			
			
			function shownfo() {
				$(o + " > .b").html("").html(nfocon[sp]).children().css('opacity', 0).fadeTo(1200,1);
			}
			
			anim(); /* trigers the frame animation at each slide */
		}
	}
	
	$(o).mouseenter(function(){ autoslideroff() }).mouseleave( function() { setTimeout(function(){ ass = 1; autoslider() },1000); } )
	
	function autoslideroff() {
		ass = 0;
	};
	
	function autoslider() {
		/*a revoir pas propre meme fancton que dans anim... */
		this.startingblocks = function() {
				$(o).children(".b").animate({height: fs["bh"], left: fs["lw"], right: fs["rw"]}, 1000);
				$(o + " > .b").html("").html(nfocon[0]).children().fadeTo(1500,1);
				
		}
		
		startingblocks();
		/*end a revoir */
		
		if (ass === 1) {
			var int = setInterval(function(){trigger()},5000);
		}
		
		function trigger() {
			if (ass === 0) {
				clearInterval(int);
				setTimeout(function(){ ass = 1; autoslider() },50000);
			}else{
				nextslide();
			}
		}
		
	}
	
	autoslider();
	/* $(o).children("a.next").click(function(){nextslide(); autoslideroff(); return false})
	.end().children("a.prev").click(function(){prevslide(); autoslideroff(); return false}) */
}

