// Supporting Javascript methods for header frame

//Define array for window object
var windowObjArray = new Array();

//Initialize the array
windowObjArray[0] = new Array();		// Pointers to all chat windows
windowObjArray[1] =	new Array(); 		// Pointers to all chat ID windows
windowObjArray[2] = null;				// Pointer to buddy list window
windowObjArray[3] = null;				// Pointer to buddy maintenance list
windowObjArray[4] = null;				// Pointer to my AI window
windowObjArray[5] = null;				// Pointer to my Calendar window
windowObjArray[6] = null; 				// Pointer to my news window
windowObjArray[7] = new Array();		// Pointers to all email windows
// Add by haifeng 06/30/2004,bug id 5214
windowObjArray[8] = new Array();		// Pointers to all email windows
// add by lianying 05/08/2005. bug id 3896, window's height 380 replace for 420.
windowObjArray[9] = null;

// Used in project. It stores the privileges of the user in current project
var nTMPrivileges = TM_PRIVILEGES_ADMINISTRATOR;

// add by linliming, 07/14/2006, supporting in JVM 1.3
var bMainLoad = false;

function dyniframesize(iframeId) 
{ 
	checkBrowser();
	
	//var isFireFox = navigator.userAgent.indexOf("Firefox")>=0; 
	//var isOpera = navigator.userAgent.indexOf("Opera")>=0; 
	var comp=document.getElementById(iframeId);
//alert(getCompOffsetWin(comp));	

	if(bFirefox){//firefox
	 	comp.style.height=document.body.scrollHeight;
	}else if (bSafari)
		comp.style.height = window.screen.availHeight-window.screenTop-170+"px" ; 	
	else
		comp.style.height = window.screen.availHeight-window.screenTop-getCompOffsetWin(comp)+"px" ; 
}

// Handles onload event
function onLoad()
{
    if(!bMainLoad)
	  showInfoSection(false);
	  
	  window.top.Working.location.href = "Start.jsp";
	  dyniframesize("start");
}

// Handles OnUnload event
function onUnLoad()
{
	
	this.top.PMWApplet.disconnect();
	closeChildWindows();
}

// Handles refresh project name message
function refreshProjectName()
{ 
	document.getElementById("currentProject").innerHTML = "<b>Project: " + window.top.PMWApplet.getProjectName()+"</b>";
	
}

// Handles refresh user group name message
function refreshUGName()
{ 
	document.getElementById("currentGroup").innerHTML = "<b>Group: " + window.top.PMWApplet.getGroupName()+"</b>";
	//alert(document.getElementById("currentGroup").innerHTML);
}

// Set current user group name and updates the current position indicator.
// livebutton0 - livebutton3	The position indicator
// MU1 							The My toolbar
// Param:	vGroupName		The new group name
function displayCurrentUserGroup(vGroupName)
{  
	var InfoTable = document.getElementById("InfoTable");
	var InfoBar = document.getElementById("InfoBar");
	vGroupName = trimString(vGroupName);
	// Modify by haifeng 07/05/2004,bug id 5186,
	//if (vGroupName.length > 35)
	//	vGroupName = vGroupName.substring(0, 35) + "...";
    if (vGroupName.length > 25)
    	vGroupName = vGroupName.substring(0, 25) + "...";

  
	if(vGroupName == "")
	{ 
		document.getElementById("groupname").style.display = "none";
		document.getElementById("groupnamefield").style.display = "none";
		
		document.getElementById("currentGroup").style.display = "none";
		
		document.getElementById("MU1").style.display = "none";
		document.getElementById("livebutton0").style.display = "";
		document.getElementById("livebutton1").style.display = "none";
		document.getElementById("livebutton2").style.display = "none";
		document.getElementById("livebutton3").style.display = "none";
		InfoTable.style.background = "url(image/HeaderBackGroundImage2.png)";
	}
	else
	{ 
		document.getElementById("groupname").style.display = "";
		//alert(document.getElementById("groupnamefield").style.display);
		document.getElementById("groupnamefield").style.display = "";
		
		document.getElementById("currentGroup").style.display = "";
		
		document.getElementById("MU1").style.display = "";
		document.getElementById("livebutton0").style.display = "none";
		document.getElementById("livebutton1").style.display = "";
		document.getElementById("livebutton2").style.display = "none";
		document.getElementById("livebutton3").style.display = "none";
		InfoTable.style.background = "url(image/HeaderBackGroundImage2.png)";
	}
	
  document.getElementById("currentGroup").innerHTML = "<b>Group: " +  vGroupName +"</b>";
	//alert(document.getElementById("currentGroup").innerHTML);
}

