//config
var _bmURL=window.location.href; //Page address
var _bmVS="none"; //Visibility (none|block)
var _bmOpen="self"; //Open mode(self|new)
var _bmDelay=5000; //Timer

//config style
var _bmAlign="top"; //[top|bottom] 
var _bmLeft="0";
var _bmFont="bold 10px arial";
var _bmFontC="#31789F";
var _bmBD="1px solid #CCC"; //External Border
var _bmBG="#EEECED"; //Background
var _bmHBG="#95CFEF"; //Hover background
var _bmWidth="90px"; //Anchor width

var _bmLocation='http://static.fapesp.br/scripts/bookmarks/', _bmID, _bmEL, _bmT=[], _bmU=[], _bmI=[], _BMCron, _bmVST=_bmVS;

_bmT[0]="linkk"; _bmU[0]="www.linkk.com.br/submit.php?url="; _bmI[0]="linkk.ico";
_bmT[1]="dihit"; _bmU[1]="dihitt.com.br/?botao=enviar&url="; _bmI[1]="dihitt.ico";
_bmT[2]="rec6"; _bmU[2]="rec6.via6.com/link.php?url="; _bmI[2]="rec6.png";
_bmT[3]="DiGG"; _bmU[3]="digg.com/submit?phase=2&url="; _bmI[3]="digg.ico";
_bmT[4]="MyWeb"; _bmU[4]="myweb2.search.yahoo.com/myresults/bookmarklet?u="; _bmI[4]="myweb.ico";
_bmT[5]="Google"; _bmU[5]="www.google.com/bookmarks/mark?op=edit&output=popup&bkmk="; _bmI[5]="google.gif";
_bmT[6]="Del.icio.us"; _bmU[6]="del.icio.us/post?url="; _bmI[6]="delicious.ico";

function createBookMarks() {
 _bmID="bmE"+(new String(Math.random()).split('.')[1]);
 var text='<ul id="'+_bmID+'" style="background:'+_bmBG+';border:'+_bmBD+';display:'+_bmVS+';margin:0;padding:0;position:absolute;left:'+_bmLeft+';width:'+_bmWidth+';">';
 for(i=0; i<_bmT.length; i++) {
  text+='<li style="list-style:none;margin:0;padding:0;"><a href="http://'+_bmU[i]+_bmURL+'" style="border:none;color:'+_bmFontC+';display:block;font:'+_bmFont+';padding:2px;text-decoration:none;"><img src="'+_bmLocation+_bmI[i]+'" border:none;/> '+_bmT[i]+'</a></li>';
 }
 document.write(text+'</ul>');
 _bmEL=document.getElementById(_bmID);
	
 _bmEL.parentNode.style.position="relative";
 if(_bmVS=="none") {
  _bmEL.parentNode.onclick=function() {
   var dpy="none";
   if(_bmEL.style.display=="none") {
   	_BMCron=setTimeout('_BMControl()',_bmDelay);
   	dpy="";
   }
   _bmEL.style.display=dpy;
   
   if(dpy=="") {
   	_bmEL.style.top=(_bmAlign=="top" ? "-"+_bmEL.offsetHeight : _bmEL.parentNode.offsetHeight)+"px";
   	
   	_bmEL.onmouseout=function(){ _BMCron=setTimeout('_BMControl()',_bmDelay); }
   	_bmEL.onmouseover=function(){if(_BMCron){clearTimeout(_BMCron);}}
   }
   return false;
  }
 }
 _bmEmts();
}

function _bmEmts() {
 var e=_bmEL.getElementsByTagName("li"),i;
 for(i=0;i<e.length;i++){
  if(_bmBG != _bmHBG) {
   var a=e[i].getElementsByTagName("a")[0];
   a.onmouseover=function(){this.style.backgroundColor=_bmHBG;}
   a.onmouseout=function(){this.style.backgroundColor=_bmBG;}
   a.onclick=function(){
   	if(_bmOpen=="new"){
   	 window.open(this.getAttribute('href'),'_blank'); return false;
   	}else{
   	 window.location.href=this.getAttribute('href');
   	}
   }
  }
 }
}

function _BMControl() {
 if(_BMCron) clearTimeout(_BMCron);
 _bmEL.style.display="none";
}