var aWords = new Array();
var  aKindergarten = new Array("the", "in", "he", "as", "at", "or", "but", "we", "there", "she", "of", "is", "was", "with", "be", "one", "not", "when", "use", "do", "and", "you", "for", "his", "this", "had", "what", "your", "an", "how", "a", "that", "on", "they", "have", "by", "all", "can", "each", "their", "to", "it", "are", "I", "from", "words", "were", "said", "which", "if");

var  aFirstgrade = new Array( "set", "put", "end", "does", "another",
  "well", "large", "must"
, "big", "even", "such", "because", "turned", "here", "why","asked"
, "went", "men", "read", "need", "land", "different", "home", "us"
, "move", "try", "kind", "hand", "picture", "again", "change","off"
, "play", "spell", "air", "away", "animals", "house", "point", "page"
, "letters", "mother", "answer", "found", "study", "still", "learn"
, "should", "American", "world", "will", "up", "other", "about", "out"
, "many", "then", "them", "these", "so", "some", "her", "would", "make"
, "like", "him", "into", "time", "has", "look", "two", "more", "write"
, "go", "see", "number", "no", "way", "could", "people", "my", "than"
, "first", "water", "been", "called", "who", "oil", "sit", "now","find"
, "long", "down", "day", "did", "get", "come", "made", "may", "part"
, "over", "new", "sound", "take", "only", "little", "work", "know"
, "place", "years", "live", "me", "back", "give", "most", "very", "after"
, "things", "our", "just", "name", "good", "sentence", "man", "think"
, "say", "great", "where", "help", "through", "much", "before", "line"
, "right", "too", "means", "old", "any", "same", "tell", "boy", "following"
, "came", "want", "show", "also", "around", "form", "three", "small");

var  aSecondgrade = new Array("listen", "wind", "rock", "space", "covered", "fast", "several", "hold", "himself", "toward", "five", "step", "morning", "passed", "vowel", "true", "hundred", "against", "pattern", "numeral", "table", "north", "slowly", "money", "map", "farm", "pulled", "draw", "voice", "seen", "cold", "cried", "plan", "notice", "south", "sing", "war", "ground", "fall", "king", "town", "I'll", "unit", "figure", "certain", "field", "travel", "wood", "fire", "upon", "important", "until", "children", "side", "feet", "car", "miles", "night", "walked", "white", "sea", "began", "grow", "took", "river", "four", "carry", "state", "once", "book", "hear", "stop", "without", "second", "later", "miss", "idea", "enough", "eat", "face", "watch", "far", "Indians", "really", "almost", "let", "above", "girl", "sometimes", "mountains", "cut", "young", "talk", "soon", "list", "song", "being", "leave", "family", "it's", "body", "music", "color", "stand", "sun", "questions", "fish", "area", "mark", "dog", "horse", "birds", "problem", "compete", "room", "knew", "since", "ever", "piece", "told", "usually", "didn't", "friends", "easy", "heard", "order", "red", "door", "sure", "become", "top", "ship", "across", "today", "during", "short", "better", "best", "however", "low", "hours", "black", "products", "happened", "whole", "measure", "remember", "early", "waves", "reached", "high", "every", "near", "add", "food", "between", "own", "below", "country", "plants", "last", "school", "father", "keep", "trees", "never", "started", "city", "earth", "eyes", "light", "thought", "head", "under", "story", "saw", "left", "don't", "few", "while", "along", "might", "close", "something", "seemed", "next", "hard", "open", "example", "beginning", "life", "always", "those", "both", "paper", "together", "got", "group", "often", "run");

var  aThirdgrade = new Array("can't", "matter", "square", "syllables", "perhaps", "bill", "felt", "suddenly", "test", "direction", "center", "farmers", "ready", "anything", "divided", "general", "energy", "subject", "Europe", "moon", "region", "return", "believe", "dance", "members", "picked", "simple", "cells", "paint", "mind", "love", "cause", "rain", "exercise", "eggs", "train", "blue", "wish", "drop", "developed", "window", "difference", "distance", "heart", "sit", "sum", "summer", "wall", "forest", "probably", "done", "English", "road", "half", "ten", "fly", "gave", "box", "finally", "wait", "correct", "oh", "quickly", "person", "became", "shown", "minutes", "strong", "verb", "stars", "front", "feel", "fact", "inches", "street", "decided", "contain", "course", "surface", "produce", "building", "ocean", "class", "note", "nothing", "rest", "carefully", "scientists", "inside", "wheels", "stay", "green", "known", "island", "week", "less", "machine", "base", "ago", "stood", "legs", "sat", "main", "winter", "side", "written", "length", "reason", "kept", "interest", "arms", "brother", "race", "present", "beautiful", "store", "job", "edge", "past", "sign", "record", "finished", "discovered", "wild", "happy", "beside", "gone", "sky", "glass", "million", "west", "lay", "weather", "root", "instruments", "meet", "third", "months", "paragraph", "raised", "represent", "soft", "whether", "clothes", "flowers", "shall", "teacher", "held", "describe", "drive", "plane", "system", "behind", "ran", "round", "boat", "game", "force", "brought", "understand", "warm", "common", "bring", "explain", "dry", "though", "language", "shape", "deep", "thousands", "yes", "clear", "equation", "yet", "government", "filled", "heat", "full", "hot", "check", "object", "am", "rule", "among", "noun", "power", "cannot", "able", "six", "size", "dark", "ball", "material", "special", "heavy", "fine", "pair", "circle", "include", "built");

