<script type="text/javascript">
	function netAmount(event,key_element) 
	{
		event.preventDefault();
        var interest = isDefaulter($('.interest_'+key_element).val());

        var amount = isDefaulter($('.amount_'+key_element).val());

        $('.amount_in_words_'+key_element).val(numberInWords(amount));

        if(interest > 0 && interest <= 100)
        {
        	var interest_amount = Math.round(isDefaulter((interest/100) * amount));
         	
        }
        else
        {
        	interest_amount = 0;
        }

        var net_amount = amount + interest_amount;
        
        
        $('.net_amount_'+key_element).val(net_amount);
        $('.net_amount_in_words_'+key_element).val(numberInWords(net_amount));
        var number_of_months = isDefaulter($('.number_'+key_element).val());
     
		if(number_of_months > 0)
		{
		  	var installment_amount = Math.round(isDefaulter(net_amount/number_of_months));



		        
		        $('.installment_amount_'+key_element).val(installment_amount);
		        $('.installment_amount_in_words_'+key_element).val(numberInWords(installment_amount));
		}
        


	}

    function initializeLoan(event,loan_id)
    {

        var route = 'initializeloan/'+loan_id;
        
        $.get(route,function(data)
        {

        
                         $('#initialize_loan').html(data);

                         $('#md_initialize_loan').modal('show');        
        });
    }
</script>