// *****************************************************************
// ***	 Pensions Administrator	:   JavaScript  File			 ***
// *** 				                            				 ***
// *** 					Used in	:								 ***
// *** 					        	                    		 ***
// *****************************************************************

var allSupport = (document.all != null);
var invalidSchemeNoMessage = "Please enter your Scheme Number in the format J*****, JX**** or H***** where * represents numerals and X represents alphanumeric.  If the first character is H, then the second must be 6, 7, 8 or 9.";

// *****************************************************************************
// *** Description:   Open New Window Functions								 ***
// *** 																		 ***
// *****************************************************************************
function openMemberAppWindow(name)
{
  MemberWin = open(name, 'MemberApplicationWindow', 'status,scrollbars,width=760,height=475,left=30,top=30,resizable=1"') ;
  target="MemberWin";
  MemberWin.location=name;

  if(navigator.appVersion.indexOf("MSIE 4") == null)
  	MemberWin.focus() ;
}

function openGroupAppWindow(name)
{
  GroupWin = open(name, 'PenadminApplicationWindow', 'status,scrollbars,width=760,height=475,left=30,top=30,resizable=1"');
  target="GroupWin";
  GroupWin.location=name;
  GroupWin.focus() ;
}

function openNSWindow(name)
{
  width = 760;
  height = 475;
  if(screen != null && screen.width != null && screen.width != 0)
  {
	  width = screen.width - 70;
	  height = screen.height - 200;
  }
  NSWin = open(name, 'PenadminApplicationWindow', 'status,scrollbars,width=' + width + ',height=' + height + ',left=30,top=30,resizable=1"');
  target="NSWin";
  NSWin.location=name;

  if(navigator.appVersion.indexOf("MSIE 4") == null)
  	NSWin.focus() ;
}

function openNSWindow(name, label)
{
  width = 760;
  height = 475;
  if(screen != null && screen.width != null && screen.width != 0)
  {
	  width = screen.width - 70;
	  height = screen.height - 200;
  }
  NSWin = open(name, label, 'status,scrollbars,width=' + width + ',height=' + height + ',left=30,top=30,resizable=1"');
  target="NSWin";
  NSWin.location=name;

  if(navigator.appVersion.indexOf("MSIE 4") == null)
  	NSWin.focus() ;
}

function openImvQuoteWindow(name)
{
  IMVWin = open(name, 'ImvQuoteWindow', 'status,scrollbars,width=760,height=475,left=30,top=30,resizable=1"');
  target="imv";
  IMVWin.location=name;

  if(navigator.appVersion.indexOf("MSIE 4") == null)
  	IMVWin.focus() ;
}

function openFormsWindow(name)
{
  FormsWin = open(name, 'PenadminFormsWindow', 'status,scrollbars,width=760,height=475,left=90,top=90,resizable=1"');
  target="FormsWin";
  FormsWin.location=name;
  FormsWin.focus() ;

}

function openFullWindow(name)
{
  FullWin = open(name, 'PenadminFullWindow');
  target="FullWin";
  FullWin.location=name;
  FullWin.focus() ;

}

function openNewWindow(name,id)
{
  NSWin = open(name, id, 'status,scrollbars,width=760,height=475,left=30,top=30,resizable=1"');
  target="NSWin";
  NSWin.location=name;

  if(navigator.appVersion.indexOf("MSIE 4") == null)
  	NSWin.focus() ;
}


function helpme(name)
{
  win=open(name,"HelpWindow","width=500,height=400,scrollbars=1,resizable=1");
  target="win";
  win.location=name;
  win.focus() ;
}

function openpdf(name)
{
  	pdfwin=open(name,"PDFForm","width=500,height=400,scrollbars=1,resizable=1","",true);
 	target="pdfwin";
  	pdfwin.location=name;
	pdfwin.focus() ;
}


