var HTTP = {
	status : function(_status){
		var s = _status.toString().split("");
		var reply;
		switch(s[0])
		{
			case "1":
				reply = this.getInformationalStatus(_status);
				break;
			case "2":
				reply = this.getSuccessfulStatus(_status);
				break;
			case "3":
				reply = this.getRedirectionStatus(_status);
				break;
			case "4":
				reply = this.getClientErrorStatus(_status);
				break;
			case "5":
				reply = this.getServerErrorStatus(_status);
				break;
			default:
				reply = "An unexpected error has occured.";
		}
		return reply;
	},

	getInformationalStatus : function(_status){
		var reply;
		switch(_status)
		{
			case 100:
				reply = "Continue";
				break;
			case 101:
				reply = "Switching Protocols";
				break;
			default:
				reply = "An unexpected error has occured.";
		}
		return reply;
	},

	getSuccessfulStatus : function(_status){
		var reply;
		switch(_status)
		{
			case 200:
				reply = "OK";
				break;
			case 201:
				reply = "Created";
				break;
			case 202:
				reply = "Accepted";
				break;
			case 203:
				reply = "Non-Authoritative Information";
				break;
			case 204:
				reply = "No Content";
				break;
			case 205:
				reply = "Reset Content";
				break;
			case 206:
				reply = "Partial Content";
				break;
			default:
				reply = "An unexpected error has occured.";
		}
		return reply;
	},

	getRedirectionStatus : function(_status){
		var reply;
		switch(_status)
		{
			case 300:
				reply = "Multiple Choices";
				break;
			case 301:
				reply = "Moved Permanently";
				break;
			case 302:
				reply = "Found";
				break;
			case 303:
				reply = "See Other";
				break;
			case 304:
				reply = "Not Modified";
				break;
			case 305:
				reply = "Use Proxy";
				break;
			case 307:
				reply = "Temporary Redirect";
				break;
			default:
				reply = "An unexpected error has occured.";
		}
		return reply;
	},

	getClientErrorStatus : function(_status){
		var reply;
		switch(_status)
		{
			case 400:
				reply = "Bad Request";
				break;
			case 401:
				reply = "Unauthorized";
				break;
			case 402:
				reply = "Payment Required";
				break;
			case 403:
				reply = "Forbidden";
				break;
			case 404:
				reply = "File not found";
				break;
			case 405:
				reply = "Method Not Allowed";
				break;
			case 406:
				reply = "Not Acceptable";
				break;
			case 407:
				reply = "Proxy Authentication Required";
				break;
			case 408:
				reply = "Request Timeout";
				break;
			case 409:
				reply = "Conflict";
				break;
			case 410:
				reply = "Gone";
				break;
			case 411:
				reply = "Length Required";
				break;
			case 412:
				reply = "Precondition Failed";
				break;
			case 413:
				reply = "Request Entity Too Large";
				break;
			case 414:
				reply = "Request-URI Too Long";
				break;
			case 415:
				reply = "Unsupported Media Type";
				break;
			case 416:
				reply = "Requested Range Not Satisfiable";
				break;
			case 417:
				reply = "Expectation Failed";
				break;
			default:
				reply = "An unexpected error has occured.";
		}
		return reply;
	},

	getServerErrorStatus : function(_status){
		var reply;
		switch(_status)
		{
			case 500:
				reply = "Internal Server Error";
				break;
			case 501:
				reply = "Not Implemented";
				break;
			case 502:
				reply = "Bad Gateway";
				break;
			case 503:
				reply = "Service Unavailable";
				break;
			case 504:
				reply = "Gateway Timeout";
				break;
			case 505:
				reply = "HTTP Version Not Supported";
				break;
			default:
				reply = "An unexpected error has occured.";
		}
		return reply;
	}
};

