// **************************************************************
// FILE: HomeUtils.js
// **************************************************************
// Copyright (c) 2006-2008 Ivinex
// 
// PURPOSE:  This file contains the code for utilities
//
// **************************************************************
// Author(s):  Craig Austin <caustin@ivinex.com>
// **************************************************************

// ***************************************************
// FUNCTION: CreateRequestObject()
// ***************************************************
function CreateRequestObject()
{
	var  RequestObject; //declare the variable to hold the object.
	var  WebBrowser;
   
   WebBrowser = navigator.appName; //find the Web Browser name
	if (WebBrowser == "Microsoft Internet Explorer")
   {
		// Create the object using MSIE's method 
		RequestObject = new ActiveXObject("Microsoft.XMLHTTP");
	}
   else
   {
		RequestObject = new XMLHttpRequest();
	}
	return RequestObject; //return the object
}
// End CreateRequestObject

// The variable for the request object
var http = CreateRequestObject(); 


// ***************************************************
// FUNCTION: GetURL()
// ***************************************************
function GetURL(strURL)
{
   http.open('get', strURL, false);
   http.send(null);
   return http.responseText;
}
// End GetURL

// ***************************************************
// FUNCTION: PostURL()
// ***************************************************
function PostURL(strURL, strPostValues)
{
   http.open('post', strURL, false);
   // Send the data.
	http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

   http.send(strPostValues);
   return http.responseText;
}
// End PostURL
