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;
case '部落軌道':fullUrl = 'http://www.blog-orbit.com/?status=' + title + ' ' + url; 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>&nbsp;&nbsp;'; 
document.write(formatString.format('Plurk', 'plugins/ILovePush/Image/plurk.png')); 
document.write(formatString.format('Twitthat!', 'plugins/ILovePush/Image/twitter.png'));
document.write(formatString.format('部落軌道', 'plugins/ILovePush/Image/bo.gif'));
document.write('<br/><br/>'); 
document.write(formatString.format('funP 推推王', 'plugins/ILovePush/Image/funp.gif')); 
document.write(formatString.format('HEMiDEMi 黑米', 'plugins/ILovePush/Image/hemidemi.gif')); 
document.write(formatString.format('Technorati', 'plugins/ILovePush/Image/technorati.gif'));
document.write(formatString.format('Facebook', 'plugins/ILovePush/Image/facebook.gif'));
document.write(formatString.format('del.icio.us', 'plugins/ILovePush/Image/delicious.gif'));
document.write(formatString.format('Google Bookmarks', 'plugins/ILovePush/Image/google.gif')); 
document.write(formatString.format('Yahoo! 奇摩書籤', 'plugins/ILovePush/Image/yahoo.gif')); 
document.write(formatString.format('Windows Live Favorites', 'plugins/ILovePush/Image/live.gif'));
document.write(formatString.format('MyShare', 'plugins/ILovePush/Image/myshare.gif'));
document.write(formatString.format('Roodo! Cliip', 'plugins/ILovePush/Image/roodo.gif'));  
document.write(formatString.format('你推我報', 'plugins/ILovePush/Image/push-reporter.gif')); 
document.write(formatString.format('udn', 'plugins/ILovePush/Image/udn.gif'));  
document.write(formatString.format('YouPush', 'plugins/ILovePush/Image/youpush.gif'));  
document.write(formatString.format('Furl', 'plugins/ILovePush/Image/furl.gif')); 
document.write(formatString.format('Digg', 'plugins/ILovePush/Image/digg.gif')); 
document.write(formatString.format('FriendFeed', 'plugins/ILovePush/Image/friendfeed.gif'));
document.write(formatString.format('百度搜藏', 'plugins/ILovePush/Image/baidu.gif'));
document.write(formatString.format('fiigo', 'plugins/ILovePush/Image/fiigo.gif'));
document.write(formatString.format('Netvibes', 'plugins/ILovePush/Image/netvibes.gif'));
document.write(formatString.format('reddit', 'plugins/ILovePush/Image/reddit.gif'));
})(); 


