var SCROLLY;
function UpdDEPARTEMENT(b_REGION){if(window.XMLHttpRequest){httpObject = new XMLHttpRequest();}else if(window.ActiveXObject){httpObject = new ActiveXObject('Microsoft.XMLHTTP');}else {PostSubmit=1} 
         if(PostSubmit==1){ls_getObj('modifier').submit();return; };
         var url='/commAnnonces/Upd_DEPARTEMENT.asp?x_REGION='+b_REGION;
         httpObject.open('GET', url, true);
         Chmp = 'b_DEPARTEMENT'
         ls_getObj(Chmp).options.length=0;
         Shw('div'+Chmp);
         addOption(Chmp, 'Veuillez patienter...', '',0);
         httpObject.onreadystatechange = function LetsGo() {if(httpObject.readyState == 4){
         																										var reponsetxt=httpObject.responseText ;
         																										if(reponsetxt!='NOSELECT'){
				         																										var reponsetxt_array = reponsetxt.split(String.fromCharCode(2));
																																		ls_getObj(Chmp).options.length=0;
																																		
																																				for (irep=0;irep<reponsetxt_array.length-1;irep++){
																																					OptionTxt = reponsetxt_array[irep]
																																					OptionArr=OptionTxt.split(String.fromCharCode(1));
																																					addOption(Chmp, OptionArr[1],OptionArr[0],OptionArr[2]);
																																					
																																				}
																																				//alert(ls_getObj(Chmp).options.length);
																																		if(ls_getObj(Chmp).options.length>1){
																																			Shw('div'+Chmp );
																																			} else {Hide('div'+Chmp);
																																				}
																														}else{
																														ls_getObj(Chmp).options.length=0;
																														Hide('div'+Chmp );
																													}
         																										//alert(reponsetxt);
         																										}
         																										}
         httpObject.send(null);
}


function UpdVILLEPROX(b_DEPARTEMENT){if(window.XMLHttpRequest){httpObject = new XMLHttpRequest();}else if(window.ActiveXObject){httpObject = new ActiveXObject('Microsoft.XMLHTTP');}else {PostSubmit=1} 
         if(PostSubmit==1){ls_getObj('modifier').submit();return; };
         var url='/commAnnonces/Upd_VILLEPROX.asp?x_DEPARTEMENT='+b_DEPARTEMENT;
         httpObject.open('GET', url, true);
         Chmp = 'b_VILLEPROX'
         ls_getObj(Chmp).options.length=0;
         Shw('div'+Chmp);
         addOption(Chmp, 'Veuillez patienter...', '',0);
         httpObject.onreadystatechange = function LetsGo() {if(httpObject.readyState == 4){
         																										var reponsetxt=httpObject.responseText ;
         																										if(reponsetxt!='NOSELECT'){
				         																										var reponsetxt_array = reponsetxt.split(String.fromCharCode(2));
																																		ls_getObj(Chmp).options.length=0;
																																		
																																				for (irep=0;irep<reponsetxt_array.length-1;irep++){
																																					OptionTxt = reponsetxt_array[irep]
																																					OptionArr=OptionTxt.split(String.fromCharCode(1));
																																					addOption(Chmp, OptionArr[1],OptionArr[0],OptionArr[2]);
																																					
																																				}
																																				//alert(ls_getObj(Chmp).options.length);
																																		if(ls_getObj(Chmp).options.length>1){
																																			Shw('div'+Chmp );
																																			} else {Hide('div'+Chmp);
																																				}
																														}else{
																														ls_getObj(Chmp).options.length=0;
																														Hide('div'+Chmp );
																													}
         																										//alert(reponsetxt);
         																										}
         																										}
         httpObject.send(null);
}


function resetD(CHmp){ls_getObj(CHmp).options.length=0;Hide('div'+CHmp); RzDt();}

function UpdatePosVilleprox(b_VILLEPROX){
if(window.XMLHttpRequest){httpObject = new XMLHttpRequest();}else if(window.ActiveXObject){httpObject = new ActiveXObject('Microsoft.XMLHTTP');}else {PostSubmit=1} 
         if(PostSubmit==1){ls_getObj('modifier').submit();return; };
         var url='/commAnnonces/RENVOIXYVILLE.asp?x_VILLEPROX='+b_VILLEPROX;
         httpObject.open('GET', url, true);CompteClick=0;
         httpObject.onreadystatechange = function LetsGo() {if(httpObject.readyState == 4){
         																										var reponsetxt=httpObject.responseText ;
         																										if(reponsetxt!='NOSELECT'){
				         																										var reponsetxt_array = reponsetxt.split(String.fromCharCode(2));
																																		if (reponsetxt_array.length>0){
																																				Shw('DIVPRECISE');
																																				ls_getObj('b_latitude').value=reponsetxt_array[0];
																																				ls_getObj('b_longitude').value=reponsetxt_array[1];
																																			} else {Hide('DIVPRECISE');}
																														}else{
																														Hide('DIVPRECISE');
																													}
         																										//alert(reponsetxt);
         																										}
         																										}
         httpObject.send(null);
}

function Precis(){
//if(document.body.parentElement){SCROLLY=document.body.scrollHeight;}else{	SCROLLY=document.body.offsetHeight;}

	Hide('ALLBODY');
	Shw('LOCALISATIONPRECIS');
	if(ls_getObj("b_longiperso").value != "" && ls_getObj("b_latiperso").value != ""){Shw('BTNBASGGD');Shw('BTNBASGGV');}else{Hide('BTNBASGGD');Hide('BTNBASGGV');}
	document.body.overflow='hidden';document.body.scroll='no';
	setTimeout("Situ2(ls_getObj('b_latitude').value,ls_getObj('b_longitude').value,ls_getObj('b_latiperso').value,ls_getObj('b_longiperso').value,'GGMAPPRECIS',1,15);");
	doResize();
	window.onresize = doResize;
}
function Normal(){
	
	Hide('LOCALISATIONPRECIS');
	document.body.overflow='auto';document.body.scroll='';
	window.onresize = null;
	Shw('ALLBODY');
	//if(document.body.parentElement){document.body.scrollHeight=SCROLLY;}else{document.body.offsetHeight=SCROLLY;}
}
function doResize(){
	ObjGGPRECIS=ls_getObj('LOCALISATIONPRECIS');
	ObjLocaPRECIS=ls_getObj('GGMAPPRECIS');
if(document.body.parentElement){
	WTailleClient=document.body.parentElement.offsetWidth;
	HTailleClient=document.body.parentElement.offsetHeight;

}else
{
	WTailleClient=window.innerWidth;
	HTailleClient=window.innerHeight;
}


	ObjGGPRECIS.style.width=WTailleClient;
	ObjGGPRECIS.style.height=HTailleClient;
	ObjLocaPRECIS.style.width=WTailleClient-35;
	ObjLocaPRECIS.style.height=HTailleClient-100;
	}
	
function RzDt(){
	ls_getObj('b_latiperso').value='';ls_getObj('b_longiperso').value='';Hide('DIVPRECISE');
	
	}

