function login()
{
  window.document.form_login.submit();
}

function inscr()
{
  window.location.replace("<?=$folder?>modules/inscr/inscr.php?lang=<?=$lang?>");
}

function validate()
{
  var test=0

  var login=window.document.form_inscr.login.value
  var pass=window.document.form_inscr.pass.value
  var pass2=window.document.form_inscr.pass2.value
  var mail=window.document.form_inscr.mail.value
  
  if ((login.length<3) && (test==0))
  {
    alert("<?=$DEF_LOGIN_EMPTY?>");
	test=1
  }
  if ((pass.length<6) && (test==0))
  {
    alert("<?=$DEF_PASS_EMPTY?>");
	test=1
  }
  if ((pass2.length<6) && (test==0))
  {
    alert("<?=$DEF_PASS2_EMPTY?>");
	test=1
  }
  if ((pass!=pass2) && (test==0))
  {
    alert("<?=$DEF_PASS_DIFFERENT?>");
	test=1
  }
  if (((mail.indexOf('@',0)==-1) || (mail.indexOf('.',0)==-1)) && (test==0))
  {
    alert("<?=$DEF_MAIL_EMPTY?>");
	test=1
  }
  if (test==0)
  {
    window.document.form_inscr.submit();
  }
}
