﻿var clip = null;

function clipComplete() 
{
    $(".__flash_wrapper").remove();
    if ($("._copyPopupPanel").length > 0) 
    {
        $("._copyPopupRoot").remove();
    }
    clip.destroy();    
}

function initCopy2Clipboard(text2copy) 
{
    clip = new ZeroClipboard.Client();
    clip.setText(text2copy);
    clip.setHandCursor(false);
    clip.addEventListener("complete", clipComplete);
    if ($("._copyPopupPanel").length > 0) 
    {
       clip.glue($(".PopupPanel").attr("id"));
    }   
}
