function display(stuff) {
 window.status = stuff;
 return true;
}
var cm=null;
function displaymenu(el,m) {
 if (m) {
	 m.style.display='';
 	 m.style.pixelLeft = getPos(el,"Left")
	 m.style.pixelTop = getPos(el,"Top") + el.offsetHeight
	 }
 if ((m!=cm) && (cm)) cm.style.display='none'
	 cm=m
}
function getPos(el,sProp) {
 var iPos = 0
 while (el!=null) {
 iPos+=el["offset" + sProp]
 el = el.offsetParent
		 }
 return iPos
}
function initArray() {
 for(i=0;i<initArray.arguments.length; i++)
  this[i] = initArray.arguments[i];
}
var isnMonths=new initArray("Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre");
var isnDays= new initArray("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche");
today=new Date();
// fixes a Netscape 2 and 3 bug
function getFullYear(d) { // d is a date object
 yr = d.getYear();
 if (yr < 1000)
  yr+=1900;
 return yr;
}
function rechercher() {
b=this.SearchInputForm.querytext.value;
if ( b == "" ) {
	alert('Veuillez entrer les critères de recherche.');
	this.SearchInputForm.querytext.focus();
	} else {
	var url = dburl() ;
	window.location = url + '/ViewSearch?SearchView&query='+b;
	}
}
function AddFavo(url,titre) {
		if ((navigator.appName.indexOf("Microsoft",0) >= 0) && (parseInt(navigator.appVersion) >= 4)) {
			window.external.AddFavorite(url,titre);
		} else {
			alert("Cette fonction n'est disponible que pour les navigateurs Internet Explorer.")
		}
}	
function newWindow(url, height, width,scroll,resiz,menu,tool,status,location,dir,nameW) {
 if (nameW==""){
nameW='noname'
}
if (url.substring(0,4)!="http"){
url = dburl() + '/' + url
}
 if (navigator.appVersion.indexOf('4') != -1) {
 // Vars for centering the new window on Version 4 Browsers
 xTop = screen.width/2 - (width/2);
 yTop = screen.height/2 - (height/2);
 window.open(url, nameW, 'height='+height+',width='+width+',scrollbars='+scroll+',resizable='+resiz+',menubar='+menu+',toolbar='+tool+',status='+status+',location='+location+',directories='+dir+',left=' + xTop + ',top=' + yTop + '');
 } else {
  window.open(url, nameW, 'height='+height+',width='+width+',scrollbars='+scroll+',resizable='+resiz+',menubar='+menu+',toolbar='+tool+',status='+status+',location='+location+',directories='+dir+',left=150,top=200');
 }
}
function dburl() {
//	return location.pathname.split('.nsf')[0] + '.nsf' ;
	return 'http://www.moulindelacoudre.com/moulin/moulin.nsf' ;
}
function logoutnow() {
	var url = dburl() ;
	window.top.location.href = url + '?logout' ;
}
function printme() {
	var url = window.top.location.href;
	var id = url.substr(url.length-32);
	window.top.location.href = dburl()+'/viewprint/'+id;
}
function ancre(nomancre)  { 
    	  var url = window.location + '';
	  var tmp = url.indexOf("#",7) ;
	  
	  if (tmp == -1 )
	  {
		url = url + nomancre;
	  }
	  else
	  {
		url = url.substring(0,tmp) + nomancre;
	  };
	  window.location.replace(url);
} 
