var socthis={initialized:false,x:0,timer:false,dtimer:false,style:{backgroundColor:'#fff',margin:0,padding:0,borderStyle:'none',fontFamily:'Arial,Helvetica,sans-serif',fontSize:'10pt',color:'#000',lineHeight:'normal'},div1:{position:'absolute',width:'250px',border:'1px solid #fdd',zIndex:1000},img:{padding:'6px',cursor:'pointer'},serv:{position:'absolute',top:'40px',display:'none',cursor:'pointer'},p:{marginTop:'30px',marginBottom:0,padding:'6px',cursor:'pointer'},div2:{textAlign:'right',marginTop:'4px',padding:'2px',backgroundColor:'#fff4f4'}};socthis.services=['Facebook','MySpace','Twitter','YouTube','Yahoo','Flickr','Bebo','Friendster','Live'];socthis.s=socthis.services.length-1;socthis.setstyle=function(el,style){if(typeof(el)=='string')el=document.getElementById(el);var s;for(s in this.style)el.style[s]=this.style[s];for(s in style)el.style[s]=style[s]};socthis.setdisp=function(i,d){var ie=document.getElementById('socthis_icon'+i).style;var se=document.getElementById('socthis_service'+i).style;if(d=='block'){ie.left=(16+this.x)+'px';se.left=(40+this.x)+'px';this.x+=30;if(this.x>120)this.x=0}ie.display=d;se.display=d};socthis.dispservice=function(){if(this.el.style.display=='none'){this.dtimer=false;return}this.setdisp(this.s,'none');this.s=(this.s+1==this.services.length?0:this.s+1);this.setdisp(this.s,'block');this.dtimer=setTimeout('socthis.dispservice()',750)};socthis.menu=function(b,e){this.aborttimer();if(b.nodeName!='A')b=b.parentNode;if(!this.initialized&&(b.nodeName!='A'||b.href!='http://otterplus.com/os')){alert("Please don't alter the Socialize This! button code. Thank you.");return}b.href='javascript:socthis.login()';if(!this.initialized){var el=this.el=document.createElement('div');el.style.display='none';this.setstyle(el,this.div1);el.onmouseout=function(){socthis.endmenu()};el.onmouseover=function(){socthis.startmenu()};var html='<img id="socthis_img" src="http://otterplus.com/os/gfx/logotiny.png" width="193" height="20" onclick="socthis.login()">';for(var i=0;i<this.services.length;i++){var sv=this.services[i];var l=sv.toLowerCase();html+='<div id="socthis_icon'+i+'"><img src="http://otterplus.com/os/gfx/'+l+'.png" width="16" height="16" alt="" onclick="socthis.login()"></div>';html+='<div id="socthis_service'+i+'" onclick="socthis.login()">'+sv+'</div>'}html+='<p  id="socthis_p" onclick="socthis.login()">Meet with and discuss this page with other readers using your favorite social networking account</p>';html+='<div id="socthis_div2"><a href="http://otterplus.com/os" target="_blank" style="text-decoration:none;color:#000">Socialize your site</a></div>';el.innerHTML=html;document.body.insertBefore(this.el,document.body.firstChild);for(var i=0;i<this.services.length;i++){this.setstyle('socthis_icon'+i,this.serv);this.setstyle('socthis_service'+i,this.serv)}this.setstyle('socthis_img',this.img);this.setstyle('socthis_p',this.p);this.setstyle('socthis_div2',this.div2);this.initialized=true}var x,y;if(!e)var e=window.event;if(e.pageX||e.pageY){x=e.pageX;y=e.pageY}else if(e.clientX||e.clientY){x=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;y=e.clientY+document.body.scrollTop+document.documentElement.scrollTop}this.el.style.display='block';var vw=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var vh=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var w=this.el.offsetWidth;var scroll=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft;if(x+w+20>scroll+vw)x=scroll+vw-20-w;var h=this.el.offsetHeight;scroll=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;if(y+h+20>scroll+vh)y=scroll+vh-20-h;this.el.style.left=x+'px';this.el.style.top=y+'px';if(!this.dtimer)this.dispservice()};socthis.startmenu=function(){this.el.style.display='block';this.aborttimer();if(!this.dtimer)this.dispservice()};socthis.endmenu=function(){this.el.style.display='none'};socthis.login=function(){if(this.el)this.el.style.display='none';var url=this.base64_encode(typeof(socthis_url)!='undefined'?socthis_url:document.URL.toLowerCase().replace(/\/$/,''));var title=this.base64_encode(typeof(socthis_title)!='undefined'?socthis_title:document.title);var admin=(typeof(socthis_admin)=='undefined'?'':'&admin='+socthis_admin);var st_url='http://otterplus.com/os/socthis.php?u='+url+'&t='+title+admin;if(typeof(socthis_open)=='undefined')socthis_open='same_tab';if(socthis_open=='new_window')window.open(st_url,'SocializeThis','toolbar=0,location=0,status=1,menubar=0,scrollbars=0,resizable=1,width=800,height=600');else if(socthis_open=='new_tab')window.open(st_url,'SocializeThis');else if(socthis_open=='same_tab')window.location=st_url};socthis.timeout=function(){this.timer=setTimeout("socthis.endmenu()",1500)};socthis.aborttimer=function(){if(this.timer)clearTimeout(this.timer);this.timer=false};socthis.base64_encode=function(data){var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_,";var o1,o2,o3,h1,h2,h3,h4,bits,i=ac=0,enc="",tmp_arr=[];do{o1=data.charCodeAt(i++);o2=data.charCodeAt(i++);o3=data.charCodeAt(i++);bits=o1<<16|o2<<8|o3;h1=bits>>18&0x3f;h2=bits>>12&0x3f;h3=bits>>6&0x3f;h4=bits&0x3f;tmp_arr[ac++]=b64.charAt(h1)+b64.charAt(h2)+b64.charAt(h3)+b64.charAt(h4)}while(i<data.length);enc=tmp_arr.join('');switch(data.length%3){case 1:enc=enc.slice(0,-2)+',,';break;case 2:enc=enc.slice(0,-1)+',';break}return enc};