function showContactForm() {
    if ($('#theContactForm').get(0)==undefined) {
        $.ajax({
            url: "Content/form_contact.htm",
            cache: false,
            success: function(html) {
                $(document.body).prepend(html);
                $('#contactForm').animate({
                    opacity: 1.0,
                    top: "0px"
                }, 1500);
                window.scrollTo(0, 0);
            }
        });
    }
    else {
        $('#contactForm').animate({
            opacity: 1.0,
            top: "0px"
        }, 1500);
        window.scrollTo(0, 0);
    }
    }


    function validateForm(errorElement,fields) {
        var valid = true;
        var message = "";
        
        //reset validation
        $('input.error').removeClass('error');
        $('#errors').remove();

        $.each(fields, function(i, obj) {
            if (obj.regEx != undefined) {
                var value = $('#' + obj.id).val();
                if (!obj.regEx.test(value)) {
                    obj.valid = false;
                    valid = false;
                    message += '<div class="row"><label class="error">' + obj.name + ": is not in a valid value</label></div>";
                }
            }

            if ($('#' + obj.id).val().length < obj.minLength) {
                valid = false;
                message += '<div class="row"><label class="error">' + obj.name + ": " + obj.message + "</label></div>";
                obj.valid = false;
                $('#' + obj.id).addClass('error');
            }
        });

        if (!valid) {

            window.scrollTo(0, 0);

            $('#' + errorElement).prepend('<div id="errors"><h1 class="error">Sorry, Please correct the Errors</h1><fieldset></fieldset></div>');
            $('#errors').find('fieldset').append(message);

            return false;
        }
        else {
            return true;
        }
    }
$(document).ready(function() {
    try {

        var name = '#top';
        var menuYloc = parseInt($(name).css("top").substring(0, $(name).css("top").indexOf("px")))
        /*
        $(window).scroll(function() {
            var offset = menuYloc + $(document).scrollTop() + "px";
            $(name).animate({ top: offset }, { duration: 500, queue: false });
        });
        */
    }
    catch (e) {
        if (e.message != undefined) {
            alert("doc.ready issues:" + e.message + e.sourceURL + e.line);
        }
    }

});