function affiche(tmg){
xmlHttpAff=GetXmlHttpObject();
if (xmlHttpAff==null){
  alert ("Votre navigateur ne supporte pas la technologie AJAX!");
  return;}
var urlAff="Affiche.asp";
urlAff=urlAff+"?mb=5";
urlAff=urlAff+"&tmg="+tmg;
urlAff=urlAff+"&sid="+Math.random();
//alert(urlAff);
xmlHttpAff.onreadystatechange=stateChangedAff;
xmlHttpAff.open("GET",urlAff,true);
xmlHttpAff.send(null);
}

function stateChangedAff(){ 
if (xmlHttpAff.readyState==4){ 
	document.getElementById("aide").innerHTML=xmlHttpAff.responseText;
	document.getElementById('box1').style.display="block";
	document.getElementById('aide').style.display="block";
	document.getElementById('box0').style.display="block";
	document.getElementById('TitreDroit').innerHTML="aide aux projets";
	if (document.getElementById('edit')){
	document.getElementById('edit').style.display="none";	}
	}
}

function closeBoxes(){
	document.getElementById('box1').style.display="none";
	document.getElementById('box0').style.display="none";
	if (document.getElementById('edit')){
	document.getElementById('edit').style.display="block";	}
}

function authentification(){
//Ouvre une fenêtre modale avec un iframe dedans et assigne le résultat à une variable nommée  "Authentification"
getlogin=dhtmlmodal.open('Authentification', 'iframe', 'admin/protect.asp', 'Accès réservé', 'width=400px,height=300px,center=1,resize=0,scrolling=1')
getlogin.onclose=function(){
window.location.reload();
return true //allow closing of window
}
}

function ressLoc(loc){
  if (loc==null){
  var idLoc=""
  }else{
  var idLoc=loc
  }
// Cache le bandeau d'images
  leBandeau=document.getElementById("BandeauImages");
  if (leBandeau!=null){
  leBandeau.style.display="none";}
  //Ouvre une fenêtre modale avec un iframe dedans et assigne le résultat à une variable nommée  "ressLoc"
  getRess=dhtmlmodal.open('RCL', 'iframe', 'crcl'+idLoc+'.htm', 'Carte des ressources culturelles locales', 'width=900px,height=610px,left=130px,top=110px,resize=0,scrolling=1')
  getRess.onclose=function(){
  //window.location.reload();
  return true //allow closing of window
}
}

function editer(mb,tmg,rub){
window.open("fckeditor/edit.asp?mb="+mb+"&tmg="+tmg+"&rub="+rub,"Editer","toolbar=no,status=no,directories=no,menubar=no,location=no,scrollbars=no,width=800,height=640,top=100,left=200,resizable=no");
}

function toggleDiv(nomDiv){
	var theDiv = document.getElementById(nomDiv);
	if (theDiv.style.display=="none"){
		theDiv.style.display="block";
	}else{
		theDiv.style.display="none";
	}
}

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;
}
