/* The following function creates an XMLHttpRequest object... */
function createRequestObject()
{
	var request_o; //declare the variable to hold the object.
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer"){
		/* Create the object using MSIE's method */
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		/* Create the object using other browser's method */
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}
/* The variable http will hold our new XMLHttpRequest object. */
var http = createRequestObject(); 

/* Function called to get the product categories list */
function which()
{
	//catid = document.getElementById('y');//.value;
	var country=document.getElementById('country').value;
	var currencycombo=document.getElementById('currencycombo').value;
	http.open('get', 'intermediate.php?country=' 
			+country+'&currencycombo='+currencycombo);
	http.onreadystatechange = handleProducts; 
	http.send(null);
}

/* Function called to handle the list that was returned from the internal_request.php file.. */
function handleProducts()
{
	if(http.readyState == 4)
	{ 
		var response = http.responseText;
		var arr=response.split("|");
		
		//document.getElementById('divid').innerHTML = response;
		document.getElementById('intrate').value=arr[0];
		document.getElementById('currency').value=arr[1];
		document.getElementById('max_term').value=arr[2];
		document.getElementById('max_ltv').value=arr[3];
		
		
	}
}


