/////////////////////////////////////////////////////////////////////////////
// 
//                            HEATWAVE  FRAMEWORK
// 
// -------------------------------------------------------------------------
//                                 LICENSE
// -------------------------------------------------------------------------
// 
// This source file is under the License Agreement that is present in the
// file LICENSE.txt.
// 
// The License Agreement is also available at the following URL:
// http://heatwave.heartbeat.ro/license/
// 
// If you did not receive a copy of the license and are unable to obtain it
// through the world-wide-web, please send an e-mail to
// heatwave.license@heartbeat.ro so we can send you a copy immediately.
// 
/////////////////////////////////////////////////////////////////////////////

/**
 * @function create_request
 * 
 * @description
 * 		Creates the request object used for sending requests to the server.
 * 
 * @return
 * 		@type
 * 			mixed
 * 
 * 		@description
 * 			Returns the request object on success, FALSE otherwise.
 * 
 * @changelog
 *		@version 1.0.0
 *			Creation of the function.
 * 
 */
function create_request()
{
	// default value
	var request = false;
	
	// try to create object for IE7+, Firefox, Chrome, Safari, Opera
	try
	{
		// create XMLHttpRequest object
		request = new XMLHttpRequest();
	}
	catch (microsoft)
	{
		// try to create object for older versions of IE (v6, v5)
		try
		{
			// create Microsoft XMLHTTP object
			request = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (msxml2)
		{
			// try another version for old IE versions
			try
			{
				// create Msxml2 XMLHTTP object
				request = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (error)
			{
				// object could not be created
				request = false;
			}
		}
	}
	
	return request;
}
