﻿var fb={};fb.allowedLabels=["facebook"];fb.defaultTop=78;fb.defaultColor="#35ccff";fb.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;}
fb.showbadge=function(){if(!window.XMLHttpRequest){return;}
if(document.getElementById('FacebookBadge')){document.body.removeChild(document.getElementById('FacebookBadge'));}
if(fb.top<0||fb.top>1000||isNaN(fb.top)){fb.top=fb.defaultTop;}
if(!fb.isInArray(fb.label,fb.allowedLabels)){fb.label=fb.allowedLabels[0];}
var validColorPattern=/^#([a-f]|[A-F]|[0-9]){3}(([a-f]|[A-F]|[0-9]){3})?$/;if(!validColorPattern.test(fb.color)||(fb.color.length!=4&&fb.color.length!=7)){fb.color=fb.defaultColor;};if(fb.side!='l'){fb.side='r';}
fb.tabStyleCode='position:fixed;'+'top:'+fb.top+'px;'+'width:30px;'+'height:119px;'+'z-index:8765;'+'cursor:pointer;'+'background:'+fb.color+' url(http://od.1091.jp/resources/c_media/themes/theme_od1091/images/'+fb.label+'.png);'+'background-repeat:no-repeat;';fb.aboutStyleCode='position:fixed;'+'top:'+(parseInt(fb.top)+107)+'px;'+'width:10px;'+'height:11px;'+'z-index:9876;'+'cursor:pointer;'+'background:url(http://www.go2web20.net/FacebookBadge/1.0/icon-about.png);'+'background-repeat:no-repeat;';if(fb.side=='l'){fb.tabStyleCode+='left:0; background-position:right top;';fb.aboutStyleCode+='left:0;';}else{fb.tabStyleCode+='right:0; background-position:left top;';fb.aboutStyleCode+='right:0;';}
fbMainDiv=document.createElement('div');fbMainDiv.setAttribute('id','FacebookBadge');document.body.appendChild(fbMainDiv);fbMainDiv.innerHTML='<div id="fbTab" style="'+fb.tabStyleCode+'"></div><div id="fbAbout" style="'+fb.aboutStyleCode+'"></div>'+'<style>#fbAbout{visibility:hidden;} #FacebookBadge:hover #fbAbout{visibility:visible;}</style>';document.getElementById('fbTab').onclick=function(){window.open('http://www.facebook.com/'+fb.account);}
document.getElementById('fbAbout').onclick=function(){window.open('http://www.go2web20.net/twitterFollowBadge/');}}
