You should give each checkbox a property relating to its shortcountrycode. For instance:
<input type="checkbox" name="country" value="1" data-code="USD"></input>
Then set an event handler with jQuery for any box that's checked:
$(function() {
$(document).on('change', '[name=country]', function() {
if ($(this).is(':checked')) {
var shortcode = $(this).data('code');
$('input:checkbox[data-code=' + shortcode + ']').prop('checked', true);
}
});
});
Writing the event handler this way creates a delegated event handler, able to handle dynamically-created elements.