


<!--
function display()
{    
	var args=display.arguments;
	var url = '/display.php?contribId=';
	url+=args[0];
	if(args.length>1) {
	  url+="&search="+args[1];
	}
	var iWin = window.open(url, 'displayWindow', 'scrollbars=yes,width=620,height=450,resizable=1');
  if (!iWin) {
   alert('Vous devez activer les ouvertures de fenêtre javascript');
  }      /*  return false;*/
}

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) {
  var oWin = window.open(theURL,winName,features);
  if (!oWin) {
   alert('Vous devez activer les ouvertures de fenêtre javascript');
  }        
}

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 ((navigator.appName=="Netscape")&&(parseInt(navigator.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 toInt ( x )
{
	return ( x > 0 ? Math.floor( x ) : Math.ceil ( x ) )
}
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.length) {
        var isChecked=0;
        for(k=0;k<val.length;k++) {          
          if(val[k].checked) isChecked=1;
        }        
        if(isChecked==0) {
          if(test.indexOf('R')!=-1) {
            errors +='- '+name+' doit contenir au minimum une sélection\n';
          }
        }
      } else {
        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+='- '+name+' doit être un nombre\n';
            if (test.indexOf('inRange') != -1) { 
              s=test.indexOf('inRange');p=test.indexOf(':');              
              min=toInt(test.substring(s+7,p));max=toInt(test.substring(p+1));
              val=toInt(val);
              if (val<min || max<val) errors+='- '+name+' doit être un nombre entre '+min+' et '+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,1000,10);	  
	if(MyBox!=null) {
	  MyBox.start();
	  
	}
  }

function AjoutFiche(admurl,opt) {
	var addCtWindow;
	var url = '/EXTRANET/';
	if(admurl) {
	  url+=admurl+".php";		  
	  url+="?xxpopup=1";
	  if(opt) url+="&"+opt;
	}
	addCtWindow = window.open(url, 'ajouter', 'width=650,height=540,resizable=1,scrollbars=yes');	
}
function AdminFiche(contribId)
{
	var editWindow;
	var url = '/EXTRANET/outils/editor.php?ou=edit&contribId=';
	url+=contribId;	
	window.open(url, 'editer', 'width=650,height=540,resizable=1,scrollbars=yes');
}

function borderize(elem,status) {
  if(status) {    
    elem.oldstyle = elem.style.backgroundColor ;
    elem.style.backgroundColor ="#C0C0C0";  
  } else {
    elem.style.backgroundColor  = elem.oldstyle;
  }
// if(status) elem.style.border="1px solid #000000";
//else elem.style.border="";  
// alert("borderize:"+elem.style.border);
}
function AdminRubrique(admurl,opt)
{
	var editWindow;
	var url = '/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>Photo</title></head><b'+'ody>');
	mywin.document.write('<center><img style="cursor:hand" onClick="javascript:window.close()" alt="cliquez pour fermer" src='+escape(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.eduliabalzano.nicephore.net','Louisette Leloup, photographe.')
}
// HREF="javascript:void(0);" onClick="AddToStart(this);return(false);"
function AddToStart(Quid){
  Quid.style.behavior='url(#default#homepage)';
  Quid.setHomePage('http://www.eduliabalzano.nicephore.net');
}

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;
	}

function autoSize() {
  IE5=NN4=NN6=false
  if (self.document.all) IE5=true;
  else if (self.document.getElementById)  NN6=true;
  else if (self.document.layers)  NN4=true;
  if (IE5) {
    winHeight=(self.document.body.scrollHeight - self.document.body.clientHeight);        
    winWidth=(self.document.body.scrollWidth - self.document.body.clientWidth);         
    self.resizeBy(winWidth, winHeight);
  }
  else  if (NN6) self.sizeToContent();
  else {
    WinDetail(self,"self");
  }
  self.focus()
}

var mlPopup = null;
function newsletter(elem) {
 var mlPopup = window.open('','newsletter','width=500,height=450,scrollbars=yes');
 if (!mlPopup) {
   alert('Vous devez activer les ouvertures de fenêtre javascript');
   return false;
 }  
 elem.target = 'newsletter';
 return true;
}

function poll_vote(id)
{
  var poll =MM_findObj('poll_'+id)
  popup_window = window.open('','sondage', 'width=350,height=160,resizable=1,scrollbars=yes'); 
  if (!popup_window) {
   alert('Vous devez activer les ouvertures de fenêtre javascript');
  }    
  poll.target="sondage";
  poll.submit();  
  return true;
}

function poll_results(id)
{
  var url="/?module=sondages&id="+id+"&popup=1&cmd=cmVzdWx0cw%3D%3D";
  popup_window = window.open(url,'resultats', 'width=620,height=350,resizable=1,scrollbars=yes'); 
  if (!popup_window) {
   alert('Vous devez activer les ouvertures de fenêtre javascript'); 
  }      
}


function imprimer(url) {
        popup_window =window.open(url, '', 'scrollbars=yes,width=740,height=400,menubar=1,titlebar=0,toolbar=1,resizable=1');
}

var stdFuncLoaded=1;
var js_loaded=1;

//-->
