function bene_crossfades(obj) {
	this.c = $(obj.container); 				//CONTAINER
	if (this.c) {
		this.ftime = obj.fadeTime;
		this.iTime = obj.interval;
		this.children = this.c.children('img'); //ENFANT IMG
		this.t = this.children.length; 			//TOTAL
		this.children.eq(0).siblings('img').hide();
		this.inc = 0;
		
		this.cx = function() {
			this.children.eq((this.inc)).fadeOut(this.ftime);
			if (this.inc>=this.t-1) { this.inc=-1; }
			this.children.eq(this.inc+1).fadeIn(this.ftime);
			this.inc++;
		}
		if(this.t>1){
			setInterval('xfades.cx()',this.iTime);
		}
	}
}

$(function(){
	xfades = new bene_crossfades(
		{
			container: '#home_bg',
			fadeTime : 1000,
			interval : 5000
		}
	);
})

