 var url = "GetCustomerData.php?id="; // The server-side script
 var productid;
       function handleHttpResponse() 
	   {   
        if (http.readyState == 4) 
		{
              if(http.status==200) 
			  {
                  var results=http.responseText;
                  document.getElementById('divCustomerInfo').innerHTML = results;
              }
	    }
       }
       
        function Customer()
        {     
		  
            var sId = document.getElementById("txtCustomerId").value;
            http.open("GET", url + escape(sId), true);
            http.onreadystatechange = handleHttpResponse;
            http.send(null);
        }
		
		function getProductsDetails(selectid,url)
		{
			productid = selectid;
			http.open("GET",url,true);
			http.onreadystatechange=ProductsInfoResponse;
			http.send(null);
		}
		
		function ProductsInfoResponse()
		{
			if (http.readyState == 4) 
			{
              if(http.status==200) 
			  {
                  var results=http.responseText;
                  var selObj=document.getElementById(productid);
				  var resultlist=results.split("&&&");
				  clearSelectBox(selobj);
				  var i=0;
				  selObj.options[i] = new Option('-Select-','');
				  if(resultlist.Length>0){
				   for(var j=0;i<resultlist.Length;j++){
						i++;
						var result=resultlist[j].split("###");
						selObj.options[i] = new Option(result[0],result[1]);
					}
				  }
              }
			}
		}
		function clearSelectBox(selobj)
		{
			for(var i=0;i<selobj.options.length;i++){
				selobj.options[i]=null;
			}
			selobj.options.length=0;
			
		}
		
		function getHTTPObject() 
		{
		  var xmlhttp;

		  if(window.XMLHttpRequest)
		  {
		    xmlhttp = new XMLHttpRequest();
		  }
		  else if (window.ActiveXObject)
		  {
		    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		    if (!xmlhttp)
			{
		        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
		    }
		   
		}
		  return xmlhttp;
		 
		}
var http = getHTTPObject(); // We create the HTTP Object
