// Displays a welcome message to user if he had already been here before
var firstName = getCookie('firstName');
var lastName = getCookie('lastName');
var dOB = getCookie('dOB');
if (firstName != null && lastName != null && dOB != null)
{
  document.write("<DIV ALIGN=CENTER><STRONG>" + firstName + ",&nbsp;&nbsp;</STRONG><a href=javascript:eraseName() CLASS=quiz>(not " + firstName + " " + lastName + "?)</A></DIV>");
}
else
{
  if (firstName == null && lastName == null)
  {
	document.write("Please enter your:<br/>");
	document.write("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD>First Name: </TD><TD><INPUT NAME=firstNameBox TYPE=text SIZE=7 MAXLENGTH=13></TD></TR>");
	document.write("<TR><TD>Last Name: </TD><TD><INPUT NAME=lastNameBox TYPE=text SIZE=7 MAXLENGTH=14></TD></TR>");
	document.write("<TR><TD>Date of Birth:&nbsp;</TD><TD><INPUT NAME=dOBBox TYPE=text VALUE=dd/mm/yyyy SIZE=7 MAXLENGTH=10 onfocus=if(this.value=='dd/mm/yyyy'){this.value='';}></TD></TR></TABLE>");
  }
  else if (firstName != null && lastName == null)
  {
	  document.write(firstName + ", please enter your:<br/>");
	  document.write("<a href=javascript:eraseName() CLASS=quiz>(not " + firstName + "?)</A><br/>");
	  document.write("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD>Last Name: </TD><TD><INPUT NAME=lastNameBox TYPE=text SIZE=7 MAXLENGTH=14></TD></TR>");
	  document.write("<TR><TD>Date of Birth:&nbsp;</TD><TD><INPUT NAME=dOBBox TYPE=text VALUE=dd/mm/yyyy SIZE=7 MAXLENGTH=10 onfocus=if(this.value=='dd/mm/yyyy'){this.value='';}></TD></TR></TABLE>");

  }
  else if (firstName != null && lastName != null && dOB == null)
  {
    document.write(firstName + ", please enter your:<br/>");
    document.write("<a href=javascript:eraseName() CLASS=quiz>(not " + firstName + " " + lastName + "?)</A><br/>");
    document.write("Date of Birth:&nbsp;<INPUT NAME=dOBBox TYPE=text VALUE=dd/mm/yyyy SIZE=7 MAXLENGTH=10 onfocus=if(this.value=='dd/mm/yyyy'){this.value='';}>");
	document.write("<br/>and answer the questions below.");
  }
}
