var XmlHttp9;

function CreateXmlHttp9()
{
	//Creating object of XMLHTTP in IE
	try
	{
		XmlHttp9 = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttp9 = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			XmlHttp9 = null;
		}
	}
	//Creating object of XmlHttp9 in Mozilla and Safari 
	if(!XmlHttp9 && typeof XMLHttpRequest != "undefined")
	{
		XmlHttp9 = new XMLHttpRequest();
	}
}

function FilterTab4(svID, ocID, sbID)
{
	// URL to get states for a given client
	var requestURL = FilterTab4AjaxUrl;
	CreateXmlHttp9();
	// If browser supports XmlHttp9Request object
	if(XmlHttp9)
	{
		//Setting the event handler for the response
		XmlHttp9.onreadystatechange = HandleFilterTab4Lookup;

		//Initializes the request object with POST (METHOD of posting),
		//Request URL and sets the request as asynchronous.
		XmlHttp9.open("POST", requestURL,  true);
			
		// send header for post
		XmlHttp9.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-9");
		
		//Sends the request to server
		var querystring = "svID="+ svID + "&ocID="+ ocID +"&sbID="+ sbID;
		XmlHttp9.send(querystring);
	}
}

function HandleFilterTab4Lookup()
{
	// To make sure receiving response data from server is completed
	if(XmlHttp9.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttp9.status == 200)
		{
			if(XmlHttp9.responseXML != null){
				DisableRadiosTab('rdoTempControl', XmlHttp9.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 = " + XmlHttp9.status + ")");
		}
	}
}
