﻿$(document).ready(function () {
    var memberAccess = $('#memberAccess');
    var mask = $('#mask');
    var popUp = $('#popUp');
    var popUpC = $('#popUpContent');
    var closer = $('#closeBar');


    memberAccess.click(function () {
        window.location = "http://www.bennettsgrove.com/pages/includes/loginUser.aspx";
    });

    closer.click(function () {
        mask.fadeOut("fast");
        popUp.fadeOut("fast");
    });

    $(".button").click(function () {
        var myVar = $(this).attr("title");
        myVar = encodeURIComponent(myVar);

        if (myVar == "eventCalendar") {
            window.location = 'https://www.bigtent.com/log_in';
        } else if (myVar == "profile") {
            window.location = '../Account/default.aspx';
        } else {
            window.location = myVar + '.aspx';
        }
    });

    $("#contactOptions").change(function () {
        var x = $("#contactOptions").val();
        if (x == "Submit Form") {
            $("#uploadForm").fadeIn("fast");
        } else {
            $("#uploadForm").fadeOut("fast");
        }
    });


    jQuery.fn.dimScreen = function () {
        var maskHeight = $(document).height();
        var maskWidth = $(window).width();
        this.css({ 'width': maskWidth, 'height': maskHeight });
        this.fadeTo("fast", ".6");
    }

    jQuery.fn.center = function () {
        this.css("position", "absolute");
        this.css("top", ($(window).height() - this.height()) / 2 + $(window).scrollTop() + "px");
        this.css("left", ($(window).width() - this.width()) / 2 + $(window).scrollLeft() + "px");
        return this;
    }



});
