/**
*	AJAX Javascript file.
*	This is a basic implementation of JS required
*	to use AJAX.
*
*	@author					Luis Guillermo Salazar Baez <luissalazar@dptsportsgroup.com>
*	@copyright				DPT Sports Group 2006
*	@category				JS
*	@version				1.0
*/





/**
*	Gets the proper XMLHttpRequest-like object
*	depending on user's web browser.
*
*	@return					XMLHttpRequest Object
*/
function getXMLHTTPObject()
{
		var xmlObject = null;
		
		// First, lets see think user uses IE.
		if ( window.ActiveXObject )
		{
			try
			{
				xmlObject = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch(e)
			{
					try
					{
						xmlObject = new ActiveXObject("Microsoft.XMLHTTP");
					}
					catch(f) {}
			} // catch
		} // if
		
		// If not IE, then lets think it may be Firefox.
		//	Actually, this is the standard one.
		if ( xmlObject==null && (window.XMLHttpRequest) )
		{
			xmlObject = new XMLHttpRequest();
		}
		
		return xmlObject;
		
} // getXMLHTTPObject




/**
*	Return a Boolean indicating if
*	the passed object had succeced on 
*	its last request.
*
*	@param					XMLHttpRequest xmlObject
*	@return					boolean
*/
function requestSucceded(xmlObject)
{
	if ( xmlObject != null )
	{
		return ( xmlObject.readyState==4 || xmlObject.readyState=="complete" );
	}
	else
	{
		return false;
	}
} // requestSucceded