
function utilAJAX() 
{
	// Nothing to do for this class.
}

utilAJAX.prototype.randomKeyTag = function()
{
	return '&RKEY=' + Math.random() * Date.parse(new Date());
}

utilAJAX.prototype.cancelRequest = function(xmlRequest) 
{
	if (xmlRequest!=null){xmlRequest.abort();}
}

utilAJAX.prototype.checkDate = function(inDate)
{
	var outDate = inDate;
	if (inDate.length == 6) 
	{
		outDate = inDate.substring(0,2) + "/" + inDate.substring(2).substring(0,2) + "/20" + inDate.substring(4);
	}
	
	if (this.isValidDate(outDate) == false || outDate.length != 10) 
	{
		alert('Not in a valid date format.  Please use MMDDYY or MM/DD/YYYY.');
	}
	
	return outDate;
}

utilAJAX.prototype.isValidDate = function(inDate)
{
	var dp = /(0[1-9]|1[012])[- \.](0[1-9]|[12][0-9]|3[01])[- \.](19|20)\d\d/;
	var returnValue = dp.test(inDate);
	
	if (inDate.length != 10) {returnValue = false;}
	
	return returnValue;
}

utilAJAX.prototype.getXMLHTTPRequest = function() 
{
	var xmlHttp;
	
	try
	{
		xmlHttp = new ActiveXObject("Msxml2.XMLHttp");
	}
	catch (e)
	{
		try
		{
			xmlHttp = new ActiveXObject("Microsoft.XMLHttp");
		}
		catch (e2)
		{
		}	
	}
	
	
	if (xmlHttp == undefined && (typeof XMLHttpRequest != 'undefinded'))
	{
		xmlHttp = new XMLHttpRequest();
	}
	
	return xmlHttp;
}

