	<!--
js_vers = 1.0;
// -->
	
	<!--

 var width=7;
var height=8;
var numWords = 5;
var puzzle = new Array(
 '-','-','-','-','2dw','-','-',
 '-','1ds','-','-','e','-','-',
 '-','h','-','-','a','-','-',
 '3ac','a','m','e','r','a','-',
 '-','m','-','-','-','-','-',
 '-','4ap','i','l','l','o','w',
 '-','o','-','-','-','-','-',
 '5as','o','c','k','s','-','-');

var clues = new Array(
 "1 DOWN -Suds",
 "2 DOWN - under_____.",
 "3 ACROSS - Rolls of film for your____.",
 "4 ACROSS - Take more than one.",
 "5 ACROSS - warm____ .");
var words = new Array(
 "shampoo",
 "wear",
 "camera",
  "pillow",
 "socks");


 
// ***** YOU DO NOT HAVE TO MODIFY ANYTHING BELOW THIS COMMENT *****

function preload() {
 this.length = preload.arguments.length;
 for (var i = 0; i < this.length; i++) {
  this[i+1] = new Image();
  this[i+1].src = preload.arguments[i];
 }
}

var pic_squares = new preload(
 "../images/a.gif", "../images/b.gif", "../images/c.gif",
 "../images/d.gif", "../images/e.gif", "../images/f.gif",
 "../images/g.gif", "../images/h.gif", "../images/i.gif",
 "../images/j.gif", "../images/k.gif", "../images/l.gif",
 "../images/m.gif", "../images/n.gif", "../images/o.gif",
 "../images/p.gif", "../images/q.gif", "../images/r.gif",
 "../images/s.gif", "../images/t.gif", "../images/u.gif",
 "../images/v.gif", "../images/w.gif", "../images/x.gif",
 "../images/y.gif", "../images/z.gif",
 "../images/white.gif", "../images/black.gif",
 "../images/1.gif", "../images/2.gif", "../images/3.gif",
 "../images/4.gif", "../images/5.gif", "../images/6.gif",
 "../images/7.gif", "../images/8.gif", "../images/9.gif",
 "../images/10.gif", "../images/11.gif", "../images/12.gif",
 "../images/13.gif", "../images/14.gif", "../images/15.gif",
 "../images/16.gif", "../images/17.gif", "../images/18.gif",
 "../images/19.gif", "../images/20.gif", "../images/21.gif",
 "../images/22.gif", "../images/23.gif", "../images/24.gif", "../images/25.gif");
// *** You can remove the *unused* number and letter ***
// *** images if you want to save bandwidth          ***

function Pair(string, val) {
 this.str = string;
 this.pos = val;
}

function fillArray(len, val) {
 for (var i = 0; i < len; i++)
  this[i] = val;
}

var js_vers = "1.1";

var orig_sources = new Array();
var letter_sources = new Array();
var solved = new fillArray(height*width, false);
var location_data = new Array();

function load_sources() {
 for (i=0; i<puzzle.length; i++) {
  dummy = puzzle[i];
  if (dummy.length > 1) {
   block_num = parseInt(dummy);
   dummy = dummy.substring(('' + block_num).length,dummy.length);
   direction = dummy.charAt(0);
   dummy = dummy.charAt(1);
   orig_sources[i] = '../images/'+ block_num + '.gif';
   letter_sources[i] ='../images/'+  dummy + '.gif';
   if (block_num <= 0) {   // *error checking only*
    alert('Error reading in letter #' + i + ". Please contact the webmaster "
     + "of this site so he can fix the problem.");
   } else {
    if ((direction == 'd') || (direction == 'b'))
     location_data[location_data.length] = new Pair(block_num + ' DOWN', i);
    if ((direction == 'a') || (direction == 'b'))
     location_data[location_data.length] = new Pair(block_num + ' ACROSS', i);
   }
  } else {
   if (dummy == '-') {
    orig_sources[i] = '../images/black.gif';
    letter_sources[i] = '../images/black.gif';
   } else {
    orig_sources[i] = '../images/white.gif';
    letter_sources[i] = '../images/'+dummy + '.gif';
   }
  }
 }
}

function createCross() {
 window.defaultStatus = "";
 document.write('<center><table border=2 cellspacing=0 cellpadding=0 '
  + 'bgcolor="white">');
 for (i=0; i<height; i++) {
  document.write('<tr>');
  for (j=0; j<width; j++)
   document.write('<td background="'+orig_sources[i*width+j]+'"><img src="'+orig_sources[i*width+j]+'" width=21 height=21 name="box'
    + (i*width+j) + '"><br></td>');
  document.write('</tr>');
 }
 
 document.write("</table></center>");
}

function loadCrossBackground() {
 for (i=0; i<height*width; i++)
  eval("document.box"+i+".src = '"+orig_sources[i]+"';");
}

function loadCrossForeground() {
 for (i=0; i<height*width; i++)
  if (solved[i])
   eval("document.box"+i+".src = '"+letter_sources[i]+"';");
}

function redraw_screen() {
 loadCrossBackground();
 loadCrossForeground();
}


function find(the_string) {
 for (i=0; i<numWords; i++)
  if (location_data[i].str == the_string)
   return location_data[i].pos;
 alert('*** function find: string not found ***');
 return -1;
}

function checkGuess() {
 clueNum = document.choices.clue.selectedIndex;
 wordNum = order[clueNum];
 wordLength = document.choices.word.options[document.choices.word.selectedIndex].text.length;
 if (wordNum == document.choices.word.selectedIndex) {
  clue_location = document.choices.clue.options[clueNum].text;
  clue_location = clue_location.substring(0,clue_location.indexOf(' -'));
  skip = 1;
  loc = find(clue_location);
  if (clue_location.toLowerCase().indexOf(' down') != -1)
   skip = width;
  for (i=0;i<wordLength;i++) {
   solved[loc] = true;
   loc += skip;
  }
  window.defaultStatus = "";
  loadCrossForeground();
 } else {
  window.defaultStatus = "        ! ! ! I N C O R R E C T ! ! !";
 }
}



load_sources();
createCross();

// -->
 <!--
// warn old browsers this script won't work for them
if (js_vers != "1.1")
 document.write("This script requires a JavaScript 1.1 capable browser. "
  + "Get Netscape 3+ or MSIE 4+ and try again.");
// -->