var  aFourthgrade = new Array("cross", "speak", "solve", "appear", "metal", "son", "either", "ice", "sleep", "village", "factors", "result", "jumped", "snow", "ride", "care", "floor", "hill", "pushed", "baby", "buy", "century", "outside", "everything", "tall", "already", "instead", "phrase", "soil", "bed", "copy", "free", "hope", "spring", "case", "laughed", "nation", "quite", "type", "themselves", "temperature", "bright", "lead", "everyone", "brown", "team", "direct", "cloud", "symbol", "save", "alone", "pay", "desert", "cost", "information", "method", "section", "lake", "consonant", "within", "dictionary", "hair", "age", "amount", "scale", "pounds", "although", "per", "broken", "moment", "tiny", "cross", "gold", "milk", "quiet", "natural", "lot", "stoned", "act", "build", "village", "speed", "count", "cat", "someone", "sail", "rolled", "bear", "wonder", "smiled", "angle", "fraction", "Africa", "killed", "melody", "bottom", "trip", "hole", "poor", "trouble", "God", "ring", "lost", "wear", "experiment", "drawing", "serve", "increase", "single", "express", "let's", "fight", "surprise", "French", "died", "beat", "exactly", "remain", "dress", "iron", "couldn't", "fingers", "row", "least", "catch", "climbed", "wrote", "shouted", "continued", "itself", "else", "pains", "gas", "England", "burning", "design", "whose", "received", "garden", "please", "strange", "caught", "joined", "foot", "law", "ears", "grass", "you're", "grew", "skin", "valley", "cents", "key", "president", "fell", "captain", "cool", "sent", "bad", "engine", "East", "child", "history", "touch", "mouth", "yard", "equal", "decimal", "yourself", "control", "practice", "report", "straight", "rise", "maybe", "business", "separate", "break", "uncle", "hunting", "statement", "stick", "party", "seeds", "bank", "woman", "coast", "period", "wire", "choose", "clean", "visit", "bit", "flow", "art", "students", "feelings");

var  aFifthgrade = new Array("supply", "corner", "electric", "insects", "crops", "tone", "hit", "sand", "doctor", "provide", "thus", "wont't", "cook", "bones", "tail", "board", "modern", "compound", "mine", "wasn't", "fit", "addition", "belong", "safe", "soldiers", "guess", "silent", "trade", "rather", "compare", "crowd", "poem", "enjoy", "elements", "indicate", "except", "expect", "flat", "seven", "interesting", "sense", "string", "blow", "famous", "value", "wing", "movement", "pole", "exciting", "branched", "thick", "blood", "lie", "spot", "bell", "fun", "loud", "consider", "suggested", "thin", "position", "entered", "fruit", "tied", "rich", "dollars", "send", "sight", "chief", "Japanese", "stream", "plants", "rhythm", "eight", "science", "major", "observe", "tube", "necessary", "weight", "meat", "lifted", "process", "army", "hat", "property", "particular", "swim", "terms", "current", "park", "sell", "shoulder", "industry", "wash", "block", "spread", "cattle", "wife", "sharp", "company", "radio", "we'll", "action", "capital", "sister", "oxygen", "plural", "various", "agreed", "opposite", "wrong", "chart", "prepared", "pretty", "solution", "fresh", "shop", "suffix", "especially", "factories", "settled", "yellow", "isn't", "southern", "shoes", "actually", "nose", "afraid", "dead", "sugar", "adjective", "fig", "office", "huge", "gun", "similar", "death", "score", "forward", "truck", "fair", "printed", "wouldn't", "ahead", "stretched", "experience", "rose", "allow", "fear", "workers", "Washington", "Greek", "women", "bought", "led", "march", "northern", "create", "British", "chance", "born", "level", "triangle", "molecules", "difficult", "match", "win", "doesn't", "steel", "total", "deal", "determine", "evening", "not", "rope", "cotton", "apple", "details", "entire", "France", "repeated", "column", "western", "church", "corn", "substances", "smell", "tools", "conditions", "cows", "track", "arrived", "located", "sir", "seat", "division", "effect", "underline", "view");
var  aBataviaK = new Array("the", "a", "my", "that", "and", "I", "is", "said", "we", "are", "you", "have", "to", "me", "go", "do", "for", "he", "she", "has", "with", "was", "see", "of", "not", "red", "yellow", "black", "blue", "brown", "orange", "white", "green", "purple");

