    //<![CDATA[
 var map ;
 var latitude ; 
 var zoom ; 
 var longitude ; 
 var timer ; 
var geocoder;
var boucle ;

var exportID ; 
 
var offset = 0 ; 
var sensTrie = 0 ; 

//var myWindow = window.open("","windowName","toolbar=0,status=0,scrollbars=1,width=150,height=150,resizable=0");

function IsNumeric(strString)
    {
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }
function drawCircle( center,rayon) 
{ 
	
     var lat = center.lat() ; 
     var lng = center.lng() ; 
     
     var Cradius = rayon; 
     var Ccolor = '#FF0000' ;         
     var Cwidth =5;                  
     var d2r = Math.PI/180 ;            
     var r2d = 180/Math.PI ;           
     var Clat = (Cradius/6374) * r2d ;  

     var Clng = Clat/Math.cos(lat*d2r); 
     var Cpoints = [] ; 
     for (var i = 0 ; i < 13 ; i++) 
     { 
      var theta = Math.PI * (i/6) ; 
      Cx = lng + (Clng * Math.cos(theta)) ; 
      Cy = lat + (Clat * Math.sin(theta)) ; 
      Cpoints.push(new GPoint(Cx,Cy)) ; 
     } 
     var circle = new GPolyline(Cpoints,Ccolor,Cwidth,1) ; 
  
    return circle;

} 
function zoomMap () {
	zoom = zoom +1 ;
	map.setCenter(new GLatLng(latitude,longitude), zoom);
}
function deZoomMap () {
	zoom = zoom-1 ;
	map.setCenter(new GLatLng(latitude,longitude), zoom);
}
function goLeft () {
	longitude-=0.1
	 map.panTo(new GLatLng(latitude, longitude)) ;
	 if ( boucle==true){
		timer = setTimeout ( "goLeft()",50 );	
		
	}
	else {
		clearTimeout(timer ) ; 
	}
	
	
}
function finBoucle ( ) {
	
	boucle = false ;	
}
function debutBoucle () {
	boucle = true ; 	
}
function goRight () {
	
	
	longitude+=0.1
	 map.panTo(new GLatLng(latitude, longitude)) ;

	if ( boucle==true){
		timer = setTimeout ( "goRight()",50 );	
		
	}
	else {
		clearTimeout(timer ) ; 
	}
	
	
}
function goTop () {
	latitude+=0.1
	 map.panTo(new GLatLng(latitude, longitude)) ;
	 if ( boucle==true){
		timer = setTimeout ( "goTop()",50 );	
		
	}
	else {
		clearTimeout(timer ) ; 
	}
	
	
}
function goBottom () {
	latitude-=0.1
	 map.panTo(new GLatLng(latitude, longitude)) ;
	 if ( boucle==true){
		timer = setTimeout ( "goBottom()",50 );	
		
	}
	else {
		clearTimeout(timer ) ; 
	}
	
	
}
function eventClick(marker, point){
		document.infoExport.buttonAffiche.disabled=false;
		var distanceExport = parseInt(document.infoExport.zoneExport.value);
		
		map.clearOverlays() ;
	 
		var circle =  drawCircle(point,distanceExport)  ; 
	
		map.addOverlay(circle ) ; 
	
		latitude=document.infoExport.lat.value=point.lat();
		 
		longitude=document.infoExport.lng.value=point.lng();
		
}
function showAddress() {
	
	if ( document.infoExport.nomVille.value !="" )
	{
		if ( IsNumeric  (document.infoExport.nomVille.value)==true ) {
			alert("Attention l'utilisation unique d'un code postal entra\356ne une perte de pr\351cision dans la localisation");
	    }
		var nomVile = document.infoExport.nomVille.value+", fr"; 
		geocoder.getLatLng(nomVile,
	    function(point) {
	      if (!point) {
		alert(nomVile + " non trouve");
	      } else {
		      latitude = point.lat();
		      longitude = point.lng() ; 
		      zoom=7;
		map.setCenter(point,zoom);
		eventClick( null , point) ; 
	      }
	    }
	  );
	}
}