// Set current project name and updates the current position indicator.
// Param:	vProjectName		The new project name
function displayCurrentProject(vProjName)
{
	vProjName = trimString(vProjName);
	// Modify by haifeng 07/05/2004,bug id 5186,
	//if (vProjName.length > 35)
	//	vProjName = vProjName.substring(0, 35) + "...";
    if (vProjName.length > 25)
         vProjName = vProjName.substring(0, 25) + "...";


	if(vProjName == "")
	{
		document.getElementById("projectname").style.display = "none";
		document.getElementById("projectnamefield").style.display = "none";
	}
	else
	{
		document.getElementById("projectname").style.display = "";
		document.getElementById("projectnamefield").style.display = "";
	
		document.getElementById("currentProject").style.display = "";
		
		document.getElementById("livebutton0").style.display = "none";
		document.getElementById("livebutton1").style.display = "none";
		document.getElementById("livebutton2").style.display = "";
		document.getElementById("livebutton3").style.display = "none";
	}
	
	document.getElementById("currentProject").innerHTML = "<b>Project: " + vProjName+"</b>";	
	//alert(" currentProject innerHTML is " + document.getElementById("currentProject").innerHTML);
	
}

// Set current tool name and updates the current position indicator.
// Param:	vToolName		The new tool name
function displayCurrentTool(vToolName)
{
	vToolName = trimString(vToolName);
	// Modify by haifeng 07/05/2004,bug id 5186,
	//if (vToolName.length > 35)
	//	vToolName = vToolName.substring(0, 35) + "...";
	if (vToolName.length > 25)
		vToolName = vToolName.substring(0, 25) + "...";

	document.getElementById("currentTool").innerHTML = "<b>Tool: " + vToolName+"</b>";

	if(vToolName == "")
	{
		document.getElementById("toolname").style.display = "none";
		document.getElementById("toolnamefield").style.display = "none";
	}
	else
	{
		document.getElementById("toolname").style.display = "";
		document.getElementById("toolnamefield").style.display = "";
		document.getElementById("livebutton0").style.display = "none";
		document.getElementById("livebutton1").style.display = "none";
		document.getElementById("livebutton2").style.display = "none";
		document.getElementById("livebutton3").style.display = "";
	}
}

// Opens a new chat window to talk with a buddy.
// Param:		vUserIdStr		The user ID of the user that current user is going to talk to.
function startChatWith(vUserIdStr)
{
	// start chat window
	window.top.PMWApplet.setCellValue(window.top.PMWApplet.getUserId() + "|" + vUserIdStr);

	if (!window.top.PMWApplet.submit(COMMAND_GET_FREE_CHAT_ID))
	{
		window.top.PMWApplet.showMessage("Error", ERROR_SEND_DATA_FAILED);
		return;
	}

	var sChatId = window.top.Working.getCommandData(COMMAND_GET_FREE_CHAT_ID, 1000);
	if (!focusOpenChat(sChatId))
	{
		// add by lianying 05/13/2005. fix the Discussion window sizable. width add 100. height add 50.
		var chatWindow = doModalFixed("Chat.jsp?ChatId=" + sChatId + "&UserId=" + vUserIdStr, this, 536, 462);
		windowObjArray[0].push(chatWindow);
		windowObjArray[1].push("" + sChatId);
	}
}

// Someone invited me
// Param:	chatId		The chat roow ID the user will join
function displayInvitedChat(chatId)
{
	if (!focusOpenChat(chatId))
	{
		// add by lianying 05/13/2005. fix the Discussion window sizable. width add 100. height add 50.
		var chatWindow = doModalFixed("Chat.jsp?ChatId=" + chatId + "&Invited=true", this, 536, 462);
		windowObjArray[0].push(chatWindow);
		windowObjArray[1].push("" + chatId);
	}
}

// Checks if the same chat has been opened, if so, bring it up and return true, otherwise return false.
// Param:	chatID		The chat ID
function focusOpenChat(chatId)
{
	var i;
	var bRetVal = false;

	for (i = 0; i < windowObjArray[1].length; i++)
	{
		if (windowObjArray[1][i] == "" + chatId && !windowObjArray[0][i].closed)
		{
			windowObjArray[0][i].focus();
			bRetVal = true;
			break;
		}
	}

	return bRetVal;
}