var  aBatavia1 = new Array("one", "likes", "give", "this", "pan", "bad", "mat", "had", "hat", "can", "on", "they", "what", "your", "back", "quack", "pack", "sack", "tack", "rack", "her", "does", "look", "there", "win", "dig", "pick", "pin", "kick", "pig", "be", "see", "could", "down", "shack", "that", "dish", "thin", "wish", "path", "go", "bus", "map", "fast", "stop", "ship");

var  aBatavia2 = new Array("no", "out", "ride", "small", "tug", "rug", "buck", "cut", "duck", "but", "saw", "two", "very", "want", "top", "hop", "lock", "hot", "rock", "not", "put", "into", "away", "good", "wet", "hen", "shed", "then", "red", "pet", "use", "about", "again", "around", "snap", "pass", "flat", "miss", "doll", "puff", "job", "cat", "help", "pat", "hog", "vet");

var  aBatavia3 = new Array("try", "fall", "their", "would", "sent", "spill", "bump", "tent", "spell", "jump", "new", "old", "any", "grow", "trip", "dress", "class", "drop", "clap", "track", "too", "together", "eat", "now", "when", "chin", "think", "chick", "wind", "sink", "under", "know", "why", "where", "came", "lake", "name", "shade", "made", "snake", "fire", "sun", "twigs", "mud", "snow", "sticks");

var  aBatavia4 = new Array("blue", "were", "always", "after", "who", "bite", "smile", "hide", "while", "white", "wide", "work", "some", "buy", "found", "because", "home", "nose", "those", "hope", "rope", "hole", "done", "far", "carry", "clean", "been", "tune", "tube", "cute", "flute", "rule", "mule", "pretty", "live", "little", "light", "how", "way", "wait", "say", "rain", "day", "tail", "brave", "truck", "smoke", "bell", "ring", "pole");

var  aBatavia5 = new Array("so", "all", "four", "over", "many", "she", "bee", "we", "three", "tree", "sheep", "off", "our", "come", "before", "right", "sea", "leaf", "read", "piece", "fields", "reached", "by", "find", "kind", "high", "more", "cold", "hold", "boat", "road", "show", "goes", "eyes", "gone", "head", "room", "everything", "child", "night", "my", "sky", "shy", "tight", "rat", "bugs", "frogs", "logs", "owl", "pond");

var  aDolchPre = new Array("a", "and", "away", "big", "blue", "can", "come", "down", "find", "for", "funny", "go", "help", "hers", "I", "in", "is", "it", "jump", "little", "look", "make", "me", "my", "not", "one", "play", "red", "run", "said", "see", "the", "three", "to", "two", "up", "we", "yellow", "you");

var  aDolchPri = new Array("all", "am", "are", "at", "ate", "be", "black", "brown", "but", "came", "did", "do", "eat", "four", "get", "good", "has", "he", "into", "like", "must", "new", "no", "now", "on", "our", "out", "please", "pretty", "ran", "ride", "saw", "say", "she", "so", "soon", "that", "there", "they", "this", "too", "under", "want", "was", "well", "went", "what", "white", "who", "will", "with", "yes");

var  aDolch1 = new Array("after", "again", "an", "any", "as", "ask", "by", "could", "every", "fly", "from", "give", "going", "had", "has", "her", "him", "how", "just", "know", "let", "live", "may", "of", "old", "once", "open", "over", "put", "round", "some", "stop", "take", "thank", "them", "then", "think", "walk", "where", "when");

var  aDolch2 = new Array("always", "around", "because", "been", "before", "best", "both", "buy", "call", "cold", "does", "don't", "fast", "first", "five", "found", "gave", "goes", "green", "its", "made", "many", "off", "or", "pull", "read", "right", "sing", "sit", "sleep", "tell", "their", "these", "those", "upon", "us", "use", "very", "wash", "which", "why", "wish", "work", "would", "write", "your");

