﻿/// <reference path="jquery.js" />
/// <reference path="ww.jquery.js" />

// *** create an instance of the service proxy
var serviceUrl = "Service.svc/"
var proxy = new ServiceProxy(serviceUrl);


$(document).ready(function() {

});
function savecomment() {

    var name = $('#customername').val();
    var email = $('#emailaddress').val();
    var phone = $('#phonenumber').val();
    var subject = $('#subject').val();
    var comment = $('#txtComment').val();
    $('#btnSubmit').disabled = true;

    proxy.invoke("SaveComment", { name: name, phone: phone, email: email, subject: subject, comment: comment }, function(result) {
        if (!result) {


            alert('There was an issue during the saving of your comment please try again.');

        } else {
           
            $('input:text').val("");
            alert('Thank you for the comment we will respond to you as soon as possibel.');
        }
    });
    
}
