//moveimages.js - Rotates images
//version 1.0
//2009
//By Andrew Brown

//time out for rotation - longer period of Time
function changeImages()
{
  setTimeout("changeImageMens()", 5000);
  setTimeout("changeImageLadies()", 8000);
  setTimeout("changeImageYouth()", 12000);
  setTimeout("changeImageKids()", 9500);
  setTimeout("changeImageLife()", 3000);
}
function mensChange()
{
   setTimeout("changeImageMens()", 10000);
}
function ladiesChange()
{
   setTimeout("changeImageLadies()", 10000);
}
function youthChange()
{
   setTimeout("changeImageYouth()", 10000);
}
function kidsChange()
{
   setTimeout("changeImageKids()", 10000);
}
function lifeChange()
{
   setTimeout("changeImageLife()", 10000);
}
//changes the image after browser has loaded
function changeImageMens()
{
   //obtains the images
	var mens1 = document.getElementById("mens1").style;
   var mens2 = document.getElementById("mens2").style;
   
	//rotates images
   if(mens1.zIndex == 1)
   {
      mens1.zIndex = 2;
	   mens2.zIndex = 1;
		mensChange(); //initiates the timeout again
   } 
	else
      if(mens1.zIndex == 2)
	   {
	      mens1.zIndex = 1;
	      mens2.zIndex = 2;
	   	mensChange();//initiates the timeout again
	   }
}
function changeImageLadies()
{
   //obtains the images
	var ladies1 = document.getElementById("ladies1").style;
   var ladies2 = document.getElementById("ladies2").style;
   
	//rotates images
   if(ladies1.zIndex == 1)
   {
      ladies1.zIndex = 2;
	   ladies2.zIndex = 1;
		ladiesChange(); //initiates the timeout again
   } 
	else
      if(ladies1.zIndex == 2)
	   {
	      ladies1.zIndex = 1;
	      ladies2.zIndex = 2;
	   	ladiesChange();//initiates the timeout again
	   }
}
function changeImageYouth()
{
   //obtains the images
	var youth1 = document.getElementById("youth1").style;
   var youth2 = document.getElementById("youth2").style;
   
	//rotates images
   if(youth1.zIndex == 1)
   {
      youth1.zIndex = 2;
	   youth2.zIndex = 1;
		youthChange(); //initiates the timeout again
   } 
	else
      if(youth1.zIndex == 2)
	   {
	      youth1.zIndex = 1;
	      youth2.zIndex = 2;
	   	youthChange();//initiates the timeout again
	   }
}
function changeImageKids()
{
   //obtains the images
	var kids1 = document.getElementById("kids1").style;
   var kids2 = document.getElementById("kids2").style;
   
	//rotates images
   if(kids1.zIndex == 1)
   {
      kids1.zIndex = 2;
	   kids2.zIndex = 1;
		kidsChange(); //initiates the timeout again
   } 
	else
      if(kids1.zIndex == 2)
	   {
	      kids1.zIndex = 1;
	      kids2.zIndex = 2;
	   	kidsChange();//initiates the timeout again
	   }
}
function changeImageLife()
{
   //obtains the images
	var life1 = document.getElementById("life1").style;
   var life2 = document.getElementById("life2").style;
   
	//rotates images
   if(life1.zIndex == 1)
   {
      life1.zIndex = 2;
	   life2.zIndex = 1;
		lifeChange(); //initiates the timeout again
   } 
	else
      if(life1.zIndex == 2)
	   {
	      life1.zIndex = 1;
	      life2.zIndex = 2;
	   	lifeChange();//initiates the timeout again
	   }
}