// Used by discussion management. Join a discussion
// Param:	chatID		The chat ID
function displayChat(chatId, bNew)  // add by lianying 01/26/2005. bug id 1180add bNew.
{
	if (!focusOpenChat(chatId))
	{
		// Modify by haifeng 09/01/2004,bug id 4891
		//var chatWindow = doModalFixed("Chat.jsp?ChatId=" + chatId, this, 416, 392);
		// add by lianying 05/13/2005. fix the Discussion window sizable. width add 100. height add 50.
		var chatWindow = doModalFixed("Chat.jsp?ChatId=" + chatId + "&bNew="+bNew, this, 536, 462);
		windowObjArray[0].push(chatWindow);
		windowObjArray[1].push("" + chatId);
	}
}

// Displays help window with help index
// Param:	helpIndex		The index of the help page.
function displayHelp(helpIndex)
{
	if(window.top.PMWApplet.hasHelp())
	{
		window.top.PMWApplet.setHelpIndex(helpIndex);
	}
	else
	{
              // add by lianying 05/08/2005. bug id 3896, window's height 380 replace for 420.
              windowObjArray[9] = doModalLocation("PathMakerHelp.jsp?HelpIndex=" + helpIndex, this, 630, 500, 150, 150);
	}
}

// Handles user suggestion button event
function onUserSuggestion()
{
	var url = window.location.href;

	if (url.indexOf("?")!=-1)
	{
		url = url.substring(0, url.indexOf("?"));
	}
	
	var sLink = "UserReport.jsp?sUserId=" + window.top.PMWApplet.getUserId() +
							"&sUGId=" + window.top.PMWApplet.getUGId() +
							"&sProjectId=" + window.top.PMWApplet.getProjectId() +
							"&sToolId=" + window.top.PMWApplet.getToolId() +
							"&sURL=" + url;

	doModal(sLink, this, 600, 500);
		
}

// Displays a modal window
// Param:	url			The page address
//			MyWindow	The parent window
//			mwidth		The window width
//			mheight		The window height
function doModal(url,MyWindow,mwidth,mheight)
{
	var newWindow;

	if (document.all&&window.print){ //if ie5
		newWindow = window.showModelessDialog(url,MyWindow,"help:0;resizable:1;dialogWidth:"+mwidth+"px;dialogHeight:"+mheight+"px;status:no");
	}
	else{
		newWindow = window.open(url,MyWindow,"width="+mwidth+"px,height="+mheight+"px,resizable=1,scrollbars=1");
	}

	newWindow.name = "NewWindow";

	return newWindow;
}

// Displays a modal window (no resize, no scrollbar)
// Param:	url			The page address
//			MyWindow	The parent window
//			mwidth		The window width
//			mheight		The window height
function doModalFixed(url,MyWindow,mwidth,mheight)
{
	var newWindow;

	if (document.all&&window.print){ //if ie5
		newWindow = window.showModelessDialog(url,MyWindow,"help:0;resizable:0;scroll:0;dialogWidth:"+mwidth+"px;dialogHeight:"+mheight+"px;status:no");
	}
	else
	{
		newWindow = window.open(url,MyWindow,"width="+mwidth+"px,height="+mheight+"px,resizable=0,scrollbars=0");
	}

	newWindow.name = "NewWindow";

	return newWindow;
}

// Displays a modal window in specified location.
// Param:	url			The page address
//			MyWindow	The parent window
//			mwidth		The window width
//			mheight		The window height
//			mLeft		x
//			mTop		y
function doModalLocation(url,MyWindow,mwidth,mheight,mLeft,mTop)
{
	var newWindow;

	if (document.all&&window.print){ //if ie5
		newWindow = window.showModelessDialog(url,MyWindow,"help:0;resizable:1;dialogWidth:"+mwidth+"px;dialogHeight:"+mheight+"px;dialogLeft:"+mLeft+"px;dialogTop:"+mTop+"px;status:no;scroll:no");
	}
	else{
		newWindow = window.open(url,MyWindow,"width="+mwidth+"px,height="+mheight+"px,resizable=1,scrollbars=1,left="+mLeft+"px,top="+mTop+"px");
	}

	newWindow.name = "NewWindow";

	return newWindow;
}

