/*
  This function copies the contents of inElement to the clipboard. Works across browsers. 
  Under GPL license http://www.jeffothy.com/weblog/clipboard-copy/
*/

function copyToClipboard(inElement) {
    if (inElement.createTextRange) {
        var range = inElement.createTextRange();
        if (range){
            range.execCommand('Copy');
        }
    } else {
        var flashcopier = 'flashcopier';
        if(!document.getElementById(flashcopier)) {
            var divholder = document.createElement('div');
            divholder.id = flashcopier;
            document.body.appendChild(divholder);
        }
        document.getElementById(flashcopier).innerHTML = '';
        var divinfo = '<embed src="js/_clipboard.swf" FlashVars="clipboard=' + 
    	    encodeURIComponent(inElement.value)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
            document.getElementById(flashcopier).innerHTML = divinfo;
    }
}