// MyCyberTwin scripts for integration v5.0

var childWindow = null;

function mct_openCyberTwin(cybertwinId, clientIdNum, input, init, resizeWindows, openLinkNewWindow, customClientId)
{
	var childH = 730;
 	var childW = 267;
 	var childT = 0;
 	var childL = screen.width-270;
  	
  	if (resizeWindows == 1)
 	{
  		var w = screen.width-275;
  		var h = screen.height-10;
  		window.moveTo(0, 0);
  		window.resizeTo(w, h);
  	}
 
 	if (screen.height < childH)
 	{
    	childH = screen.height - 10;
 	}
 
 	if (childWindow == null || childWindow.closed)
 	{
     	childWindow=open('https://mycybertwin.com/ui/slimline.jsp?cybertwinid='+cybertwinId+'&clientidnum='+clientIdNum+'&input='+input+'&init='+init+'&newwindowlink='+openLinkNewWindow+'&customclientid='+customClientId,'chatwindow','location=0,status=0,resizable=0,scrollbars=0,top='+childT+',left='+childL+',width='+childW+',height='+childH);
    }   
  
  	if (childWindow != null && childWindow.opener == null)
  	{	 
  		childWindow.opener = self;
  	}
}




function mct_launchCyberTwin(cybertwinId, clientIdNum, customClientId, input, resizeWindows, openLinkNewWindow)
{
	mct_openCyberTwin(cybertwinId, clientIdNum, input, -1, resizeWindows, openLinkNewWindow, customClientId);
}