function getGeoLocResult ( ) {
	var selectedSpe ="" ; 
	for (var i=document.infoExport.specialite.options.length-1; i >= 0;i--) {
		if (document.infoExport.specialite.options[i].selected == true ) {
			if ( selectedSpe.length >0 ) {
				selectedSpe = selectedSpe + ";"; 
			}
			selectedSpe=selectedSpe+document.infoExport.specialite.options[i].value;
			
		}
	}
	selectedSpe = encode64 ( selectedSpe ) ; 
	printPageFromUrl("/annuApicrypt/code.php?geoLoc=true&lat="+latitude+"&lng="+longitude+"&zoneExport="+document.infoExport.zoneExport.value+"&hopitaux="+document.infoExport.proxyApi+"i&spe="+selectedSpe+"",initPrintUserList); 

}

function changeExportZone ( ) {
	
	var point = new GLatLng (latitude,longitude);
	eventClick("",point);
	return 1 ; 
}
 
			
function chargementMap() {
      if (GBrowserIsCompatible()) {
      map = new GMap2(document.getElementById("map"));
      var distanceExport = 10; 

     document.infoExport.buttonAffiche.disabled=true;
     // var over = new GOverlay
      GEvent.addListener(map, "click",eventClick);
      map.addControl(new GMapTypeControl());
      zoom=5;
      latitude=document.infoExport.lng.value=48.87;
	longitude=document.infoExport.lat.value=2.3;
	document.infoExport.zoneExport.value=20;
         map.setCenter(new GLatLng(latitude,longitude), zoom);
	geocoder = new GClientGeocoder();
	
	
      }
      else {
	      alert("Geolocalisation incompatible avec votre navigateur");
      }
    } 


function getSelectVilleFromDep(divId){ 
	var xmlHttp=null;
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	 {
	 alert ("Browser does not support HTTP Request");
	 return;
	 }
	 
	if ( document.formfiltre.departement ==null || document.formfiltre.ville ==null ){
		return ; 
	}
	 
	document.getElementById(divId).innerHTML ="<select name =\"ville\" disabled=\"true\" >	<option  value=\"%\">Recherche en cour</option>	</select>	"; 
	var url="/annuApicrypt/phpRequestForAjax.php";
	url=url+"?function="+"getVilleFromDep";
	if ( document.formfiltre.pays != null){
		url=url+"&pays="+document.formfiltre.pays.options[document.formfiltre.pays.selectedIndex].value;
	}
	url=url+"&dep="+document.formfiltre.departement.options[document.formfiltre.departement.selectedIndex].value;
	xmlHttp.onreadystatechange= function() { stateChanged(xmlHttp,divId); };
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null);
}


function getFiltre(divId,extented){ 
	var xmlHttp=null;
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	 {
	 alert ("Browser does not support HTTP Request");
	 return;
	 }
	 
	var url="/annuApicrypt/phpRequestForAjax.php";
	url=url+"?function="+"getFiltre";
	url=url+"&extented="+extented;
	url=url+"&dep="+document.formfiltre.departement.options[document.formfiltre.departement.selectedIndex].value;
	if ( document.formfiltre.pays != null){
		url=url+"&pays="+document.formfiltre.pays.options[document.formfiltre.pays.selectedIndex].value;
	}

	xmlHttp.onreadystatechange= function() { stateChanged(xmlHttp,divId);cleanSelect ('villeSelectList','ville' );;getSelectSpe('speSelectList' ) ; getSelectVilleFromDep('villeSelectList');getSelectProxy('proxySelectList');reloadTab ('listeUtilisateur') ;};
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null);
}





function stateChanged(xmlHttp,divId) { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		//alert ("ok " + divId ); 
		if ( divId=="" ){
		 //			alert (xmlHttp.responseText ) ; 
		}else {
			document.getElementById(divId).innerHTML=xmlHttp.responseText;
		}
	 	
	 	
	 	
	 } 
	 
}

