$(document).ready(function() {
      
/**
 * NOTE: 2010-06-17
 * Brochure ordering from the Agent pages is not fully tested. See
 * agent.views for details.
    $('[name=brochure-login-ref]').click(function(e){
        e.preventDefault();
        $.get('/agents/brochure-order-login/', function(data) {
            // display the brochure login form
            $('#brochure').html(data);
        });        
    });
    
    $('a[rel=brochure-login-submit]').live('click', function(e) {
        e.preventDefault();
        $('#submit-section').html('Finding profile, please wait...');
        // post the completed login form via ajax call
        var form_vals = $('#brochure-login-form').serialize();
        $.post('/agents/brochure-order-login/', form_vals, function(data) {
            // display the brochure order form or invalidation results
            $('#brochure').html(data); 
        });
    });
    
    $('a[rel=brochure-order-submit]').live('click', function(e){
        e.preventDefault();
        $('#submit-section').html('Submission in progress, please wait...');
        // post the completed order form via ajax call
        var form_vals = $('#brochure-order-form').serialize();
        $.post('/agents/brochure-order/', form_vals, function(data) {
            // display the brochure order form or invalidation results
            $('#brochure').html(data); 
        });        
    });    
*/
    var $id_in_group = $('#id_in_group');
    var $row_group = $('#row_group')

    if ($id_in_group.val() != 'yes') {
        $row_group.hide();
    } else {
        $row_group.show();
    };

    $id_in_group.change(function() {
        if ($(this).val() == 'yes') {
            $row_group.fadeIn('slow');
        } else {
            $row_group.fadeOut('slow');
        };
    });

    var geography = new Geography('/geography/countries', '/geography/states');
});