// i=pathmaker displays consultant's logo if if the user belongs to a consultant.
// Param:	vHiddenImageName		The logo consisted of two images before. This
//									variable is not used now.
//			vConsultImageName		The consultant image name
function doChangeLogo(vHiddenImageName, vConsultImageName)
{
	 //modified by zhanghuajie 0600321 ,for supporting FireFox 

	var hidLogo = document.getElementById("hidLogo");
	var tblLogo = document.getElementById("tblLogo");
	if(hidLogo.src.indexOf(vHiddenImageName) == -1)
		hidLogo.src = vHiddenImageName;

 //modified by zhanghuajie 0600321 ,for supporting FireFox 
	var myLogo = document.getElementById("myLogo");
	if(myLogo.src.indexOf(vConsultImageName) == -1)
	{
		// our logo is bigger.
		if (vConsultImageName == "image/LogoIPathmakerGrey.gif")
		{ 
			myLogo.src = vHiddenImageName;
			tblLogo.background = "image/IPathMakerBanner.jpg";
		}
		else
		{ 
			myLogo.src = vConsultImageName;
			tblLogo.background = "";
		}

	}

}

// Changes logo back to the default logo after user logs out.
function doChangeLogoDefault()
{
	var defLogo = document.getElementById("myLogo");
	defLogo.src = "image/ConsultantImages/HiddenImage.gif";

	var hidLogo = document.getElementById("hidLogo");
	hidLogo.src = "image/ConsultantImages/HiddenImage.gif";
}

// close chat windows and buddy list window
function closeChildWindows()
{
	//close chat windows.
	var numOfChat = windowObjArray[0].length;
	var i;
	var chatWindow;

	for (i = 0; i < numOfChat; i++)
	{
		chatWindow = windowObjArray[0].pop();
		windowObjArray[1].pop();

		if (!chatWindow.closed)
		{
			chatWindow.close();
		}
	}

	//close buddy list window.
	if (windowObjArray[2] != null && !windowObjArray[2].closed)
		windowObjArray[2].close();

	//close manage buddy list window.
	if (windowObjArray[3] != null && !windowObjArray[3].closed)
		windowObjArray[3].close();

	//close my AI window.
	if (windowObjArray[4] != null && !windowObjArray[4].closed)
		windowObjArray[4].close();

	//close my Calendar window.
	if (windowObjArray[5] != null && !windowObjArray[5].closed)
		windowObjArray[5].close();

	//close my News window.
	if (windowObjArray[6] != null && !windowObjArray[6].closed)
		windowObjArray[6].close();

	//close email windows.
	var numOfEmail = windowObjArray[7].length;
	var i;
	var emailWindow;

	for (i = 0; i < numOfEmail; i++)
	{
		emailWindow = windowObjArray[7].pop();

		if (!emailWindow.closed)
		{
			emailWindow.close();
		}
	}

	//close print windows.
	// Add by haifeng 06/30/2004,bug id 5214
	var numOfPrint = windowObjArray[8].length;
	var j;
	var printWindow;

	for (j = 0; j < numOfPrint; j++)
	{
		printWindow = windowObjArray[8].pop();

		if (!printWindow.closed)
		{
			printWindow.close();
		}
	}

        //close ipathmaker hellp window.
	if (windowObjArray[9] != null && !windowObjArray[9].closed)
		windowObjArray[9].close();
}

function closeHelp()
{
    //close ipathmaker hellp window.
    if (windowObjArray[9] != null && !windowObjArray[9].closed)
            windowObjArray[9].close();
}
// Shows/Hides the head information section.
// Param:	bShow		show/hide the information
function showInfoSection(bShow)
{
	var InfoTable = document.getElementById("InfoTable"); 
	var mySection = document.getElementById("InfoSection");
	var myInfoBar = document.getElementById("InfoBar");
	var tblLogo = document.getElementById("tblLogo");
	var divMenu = document.getElementById("divMenu");
    
  //modified by zhanghuajie 0600321 ,for supporting FireFox

	if (bShow)
	{
		mySection.style.display = "";
		myInfoBar.style.display = "";
		InfoTable.style.background = "url(image/HeaderBackGroundImage2.png)";
		tblLogo.style.border = "1px solid black";
		divMenu.style.display = "";
	}
	else
	{
		mySection.style.display = "none";
		myInfoBar.style.display = "none";
		//document.body.background = "image/IPathMakerBanner.jpg";
		tblLogo.className = "";
		tblLogo.style.border = "";
		divMenu.style.display = "none";
	}

	bMainLoad = true;
}

//This function resets the header frame logo
function resetHeaderLogo()
{
	var tblLogo = document.getElementById("tblLogo");
	tblLogo.background = "";
	tblLogo.className = "";
}

