﻿var tfb={};tfb.allowedLabels=["twitter"];tfb.defaultTop=78;tfb.defaultColor="#35ccff";tfb.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;}
tfb.showbadge=function(){if(!window.XMLHttpRequest){return;}
if(document.getElementById('twitterFollowBadge')){document.body.removeChild(document.getElementById('twitterFollowBadge'));}
if(tfb.top<0||tfb.top>1000||isNaN(tfb.top)){tfb.top=tfb.defaultTop;}
if(!tfb.isInArray(tfb.label,tfb.allowedLabels)){tfb.label=tfb.allowedLabels[0];}
var validColorPattern=/^#([a-f]|[A-F]|[0-9]){3}(([a-f]|[A-F]|[0-9]){3})?$/;if(!validColorPattern.test(tfb.color)||(tfb.color.length!=4&&tfb.color.length!=7)){tfb.color=tfb.defaultColor;};if(tfb.side!='l'){tfb.side='r';}
tfb.tabStyleCode='position:fixed;'+'top:'+tfb.top+'px;'+'width:30px;'+'height:119px;'+'z-index:8765;'+'cursor:pointer;'+'background:'+tfb.color+' url(images/'+tfb.label+'.png);'+'background-repeat:no-repeat;';if(tfb.side=='l'){tfb.tabStyleCode+='left:0; background-position:right top;';}else{tfb.tabStyleCode+='right:0; background-position:left top;';}
tfbMainDiv = document.createElement('div'); tfbMainDiv.setAttribute('id', 'twitterFollowBadge'); document.body.appendChild(tfbMainDiv); tfbMainDiv.innerHTML = '<div id="tfbTab" style="' + tfb.tabStyleCode + '"></div><style>#twitterFollowBadge:hover {visibility:visible;}</style>'; document.getElementById('tfbTab').onclick = function() { window.open('http://www.twitter.com/' + tfb.account); } 
}

var face = {}; face.defaultTop = 208;
face.showbadge = function() {
    if (!window.XMLHttpRequest) { return; }
    if (document.getElementById('facebookBadge')) { document.body.removeChild(document.getElementById('facebookBadge')); }
    if (face.top < 0 || face.top > 1000 || isNaN(face.top)) { face.top = face.defaultTop; }
    face.tabStyleCode = 'position:fixed;' + 'top:' + face.top + 'px;' + 'width:30px;' + 'height:119px;' + 'z-index:8765;' + 'cursor:pointer;' + 'background: url(images/facebook.gif);' + 'background-repeat:no-repeat;'; face.tabStyleCode += 'right:0; background-position:left top;';
    faceMainDiv = document.createElement('div'); faceMainDiv.setAttribute('id', 'faceFollowBadge'); document.body.appendChild(faceMainDiv); faceMainDiv.innerHTML = '<div id="faceTab" style="' + face.tabStyleCode + '"></div><style>#faceFollowBadge:hover {visibility:visible;}</style>'; document.getElementById('faceTab').onclick = function() { window.open('http://www.facebook.com/' + face.account); } 
}