var i,n,s=unescape('%s').toLowerCase();
if(s==''||s=='%'+'s') s='clear';
var p=s.split(/ +/),width='',style='',color='';
if(s=='about')
{
alert('Border bookmarklet\nFind other bookmarklets at http://bookmarklets.met.cz/');
return;
}
if (s=='help')
{
alert('Example of usage: bor 1, bor #f00, bog .2em #00f dotted, bor clear');
return;
}
for(i=0;i
=0) width=n+'em';
else width=n+'px';
continue;
}
if(p[i].charAt(0)=='#')
{
color=p[i];
continue;
}
if(p[i].search(/none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset/)>=0)
style=p[i];
if(p[i]=='clear')
{
var old=document.getElementById('met-bkmk-border');
if(old!=null) old.href='data:text/css,';
return;
}
}
if(width=='') width='1px';
if(style=='') style='solid';
if(color=='') color='black';
var link=document.createElement('link');
link.id='met-bkmk-border';
link.rel='stylesheet';
link.href='data:text/css,'+escape('* {border:'+width+' '+style+' '+color+' ! important}');
document.documentElement.childNodes[0].appendChild(link);