// This script is included by ALogon and PLogon

/* 
This function is used to read the cookie set in code behind file and confirm whether browser supports cookies or not.
It will return true - if it is able to read the cookie and hence browser supports cookies.
It will return false - if it cannot read the cookie and hence browser does not support cookies.
*/
function checkCookie() 
{
	var cookiestring=""+document.cookie;
	var index1=cookiestring.indexOf("CookiesEnabled");
	
	if (index1 == - 1)
	{
	    removeClassName(document.getElementById("controlRowCookiesDisabledPrompt"), "hidden");
		return false;
	}
	else
	{
	    addClassName(document.getElementById("controlRowCookiesDisabledPrompt"), "hidden");
		return true;
	}
}

/* 
This function will be called during onclick of Login and Password links.
If the controlRowSessionTimeoutPrompt is visible then it will hide it and then
call checkCookie() to show or hide the cookie error prompt. If the browser does not support 
cookies then the page will not be posted back. This is done to avoid unnecessary server processings.
*/
function checkStatus()
{
	if (document.getElementById("controlRowSessionTimeoutPrompt")!=null)
	    addClassName(document.getElementById("controlRowSessionTimeoutPrompt"), "hidden");
	return (checkCookie());
}

// Decrease count of pages left to load, so that we know when to hide the hourglass and show the mainpage
if (typeof (jsScriptCount) != "undefined")
    jsScriptCount--;
