//Time between pics switching in secs
var HowLongBetweenPic=2;

// image, link, alternate text
var ad_list = [
               ["dre2.jpg","http://www.digitalradioengineering.com/","Digital Radio Engineering"],
               ["bc2.jpg","http://www.baycountry.com/used_equipment.html","Bay Country"],
	       ["mv.jpg","http://www.theBDR.net/articles/myview.html","editorial link"],             
	       ["Shively2.jpg","http://www.shively.com/","Shively Labs"],
	       ["nab450.jpg", "http://www.radioshowweb.com/","NAB Radio SHow"]	
               ];

// nothing below this line should be messed with -- john

// This code was obtained from http://www.draac.com/picture-roll.html 
//Start at the what pic:
var PicNumber=3;
//Number of pics:
var NumberOfPictures = ad_list.length;

//SwitchPic Function
function SwitchPic(counter){
   if(counter < HowLongBetweenPic){
      counter++;
      //DEBUG in the status bar at the bottom of the screen
      window.status="Switch picture at 5 : "+counter+" PicNumber: "+PicNumber+" ";
		
      //Display pic in what <IMG> tag roll is what I called the image
      document.roll.src = "/gfx/" + ad_list[PicNumber][0];
      document.getElementById("rollurl").href = ad_list[PicNumber][1];
      document.roll.alt = ad_list[PicNumber][2];
		
      //function calls itself
      CallSwitchPic=window.setTimeout("SwitchPic("+counter+")",1500); 
		
   } else {
      PicNumber++;
      if(PicNumber == NumberOfPictures) PicNumber=0;
      SwitchPic(0);
   }
}
