function xmlhttpPost(strURL, idx, style_pr) 
{
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) 
    {
	    self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) 
    {
    	self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
	if (self.xmlHttpReq.readyState == 4) 
	{
		updatepage(self.xmlHttpReq.responseText, idx);
	}
	}
																								    
    self.xmlHttpReq.send(getquerystring(idx, style_pr));
}

function getquerystring(idx, style_pr) 
{
	
  if(idx == "models")
	{
		var x1 = document.getElementById('make_id').value;
		var x2 = document.getElementById('lang_id').value;
		
		qstr = 'x1=' + escape(x1)+ '&x2=' + escape(x2);
		
	}
	//alert(qstr);
	return qstr;
	
}

function updatepage(str, idx)
{
	if(idx == "products")
	{
		
		/*document.forms['form1'].zone.length=1;
		document.forms['cpp'].street.length=1;*/
		document.getElementById("product_td_id").innerHTML=str;
		//alert('bbbb');
	}
	
	if(idx == "models")
	{
		document.getElementById("model_td_id").innerHTML=str;
		
		if(str)
		{
			document.getElementById("modelRow1").style.display='block';
			document.getElementById("modelRow2").style.display='block';
		}
		else 
		{
			document.getElementById("modelRow1").style.display='none';
			document.getElementById("modelRow2").style.display='none';
		}
	}
	
}
