var adImages = new Array();
  // Enter the names of the images below
  // REMEMBER TO CHANGE THE CODE ON INDEX.SHTML TO REFLECT IMAGE 0 HERE
  adImages[0]="/images/feature_images/early_detection_on.jpg";
  adImages[1]="/images/feature_images/comfort_healing_on.jpg";
  adImages[2]="/images/feature_images/brightening_lives_on.jpg";
  adImages[3]="/images/feature_images/today_future_on.jpg";
  
  
var adBackground = new Array();
//Enter the corresponding background colors
  adBackground[0]="url(/images/feature_images/rightcolumn1.jpg) no-repeat transparent left center";
  adBackground[1]="url(/images/feature_images/rightcolumn2.jpg) no-repeat transparent left center";
  adBackground[2]="url(/images/feature_images/rightcolumn3.jpg) no-repeat transparent left center";
  adBackground[3]="url(/images/feature_images/rightcolumn4.jpg) no-repeat transparent left center";
  
var adText = new Array();
//Enter the descriptive title
   adText[0] = "";
   adText[1] = "";
   adText[2] = "";
   adText[3] = "";

var adLink = new Array();
//Enter the URL to the full story
   adLink[0] = "http://www.sjhcfoundation.org/stories/index.htm";
   adLink[1] = "http://www.sjhcfoundation.org/stories/index.htm";
   adLink[2] = "http://www.sjhcfoundation.org/stories/index.htm";
   adLink[3] = "http://www.sjhcfoundation.org/stories/index.htm";
 
  
   
var thisAd = 0;
var imgCt = adImages.length;

function rotate() {
 if(document.images) {
 

   if (thisAd == imgCt) {
      thisAd = 0;
   }

   document.getElementById('adBanner').src=adImages[thisAd];


 featureTitle(thisAd)
  thisAd++;
  
	  setTimeout("rotate()", 7 * 1000)

 }
 


}


function featureTitle(thisAd)  {

   var totalArray = "<br />";
   var newValue = "";
   var newHref = "";

   for (i=0;i<adText.length;i++)
   {
   
      if (i == thisAd)
      {
      
         newValue = "<strong><a style=\"color: #fff;_margin-left:-15px;background: " + adBackground[i] + ";\" href=\"" + adLink[i] + "\">" + adText[i] + "</a></strong><br /><br /><script language=\"javascript\" type=\"text/javascript\">document.getElementById('newBg').href=adLink[" + i + "];</script>";
      
      } else {      
      
         newValue = "<a onMouseOver=\"document.getElementById('adBanner').src=adImages[" + i + "]; document.getElementById('newBg').href=adLink[" + i + "]; featureTitle(" + i + ");\" href=\"#\">" + adText[i] + "</a><br /><br />";
           
      }

      
      totalArray = totalArray + newValue;
   }

   var newVar = totalArray;
   document.getElementById('adText').innerHTML = newVar;
   
}



