function refreshDocJSTOD(frequency) {
  var max = tips.length;
  var dateObj = new Date();
      tipIndex = getRandomIndex(max);
 tipIndex = tipIndex % max;
 document.write(tips[tipIndex]);
}

function getRandomIndex(max) {
 var randomNum = Math.random();
 randomNum = randomNum * max;
 randomNum = parseInt(randomNum);
 if(isNaN(randomNum)) randomNum = 0; // for Netscape
 return randomNum;
}
