	//
	//Check if there is an error on any of the pages and return it.
	if (GetCookie("PCHError") != null)
	{
		var sError = getNameVal("PCHError", "error");
		if (sError.indexOf("Only") != -1)
		{
			openWin(nonsecureURL("/errors/maxEntry.aspx"));
		}
		else
		{
			openWin(nonsecureURL("/errors/error.html?sError=" + escape(sError)));
		}
		DeleteCookie("PCHError","/");
	}
	
	if (GetCookie("PCHSession") == null)
	{
		var expdateLong = new Date();
		var ar1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
		var ar2 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
		var ar3 = "ABCDEFGHIJKL0123456789MNOPQRSTUVWXYZ";
		var ar4 = "56789ABCDEFGHIJKLMNOPQRSTUVWXYZ01234";
		var ar5 = "01234ABCDEFGHIJKLMNOPQRSTUVWXYZ56789";
		var sID = "";
		
		var years = 8;
		var today = new Date();
		var expires = new Date(today.getTime() + (years * 365 * 24*60*60*1000));
		
		sID += ar1.substr(Math.random()*30,1);
		sID += ar2.substr(Math.random()*30,1);
		sID += ar3.substr(Math.random()*30,1);
		sID += ar4.substr(Math.random()*30,1);
		sID += ar5.substr(Math.random()*30,1);
		sID += ar1.substr(Math.random()*30,1);
		sID += ar2.substr(Math.random()*30,1);
		sID += ar3.substr(Math.random()*30,1);
		sID += "-";
		sID += ar4.substr(Math.random()*30,1);
		sID += ar5.substr(Math.random()*30,1);
		sID += ar1.substr(Math.random()*30,1);
		sID += ar2.substr(Math.random()*30,1);
		sID += "-";
		sID += ar3.substr(Math.random()*30,1);
		sID += ar4.substr(Math.random()*30,1);
		sID += ar5.substr(Math.random()*30,1);
		sID += ar1.substr(Math.random()*30,1);
		sID += "-";
		sID += ar2.substr(Math.random()*30,1);
		sID += ar3.substr(Math.random()*30,1);
		sID += ar4.substr(Math.random()*30,1);
		sID += ar5.substr(Math.random()*30,1);
		sID += "-";
		sID += ar1.substr(Math.random()*30,1);
		sID += ar2.substr(Math.random()*30,1);
		sID += ar3.substr(Math.random()*30,1);
		sID += ar4.substr(Math.random()*30,1);
		sID += ar5.substr(Math.random()*30,1);
		sID += ar1.substr(Math.random()*30,1);
		sID += ar2.substr(Math.random()*30,1);
		sID += ar3.substr(Math.random()*30,1);
		sID += ar4.substr(Math.random()*30,1);
		sID += ar5.substr(Math.random()*30,1);
		sID += ar1.substr(Math.random()*30,1);
		sID += ar2.substr(Math.random()*30,1);
		
		document.cookie = "PCHSession=" + escape("Session="+sID) + escape(";SessionDate="+ SERVER_DATE) +"; expires=" + expires.toGMTString();
	}
