function copycode(obj) {
var rng = document.body.createTextRange();
var obj1=document.getElementById(obj)
rng.moveToElementText(obj1);
rng.scrollIntoView();
rng.select();
rng.execCommand("Copy");
rng.collapse(false);
}

function runCode(obj) {
var winname = window.open('', "_blank", '');
   var obj1=document.getElementById(obj)
winname.document.open('text/html', 'replace');
    winname.opener = null // ·ÀÖ¹¶ñÒâÐÞ¸Ä
winname.document.writeln(obj1.value);
winname.document.close();
}
function saveCode(obj) {
var winname = window.open('', '_blank', 'top=10000');
   var obj1=document.getElementById(obj)
winname.document.open('text/html', 'replace');
winname.document.writeln(obj1.value);
winname.document.execCommand('saveas','','code.htm');
winname.close();
}