///Last Modified Date : 2007-12-21
///Changes - add ".aspx" in Url Request

function Ajax_KickStory(storyID, isKick, success, failure) {
    StartLoading();
    dojo.io.bind({
        url: AJAX_BASE_URL + "/kickit/" + storyID + "/" + isKick + ".aspx",
        load: function(type, data, evt) { success(storyID, data); },
        error: function(type, data, evt) { failure(); },
        mimetype: "text/plain"
    });
}

function Ajax_GetUserStoryTags(storyID, success, failure) {
    StartLoading();
    dojo.io.bind({
        url: AJAX_BASE_URL + "/getuserstorytags/" + storyID + ".aspx",
        load: function(type, data, evt) { success(storyID, data); },
        error: function(type, data, evt) { failure(); },
        mimetype: "text/plain"
    });
}

function Ajax_AddUserStoryTags(storyID, tagInput, success, failure) {
    StartLoading();
    dojo.io.bind({
        url: AJAX_BASE_URL + "/adduserstorytags/" + storyID + ".aspx?tags=" + escape(tagInput),
        load: function(type, data, evt) { success(storyID, data); },
        error: function(type, data, evt) { failure(); },
        mimetype: "text/plain"
    });
}

function Ajax_RemoveUserStoryTag(storyID, tagID, success, failure) {
    StartLoading();
    dojo.io.bind({
        url: AJAX_BASE_URL + "/removeuserstorytag/" + storyID + "/" + tagID + ".aspx",
        load: function(type, data, evt) { success(storyID, tagID, data); },
        error: function(type, data, evt) { failure(); },
        mimetype: "text/plain"
    });
}

function Ajax_GetPopularStories(sortBy, pageNumber, success, failure) {
    StartLoading();
    dojo.io.bind({
        url: AJAX_BASE_URL + "/getpopularstories/" + sortBy + "/" + pageNumber + ".aspx",
        load: function(type, data, evt) { success(data); },
        error: function(type, data, evt) { failure(); },
        mimetype: "text/plain"
    });
}

function Ajax_ReportAsSpam(storyID, success, failure) {
    StartLoading();
    dojo.io.bind({
        url: AJAX_BASE_URL + "/reportasspam/" + storyID + ".aspx",
        load: function(type, data, evt) { success(storyID, data); },
        error: function(type, data, evt) { failure(); },
        mimetype: "text/plain"
    });
}

function Ajax_ViewStory(storyID, success, failure) {
    StartLoading();
    dojo.io.bind({
        url: AJAX_BASE_URL + "/viewit/" + storyID + ".aspx",
        load: function(type, data, evt) { success(storyID, data); },
        error: function(type, data, evt) { failure(); },
        mimetype: "text/plain"
    });
}