// JavaScript Document

// execute your scripts when the DOM is ready. this is a good habit
$(function() {

	// select all desired input fields and attach tooltips to them
	$(".SignUpForm :input.Tip").tooltip({
		position: "center right",   // place tooltip on the right edge
		offset: [-2, 10],   // a little tweaking of the position
		effect: "fade", // use the built-in fadeIn/fadeOut effect
		opacity: 0.7,   // custom opacity setting
		tip: '.tooltip' // use this single tooltip element
	});

	$(".SignUpForm img.Tip").tooltip({
		position: "center right",   // place tooltip on the right edge
		offset: [-2, 10],   // a little tweaking of the position
		effect: "fade", // use the built-in fadeIn/fadeOut effect
		opacity: 0.7,   // custom opacity setting
		tip: '.tooltip' // use this single tooltip element
	});

});

$(document).ready(function() {
    $("#AlreadyAMember").find(".Forgot").click(function() {
        $("#AlreadyAMember").hide();
        $("#ForgotPW").show();
    });
    $("#ForgotPW").find(".CancelBtn").click(function() {
        $("#AlreadyAMember").show();
        $("#ForgotPW").hide();
    });

    // Show 'Confirm Password' Box
    $("#Text1").focus(function() {
        $("#ConfirmPassword").slideDown();
    });
    // Prevent Form Submit if passwords don't match
    $("#RegisterForm").find("input.Submit").click(function() {
        if ($("#Text1").val() != $("#Text2").val()) {
            alert("Your passwords do not match. \n\nPlease re-enter your password.\n ");
            $("#Text1, #Text2").val("");
            $("#Text1").focus();
            return false;
        }
    });
});
