var ffb={};ffb.allowedLabels=["follow-me","follow-us","follow","my-facebook","add-as-friend","become-a-fan"];ffb.defaultTop=78;ffb.defaultColor="#999";ffb.isInArray=function(str,ar){if(ar.length<1)return;for(var i=0;i<ar.length;i++){if(ar[i]==str){return true;break;}}
return false;}
ffb.showbadge=function(){if(!window.XMLHttpRequest){return;}
if(document.getElementById('facebookFollowBadge')){document.body.removeChild(document.getElementById('facebookFollowBadge'));}
if(ffb.top<0||ffb.top>1000||isNaN(ffb.top)){ffb.top=ffb.defaultTop;}
if(!ffb.isInArray(ffb.label,ffb.allowedLabels)){ffb.label=ffb.allowedLabels[0];}
var validColorPattern=/^#([a-f]|[A-F]|[0-9]){3}(([a-f]|[A-F]|[0-9]){3})?$/;if(!validColorPattern.test(ffb.color)||(ffb.color.length!=4&&ffb.color.length!=7)){ffb.color=ffb.defaultColor;};if(ffb.side!='l'){ffb.side='r';}
ffb.tabStyleCode='position:fixed;'+'top:'+ffb.top+'px;'+'width:30px;'+'height:119px;'+'z-index:8765;'+'cursor:pointer;'+'background:'+ffb.color+' url(http://follow-badge.apadong.org/facebook/files/bg-badge/'+ffb.label+'.png);'+'background-repeat:no-repeat;';ffb.aboutStyleCode='position:absolute;'+'top:'+(parseInt(ffb.top)+107)+'px;'+'width:10px;'+'height:11px;'+'z-index:9876;'+'cursor:pointer;'+'background:url(http://follow-badge.apadong.org/images/icon-about.png);'+'background-repeat:no-repeat;';if(ffb.side=='l'){ffb.tabStyleCode+='left:0; background-position:right top;';ffb.aboutStyleCode+='left:0;';}else{ffb.tabStyleCode+='right:0; background-position:left top;';ffb.aboutStyleCode+='right:0;';}
ffbMainDiv=document.createElement('div');ffbMainDiv.setAttribute('id','facebookFollowBadge');document.body.appendChild(ffbMainDiv);ffbMainDiv.innerHTML='<div id="ffbTab" style="'+ffb.tabStyleCode+'"></div><div id="ffbAbout" style="'+ffb.aboutStyleCode+'"></div>'+'<style>#ffbAbout{visibility:hidden;} #facebookFollowBadge:hover #ffbAbout{visibility:visible;}</style>';document.getElementById('ffbTab').onclick=function(){window.open('http://facebook.com/'+ffb.account);}
document.getElementById('ffbAbout').onclick=function(){window.open('http://follow-badge.apadong.org/facebook/');}}
