function MM_jumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function f_clientWidth() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}
function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}
function f_scrollLeft() {
	return f_filterResults (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}
function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

function centerImg(width,height) {
  var bodyHeight = 0;
  var bodyWidth  = 0;
  var e = document.getElementById('fullsize');
  var top = 0;
  var left = 0;
  
  bodyHeight = f_clientHeight();
  bodyWidth = f_clientWidth();

  top  = ((bodyHeight - height) / 2) + f_scrollTop();           
  left = ((bodyWidth - width) / 2) + f_scrollLeft();

  e.style.top    = top+"px";
  e.style.left   = left+"px";
  
  document.getElementById('grise').style.height=f_clientHeight() + f_scrollTop()+"px";
  document.getElementById('grise').style.width=f_clientWidth() + f_scrollLeft()+"px";
}

function openPhoto(url,largeur,hauteur,close,title) {
//  hauteur += 51;
  centerImg(largeur,hauteur);
  
  photo =  "<h3>"+title+"</h3><img src="+url+" alt='' title='"+close+"'>";
//  photo += "<div style='background-color:white;text-align:center;font-weight:bold;font-size:1.2em;'><img src='./img/tel_grand.gif'><a href='#' onclick=\"ipigz_me("+url+"); return false;\">Cette image sur mon téléphone portable</a></div>";

  document.getElementById('fullsize').style.display='block';
  document.getElementById('grise').style.display='block';
  document.getElementById('fullsize').style.width = largeur+"px";
  document.getElementById('fullsize').innerHTML=photo;
  
 refreshCenterImg = setInterval("centerImg("+largeur+","+hauteur+")",500);
}

function closePhoto() {
  document.getElementById('fullsize').style.display='none';
  document.getElementById('grise').style.display='none';
  document.getElementById('fullsize').innerHTML="empty";
  clearInterval(refreshCenterImg);
//  document.getElementById('body').style.overflow='auto';
}
//efaccer nbrSubFolders
function showTree(root){
	    if (document.getElementById("root"+root)) {
		    if(document.getElementById("root"+root).style.display=='none'){
			    document.getElementById("root"+root).style.display='list-item';
			    document.getElementById("img"+root).src='./img/tree_open.gif';
		    }else{
			    document.getElementById("root"+root).style.display='none';
			    document.getElementById("img"+root).src='./img/tree_close.gif';
		    }
	    }
}

function showHTML(str){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	}
	var url=str;
	    url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChanged(){
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
		document.getElementById('galleries').innerHTML=xmlHttp.responseText 
	}
}

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
  {
  objXMLHttp=new XMLHttpRequest()
  }
else if (window.ActiveXObject)
  {
  objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
return objXMLHttp
} 
