/*
 * qna_common_wizard.js
 *
 * JavaScript file for common Q&A wizard functionality.
 * 
 */


/**
  * Handle a key press release event in the question box.
  */
function handleKeyPress_QuestionBoxForWizard(p_evt, p_question)
{
    var ew = new EventWrapper(p_evt, qna_browser);

    if (ew.isKeyPress(ew.key.ENTER))
    {
        var qBox = ew.getElement();
        qBox.blur();
        qBox.value = qBox.value.replace(/\s+$/,''); // Strip whitespace from end
        submitQuestionForWizard(p_question);
        return false;
    }
    else
    {
        if (ew.getElement().value.length > 135)
        {
            ew.getElement().value = ew.getElement().value.substring(0,135);
            alert(qna_max_size_alert);
            return false;
        }
    }

    return true;
}
