var t;
var x_pos=0;
var nu_img,image_index=0;
var tc=1;
  
function timedAnimator()
{
var t_img,t_div,url1,url2,nu_index;


if (x_pos==0)
{  
 do{   nu_index=Math.ceil(10*Math.random())}while(nu_index==image_index);
 image_index=nu_index;    
   
   t_div=document.getElementById("div"+image_index);
   t_img=document.getElementById("img"+image_index);
   
   //store URLs
   url1=t_div.style.backgroundImage;
   url2=t_img.src;
   
   url1=url1.substr(4,url1.length-5);
   if (url1.charAt(0)=='"')
   { 
   	 url1=url1.substr(1,url1.length-2);
   }
   
   t_div.style.backgroundImage="url("+url2+")";
   t_img.style.left = "-100px";
   t_img.src=url1;
   
   x_pos=-t_img.width;
}

x_pos =Math.floor(x_pos*.8)+1;
t_img=document.getElementById("img"+image_index);
t_img.style.left = x_pos+"px";

t=setTimeout("timedAnimator()",40);
}

//No preloading needs to be done, but we do need to set the backgrounds from the 'alts'
function imagePreloader()
{
var n,t_div,t_img;

	for(n=1;n<=10;n++)
	{
	 	t_div=document.getElementById("div"+n);
		t_img=document.getElementById("img"+n);

		t_div.style.backgroundImage="url("+t_img.alt+")";
	}
	t=setTimeout("timedAnimator()",40);
}
