﻿$(function() {
    $('.rounded').corners("transparent");

    $("#enquiry").click(function() {
        var Details = {};

        $('input:text').each(function() { Details[this.id] = this.value; });
        $('textarea').each(function() { Details[this.id] = this.value; });

        var DTO = { 'details': Details };

        $.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",
            url: "Services.asmx/RegisterContact",
            data: JSON.stringify(DTO),
            dataType: "json",
            success: function() {
                $("#contactform").replaceWith("<p class=\"contacttitle\">Thank you for<br />contacting <img src=\"images/logo_med.png\" alt=\"logo\" width=\"47\" height=\"16\" /></p>");
            }
        });
    });
});
