function DelButton(theme) {
    this.tp = "Del";
    $("#DeleteNote").attr("title", Strings.Getdelnote());
    
    this.SetTheme(theme);
    $("#DeleteNote").click(function() {
        
        if (!Notes.MinFilled()) {
            if (Global.GetPromptDelete()) {
                UI.ShowDelete();
                
            }
            else {
                UI.DeleteNote();
                UI.ShowPosition();
                $("#DeleteNote").mouseover();
            }

        }
    });
    $("#DeleteNote").mouseover(function() {
        if ($("#DeleteNote").attr("src").indexOf("Dis") == -1) {
            $("#DeleteNote").attr("src", DelButton.ImgHov.src);
        }
    });
    $("#DeleteNote").mousedown(function() {
        if ($("#DeleteNote").attr("src").indexOf("Dis") == -1) {
            $("#DeleteNote").attr("src", DelButton.ImgCli.src);
        }
    });
    
    $("#DeleteNote").mouseout(function() {
    $("#DeleteNote").attr("src", (Notes.MinFilled()) ? DelButton.ImgDis.src : DelButton.Img.src);
    });
    this.Show(true);
}

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

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

DelButton.prototype.SetState = function() {
    $("#DeleteNote").attr("src", (Notes.MinFilled()) ? DelButton.ImgDis.src : DelButton.Img.src);
}

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