/**
 *
 * This file stores the js functions utility functions.
 *
 * @author     Vera Kern <vera@worksmartlabs.com>
 * @copyright  2009 WorkSmart Labs, Inc.
 */

/**
 * Creates an AJAX request object in different browsers.
 * @return
 */
function createAjaxRequestObject() {
    var ajaxRequest;
    try{
        // Opera 8.0+, Firefox, Safari
        ajaxRequest = new XMLHttpRequest();
    } catch (e){
        // Internet Explorer Browsers
        try{
            ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try{
                ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e){
                // Something went wrong
                alert("There was an error deleting the track. Please try upgrading " + 
                      "your browser.");
                return null;
            }
        }
    }
    return ajaxRequest;
}