var createSlider = function() {
	var elem    = (arguments.length > 0) ? arguments[0] : '';
	var wflag = (arguments.length > 1) ? arguments[1] : true;
	var width = (arguments.length > 2) ? arguments[2] : false;
	var bottom = "<a href='#' class='prev' style='position:absolute;top:107px;left:0px;width:20px;height:40px;display:block;z-index:101;'><img src='/img/arrow-prev.png' width='20' height='40' alt='Arrow Prev'></a><a href='#' class='next' style='position:absolute;top:107px;left:0px;width:20px;height:40px;display:block;z-index:101;'><img src='/img/arrow-next.png' width='20' height='40' alt='Arrow Next'></a>";
	elem.append(bottom);
	var w;
	if(width && width != "false" && width != false){
		w = width;
	}else{
		w = elem.find(".slides_container").width();	
	}
	elem.find(".next").each(function(){
		$(this).css("left",w-20);
	});
	
	elem.find(".slides_container").each(function(){
		$(this).css("overflow","hidden");
		
		if(wflag || (width && width != "false" && width != false)){
			$(this).css("width",w);
		}
		
	});
	elem.find(".slides_container div.slide").each(function(){
		$(this).css("width",w);
	});
	elem.slides({ 
		preload: false,
		effect: 'fade',
		preloadImage: "/img/loading.gif",
		generatePagination: false,
		play: 5000,
		autoHeight: true,
		hoverPause: true,
//		start: startSlide,
//		animationStart: function(){
//			var top = elem.find(".slides_control").height()/2-21;
//			elem.find(".next").each(function(){
//				$(this).css("top",top);
//			});
//			elem.find(".prev").each(function(){
//				$(this).css("top",top);
//			});
//		},
		autoHeightComplete: function(current){
			var top = elem.find(".slides_control").height()/2-21;
			elem.find(".next").each(function(){
				$(this).css("top",top);
			});
			elem.find(".prev").each(function(){
				$(this).css("top",top);
			});
		}
	});
}