// Handles "Overview" event
function onHome()
{
	parent.Working.location.href='User0.jsp';
}

// Handles go to group level event
function onGroup()
{
	var UGId = window.top.PMWApplet.getUGId();

	if (UGId > 0)
		parent.Working.location.href='Group0.jsp?GroupId=' + UGId;
}

// Handles go to project level event
function onProject()
{
	var ProjectId = window.top.PMWApplet.getProjectId();

	if (ProjectId > 0)
		parent.Working.location.href='Pathway.jsp?ProjectId=' + ProjectId + "&bAI=0";
}

// Handles show buddy list event
function onBuddyList()
{
	var x = screen.width - 200;
	var y = 90;

	if (windowObjArray[2] == null || windowObjArray[2].closed)
		windowObjArray[2] = doModalLocation("BuddyList.jsp?sortByLevel=" + window.top.PMWApplet.getSortBy(), window, 200, 300, x, y);
	else
		windowObjArray[2].focus();
}

// Processes refresh buddy list message
function refreshBuddyList()
{
	if (windowObjArray[2] != null && !windowObjArray[2].closed)
	{
		windowObjArray[2].refresh();
	}

	showBuddies0()
}

// Process refresh buddy list maintenance window message
function refreshMyBuddyList()
{
	if (windowObjArray[3] != null && !windowObjArray[3].closed)
	{
		var sTempURL = "" + windowObjArray[3].location;
		var nPage = sTempURL.indexOf("Buddies0.jsp");

		if (nPage > 0)
		{
			windowObjArray[3].refresh();
		}
	}
}

function showBuddies0()
{
	if (windowObjArray[3] != null && !windowObjArray[3].closed)
	{
		windowObjArray[3].refresh();
	}
}

// Opens buddy list maintenance page.
function openMyBuddies0()
{
	var x = screen.width-410;
	var y = 390;

	if (windowObjArray[3] == null || windowObjArray[3].closed)
	{
			windowObjArray[3] = window.open("Buddies0.jsp", (new Date()).getMilliseconds(), "width=400,height=370,location=no,menubar=no,status=yes,resizable=yes,toolbar=no,left=" + x + ",top=" + y);
	
//		windowObjArray[3] = window.open("Buddies0.jsp", (new Date()).getMilliseconds(), "width=400,height=370,location=no,menubar=no,status=no,toolbar=no,left=" + x + ",top=" + y);
	}
	else
	{
		windowObjArray[3].focus();
	}
}

// Handles show email page event
function onEmail()
{
	var emailWindow = doModal("Email.jsp", this, EMAIL_DIALOG_WIDTH, EMAIL_DIALOG_HEIGHT);
	windowObjArray[7].push(emailWindow);
}

// Handles show my calendar page event
function onCalendar()
{
	if (windowObjArray[5] == null || windowObjArray[5].closed)
	{
		windowObjArray[5] = window.open("MyCal.jsp", "","width=800,height=650,left=110,top=90,scrollbars=1, resizable=1");
	}
	else
	{
		windowObjArray[5].focus();
	}
}

// Handles show My news page event
function onNews()
{
	if (windowObjArray[6] == null || windowObjArray[6].closed)
	{
		windowObjArray[6] = window.open("MyNews.jsp?sGroupId=-1&sProjId=0&SortBy=NewsDate&SortOrder=0", "","width="+(screen.width-30)+",height="+(screen.height-280)+",left=5,top=90,scrollbars=1,resizable=1");
	}
	else
	{
		windowObjArray[6].focus();
	}
}

// Handles show My action items page event
function onAI()
{
	if (windowObjArray[4] == null || windowObjArray[4].closed)
	{
		windowObjArray[4] = window.open("MyAI.jsp?sGroupId=0&sProjId=0", "","width="+(screen.width-30)+",height="+(screen.height-280)+",left=5,top=90,scrollbars=1, resizable=1");
	}
	else
	{
		windowObjArray[4].focus();
	}
}

// Display email page when we know the user email address
// Param:	vTo		The user email address
function showEmailTo(vTo)
{
	var emailWindow = doModal("Email.jsp?EmailName=" + vTo, this, EMAIL_DIALOG_WIDTH, EMAIL_DIALOG_HEIGHT);
	windowObjArray[7].push(emailWindow);
}

