jQuery.fn.clipcopy=function(b){var a={htmlcopytxt:'<br>&lt;a href="'+window.location.href+'"&gt;'+jQuery("title").html()+'&lt;/a&gt;',minlen:25,addcopyfirst:false};jQuery.extend(a,b);var c=document.createElement("span");c.id="ctrlcopy";c.innerHTML=a.htmlcopytxt;return this.each(function(){jQuery(this).mousedown(function(){jQuery("#ctrlcopy").remove()});jQuery(this).mouseup(function(){if(window.getSelection){var e=window.getSelection();var d=e.toString();if(!d||d.length<a.minlen){return}var f=e.getRangeAt(0);d=f.cloneRange();d.collapse(a.addcopyfirst);d.insertNode(c);if(!a.addcopyfirst){f.setEndAfter(c)}e.removeAllRanges();e.addRange(f)}else{if(document.selection){var e=document.selection;var f=e.createRange();var d=f.text;if(!d||d.length<a.minlen){return}d=f.duplicate();d.collapse(a.addcopyfirst);d.pasteHTML(c.outerHTML);if(!a.addcopyfirst){f.setEndPoint("EndToEnd",d);f.select()}}}})})};

