
var content = new Array("&quot;Thanks so much for helping me to surprise my boyfriend with our trip to NMSkies in May! We had such a wonderful time, and are STILL bragging about your observatory to everyone we know. Eric wants to come back over and over again, in all different seasons and moon phases! Give Bowser a friendly head pat from both of us!&quot;",
"&quot;We had a wonderful time during our visit. Mike and Lynn made us feel right at home from the minute we arrived. The equipment and skies were outstanding, and the accommodations were wonderful. We can't wait to return for our deep-sky, large aperture (and cappuccino) fix!&quot;",
"&quot;My new wife and I had the best time ever. Now I've been spoiled by the beautiful night sky and fresh mountain air. It was a shame to go home. The only problem now is that I'm hooked on cappuccinos!!!. Great setup and wonderful atmosphere. Mike and Lynn know how to make you feel at home.&quot;",
"&quot;From St. Croix in the Caribbean to Cloudcroft is a long way, but our 4-night stay at N.M. Skies made the trip worthwhile. Clear and steady skies so dark they are bright from starlight, hand-picked equipment, stunning views of familiar and new objects, a beautiful location adjoining a national forest teeming with wildlife and fearless hummingbirds, spotlessly clean accommodations, and gracious, knowledgeable proprietors dedicated to providing the best possible experience.&quot;",
"&quot;Mike and Lynn -- thanks for a great stay over the past few days...It was really great to have seen you again, and to have spent a couple of nights under your skies. I'm very struck with the feeling of how close the stars are when the sky is so dark and the stars are so bright...really something which I haven't seen elsewhere!&quot;")


/* 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 scaled 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
}
