﻿$(document).ready(function() {
    // Perform the cookie check
    if ($.cookie("MessageAlertShown") == null) {
        $(".messageAlert").css("top", "87px");
    }

    // Bind to the click event of the alert
    $(".messageAlert").bind('click', function() {
        // Set the datetime when the user was clicked on the message
        var currentTime = new Date();
        var month = currentTime.getMonth() + 1;
        var day = currentTime.getDate();
        var year = currentTime.getFullYear();

        // Set the cookie to say we've been shown the message
        $.cookie("MessageAlertShown", year + "/" + month + "/" + day, { expires: 365 });

        // Hide the message
        $(".messageAlert").css("top", "-999em");
    });
});