function GetXmlHttpObject(){
	var xmlHttp=null;
	try {
		 // Firefox, Opera 8.0+, Safari
		 xmlHttp=new XMLHttpRequest();
	 }
	catch (e) {
	 //Internet Explorer
	 try {
	 	 xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  }
	 catch (e) {
	  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	 }
	return xmlHttp;
}
function cleanSelect (divId,selectName ) {
	if ( document.getElementById(divId) == null ) {
		return ; 
	}
	document.getElementById(divId).innerHTML ="<select name =\""+selectName+"\"  disabled=\"true\"><option  value=\"%\" >Recherche en cour</option></select>"; 

}
function getSelectProxy (divId ){
	
	var xmlHttp=null;
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	 {
	 alert ("Browser does not support HTTP Request");
	 return;
	 }
	if ( document.formfiltre.departement ==null || document.formfiltre.ville ==null ){
		return ; 
	}
	var url="/annuApicrypt/phpRequestForAjax.php";
	url=url+"?function="+"getSelectProxy";
	url=url+"&dep="+document.formfiltre.departement.options[document.formfiltre.departement.selectedIndex].value;
	url=url+"&ville="+document.formfiltre.ville.options[document.formfiltre.ville.selectedIndex].value;
	if ( document.formfiltre.pays != null){
		url=url+"&pays="+document.formfiltre.pays.options[document.formfiltre.pays.selectedIndex].value;
	}
	document.getElementById(divId).innerHTML ="<select name =\"idProxy\"  disabled=\"true\"><option  value=\"%\" >Recherche en cour</option></select>"; 
	xmlHttp.onreadystatechange= function() { stateChanged(xmlHttp,divId); };
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null);
}

function openWindowWithPost(url,name,keys,values){
	var sData;
    sData = "<form name='loginform' id='loginform' action='" +url +" ' method='post'>";
    sData = sData + "<input type='hidden' id='"+keys+"' name='"+keys+"' value='"+values+"' />";
    sData = sData + "</form>";
    sData = sData + "<script type='text/javascript'>";
    sData = sData + "document.loginform.submit();</sc" + "ript>";
    OpenWindow=window.open("", "exportAnnuaire","toolbar=0,status=0,scrollbars=1,width=150,height=150,resizable=0");
    OpenWindow.document.write(sData);
    OpenWindow.document.close()
}

function fillVarForExport ( ) {
	var objCheckBoxes = document.forms['formAnnu'].elements['exportID'];
	if(!objCheckBoxes){
		return ; 
		
	}
		
	if ( document.formfiltre.departement !=null ){
		document.formfiltre.dep.value =  document.formfiltre.departement.options[document.formfiltre.departement.selectedIndex].value;
	}
	
	if ( document.formfiltre.specialite !=null ){
		var selectedSpe ="" ; 
		for (var i=document.formfiltre.specialite.options.length-1; i >= 0;i--) {
			if (document.formfiltre.specialite.options[i].selected == true ) {
				if ( selectedSpe.length >0 ) {
					selectedSpe = selectedSpe + ";"; 
				}
				selectedSpe=selectedSpe+document.formfiltre.specialite.options[i].value;
			
			}
		}
		document.formfiltre.spe.value = selectedSpe; 
	}

	/*	document.formfiltre.ville.value = document.formfiltre.ville.options[document.formfiltre.ville.selectedIndex].value ; 
	document.formfiltre.idProxy.value = document.formfiltre.idProxy.options[document.formfiltre.idProxy.selectedIndex].value;
	document.formfiltre.ordre.value = document.formfiltre.ordre.options[document.formfiltre.ordre.selectedIndex].value;
*/	

	if ( document.formfiltre.nbrUserPage != null ) document.formfiltre.nbrUser.value = document.formfiltre.nbrUserPage.options[document.formfiltre.nbrUserPage.selectedIndex].value ; 
	exportID = ""  ; 
	var apimailExport = "" ;
	var countCheckBoxes = objCheckBoxes.length;
	for(var i = 0; i < countCheckBoxes; i++){
		if ( objCheckBoxes[i].checked == true ){
			var toAdd = "" ; 
			if ( i > 0 ){
				toAdd= toAdd+";" ; 
			}
			apimailExport=apimailExport+toAdd+objCheckBoxes[i].value ;
		 
		}
	}
	if ( document.formfiltre.exportType ==null  ){
		return ; 
	}

	exportID=encode64(apimailExport);
	document.formfiltre.offset.value = offset ; 
	document.formfiltre.sensTrie.value = sensTrie ; 
	document.formfiltre.exportID.value = exportID ; 

}

