function PrevButton(theme) {
    this.tp = "Back";
    $("#DownNote").attr("title", Strings.Getpreviousnote());

    this.SetTheme(theme);

    $("#DownNote").click(function() {
        if (!Notes.IsFirst()) {
            UI.Move(Notes.CurrentNoteIndex(), Notes.PreviousNoteIndex(), false);
            Notes.MoveBackward();
            UI.ShowPosition();
            $("#DownNote").mouseover();
        }
    });
    $("#DownNote").mouseover(function() {
        if ($("#DownNote").attr("src").indexOf("Dis") == -1) {
            $("#DownNote").attr("src", PrevButton.ImgHov.src);
        }
    });
    $("#DownNote").mousedown(function() {
    if ($("#DownNote").attr("src").indexOf("Dis") == -1) {
            $("#DownNote").attr("src", PrevButton.ImgCli.src);
        }
    });
   
    $("#DownNote").mouseout(function() {
    $("#DownNote").attr("src", (Notes.IsFirst()) ? PrevButton.ImgDis.src : PrevButton.Img.src);
    });
    this.Show(true);
}

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

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

PrevButton.prototype.SetState = function() {
    $("#DownNote").attr("src", (Notes.IsFirst()) ? PrevButton.ImgDis.src : PrevButton.Img.src);
}


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