﻿var dq = String.fromCharCode(34);
var sq = String.fromCharCode(39);

function AddComment(NoteID)
{
    document.getElementById('textareaComment').disable = true;
    Syrupie.WWW.Services.Note.AddComment(NoteID, document.getElementById('textareaComment').value);
    setTimeout('GetComments(' + NoteID + ');', 1000)
    document.getElementById('textareaComment').value = '';
    document.getElementById('textareaComment').disable = false;
}

function DeleteNote(String1, String2)
{
    if (confirm('Delete \"' + String2 + '\"?'))
    {
        document.getElementById('divNote' + String1).style.display = 'none';
        Syrupie.WWW.Services.Note.DeleteNote(String1);
    }
}

function DeleteComment(String1, String2)
{
    if (confirm('Delete this comment?'))
    {
        document.getElementById('divComment' + String2).style.display = 'none';
        Syrupie.WWW.Services.Note.DeleteComment(String1, String2);
    }
}

function GetComments(NoteID)
{
    Syrupie.WWW.Services.Note.GetComments
    (
        "en-US",
        NoteID,
        function (Comments)
        {
            document.getElementById('divComments').innerHTML = Comments;
        }
    );
}

function GetFriendsNotes()
{
    Syrupie.WWW.Services.Note.GetFriendsNotes
    (
        "en-US",
        function (Notes)
        {
            document.getElementById('divNotes').innerHTML = Notes;
        }
    );
}

function GetNote(NoteID)
{
    Syrupie.WWW.Services.Note.GetNote
    (
        "en-US",
        NoteID,
        function (Notes)
        {
            document.getElementById('divNote').innerHTML = Notes;
        }
    );
}

function GetNotes(String1, String2)
{
    Syrupie.WWW.Services.Note.GetNotes
    (
        "en-US",
        String1,
        String2,
        function (Notes)
        {
            document.getElementById('divNotes').innerHTML = Notes;
        }
    );
}
