//////////////////////////////////////////////////////////
// Example of how to use TqcRunas ActiveX Objects
// using JScript
//////////////////////////////////////////////////////////

// Create a tqc.Runas object
var tqc = new ActiveXObject("Tqc.Runas");

// if it worked
if(tqc)
{
    // display the main dialog
    tqc.DoModalRunasDlg();

    // display the impersonate user dialog
    tqc.DoModalImpersonateDlg();

    // in case an impersonation is active disable it
    tqc.RevertToSelf();

    // destroy the object
    tqc=0;
}