 			return new ActiveXObject("Microsoft.XMLHTTP")
 
 
-	@parseData: (data) ->
-		result = []
-		for name, value of data
-			result.push(name + '=' + encodeURIComponent(value))
-		return result.join('&')
-
-
 	@callHttpEvent: (response, request, event, args = []) ->
 		if Request.Http == null
 			Request.Http = require './Http'

					if @success != null then @success(@response)
					Request.callHttpEvent(@response, @, 'success')
				else
					error = new Error 'Can not load ' + @url + ' address'
					if @error != null then @error(error)
					Request.callHttpEvent(@response, @, 'error', [error])




	constructor: (@url, @type = 'GET', @data = null) ->
		url = @url
		@type = @type.toUpperCase()
		if @type not in ['GET', 'POST', 'PUT', 'DELETE']
			throw new Error 'Http request: type must be GET, POST, PUT or DELETE, ' + @type + ' given'

		if @data != null
			data = @Http.buildQuery(@data)
			if @type != 'POST'
				url = if @url.indexOf('?') != -1 then @url + '&' + data else @url + '?' + data

		@xhr = Request.createRequestObject()
		@xhr.open(@type, url, true)

		if @type == 'POST'
			@setHeader('Content-type', 'application/x-www-form-urlencoded')