function exportAnnu(divId) {
	/*var xmlHttp=null;
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	 {
	 alert ("Browser does not support HTTP Request");
	 return;
	 }
	
	var url="/annuApicrypt/phpRequestForAjax.php";
	url=url+"?function="+"exportAnnu";
	
	if ( document.formfiltre.proxy !=null){
		url=url+"&proxy="+
	}
	if ( document.formfiltre.specialite !=null ){
		var selectedSpe ="" ; 
		for (var i=document.formfiltre.specialite.options.length-1; i >= 0;i--) {
			if (document.formfiltre.specialite.options[i].selected == true ) {
				if ( selectedSpe.length >0 ) {
					selectedSpe = selectedSpe + ";"; 
				}
				selectedSpe=selectedSpe+document.formfiltre.specialite.options[i].value;
			
			}
		}
		url=url+"&spe="+encode64(selectedSpe);
	}
	
	if ( document.formfiltre.idProxy !=null ){
		url=url+"&idProxy="+	}
	if ( document.formfiltre.ordre !=null ){
		url=url+"&ordre="+
	}
	if ( document.formfiltre.nbrUserPage !=null ){
		url=url+"&nbrUser="+;	
	}
	if ( offset !=null ){
		url=url+"&offset="+offset;
	}
	if ( sensTrie !=null ){
		url=url+"&sensTrie="+sensTrie;	
	}
	var apimailExport = "" ; 
	
	var objCheckBoxes = document.forms['formAnnu'].elements['exportID'];
	if(!objCheckBoxes){
		return ; 
	}

	var countCheckBoxes = objCheckBoxes.length;
	for(var i = 0; i < countCheckBoxes; i++){
		if ( objCheckBoxes[i].checked == true ){
			var toAdd = "" ; 
			if ( i > 0 ){
				toAdd= toAdd+";" ; 
			}
			apimailExport=apimailExport+toAdd+objCheckBoxes[i].value ;
		 
		}
	}
	if ( document.formfiltre.exportMode ==null  ){
		return ; 
	}
	//url=url+"&exportID="+encode64(apimailExport);
	url=url+"&exportType="+document.formfiltre.exportMode.options[document.formfiltre.exportMode.selectedIndex].value;
//	alert ( url ) ; 
	//window.open(url,'name','height=400,width=500');
	openWindowWithPost (url , "export",	"exportID",encode64(apimailExport) ) ; 
  	//window.close() ; 
	//xmlHttp.onreadystatechange= function() { stateChanged(xmlHttp,""); };
	//xmlHttp.open("POST",url,true);
	//xmlHttp.send(null);
*/
}
function setOffset ( newOffset ) {

	offset = newOffset ; 
}
function getSelectSpe (divId ) {
		
	var xmlHttp=null;
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request");
		return;
	}
	if ( document.formfiltre.departement ==null || document.formfiltre.ville ==null ){
		return ; 
	}
	var url="/annuApicrypt/phpRequestForAjax.php";
	url=url+"?function="+"getSelectSpe";
	url=url+"&dep="+document.formfiltre.departement.options[document.formfiltre.departement.selectedIndex].value;
	if ( document.formfiltre.pays != null){
		url=url+"&pays="+document.formfiltre.pays.options[document.formfiltre.pays.selectedIndex].value;
	}
	url=url+"&ville="+document.formfiltre.ville.options[document.formfiltre.ville.selectedIndex].value;
	document.getElementById(divId).innerHTML ="<select name =\"specialite\"  disabled=\"true\"><option  value=\"%\" >Recherche en cour</option></select>"; 
	xmlHttp.onreadystatechange= function() { stateChanged(xmlHttp,divId); };
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null);
}

