function SetClipboard2(controlname){
    var holdtext = document.getElementById(controlname);
    Copied = holdtext.createTextRange();
    Copied.execCommand("Copy");
}

function ShowCodePopup(controlname, container){

    var bodyh = document.documentElement.clientHeight;
    var bodyw = document.documentElement.clientWidth;
    
    var cont = document.getElementById(container);
    cont.style.width = bodyw + "px";
    cont.style.height = bodyh + "px";
    cont.style.visibility = "visible";

    var holdtext = document.getElementById(controlname);
    holdtext.className = "codepopup_visible";
    document.body.className = document.body.className.replace(" codeviewer__modalBackground",'');
    
    var w = parseInt(holdtext.offsetWidth);
    var h = parseInt(holdtext.offsetHeight);
        
    holdtext.style.left = ((bodyw - w) / 2 )+ "px";
    holdtext.style.top = ((bodyh - h) / 2 )+ "px";

    //document.body.className += " codeviewer__modalBackground";
}

function HideCodePopup(controlname, container){
    var cont = document.getElementById(container);
    cont.style.width = "0px";
    cont.style.height = "0px";
    cont.style.visibility = "hidden";
        
    var holdtext = document.getElementById(controlname);
    holdtext.className = "codepopup_hidden";
}