﻿$(document).ready(function(){
    
            $("#imgCurrConvert").click(function(){    
            	var fcurr,tcurr, amt;
                fcurr=$("#Currencyconvertor1_ddFromCurrency").val();
                tcurr=$("#Currencyconvertor1_ddToCurrency").val();
                amt=$("#Currencyconvertor1_txtAmount").val(); 
                if(fcurr==tcurr)
                {
                alert("From and To currency should not be same");
                return false;
                } 
                else if(amt=="")
                {
                alert("Enter currency amount");
                return false;
                }
                else{
			        getCurrency(fcurr,tcurr,amt);
			        }
			
		    });
		   
		
	});
	
	function getCurrency(fcurr,tcurr,amt)
	{
	
	$.ajax({     type: "GET",
              url: "get-currency-details.aspx",
              data: "fc="+fcurr+"&tc="+tcurr+"&amt="+amt,dataType:"text",
              success: function(response)
              {
                  $('#dvConvert').html(response)
                 
              }
              });
         
	}
