/* 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")

var content = new Array("Who's your daddy?",
"We eat small children",
"We luv you long time",
"Send Money",
"First time's free",
"Pet the monkey",
"Do you LoungeNet?",
"Don't hate us because we're beautiful",
"Beer",
"No really, Send Money",
"Hornier than a pod of Bonobo monkeys.",
"We'll show you ours if you show us yours.",
"Putting Steve Buscimi in a power chipper since 1996.",
"Getting Boris laid with ugly chicks since 1997.",
"Getting Boris to swallow the worm since 1996.",
"Encouraging Safe Yeti sex since 1996.",
"Double fisted pistolero action",
"Yer Sister's keeper.",
"Giving the dog a bone since 1996",
"Schllllllllllltttttt tttttttcccccccccccccc chhhhhhhhhhhhhhhhhhhh hhhhhfffffffffffffPll lllllllllllllllllllll llllttttttttttttttttt ttttttttttccccccccccc cccccccccchhhhhhhh!(Sound of Kracken having sex with a phone)",
"Being pimp.",
"Wishing we were as cool as Alex.",
"Beating the crap out of Alex since 1996",
"We hate to see you go, but we love to watch you leave.",
"Splock!",
"Tofu is Peeeooople!",
"Choking the chicken since 1996",
"Selling out to the UC Regents since 1996.",
"You'll get used to us",
"5 dollah suckee suckee!",
"You WILL join us!",
"Hot college coed teens",
"Up in your dot com since 1996.",
"Bork Bork Bork",
"An Everybody Place",
"Punching holes in dogmatic principles since 1996.",
"This is where you are going today.",
"Playing with your emotions since 1996",
"Playing God since 1996",
"Dizplaying R 133t ski11z since 1996",
"Mmmm yeeeahh, that's greeeaaat Mmmkay?",
"You know you want some",
"Feng Shui to you too, buddy!",
"We know your IP address",
"Ping this!",
"Handling our mice since 1996",
"3D accelerating your expansion slot since 1996",
"Adam: Strong enough for a man, PH balanced for a woman",
"ZZZzzipp...WOMP.")

// 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
}

