window.RWS.slider = function(id, _cfg) {

	var cfg = {
		auto: true,
		continuous: true,
		numeric: true,
		numericId: id + "_controls"
	};

	jQuery.extend(cfg, _cfg);

	//if(typeof cfg.width == "undefined") { cfg.width = "100%"; }
	//if(typeof cfg.height == "undefined") { cfg.height = "250px"; }

	if(typeof jQuery.fn.easySlider  == "undefined") {

		if(document.createStyleSheet) {
			document.createStyleSheet("/scripts/easyslider/base.css");
		} else {
			jQuery('head').append('<link rel="stylesheet" href="/scripts/easyslider/base.css" type="text/css" />');
		}

		jQuery.ajax({
			type: "GET",
			url: '/scripts/easyslider/easySlider1.7.js',
			cache: true,
			dataType: 'script',
			success: function(data, status) {

				$("#" + id).css({visibility:"visible"}).easySlider(cfg);
			}
		});

	} else {

		$("#" + id).css({visibility:"visible"}).easySlider(cfg);
	}	

};

