function checkAppCookie() {	var cookieName = "ECEApplication=";	var cookies = document.cookie;	var pos = cookies.indexOf( cookieName );	if ( pos >= 0 ) {		var start = pos + cookieName.length;		var end = cookies.indexOf( ";", start );		if ( end < 0 ) {			end = cookies.length;		}		return cookies.substring( start, end );	}	return "";}function loadAppByCookie( tpMode ) {	var port = document.forms[0].HTTPSPort.value;	//look for session cookie first and load if found	var appUNID = checkAppCookie();	if ( appUNID != ""  ) {		location.href = "https://" + document.domain  + ( port != "" ? ":" + port : "" ) 		+ "/main/LoadDoc?OpenAgent&UNID=" + appUNID;		return;	} else {		location.href = "https://" + document.domain + ( port != "" ? ":" + port : "" ) 		+ "/main/ReturnToApp?OpenForm&SubSite=1&LeftNav=3" + ( tpMode != undefined ? "&TPMode=" + tpMode : "" );	}}function loadAppByAccessCode( accessCode, dob ) {	var port = document.forms[0].HTTPSPort.value;	location.href = "https://" + document.domain  + ( port != "" ? ":" + port : "" ) 	+ "/main/LoadDoc?OpenAgent&Access=" + accessCode + "&DOB="  + dob;}