var highlight = function(offset){
	var thumb = document.getElementById("thumb_" + offset);
	var input = document.getElementById("image_" + offset);

	var imageOffset = $('#image_'+offset).val();

	$('#image_'+offset).val(imageOffset == 1 ? 0 : 1);
	$('#thumb_'+offset).css({
		'border' : '2px solid '+(imageOffset == 1 ? 'transparent' : '#F00'),
		'margin' : '2px'
	});
}

$.fn.extend({
    extract_data    : function() {
        var data_set = {};
        
        $(':input[name]', this).each(function() {
            data_set[$(this).attr('name')] = $(this).val();
        });
        
        $(':checkbox[name]', this).each(function() {
            data_set[$(this).attr('name')] = $(this).attr('checked') ? 1 : 0;
        });
        
        $(':radio[name]:checked', this).each(function() {
            data_set[$(this).attr('name')] = $(this).val();
        });
        
        return data_set;
    }
});
