var CopyLink=function(h,f){
function j(a,b,d){
a.addEventListener?a.addEventListener(b,d,!1):a.attachEvent&&a.attachEvent("on"+b,function(){return d.call(a,h.event)})
}
function k(){
var a=b.parentNode;a&&a.removeChild(b)
}
function i(a){
this.id=a.id||"copylink";this.minimalSelection=a.minimalSelection||20;
this.alert=a.alert||'';this.container=a.container;
this.handler=a.handler||function(){return"
Source: "+location.href};
this.create();
this.setupEvents()
}
var b=null;
i.addEvent=j;
i.prototype={
create:function(){
if(!b)b=f.createElement("span"),b.id=this.id,b.style.cssText="position: absolute; left: -9999px;"
},setupEvents:function(){
var a=this;j(a.container,"copy",function(){
a.insert()
})
},insert:function(){
var a=h.getSelection?h.getSelection():f.selection&&f.selection.createRange?f.selection.createRange():!1;
if(a&&!((a.toString?a.toString():a.text).length