function getSelectDep (divId ) {
		
	var xmlHttp=null;
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request");
		return;
	}
	if ( document.formfiltre.pays ==null  ){
		return ; 
	}
	
	var url="/annuApicrypt/phpRequestForAjax.php";
	url=url+"?function="+"getDepFromPays";
	
	if ( document.formfiltre.pays != null && document.formfiltre.pays.selectedIndex!=-1){
		url=url+"&pays="+document.formfiltre.pays.options[document.formfiltre.pays.selectedIndex].value;
	}

	if ( document.formfiltre.departement != null && document.formfiltre.departement.selectedIndex != -1){
		url=url+"&dep="+document.formfiltre.departement.options[document.formfiltre.departement.selectedIndex].value;
	}
//	alert ( url ) ; 
	document.getElementById(divId).innerHTML ="<select name =\"departement\"  disabled=\"true\"><option  value=\"%\" >Recherche en cour</option></select>"; 
	//xmlHttp.onreadystatechange= function() { alert("ok") ; stateChanged(xmlHttp,divId); };
	xmlHttp.open("POST",url,false); // il faut obligatoirement les departement avant de faire autre chose , on lance donc un appel synchrone pour attendre que les bonnes valeurs soit en place avant de passer a la suite 
	xmlHttp.send(null);
	
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		//alert ("ok " + divId ); 
		document.getElementById(divId).innerHTML=xmlHttp.responseText;

	 } 
}


function setOrder (divId,newOrder) {
	if ( document.formfiltre.ordre ==null  ){
		return ; 
	}
	var oldOrder = document.formfiltre.ordre.options[document.formfiltre.ordre.selectedIndex].value ; 
	var selectContent ="" ; 
	if ( oldOrder == newOrder ) {
		if ( sensTrie == 0){
			sensTrie = 1 ; 
		}
		else{
			sensTrie = 0 ;
		}  
	}
	selectContent = "<select name=\"ordre\" onchange=\"reloadTab ('listeUtilisateur' ) ;\">" ; 
	
	if ( newOrder == "nom"){
		selectContent= selectContent + "<option value=\"nom\" SELECTED >Nom</option>"; 
	}else {
		selectContent= selectContent + "<option value=\"nom\">Nom</option>"; 
	}
	if ( newOrder == "etab"){
		selectContent= selectContent + "<option value=\"etab\" SELECTED >Etablissement</option>"; 
	}else {
		selectContent= selectContent + "<option value=\"etab\">Etablissement</option>"; 
	}
	if ( newOrder == "cp"){
		selectContent= selectContent + "<option value=\"cp\" SELECTED >Code postal</option>"; 
	}else {
		selectContent= selectContent + "<option value=\"cp\">Code postal</option>"; 
	}
	if ( newOrder == "specialite"){
		selectContent= selectContent + "<option value=\"specialite\" SELECTED >Sp&eacute;cialit&eacute;</option>"; 
	}else {
		selectContent= selectContent + "<option value=\"specialite\">Sp&eacute;cialit&eacute;</option>"; 
	}
	if ( newOrder == "ville"){
		selectContent= selectContent + "<option value=\"ville\" SELECTED >Ville</option>"; 
	}else {
		selectContent= selectContent + "<option value=\"ville\">Ville</option>"; 
	}
	if ( newOrder == "datei"){
		selectContent= selectContent + "<option value=\"datei\" SELECTED >Date d'inscription</option>"; 
	}else {
		selectContent= selectContent + "<option value=\"datei\">Date d'inscription</option>"; 
	}
	document.getElementById(divId).innerHTML  = selectContent ; 
}

