﻿function hideNotification() {
    if ($('#notificationMessage') != null) {
        $('#notificationMessage').hide('blind', null, 1000, null);
    }

}
function showNotification(message, errorLevel) {
    $('#notificationMessageText').html(message);
    switch (errorLevel) {
       
        case 'warning':
            $('#notificationImage').attr('src', "../../Content/Images/Icons/warning.png");
            $('#notificationMessage').css('border-color', 'yellow');
            break;
        case 'information':
            $('#notificationImage').attr('src', "../../Content/Images/Icons/information.png");
            $('#notificationMessage').css('border-color', 'green');
            break;
        case 'error':
        default:
            $('#notificationImage').attr('src', "../../Content/Images/Icons/error.png");
            $('#notificationMessage').css('border-color', 'red');
            break;

    }
    $('#notificationMessage').show('blind', null, 1000, null);
    setTimeout("hideNotification()", 30000);

}
$(document).ready(function () {
    //Hide all subcategories
    $('.menuCategory ~ ul').css({ display: "none" });

    $('.menuCategory').click(function () {
        var menu = $('.menuCategory ~ ul')[0];
        if (menu.style.display == 'none') {
            menu.style.display = 'block';
        }
        else if (menu.style.display == 'block') {
            menu.style.display = 'none';
        }
        return false;
    });

    if ($('#notificationMessageText').html() != '') {
        $('#notificationMessage').show('blind', null, 1000, null);
        setTimeout("hideNotification()", 30000);
    }
   

});

Array.prototype.remove = function(from, to) {
    var rest = this.slice((to || from) + 1 || this.length);
    this.length = from < 0 ? this.length + from : from;
    return this.push.apply(this, rest);
};
