// -----------------------------------------------------------
// Feedback Form Window Code
// -----------------------------------------------------------

function OpenFormInNewWindow(intFormNo, intPageLevel)
{
	// Display the feedback form in a another window.
	
	var strPath = "";
	
	// Note global variable g_SiteName is set in the two top level pages index.html and Leisure-Link_Index.htm
	var strSiteFolder = g_SiteName;
	
	switch(intPageLevel)
	{
		case 1:
			// Top level directory (i.e. one of the two top level index pages)
			strPath = strSiteFolder + "/Forms/";
			break;
		case 2:
			// level 2 directory. A page in the Norwich-Pool or Leisure-Link directory.
			strPath = "Forms/";
			break;
		case 3:
			// level 3 directory. A page in a sub directory of Norwich-Pool or Leisure-Link directories.
			// strPath = "../" + strSiteFolder + "/Forms/";
			strPath = "../Forms/";
			break;
		default:
			break;
	}
	
	// intWindowHeight maximum is 480.
	// intWindowWidth  maximum is 750.
	
	switch(intFormNo)
	{
		case 1:
			strPath = strPath + "FeedBack.htm";
			var intWindowHeight = 480;
			var intWindowWidth  = 750;
			break;
		case 2:
			strPath = strPath + "MatchResult.htm";
			var intWindowHeight = 480;
			var intWindowWidth  = 750;
			break;
		case 3:
			strPath = strPath + "Subscribe.htm";
			var intWindowHeight = 480;
			var intWindowWidth  = 750;
			break;
		case 4:
			strPath = strPath + "SinglesLeagueResult.htm";
			var intWindowHeight = 480;
			var intWindowWidth  = 750;
			break;
		default:
			break;
	}
	
	if(intWindowHeight == 0 && intWindowWidth == 0)
	{
		// Display in a full screen window.
		var strWindowDimensions = ",left=0,top=0,width=" + String(screen.availWidth - 12) + ",height=" + String(screen.availHeight - 30);
	}
	else
	{
		// Display in a sized window in the center of the screen.
		var intWindowLeft = (screen.availWidth  / 2) - (intWindowWidth  / 2);
		var intWindowTop  = (screen.availHeight / 2) - (intWindowHeight / 2);
		
		var strWindowDimensions = ",left=" + String(intWindowLeft) + ",top=" + String(intWindowTop) + ",width=" + String(intWindowWidth) + ",height=" + String(intWindowHeight);
	};

	var strFeatures	= "titlebar=no,status=no,toolbar=no,menubar=no,scrollbars=no,resizable=no" + strWindowDimensions;
			
	g_objFormWindow = window.open(strPath, "FeedbackForm", strFeatures);
	
	// Set focus to the window. Required when the window is already open.
	g_objFormWindow.focus();
}