/*
#============================================================================
#
#    $Id: taf.js,v 1.2 2009-03-09 22:17:53 acrosman Exp $
#
#============================================================================

    Copyright 2009 Aaron Crosman


    This program is free software; you can redistribute
    it and/or modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2 of
    the License, or (at your option) any later version.

    This program is distributed in the hope that it
    will be useful, but WITHOUT ANY WARRANTY; without even the implied
    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this software; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/

$(document).ready(function() {
	// Remove the action from the form, and leave it to the script to handle it.
	$("#taf_form").submit(function() {
		$("#TAF").hide();
		var data = {
				'Name':$("#Name").val(),
				'SenderEmail':$("#SenderEmail").val(),
				'Subject':$("#Subject").val(),
				'message':$("#message").val(),
				'Email1':$("#Email1").val(),
				'Email2':$("#Email2").val(),
				'Email3':$("#Email3").val(),
				'Email4':$("#Email4").val(),
				'Email5':$("#Email5").val(),
				'q':"taf"
		};
		$.post("index.php", data, message_sent);
		$("#Sending_Message").removeClass("hide");
		return false;
	});
});

function message_sent() {
	$("#Sending_Message").addClass("hide");
	$("#TAF_Thanks").removeClass("hide");
}