﻿
// *** Boilerplate Ajax code start ***

function CreateXmlHttp()
{
    if(window.XMLHttpRequest)
    {
        //We're in firefox. Yay!
        var xhrRequest = new XMLHttpRequest();
    }
    else
    {
        //We're in IE. Let's hope the user has ActiveX enabled...
        try
        {
            var xhrRequest=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            var xhrRequest=new ActiveXObject("Microsoft.XMLHTTP");
        }
    }

    return xhrRequest;

}

function MakeAjaxCall(xhrRequest, url, funCompleteHandler)
{
    
    xhrRequest.onreadystatechange=funCompleteHandler;

    var d = new Date();

    xhrRequest.open('GET', url + '&datestamp=' + d.getTime(), true);
    xhrRequest.send(null);
    
}    
// *** Boilerplate Ajax code end ***

// Function to send user to login page.
function Login(strHome)
{
    if (strHome) {
        window.location = strHome + 'login.aspx?returnurl=' + encodeURIComponent(window.location);
    } else {
        window.location = '/login.aspx?returnurl=' + encodeURIComponent(window.location);
           
    }
}