function reloadTab (divId){
	var xmlHttp=null;
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	 {
	 alert ("Browser does not support HTTP Request");
	 return;
	 }
	
	 document.getElementById(divId).innerHTML ="<div class=\"center\"><div class=\"txtBig\">chargement de la liste des utilisateurs</div><br><img alt=\"chargement\" src=\"/annuApicrypt/img/ajax-loader.gif\"></img></div> " ; 
 	
	var url="/annuApicrypt/phpRequestForAjax.php";
	url=url+"?function="+"reloadTab";
	
	if ( document.formfiltre.departement != null){
		url=url+"&dep="+document.formfiltre.departement.options[document.formfiltre.departement.selectedIndex].value;
	}
	if ( document.formfiltre.pays != null){
		url=url+"&pays="+document.formfiltre.pays.options[document.formfiltre.pays.selectedIndex].value;
	}
	if ( document.formfiltre.proxy != null){
		url=url+"&proxy="+document.formfiltre.proxy.value;
	}

	if ( document.formfiltre.specialite != null ){
		var selectedSpe ="" ; 
		for (var i=document.formfiltre.specialite.options.length-1; i >= 0;i--) {
			if (document.formfiltre.specialite.options[i].selected == true ) {
				if ( selectedSpe.length >0 ) {
					selectedSpe = selectedSpe + ";"; 
				}
				selectedSpe=selectedSpe+document.formfiltre.specialite.options[i].value;
			
			}
		}
		url=url+"&spe="+encode64(selectedSpe);
	}else if ( document.formfiltre.speGeoLoc != null ) {
		url=url+"&spe="+document.formfiltre.speGeoLoc.value;
	}
	if ( document.formfiltre.ville != null ){
		url=url+"&ville="+document.formfiltre.ville.options[document.formfiltre.ville.selectedIndex].value;
	}
	if ( document.formfiltre.idProxy != null ){
		url=url+"&idProxy="+document.formfiltre.idProxy.options[document.formfiltre.idProxy.selectedIndex].value;
	}
	if ( document.formfiltre.ordre != null ){
		url=url+"&ordre="+document.formfiltre.ordre.options[document.formfiltre.ordre.selectedIndex].value;
	}
	if ( document.formfiltre.nbrUserPage !=null ){
		url=url+"&nbrUser="+document.formfiltre.nbrUserPage.options[document.formfiltre.nbrUserPage.selectedIndex].value;	
	}
	if ( document.formfiltre.typeAffichage != null ) {
		url=url+"&typeAffichage="+document.formfiltre.typeAffichage.options[document.formfiltre.typeAffichage.selectedIndex].value;
	
	}
	if ( offset != null){
		url=url+"&offset="+offset;
	}
	if ( sensTrie != null ){
		url=url+"&sensTrie="+sensTrie;	
	}
		
	//alert ( url ) ; 
	xmlHttp.onreadystatechange= function() { stateChanged(xmlHttp,divId); };
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null);
	
}


// This code was written by Tyler Akins and has been placed in the
// public domain.  It would be nice if you left this header intact.
// Base64 code from Tyler Akins -- http://rumkin.com

var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

function encode64(input) {
   var output = "";
   var chr1, chr2, chr3;
   var enc1, enc2, enc3, enc4;
   var i = 0;

   do {
      chr1 = input.charCodeAt(i++);
      chr2 = input.charCodeAt(i++);
      chr3 = input.charCodeAt(i++);

      enc1 = chr1 >> 2;
      enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
      enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
      enc4 = chr3 & 63;

      if (isNaN(chr2)) {
         enc3 = enc4 = 64;
      } else if (isNaN(chr3)) {
         enc4 = 64;
      }

      output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + 
         keyStr.charAt(enc3) + keyStr.charAt(enc4);
   } while (i < input.length);
   
   return output;
}


