function Feature(var_name) {

	this.var_name = var_name;
	
	this.count = 0;
	this.index = 0;
	
	this.timer = true;
	this.timer_obj = 0;
	this.timer_duration = 6500;	
	this.timer_fade = 1.0;
	
	this.div_base = 'features';
	//Items are: 
	//	itemnav - Next-Prev grouping
	//	itemX - 1,2,3,etc, item groups.
	
	this.init = function(size) {
		this.count = size;
		this.index = 1;
	};
	
	this.start = function() {
		$(this.div_base + "Bar").style.display = 'block';
		//$(this.div_base + "ItemCount").style.display = 'block';
		this.show();
	};

	this.next = function() {	
		this.index++;
		if(this.index > this.count) {
			this.index = 1;
		}
		clearTimeout(this.timer_obj);
		this.show();
	};
	
	this.prev = function() {	
		this.index--;
		if(this.index <= 0) {
			this.index = this.count;
		}
		clearTimeout(this.timer_obj);
		this.show();
	};
	
	this.auto = function() {	
	
		//Fade Out Old		
		//afterFinish: this.autoend,TempFeature: this
		//$('item1').style.display = 'block';
		//$('item2').style.display = 'block';
		
		//new Effect.Opacity('item1', {duration:1.0, from:1.0, to:0.0});
		//new Effect.Opacity('item2', {duration:1.0, from:0.0, to:1.0});
		
		
		this.index++;
		if(this.index > this.count) {
			this.index = 1;
		}
		this.show();

	};
	
	this.autoend = function(callback) {
		var tempFeature = callback['options']['TempFeature'];
		tempFeature.show();
		$(tempFeature.div_base + tempFeature.index).style.display = 'none';
		//
	};
	
	this.show = function() {
		for(var i=1; i<=this.count; i++) {
			$(this.div_base + i).style.display = 'none';
		}
		$(this.div_base +  this.index).style.display = 'block';
		
		if(this.timer) {
			this.timer_obj = setTimeout(this.var_name + '.auto()',this.timer_duration);
		}
		$(this.div_base +  'ItemCount').innerHTML = '' + this.index + ' of ' + this.count;	
		$(this.div_base +  'ItemLink').innerHTML = $(this.div_base +  this.index).getAttribute('title');	//Get title
		$(this.div_base +  'ItemLink').setAttribute('href',$(this.div_base + 'Link' + this.index).getAttribute('href'));
	};
} 
