imageCount=107
progressCount=20

imageList=new Array(imageCount)
for (Index=0;Index<imageCount;Index++)
  imageList[Index]=new Image()

function prepare()
{
imageList[0].src="./00back.gif"
imageList[1].src="./00crown.gif"
imageList[2].src="./00dire.gif"
imageList[3].src="./00dirn.gif"
imageList[4].src="./00dirs.gif"
imageList[5].src="./00dirw.gif"
imageList[6].src="./00empty.gif"
imageList[7].src="./00forw.gif"
imageList[8].src="./00glass.gif"
imageList[9].src="./00left.gif"
imageList[10].src="./00right.gif"
imageList[11].src="./00torch.gif"
imageList[12].src="./01black.jpg"
imageList[13].src="./01path.jpg"
imageList[14].src="./01wall.jpg"
imageList[15].src="./02sky.jpg"
imageList[16].src="./03black.jpg"
imageList[17].src="./03path.jpg"
imageList[18].src="./03wall.jpg"
imageList[19].src="./04black.jpg"
imageList[20].src="./04end1.jpg"
imageList[21].src="./04exit.jpg"
imageList[22].src="./04exit1.jpg"
imageList[23].src="./04path.jpg"
imageList[24].src="./04wall.jpg"
imageList[25].src="./05black.jpg"
imageList[26].src="./05end1.jpg"
imageList[27].src="./05sky.jpg"
imageList[28].src="./06black.jpg"
imageList[29].src="./06end1.jpg"
imageList[30].src="./06exit.jpg"
imageList[31].src="./06exit1.jpg"
imageList[32].src="./06path.jpg"
imageList[33].src="./06wall.jpg"
imageList[34].src="./07black.jpg"
imageList[35].src="./07end1.jpg"
imageList[36].src="./07end2.jpg"
imageList[37].src="./07exit1.jpg"
imageList[38].src="./07exit2.jpg"
imageList[39].src="./07path.jpg"
imageList[40].src="./07wall.jpg"
imageList[41].src="./08black.jpg"
imageList[42].src="./08end1.jpg"
imageList[43].src="./08end2.jpg"
imageList[44].src="./09black.jpg"
imageList[45].src="./09end1.jpg"
imageList[46].src="./09end2.jpg"
imageList[47].src="./09exit1.jpg"
imageList[48].src="./09exit2.jpg"
imageList[49].src="./09path.jpg"
imageList[50].src="./09wall.jpg"
imageList[51].src="./10black.jpg"
imageList[52].src="./10end1.jpg"
imageList[53].src="./10end2.jpg"
imageList[54].src="./10end3.jpg"
imageList[55].src="./10exit1.jpg"
imageList[56].src="./10exit2.jpg"
imageList[57].src="./10exit3.jpg"
imageList[58].src="./10path.jpg"
imageList[59].src="./10wall.jpg"
imageList[60].src="./11black.jpg"
imageList[61].src="./11end1.jpg"
imageList[62].src="./11end2.jpg"
imageList[63].src="./11end3.jpg"
imageList[64].src="./12black.jpg"
imageList[65].src="./12end1.jpg"
imageList[66].src="./12end2.jpg"
imageList[67].src="./12end3.jpg"
imageList[68].src="./12exit1.jpg"
imageList[69].src="./12exit2.jpg"
imageList[70].src="./12exit3.jpg"
imageList[71].src="./12path.jpg"
imageList[72].src="./12wall.jpg"
imageList[73].src="./13black.jpg"
imageList[74].src="./13end1.jpg"
imageList[75].src="./13end2.jpg"
imageList[76].src="./13end3.jpg"
imageList[77].src="./13end4.jpg"
imageList[78].src="./14black.jpg"
imageList[79].src="./14end1.jpg"
imageList[80].src="./14end2.jpg"
imageList[81].src="./14end3.jpg"
imageList[82].src="./14exit1.jpg"
imageList[83].src="./14exit2.jpg"
imageList[84].src="./14exit3.jpg"
imageList[85].src="./14floor.jpg"
imageList[86].src="./14tele.jpg"
imageList[87].src="./15black.jpg"
imageList[88].src="./15crown.jpg"
imageList[89].src="./15end1.jpg"
imageList[90].src="./15end2.jpg"
imageList[91].src="./15exit1.jpg"
imageList[92].src="./15exit2.jpg"
imageList[93].src="./15floor.jpg"
imageList[94].src="./15glass.jpg"
imageList[95].src="./15tele.jpg"
imageList[96].src="./15torch.jpg"
imageList[97].src="./16black.jpg"
imageList[98].src="./16crown.jpg"
imageList[99].src="./16end1.jpg"
imageList[100].src="./16exit1.jpg"
imageList[101].src="./16floor.jpg"
imageList[102].src="./16glass.jpg"
imageList[103].src="./16tele.jpg"
imageList[104].src="./16torch.jpg"
imageList[105].src="./17black.jpg"
imageList[106].src="./17floor.jpg"
}

function evaluateProgress()
{
  done=0;
  for (Index=0;Index<imageCount;Index++)
    if (imageList[Index].complete)
      done++
  progress=Math.floor(progressCount*(done+0.5)/imageCount)
  for (Index=0;Index<progress;Index++)
    document.images["progress"+Index].src="./smiley.gif"
  if (done<imageCount)
    timerId=setTimeout("evaluateProgress()",500)
}

function enableScript()
{
  prepare()
  evaluateProgress()
}
