// JavaScript Document

function validate_required(field,alerttxt)
{
with (field)
{
  if (value==null||value=="")
  {
  alert(alerttxt);return false;
  }
  else
  {
  return true;
  }
}
}

function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
  {alert(alerttxt);return false;}
else {return true;}
}
}

function validate_form(thisform)
{
with (thisform)
{
if (validate_email(email,"Please enter a valid e-mail address")==false)
  {email.focus();return false;}
}
with (thisform)
{
if (validate_required(firstname,"Please enter your first name")==false)
  {email.focus();return false;}
}

with (thisform)
{
if (validate_required(surname,"Please enter your surname")==false)
  {email.focus();return false;}
}

}


//validating the partner login, username and login required

function validate_partnername(field,alerttxt)
{
with (field)
{
  if (value=="guest")
  {
  return true;
  }
  else
  {
	alert(alerttxt);return false;
  }
}
}

function validate_login(field,alerttxt)
{
with (field)
{
  if (value=="jan09")
  {
  return true;
  }
  else
  {
	alert(alerttxt);return false;
  }
}
}




function validate_partner(thisform)
{
with (thisform)
{
if (validate_partnername(username,"Either the username or login is incorrect")==false)
  {username.focus();return false;}
}
with (thisform)
{
if (validate_login(login,"Either the username or login is incorrect")==false)
  {login.focus();return false;}
}

}