function rotate(bg, text, stop)
{
  //alert(bg);
  //var myDiv = document.getElementById('ctl00_LeftPanel_RotatingFeaturedContent_FeatureBackgroundContainer');
  var myDiv = (document.getElementById('ctl00_LeftPanel_RotatingFeaturedContent_FeatureBackgroundContainer') ? document.getElementById('ctl00_LeftPanel_RotatingFeaturedContent_FeatureBackgroundContainer') : 'document'); // check if container exists or use the whole document
    
  //.setAttribute("style", "height:100px;background-image: url(" + bg + ");");
  //myDiv.setAttribute("cssText","height:310px;margin:3px 0 0 0;padding:0px 0 0 0; border-top:1px solid #fff;background: #62926d url(" + bg + ") no-repeat;");
  myDiv.style.cssText = "height:310px;margin:3px 0 0 0;padding:0px 0 0 0; border-top:1px solid #fff;background: #62926d url(" + bg + ") no-repeat;"
  var lsRegExp = /\+/g;
  document.getElementById("ctl00_LeftPanel_RotatingFeaturedContent_FeatureText").innerHTML = URLDecode(text); 
  //document.getElementById("spinner").setAttribute("href",_link);
  //document.getElementById("spinner").innerHTML =_link;
  //document.getElementById("spcontent").setAttribute("href",_link);
  //document.getElementById("spcontent").innerHTML = _text;
  //document.getElementById("spvisit").setAttribute("href",_link);
  //alert('Done');
  if(stop == "::pause")
    rotatorStop();
}

function URLDecode(psEncodeString)
{
  // Create a regular expression to search all +s in the string
  var lsRegExp = /\+/g;
  // Return the decoded string
  return unescape(String(psEncodeString).replace(lsRegExp, " "));
}

var timerID = 0;
var imageID = 0;
rotatorStart();
//getImageList();

function getImageList()
{
  var section = (document.getElementById('ctl00_LeftPanel_RotatingFeaturedContent_SpotlightList') ? document.getElementById('ctl00_LeftPanel_RotatingFeaturedContent_SpotlightList') : 'document'); // check if container exists or use the whole document
  if ( !section.getElementsByTagName('a') ) return;
  
  var links = section.getElementsByTagName('a');
  
  if(imageID >= links.length)
    imageID = 0;
  var s = links[imageID].getAttribute('onmouseover');
  s = String(s).replace(/::pause/, "::dontpause");
  s = String(s).replace(/function anonymous\(\)/, "");
  s = String(s).replace(/{/, "");
  s = String(s).replace(/}/, "");
  s = String(s).replace(/function onmouseover\(\)/, ""); //W&C add: AJ 11/12/09 fixes error under IE8

  eval(s);
  imageID++;
}


function rotatorStart() {
   timerID  = window.setInterval("getImageList()", 5000);
   //alert("starting");
}

function rotatorStop() {
   if(timerID) {
      clearInterval(timerID);
      timerID  = 0;
      //alert("stopping");
   }
}