function getCookieVal (offset) 
{
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
   
function GetCookie (name)
{
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) 
	{
		var j = i + alen;									   
		if (document.cookie.substring(i, j) == arg)
			return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) 
			break; 
	}
	return null;
}

var result;
var LoginBox;
var EUI;

result = GetCookie("ETAUI")
EUI = GetCookie("EUI")

//alert(result);
//if(result)
//	document.write("<!-- logindata: " & result & " -->")

if (!result)
	LoginBox = true
else
	if(EUI == 'K285rocJ+du6WP8/LD2vhFSLXePhen2t/RAmF3BtyHyeMaE5K5VAlg==')
		LoginBox = true
	else
		LoginBox = false

if(LoginBox)
{
	// display the loginbox.
	document.write('<FORM name="EskionLoginForm" method="post" action="../login/login.aspx">')
	document.write('<TABLE cellspacing="0" cellpadding="0" border="0" class="DefaultText" id="LogonTable" name="LogonTable">')
	document.write('<TR>')
	document.write('<TD colspan="2"><H1>Aanmelden</H1>')
	document.write('</TD>')
	document.write('</TR>')
	document.write('<TR>')
	document.write('<TD>&nbsp;</TD>')
	document.write('</TR>')
	document.write('<TR>')
	document.write('<TD class="DefaultText">Gebruikersnaam:</TD>')
	document.write('<TD class="DefaultText">Wachtwoord:</TD>')
	document.write('</TR>')
	document.write('<TR>')
	document.write('<TD><INPUT name="txtLoginName" class="LoginTextBox"></TD>')
	document.write('<TD><INPUT type="password" name="txtPassword" class="PasswordTextBox"></TD>')
	document.write('<TD><INPUT type="submit" value="Aanmelden"></TD>')
	document.write('<TD><INPUT type="hidden" name="hidJavascript" value="JavascriptGenerated"></TD>')
	document.write('</TR>')
	document.write('<TR>')
	document.write('<TD colspan="3" class="DesktopText"><INPUT type="checkbox" value="1" runat="server" name="RememberMe" id="RememberMe"><LABEL for="RememberMe">Gebruikersnaam onthouden</LABEL></TD>')
	document.write('')
	document.write('</TR>')
	document.write('</TABLE>')
	document.write('</FORM>')
	// The loginbox is created here:
	if(GetCookie("LOGONUSERNAME"))
	{
		document.EskionLoginForm.txtLoginName.value=GetCookie("LOGONUSERNAME")
		document.EskionLoginForm.RememberMe.checked=true;
	}
	else
	{
		document.EskionLoginForm.RememberMe.checked=false;
	}
}
