clsSlider = function(list, targets){ 	
	this.imgList = list;
	this.fadeTimeout = 1000;
	var _this = this;
	this.curIndex = 0;
	this.targetSelector = targets;
		
	this.preload = function(){
		var imgPreload = new Image();
		for(x in this.imgList){
			imgPreload.src = sBaseHref + '/upload/slider/' + this.imgList[x];
		}
	};
	
	this.fadeImg = function(imgUrl, targetSelector){
		var objImg = $('<img />');
		objImg.attr('src', sBaseHref+'/upload/slider/' + imgUrl); 
				
		$(objImg).animate({opacity: 0}, 0);
		$(targetSelector).append(objImg);


		$(objImg).animate({opacity: 1}, 1000, function(){
			if($(targetSelector + ' img ').length > 1){
				$(targetSelector + ' img:first').remove();
			}
		});
	};
	
	this.process = function(){
//		this.imgList.sort(function() {return (Math.round(Math.random())-0.5);}); 
		for(x in this.targetSelector){
			if(this.imgList[this.curIndex] != undefined){
				this.fadeImg(this.imgList[this.curIndex], this.targetSelector[x]);
			}
			if(this.imgList[this.curIndex+1] == undefined){
				this.reset();
			}else{
				this.curIndex++;
			}
		} 		
	};
	
	this.reset = function(){
		this.curIndex = 0;
	};
	
	$(document).ready(function(){
		_this.preload();
		setInterval(function(){
			_this.process();
		}, 5000);
		
		_this.process();
	});
	
};