// *****************************************************************************
// *** Description:   Check the Browser being Used							 ***
// *** 																		 ***
// *****************************************************************************
function isRightBrowser()
{
	var isRight;
	if ( (parseInt(navigator.appVersion) >=4) &&
	     ( (navigator.appName.indexOf("Microsoft") != -1) ||
	       (navigator.appName.indexOf("Netscape") != -1) ) )
	{
		isRight = true;
	}
	else
	{
		isRight = false;
		window.parent.location = "../unsupportedbrowserfs.htm" ;
	}

	return isRight;
}

function isBrowserNavigator()
{
	var isNav, isIE ;

	if (parseInt(navigator.appVersion) >=4)
	{
		if (navigator.appName == "Netscape")
		{
			isNav = true ;
			isIE = false ;
		}
		else
		{
			isIE = true ;
			isNav = false ;
		}
	}

	return isNav ;
}


// *****************************************************************************
// *** Description:   Generic function - pass it a scheme number & it		 ***
// ***                will return true if it's valid or false if it's not.   ***
// ***                NOTE: In your calling function, you will probably want ***
// ***                do display a message if the scheme number is invalid;  ***
// ***                for consistency (and in case the text needs changed    ***
// ***                in the future) please use the variable                 ***
// ***                "invalidSchemeNoMessage" which is defined in this      ***
// ***                script.                                                ***
// *** 																		 ***
// *****************************************************************************

function genericValidSchemeNum(schemeNum)
{
	var result = true;

	if(schemeNum.length == 6)
	{
		// first character must be J or H...
		if ((schemeNum.charAt(0).toUpperCase() != "J") && (schemeNum.charAt(0).toUpperCase() != "H"))
		{
			result = false;
		}

		// second character must be numerical (6-9 for schemes staring with H, else 0-9)...
		if (schemeNum.charAt(0).toUpperCase() == "H")
		{
			if ((schemeNum.charAt(1)<"6") || (schemeNum.charAt(1)>"9"))
			{
				result = false;
			}
		}
		else
		{
			if 	(
				((schemeNum.charAt(1)<"0") || (schemeNum.charAt(1)>"9"))
				&&
				((schemeNum.charAt(1).toUpperCase()<"A") || (schemeNum.charAt(1).toUpperCase()>"Z"))
				)

			{
				result = false;
			}
		}

		// characters 4 thu 6 must be numerical 0-9...
		for(i=2; i<=5; i++)
		{
			if ((schemeNum.charAt(i)<"0") || (schemeNum.charAt(i)>"9"))
			{
				result = false;
			}
		}
	}

	else
	{
		result=false;
	}

	return result;
}


