﻿var Statistics =
{
    UpdateTaxonomyStatistics: function(listtext,linktype)
    {
        Statistics.MakeRequest('/xml/Statistics.ashx?f=tax&lt=' + linktype, "POST", "tax=" + listtext, null, null)  
    },
    MakeRequest: function(url, verb, data, func, obj)
    {
        var TheRequest = new Sys.Net.WebRequest()

        TheRequest.set_url(url)
        TheRequest.set_httpVerb(verb)

        if (data)
        {
            TheRequest.set_body(data)
            TheRequest.get_headers()["Content-Length"] = data.length;
        }

        TheRequest.add_completed(Statistics.MakeRequestComplete)
        TheRequest.invoke()

        return TheRequest
    },
    MakeRequestComplete: function(executer, eventArgs)
    {
//        if (executer.get_responseAvailable())
//        {
//            alert(executer.get_responseData().replace(/\u2028/g, ''))
//        }
//        else
//        {
//            TheParams.responseData = null
//            alert('no response')
//        }
    }
}

var LinkType =
{
    Website : 1,
    Email   : 2
}
