(function($) {
   
     //Attach this new method to jQuery  
    $.fn.extend({   
          
         //This is where you write your plugin's name  
		radio: function(settings){
			
			this.each(function(i,o){
				$imagen = $('<img src="/img/tilde_sin.jpg" alt="panoramic" width="22" height="20" />');
				
				$imagen.click(function(){
					
					nombre = $(this).prev()[0].name;					
					$(':radio[name='+nombre+']').each(function(i,o){						
						$(o).next()[0].src = '/img/tilde_sin.jpg';
						$(o)[0].checked = false;
					});
					
					$(this).prev()[0].checked = true;
					$(this)[0].src = '/img/tilde_ok.jpg';
				})
				
				$(o).after($imagen);
				$(o).hide();				
			})		
			
		}
	});


})(jQuery);

