//============================================================================================
//=== used by normal chat applet demos
//    this one uses the normal room (not the invite room used for tracking)

function initiateHavChatIM(fromUser, toUser) {

	myImPage = "http://www.hav.com/include/chat/chatIMCPopup.havchat.com.htm?auto=1&fromUser=" 
	             + fromUser + "&aliasedUser=" + toUser;
	
	imWindowName = "havChatImWin";
	
	thewidth = 385
	theheight= 275
	
	initiateHavChatIMOpen(myImPage, thewidth, theheight, imWindowName);
}

//============================================================================================
//=== used by tracker applet on pages
//    this one specifies the invite roomID when opening the IM popup

function initiateHavChatIMroomInvite (fromUser, toUser) {

	myImPage = "http://www.hav.com/include/chat/chatIMCPopup.havchat.com.htm?auto=1&fromUser=" 
	             + fromUser + "&aliasedUser=" + toUser + "&roomID=invite";
	
	imWindowName = "havChatImWin";
	thewidth = 385;
	theheight= 275;
	
	initiateHavChatIMOpen(myImPage, thewidth, theheight, imWindowName);
}



//============================================================================================
//=== this actually performs the IM popup window opening call

function initiateHavChatIMOpen (popupTarget, thewidth, theheight, winName) {

	if (document.all) {
	
		window.open (popupTarget, winName, 'leftmargin=0,topmargin=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + parseInt(thewidth) + ',height=' + parseInt(theheight) + ',left=20,top=20');
		
	} else {
		window.open (myImPage, imWindowName, 
		
	'leftmargin=0,topmargin=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + parseInt(thewidth) + ',height=' + parseInt(theheight) + ',screenx=20,screeny=20');
	
	}
}
