var thnx = function() {
    // How long the thankskid stays visible.
    var _persistLength = 7000;
    
    var _imgPath;

    var _kidImgs = [
    	"bella2.gif",
    	"maggie2.gif",
    	"george2.gif",
    	"trey2.gif"
	];

    var _responses = {
        Contact: "Thanks for the email. We've got our best on it now.",
        Enroll: "Thanks for applying. We'll be in touch shortly.",
        Signup: "Your newsletter subscription will begin immediately.",
        GeorgiaFriends: "Thanks for enrolling. Your involvement is very important to me."
    };

    var random = function(sampleSize) {
        return Math.floor(Math.random() * sampleSize)
    };

    return {
        init: function(imagesPath) {
            _imgPath = imagesPath;
        },

        giveThanks: function(form) {
            //form="Contact";
            if (form != "") {
                var kid = random(4);

                $("#thankskid > img")[0].src = _imgPath + _kidImgs[kid];
                var thankU = _responses[form];
                $("#bubblespeech2").html(thankU);
                $("#bigbubble2").fadeTo(1500, 1).fadeIn(500,
					function() {
                        $(this).fadeTo(_persistLength, 1).fadeOut("slow");
                        $("#thankskid > img").fadeTo(_persistLength, 1).fadeOut("slow");
					}
				);
                $("#thankskid").fadeTo(1500, 1).fadeIn(500);
            }
        }
    };
} ();