var socLng;
var socTitle;
var socUrl;
var socClick;
var socView;
var socColor;
var socWeight;
if(socWeight==undefined) socWeight=0;
if(socView==undefined) socView=1;
if(socColor==undefined) socColor='63B53F';
if(socClick==undefined) socClick=false;
if(socLng==undefined) socLng='Eng,Rus,'
socLng=encodeURIComponent(socLng);
if(socTitle==undefined){
var socTitle=encodeURIComponent(document.title);
if(socTitle==undefined) socTitle='';
} else socTitle=encodeURIComponent(socTitle);
if(socUrl==undefined){
var socUrl=encodeURIComponent(document.location.href);
if(socUrl==undefined) socUrl='';
} else socUrl=encodeURIComponent(socUrl);
var desc='';
var key='';
meta=document.getElementsByTagName('meta');
for(var i=0; i<meta.length; i++){
if(meta[i].name.toLowerCase()=='description') desc=meta[i].content;
if(meta[i].name.toLowerCase()=='keywords') key=meta[i].content;
}
if(desc.length>255) desc=desc.substr(0,254);
if(key.length>255) key=key.substr(0,254);
desc=encodeURIComponent(desc);
key=encodeURIComponent(key);

newSzenBM = function(){    
  this.hide = function(){
    if(this.timeout) clearTimeout(this.timeout);
    document.getElementById('idSzenBM').style.visibility='hidden';
  }
  
  this.show = function(element){
    if(this.timeout) clearTimeout(this.timeout);
    var left=0,top=0;
    var style=document.getElementById('idSzenBM').style;
    while(element){
      left+=element.offsetLeft;
      top+=element.offsetTop;
      element=element.offsetParent;
    }
    style.left=left+'px';
    style.top=top+'px';
    style.visibility='visible';
  }
  
  this.init = function(){
    if(!document.getElementById('idSzenBM')){
      var div = document.createElement('div');
      div.id='idSzenBM';
      div.style.position='absolute';
      div.style.visibility='hidden';
      div.style.width='260px';
      div.style.border='0';
      div.style.padding='0';
      div.style.zIndex='1000';
      var httext='<style type="text/css">.socCopyR{color:#'+socColor+' !important;font-family:tahoma, serif !important;text-decoration:none !important;}.socCopyR:hover{color:#'+socColor+' !important;text-decoration:underline !important;}</style><div style="background:url(http://social.szenprogs.ru/code/bl'+socView+'_1.gif);height:16px;overflow:hidden;"><a href="http://social.szenprogs.ru/"><img src="http://social.szenprogs.ru/code/bl'+socView+'_1.gif" width="260" height="16" border="0" alt=""><\/a><\/div>';
      httext+='<div style="height:150px;"><iframe allowtransparency="true" src="http://social.szenprogs.ru/dir/?bmlng='+socLng+'&vi='+socView+'&cl='+socColor+'&wg='+socWeight+'&url='+socUrl+'&title='+socTitle+'&desc='+desc+'&key='+key+'" style="border-style:none;background:url(http://social.szenprogs.ru/code/bl'+socView+'_2.gif);" width="100%" height="100%"><\/iframe><\/div><div style="background:url(http://social.szenprogs.ru/code/bl'+socView+'_2.gif);text-align:right;font-size:8pt !important;padding:3px 10px 0 0;font-weight:bold;">&copy; <a href="http://social.szenprogs.ru/" target="_blank" class="socCopyR">SzenProgs - Social<\/a><\/div><div style="background:url(http://social.szenprogs.ru/code/bl'+socView+'_3.gif);height:8px;overflow:hidden;"><\/div>';
      div.innerHTML=httext;
      div.onmouseover=function() {if (SzenBM.timeout) clearTimeout(SzenBM.timeout)}
      div.onmouseout=function() {SzenBM.timeout=setTimeout('SzenBM.hide()',500)};
      document.body.insertBefore(div,document.body.firstChild);      
    }
    document.write('<a href="http://social.szenprogs.ru/"');
    if(socClick) document.write(' onclick="SzenBM.show(this);return false;"');
    document.write('><img border="0" src="http://social.szenprogs.ru/code/but'+socView+'.gif"');
    if(!socClick) document.write(' onmouseover="SzenBM.show(this);"');
    document.write(' onmouseout="SzenBM.timeout=setTimeout(\'SzenBM.hide()\',500);" width="136" height="16" alt=""><\/a>');
  }  
}

SzenBM = new newSzenBM();
SzenBM.init();