no_of_pics = 21;

var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
ttlsecs = (hours * 3600) + (minutes * 60) + seconds;
idx = ttlsecs % no_of_pics;
idx = idx + 1;

document.write('<IMG SRC="headerphotos/hphoto'+idx+'.jpg" WIDTH="150" HEIGHT="60" BORDER="0" NATURALSIZEFLAG="3">');

if (screen.width > 640) {
  idx = idx + (no_of_pics / 3);
  if (idx > no_of_pics)
    idx = idx - no_of_pics
  document.write('<IMG SRC="images/blankspace.gif" WIDTH="6" HEIGHT="60" BORDER="0" NATURALSIZEFLAG="0">');
  document.write('<IMG SRC="headerphotos/hphoto'+idx+'.jpg" WIDTH="150" HEIGHT="60" BORDER="0" NATURALSIZEFLAG="3">');
}

if (screen.width > 800) {
  idx = idx + (no_of_pics / 3);
  if (idx > no_of_pics)
    idx = idx - no_of_pics
  document.write('<IMG SRC="images/blankspace.gif" WIDTH="6" HEIGHT="60" BORDER="0" NATURALSIZEFLAG="0">');
  document.write('<IMG SRC="headerphotos/hphoto'+idx+'.jpg" WIDTH="150" HEIGHT="60" BORDER="0" NATURALSIZEFLAG="3">');
}
