 function goodchars(e, goods)

        {

        var key, keychar;

        key = getkey(e);

        if (key == null) return true;



        keychar = String.fromCharCode(key);

        keychar = keychar.toLowerCase();

        goods = goods.toLowerCase();



        if (goods.indexOf(keychar) != -1)

        return true;

        if ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 )

           return true;



        return false;

        }

        function getkey(e)

        {

        if (window.event)

           return window.event.keyCode;

        else if (e)

           return e.which;

        else

           return null;

        }
        
        
        function calculeaza(){

        	var B2=$("#suma").val();

        	var B3=$("#perioada").val();

        	var dob=$("#dobanda").val();

        	if(B2)

        	{$("#n1").html("");}

        	else

        	{$("#n1").html("[camp necesar]");}

        	if(B3)

        	{$("#n2").html("");}

        	else

        	{$("#n2").html("[camp necesar]");}

        	if(dob)

        	{$("#n3").html("");}

        	else

        	{$("#n3").html("[camp necesar]");}

        	var B6=dob/100;

        	var B8=B6*30/365;

        	var putere=Math.pow(1+B8,-B3*12);

        	var rez=B2*B8/(1-putere);

        	$("input#rate").val(Math.round(rez*100)/100);

        };

        $("document").ready(function(){



        	$("#dobanda").change(function(){

        	var B2=$("#suma").val();

        	var B3=$("#perioada").val();

        	var dob=$("#dobanda").val();

        	if(B2)

        	{$("#n1").html("");}

        	else

        	{$("#n1").html("[camp necesar]");}

        	if(B3)

        	{$("#n2").html("");}

        	else

        	{$("#n2").html("[camp necesar]");}

        	if(dob)

        	{$("#n3").html("");}

        	else

        	{$("#n3").html("[camp necesar]");}

        	var B6=dob/100;

        	var B8=B6*30/365;

        	var putere=Math.pow(1+B8,-B3*12);

        	var rez=B2*B8/(1-putere);

        	$("input#rate").val(Math.round(rez*100)/100);

            });



        	$("#suma").keyup(function(){

        	var B2=$("#suma").val();

        	var B3=$("#perioada").val();

        	var dob=$("#dobanda").val();

        	if(B2)

        	{$("#n1").html("");}

        	else

        	{$("#n1").html("[camp necesar]");}

        	if(B3)

        	{$("#n2").html("");}

        	else

        	{$("#n2").html("[camp necesar]");}

        	if(dob)

        	{$("#n3").html("");}

        	else

        	{$("#n3").html("[camp necesar]");}

        	var B6=dob/100;

        	var B8=B6*30/365;

        	var putere=Math.pow(1+B8,-B3*12);

        	var rez=B2*B8/(1-putere);

        	$("input#rate").val(Math.round(rez*100)/100);

            });

            	$("#perioada").keyup(function(){

        	var B2=$("#suma").val();

        	var B3=$("#perioada").val();

        	var dob=$("#dobanda").val();

        	if(B2)

        	{$("#n1").html("");}

        	else

        	{$("#n1").html("[camp necesar]");}

        	if(B3)

        	{$("#n2").html("");}

        	else

        	{$("#n2").html("[camp necesar]");}

        	if(dob)

        	{$("#n3").html("");}

        	else

        	{$("#n3").html("[camp necesar]");}

        	var B6=dob/100;

        	var B8=B6*30/365;

        	var putere=Math.pow(1+B8,-B3*12);

        	var rez=B2*B8/(1-putere);

        	$("input#rate").val(Math.round(rez*100)/100);

            });

        });