// Display email page when we know the user ID
// Param:	vTo		The user ID
function showEmailToWhom(vTo)
{
	var emailWindow = doModal("Email.jsp?ToUser=" + vTo, this, EMAIL_DIALOG_WIDTH, EMAIL_DIALOG_HEIGHT);
	windowObjArray[7].push(emailWindow);
}

// add by lianying 03/23/2005. bug id 3900.
function showLinksEmailTo(vTo)
{
	var emailWindow = doModal("Email.jsp?sFAId="+vTo, this, EMAIL_DIALOG_WIDTH, EMAIL_DIALOG_HEIGHT);
	windowObjArray[7].push(emailWindow);
}

// Handles show live help window event
function onShowLiveHelp()
{
	doModal("LiveHelp.jsp?idx=3", this, 650, 550);
}

// Handles show user profile event
function onUserProfile()
{	
	window.top.Working.location.href = "User_View.jsp?UserId=" + window.top.PMWApplet.getUserId();
}

// Handles About i-pathmaker event
function onShowAboutIPathMaker()
{
//	var sConnectType = "";

//	if (window.top.PMWApplet.bConnectViaSocket)
//		sConnectType = "Socket";
//	else
//	sConnectType = "HTTP";
	
	var sLink = "About.jsp";
	doModal(sLink, this, 580, 300);
}

function onShowSkymarkHomePage()
{			
	var sLink = "http://www.skymark.com";
	window.open(sLink);		
}

// Handles log out event
function onLogOut()
{
	if (confirm("Do you really want to log out?"))
	{
        // Add by haifeng 09/17/2004,bug id 5432
		if (window.top.Working.hasControl()){
			window.top.Working.releaseControl();
		}

		//close child windows
		closeChildWindows();

		// Wait for a while when the chat windows are closing.
		window.setTimeout("signout(1)", 1000, "JAVASCRIPT" );
	}
}

// Cleans up and sign out.
function signout(vType)
{
	resetHeaderLogo();
	window.top.Working.location.href = "Start.jsp?Signout=" + vType;
}

// Disable the right-click menu
function disableRightClickMenu()
{
	document.oncontextmenu=new Function("return false");
}

// Displays a modal window in specified location.
// Param:	url			The page address
//			MyWindow	The parent window
//			mwidth		The window width
//			mheight		The window height
//			mLeft		x
//			mTop		y
//          mScrollbars Scrollbars
//          mResizable  Resizable
function doModalLocationAllParam(url,MyWindow,mwidth,mheight,mLeft,mTop,mScrollbars,mResizable)
{
	var newWindow;

	if (document.all&&window.print){ //if ie5
		newWindow = window.showModelessDialog(url,MyWindow,"help:0;resizable:"+mResizable+";dialogWidth:"+mwidth+"px;dialogHeight:"+mheight+"px;dialogLeft:"+mLeft+"px;dialogTop:"+mTop+"px;status:no;scroll:"+mScrollbars+"");
	}
	else{
		newWindow = window.open(url,MyWindow,"width="+mwidth+"px,height="+mheight+"px,resizable="+mResizable+",scrollbars="+mScrollbars+",left="+mLeft+"px,top="+mTop+"px");
	}

	newWindow.name = "NewWindow";

	return newWindow;
}

// Add by haifeng 06/30/2004,bug id 5214,for the purpose "close print windows"
// Handles show print page event
function onPrint(url,width,height,left,top)
{
	var printWindow = doModalLocation(url,this,width,height,left,top);
	windowObjArray[8].push(printWindow);
}

// Handles show print page event
function onPrintWindow(url,width,height,left,top,Scrollbars,Resizable)
{
	var printWindow = doModalLocationAllParam(url,this,width,height,left,top,Scrollbars,Resizable);
	windowObjArray[8].push(printWindow);
}

function onFAQ()
{
	var sLink = "FAQ.jsp?id=1";
	doModal(sLink, this, 600, 600);	
}	

function onLiveHelp()
{
	var sLink = "LiveHelp.jsp?idx=3";
	doModal(sLink, this, 650, 550)	
}

function onShowHelp()
{
	var sHelpIndex = "Overview";
	var sLink = "PathMakerHelp.jsp?HelpIndex=" + sHelpIndex;	
	displayHelp(sHelpIndex);
}	

function showAIEmailTo(vAIId, vProj)
{
	var emailWindow = doModal("Email.jsp?sAIId="+vAIId+"&proj="+escape(vProj), this, EMAIL_DIALOG_WIDTH, EMAIL_DIALOG_HEIGHT);
	windowObjArray[7].push(emailWindow);
}