<!-- start hide

function getValues() {
 var ret='';
 //KontoNummer
 KN=trim(document.mainform.KontoNummer.value);
 KN=KN.toUpperCase();
 KN=sonder(KN);
 if (KN.length > lengthKN) {
  ret='Numéro de compte: ' + lengthKN + ' positions autorisées au maximum';
  document.mainform.KontoNummer.focus();
 }  
 if (KN.length==0){
  ret='Entrez le numéro de compte';
  document.mainform.KontoNummer.focus();
 } 
 //BCNummer
 BC=trim(document.mainform.BCNummer.value);
 if (BC.length > lengthBC) {
   ret='ID. bancaire: ' + lengthBC + ' positions autorisées au maximum';
 }
 if (BC.length==0){
 	if (lengthBC!=0) {
    ret="Entrez l'ID. bancaire";
    document.mainform.BCNummer.focus();
  }
 }  
 countryPointer=getCountryPointer(document.mainform.laender.value);
 if (countries[countryPointer][3]=="n"){
  for (var i=0; i<BC.length; i++){
   if ((BC.charAt(i)<'0') || (BC.charAt(i)>'9')){
    ret='ID. bancaire non valable';
    document.mainform.BCNummer.focus();
   }
  } 
 }
 return ret;
}
 
function getP(){
 var ret='';
 IB=trim(document.mainform.pIBAN.value);
 if ((IB.substring(0,4)=='IBAN') || (IB.indexOf(" ")!=-1)){
  if (trimIban()==1){
   ret='Format erroné';
   document.mainform.pIBAN.focus();
  }
 } 
 if (ret==''){
  if (IB.substring(0,4)=='IBAN'){
   IB=IB.substring(4,IB.length);
  }
  var len=IB.length;
  for (var i=0; i<len; i++){
   c=IB.charAt(i);
   if ((c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')){
    //nothing
   }else{
    ret='Charactères non admis';   
    document.mainform.pIBAN.focus();
   }
  }
  if (IB.length<4){
     ret='Entrée trop courte';
 	   document.mainform.pIBAN.focus();
  } 
  if (IB.length<1){
     ret='Entrez l\'IBAN';
 	   document.mainform.pIBAN.focus();
  } 

  countryPointer=getCountryPointer(IB.substring(0,2));
  
  if (countryPointer==-1) {
  	ret='Code de pays non valable';
  }
  else {
    totLength=4+eval(countries[countryPointer][1])+eval(countries[countryPointer][2]);
    if (IB.length!=totLength){
      ret='Doit comporter '+totLength+' positions';
 	    document.mainform.pIBAN.focus();
    }
  }
  
 } 
 return ret;	
} 

function doPlaus(){
 document.getElementById("errormessage").firstChild.nodeValue=" ";   	
 clearStatus();
 protpIBAN=true;
 LC='';
 BC='';
 KN='';
 
 var stat=getP();
 
 LCt=IB.substring(0,2);
 countryPointer=getCountryPointer(LCt);
 if (countryPointer==-1) {
 	stat='Code de pays non valable';
 }
 
 if (stat==''){
  n=IB.substring(4,IB.length)+LCt+"00";
  n=setNum(n);
  pZ=calc(n);
  
  if(pZ==IB.substring(2,4)){
   stat='IBAN correct';
   protpIBAN=false;
  
   LC=LCt;
   BC=IB.substring(4,4+eval(countries[countryPointer][1]));
   KN=IB.substring(4+eval(countries[countryPointer][1]),4+eval(countries[countryPointer][1])+eval(countries[countryPointer][2]));
   document.mainform.pBCNummer.size=eval(countries[countryPointer][1]);
   document.mainform.pKontoNummer.size=eval(countries[countryPointer][2]);
   
  }else{
   stat='Chiffre de contrôle erroné';
   document.mainform.pIBAN.focus();
  }  
 }
 document.getElementById("errormessage").firstChild.nodeValue=stat;    
 document.mainform.pLandCode.value=LC;
 document.mainform.pBCNummer.value=BC;
 document.mainform.pKontoNummer.value=KN;
} 

function about(){
 alert("\n       Réalisé par:                                "+
  "\n"+
  "\n       CREALOGIX E-Banking Solutions AG"+
  "\n       Hohlstrasse 535"+
  "\n       CH - 8048 Zurich"+ 
  "\n       Tel.: 01 439 57 57"+
  "\n       http://www.e-banking.crealogix.com/");
}
// end hide -->
