var tips1 = new Array();
tips1[0] = '<img src="http://www.lilleheden.dk/grafik/topleft1a.jpg" width="280" height="190" border="0">';
tips1[1] = '<img src="http://www.lilleheden.dk/grafik/topleft1b.jpg" width="280" height="190" border="0">';
tips1[2] = '<img src="http://www.lilleheden.dk/grafik/topleft1c.jpg" width="280" height="190" border="0">';
tips1[3] = '<img src="http://www.lilleheden.dk/grafik/topleft1d.jpg" width="280" height="190" border="0">';
tips1[4] = '<img src="http://www.lilleheden.dk/grafik/topleft1e.jpg" width="280" height="190" border="0">';
tips1[5] = '<img src="http://www.lilleheden.dk/grafik/topleft1f.jpg" width="280" height="190" border="0">';
tips1[6] = '<img src="http://www.lilleheden.dk/grafik/topleft1g.jpg" width="280" height="190" border="0">';
tips1[7] = '<img src="http://www.lilleheden.dk/grafik/topleft1h.jpg" width="280" height="190" border="0">';
tips1[8] = '<img src="http://www.lilleheden.dk/grafik/topleft1i.jpg" width="280" height="190" border="0">';
tips1[9] = '<img src="http://www.lilleheden.dk/grafik/topleft1j.jpg" width="280" height="190" border="0">';
tips1[10] = '<img src="http://www.lilleheden.dk/grafik/topleft1k.jpg" width="280" height="190" border="0">';

function Topleft1(frequency) {
  var max = tips1.length;
  var dateObj = new Date();
  switch(frequency) {
    case "month": // 0 - 11
      tipIndex = dateObj.getMonth();
      break
    case "dayOfTheMonth": // 1 - 31
      tipIndex = dateObj.getDate() - 1 // 0 - 30
      break;
    case "dayOfTheWeek": // 0 - 6
      tipIndex = dateObj.getDay();
      break;
    case "hour": // 0 - 23
      tipIndex = dateObj.getHours();
      break;
    case "now": // Default
    default:
      tipIndex = getRandomIndex(max);
   }
 tipIndex = tipIndex % max;
 document.write(tips1[tipIndex]);
}

function getRandomIndex(max) {
 var randomNum = Math.random();
 randomNum = randomNum * max;
 randomNum = parseInt(randomNum);
 if(isNaN(randomNum)) randomNum = 0; // for Netscape
 return randomNum;
}

