function NextButton(theme) {
    this.tp = "Forw";
    $("#UpNote").attr("title", Strings.Getnextnote());
    
    this.SetTheme(theme);
    
    
    $("#UpNote").click(function() {
        if (!Notes.IsLast()) {
            UI.Move(Notes.CurrentNoteIndex(), Notes.NextNoteIndex(), true);
            Notes.MoveForward();
            UI.ShowPosition();
            $("#UpNote").mouseover();
        }
    });
    
    $("#UpNote").mouseover(function() {
        if ($("#UpNote").attr("src").indexOf("Dis") == -1) {
            $("#UpNote").attr("src", NextButton.ImgHov.src);
        }
    });
   
    $("#UpNote").mousedown(function() {
        if ($("#UpNote").attr("src").indexOf("Dis") == -1) {
            $("#UpNote").attr("src", NextButton.ImgCli.src);
        }
    });
    
    $("#UpNote").mouseout(function() {
    $("#UpNote").attr("src", (Notes.IsLast()) ? NextButton.ImgDis.src : NextButton.Img.src);
    });
    this.Show(true);
}

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

}

NextButton.prototype.SetState = function() {
    $("#UpNote").attr("src", (Notes.IsLast()) ? NextButton.ImgDis.src : NextButton.Img.src);
}


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


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