var menutimers=new Array();
var publicsite=true;
var rel='images/navig/';
var gardoc='';
var gard='';
var gardy='';
posimask=0;
var loaded=0;
var limit=0;
var xmenu=1;
var htab=0;
var hdiv=0;
var gardcal=null;
var indice=0;
var bkmrk=null;
var gardv=null;
var yesMap=false;
var wloadiaporama=null;
var mapdiv=null;
var maplocal=null;
function validcherche()
{var ch=document.getElementById('CHERCHE').value;
 if (ch.length<3) {
    alert('Le mot recherché doit avoir au minimum 3 caractères');
    return false;
    } else {return true;};
};
function disp(id,dc) {
if(dc==1) {
         eld=document.getElementById('divdoc'+id);
         im=document.getElementById('fl'+id);
         if(eld.style.display!='block') {
         eld.style.display='block';
         im.src='images/flechvisit0.png';
         im.alt='Cliquer pour fermer';
         } else {
         eld.style.display='none';
         im.src='images/flechvisit1.png';
         im.alt='Cliquer pour voir les détails';
}; } else {    eld=document.getElementById('divdoc'+id);
             if(eld.style.display!='block') {
             eld.style.display='block';
             if(gardoc!='' && gardoc!=id) {
             document.getElementById('divdoc'+gardoc).style.display='none';
             }; gardoc=id;} else { eld.style.display='none';}; };
};

function showplace(e,p,cl) {if(gardcal!=null) {gardcal.parentNode.fireEvent('click');};
  e.removeEvent('click');var adresse=e.parentNode.childNodes[1].nodeValue; 
  if(mapdiv==null) {mapdiv=new Element('div');mapdiv.id='mapdiv';mapdiv.injectInside(e.parentNode);  
      mapdiv.setStyles({'width':'640px','height':'320px','border':'1px solid #000','margin':'8px auto 8px auto'});
      if (GBrowserIsCompatible()) {
	     maplocal = new GMap2(document.getElementById('mapdiv'));
        maplocal.addMapType(G_SATELLITE_3D_MAP);
          maplocal.addControl(new GSmallMapControl());
        maplocal.addControl(new GMapTypeControl()); 
        maplocal.setCenter(new GLatLng(44.091007,6.231478),7,G_HYBRID_MAP);  
   	};     
  } else { mapdiv.setStyle('display','block');maplocal.clearOverlays();} ;   
  mapdiv.injectInside(e.parentNode);
 var posi=p.split(',');
  posi=new GPoint(posi[0],posi[1]);
  var icone=new GIcon();
	 icone.iconSize=new GSize(32,32);
     icone.iconAnchor=new GPoint(16,32);
 	 icone.infoWindowAnchor=new GPoint(16,1);
	 icone.image=urlbase+'/images/icomap'+cl+'_32.png'; 
     icone.printImage='images/icomap'+cl+'_32.gif'; 
     var mkr = new GMarker(posi,{icon:icone, title:"Cliquez pour informations"});
     maplocal.addOverlay(mkr);
     gardcal=e.getElement('img');gardcal.setProperty('src','images/icomap16_close.png');
     closeplace(e,p,cl);
   return false;
 
};
function closeplace(e,p,cl) {
 e.removeEvent('click');e.addEvent("click", function() {gardcal=null;mapdiv.setStyle('display','none');this.removeEvent('click');gardcal=e.getElement('img');gardcal.setProperty('src','images/icomap16_0.png');gardcal=null;this.addEvent('click',function(){showplace(this,p,cl);});});
}; 
function patience(x) {
   if(x) {$('tempo').setStyle('display','block');} else {$('tempo').setStyle('display','none');};
};
function repost()
{if (loaded==1) { };};  
if(rslt) {
window.onload=function(){
loaded=1;
if (document.getElementById) {  
  $('tempo').setStyle('display','none');
if(document.getElementById('dvcal')) {definecontrols();};
       if(document.getElementById('actualite')) { inithomepage();};       
       if(document.getElementById('majour')) {var rel=$('majour').getElements('a[rel=dupliq]'); if(rel.length>0) {init_dupliq();};  };      
             	   
	if (window.formulaire) {init_editor('');} ; if(wloadiaporama!=null ) { wloadiaporama();};		  			 
if(document.getElementById('mapgoogle')) {mapgoogle();  } else if(document.getElementById('map')) {loadmap();} ;
if(rslt[1]<7 && rslt[1]>=5.5) {supersleight.init();};
if(MOOdalBox) {MOOdalBox.init(); };if(document.getElementById('tempo')) {patience(0);};
};
};
window.onUnload=function() { if(yesMap) {GUnload();};};
} else { 
window.onload=function(){ 
loaded=1;
            if (document.getElementById) {			 
    if(document.getElementById('dvcal')) {definecontrols();};
        if(document.getElementById('actualite')) { inithomepage();};       
       if(document.getElementById('majour')) { var rel=$('majour').getElements('a[rel=dupliq]');
	   if(rel.length>0) {init_dupliq();}; };
	    
    	if (window.formulaire) {init_editor(''); };
	   if(wloadiaporama!=null ) { wloadiaporama();};
	   if(MOOdalBox) {MOOdalBox.init(); };
	   if(document.getElementById('mapgoogle')) {mapgoogle();} else if(document.getElementById('map')) {loadmap();} ; }; if(document.getElementById('tempo')) {patience(0);};
        } ;

window.onUnload=function() { if(yesMap) {GUnload();};} ; 

  }; 
  

 