window.onload=function()
{
   var icallout = 1;   // default to 1
   var idivsTotal = 7; //How many total divs do we have?
   var idivsShow = 4;  //How many divs do we want to show on the page?

   ///////////////////////////////////////////////////////////////////////////////
   // You must add duplicates of the first 3 divs at the bottom of the callouts //
   // so that they look like they are cycling through the list of callouts.     //
   // If you want to show 5, you would duplicate the first 4 and so on.         //
   ///////////////////////////////////////////////////////////////////////////////
   if(document.cookie && document.cookie.indexOf("icallout=") != -1)
   {
      icallout = document.cookie.split('icallout=')[1];
      icallout = icallout.split(";")[0];
   }

   var icurrent = icallout;

   //alert('icallout=' + icallout);
   for(var i=1; i<=idivsShow; i++)
   {
      if(icurrent > parseInt(idivsTotal)+parseInt(idivsShow)-1)
      {
         icurrent = 1; //reset
      }

      //alert('icurrent=' + icurrent);
      document.getElementById('homeCallout' + icurrent).className = 'homeCalloutsShow';
      icurrent = parseInt(icurrent)+1; //increment
   }

   icallout = parseInt(icallout)+1//increment
   if(icallout > idivsTotal)
   {
      icallout = 1; //reset
   }

   setcookie(icallout);
}

function setcookie(inew)
{
   exp=new Date();
   plusMonth=exp.getTime()+(31*24*60*60*1000);
   exp.setTime(plusMonth);
   document.cookie='icallout='+inew+';expires='+exp.toGMTString();
}
