jQuery.fn.listaDestaques = function (options) {
	var opts = jQuery.extend({
		timer: 6000,
		fadeSpeed: "normal",
		autoPlay: true,
		classAt: "dstBtAt",
		classOver: "dstBtOver"

	}, options);

	this.each(function(){

		//Configs iniciais

		var Interval;
		var Father		= $(this);
		var selItem		= 1;
		var nItens 		= $(".item_dest", Father).size();

		$('.item_dest', Father).hide();

		//$('.item_dest:first', Father).show();

		$(".listaDestaques", Father).css('position', 'relative');

		$('.item_dest', Father).css('position', 'absolute');

		
		//----------------

		
		//Funcoes		

		function showDst (n){

			if (opts.autoPlay) { stopDst(); }

			$(".item_dest", Father).fadeOut(opts.fadeSpeed);

			$(".item_dest:eq("+(n-1)+")", Father).fadeIn(opts.fadeSpeed);

				selItem = n;

				$(".btRpt", Father).removeClass(opts.classAt);

				$(".btRpt:eq("+(n-1)+")", Father).addClass(opts.classAt);

				if (opts.autoPlay) { playDst(opts.timer); }

		}

		function nextDst () {

			if (selItem > nItens-1) {

				n = 1;

			} else {

				n = selItem + 1;

			}

			if (nItens > 1) {

			showDst(n);

			}



		}

		function playDst (t) {

			Interval = setTimeout(nextDst, t);

		}

		
		function stopDst () {

			clearTimeout(Interval);

		}

		//-------

		//Crio os Botoes

		var btModel = $(".btRpt:last", Father);

		for (i=0; i<nItens-1; i++) { btModel.clone().insertAfter(btModel); }

		

		var lblBt = 0;

		$(".btRpt", Father).each(function(){

			lblBt++;

			$(this).html(lblBt);

			$(this).click(function(){

				n = parseFloat($(this).html());

				if (selItem != n) {

					showDst(n);

				}

			});
			

			$(this).hover(function(){

				$(this).addClass(opts.classOver);

			},

			function(){

				$(this).removeClass(opts.classOver);

			});

		});

		//--------------

		

		showDst (1);

		if (opts.autoPlay) { playDst(opts.timer); }

		

		

	});

}
