var XmlHttp;

function CreateXmlHttp()
{
	//Creating object of XMLHTTP in IE
	try
	{
		XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			XmlHttp = null;
		}
	}
	//Creating object of XMLHTTP in Mozilla and Safari 
	if(!XmlHttp && typeof XMLHttpRequest != "undefined")
	{
		XmlHttp = new XMLHttpRequest();
	}
}

function FilterTab5(wID, ocID, sID, sbID)
{
	// URL to get states for a given client
	var requestURL = FilterTab5AjaxUrl;
	CreateXmlHttp();
	// If browser supports XMLHTTPRequest object
	if(XmlHttp)
	{
		//Setting the event handler for the response
		XmlHttp.onreadystatechange = HandleFilterTab5Lookup;

		//Initializes the request object with POST (METHOD of posting),
		//Request URL and sets the request as asynchronous.
		XmlHttp.open("POST", requestURL,  true);
			
		// send header for post
		XmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
		
		//Sends the request to server
		var querystring = "wID="+ wID + "&ocID="+ ocID + "&sID="+ sID + "&sbID="+ sbID;
		XmlHttp.send(querystring);
	}
}

function HandleFilterTab5Lookup()
{
	// To make sure receiving response data from server is completed
	if(XmlHttp.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttp.status == 200)
		{
			if(XmlHttp.responseXML != null){
				DisableRadiosTab('rdoAnalysisMethods', XmlHttp.responseXML.documentElement);
			}else{
				alert("There was a problem retrieving data from the server (responseXML == null)");
			}
		}
		else
		{
			alert("There was a problem retrieving data from the server (status = " + XmlHttp.status + ")");
		}
	}
}