function DisconnectActiveX()
{
  var control = eval("VSClientControl1");
  control.Disconnect();
  var d = document.getElementById("ActiveX1");
  d.innerHTML = "";
  d.style.cssText='display:none;';
}
function ConnectActiveX()
{
  var d = document.getElementById("ActiveX1");
  d.innerHTML = "<OBJECT id='VSClientControl1' name='VSClientControl1' VIEWASTEXT CODEBASE='ActiveX/VMRCActiveXClient1.cab' classid='clsid:4EFA317A-8569-4788-B175-5BAF9731A549' height=600 width=800>" +
	"<PARAM NAME='MenuEnabled' VALUE='0'>" +
	"<PARAM NAME='HostKey' VALUE='Key_RightAlt'>" +
	"<PARAM NAME='ServerAddress' VALUE='" + Machines[CurrentSelectedMachineId-1][0] + "'>" +
	"<PARAM NAME='ServerPort' VALUE='" + Machines[CurrentSelectedMachineId-1][1] + "'>" +
	"<PARAM NAME='ServerDisplayName' VALUE='" + Machines[CurrentSelectedMachineId-1][2] + "'>" +
	"<PARAM NAME='UserDomain' VALUE='" + Machines[CurrentSelectedMachineId-1][3] + "'>" +
	"<PARAM NAME='UserName' VALUE='" + Machines[CurrentSelectedMachineId-1][4] + "'>" +
	"<PARAM NAME='UserPassword' VALUE='" + Machines[CurrentSelectedMachineId-1][5] + "'>" +
	"<PARAM NAME='ProxyAddress' VALUE='" + ProxyAddress + "'>" +
	"<PARAM NAME='ProxyPort' VALUE='" + ProxyPort + "'>" +
	"<PARAM NAME='ProxyUserName' VALUE='" + ProxyUserName + "'>" +
	"<PARAM NAME='ProxyPassword' VALUE='" + ProxyPassword + "'>" +
	"</OBJECT>";
  d.style.cssText='display:inline;';
}
function LoadBuildingFlash(ContactID, BuildStartTime)
{
  var d = document.getElementById("flashmovie");
  d.innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='550' height='160' id='flashmovie' align='middle' >" +
	"<PARAM NAME='allowScriptAccess' VALUE='sameDomain'>" +
	"<PARAM NAME='movie' VALUE='flash/loading.swf'>" +
	"<PARAM NAME='quality' VALUE='high'>" +
	"<PARAM NAME='transparent' VALUE='true'>" +
	"<PARAM NAME='bgcolor' VALUE='#429EB5'>" +
	"</OBJECT>";
 var i = document.getElementById("launchframediv");
 i.innerHTML = "<iframe src='launch.aspx?CID="+ContactID+"&BuildStartTime="+BuildStartTime+"' name='checkup' scrolling='no' frameborder='no' align='center' height='160' width='548' id='LaunchFrame'></iframe>";
}
function GetCurrentControl()
{
    var control = document.getElementById("VSClientControl1");
	return control;
}