// *****************************************************************************
// *** Description:   Frameset Mouseover Image Javascript functions			 ***
// *** 																		 ***
// *****************************************************************************
function MM_swapImgRestore()
{ //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages()
{ //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d)
{ //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage()
{ //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



// *****************************************************************************
// *** Description:   These Functions Taken from schemeNumRequest			 ***
// *** 																		 ***
// *****************************************************************************

// Sets focus for Scheme Num Entry but only if field exists
function schemeRequestSetFocus()
{
	if (document.schemeNumRequest != null)
	{
		document.schemeNumRequest.schemeNumber.focus();
	}
}

function memberIdentify()
{
	window.open("memberidentify.jsp", "memIdentify", "resizable=1, scrollbars=1, width=640");
}

function clientValidate()
{
  isValid = new Boolean();
  isValid = validateId();
  return isValid;
}

function validateId()
{
   idValid = new Boolean();
   idValid = true;

   if (document.schemeNumRequest.custId.value.length == 0)
   {
     alert("A customer identifier must be specified.");
     document.schemeNumRequest.custId.style.borderColor = "red";
     document.schemeNumRequest.custId.style.borderWidth = "medium";
     document.schemeNumRequest.custId.focus();
     idValid = false;
   }

   else if("J" == document.schemeNumRequest.custId.value.substr(0,1).toUpperCase())
   {
     document.schemeNumRequest.custId.style.borderColor = "blue";
     document.schemeNumRequest.custId.style.borderWidth = "thin";
     //document.schemeNumRequest.action="spigppoptions.jsp";
     idValid = true;
   }

   else if("H" == document.schemeNumRequest.custId.value.substr(0,1).toUpperCase())
   {
     document.schemeNumRequest.custId.style.borderColor = "blue";
     document.schemeNumRequest.custId.style.borderWidth = "thin";
     //document.schemeNumRequest.action="javascript:memberIdentify();"
     idValid = true;
   }
   else
   {
     alert('Please enter a valid scheme number');
     document.schemeNumRequest.custId.style.borderColor = "red";
     document.schemeNumRequest.custId.style.borderWidth = "medium";
     document.schemeNumRequest.custId.focus();
     idValid = false;
   }
   return idValid;
}


// ***************************************************************************
// *** Description: Sets the values for the next results				   ***
// *** 																	   ***
// ***************************************************************************
function getNextResults()
{
	var currentPage = 1 ;
	var form = document.forms['memberList'];
	if(allSupport)
	{
		currentPage = document.all.pageRequired.value  ;
	}
	else
	{
		currentPage = form.pageRequired.value;
	}

	currentPage ++  ;

	if(allSupport)
	{
		document.all.pageRequired.value = currentPage ;
	}
	else
	{
		form.pageRequired.value = currentPage ;
	}

	if(allSupport)
	{
		document.memberList.submit();
	}

	else
	{
		if (form.moreDataExists.value != "Y")
		{
			currentPage --;
			form.pageRequired.value = currentPage ;
			alert("There is no next page.");
		}
		else
			document.memberList.submit();
	}
}

// ***************************************************************************
// *** Description: Sets the values for the next results				   ***
// *** 																	   ***
// ***************************************************************************
function getPreviousResults()
{
	var currentPage = 2 ;
	var form = document.forms['memberList'];

	if(allSupport)
	{
		currentPage = document.all.pageRequired.value ;
	}
	else
	{
		currentPage = form.pageRequired.value ;
	}
	currentPage -- ;

	if(allSupport)
	{
		document.all.pageRequired.value = currentPage ;
	}
	else
	{
		form.pageRequired.value = currentPage;
	}

	if(allSupport)
	{
		document.memberList.submit();
	}
	else if (!( form.pageRequired.value >= 1) )
	{
		currentPage ++;
		form.pageRequired.value = currentPage ;
		alert("There is no previous page.");
	}
	else
	{
		document.memberList.submit();
	}
}


// ************************************************************************
// *** Description: Enables / Disables Fields depending on option       ***
// *** 		    selected. Also sets Action where appropriate            ***
// ************************************************************************
function disableButtons()
{
	if(allSupport)
	{
		if (document.all.Next != null)
		{
			document.all.Next.disabled = true;
			document.all.Previous.disabled = true;

			if (document.all.pageRequired.value > 1)
			{
				document.all.Previous.disabled = false;
			}

			if (document.all.moreDataExists.value == "Y")
			{
				document.all.Next.disabled = false;
			}
		}
	}
	/****************
	else
	{
		var form = document.forms[0];
		if (form.Next != null)
		{

			//form.Next.disabled = true;
			//form.Previous.disabled = true;

			if (!( form.pageRequired.value > 1) )
			{
				//form.Previous.disabled = false;
				alert("There is no previous page any more!");
			}

			if (form.moreDataExists.value != "Y")
			{
				//form.Next.disabled = false;
				alert("There are no more members for this scheme!");
			}
		}

	}
	******************/
}


// ********************************************************
// *** Description: Validate the entered scheme number  ***
// ********************************************************
function validateScheme(schemeNum)
{
	var result = genericValidSchemeNum(schemeNum);

	if(true == result)
		document.schemeNumRequest.schemeNumber.className  = "entryClass";

	else
	{
		showError();
		result=false;
	}

	return result;
}


// *****************************************************************************
// *** Description: Check the typed scheme number							 ***
// *** 																		 ***
// *****************************************************************************
function isDigit(number)
{
	var isNumber = true;

	for(var i=0; i<number.length; i++)
	{
		var c = number.charAt(i);
		if(isNaN(c))
		{
			isNumber = false;
		}
	}

	return isNumber;
}

// *****************************************************************************
// *** Description: Shows error message for invalid scheme number			 ***
// *** 																		 ***
// *****************************************************************************
function showError()
{
	window.alert("Please enter a valid scheme number.");
	document.schemeNumRequest.schemeNumber.className = "errorClass";
	document.schemeNumRequest.schemeNumber.focus();
}

// *****************************************************************************
// *** Description: this gets called at onload of ubnitprices.htm			 ***
// *** 																		 ***
// *****************************************************************************
function initUnitPrices()
{
	if(document.schemeNumRequest.schemeNumber != null)
	{
		document.schemeNumRequest.schemeNumber.value='';
		document.schemeNumRequest.schemeNumber.focus();
	}
}
// ************************************************************
// *** End of javascripts for unitprices		    ***
// ************************************************************

// *****************************************************************************
// *** Description:                                                          ***
// *** 																		 ***
// *****************************************************************************
function writeForm(formsName, formsClass, formsOnSubmit, formsAction)
{
	if(isBrowserNavigator())
	{
		return ("<FORM NAME=" + formsName + " METHOD=GET class=" + formsClass + " OnSubmit=\"" + formsOnSubmit + "\" Action=" + formsAction + ">");
	}
	else
	{
		return ("<FORM NAME=" + formsName + " METHOD=POST class=" + formsClass + " OnSubmit=\"" + formsOnSubmit + "\" Action=" + formsAction + ">");
	}
}

// *****************************************************************************
// *** Description: Script for increase contributions						 ***
// *** 																		 ***
// *****************************************************************************
function checkIncreasefields()
{
	var isFilled = true;

	//if all 4 fields are empty
	if(isblank(document.increaseContributions.currentContributionsEmployee.value)
	&& isblank(document.increaseContributions.employeeIncrease.value)
	&& isblank(document.increaseContributions.currentContributionsEmployer.value)
	&& isblank(document.increaseContributions.employerIncrease.value)
	)
	{
		document.increaseContributions.currentContributionsEmployer.focus();
		isFilled = dateError("please enter contribution details.");
	}

	//if one field for employer and one field for employee is filled
	else if( (!isblank(document.increaseContributions.currentContributionsEmployee.value)
		&& !isblank(document.increaseContributions.currentContributionsEmployer.value) )
		|| ( !isblank(document.increaseContributions.currentContributionsEmployer.value)
		&& !isblank(document.increaseContributions.employeeIncrease.value) )
		)
	{
		if(isblank(document.increaseContributions.currentContributionsEmployer.value))
		{
			isFilled = dateError("please enter current contribution details.");
			document.increaseContributions.currentContributionsEmployer.focus();
		}
		else if(isblank(document.increaseContributions.employerIncrease.value))
		{
			isFilled = dateError("please enter new contribution details.");
			document.increaseContributions.employerIncrease.focus();
		}
		else if(isblank(document.increaseContributions.currentContributionsEmployee.value))
		{
			isFilled = dateError("please enter current contribution details.");
			document.increaseContributions.currentContributionsEmployee.focus();
		}
		else if(isblank(document.increaseContributions.employeeIncrease.value))
		{
			isFilled = dateError("please enter new contribution details.");
			document.increaseContributions.employeeIncrease.focus();
		}
	}

	//if one of the employer field is not empty
	else if(!isblank(document.increaseContributions.currentContributionsEmployer.value)
	|| !isblank(document.increaseContributions.employerIncrease.value))
	{
		if(isblank(document.increaseContributions.currentContributionsEmployer.value))
		{
			isFilled = dateError("please enter current contribution details.");
			document.increaseContributions.currentContributionsEmployer.focus();
		}
		else if(isblank(document.increaseContributions.employerIncrease.value))
		{
			isFilled = dateError("please enter new contribution details.");
			document.increaseContributions.employerIncrease.focus();
		}
	}

	//if one of the employee field is not filled
	else if(!isblank(document.increaseContributions.currentContributionsEmployee.value)
	|| !isblank(document.increaseContributions.employeeIncrease.value))
	{
		if(isblank(document.increaseContributions.currentContributionsEmployee.value))
		{
			isFilled = dateError("please enter current contribution details.");
			document.increaseContributions.currentContributionsEmployee.focus();
		}
		else if(isblank(document.increaseContributions.employeeIncrease.value))
		{
			isFilled = dateError("please enter new contribution details.");
			document.increaseContributions.employeeIncrease.focus();
		}
	}

	return isFilled;
}


// *****************************************************************************
// *** Description:  Script for decrease contributions						 ***
// *** 																		 ***
// *****************************************************************************
function checkDecreasefields()
{
	var isFilled = true;

	//if all 4 fields are empty
	if(isblank(document.decreaseContributions.currentContributionsEmployee.value)
	&& isblank(document.decreaseContributions.employeeDecrease.value)
	&& isblank(document.decreaseContributions.currentContributionsEmployer.value)
	&& isblank(document.decreaseContributions.employerDecrease.value)
	)
	{
		document.decreaseContributions.currentContributionsEmployer.focus();
		isFilled = dateError("please enter contribution details.");
	}

	//if one field for employer and one field for employee is filled
	else if( (!isblank(document.decreaseContributions.currentContributionsEmployee.value)
		&& !isblank(document.decreaseContributions.currentContributionsEmployer.value) )
		|| ( !isblank(document.decreaseContributions.currentContributionsEmployer.value)
		&& !isblank(document.decreaseContributions.employeeDecrease.value) ) )
	{
		if(isblank(document.decreaseContributions.currentContributionsEmployer.value))
		{
			isFilled = dateError("please enter current contribution details.");
			document.decreaseContributions.currentContributionsEmployer.focus();
		}
		else if(isblank(document.decreaseContributions.employerDecrease.value))
		{
			isFilled = dateError("please enter new contribution details.");
			document.decreaseContributions.employerDecrease.focus();
		}
		else if(isblank(document.decreaseContributions.currentContributionsEmployee.value))
		{
			isFilled = dateError("please enter current contribution details.");
			document.decreaseContributions.currentContributionsEmployee.focus();
		}
		else if(isblank(document.decreaseContributions.employeeDecrease.value))
		{
			isFilled = dateError("please enter new contribution details.");
			document.decreaseContributions.employeeDecrease.focus();
		}

	}

	//if one of the employer field is not empty
	else if(!isblank(document.decreaseContributions.currentContributionsEmployer.value)
	|| !isblank(document.decreaseContributions.employerDecrease.value))
	{
		if(isblank(document.decreaseContributions.currentContributionsEmployer.value))
		{
			isFilled = dateError("please enter current contribution details.");
			document.decreaseContributions.currentContributionsEmployer.focus();
		}
		else if(isblank(document.decreaseContributions.employerDecrease.value))
		{
			isFilled = dateError("please enter new contribution details.");
			document.decreaseContributions.employerDecrease.focus();
		}
	}

	//if one of the employee field is not filled
	else if(!isblank(document.decreaseContributions.currentContributionsEmployee.value)
	|| !isblank(document.decreaseContributions.employeeDecrease.value))
	{
		if(isblank(document.decreaseContributions.currentContributionsEmployee.value))
		{
			isFilled = dateError("please enter current contribution details.");
			document.decreaseContributions.currentContributionsEmployee.focus();
		}
		else if(isblank(document.decreaseContributions.employeeDecrease.value))
		{
			isFilled = dateError("please enter new contribution details.");
			document.decreaseContributions.employeeDecrease.focus();
		}
	}

	return isFilled;
}

// *****************************************************************************
// *** Description: spimemberlist DPR#541			                         ***
// *** 																		 ***
// *****************************************************************************
function setValues(planNumber,consentFlag)
{
	document.hiddenValues.linkedPlanNumber.value=planNumber;
	document.hiddenValues.linkedConsentGivenFlag.value=consentFlag;
	document.hiddenValues.submit();
}


// *****************************************************************************
// *** Description:  initialise form...                                      ***
// *** 																		 ***
// *****************************************************************************
function initMpiWelcome()
{
	if (document.welcomeForm != null)
	{
		document.welcomeForm.planNumber.selectedIndex = document.welcomeForm.planListIndex.value ;
	}
}

// *****************************************************************************
// *** Description: perform "pseudo-sumbit" from list of plan numbers 		 ***
// *** 																		 ***
// *****************************************************************************
function refreshMpiWelcome()
{
	if (document.welcomeForm != null)
	{
		document.welcomeForm.planListIndex.value = document.welcomeForm.planNumber.selectedIndex ;
		document.action="mpiwelcome.jsp" ;
		document.welcomeForm.submit() ;
	}
}

// ******************************************************************
// *** Script for change address and general enquiry pages.		*****
// *** (At the moment group only).	  							*****
// ******************************************************************
function checkEntry(form, comp)
{
	var isEntryOk = new Boolean();

	isEntryOk=false;

		if(!verify(form))
		{
			isEntryOk=false;
			return isEntryOk;
		}

		else
		{
			if("changeAddress"==form.name)
			{
				if(comp.value.length>150)
				{
					alert("We are unable to submit this form as the address is too long.\nPlease condense the address and try again.");
					comp.focus();
					isEntryOk=false;
				}
				else
				{
					isEntryOk=true;
				}
			}

			else if("schemeGeneralEnquiry"==form.name)
			{
				if(comp.value.length>1500)
				{
					alert("We are unable to submit this form\nas the text exceeds 1500 characters.\nPlease reduce the text and try again.");
					comp.focus();
					isEntryOk=false;
				}
				else
				{
					isEntryOk=true;
				}
			}
		}

	return isEntryOk;
}


// ************************************************************************
// *** Description:   Check the Browser being MSIE 4 or not.		***
// *** in IE4 sometimes there is a problem with giving focus to the 	***
// *** help window. The error "Access is dennied" appears every time	***
// *** when the focus is given to a help window. If the problem appears	***
// *** then we use this function. If this method returns true then we 	***
// *** do not call "focus()" function else we do			***
// ************************************************************************
function isIE4()
{
 	return ( navigator.appVersion.indexOf('MSIE 4') != -1 );
}

// ***********************************************************************************
// *** Description:   Used for Contribution Payer where HTML links were		       ***
// *** forwarding to pages using renderers that expect ContributionFile            ***
// *** objects to exist in session scope.  Enhancements to Cont Payer in           ***
// *** August 2004 involve removing these session-scope objects, and so            ***
// *** these HTML links must now pass through request handlers so that the         ***
// *** appropriate ContributionFile data can be read from the back-end and         ***
// *** then stored in request scope before forwarding onto the page                ***
// *** specified in "destination".                                                 ***
// *** reqHandler = code for request handler to be invoked (see servletconfig.xml) ***
// *** destination = page to forward to from req handler (ie "whatever.jsp")       ***
// ***********************************************************************************

function goContPayer(reqHandler, destination)
{
	document.pagedata.RequestID.value = reqHandler;
	document.pagedata.destination.value = destination;
	document.pagedata.submit();
}

// *** The following "goEditMember" is a page-specific "extension" of goContPayer which is required to pass on extra parameters into request scope ***

function goEditMember(reqHandler, destination, selectedRow, RevalidateRequired, Status, DueDateOfPayment, PayrollDate, OpraDate, EmployerPaymentDate, NameSearch, ExactMatch)
{
	document.pagedata.RequestID.value = reqHandler;
	document.pagedata.destination.value = destination;
	document.pagedata.selectedRow.value = selectedRow;
	document.pagedata.RevalidateRequired.value = RevalidateRequired;
	document.pagedata.Status.value = Status;
	document.pagedata.DueDateOfPayment.value = DueDateOfPayment;
	document.pagedata.PayrollDate.value = PayrollDate;
	document.pagedata.OpraDate.value = OpraDate;
	document.pagedata.EmployerPaymentDate.value = EmployerPaymentDate;
	document.pagedata.NameSearch.value = NameSearch;
	document.pagedata.ExactMatch.value = ExactMatch;
	document.pagedata.submit();
}

function employerLogout()
{
	window.opener.close();
	if(window.opener != null && window.opener.closed == false)
	{
		window.focus();
	}
	else
	{
		document.location = "/penadmin/group/jsp/sessionlogout.jsp";
	}
}

