// JavaScript Document
function pager(idopen, idclose1,idclose2)
{
	//alert("open:"+idopen+ "Close:"+idclose1+" and "+idclose2)
	document.getElementById(idopen).style.display = "block";
	document.getElementById(idclose1).style.display = "none";
	document.getElementById(idclose2).style.display = "none";
}
function OpenLayer(id)
 {
   if(document.getElementById(id).style.display == "block")
   {
    document.getElementById(id).style.display = "none" ;
   }
   else
   {
    document.getElementById(id).style.display = "block" ;
   }
   	window.status = ""
 }
 function JMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function openWin(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function saveNDclose(id)
{
var sel = confirm('Voulez vous enregistrer et fermer la fenêtre?');
	if (sel) 
	{
		window.close();
		return true;
	//alert("JE ferme la fenêtre")
	}
	else
	{
			location = "?ID=" + id;

	}
}
function Supprimer(id, m)
{
var sel = confirm('Êtes-vous sûr de vouloir supprimer cet enregistrement?');
	if (sel) 
	{
	
	location = "?ID=" + m + "&a=del&num=" + id;
	//alert("Supression effectuée avec succès")

	}
}
function AddNew (s, url, type, txt, w, h) 
{
    if (s.options[s.selectedIndex].text != txt)
        return;
    	if (type == 1)
		{
		window.open(url, 'add', 'width='+ w +',height='+ h +',resizable=no,scrollbars =1');
		}
		else
		{
		location = url;
		}

}
function popimage(img) { 
titre="Agrandissement"; 
w=open("",'image','width=1,height=1,toolbar=no,scrollbars=no,resizable=no'); 
w.document.write("<script type='text/javascript'>function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+10,document.images[0].height+50); window.focus();} else { settimeout('checksize()',250) } }</"+"script>"); 
w.document.write("<html><head><title>CFCM : Agrandir une photos : </title></head>")
w.document.write("<body onload='checksize()' onblur='window.close()' onclick='window.close()' style='padding:0px; margin:0px;' topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>"); 
w.document.write("<img src='"+img+"' border='0' alt='image' />"); 
w.document.write("</body>")
w.document.write("</html>")
w.document.close(); 
} 