function printPageFromUrl(urlPage){
	var xmlHttp=null;
	xmlHttp=GetXmlHttpObjectForPrintPage();
	if (xmlHttp==null)
	 {
	 alert ("Browser does not support HTTP Request");
	 return;
	 }
	
	var url=urlPage;
	xmlHttp.onreadystatechange= function() { stateChangedForPrintPage(xmlHttp); };
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null);


}

function printPageFromUrl(urlPage,param_initFunction){
	var xmlHttp=null;
	xmlHttp=GetXmlHttpObjectForPrintPage();
	if (xmlHttp==null)
	 {
	 alert ("Browser does not support HTTP Request");
	 return;
	 }
	var url=urlPage;
	xmlHttp.onreadystatechange= function() { stateChangedForPrintPage(xmlHttp,param_initFunction); };
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null);


}
function initGeoLoc ( ) {
	//alert (" aavant chargment mapm ") ; 
	chargementMap() ; 
	//alert ( "just apres ") ; 

}
function initPrintUserList ( ) {
	setOffset(0);
	//alert ("ici" );
	getSelectDep('depSelectList' );
	//alert ("et la " ) ; 
	
	reloadTab ('listeUtilisateur' ) ;
	
	getSelectSpe('speSelectList' );
	getSelectVilleFromDep('villeSelectList');
	getSelectProxy('proxySelectList');
	

}


function stateChangedForPrintPage(xmlHttp,param_initFunction) { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		//alert ("ok " + divId ); 
		
			document.getElementById("pageAnnuaire").innerHTML=xmlHttp.responseText;
			if ( param_initFunction != null ) param_initFunction( ) ; 
	 	
	 	
	 } 
	 
}

function GetXmlHttpObjectForPrintPage(){
	var xmlHttp=null;
	try {
		 // Firefox, Opera 8.0+, Safari
		 xmlHttp=new XMLHttpRequest();
	 }
	catch (e) {
	 //Internet Explorer
	 try {
	 	 xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  }
	 catch (e) {
	     xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	 }
	return xmlHttp;
}
//  End redirection lien-->

// debut javascript userList.tpl
var TipBoxID = "TipBox";

// No other customizations required
// // // // // // // // // // // //

var tip_box_id;
var checkflag = 0;

function findPosX(obj)
{
   var curleft = 0;
   if(obj.offsetParent)
   while(1) 
   {
      curleft += obj.offsetLeft;
      if(!obj.offsetParent)
         break;
      obj = obj.offsetParent;
   }
   else if(obj.x)
      curleft += obj.x;
   return curleft;
}

function findPosY(obj)
{
   var curtop = 0;
   if(obj.offsetParent)
   while(1)
   {
      curtop += obj.offsetTop;
      if(!obj.offsetParent)
         break;
      obj = obj.offsetParent;
   }
   else if(obj.y)
      curtop += obj.y;
   return curtop;
}

function DisplayTip(me,offX,offY,content) {
   var tipO = me;
   tip_box_id = document.getElementById(TipBoxID);
   var x = findPosX(me);
   var y = findPosY(me);
   tip_box_id.style.left = String(parseInt(x + offX) + 'px');
   tip_box_id.style.top = String(parseInt(y + offY) + 'px');
   tip_box_id.innerHTML = content;
   tip_box_id.style.display = "block";
   tipO.onmouseout = HideTip;
} // function DisplayTip()

function HideTip() { tip_box_id.style.display = "none"; }

	
function SetAllCheckBoxes(FormName, FieldName)
{
	if(!document.forms[FormName]){
		return;
	}
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes){
		return;
	}
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes){
		objCheckBoxes.checked = checkflag;
		
		}
	else {
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++){
				objCheckBoxes[i].checked = checkflag;
			}
	}
	if ( checkflag ==1){
		checkflag =0 ; 
		return "Ne rien exporter";
	}
	else  {
		checkflag =1 ; 
		return "Tout exporter";
	}
}
//end javascript userList.tpl

