$(document).ready(function(){
    if(!FlashDetect.installed)
        $('input[value="flip_book"]').attr('disabled', true);

    if ($('input[value="email"]').attr('checked')){
        $('#email').show();
        $('#submit').attr('value', 'Email PDF');
		}
    else
        $('#email').hide();

    $('input[value="email"]').change(function (event) {
        $('#email').show();
        $('form').attr('target', '');
        $('#submit').attr('value', 'Email PDF');
    });

    $('input[value="flip_book"]').change(function () {
        $('#email').hide();
        $('form').attr('target', '_blank');            
        $('#submit').attr('value', 'View PDF');
    });

    $('input[value="download"]').change(function () {
        $('#email').hide();
        $('form').attr('target', '');
        $('#submit').attr('value', 'Download PDF');
    });

});
