//textareaのコンテンツをクリップボードにコピーするかどうかを指定(IE4+）  
//0=no, 1=yes  
//var copytoclip=1  
function HighlightAll(theField,copytoclip) {  
  var tempval=eval("document."+theField)  
  tempval.focus()  
  tempval.select() 
/*  if (document.all&&copytoclip==1){  
    therange=tempval.createTextRange()  
    therange.execCommand("Copy")  
    window.status="コンテンツをハイライトしてクリップボードにコピーしました！"  
    setTimeout("window.status=''",1800)  
  } */ 
}  
/****************************************************************
* 機能： クリップボードにコピー
* 引数： arg コピー元のオブジェクト
****************************************************************/
function CopyText(arg){
    var obj=document.all && document.all(arg) || document.getElementById && document.getElementById(arg);
    if (obj.value) {
        var doc = document.body.createTextRange();
        doc.moveToElementText(obj);
        doc.execCommand("copy");
        alert('クリップボードにコピーしました。');
    } else {
        alert('コピーするデータがありません。');
    }
}
