﻿//Quick Form Show Hidden
$(document).ready(function () {
    $('#QuickFormShow').click(function () {
        $('#QuickFormHide').slideDown('');
    });
});


//Quick Form success!
$(function () {
    $('#AppointmentContactForm').submit(function () {
        $.ajax({
            type: this.method,
            url: this.action,
            data: $(this).serialize(),
            success: function (result) {
                $('#AppointmentContactForm')[0].reset();
                $("#SentAppointmentMessage").show("slow");
            }
        });
        setTimeout(function () {
            $("#SentAppointmentMessage").hide("slow");
            $('#QuickFormHide').slideUp('');
        }, 2000);
        
        return false;
    });
});

//Contact Form success!
$(function () {
    $('#ContactForm').submit(function () {
        $.ajax({
            type: this.method,
            url: this.action,
            data: $(this).serialize(),
            success: function (result) {
                $('#ContactForm')[0].reset();
                $("#ContactForm").hide("slow");
                $("#SentContactMessage").show("slow");
                setTimeout(function () {
                    window.location = "/";
                }, 2000);
            }
        });
        setTimeout(function () {
            $("#SentContactMessage").hide("slow");
        }, 2000);
        return false;
    });
});



        
