﻿/// <reference path="../../Scripts/jquery-1.3.2.min-vsdoc.js" />

$().ready(function() {
    TipValidate();
});

function TipSuccess(content) {
    if (content.get_data().toString().toLowerCase() == 'true') {
        $("#boxSuccess").show();
        $("#SenderName").val("");
        $("#ReceiverEmail").val("");
        window.setTimeout(function() {
            $("#boxSuccess").fadeOut(500);
        }, 5500);

    }
    else {
        $("#boxError").show();
        window.setTimeout(function() {
            $("#boxError").fadeOut(500);
        }, 1500);
    }
}

function TipValidate() {
    $("#TipForm").validate({
        rules: {
            SenderName: "required",
            RecieverEmail:
                {
                    required: true,
                    email: true
                }
        },
        messages: {
        SenderName: "",
        RecieverEmail: ""
        }
    });
}
