﻿function hideDemo() {
    $(".formWrapper").fadeOut("fast", function () {
        $(".dimBg").animate({ 'opacity': '0' }, function () {
            $(".dimBg").css({ 'width': '0px', 'height': '0px', 'opacity': '0' });
        });
    });
}

function validateForm() {
    $('.formWrapper .row input[type="text"]').each(function () {
        if ($(this).val() != "") {
        } else {
            $(this).css({ 'border': 'red 2px solid' });
        }
    });
}

function resetForm() {
    $('.formWrapper .row input[type="text"]').each(function () {
        $(this).val("");
    });
}

function unValidate() {
    $('.formWrapper .row input[type="text"]').css({'border':'#ccc 2px solid'});
}

$().ready(function () {

    $(".demo").click(function () {
        $(".dimBg").css({ 'width': '100%', 'height': '100%', 'opacity': '0' }).animate({ 'opacity': '0.7' }, function () {
            $(".formWrapper").fadeIn("fast");
        });
    });

    $(".closeRequest").click(function () {
        hideDemo();
        resetForm();
    });


    $("ul").each(function () {
        $(this).children("li:last").addClass("last");
    });
});
