
<!--
function display()
{
  
	var editWindow;
	var args=display.arguments;
	var url = '/avenir-nepad/display.php?contribId=';
	url+=args[0];
	if(args.length>1) {
	  url+="&search="+args[1];
	}
	window.open(url, 'displayWindow', 'scrollbars=yes,width=620,height=450,resizable=1');
}

function MM_swapImgRestore() {
  var i,x,a=document.MM_sr;
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() {
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_validateForm() {
  var name,i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]); name=args[i+1]
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+name+' doit être une adresse e-mail valide (au format nom@hote.domaine).\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+name+' est nécessaire.\n'; }
  } if (errors) alert('Le formulaire contient les erreurs suivantes :\n'+errors);
  document.MM_returnValue = (errors == '');
}

var MyBox = null;
function InitMyBox()
	{
	MyBox = new Box('MyBox','conteneur',1,40,10,50);	  
	if(MyBox!=null) MyBox.start();
  }

function AdminFiche(contribId)
{
	var editWindow;
	var url = '/avenir-nepad/EXTRANET/outils/editor.php?ou=edit&contribId=';
	url+=contribId;	
	window.open(url, 'editer', 'width=650,height=540,resizable=1,scrollbars=yes');
}

function AdminRubrique(admurl,opt)
{
	var editWindow;
	var url = '/avenir-nepad/EXTRANET/';
	if(admurl) {
	  url+=admurl+".php";		  
	  url+="?xxpopup=1";
	  if(opt) url+="&"+opt;
	}
	
	window.open(url, 'AdmSite', 'toolbar=1,status=1,resizable=1,scrollbars=yes');
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function menu(layer,mode)
{
  MM_showHideLayers(layer,'',mode)
}

function ShowPicture(ImageId,thewidth,theheight)
{
  var maxWidth;
  var maxHeight;
  var popwidth;
  var popheight;
  var moveit=0;  
  
  maxWidth=screen.availWidth;
  if(maxWidth<=0) maxWidth=thewidth;
  if(maxHeight<=0) maxHeight=theheight
  maxHeight=screen.availHeight;
  
  
  if((thewidth+48)>maxWidth) { popwidth=maxWidth-16;moveit=1; }
  else  { popwidth=thewidth+48;}
  if((theheight+64)>maxHeight) { popheight=maxHeight-16;moveit=1; }
  else { popheight=theheight+64; }
	var copyWindow;
	var url = ImageId;
	mywin = window.open('', '', 'width='+(popwidth)+',height='+(popheight)+',resizable=1,scrollbars=yes');
	mywin.document.write('<html><head><title>visualisation image</title></head><b'+'ody>');
	mywin.document.write('<center><img src='+ImageId+' width='+thewidth+' height='+theheight+' border=0>');
	mywin.document.write('<br><font face="arial,helvetica,sans-serif" size="2">[<a href="javascript:window.close()">Fermer</a>]</font>');
	mywin.document.write('</center></b'+'ody></html>');
	if(moveit) mywin.moveTo(0,0);
}

function checkemail(valStr) {
  var current=MM_findObj(valStr);  
  var varMail=current.value;   
  if (varMail.match(/^[a-z][a-z_0-9\.\-]+@[a-z_=>0-9\.\-]+\.[a-z]{2,4}$/i) != varMail) {
    return false ;
  }
  else {
    return true ;
  } 
}

function AddToFavorite()
{
  window.external.AddFavorite('http://www.assoce.net/avenir-nepad','Pour une diaspora présente et active <br>ici et là bas')
}
// HREF="javascript:void(0);" onClick="AddToStart(this);return(false);"
function AddToStart(Quid){
  Quid.style.behavior='url(#default#homepage)';
  Quid.setHomePage('http://www.assoce.net/avenir-nepad');
}

function getAnchorPosition(anchorname) {
	// This function will return an Object with x and y properties
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	// Browser capability sniffing
	var use_gebi=false, use_css=false, use_layers=false;
	if (document.getElementById) { use_gebi=true; }
	else if (document.all) { use_css=true; }
	else if (document.layers) { use_layers=true; }
	// Logic to find position
 	if (use_gebi && document.all) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_gebi) {
		var o=document.getElementById(anchorname);
		x=AnchorPosition_getPageOffsetLeft(o);
		y=AnchorPosition_getPageOffsetTop(o);
		}
 	else if (use_css) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_layers) {
		var found=0;
		for (var i=0; i<document.anchors.length; i++) {
			if (document.anchors[i].name==anchorname) { found=1; break; }
			}
		if (found==0) {
			coordinates.x=0; coordinates.y=0; return coordinates;
			}
		x=document.anchors[i].x;
		y=document.anchors[i].y;
		}
	else {
		coordinates.x=0; coordinates.y=0; return coordinates;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// getAnchorWindowPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the window
function getAnchorWindowPosition(anchorname) {
	var coordinates=getAnchorPosition(anchorname);
	var x=0;
	var y=0;
	if (document.getElementById) {
		if (isNaN(window.screenX)) {
			x=coordinates.x-document.body.scrollLeft+window.screenLeft;
			y=coordinates.y-document.body.scrollTop+window.screenTop;
			}
		else {
			x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
			y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
			}
		}
	else if (document.all) {
		x=coordinates.x-document.body.scrollLeft+window.screenLeft;
		y=coordinates.y-document.body.scrollTop+window.screenTop;
		}
	else if (document.layers) {
		x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
		y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// Functions for IE to get position of an object
function AnchorPosition_getPageOffsetLeft (el) {
	var ol=el.offsetLeft;
	while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
	return ol;
	}
function AnchorPosition_getWindowOffsetLeft (el) {
	return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
	}	
function AnchorPosition_getPageOffsetTop (el) {
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null) { ot += el.offsetTop; }
	return ot;
	}
function AnchorPosition_getWindowOffsetTop (el) {
	return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
	}

//-->
