function loadPicture(id){
	hideClass('imgmini');
	$(id).style.display="block";
}
		
//-----------------------------------------------------
// affichage de la liste
//-----------------------------------------------------
function loadList(id, page, r, lang){
	document.getElementById("loading").style.display=""; 
	new Effect.Center("loading");  
	new Ajax.Updater(id, page, { 
		onComplete:function(request){ 
			document.getElementById("loading").style.display="none"; 
		},
		parameters : "r="+r+"&lang="+lang, 
		evalScripts:true, asynchronous:true 
	});
}

function Ajouter(id, page, AdmCat){
	param = '';
	if (typeof AdmCat!="undefined" && AdmCat!="") { param = "&Admcat="+AdmCat; }
	var myAjax = new Ajax.Request(page, { 
		onComplete:function(request){ 
			new Effect.PopupDHTML("popupPub", request.responseText);
		},
		parameters : "id="+id+param, 
		evalScripts:true, asynchronous:true 
	});
}
	
function loadAjax(id, page, param){
	new Ajax.Updater(id, page, { 
		onComplete:function(request){ 
			document.getElementById("loading").style.display="none"; 
		},
		parameters : param, 
		evalScripts:true, asynchronous:true 
	});
}
//-----------------------------------------------------
// INFOBULLE
//-----------------------------------------------------

/***********************************************
* Cool DHTML tooltip script II- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip" class="fl_infobulles"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="images/icones/infobulle.gif">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext){
if (ns6||ie){
if (typeof theclass!="undefined" && theclass!="") tipobj.className=theclass
if (typeof thewidth!="undefined" && thewidth!="") tipobj.style.width=thewidth+"px" 
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
if (typeof thepadding!="undefined" && thepadding!="") tipobj.style.padding=thepadding+"px"
tipobj.innerHTML=document.getElementById(thetext).innerHTML;
enabletip=true
return false;
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
tipobj.style.padding=''
}
}

document.onmousemove=positiontip
function showhide(id){
	if(document.getElementById(id)){
		if(document.getElementById(id).style.display=="none"){ 
			document.getElementById(id).style.display="";
		}else{
			document.getElementById(id).style.display="none";
		}
	}
}

function hideClass(classe){
	var tab = document.getElementsByClassName(classe);
	for(i=0;i<tab.length;i++){
		tab[i].style.display="none";
	}
}
function showClass(classe){
	var tab = document.getElementsByClassName(classe);
	for(i=0;i<tab.length;i++){
		tab[i].style.display="";
	}
}
function retour_chariot(id){
	return id.replace(/\n/g,'<br />');
}

function RunFoo(swf, hauteur, largeur, couleur, nom, version, transparent) {
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+version+",0,0,0\" width=\""+hauteur+"\" height=\""+largeur+"\" id=\""+nom+"\" align=\"middle\">\n");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n");
	transp = '';
	if(transparent !=''){
		document.write('<param name="wmode" value="transparent">');
		transp =  'wmode="transparent" ';
	}
	
	document.write("<param name=\"movie\" value=\""+swf+"\" /><param name=\"quality\" value=\"high\" /><embed src=\""+swf+"\" "+transp+" quality=\"high\"  width=\""+hauteur+"\" height=\""+largeur+"\" name=\""+nom+"\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />\n");
	document.write("</object>\n");
}


function valideform(maForm){
	document[maForm].submit();
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
	NavName = navigator.appName;
	NavVers = navigator.appVersion;
	Navigateur = NavName;
	if(NavName=="Microsof Internet Exploreur") {
	 window.open(theURL,winName,features);
	}else{
		window.open(theURL,winName,features);
	}
}

	
function noHtml(txt) {
	a = txt.indexOf('<');
	b = txt.indexOf('>');
	len = txt.length;
	c = txt.substring(0, a);
	if(b == -1) {
		b = a;
	}
	d = txt.substring((b + 1), len);
	txt = c + d;
	cont = txt.indexOf('<');
	if (cont != -1) {
		txt = noHtml(txt);
	}
	return txt;
}

function suppri(lien) {
	retour = confirm('Etes vous sur de vouloir effectuer cette suppression');
	if(retour==true) {
		window.location.href = lien;
	}
}

function confimation(lien) {
	retour = confirm('Etes vous sur de vouloir effectuer cette opération');
	if(retour==true) {
		window.location.href = lien;
	}
}

function calendarCallback_date(date, month, year) { monedit = document.getElementById("date");if (String(month).length == 1) { month = "0" + month; } if (String(date).length == 1) { date = "0" + date; } monedit.value = date + "/" + month + "/" + year; }
