//<!-- TOPIC Javascript Libraries -->
function ActiveAgree(apptype, ckObject) {
    var bRet = true;
    if(ckObject == null)
    {
    	ckObject = document.forms[0].szPINAGREE;
    }
    if (!(ckObject[0].checked)) {
    	if (apptype == 'R')
    	{
    		alert("You cannot submit your PIN Application until you agree with the terms listed on the page.  If you disagree with the terms, close this message and select the 'Cancel' button to cancel your PIN Application.")
    		    
    	}
    	else if (apptype == 'S')
    	{
    		alert("Usted no puede presentar la solicitud de PIN hasta que acepte las condiciones indicadas en la página.  Si no acepta dichas condiciones, cierre el presente mensaje y pulse el botón «Cancelar» para cancelar su solicitud de PIN.")
    	}
    	else if (apptype == 'T')
    	{
    		alert("Usted no puede activar su PIN hasta que acepte las condiciones indicadas en la página.  Si no acepta dichas condiciones, cierre el presente mensaje y pulse el botón «Cancelar» para salir.")
    	}    	
    	else
    	{
    	    alert("You cannot activate your PIN until you agree with the terms listed on the page.  If you disagree with the terms, close this message and select the 'Cancel' button to exit.")
    	}
    bRet = false;
    }
    return bRet;
}

function submission(what)
{
    document.forms[0].dowhat.value=what

 	//if(what=='clearform')
    	//Help('pincache.html')
    document.forms[0].submit()
    return false
}

var clHandleEmail;
var EmailPage = null;
function show_email_post(szMailPage)
{
	if (document.FAFSA.szPINDisplay.value == 2)
	{
		EmailPage = window.open (szMailPage, 'EmailPage','location=1,status=1,scrollbars=1,width=200,height=200');
		window.focus();
		setTimeout('closeWindow()', 5000);
	} else
	{
		submission('next');	
	}
}

function closeWindow()
{
//var clXML = EmailPage.document;
//var clNode = clXML.getElementsByName("lmdelivery");
//alert(clNode.length);
//var szReturn =serialize(clNode);
//var isSubmitted = (szReturn.indexOf("Accepted") > -1);
//	alert(isSubmitted)
//window.open(szMailPage, 'EmailPage','').close();
submission('next');	
}

function serialize(node)
{
if (typeof XMLSerializer != "undefined")
	return (new XMLSerializer( )).serializeToString(node);
else if (node.xml) return node.xml;
else 
	return "XML.serialize is not supported or can't serialize " + node;
}