$(function() {
$('img').click(function() {
$('img[clicked="true"]').removeAttr('clicked').css('border-color', '#999');
$(this).css('border-color', '#f00').attr('clicked', true);
});
})
$(function() {
$('img').click(function() {
$('img[clicked="true"]').removeAttr('clicked').css('border-color', '#999');
$(this).css('border-color', '#f00').attr('clicked', true);
});
})