
<!--
function restest(nbval,res0,res1,res2)
{
if( nbval==0 )
  alert(res0);
else{
  if( nbval==NMAX ){
    alert(res1);
    return 1;
    }
  else
    alert(res2);
  }
return 0;
}

function puzzle(frm,action)
{
frm.action=action;
frm.submit();
}

function noblanc()
{
val = document.form.name.value;

len = val.length;
while( 1 ){
   posit=val.indexOf(" ");
   if( posit==-1 ){break;}
   val1=val.substring(0,posit)
   val2=val.substring(posit+1,len)
   val = val1+"_"+val2
}
document.form.name.value=val;
alert(val);

}

function loadform( frm, proj, lang, page, aname )
{
if( aname==null )alert("NUL");
frm.action="/cgi-bin/exe.pl?"+proj+"&"+lang+"&"+page+"&0"+aname;
frm.submit();
}

function send(frm,proj,lang,txt)
{
if( frm.name.value=="" || frm.passwd.value=="" ){
  alert( txt);
  return;
  }
frm.action = "/cgi-bin/exe.pl?"+proj+"&"+lang+"&chkuser&0";
frm.submit();
window.close();
}

function town(name,uv,dept,nudept){
document.form.name.value = name;
document.form.uv.value = uv;
if( nudept==0 )
  document.form.dept.value = dept;
else
  document.form.dept.value = dept+' ('+nudept+')';
}

function wind(proj,lang)
{
  remote=window.open("","remotewin",
"toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=0,width=400,height=280,left=400,top=400");
  remote.location.href = "/cgi-bin/exe.pl?"+proj+"&"+lang+"&top:login";
  if( remote.opener == null )remote.opener = "window";
  remote.opener.name = "opener";
  remote.focus();
}

function popwindow(type,proj,lang,page,prevpage,bgcolor)
{
var popwin0;

  nresize=1;
  nscroll=1;
  nwidth=700;
  nheight=400;
  nleft=100;
  ntop=100;
  if( page=="langue" ){
    nresize=0;
    nscroll=0;
    nwidth=245;
    nheight=10;
    nleft=200;
    ntop=200;
  }
  option="toolbar=0,location=0,directories=0,menuBar=0,scrollbars="+nscroll+",resizable="+nresize+",width="+nwidth+",height="+nheight+",left="+nleft+",top="+ntop;
  popwin0 = window.open("","popwin",option);
  popwin0.close();

  remote=window.open("","popwin",option);
  remote.location.href = 
       "/cgi-bin/exe.pl?"+proj+"&"+lang+"&"+type+":"+page+":"+bgcolor+":"+prevpage;
  if( remote.opener == null )remote.opener = "window";
  remote.opener.name = "opener";

  remote.focus();
}

function checkForm(frm,miss,user,passwd,passwd1) {
  var ErrMsg = miss;
  var lenInit = ErrMsg.length;

  lenInit = ErrMsg.length;
  if (frm.user){
     if(isEmpty(frm.user)==true) 
            ErrMsg += '\n - ' +user;}
  if (frm.passwd){
     if(isEmpty(frm.passwd)==true)
            ErrMsg += '\n - ' +passwd;}
  if (frm.passwd1){
     if(frm.passwd1.value!=frm.passwd.value)
            ErrMsg += '\n - ' +passwd1;}
  if (ErrMsg.length > lenInit){
     alert(ErrMsg);
     return false;
     }
//  else {
//      frm.submit();
//  }
return true;
}

// Is the variable empty ?
function isEmpty(elm) {
  var elmstr = elm.value + "";
  if (elmstr.length == 0) return true;
  return false;
}

// Check for email address: look for [@] and [.] and NOT [ ]
function isEmail(elm) {
        if (elm.value.indexOf(" ") + "" == "-1"
        && elm.value.indexOf("@") + "" != "-1"
        && (elm.value.lastIndexOf(".") > elm.value.indexOf("@"))
        && elm.value != "") return true;
        else return false;
}

// Check age validity
function isAge(elm) {
        if ( (elm.value>=0 && elm.value<=120)
        && elm.value != "") return true;
        else return false;
}

function forback(num){
parent.MENU.history.go(num);
parent.BCENT.history.go(num);
}

//-->

