function updateRatePrice()
{	
	var sCurFrom, sCurTo, sRate;
	
	sCurFrom = $("#currency_pairs_from").val();
	sCurTo   = $("#currency_pairs_to").val();

    if ( sCurFrom != "" && sCurTo != "")
	{
	 $.ajax({
		 type: "GET",
		 url: "/global/rate-watch/pairing.aspx?CurrTo=" + sCurFrom + "&CurrFrom=" + sCurTo,
		 dataType: "xml",
		 success: function(xml)
			{

				$(xml).find('detail').each(function()
				{
					sRate  = $(this).find('rate').text();
					$("#rate_market").val(sRate);
				});				
			} 
	 });
	}
}


$(document).ready(function(){
	$("#currency_pairs_from, #currency_pairs_to").change(function(event){
		updateRatePrice();								
	});
});
