function AddButton(theme) {
    this.tp = "Add";
    $("#AddNote").attr("title", Strings.Getaddnote());

    this.SetTheme(theme);
    
    $("#AddNote").click(function() {
        if (!Notes.MaxFilled())
            {
               UI.Move(Notes.CurrentNoteIndex(), Notes.GetNewNoteIndex(), true);
                Notes.AddNote();
                var curr = Notes.CurrentNoteIndex();
                UI.Changed[curr] = true;
                UI.TextChanged();
                UI.ShowPosition();
                $("#AddNote").mouseover();
            }
    });
    $("#AddNote").mouseover(function() {
        if ($("#AddNote").attr("src").indexOf("Dis") == -1) {
            $("#AddNote").attr("src", AddButton.ImgHov.src);
        }
    });
    $("#AddNote").mousedown(function() {
        if ($("#AddNote").attr("src").indexOf("Dis") == -1) {
            $("#AddNote").attr("src", AddButton.ImgCli.src);
        }
    });
    
    $("#AddNote").mouseout(function() {
    $("#AddNote").attr("src", (Notes.MaxFilled()) ? AddButton.ImgDis.src : AddButton.Img.src);
    });
    this.Show(true);
}
AddButton.prototype.SetState = function() {
    $("#AddNote").attr("src", (Notes.MaxFilled()) ? AddButton.ImgDis.src : AddButton.Img.src);
}

AddButton.prototype.SetTheme = function(theme) {
    AddButton.ImgCli.src = "Themes/" + theme + "/" + this.tp + "OnClick.png";
    AddButton.ImgHov.src = "Themes/" + theme + "/" + this.tp + "OnHover.png";
    AddButton.Img.src = "Themes/" + theme + "/" + this.tp + "OnNormal.png";
    AddButton.ImgDis.src = "Themes/" + theme + "/" + this.tp + "Dis.png";
    this.SetState();
}

AddButton.prototype.Show = function(val) {
    $("#AddNote").css("display", val ? "block" : "none");
}




AddButton.ImgCli = new Image;
AddButton.ImgHov = new Image;
AddButton.Img = new Image;
AddButton.ImgDis = new Image;