// JavaScript Document
;(function($) {
 
     $.fn.autoSwitch = function(options) {
         options = jQuery.extend({
             speed: 'normal', // 切换速度，可选值: slow, normal, fast
             keeptime: 3000    //每一个的停留时间，毫秒
         }, options);
 
         var _this = this;
         var _count = _this.length;
         var _currentIndex = 0;
 
         if (_count > 1) {
			 //_this.hide();
			 //_this.eq(0).show();
             _this.find('a').css('font-weight', 'normal');
			 _this.find('a').css('color', '#939393');
             _this.eq(0).find('a').css('font-weight', 'bold');
			 _this.eq(0).find('a').css('color', '#0068ab');
			 _this.eq(0).parent().css("background",'url('+_this.eq(0).find('a').attr('rel')+') right no-repeat');
			 //alert(_this.eq(0).find('a').attr('rel'));
             window.setInterval(function() {
                 _currentIndex = ++_currentIndex % _count;
                 //_this.filter(':visible').hide();
                 //_this.eq(_currentIndex).fadeIn(options.speed);
				 _this.find('a').css("font-weight", "normal" );
				 _this.find('a').css('color', '#939393');
				 _this.eq(_currentIndex).find('a').css("font-weight", "bold" );
				 _this.eq(_currentIndex).find('a').css('color', '#0068ab');
				 _this.eq(_currentIndex).parent().css("background",'url('+_this.eq(_currentIndex).find('a').attr('rel')+') right no-repeat');
             }, options.keeptime);
         }
 
         return this;
     }
 
})(jQuery);