/**
 * jQuery plugin for prepending elements with images
 * Tested in Safari
 *
 * $("a").addIcons({'success':'success.png', 'error': 'error.png'});
 *
 * @license BSD (http://www.opensource.org/licenses/bsd-license.php)
 * @author Jiri Knesl <jiri.knesl@gmail.com> (http://www.knesl.com)
 * @version 1
 */
(function($) {
	
	$.fn._addIcon = function(icon) {
		
		$(this).css({
			paddingLeft: '40px',
			backgroundRepeat: 'no-repeat',
			backgroundPosition: 'top left',
			backgroundImage: 'url('+icon+')'
		});
	}
	
	$.addIcons = function(icons) {
		for (htmlClass in icons) {
			$("."+htmlClass)._addIcon(icons[htmlClass]);
		}
	}
	
})(jQuery);