var  aDolch3 = new Array("about", "better", "bring", "carry", "clean", "cut", "done", "draw", "drink", "eight", "fall", "far", "full", "got", "grow", "hold", "hot", "hurt", "if", "keep", "kind", "laugh", "light", "long", "much", "myself", "never", "only", "own", "pick", "seven", "shall", "show", "six", "small", "start", "ten", "today", "together", "try", "warm");

var aMillvilleK = new Array("a","my","the","I","like","go","we","on","to","you",
"have","do","what","no","see","look","come","for","me","one","little",
"are","here");

var sTitle = "";

// global variable for subwindow reference
var newWindow;

// generate and fill the new window
function makeNewWindow(sList,iH,iW) {
    var winoptions = "";
    fGetList(sList);
    winoptions="status, resizable, scrollbars, height=" + iH + ",width=" + iW ;
    //alert(aLocal.length);
    // make sure it isn't already opened
    if (!newWindow || newWindow.closed) {
        newWindow = window.open("","sub",winoptions);
        // delay writing until window exists in IE/Windows
        setTimeout("writeToWindow()", 50);
    } else if (newWindow.focus) {
        // window is already open and focusable, so bring it to the front
        newWindow.focus();
        setTimeout("writeToWindow()", 50);
    }
}
function writeToWindow() {
   var i = 0;

    // assemble content for new window
    var newContent = "<html><head><title>Secondary Window</title></head>";
    newContent += "<body><h1>" + sTitle + "</h1>";
    newWindow.document.write(newContent);
    newContent = "<table>";
    newWindow.document.write(newContent);

    for ( i = 0; i < aWords.length; i = i + 4)
       {
       newContent = "<tr><td>" + aWords[i] + "</td>";
       if ((i+1) < aWords.length)
          newContent += "<td>" + aWords[i+1] +"</td>";
       if ((i+2) < aWords.length)
          newContent += "<td>" + aWords[i+2] +"</td>";
       if ((i+3) < aWords.length)
          newContent += "<td>" + aWords[i+3] +"</td>";
       newContent += "</tr>";
       newWindow.document.write(newContent);
       }
    newWindow.document.close(); // close layout stream
}

function fGetList(sList)
   {
   sTitle = sList;
   switch (sList)
      {
      case 'Kindergarten':
         sTitle = "River Ridge Kindergarten Sight Words";
         aWords = aKindergarten;
         return;
      case 'Firstgrade':
         sTitle = "River Ridge First Grade Sight Words";
         aWords = aFirstgrade;
         return;
      case 'Secondgrade':
         sTitle = "River Ridge Second Grade Sight Words";
         aWords = aSecondgrade;
         return;
      case 'Thirdgrade':
         sTitle = "River Ridge Third Grade Sight Words";
         aWords = aThirdgrade;
         return;
      case 'Fourthgrade':
         sTitle = "River Ridge Fourth Grade Sight Words";
         aWords = aFourthgrade;
         return;
      case 'Fifthgrade':
         sTitle = "River Ridge Fifth Grade Sight Words";
         aWords = aFifthgrade;
         return;
      case 'Bataviak':
         sTitle = "Batavia Kindergarten Sight Words";
         aWords = aBataviaK;
         return;
      case 'Batavia1':
         sTitle = "Batavia First Grade Book 1 Words";
         aWords = aBatavia1;
         return;
      case 'Batavia2':
         sTitle = "Batavia First Grade Book 2 Words";
         aWords = aBatavia2;
         return;
      case 'Batavia3':
         sTitle = "Batavia First Grade Book 3 Words";
         aWords = aBatavia3;
         return;
      case 'Batavia4':
         sTitle = "Batavia First Grade Book 4 Words";
         aWords = aBatavia4;
         return;
      case 'Batavia5':
         sTitle = "Batavia First Grade Book 5 Words";
         aWords = aBatavia5;
         return;
      case 'Dolchpre':
         sTitle = "Dolch Pre-primer Sight Words";
         aWords = aDolchPre;
         return;
      case 'Dolchpri':
         sTitle = "Dolch Primer Sight Words";
         aWords = aDolchPri;
         return;
      case 'Dolch1':
         sTitle = "Dolch First Grade Sight Words";
         aWords = aDolch1;
         return;
      case 'Dolch2':
         sTitle = "Dolch Second Grade Sight Words";
         aWords = aDolch2;
         return;
      case 'Dolch3':
         sTitle = "Dolch Third Grade Sight Words";
         aWords = aDolch3;
         return;
      case 'MillvilleK':
         sTitle = "Millville Kindergarten Sight Words";
         aWords = aMillvilleK;
         return;

      }
   return;
   }