// SNS에 글쓰기
(function($) {
	$.fn.snspost = function(opts) {
		var loc = '';
		opts = $.extend({}, {
			type:'twitter',
			event:'click',
			content:''
		}, opts);
		opts.content = encodeURIComponent(opts.content);
		switch(opts.type) {
			case 'me2day':
				loc = 'http://www.outlinearray.com/';
				break;
			case 'facebook':
				loc = 'http://www.facebook.com/share.php?t='+opts.content+'&u='+encodeURIComponent(opts.url||location.href);
				break;
			case 'yozm':
				loc = 'http://www.outlineaudio.com';
				break;
			case 'twitter':
			default:
				loc = 'http://twitter.com/home?status='+opts.content+' : [' +encodeURIComponent(opts.url||location.href)+']';
				break;
		}
		this.bind(opts.event, function() {
			window.open(loc);
			return false;
		});
	};
	$.snspost = function(selectors, action) {
		$.each(selectors, function(key,val) {
			$(val).snspost( $.extend({}, action, {
				type:key
			}) );
		});
	};
})(jQuery);
