// Author:	renjin
// Author Blog: http://renjin.blogspot.com/
// Modify: Cola Chang http://colaccl.blogspot.com/
// Date: Mar 19, 2009
if (typeof(String.prototype.format) == 'undefined') { String.prototype.format = function() { var result = this; for(var i=0; i<arguments.length; i++)
{ var regex = new RegExp('\\{' + i.toString() + '\\}','gm'); result = result.replace(regex, arguments[i]);}
return result;};}
if (typeof(addTo) == 'undefined') { var addTo = function(site, title, url) { title = encodeURIComponent(title); url = encodeURIComponent(url); var via = encodeURIComponent(typeof(document.referrer) == 'string' ? document.referrer : ''); var desc = ''; if (window.getSelection) desc = window.getSelection(); else if(document.getSelection) desc = document.getSelection(); else if(document.selection) desc = document.selection.createRange().text; desc = encodeURIComponent(desc); var fullUrl = ''; 
switch(site) { 
case 'Plurk':fullUrl = 'http://www.plurk.com/?status=' + url + ' (' + title + ')'; break; 
case 'Facebook':fullUrl = 'http://www.facebook.com/share.php?u=' + url; break; 
case 'Twitter':fullUrl = 'http://twitter.com/home/?status=' + url + ' ' + title; break;
case 'feedburner':fullUrl = 'http://feeds.feedburner.com/airyanzi'; break;
default:return;
}
window.open(fullUrl, "_blank");};}
(function() { var title = (typeof(_bookmarkTitle) == 'string' ? _bookmarkTitle : window.document.title); var url = (typeof(_bookmarkUrl) == 'string' ? _bookmarkUrl:window.location.href); 
var formatString = '<a href="javascript:addTo(&quot;{0}&quot;,&quot;' + title + '&quot;,&quot;' + url + '&quot;)" title="張貼在「{0}」" class="social-button-a" ><img src="{1}" alt="張貼在「{0}」" class="social-button"/></a>';
var formatString2 = '<a href="http://feeds.feedburner.com/airyanzi" title="訂閱小笠‧雜筆" class="social-button-a" ><img src="{1}" alt="訂閱小笠‧雜筆" class="social-button"/></a>'; 
document.write(formatString.format('Plurk', 'http://sites.google.com/site/lunfiles/box/plurkc1.png')); 
document.write(formatString.format('Facebook', 'http://sites.google.com/site/lunfiles/box/facebookc1.png'));
document.write(formatString.format('Twitter', 'http://sites.google.com/site/lunfiles/box/twitterc1.png'));
document.write(formatString2.format('feedburner', 'http://sites.google.com/site/lunfiles/box/feed_cloud.png'));
})(); 


