var NHA={
  getRandom : function(maxNum) {
    if (Math.random && Math.round) {
      return ( Math.round(Math.random()*(maxNum-1)) )+1;
    }
    var today=new Date();
    var hours=today.getHours();
    var mins=today.getMinutes();
    var secn=today.getSeconds();
    if (hours==19) { hours=18; }
    return (((hours+1)*(mins+1)*secn)%maxNum)+1;
  },
  rotateImg:function(slug){
    if (!slug || !NHA.numImages[slug]) { slug = 'home'; }
    var total = NHA.numImages[slug];
    var w = slug == 'home' ? '409' : '409';
    var h = slug == 'home' ? '258' : '258';
    var num = (total ? NHA.getRandom(total) : 1).toString();
    var html = '<img src="http://www.arl.org/nha/images/home/rotate' + num + '.jpg" width="'
      + w + '" height="' + h + '" alt="" />';
    document.write(html);
  },
  numImages : {
    'home' : 6
  }
};
