/* Specifies the period of time between updates:
    month - once a month
    date - once per every day of the month (repeats the next month)
    weekday - once per every day of the week (repeats the next week)
    hour - once per hour (repeats the next day)
    request - once per browser request (default)
*/
var updatePeriods = new Array("month","date","weekday","hour","request")

// Invoked to display rotated HTML content in a Web page. The period
// argument should be an element of the updatePeriods array.
function displayRotatedContent(period) {
 var updatePeriod = -1
 for(var i=0;i<content.length;++i) {
  if(period.toLowerCase() == updatePeriods[i].toLowerCase()) {
   updatePeriod = i
   break
  }
 }
 var s = selectHTML(updatePeriod)
 document.write(s)
}

function selectHTML(updatePeriod) {
 var n = 0
 var max = content.length
 var d = new Date()
 switch(updatePeriod) {
  case 0: // Month (0 - 11)
   n = d.getMonth()
   break
  case 1: // Date (1 - 31)
   // Scale to (0 - 30)
   n = d.getDate() - 1
   break
  case 2: // Weekday (0 - 6)
   n = d.getDay()
   break
  case 3: // Hour (0 - 23)
   n = d.getHours()
   break
  case 4: // Request (Default)
  default:
   n = selectRandom(max)
 }
 n %= max 
 return content[n]
}

// Select a random integer that is between 0 (inclusive) and max (exclusive)
function selectRandom(max) {
 var r = Math.random()
 r *= max
 r = parseInt(r)
 if(isNaN(r)) r = 0
 else r %= max
 return r
}



var content = new Array
('<div align="center"><img src="images/easyhome.gif" width="214" height="73"></div><div align="left"><b><span class="smallFont2"><br>Make the Web and Phone Work Together with the Call Interactive EasyServe&nbsp;<img src="images/sm.gif" width="9" height="7"> Service.</span></b></div><p>Web integration gives your customers the choice they want in how to communicate with&nbsp;you.<br><a href="rotate_story6.asp">the full scoop</a> <img src="images/arrow.gif" width="3" height="6">&nbsp;<img src="images/arrow.gif" width="3" height="6"></p>',
 '<div align="center"><img src="images/orderhome.gif" width="270" height="73"></div><div align="left"><b><span class="smallFont2"><br>Help the Customer Decide with the Call Interactive OrderManagement&nbsp;<img src="images/sm.gif" width="9" height="7"> Service.</span></b></div><p>Pare per-call costs down by 90 percent and get the order right every time. <br><a href="rotate_story5.asp">the full scoop</a> <img src="images/arrow.gif" width="3" height="6">&nbsp;<img src="images/arrow.gif" width="3" height="6"></p>', 
 '<div align="center"><img src="images/easyhome2.gif" width="214" height="73"></div><div align="left"><b><span class="smallFont2"><br>If You Are Not There 24/7, Your Competition Will Be with the Call Interactive EasyServe&nbsp;<img src="images/sm.gif" width="9" height="7"> Service.</span></b></div><p>Step up to the customer service challenge with customer-savvy solutions.<br><a href="rotate_story4.asp">the full scoop</a> <img src="images/arrow.gif" width="3" height="6">&nbsp;<img src="images/arrow.gif" width="3" height="6"></p>',
 '<div align="center"><img src="images/newreachhome.gif" width="219" height="73"></div><div align="left"><b><span class="smallFont2"><br>Acquire New Customers the Easy Way with the Call Interactive NewReach&nbsp;<img src="images/sm.gif" width="9" height="7"> Service.</span></b></div><p>Completely automated solutions make it easy for prospects to say yes to your offer.<br><a href="rotate_story3.asp">the full scoop</a> <img src="images/arrow.gif" width="3" height="6">&nbsp;<img src="images/arrow.gif" width="3" height="6"></p>',
 '<div align="center"><img src="images/cardacthome.gif" width="263" height="73"></div><div align="left"><b><span class="smallFont2"><br>Give Your Customers Fast Activation for New Credit Cards with the Call Interactive CardActivation&nbsp;<img src="images/sm.gif" width="9" height="7"> Service.</span></b></div><p>Customers have come to expect the convenience of anywhere, anytime card&nbsp;activation.<br><a href="rotate_story2.asp">the full scoop</a> <img src="images/arrow.gif" width="3" height="6">&nbsp;<img src="images/arrow.gif" width="3" height="6"></p>',
 '<div align="center"><img src="images/easyhome3.gif" width="214" height="73"></div><div align="left"><b><span class="smallFont2"><br>Talk Is Here with the Call Interactive EasyServe&nbsp;<img src="images/sm.gif" width="9" height="7"> Service!</span></b> </div><p>Advanced speech is revolutionizing automated customer care across key industries.<br><a href="rotate_story1.asp">the full scoop</a> <img src="images/arrow.gif" width="3" height="6">&nbsp;<img src="images/arrow.gif" width="3" height="6"></p>'
);
