var picIdx = 1;
var intervalId = null;
var TOTAL_PICS = 6;
var ID_BASE_NAME ="pic";
var MS_PER_DAY = 1000 * 86400;

intervalId = setInterval(slideShow, 3500);

function slideShow()
{
   var divId = null;
   var curSlide = null;
   var newSlide = null;
   var curPicIdx = picIdx;

   picIdx = (picIdx == TOTAL_PICS) ? 1 : ++picIdx;

   divId = ID_BASE_NAME + curPicIdx;
   curSlide = document.getElementById(divId);

   divId = ID_BASE_NAME + picIdx;
   newSlide = document.getElementById(divId);

   curSlide.style.display = "none";
   newSlide.style.display = "block";
}



function showCountDown()
{
   var totalDays;
   var countMsg = null;
   var countDiv = null;
   var elapsedTime = null;
   var curDate = new Date();
   var conferenceDate = new Date(2009, 5, 18);

   elapsedTime = conferenceDate.getTime() - curDate.getTime();
   totalDays = Math.ceil(elapsedTime / MS_PER_DAY);

   if (totalDays > 0)
   {
        countMsg = "" + totalDays + " Day";

        if (totalDays > 1)
            countMsg = countMsg + "s";
   }
   else
        countMsg = "Now";

   countDiv = document.getElementById("countDown");
   countDiv.innerHTML = "Conference Countdown: " + countMsg;

}