// Procédures globales du projet
function ouvre_popup(page) {
	var top=(screen.height-230)/2;
	var left=(screen.width-120)/2;
	return window.open(page,"LOADING","menubar=no, status=no, scrollbars=no, menubar=no, width=230, height=120 , top="+top+", left="+left+" ");
	}
function ferme_popup(oMyPopUp) {
	if (oMyPopUp.document) { 
		oMyPopUp.close(); 
		}
	}

function fonctionJS(sDept) {
	if (document.getElementById) {
		var l = document.getElementById('A3');
		} else if (document.all) {
		var l = document.all['A3'];
		} else if (document.layers) {
		var l = document.layers['A3'];
		}
	l.options[ChercheDptCombo(l,sDept)-1].selected=true;
}
function ChercheDptCombo(l,v){
	var n=0;
	while(n<l.length){
		var s=new String(eval("l.options["+n+"].text"));
		if(s.substring(0,v.length)==v){
			return n+1
			}
		n++
		}
	return -1
	}

function fonctionJS_Ville(sVille) {
	if (document.getElementById) {
		document.getElementById('A33').value = sVille;
		} else if (document.all) {
		document.all['A33'].value = sVille;
		} else if (document.layers) {
		document.layers['A33'].value = sVille;
		}
	}
function fonctionJS_DptVille(sDept,sVille) {
	if (document.getElementById) {
		var l = document.getElementById('A3');
		document.getElementById('A33').value = sVille;
		} else if (document.all) {
		var l = document.all['A3'];
		document.all['A33'].value = sVille;
		} else if (document.layers) {
		var l = document.layers['A3'];
		document.layers['A33'].value = sVille;
		}
	l.options[ChercheDptCombo(l,sDept)-1].selected=true;
	}
function fonctionJS_DptVilleDPRT(sDept,sVille) {
		if (document.getElementById) {
		var l = document.getElementById('A43');
		document.getElementById('A50').value = sVille;
		document.getElementById('A55').value = (sDept=='38'?'02':'01')+sDept;
				} else if (document.all) {
		var l = document.all['A43'];
		document.all['A50'].value = sVille; 
		document.all['A55'].value = (sDept=='38'?'02':'01')+sDept; 
				} else if (document.layers) {
		var l = document.layers['A43'];
		document.layers['A50'].value = sVille;
		document.layers['A55'].value = (sDept=='38'?'02':'01')+sDept;
		}
	l.options[ChercheDptComboAgc(l,sDept)-1].selected=true;
	}
function ChercheDptComboAgc(l,v){
	var n=0;
	while(n<l.length){
		var s=new String(eval("l.options["+n+"].text"));
		if(s.substring(0,v.length)==v){
			return n+1
			}
		n++
		}
	return -1
	}

