/*Content Flipping Functions
  Written by: Enoch Liu
  All Rights Reserved. Copyright &copy; 2011 by Natural Selection, Inc.*/
  
var index = '1';
var numinfo = '3';
	   
function initializeFlipContent()
{
   // set a timer to flip the content every 30 seconds
   timer = setTimeout('flipContent()',30000);
   
}
function flipContent()
{
   var timer;
		  
   showNextInfo();
}
	   
function showNextInfo()
{
   var image;
   var imagename;

   if(index < numinfo)
   {
      index++;
   }
   else
   {
      index = '1';
   }
		  
   imagename = 'img' + index;
		  
   image = document.getElementById(imagename);
   image.style.visibility = "visible";
   image.style.position = "relative";
			
   for(i = 1; i <= numinfo; ++i)
   {
      if(i != index)
      {
         imagename = 'img' + i;
         image = document.getElementById(imagename);
         image.style.visibility = "hidden";
         image.style.position = "absolute";
      }
   }				      
}

function showPrevInfo()
{
   var image;
   var imagename;

   if(index > 1)
   {
      index--;
   }
   else
   {
      index = numinfo;
   }
	     
   imagename = 'img' + index;
		  
   image = document.getElementById(imagename);
   image.style.visibility = "visible";
   image.style.position = "relative";
			
   for(i = 1; i <= numinfo; ++i)
   {
      if(i != index)
      {
         imagename = 'img' + i;
	     image = document.getElementById(imagename);
         image.style.visibility = "hidden";
         image.style.position = "absolute";
      }
   }	
}

