$(function(){

    $('#closemodal').click(function(){
        $('#modalbox,#modalboxbg').animate({
            opacity: 0
        }, 500, function(){
            $('#modalbox,#modalboxbg').css('display','none');
        });
    });

    $('.modal').click(function(e){
        e.preventDefault();
        $('#modalbox').css('display','inline').animate({
            opacity: 1
        }, 500);
        $('#modalboxbg').css('display','inline').animate({
            opacity: 0.7
        }, 500);
    });


    $('#refreshbutton').click(function(){
        //$('#refreshCurrency').submit();
        var a = $("input[name='mcurrency']:checked").val();
        var b = $("input[name='msize']:checked").val();
        $.ajax({
            type: 'POST',
            url:'../updatecurrency.php?mcurrency='+a+'&msize='+b,
            dataType: 'html',
            complete: function(){
                $('#modalbox').animate({
                    opacity: 0
                }, 500, function(){
                    $('#modalbox').css('display','none');
                  //  $('#topCurrency').html(a);
                   // $('#topSize').html(b);
                    location.reload();
                });
            }
        });
    });
});
