// Wintertree Spell Check Applet
// onCheckSpellingBtn: Respond to a Check Spelling button press
// Copyright (c) 2006 Wintertree Software Inc.
// www.wintertree-software.com
//
// $Id: onCheckSpellingBtn.js,v 2.1 2006/06/15 13:20:24 wsi Exp wsi $

// The pop-up spelling form window
var spellCheckWin = null;

// Array of text areas to check
var textAreasToCheck;

// Override appletLoc, needed because Spell Check Applet is defined in this form.
appletLoc = document;

// Respond to a Check Spelling button press
// Parameters: List of text areas to check.
function onCheckSpellingBtn() {
    if (spellCheckWin != null && !spellCheckWin.closed) {
        // The spell-check form is active. Bring it to the front.
        spellCheckWin.focus();
        return;
    }

    // The pop-up spelling form expects to find the list of text areas in
    // textAreasToCheck
    textAreasToCheck = new Array();
    for (var i = 0; i < arguments.length; ++i) {
        textAreasToCheck[i] = arguments[i];
    }

    // Create the pop-up spelling form
    spellCheckWin = window.open("SpellCheckForm.html", "spellWin",
      'toolbar=0,location=0,directories=0,status=1,scrollbars=1,resizable=1,width=620,height=260');
    if (null == spellCheckWin.opener) {
        spellCheckWin.opener = self;
    }
}

