﻿$(function() {

    $('.error').hide();
    $('.message').hide();

	/*$(function()
{
	$('.FAQHolder').jScrollPane();
});
*/
    $("input#SubmitFAQButton").click(function() {
        //alert("Join");
        var error = false;
		var clientIdPrefix = "ctl00_LeftContent_";
        //Validation
        $('.error').hide();

        var faq_question = $("#"+clientIdPrefix+"FAQTextBox").val();

        if (faq_question == "") {
            $("#FAQTextBoxError").show();
            $("#"+clientIdPrefix+"FAQTextBox").focus();
            error = true;
        }

        if (error) {
            return false;
        }

        var dataString = 'faq_question=' + faq_question;

        $.ajax({
            type: "POST",
            url: "ProcessSubmitFAQ.aspx",
            data: dataString,
            success: function(response) {
                // Replace the div's content with the page method's return.
                if (response == "Success") {
                    $('#FAQControls').hide();
                    $('#ConfirmationFAQ').show();
                } else {
                    $('#FAQControls').hide();
                    $('#ErrorFAQ').show();
                }
            }
        });
    });
});
  