// 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 'Twitthat!':fullUrl = 'http://twitthat.com/go?url=' + url + '&title=' + title; break;
case 'funP 推推王':fullUrl = 'http://funp.com/push/submit/?via=tools&url=' + url + '&title=' + title; break; 
case 'del.icio.us':fullUrl = 'http://del.icio.us/post?title=' + title + '&url=' + url + '&notes=' + desc; break; 
case 'Netvibes':fullUrl = 'http://www.netvibes.com/share?url=' + url + '&title=' + title; break; 
case 'HEMiDEMi 黑米':fullUrl = 'http://www.hemidemi.com/user_bookmark/new?title=' + title + '&url=' + url + '&description=' + desc + '&via=' + via; break; 
case 'Google Bookmarks':fullUrl = 'http://www.google.com/bookmarks/mark?op=add&bkmk=' + url + '&title=' + title + '&annotation=' + desc; break; 
case 'Yahoo! 奇摩書籤':fullUrl = 'http://tw.myweb2.search.yahoo.com/myresults/bookmarklet?ei=UTF-8&t=' + title + '&u=' + url + '&d=' + desc; break; 
case 'Windows Live Favorites':fullUrl = 'https://favorites.live.com/quickadd.aspx?marklet=1&url=' + url + '&title=' + title + '&top=1'; break; 
case 'MyShare':fullUrl = 'http://myshare.url.com.tw/index.php?func=newurl&from=mysharepop&url=' + url + '&desc=' + title + '&contents=' + desc; break; 
case 'Roodo! Cliip':fullUrl = 'http://cliip.roodo.com/Main.php?do=Cliip&url=' + url + '&title=' + title; break; 
case '你推我報':fullUrl = 'http://www.push-reporter.com/submit.php?url=' + url; break; 
case 'udn':fullUrl = 'http://bookmark.udn.com/add?f_URL=' + url + '&f_TITLE=' + title; break;  
case 'YouPush':fullUrl = 'http://www.youpush.net/submit.php?url=' + url; break;  
case 'Furl':fullUrl = 'http://www.furl.net/storeIt.jsp?t=' + title + '&u=' + url + '&r='+ via +'&c=' + desc + '&p=1'; break; 
case 'Digg':fullUrl = 'http://digg.com/submit?phase=2&url=' + url + '&title=' + title + '&bodytext=' + desc; break; 
case 'Technorati':fullUrl = 'http://technorati.com/faves?add=' + url + '&title=' + title; break; 
case 'Facebook':fullUrl = 'http://www.facebook.com/share.php?u=' + url; break; 
case 'FriendFeed':fullUrl = 'http://friendfeed.com/?url=' + url + '&title=' + title; break;  
case '百度搜藏':fullUrl = 'http://cang.baidu.com/do/add?iu=' + url + '&it=' + title + '&dc=' + desc; break;
case 'fiigo':fullUrl = 'http://www.fiigo.com.tw/bookmark/add.php?title=' + title + '&url=' + url; break; 
case 'reddit':fullUrl = 'http://reddit.com/submit?url=' + url + '&title=' + title; 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>'; 
document.write(formatString.format('Plurk', 'http://social.widget.googlepages.com/plurk_o.gif')); 
document.write(formatString.format('Twitthat!', 'http://social.widget.googlepages.com/twitter_o.gif')); 
document.write(formatString.format('funP 推推王', 'http://social.widget.googlepages.com/funp_o.gif')); 
document.write(formatString.format('del.icio.us', 'http://social.widget.googlepages.com/delicious_o.gif')); 
document.write(formatString.format('Netvibes', 'http://social.widget.googlepages.com/netvibes_o.gif'));
document.write(formatString.format('HEMiDEMi 黑米', 'http://social.widget.googlepages.com/hemidemi_o.gif')); 
document.write(formatString.format('Google Bookmarks', 'http://social.widget.googlepages.com/google_o.gif')); 
document.write(formatString.format('Yahoo! 奇摩書籤', 'http://social.widget.googlepages.com/yahoo_o.gif')); 
document.write(formatString.format('Windows Live Favorites', 'http://social.widget.googlepages.com/live_o.gif'));
document.write(formatString.format('MyShare', 'http://social.widget.googlepages.com/myshare_o.gif'));
document.write(formatString.format('Roodo! Cliip', 'http://social.widget.googlepages.com/roodo_o.gif'));  
document.write(formatString.format('你推我報', 'http://social.widget.googlepages.com/push-reporter_o.gif')); 
document.write(formatString.format('udn', 'http://social.widget.googlepages.com/udn_o.gif'));  
document.write(formatString.format('YouPush', 'http://social.widget.googlepages.com/youpush_o.gif'));  
document.write(formatString.format('Furl', 'http://social.widget.googlepages.com/furl_o.gif')); 
document.write(formatString.format('Digg', 'http://social.widget.googlepages.com/digg_o.gif')); 
document.write(formatString.format('Technorati', 'http://social.widget.googlepages.com/technorati_o.gif'));
document.write(formatString.format('Facebook', 'http://social.widget.googlepages.com/facebook_o.gif'));
document.write(formatString.format('FriendFeed', 'http://social.widget.googlepages.com/friendfeed_o.gif'));
document.write(formatString.format('百度搜藏', 'http://social.widget.googlepages.com/baidu_o.gif'));
document.write(formatString.format('fiigo', 'http://social.widget.googlepages.com/fiigo_o.gif'));
document.write(formatString.format('reddit', 'http://social.widget.googlepages.com/reddit_o.gif'));})(); 



