function CheckLight()
{
document.UserData.Extra.value = navigator.appName + ", " + navigator.userAgent;
document.UserData.Lxone.value = screen.width;
document.UserData.Lxtwo.value = screen.height;
if (navigator.appName == "Netscape")
{
  document.UserData.Lxthr.value = window.outerWidth;
  document.UserData.Lxfou.value = window.outerHeight;
}
}

function getUserData()
{
  var userdata = document.cookie;
  userdata = unescape(userdata.substring(userdata.indexOf("ICDL=")+5,userdata.length));
  end = userdata.indexOf("&&");
  document.UserData.firstname.value = userdata.substring(0,end);
  document.UserData.firstname.style.backgroundColor = "#cee0ff";
  userdata = userdata.substring(end+2,userdata.length);
  end = userdata.indexOf("&&");
  document.UserData.lastname.value = userdata.substring(0,end);
  document.UserData.lastname.style.backgroundColor = "#cee0ff";
  document.UserData.email.value = userdata.substring(end+2,userdata.length);
  document.UserData.email.style.backgroundColor = "#cee0ff";
  document.UserData.info.style.backgroundColor = "#cee0ff";
  document.UserData.postal.focus();
}

function CheckForm()
{
document.UserData.Lxone.value = screen.width;
document.UserData.Lxtwo.value = screen.height;

if (navigator.appName == "Netscape")
{
  document.UserData.Lxthr.value = window.outerWidth;
  document.UserData.Lxfou.value = window.outerHeight;
}

document.UserData.Extra.value = navigator.appName + ", " + navigator.userAgent;
var Email = document.UserData.email.value;

if(document.UserData.firstname.value.length < 2)
{
  document.UserData.firstname.focus();
  document.UserData.firstname.style.backgroundColor = "#ffd0d3";
  alert("Please enter your first name.");
  return false;
}

if(document.UserData.lastname.value.length < 2)
{
  document.UserData.lastname.focus();
  document.UserData.lastname.style.backgroundColor = "#ffd0d3";
  alert("Please enter your last name.");
  return false;
}

if(Email == '')
{
  document.UserData.email.focus();
  document.UserData.email.style.backgroundColor = "#ffd0d3";
  alert("Please enter your email address\nor call us, if you do not have one.");
  return false;
}

if(Email.indexOf('@') < 1 || Email.indexOf('.') < 1 || Email.length < 6)
{
  document.UserData.email.focus();
  document.UserData.email.style.backgroundColor = "#ffd0d3";
  alert("Sorry,\n\""+ Email +"\" does not look like a valid email address.\n\nPlease enter your email address\nor call us, if you do not have one.");
  return false;
}

if(Email.indexOf('@.') >= 0 || Email.indexOf('.@') >= 0)
{
  document.UserData.email.focus();
  document.UserData.email.style.backgroundColor = "#ffd0d3";
  alert("Sorry,\n\""+ Email +"\" does not look like a valid email address.\n\nPlease enter your email address\nor call us, if you do not have one.");
  return false;
}

if(document.UserData.postal.value.length < 10)
{
  document.UserData.postal.focus();
  document.UserData.postal.style.backgroundColor = "#ffd0d3";
  alert("Please enter at least your city and country.");
  return false;
}

var Verfall = new Date();
var Hlpv = Verfall.getTime();
Verfall.setTime(Hlpv + 360*24*3600000);

var Inhalt = document.UserData.firstname.value + "&&" +
document.UserData.lastname.value + "&&" +
document.UserData.email.value;

document.cookie = "ICDL=" + escape(Inhalt) + "; expires="+Verfall.toGMTString();
}


