//Display a message in a popup window. Draw contents from the given file
function ShowMsg(FileName)
{
	window.name = "EAppealHelp";
	var h = 300; //set the height of the pop-up window
	var w = 600; //set the width of the pop-up window
	var l = ((screen.width -  w) / 2);  //set the left so it'll be centered
	var t = ((screen.height - h) / 2);  //set the top so it'll be centered
	var window_settings = "left="+l+",top="+t+",height="+h+",width="+w+",menubar=no,titlebar=yes,resizable=yes,location=no,toolbar=no,dependent=yes,scrollbars=yes";
	var newWindow = window.open("HelpWin.aspx?HelpFileName="+FileName, "", window_settings);
	newWindow.focus();
}

function PopUpWindow(psUrl)
{	window.name = "Popup";
	var h = 550; //set the height of the pop-up window
	var w = 770; //set the width of the pop-up window
	var l = ((screen.width -  w) / 2);  //set the left so it'll be centered
	var t = ((screen.height - h) / 2);  //set the top so it'll be centered
	var window_settings = "left="+l+",top="+t+",height="+h+",width="+w+",menubar=no,titlebar=yes,resizable=yes,location=no,toolbar=no,dependent=yes,scrollbars=yes";
	var newWindow = window.open(psUrl, "", window_settings);
	newWindow.focus();
	
	if (psUrl != "EditUser.aspx"){	
	   if (waitWindow)
	      waitWindow.focus();
	}      
}

//Pops up not implemented message
function NotImplemented()
{
	alert("This feature is not currently implemented.");
	return false;
}

//Alert on save without submit option
//Reminding the filer about the purge Policy
function NoSubmitAlert()
{
	if (window.confirm("All informations in the system database about an unsubmitted pleading \n may be deleted when last access is 90 or more days ago. Continue?") ==true)
		return true;
	else
		return false;
}
var waitWindow;
function ShowWaitWindow(WaitType,IsAdmin)
{
	window.name = "eAppeal";
	var h = 160; //set the height of the pop-up window
	var w = 400; //set the width of the pop-up window
	var l = ((screen.width -  w) / 2);  //set the left so it'll be centered
	var t = ((screen.height - h) / 2);  //set the top so it'll be centered
	var window_settings = "left="+l+",top="+t+",height="+h+",width="+w+",menubar=no,titlebar=yes,resizable=no,location=no,toolbar=no,dependent=no,scrollbars=no";
	if (IsAdmin=='Y')
		waitWindow = window.open("../PleadingWait.aspx?WaitType=" + WaitType , "WaitWindow", window_settings);
	else
		waitWindow = window.open("PleadingWait.aspx?WaitType=" + WaitType , "WaitWindow", window_settings);
	waitWindow.focus();
}
function CloseWaitWindow()
{
	if (waitWindow)
		if (waitWindow.open && !waitWindow.closed) 
			waitWindow.close();
}

function Logon(target, targetName)
{
	window.name = "eAppeal";
	var h = 600; //set the height of the pop-up window
	var w = 800; //set the width of the pop-up window
	var l = ((screen.width -  w) / 2);  //set the left so it'll be centered
	var t = ((screen.height - h) / 2);  //set the top so it'll be centered
	var window_settings = "left="+l+",top="+t+",height="+h+",width="+w+",menubar=no,titlebar=yes,resizable=yes,location=no,toolbar=no,dependent=yes,scrollbars=yes";
	var newWindow = window.open("login.aspx?target="+target, targetName, window_settings);
	newWindow.focus();
}
