function Status(val) {
    this.LoggedInImg = new Image;
    this.LoggedInImg.src = "Images/green.png";
    this.LoggedOutImg = new Image;
    this.LoggedOutImg.src = "Images/red.png";
    this.SyncImg = new Image;
    this.SyncImg.src = "Images/yellow.gif";
    this.State = val;
    this.SetState(val);
    this.Show(true);
    $("#Status_Login").text(Strings.GetLogin());
    $("#Status_Register").text(Strings.GetRegister());
    $("#Status_Login").click(function() {
        Platform.ShowLogin();
    });
    $("#Status_Register").click(function() {
        Platform.ShowRegister();
    });
    if (true)//GLOBAL>SHOWSTATE TEXT
    {
        this.ShowText(true);
    }
}

Status.prototype.SetState = function(val) {
    this.State = val;
    $("#status_status > div").css("display", "none");
    switch (val) {
        case 0:
            $("#status_img").attr("src", this.LoggedOutImg.src);
            $("#status_img").attr("title", Strings.GetclickLogin());
            $("#status_loggedout").css("display", "block");
            $("#status_img").css("cursor", "pointer");
            $("#status_img").click(function() {
                Platform.ShowLogin();
            });

            break;
        case 1:
            $("#status_img").attr("src", this.LoggedInImg.src);
            $("#status_img").attr("title", Strings.GetclickLogout());
            $("#status_loggedin").css("display", "block");
            $("#status_loggedin").text(Strings.Getloggedin());
            $("#status_img").css("cursor", "pointer");
            $("#status_img").click(function() {
                Platform.ShowLogOut();
            });
            break;
        case 2:
            $("#status_img").attr("src", this.SyncImg.src);
            $("#status_img").css("cursor", "default");
            if (Notes.LoggedIn()) {
                $("#status_syncing").text(Strings.Getsyncing());
                $("#status_img").attr("title", Strings.Getsyncing());
            }
            else {
                $("#status_syncing").text(Strings.Getsaving());
                $("#status_img").attr("title", Strings.Getsaving());
            }
            $("#status_syncing").css("display", "block");
            $("#status_img").click(function() { });
            break;
    }
}


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

Status.prototype.ShowText = function(val) {
    $("#status_status").css("display", val ? "block" : "none");
}


