function moveToFront() {if (parseInt(navigator.appVersion) >= 3) {top.focus();}}

function popup(nompage,nomfen,large,haut) {
var fenetre = window.open(nompage, nomfen, 'resizable=yes,scrollbars=yes,status=no,menubar=yes,toolbar=no,directories=no,location=no,width=' + large + ',height=' + haut + '');
}

function go_close() {top.location = "./vide.htm";}

function go(nompage) {document.top.action = nompage;}

/*function bloqueTouche(e) 
{ 
  if(event.ctrlKey) return false; //Touche Ctrl enfoncée 
    if((event.keyCode == 78) || (event.keyCode == 104)) //touche n ou N enfoncée 
      event.returnValue = false; 
  if (event.keyCode == 122){ //touche F11 enfoncée 
      event.keyCode=0;
	  return false
	}*/ 

function disableselect(e) {
return false;
}

function checkPressedKey(e){	
	return; //pendant les tests
	
	if (objFocused == "form_textfield") {	 
	return;
	}	
	
	var code;
	if (!e) var e = window.event;
	if (e.keyCode) code = e.keyCode;
	else if (e.which) code = e.which;	
	
		if (e.type=="keypress") {
			if (code>32 && code !=122 && code != 116) {
			code-=32;
			}
		}		

	if (code==17||code==104||code==8||code==122) {
		if (document.all) e.keyCode=0; //pr IE		
	return false;
	}
	else return true;
	//var character = String.fromCharCode(code);
	//alert('Character was ' + character);
}

function checkRightClick(e)
{
	return;//pendant les tests

	var rightclick;
	if (!e) var e = window.event;
	if (e.which) rightclick = (e.which == 3);
	else if (e.button) rightclick = (e.button == 2);
	//alert('Rightclick: ' + rightclick); // true or false
	
	if (rightclick) return false;
	else return true;
}

function isForbidden() {
return; //pendant les tests
return false;
}

function pageInit() {
top.focus();

	if (document.forms) {
	//Yanno :
	//appliquer un évenement onfocus et onblur sur tous les champs textes
	//on empeche ainsi la capture des evenements clavier quand ceux ci ont le focus
	
		for (var j=0; j<document.forms.length;j++) {
			for (var i=0; i<document.forms[j].elements.length;i++) {
			var elt = document.forms[j].elements[i];
			var t = elt.type.toLowerCase();
			
		
			msg += t + " | ";
		
				if (t.indexOf("text")>=0 || t.indexOf("pass")>=0) {			
				elt.onfocus=function() { objFocused = "form_textfield"; }
				elt.onblur=function() { objFocused = ""; }
				}		
			}
		}		
	}
objFocused="";

	 if (window.check_radio) { check_radio(); } //remplace les body onload="" en dur dans la page
}

function P7_autoLayers() { //v1.2 by PVII
 var g,b,k,f,args=P7_autoLayers.arguments;
 var a = parseInt(args[0]);if(isNaN(a))a=0;
 if(!document.p7setc) {p7c=new Array();document.p7setc=true;
  for (var u=0;u<10;u++) {p7c[u] = new Array();}}
 for(k=0; k<p7c[a].length; k++) {
  if((g=MM_findObj(p7c[a][k]))!=null) {
   b=(document.layers)?g:g.style;b.visibility="hidden";}}
 for(k=1; k<args.length; k++) {
  if((g=MM_findObj(args[k])) != null) {
   b=(document.layers)?g:g.style;b.visibility="visible";f=false;
   for(j=0;j<p7c[a].length;j++) {
    if(args[k]==p7c[a][j]) {f=true;}}
  if(!f) {p7c[a][p7c[a].length++]=args[k];}}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function verification() {
var ok='ok';
	if (test_videL(eval(document.formulaire.numclient),'fr',0,'msg01') != 'ok') {return 'non'}
	if (test_numeriqueL(document.formulaire.numclient,'fr',0,'msg02') != 'ok') {return 'non'}
	if (test_longueur_numL(eval(document.formulaire.numclient),6,'fr',0,'msg03') != 'ok') {return 'non'}
	if (test_videL(eval(document.formulaire.mdp),'fr',0,'msg04') != 'ok') {return 'non'}

return ok;
}
	
function verification2() {
var ok='ok';
	if (test_videL(eval(document.formulaire2.numclient2),'fr',0,'msg01') != 'ok') {return 'non'}
	if (test_numeriqueL(document.formulaire2.numclient2,'fr',0,'msg02') != 'ok') {return 'non'}
	if (test_longueur_numL(eval(document.formulaire2.numclient2),6,'fr',0,'msg03') != 'ok') {return 'non'}

return ok;
}

//--------- GLOBAL VARS -------------
var msg;
var objFocused;