//===============//
// Class webRead //
//===============//

function WebRead()
{
	// User Inputs These Fields
	this.url = "";

	// Class Returns These Fields
	this.text = "";
	this.status = 0;
	this.error = "";

	// Class Offers These Methods
	this.getText = getResponse;
}

function getResponse()
{
	var req = false;
	// For Safari, Firefox, and other non-MS browsers
	if (window.XMLHttpRequest)
	{
		try
		{
			req = new XMLHttpRequest();
		}
		catch (e)
		{
			this.status = 1;
			this.error = "Cannot Create HTTP Request Object";
			return;
		}
	}
	else if (window.ActiveXObject)
	{
		// For Internet Explorer on Windows
		try
		{
			req = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				req = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				this.status = 1;
				this.error = "Cannot Create HTTP Request Object";
				return;
			}
		}
	}
	try
	{
		req.open("POST", this.url , false);
		req.send("");
	}
	catch (e)
	{
		this.status = 1;
		this.error = "Cannot Access Web Service";
		return;
	}

	this.text = req.responseText;
}