// vim: set tabstop=2 shiftwidth=2 foldmethod=marker:
// +----------------------------------------------------------+
// | Copyright (c) 2006 Favicon API 
// |                    (http://favicon.aruko.net/) - aruko.net
// |                              jquery plugin version - 0.0.2
// +----------------------------------------------------------+
// |  * This script is freely distributable under 
// |    the terms of an MIT-style license.
// |    http://favicon.aruko.net/dl/license.txt
// +----------------------------------------------------------+

(function() {

	jQuery.fn.faviconapi = function(config){

		config = jQuery.extend({
			size: 'm',		//	size: 's',
			def: 'e',		//	def: 'f',
			margin: '0 0 0 1px',
			padding: '0 0 0 18px',
			backgroundColor: null,
			backgroundPosition: '2px left'		//	backgroundPosition: '1px 1px'
		},config);

		var target = this;

		jQuery.each(target,function(i,val) {

			var bk = '';

			if(config.backgroundColor != null) {
				bk += config.backgroundColor + ' ';
			}
/*
			bk += 'url("http://favicon.aruko.net/'+
				config.size+'/'+ 
				config.def+'/'+ 
				$(this).attr('href') + 
			'") no-repeat'; 
*/
			bk += 'url("http://favicon.st-hatena.com/?url='+ 
				$(this).attr('href') + 
			'") no-repeat';
			$(this).css({
				margin:config.margin,
				padding:config.padding,
				background:bk,
				backgroundPosition:config.backgroundPosition
			});
		});
	};
})(jQuery);

