function NewsRotate() {

	var me = this;
	var numNewsCount = 0;
	var numCurrentNews = 0;
	var numLoopCount = 0;
	var jqCon;
	var jqNews;
	var jqControl;
	var timerRotate;
	this.numRotateTime = 5000; // millisec
	this.numLoopsToDo = -1; // number of loop to show before it stops.  -1 for infinite
	this.boolClickControlKillRotation = false; // if true, kill the rotation timer when the control is clicked
	
	this.init = function(strConId) {
		// get dom objects & init params
		jqCon = $('#'+strConId);
		jqNews = jqCon.find('.news').find('li');
		jqControl = jqCon.find('.control').find('li');
		numNewsCount = jqNews.length;
		
		//  hide all news
		jqNews.hide();
		
		// patch click events to controls
		jqControl.click(function() {
			// set current news number
			numCurrentNews = jqControl.index(this);
			// show one news
			me.show(numCurrentNews);
			if (me.boolClickControlKillRotation) {
				// kill rotation
				clearInterval(timerRotate);
			} else {
				// reset timer
				me.resetTimer();
			}
		});
		
		// auto show the first news
		me.show(0);

		// set auto rotate
		me.resetTimer();
	}
	
	this.nextIndex = function() {
		numCurrentNews++;
		if (numCurrentNews > numNewsCount-1) {
			numCurrentNews = 0;
			numLoopCount++;
		}
		return numCurrentNews;
	}

	this.prevIndex = function() {
		numCurrentNews--;
		if (numCurrentNews < 0) {
			numCurrentNews = numNewsCount-1;
		}
		return numCurrentNews;
	}

	this.show = function(index) {
		// hide all first
		jqNews.hide();
		// show one news
		jqNews.eq(index).fadeIn();
		// lo-lite all control buttons
		jqControl.removeClass('on');
		// hi-lite the control button
		jqControl.eq(index).addClass('on');
	}

	this.resetTimer = function() {
		clearInterval(timerRotate);
		timerRotate = setInterval(
			function() {
				// if current loop count hasn't reached the given loop limit
				if (me.numLoopsToDo == -1 || me.numLoopsToDo > numLoopCount) {
					// show next slide
					me.show(me.nextIndex());
				} else {
					// kill the timer
					clearInterval(timerRotate);
				}
			}, me.numRotateTime);
	}

}