$(document).ready(function() {
    var easterEgg = 'admin';
    var eggLength = easterEgg.length;
    var keyHistory = '';
    var match;
        $(document).keypress(function(e) {
            keyHistory += String.fromCharCode(e.which)
            match = keyHistory.match(easterEgg); 
            if(match) {
                keyHistory = '';
                $('.adminForm').slideDown('normal');  
            } else if (keyHistory.length > 30) {
                keyHistory = ''
            }
        });
});

$(document).ready(function() {
    $('.adminClose').click(function(){
        $('.adminForm').slideUp('normal');
    });   
});

/*OBVESTILA*/
$(function(){
    hideErrors();
});


function hideErrors(){
    $('#errorTip').hide();  
    $('#errorNaslov').hide(); 
    $('#errorVsebina').hide(); 
}

function onSubmitError(){
        hideErrors();
        var tip = $("#tipObvestilaSelect").val();
        if(tip == "0"){
            $('#errorTip').fadeIn("slow");
            $("input#tipObvestilaSelect").focus();
            return false;
        }
        
        var naslov = $(".naslovObvestila").val();
        if(naslov == ""){
            $('#errorNaslov').fadeIn("slow");
            $(".naslovObvestilat").focus();
            return false;
        }
        
        return true;
}

function makesure() {
  if (confirm("Si prepričan, da želiš izbrisati to obvestilo?")) {
        return true;
  }
  return false;
}

