/* CopyLink 1.1 http://github.com/molily/selectionmenu by molily (zapperlott@gmail.com, http://molily.de/) EN: CopyLink automatically inserts a source reference when the user copies text from a page DE: CopyLink fügt automatisch eine Quellenreferenz ein, wenn der Benutzer Text von einer Seite kopiert EN: License: Public Domain EN: You're allowed to copy, distribute and change the code without restrictions DE: Lizenz: Public Domain DE: Kopieren, Verteilen und Aendern ohne Einschraenkungen erlaubt */ 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.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