var numFeatures=5;
var animate=true;
var current=0;

function featureSet(f,L) //f is the feature to set.  L is a 0 or 1 and determines whether we should stop the animation  
{
 if (L==1)
  animate=false;
 for (z=0; z<numFeatures; z++)
 {
  if (z!=f)
	{
	 document.getElementById('feature'+z).style.display='none';
	 document.getElementById('featimg'+z).style.display='none';
	 document.getElementById('featurehead'+z).className='feature';
	}
 }
 document.getElementById('feature'+f).style.display='block';
 document.getElementById('featimg'+f).style.display='block';
 document.getElementById('featurehead'+f).className='featurehighlight';
 current=f;
}

function featureSetClass(f)
{
 keepHighlight=true;
 for (z=0; z<numFeatures; z++)
 {
  if (z!=f && document.getElementById('featurehead'+z).className=='featurehighlight') //there is another highlighted box, so turn this one yellow
	 keepHighlight=false;
 }
 if (!keepHighlight)
  document.getElementById('featurehead'+f).className='feature';
}

function featureAnimate()
{
 if (animate)
 {
  current=(current+1)%5;  
	featureSet(current,0);
 }
}

setInterval("featureAnimate()",3000);

