

var count = 0;            // Place in imageFiles array
var Flag = 'Y';           // Clause to stop Recursive function
var delayTime = 3;        // seconds to delay between rotating icons, /common/images/icons/
var imageFiles = new Array("icon-facebook.gif", 
                           "icon-digg.gif", 
                           "icon-delicious.gif", 
                           "icon-google.gif", 
                           "icon-reddit.gif", 
                           "icon-yahoo.gif",
                           "icon-newsvine.gif");



function showSocialBookmarks() { //Shows or hides social bookmarks
  var socialBookmarks = document.getElementById("social-bookmarks");
  var shareLI = document.getElementById("share-bookmarks");

  if (socialBookmarks.style.display == "block") {
        shareLI.style.backgroundImage = "url('/common/images/icons/bg-icon-expand.gif')";
        shareLI.style.backgroundRepeat = "no-repeat";
        shareLI.style.backgroundPosition = "0px 0px";
        socialBookmarks.style.display = "none";
  } else {
        shareLI.style.background = "url('/common/images/icons/bg-icon-collapse.gif')";
        shareLI.style.backgroundRepeat = "no-repeat";
        shareLI.style.backgroundPosition = "0px 0px";
        socialBookmarks.style.display = "block";
        
  }
}

function stopChangeSocialBookmarkingBG(){ //Stops rotation of "share" background images and changes the background to the expand icon.
  var socialBookmarks = document.getElementById("social-bookmarks");
  var shareLI = document.getElementById("share-bookmarks");

  if (socialBookmarks.style.display != "block") { //If social bookmarks are not visible
      shareLI.style.backgroundImage = "url('/common/images/icons/bg-icon-expand.gif')";
      shareLI.style.backgroundPosition = "0px 0px";
      shareLI.style.backgroundRepeat = "no-repeat";
    
  }
}

function startChangeSocialBookmarkingBG(){  //Starts rotation of "share" background images.
  var socialBookmarks = document.getElementById("social-bookmarks");
  var shareLI = document.getElementById("share-bookmarks");
  

  
  if (socialBookmarks.style.display != "block") { //If social bookmarks are not visible
      

      socialBookmarks.style.display = "none";
      shareLI.style.backgroundImage = "url('/common/images/icons/icon-rotate.gif')";
      shareLI.style.backgroundPosition = "0px 0px";
      shareLI.style.backgroundRepeat = "no-repeat";

      
  }
  

}


