var customarray=new Array();
var params;
var req;
var obj;	

function displayItems(ctrl,queryString,processPage) 
{	
	
	var params = queryString + "=";
	params +=document.getElementById(ctrl).value;
	var Html = retrieveURL(processPage + params); 
	// we would return false if the Browser wasn't supported. This has been committed from the
	// sample article.
	return true;
}	
//
//Todo : get data from url
//		
function retrieveURL(url) 
{
	if (window.XMLHttpRequest)  // use for other browsers which isn't called IE
	{
		req = new XMLHttpRequest();
		req.onreadystatechange = processStateChange;//Raise event to get data which is changed
		try 
		{
			req.open("POST", url, true);//todo :call url to process params and receive return values
		} 
		catch (e) 
		{
			window.alert("Error: " + e);
		}
						
		req.send(null);
	} 
	else if (window.ActiveXObject)  // use for IE browser
	{
		req = new ActiveXObject("Microsoft.XMLHTTP");
		if (req) 
		{
			req.onreadystatechange = processStateChange;
			req.open("POST", url, true);
			req.send();
		}
	}
}
//
//Event to get data which is changed
//
function processStateChange() 
{
	if (req.readyState == 4)  // Complete
	{
		if (req.status == 200)  // OK response
		{	
			try
			{
				customarray=req.responseText.split(',');
				obj = actb(document.getElementById('txtSearch'),customarray,10,false,true,'#ffffff','#000000','#e5e6ea','Tahoma',11);
			}
			catch(exception)
			{
				alert("Error: Failed");	
			}
		}
		else 
		{
			alert("Error: " + req.statusText);
		}
	}
}

			